/* Radar interface */

:root {
  --bg: #f4f6f7;
  --surface: #ffffff;
  --surface-2: #eef2f3;
  --line: #dde3e6;
  --text: #15201f;
  --muted: #5d6b6d;
  --faint: #8a979a;
  --accent: #0b7a83;
  --accent-soft: #e0f1f2;
  --accent-text: #ffffff;
  --up: #e8590c;
  --down: #5b6cff;
  --warn: #b45309;
  --warn-soft: #fdf0dd;
  --danger: #c0392b;
  --danger-soft: #fbe6e3;
  --ok: #15803d;
  --ok-soft: #e1f3e6;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 16px rgba(16, 24, 40, 0.05);
  --radius: 12px;
  --font-head: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1415;
    --surface: #161e20;
    --surface-2: #1d272a;
    --line: #2a3639;
    --text: #e6eeef;
    --muted: #9aa9ac;
    --faint: #6d7c7f;
    --accent: #2bb3bd;
    --accent-soft: #123236;
    --accent-text: #061314;
    --up: #ff8a3d;
    --down: #8d99ff;
    --warn: #f0a24a;
    --warn-soft: #3a2a14;
    --danger: #ef6b5b;
    --danger-soft: #3b1c18;
    --ok: #4ac27a;
    --ok-soft: #13301f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-head); margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 26px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
.mono { font-family: var(--font-mono); font-size: 0.92em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.hidden { display: none !important; }

/* ---- Frame ---- */
.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; font-family: var(--font-head); font-weight: 700; font-size: 19px; }
.brand-mark { width: 30px; height: 30px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px;
  color: var(--muted); font-weight: 500; text-decoration: none;
}
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav-count { margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--faint); }
.sidebar-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.sidebar-foot .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 500; }
.main { padding: 28px 32px 60px; min-width: 0; }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .grow { flex: 1; }
.page-sub { color: var(--muted); margin-top: 2px; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0 8px 0 0; font-size: 0; }
  .nav { flex-direction: row; overflow-x: auto; }
  .nav a { padding: 8px 10px; white-space: nowrap; }
  .nav-count { display: none; }
  .sidebar-foot { display: none; }
  .main { padding: 18px 16px 50px; }
}

