:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-2: #273449;
  --fg: #e8eef5;
  --muted: #94a3b8;
  --accent: #3b82f6;
  --accent-h: #2f6fd6;
  --ok: #22c55e;
  --err: #ef4444;
  --warn: #f59e0b;
  --border: #334155;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  min-height: 100vh;
}

.view { display: none; }
.view.active { display: block; }

/* --- ログイン --- */
#login-view.active { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box {
  background: var(--panel);
  padding: 2.5rem;
  border-radius: 16px;
  width: min(90vw, 380px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
.login-box h1 { font-size: 1.4rem; margin-bottom: 1.5rem; text-align: center; }
.login-box label { display: block; color: var(--muted); margin-bottom: 0.5rem; }
.login-box input {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  margin-bottom: 1.2rem;
}
.login-box input:focus { outline: none; border-color: var(--accent); }
.login-box button {
  width: 100%;
  padding: 0.85rem;
  font-size: 1.05rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.login-box button:hover { background: var(--accent-h); }
.error-msg { color: var(--err); font-size: 0.9rem; margin-bottom: 1rem; }

/* --- トップバー --- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h1 { font-size: 1.2rem; }
.topbar-right { display: flex; align-items: center; gap: 1rem; }
.conn-dot { font-size: 0.85rem; color: var(--warn); }
.conn-dot.online { color: var(--ok); }
.ghost-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
}
.ghost-btn:hover { color: var(--fg); border-color: var(--muted); }

/* --- 店舗グリッド --- */
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
  padding: 1.5rem;
}
.guest-section { border-top: 1px solid var(--border); }
.guest-section[hidden] { display: none; }
.section-title {
  font-size: 1.05rem;
  color: var(--warn);
  padding: 1.2rem 1.5rem 0;
}
.guest-section .store-card { border-color: rgba(245,158,11,0.4); }
.store-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.2rem;
  transition: border-color 0.2s;
}
.store-card.offline { opacity: 0.72; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}
.store-name { font-size: 1.1rem; font-weight: 600; }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.off { background: #64748b; }
.preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-ph { color: #64748b; font-size: 0.85rem; }
.card-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.1rem; }
.badge {
  font-size: 0.78rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
}
.badge.ok { background: rgba(34,197,94,0.15); color: var(--ok); }
.badge.err { background: rgba(239,68,68,0.15); color: var(--err); }
.badge.audio { background: rgba(245,158,11,0.15); color: var(--warn); }
.badge.muted { background: var(--panel-2); color: var(--muted); }
.badge.state { background: rgba(59,130,246,0.15); color: var(--accent); }
.call-btn {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.call-btn:hover:not(:disabled) { background: var(--accent-h); }
.call-btn:disabled { background: var(--panel-2); color: #64748b; cursor: not-allowed; }
.card-actions { display: flex; gap: 0.5rem; }
.card-actions .call-btn { flex: 1; }
.chat-btn {
  position: relative;
  width: 3rem;
  flex-shrink: 0;
  border: none;
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--fg);
  font-size: 1.15rem;
  cursor: pointer;
}
.chat-btn:hover { background: #334155; }
.unread-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--err);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.unread-badge[hidden] { display: none; }

/* --- 通話ステージ --- */
#call-view.active { display: block; }
.call-stage {
  position: fixed;
  inset: 0;
  background: #000;
}
#remote-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.remote-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: #000;
  color: #8a97a6;
  z-index: 1;
}
.remote-placeholder[hidden] { display: none; }
.remote-placeholder .rp-icon { font-size: clamp(3rem, 9vw, 5.5rem); opacity: 0.8; }
.remote-placeholder p { font-size: clamp(1.1rem, 3vw, 1.7rem); }
.pip {
  position: absolute;
  right: 1.2rem;
  top: 1.2rem;
  width: min(22vw, 240px);
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.6);
  box-shadow: 0 4px 16px rgba(0,0,0,0.6);
  transform: scaleX(-1);
  z-index: 3;
}

/* 接続中オーバーレイ(カウントダウン終了後、映像が来るまで)*/
.connecting-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  background: #000;
  z-index: 2;
  color: var(--muted);
  font-size: 1.3rem;
}
/* display:flex を持つオーバーレイは hidden 属性が効かないため明示的に打ち消す */
.connecting-overlay[hidden],
.call-countdown[hidden],
.call-controls[hidden] { display: none; }
.connecting-overlay .spinner {
  width: 3.2rem;
  height: 3.2rem;
  border: 4px solid rgba(255,255,255,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* カウントダウン */
.call-countdown {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: linear-gradient(160deg, #1e3a5f, #0b1220);
  z-index: 4;
}
.cc-store { font-size: 1.6rem; font-weight: 600; }
.cc-num {
  font-size: clamp(7rem, 22vw, 16rem);
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  animation: pop 1s ease-out;
}
@keyframes pop {
  0% { transform: scale(0.4); opacity: 0.2; }
  40% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.cc-label { color: var(--muted); font-size: 1.1rem; }

/* 通話コントロール */
.call-controls {
  position: absolute;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  background: rgba(15,23,42,0.82);
  padding: 1rem 1.6rem;
  border-radius: 16px;
  backdrop-filter: blur(8px);
  z-index: 5;
}
.call-info { display: flex; align-items: center; gap: 1rem; font-size: 1.05rem; }
.timer { font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 600; }
.ctrl-buttons { display: flex; gap: 0.8rem; }
.ctrl-btn {
  padding: 0.7rem 1.4rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--fg);
  cursor: pointer;
}
.ctrl-btn:hover { background: #334155; }
.ctrl-btn.active { background: var(--warn); color: #000; }
.ctrl-btn.danger { background: var(--err); color: #fff; }
.ctrl-btn.danger:hover { background: #dc2626; }
.danger-btn {
  padding: 0.7rem 1.6rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  background: var(--err);
  color: #fff;
  cursor: pointer;
}

/* トースト */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--panel);
  color: var(--fg);
  padding: 0.9rem 1.4rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: var(--err); }

/* --- 設定モーダル --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 1rem;
  z-index: 60;
  overflow-y: auto;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: min(92vw, 640px);
  padding: 1.5rem 1.6rem 1.8rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}
.modal-head h2 { font-size: 1.25rem; }
.modal-section { margin-bottom: 1.6rem; }
.modal-section h3 {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}
.primary-btn {
  padding: 0.6rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}
.primary-btn:hover { background: var(--accent-h); }
.create-row { display: flex; gap: 0.6rem; }
.create-row input {
  flex: 1;
  padding: 0.6rem 0.8rem;
  font-size: 0.95rem;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
}
.create-row input:focus { outline: none; border-color: var(--accent); }
.new-store-result {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 10px;
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.4);
}
.nsr-label { color: var(--ok); font-size: 0.9rem; margin-bottom: 0.6rem; }
.url-row { display: flex; gap: 0.6rem; }
.url-row input {
  flex: 1;
  padding: 0.55rem 0.7rem;
  font-size: 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  font-family: ui-monospace, monospace;
}
.settings-store-list { display: flex; flex-direction: column; gap: 0.7rem; }
.muted-note { color: var(--muted); font-size: 0.9rem; }
.store-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
}
.sr-info { flex: 1; min-width: 0; }
.sr-name { font-weight: 600; margin-bottom: 0.15rem; }
.sr-id { font-size: 0.78rem; color: var(--muted); margin-bottom: 0.4rem; }
.sr-url {
  width: 100%;
  padding: 0.4rem 0.55rem;
  font-size: 0.78rem;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  font-family: ui-monospace, monospace;
}
.sr-actions { display: flex; flex-direction: column; gap: 0.5rem; }
.sr-actions .primary-btn,
.sr-actions .danger-btn { font-size: 0.85rem; padding: 0.45rem 0.9rem; }
.sr-urlrow { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.35rem; }
.url-tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  flex-shrink: 0;
}
.url-row { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }

@media (max-width: 520px) {
  .store-row { flex-direction: column; align-items: stretch; }
  .sr-actions { flex-direction: row; flex-wrap: wrap; }
}

/* --- 広告管理 --- */
.ads-list { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 0.8rem; }
.ad-item {
  position: relative;
  width: 120px;
}
.ad-thumb {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}
.ad-del {
  width: 100%;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  padding: 0.3rem;
}

/* --- チャットパネル --- */
.chat-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2,6,23,0.5);
  z-index: 70;
}
.chat-backdrop[hidden] { display: none; }
.chat-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100vw);
  background: var(--panel);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 71;
  box-shadow: -8px 0 30px rgba(0,0,0,0.5);
}
.chat-panel[hidden] { display: none; }
.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.msg-row { display: flex; }
.msg-row.mine { justify-content: flex-end; }
.msg-row.theirs { justify-content: flex-start; }
.bubble { max-width: 78%; padding: 0.55rem 0.75rem; border-radius: 14px; }
.msg-row.mine .bubble { background: var(--accent); border-bottom-right-radius: 4px; }
.msg-row.theirs .bubble { background: var(--panel-2); border-bottom-left-radius: 4px; }
.msg-text { white-space: pre-wrap; word-break: break-word; line-height: 1.4; }
.msg-image { max-width: 100%; max-height: 240px; border-radius: 8px; display: block; cursor: pointer; }
.msg-file {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  text-decoration: none;
  padding: 0.2rem 0;
  word-break: break-all;
}
.msg-file .file-icon { font-size: 1.5rem; flex-shrink: 0; }
.msg-file .file-label { text-decoration: underline; }
.msg-time { font-size: 0.68rem; color: rgba(255,255,255,0.6); text-align: right; margin-top: 0.25rem; }
.chat-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.7rem;
  border-top: 1px solid var(--border);
  align-items: center;
}
.icon-btn {
  border: none;
  background: var(--panel-2);
  color: var(--fg);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
}
.chat-bar input[type="text"] {
  flex: 1;
  padding: 0.6rem 0.9rem;
  font-size: 0.95rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
}
.chat-bar input[type="text"]:focus { outline: none; border-color: var(--accent); }