/* ---- Buttons, fields ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: 600 13.5px var(--font-body); cursor: pointer;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--danger); }
.btn.small { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.icon { width: 36px; padding: 0; }
.btn:disabled { opacity: 0.55; cursor: default; }
input, textarea, select {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
textarea { resize: vertical; min-height: 80px; }
label.field { display: grid; gap: 6px; font-weight: 600; font-size: 13px; }
label.field .hint { font-weight: 400; color: var(--muted); }
.search { position: relative; min-width: 220px; flex: 1; max-width: 360px; }
.search input { padding-left: 34px; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); }

.segmented { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented button {
  border: 0; background: transparent; color: var(--muted); font: 600 13px var(--font-body);
  padding: 6px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap;
}
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---- Kartlar ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-head .grow { flex: 1; }
.empty { padding: 34px 18px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--text); font-family: var(--font-head); font-size: 16px; margin-bottom: 4px; }

/* ---- Tags and status ---- */
.tag {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 99px;
  font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text); border: 1px solid transparent;
  white-space: nowrap; cursor: default;
}
.tag .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.tag button { border: 0; background: none; padding: 0; margin-left: 2px; color: var(--faint); cursor: pointer; font-size: 14px; line-height: 1; }
.tag button:hover { color: var(--danger); }
.tag.clickable { cursor: pointer; }
.tag.clickable:hover { border-color: var(--line); }
.tag.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em; }
.pill.live { background: var(--ok-soft); color: var(--ok); }
.pill.pending { background: var(--surface-2); color: var(--muted); }
.pill.removed { background: var(--danger-soft); color: var(--danger); }
.pill.st-idea { background: var(--surface-2); color: var(--muted); }
.pill.st-prototype { background: #e7ecff; color: #3b4bd8; }
.pill.st-test { background: var(--warn-soft); color: var(--warn); }
.pill.st-production { background: var(--ok-soft); color: var(--ok); }
.pill.st-shelved { background: var(--surface-2); color: var(--faint); text-decoration: line-through; }
@media (prefers-color-scheme: dark) { .pill.st-prototype { background: #1d2450; color: #9aa6ff; } }
.store-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.store-badge svg { width: 13px; height: 13px; }

/* ---- Game list ---- */
.games-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
@media (max-width: 1200px) { .games-layout { grid-template-columns: 1fr; } .games-layout > aside { display: none; } }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.tag-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.game-card { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 14px; color: inherit; text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
.game-card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.game-card .info { min-width: 0; display: grid; gap: 4px; }
.game-card .title { font-weight: 700; font-family: var(--font-head); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-card .dev { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-card .stats { display: flex; gap: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.game-card .last { font-size: 12px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 7px; margin-top: 4px; grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; }
.game-card .last.warn { color: var(--warn); }
.icon { width: 56px; height: 56px; border-radius: 13px; background: var(--surface-2); object-fit: cover; border: 1px solid var(--line); }
.icon.sm { width: 32px; height: 32px; border-radius: 8px; }
.icon.xs { width: 22px; height: 22px; border-radius: 6px; }
.icon.lg { width: 96px; height: 96px; border-radius: 22px; }
.icon-ph { display: grid; place-items: center; color: var(--faint); font-family: var(--font-head); font-weight: 700; }

/* ---- Feed ---- */
.feed { display: grid; }
.feed-item { display: grid; grid-template-columns: 32px 1fr; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.feed-item:last-child { border-bottom: 0; }
.feed-item:hover { background: var(--surface-2); text-decoration: none; }
.feed-item .what { font-size: 13px; }
.feed-item .what b { font-weight: 600; }
.feed-item .when { font-size: 11.5px; color: var(--faint); }
.feed-day { padding: 10px 16px 6px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--faint); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.feed-item.alert .what b { color: var(--warn); }

/* ---- Game page ---- */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; margin-bottom: 14px; }
.back svg { width: 16px; height: 16px; }
.hero { display: grid; grid-template-columns: 96px 1fr auto; gap: 20px; align-items: center; padding: 20px; }
.hero h1 { font-size: 24px; }
.hero .dev { color: var(--muted); margin-top: 2px; }
.hero .meta-line { display: flex; gap: 10px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.hero-actions { display: flex; gap: 8px; align-self: start; }
@media (max-width: 700px) { .hero { grid-template-columns: 64px 1fr; } .hero .icon.lg { width: 64px; height: 64px; border-radius: 15px; } .hero-actions { grid-column: 1 / -1; } }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); border-top: 1px solid var(--line); }
.stat { padding: 12px 20px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat .k { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.stat .v { font-family: var(--font-head); font-weight: 700; font-size: 18px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; margin-top: 18px; align-items: start; }
.detail-grid > div { display: grid; gap: 18px; min-width: 0; grid-template-columns: minmax(0, 1fr); }
.detail-grid > div > *, .idea-side > * { min-width: 0; }
@media (max-width: 1100px) { .detail-grid { grid-template-columns: 1fr; } }
.tag-editor { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line); }
.tag-editor input { width: 180px; height: 28px; padding: 4px 10px; font-size: 12.5px; }

.timeline { display: grid; }
.tl-item { display: grid; grid-template-columns: 110px 1fr; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.tl-item:last-child { border-bottom: 0; }
.tl-item .when { font-size: 12px; color: var(--muted); }
.tl-item .field { font-weight: 600; }
.tl-item.alert .field { color: var(--warn); }
.tl-item .diff { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 3px; font-size: 13px; }
.tl-item .old { color: var(--faint); text-decoration: line-through; word-break: break-word; }
.tl-item .new { word-break: break-word; }
.tl-item details { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.tl-item details p { white-space: pre-wrap; max-height: 240px; overflow: auto; background: var(--surface-2); padding: 10px; border-radius: 8px; margin: 6px 0 0; }

.shot-set { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.shot-set:last-child { border-bottom: 0; }
.shot-set .range { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.shot-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.shot-strip img { height: 190px; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; background: var(--surface-2); flex: none; }

.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; padding: 16px 18px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; min-width: 0; }

.chart { padding: 14px 18px 10px; }
.chart svg { width: 100%; height: 120px; display: block; }
.chart .axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); margin-top: 4px; }

/* ---- Notes ---- */
.note-form { display: grid; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.note-form textarea { min-height: 64px; }
.note-form .row { display: flex; justify-content: flex-end; }
.note { padding: 12px 18px; border-bottom: 1px solid var(--line); }
.note:last-child { border-bottom: 0; }
.note .who { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.note .who button { margin-left: auto; border: 0; background: none; color: var(--faint); cursor: pointer; font-size: 12px; }
.note .who button:hover { color: var(--danger); }
.note .body { white-space: pre-wrap; margin-top: 3px; word-break: break-word; }

/* ---- Idea board ---- */
.idea-list { display: grid; gap: 10px; }
.idea-row { display: grid; grid-template-columns: 52px 76px 1fr auto; gap: 14px; padding: 12px 16px 12px 10px; align-items: center; }
.idea-row:hover { border-color: var(--accent); }
.vote { display: grid; justify-items: center; gap: 0; }
.vote button {
  width: 32px; height: 26px; border: 0; background: none; cursor: pointer; color: var(--faint);
  display: grid; place-items: center; border-radius: 6px;
}
.vote button svg { width: 18px; height: 18px; }
.vote button:hover { background: var(--surface-2); }
.vote button.up.on { color: var(--up); }
.vote button.down.on { color: var(--down); }
.vote .score { font-family: var(--font-head); font-weight: 700; font-size: 16px; line-height: 1.2; }
.vote .score.pos { color: var(--up); }
.vote .score.neg { color: var(--down); }
.cover { width: 76px; height: 104px; border-radius: 9px; object-fit: cover; object-position: top; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--faint); font-family: var(--font-head); font-weight: 700; font-size: 22px; }
.idea-row .body { min-width: 0; display: grid; gap: 5px; color: inherit; text-decoration: none; }
.idea-row .body:hover { text-decoration: none; }
.idea-row .title-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.idea-row .title { font-family: var(--font-head); font-weight: 700; font-size: 16px; }
.idea-row .desc { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.idea-row .meta { display: flex; gap: 12px; align-items: center; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.idea-row .meta span { display: inline-flex; align-items: center; gap: 4px; }
.idea-row .meta svg { width: 14px; height: 14px; }
.age { font-weight: 600; }
.age.fresh { color: var(--ok); }
.age.old { color: var(--faint); }
.similar-icons { display: inline-flex; align-items: center; gap: 3px; }

.idea-layout { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 1000px) { .idea-layout { grid-template-columns: 1fr; } }
.phone {
  position: sticky; top: 20px; width: 100%; max-width: 380px; aspect-ratio: 1080 / 2340; margin: 0 auto;
  background: #000; border-radius: 34px; padding: 10px; box-shadow: var(--shadow), 0 0 0 1px var(--line);
}
.phone-screen { width: 100%; height: 100%; border-radius: 26px; overflow: hidden; background: #111; position: relative; }
.phone-screen iframe { width: 100%; height: 100%; border: 0; display: block; background: #000; }
.phone-screen .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0.55; }
.phone-screen .play { position: absolute; inset: 0; display: grid; place-items: center; }
.phone-screen .play button { height: 52px; padding: 0 26px; border-radius: 99px; font-size: 16px; }
.phone-bar { display: flex; gap: 8px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.idea-side { display: grid; gap: 18px; min-width: 0; grid-template-columns: minmax(0, 1fr); }
.idea-title { display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: start; padding: 18px 18px 14px 10px; }
.idea-title h1 { font-size: 24px; }
.idea-title .desc { color: var(--muted); margin-top: 6px; white-space: pre-wrap; }
.status-row { display: flex; gap: 10px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.version { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.version:last-child { border-bottom: 0; }
.version .num { font-family: var(--font-mono); font-weight: 700; color: var(--accent); }
.version.current { background: var(--accent-soft); }
.similar-item { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.similar-item:last-child { border-bottom: 0; }
.similar-item a.name { font-weight: 600; color: var(--text); }
.similar-item .sub { font-size: 12px; color: var(--muted); }
.add-row { display: flex; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.add-row input { flex: 1; }

/* ---- Tables ---- */
table.list { width: 100%; border-collapse: collapse; font-size: 13px; }
table.list th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 10px 18px; border-bottom: 1px solid var(--line); }
table.list td { padding: 10px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .admin-grid { grid-template-columns: 1fr; } }
.swatch { width: 26px; height: 26px; padding: 0; border-radius: 6px; border: 1px solid var(--line); cursor: pointer; }

/* ---- Modal, toast, lightbox ---- */
dialog.modal {
  border: 1px solid var(--line); border-radius: 16px; padding: 0; width: min(520px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
dialog.modal::backdrop { background: rgba(10, 18, 20, 0.45); }
.modal-head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { flex: 1; }
.modal-head button { border: 0; background: none; color: var(--muted); cursor: pointer; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; }
.modal-head button:hover { background: var(--surface-2); }
.modal-body { padding: 18px 20px; display: grid; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.form-error { color: var(--danger); font-size: 13px; }
.dropzone { border: 2px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); cursor: pointer; }
.dropzone.over, .dropzone:hover { border-color: var(--accent); color: var(--accent); }
.dropzone strong { display: block; color: var(--text); }

.toasts { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 8px; z-index: 100; }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 500; box-shadow: var(--shadow); animation: toast-in 0.2s ease-out; max-width: 360px; }
.toast.error { background: var(--danger); color: #fff; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.85); display: grid; place-items: center; z-index: 90; cursor: zoom-out; }
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 10px; }

.loading { padding: 50px; text-align: center; color: var(--muted); }

/* ---- Sign-in ---- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 20% -10%, var(--accent-soft), transparent), var(--bg); }
.login-card { width: min(400px, 100%); padding: 32px 28px; display: grid; gap: 18px; }
.login-card .brand { padding: 0; font-size: 24px; }
.login-card .brand-mark { width: 38px; height: 38px; }
.login-card p { margin: 0; color: var(--muted); }
.login-card .divider { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; }
.login-card .divider::before, .login-card .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.login-card form { display: grid; gap: 10px; }
.dev-badge { font-size: 11px; font-weight: 700; color: var(--warn); background: var(--warn-soft); padding: 2px 8px; border-radius: 6px; justify-self: start; }

/* ---- Utilities ---- */
.small { font-size: 12px; }
.min0 { min-width: 0; }
.grow { flex: 1; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.pos { color: var(--ok); font-weight: 600; }
.error-text { color: var(--danger); font-size: 12px; }
.btn.on-accent { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.select-wrap { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.select-wrap select { width: auto; height: 36px; padding: 0 30px 0 10px; font-size: 13px; }
.filters.inner { padding: 12px 18px 0; margin-bottom: 4px; }
.card-head.wrap { flex-wrap: wrap; }
.stat .v.accent { color: var(--accent); }

/* ---- Favorites and badges ---- */
.star { border: 0; background: none; padding: 2px; color: var(--faint); cursor: pointer; display: inline-grid; place-items: center; border-radius: 6px; flex: none; vertical-align: middle; }
.star svg { width: 20px; height: 20px; }
.star.small svg { width: 16px; height: 16px; }
.star:hover { color: #f5a524; background: var(--surface-2); }
.star.on { color: #f5a524; }
h1 .star svg { width: 22px; height: 22px; }
.badge-new { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 5px; background: #e8590c; color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: 0.05em; margin-left: 6px; vertical-align: 1px; }
.new-dot { width: 7px; height: 7px; border-radius: 50%; background: #e8590c; display: inline-block; margin-left: 5px; }
.pub-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; background: var(--accent-soft); color: var(--accent); white-space: nowrap; margin: 1px 4px 1px 0; text-decoration: none; }
.pub-chip:hover { text-decoration: none; filter: brightness(1.05); }
.source-badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.source-badge svg { width: 12px; height: 12px; }
.title-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.title-row .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }

/* ---- Publishers ---- */
.publisher-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.publisher-card { padding: 16px; display: grid; gap: 12px; color: inherit; text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
.publisher-card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.publisher-top { display: flex; gap: 12px; align-items: center; }
.publisher-card .title { font-family: var(--font-head); font-weight: 700; font-size: 16px; }
.publisher-mark { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), #5b6cff); color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 20px; flex: none; }
.publisher-mark.large { width: 96px; height: 96px; border-radius: 22px; font-size: 40px; }
.publisher-mark.small { width: 28px; height: 28px; border-radius: 8px; font-size: 13px; }
.publisher-icons { display: flex; gap: 6px; min-height: 32px; align-items: center; }
.publisher-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); padding-top: 10px; }
.publisher-stats div { display: grid; }
.publisher-stats b { font-family: var(--font-head); font-size: 18px; }
.publisher-stats span { font-size: 11.5px; color: var(--muted); }
.publisher-stats .has-new b { color: #e8590c; }
.new-strip { margin-top: 18px; border-color: #e8590c66; }

/* ---- Game tables ---- */
.table-wrap { overflow-x: auto; }
.games-table td { padding: 8px 14px; }
.games-table th { padding: 10px 14px; }
.games-table th.num, .games-table td.num { text-align: right; }
.game-cell { display: flex; gap: 10px; align-items: center; min-width: 220px; }
.game-cell .name { font-weight: 600; color: var(--text); }
.game-cell .min0 { flex: 1; }
.rank { font-family: var(--font-mono); font-weight: 700; }
.move { display: inline-flex; align-items: center; gap: 1px; font-size: 11px; font-weight: 700; margin-left: 5px; }
.move svg { width: 11px; height: 11px; }
.move.up { color: var(--ok); }
.move.down { color: var(--danger); }
.move.new { color: #e8590c; text-transform: uppercase; font-size: 10px; }

/* ---- Insights ---- */
/* Column flow so short cards stack under each other instead of leaving gaps. */
.insight-grid { columns: 3 300px; column-gap: 14px; margin-bottom: 4px; }
.insight-grid > section { break-inside: avoid; display: inline-block; width: 100%; margin-bottom: 14px; }
.mini-list { display: grid; }
.mini-row { display: flex; gap: 10px; align-items: center; padding: 8px 16px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.mini-row:last-child { border-bottom: 0; }
.mini-row:hover { background: var(--surface-2); text-decoration: none; }
.mini-row .name { font-weight: 600; font-size: 13px; }
.mini-row .metric { text-align: right; font-size: 12px; white-space: nowrap; }
.preset-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 99px; height: 32px; padding: 0 14px; font: 600 13px var(--font-body); cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.finder-summary { padding: 0 18px 10px; }
.finder .card-pad { padding-bottom: 4px; }
.chart-ranks { display: grid; }
.chart-rank { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center; padding: 9px 18px; border-bottom: 1px solid var(--line); font-size: 13px; }
.chart-rank:last-child { border-bottom: 0; }
.chart-rank .faint { grid-column: 2 / -1; }

/* ---- Ideas and admin extras ---- */
.no-build { color: #fff; font-weight: 600; background: rgba(0, 0, 0, 0.55); padding: 10px 16px; border-radius: 10px; }
.slack-setup ol { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.slack-setup p { margin: 0; }
code { font-family: var(--font-mono); font-size: 0.9em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.token-row { padding: 10px 0; border-bottom: 0; }
.token-row input { font-family: var(--font-mono); }

/* ---- Slack conversation ---- */
.slack-thread { display: grid; padding: 6px 0; }
.slack-message { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 10px 18px; }
.slack-message.reply { padding-left: 42px; grid-template-columns: 28px 1fr; }
.slack-message.post { border-bottom: 1px solid var(--line); }
.slack-avatar { width: 34px; height: 34px; border-radius: 8px; background: #4a154b; color: #fff; display: grid; place-items: center; font-weight: 700; font-family: var(--font-head); }
.slack-message.reply .slack-avatar { width: 28px; height: 28px; font-size: 12px; background: #611f69; }
.slack-meta { display: flex; gap: 8px; align-items: baseline; font-size: 13px; flex-wrap: wrap; }
.slack-meta .faint { font-size: 11.5px; }
.slack-text { white-space: pre-wrap; word-break: break-word; margin-top: 2px; }
.file-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.file-chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 6px; background: var(--surface-2); font-size: 12px; color: var(--muted); }
.file-chip svg { width: 13px; height: 13px; }


/* ---- Studios ---- */
.studio-mark { background: linear-gradient(135deg, #7c3aed, #e8590c); }
.studio-row { padding: 12px 18px; border-bottom: 1px solid var(--line); }
.studio-row:last-child { border-bottom: 0; }
.studio-row .name { font-weight: 700; color: var(--text); }
.studio-games { display: grid; gap: 4px; margin-top: 6px; }
.studio-game { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; text-decoration: none; }
.studio-game:hover { text-decoration: none; color: var(--accent); }
.studio-game .faint { margin-left: auto; white-space: nowrap; }

.load-more { display: flex; justify-content: center; padding: 18px 0; }

/* ---- Dashboard ---- */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.dash-widget.wide { grid-column: span 2; }
@media (max-width: 760px) { .dash-widget.wide { grid-column: auto; } }
.dash-widget.editing { outline: 2px dashed var(--line); outline-offset: 2px; }
.widget-body { max-height: 460px; overflow: auto; }
.widget-tools { display: flex; gap: 4px; }
.mini-cover { width: 32px; height: 44px; border-radius: 6px; object-fit: cover; object-position: top; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; color: var(--faint); flex: none; }
.widget-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; max-height: 50vh; overflow: auto; }
.widget-choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.widget-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.widget-choice input { width: auto; margin-top: 3px; }


/* ---- Admin ---- */
.tab-bar { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab-bar button { border: 0; background: none; padding: 10px 14px; font: 600 14px var(--font-body); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab-bar button:hover { color: var(--text); }
.tab-bar button.on { color: var(--accent); border-bottom-color: var(--accent); }
.health-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 14px; }
.health { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); border-left: 4px solid var(--line); }
.health.good { border-left-color: var(--ok); }
.health.bad { border-left-color: var(--danger); }
.health .k { font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.health .v { font-family: var(--font-head); font-size: 20px; font-weight: 700; margin: 2px 0; }
.small-grid .health .v { font-size: 17px; }
.warn-box, .ok-box { padding: 12px 16px; margin-bottom: 14px; display: grid; gap: 4px; font-weight: 500; }
.warn-box { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.ok-box { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.job-buttons { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; padding: 14px 18px; }
.job-button { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 12px; cursor: pointer; display: grid; gap: 2px; color: var(--text); font: inherit; }
.job-button:hover { border-color: var(--accent); background: var(--accent-soft); }
.job-button span { font-size: 12px; color: var(--muted); }
.admin-grid.single { grid-template-columns: minmax(0, 760px); }
.muted-row td { opacity: 0.45; }
.switch { position: relative; display: inline-block; width: 36px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 99px; cursor: pointer; transition: 0.15s; }
.switch span::before { content: ''; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: 0.15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(16px); }


/* ---- Bell ---- */
.topbar { position: fixed; top: 14px; right: 18px; z-index: 50; }
.bell { position: relative; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); }
.bell:hover { border-color: var(--accent); }
.bell svg { width: 20px; height: 20px; }
.bell-count { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: #e8590c; color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.bell-panel { position: absolute; right: 0; top: 48px; width: min(400px, calc(100vw - 32px)); max-height: 70vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28); overflow: hidden; }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.bell-list { overflow: auto; }
.bell-item { display: flex; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.bell-item:hover { background: var(--surface-2); text-decoration: none; }
.bell-item.unread { background: var(--accent-soft); }
.bell-icon { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; flex: none; color: var(--accent); }
.bell-icon svg { width: 15px; height: 15px; }
.bell-title { display: block; font-weight: 600; font-size: 13px; }
.bell-body { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.5px; color: var(--muted); }
.page-head { padding-right: 56px; }
@media (max-width: 860px) { .topbar { top: 8px; right: 10px; } }

/* ---- Feedback ---- */
.quick-add { display: flex; gap: 8px; padding: 10px; margin-bottom: 14px; }
.quick-add input { flex: 1; border: 0; font-size: 15px; }
.quick-add input:focus { outline: none; }
.quick-add select { width: auto; }
.fb-list { overflow: hidden; }
.fb-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.fb-row:last-child { border-bottom: 0; }
.fb-row:hover { background: var(--surface-2); }
.fb-row.closed .fb-title { color: var(--faint); text-decoration: line-through; }
.fb-main { min-width: 0; color: inherit; text-decoration: none; display: grid; gap: 3px; }
.fb-main:hover { text-decoration: none; }
.fb-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.fb-meta span { display: inline-flex; align-items: center; gap: 3px; }
.status-circle { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--faint); background: none; cursor: pointer; display: grid; place-items: center; padding: 0; color: #fff; position: relative; overflow: hidden; }
.status-circle:hover { border-color: var(--accent); }
.status-circle svg { width: 15px; height: 15px; }
.status-circle.st-doing { border-color: var(--warn); }
.status-circle .half { position: absolute; left: 0; top: 0; bottom: 0; width: 50%; background: var(--warn); }
.status-circle.st-done { border-color: var(--ok); background: var(--ok); }
.status-circle.st-wontfix { border-color: var(--faint); background: var(--faint); }
.type-chip { height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; }
.type-bug { background: var(--danger-soft); color: var(--danger); }
.type-idea { background: var(--accent-soft); color: var(--accent); }
.type-question { background: #ede9fe; color: #6d28d9; }
.type-task { background: var(--surface-2); color: var(--muted); }
@media (prefers-color-scheme: dark) { .type-question { background: #2e1f57; color: #b9a2ff; } }
.pill.st-open { background: var(--surface-2); color: var(--muted); }
.pill.st-doing { background: var(--warn-soft); color: var(--warn); }
.pill.st-done { background: var(--ok-soft); color: var(--ok); }
.pill.st-wontfix { background: var(--surface-2); color: var(--faint); }
.fb-detail-head { display: flex; gap: 14px; align-items: flex-start; padding: 18px; }
.fb-detail-head .status-circle { margin-top: 6px; }
.fb-detail h1 { font-size: 22px; }
.fb-body { white-space: pre-wrap; border-top: 1px solid var(--line); }
.fb-event { padding: 6px 18px 6px 42px; font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }

/* ---- What's new ---- */
.updates { display: grid; gap: 14px; max-width: 860px; }
.update { display: grid; grid-template-columns: 120px 1fr; gap: 18px; padding: 18px; }
.update-date { display: grid; align-content: start; gap: 2px; }
.update-head { display: flex; gap: 8px; align-items: flex-start; }
.update-body { color: var(--text); margin: 6px 0 10px; }
.update-body p { margin: 0 0 8px; }
.update-body ul { margin: 0 0 8px; padding-left: 20px; display: grid; gap: 3px; }
@media (max-width: 640px) { .update { grid-template-columns: 1fr; } }

.publisher-card, .publisher-card > *, .publisher-top .min0 { min-width: 0; }
.publisher-top .faint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab-bar { overflow-y: hidden; }

/* ---- Mix & merge board ---- */
.mix-board { margin-bottom: 16px; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: linear-gradient(180deg, var(--accent-soft), var(--surface) 70px); }
.mix-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 280px); gap: 12px; overflow-x: auto; padding: 14px 18px 16px; }
.mix-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 8px; align-content: start; }
.mix-top { display: flex; gap: 10px; align-items: flex-start; }
.mix-title { font-family: var(--font-head); font-weight: 700; color: var(--text); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mix-facts { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.mix-note { text-align: left; border: 1px dashed transparent; background: var(--surface-2); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; color: var(--text); cursor: pointer; white-space: pre-wrap; }
.mix-note:hover { border-color: var(--accent); }
.mix-note.empty-note { color: var(--faint); border-color: var(--line); }
.mix-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.mix-tools { display: flex; gap: 2px; }
.mix-tools .btn.icon { width: 28px; height: 28px; }
@media (max-width: 860px) { .mix-hint { display: none; } }


/* ---- AI ---- */
.ai-form { display: grid; gap: 10px; padding: 0 18px 18px; }
.ai-results { display: grid; gap: 10px; }
.ai-draft { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; background: var(--surface-2); }
.ai-draft-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ai-draft ul { margin: 2px 0 0; padding-left: 18px; }
.ai-pitch { font-weight: 500; }
.mix-pick { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- Developers under publishers ---- */
.dev-row-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.multi-badge { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11px; font-weight: 700; background: var(--warn-soft); color: var(--warn); white-space: nowrap; }
.multi-text { color: var(--warn); font-weight: 600; }
.multi-banner { margin: 10px 18px 0; padding: 8px 12px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-weight: 600; font-size: 13px; }
.dev-link-form { border-top: 1px solid var(--line); border-bottom: 0; flex-wrap: wrap; }
.dev-link-form input[name=note] { max-width: 200px; }

/* ---- QA fixes ---- */
/* QA-26: readable faint text (small timestamps, sublines, table headers). */
:root { --faint: #6b787b; }
@media (prefers-color-scheme: dark) { :root { --faint: #8696a0; } }
.segmented { flex-wrap: wrap; max-width: 100%; }
.hero-actions { flex-wrap: wrap; align-items: center; }
.btn.icon { height: 36px; }
.btn.small.icon { height: 30px; width: 30px; }
.form-error:empty { display: none; }
.mini-row .min0 { min-width: 0; overflow: hidden; }
.games-table td.small, .games-table td.num, .games-table .pub-chip { white-space: nowrap; }
.card > form.add-row:last-child { padding-bottom: 16px; }
.detail-grid > div:last-child { position: sticky; top: 20px; }
.desc-clamp { display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }
.link-button { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
.toast .toast-action { margin-left: 12px; border: 0; background: rgba(255, 255, 255, 0.2); color: inherit; font: inherit; font-weight: 700; border-radius: 6px; padding: 2px 8px; cursor: pointer; }
.toast { pointer-events: auto; }
details.more-filters > summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--accent); margin-bottom: 10px; list-style: none; }
details.more-filters > summary::-webkit-details-marker { display: none; }
.mix-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; margin-bottom: 14px; }
.mix-bar .grow { color: var(--muted); font-size: 13px; }

/* QA-06: dashboard as masonry columns; wide widgets span all columns. */
.dash-grid { display: block; columns: 3 340px; column-gap: 14px; }
.dash-grid > .dash-widget { break-inside: avoid; display: inline-block; width: 100%; margin-bottom: 14px; }
.dash-grid > .dash-widget.wide { column-span: all; }
.dash-widget .card-head h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* QA-07: insights overview in three explicit columns. */
.insight-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; align-items: start; }
.insight-cols > div { display: grid; gap: 14px; min-width: 0; }
@media (max-width: 1100px) { .insight-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .insight-cols { grid-template-columns: minmax(0, 1fr); } }

/* QA-23: admin health grid. */
.health-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.job-button b::before { content: '▶ '; color: var(--accent); }
.job-button:focus-visible { outline: 2px solid var(--accent); }
.admin-grid > .card:only-child { grid-column: 1 / -1; }

/* QA-01/02/03: phone. */
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .nav { min-width: 0; }
  .sidebar { padding-right: 60px; }
  table.list { display: block; overflow-x: auto; }
  .page-head { padding-right: 0; }
  .filters .search { min-width: 0; max-width: none; flex-basis: 100%; }
  .detail-grid > div:last-child { position: static; }
  .stat-row { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
}

tr.extra-row { display: none; }
.badge-new.linked { background: var(--accent); }

.insight-cols > div { grid-template-columns: minmax(0, 1fr); }

.store-link { display: inline-flex; padding: 1px 3px; border-radius: 5px; color: inherit; }
.store-link:hover { background: var(--accent-soft); text-decoration: none; }
.store-pair { display: inline-flex; gap: 4px; }
.sibling-link { background: var(--accent-soft); color: var(--accent); text-decoration: none; }

/* Home widgets grow with their rows; long lists fold behind 'Show N more'. */
.widget-body { max-height: none; overflow: visible; }
.mini-row.extra-row { display: none; }
.widget-more { padding: 8px 16px 12px; border-top: 1px solid var(--line); }
button.file-chip.clickable { border: 1px solid var(--line); cursor: pointer; font: inherit; font-size: 12px; color: var(--accent); }
button.file-chip.clickable:hover { border-color: var(--accent); }
.same-name { margin: 8px 0 0; font-weight: 500; }

.history-progress { color: var(--warn); font-weight: 600; margin-top: 2px; }

/* Invite link dialog */
.invite-link { display: flex; gap: 8px; align-items: center; }
.invite-link input { flex: 1; min-width: 0; font-family: ui-monospace, monospace; font-size: 12px; }

/* Offline copy (one HTML file) */
.offline-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.offline-chip svg { width: 14px; height: 14px; }
.offline-update { margin: 10px 0 8px; display: flex; flex-direction: column; gap: 4px; }
.offline-update .btn { width: 100%; justify-content: center; }
.offline-update .btn svg { width: 14px; height: 14px; }
.offline-update.running .btn svg { animation: offline-spin 1s linear infinite; }
.offline-update-status { font-size: 11.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes offline-spin { to { transform: rotate(360deg); } }
.offline-lock { max-width: 340px; margin: 18vh auto 0; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.offline-lock .brand { justify-content: center; font-size: 22px; }
.offline-lock.shake { animation: lock-shake 0.35s; }
@keyframes lock-shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

.mix-bar > svg { width: 18px; height: 18px; flex: none; color: var(--accent); }
.offline-locked .sidebar-foot, .offline-locked .topbar { visibility: hidden; }