/* --- 画像拡大 --- */
.image-viewer {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 1rem;
}
.image-viewer[hidden] { display: none; }
.image-viewer img { max-width: 100%; max-height: 100%; }

/* --- 字幕(相談員側)--- */
.caption-overlay {
  position: absolute;
  left: 50%;
  bottom: 190px;
  transform: translateX(-50%);
  max-width: min(90%, 900px);
  z-index: 5;
  background: rgba(0,0,0,0.7);
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  text-align: center;
}
.caption-overlay[hidden] { display: none; }
.caption-label { color: var(--muted); font-size: 0.78rem; margin-right: 0.4rem; }
.caption-overlay-text { color: #fff; font-size: 1.1rem; font-weight: 600; }
.caption-overlay-text.interim { color: #b9c6d6; font-weight: 400; }

.caption-controls { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.caption-manual { display: flex; gap: 0.5rem; width: 100%; }
.caption-manual input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.8rem;
  font-size: 0.95rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
}
.caption-manual input:focus { outline: none; border-color: var(--accent); }
.ctrl-btn.active { background: var(--accent); color: #fff; }

.caption-history {
  position: fixed;
  right: 1.2rem;
  top: 4.5rem;
  width: min(380px, 90vw);
  max-height: 70vh;
  background: rgba(15,23,42,0.97);
  border: 1px solid var(--border);
  border-radius: 12px;
  z-index: 90; /* 通話画面・ダッシュボードどちらの上にも出す */
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
}
.caption-history[hidden] { display: none; }
.ch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.ch-head-actions { display: flex; gap: 0.4rem; }
.ch-list { overflow-y: auto; padding: 0.6rem 0.9rem; display: flex; flex-direction: column; gap: 0.5rem; }
.ch-item {
  font-size: 0.9rem;
  line-height: 1.5;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem;
  position: relative;
}
.ch-time { color: var(--muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.ch-manual { background: var(--warn); color: #000; font-size: 0.68rem; padding: 0 0.35rem; border-radius: 4px; }
.ch-text { flex: 1; min-width: 0; word-break: break-word; }
.ch-copy {
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--muted);
  font-size: 0.7rem;
  padding: 0.1rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.ch-item:hover .ch-copy,
.ch-copy:focus { opacity: 1; }
.ch-copy.copied { color: var(--ok); border-color: var(--ok); opacity: 1; }
.ctrl-btn.copied { color: var(--ok); }
.ch-empty { color: var(--muted); font-size: 0.85rem; text-align: center; padding: 1rem 0; }
/* タッチ端末ではホバーが無いので常時表示 */
@media (hover: none) { .ch-copy { opacity: 1; } }

/* --- 対応可能トグル --- */
.avail-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem 0.35rem 0.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.avail-toggle .avail-dot {
  width: 26px;
  height: 16px;
  border-radius: 999px;
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s;
}
.avail-toggle .avail-dot::after {
  content: '';
  position: absolute;
  top: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.2s;
}
.avail-toggle.on {
  background: rgba(34,197,94,0.18);
  color: var(--ok);
  border-color: rgba(34,197,94,0.5);
}
.avail-toggle.on .avail-dot { background: var(--ok); }
.avail-toggle.on .avail-dot::after { left: 12px; }
.avail-toggle.off {
  background: rgba(148,163,184,0.15);
  color: var(--muted);
  border-color: var(--border);
}
.avail-toggle.off .avail-dot { background: #64748b; }
.avail-toggle.off .avail-dot::after { left: 2px; }

/* --- 通話履歴モーダル --- */
.calllog-modal { width: min(92vw, 720px); }
.calllog-list { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.8rem; max-height: 65vh; overflow-y: auto; }
.calllog-row { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--panel-2); }
.clr-head {
  width: 100%;
  display: grid;
  grid-template-columns: 84px 1fr 84px 96px 88px;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
  background: transparent;
  border: none;
  color: var(--fg);
  cursor: pointer;
  text-align: left;
  font-size: 0.9rem;
}
.clr-head:hover { background: rgba(255,255,255,0.03); }
.clr-head.open { background: rgba(59,130,246,0.1); }
.clr-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.clr-store { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clr-dur { color: var(--muted); font-variant-numeric: tabular-nums; }
.clr-reason { color: var(--muted); }
.clr-cap { text-align: right; font-size: 0.82rem; }
.clr-nocap { color: #64748b; }
.clr-detail { padding: 0.6rem 0.9rem; border-top: 1px solid var(--border); background: var(--bg); }
.clr-detail[hidden] { display: none; }
.clr-nocap-detail { color: var(--muted); font-size: 0.9rem; }
.clr-cap-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; font-size: 0.85rem; color: var(--muted); }
.clr-cap-list { display: flex; flex-direction: column; gap: 0.4rem; }

@media (max-width: 560px) {
  .clr-head { grid-template-columns: 1fr auto; grid-auto-rows: auto; row-gap: 0.2rem; }
  .clr-store { grid-column: 1 / 2; }
  .clr-cap { grid-column: 2 / 3; grid-row: 1 / 2; }
  .clr-time, .clr-dur, .clr-reason { grid-column: 1 / 3; font-size: 0.8rem; }
}
