* { box-sizing: border-box; font-family: "Segoe UI", "Trebuchet MS", Tahoma, sans-serif; }
body { margin: 0; padding: 0; background: transparent; }

:root {
  --tablet-ratio: 1.48414;
  --screen-inset-top: 8.8%;
  --screen-inset-right: 5.6%;
  --screen-inset-bottom: 8.8%;
  --screen-inset-left: 5.8%;

  --bg: #08111a;
  --bg2: #102131;
  --panel: rgba(18, 33, 48, 0.9);
  --panel-solid: #122130;
  --card: rgba(8, 18, 28, 0.46);
  --input-bg: rgba(7, 14, 22, 0.68);
  --line: rgba(190, 220, 245, 0.2);
  --text: #e5f0fb;
  --heading: #f3fbff;
  --muted: #9bb1c6;
  --accent: #5ec8ff;
  --accent-soft: rgba(94, 200, 255, 0.24);
  --accent-alt: rgba(76, 255, 196, 0.16);
  --success: #5ae696;
  --warning: #ffc25e;
  --danger: #ff6969;
  --owner-accent: #ffc846;
}

#app.hidden { display: none; }
#app {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

#app.is-open {
  opacity: 1;
  pointer-events: auto;
}

#app.is-closing {
  opacity: 0;
  pointer-events: none;
}

.tablet-frame {
  position: relative;
  width: min(96vw, calc(96vh * var(--tablet-ratio)));
  aspect-ratio: 1450 / 977;
  background-image: url('tablet-frame.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  transform: translateY(20px) scale(0.965);
  filter: saturate(0.86);
  transition: transform 0.24s ease, filter 0.24s ease, opacity 0.24s ease;
}

#app.is-open .tablet-frame {
  transform: translateY(0) scale(1);
  filter: saturate(1);
}

#app.is-closing .tablet-frame {
  transform: translateY(14px) scale(0.975);
  filter: saturate(0.9);
}

#app.cursor-outside-ui .tablet-frame {
  opacity: 0.4;
}

.tail-hud {
  position: fixed;
  left: 50%;
  bottom: 7.5vh;
  transform: translateX(-50%);
  min-width: 280px;
  max-width: min(620px, 82vw);
  pointer-events: none;
  text-align: center;
  color: #e5f0fb;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95), 0 0 10px rgba(0, 0, 0, 0.9);
  z-index: 50;
}

.tail-hud.hidden,
.tail-hud-crosshair.hidden {
  display: none;
}

.tail-hud-primary {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.15;
}

.tail-hud[data-tone="success"] .tail-hud-primary { color: #dfffee; }
.tail-hud[data-tone="warning"] .tail-hud-primary { color: #ffe0a3; }
.tail-hud[data-tone="danger"] .tail-hud-primary { color: #ffb0b0; }

.tail-hud-secondary {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.15;
}

.tail-hud-secondary[data-tone="success"] { color: #78f0a8; }
.tail-hud-secondary[data-tone="warning"] { color: #ffc25e; }
.tail-hud-secondary[data-tone="danger"] { color: #ff6969; }
.tail-hud-secondary[data-tone="neutral"] { color: #dceeff; }

.tail-hud-warning {
  margin-top: 6px;
  min-height: 20px;
  color: #ff4f4f;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.15;
}

.tail-hud-warning-flash {
  animation: tailHudFlash 0.7s steps(2, start) infinite;
}

.prompt-hud {
  position: fixed;
  left: 50%;
  bottom: 4.6vh;
  transform: translateX(-50%);
  max-width: min(620px, 82vw);
  padding: 8px 14px;
  border: 1px solid rgba(190, 220, 245, 0.28);
  border-radius: 7px;
  background: rgba(5, 12, 20, 0.76);
  color: #e7f5ff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  z-index: 55;
}

.prompt-hud.hidden {
  display: none;
}

.prompt-hud[data-tone="success"] {
  border-color: rgba(90, 230, 150, 0.42);
  color: #c9ffdd;
}

.prompt-hud[data-tone="warning"] {
  border-color: rgba(255, 194, 94, 0.48);
  color: #ffe0a3;
}

.prompt-hud[data-tone="danger"],
.prompt-hud[data-tone="error"] {
  border-color: rgba(255, 105, 105, 0.5);
  color: #ffb8b8;
}

/* ── Scam "hot/cold" suspect proximity HUD ───────────────────────── */
.scam-proximity {
  position: fixed;
  left: 50%;
  bottom: 11vh;
  transform: translateX(-50%);
  width: min(280px, 60vw);
  padding: 8px 12px 10px;
  border: 1px solid rgba(190, 220, 245, 0.22);
  border-radius: 8px;
  background: rgba(5, 12, 20, 0.74);
  pointer-events: none;
  z-index: 55;
  transition: border-color 180ms ease;
}

.scam-proximity.hidden {
  display: none;
}

.scam-proximity-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 6px;
  color: #cfe4f5;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  transition: color 180ms ease;
}

.scam-proximity-track {
  position: relative;
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.scam-proximity-fill {
  height: 100%;
  width: 0%;
  border-radius: 5px;
  background: #6fa8d6;
  transition: width 200ms ease, background-color 180ms ease;
}

.scam-proximity[data-level="cold"] { border-color: rgba(110, 160, 220, 0.4); }
.scam-proximity[data-level="cold"] .scam-proximity-label { color: #9ec5ef; }
.scam-proximity[data-level="cold"] .scam-proximity-fill { background: #5b8fd0; }

.scam-proximity[data-level="cool"] { border-color: rgba(110, 200, 210, 0.42); }
.scam-proximity[data-level="cool"] .scam-proximity-label { color: #9fe2e6; }
.scam-proximity[data-level="cool"] .scam-proximity-fill { background: #4fc6cf; }

.scam-proximity[data-level="warm"] { border-color: rgba(255, 200, 110, 0.46); }
.scam-proximity[data-level="warm"] .scam-proximity-label { color: #ffd591; }
.scam-proximity[data-level="warm"] .scam-proximity-fill { background: #f0b24f; }

.scam-proximity[data-level="hot"] { border-color: rgba(255, 140, 80, 0.5); }
.scam-proximity[data-level="hot"] .scam-proximity-label { color: #ffb27a; }
.scam-proximity[data-level="hot"] .scam-proximity-fill { background: #ff8a4c; }

.scam-proximity[data-level="burning"] { border-color: rgba(255, 90, 90, 0.58); }
.scam-proximity[data-level="burning"] .scam-proximity-label { color: #ff9b9b; }
.scam-proximity[data-level="burning"] .scam-proximity-fill {
  background: #ff5a5a;
  animation: scamProximityPulse 700ms ease-in-out infinite;
}

@keyframes scamProximityPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.tail-hud-camera {
  top: 6.5vh;
  bottom: auto;
}

.tail-hud-photo {
  bottom: 8vh;
}

.tail-hud-crosshair {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  transform: translate(-50%, -50%);
}

.tail-hud-crosshair::before,
.tail-hud-crosshair::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.65);
  transform: translate(-50%, -50%);
}

.tail-hud-crosshair::before {
  width: 2px;
  height: 58px;
}

.tail-hud-crosshair::after {
  width: 58px;
  height: 2px;
}

@keyframes tailHudFlash {
  50% { opacity: 0.18; }
}

.tablet-screen {
  position: absolute;
  top: var(--screen-inset-top);
  right: var(--screen-inset-right);
  bottom: var(--screen-inset-bottom);
  left: var(--screen-inset-left);
  overflow: hidden;
  background:
    radial-gradient(1000px 420px at 10% -20%, rgba(94, 200, 255, 0.2), transparent),
    radial-gradient(820px 500px at 110% 120%, rgba(76, 255, 196, 0.1), transparent),
    radial-gradient(520px 260px at 50% 110%, rgba(50, 130, 210, 0.08), transparent),
    linear-gradient(165deg, var(--bg), var(--bg2));
  color: var(--text);
  transform: scale(1.015);
  opacity: 0.8;
  transition: transform 0.24s ease, opacity 0.24s ease;
}

#app.is-open .tablet-screen {
  transform: scale(1);
  opacity: 1;
}

#app.is-closing .tablet-screen {
  transform: scale(1.01);
  opacity: 0.88;
}

#app.cursor-outside-ui .tablet-screen {
  opacity: 0.35;
}

.os-shell { width: 100%; height: 100%; display: grid; grid-template-rows: 44px 1fr; }

.statusbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(7, 14, 22, 0.84), rgba(10, 19, 29, 0.72));
  padding: 0 12px;
  backdrop-filter: blur(6px);
}

.status-left, .status-right { display: flex; align-items: center; gap: 8px; }
.status-right { justify-content: flex-end; }
.status-center { display: flex; justify-content: center; }

.chip {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.05);
}

.brand { font-size: 12px; letter-spacing: 0.12em; color: #d6e9fb; text-transform: uppercase; }
.clock { font-size: 12px; color: #def2ff; }

.close-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.close-btn:hover {
  background: rgba(94, 200, 255, 0.16);
}

.close-btn:active {
  transform: translateY(1px);
}

.workspace {
  display: grid;
  grid-template-columns: 92px 1fr;
  min-height: 0;
}

.sidebar {
  border-right: 1px solid var(--line);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background:
    linear-gradient(180deg, rgba(11, 26, 40, 0.94), rgba(7, 14, 22, 0.8)),
    radial-gradient(120px 180px at 50% -10%, rgba(94, 200, 255, 0.18), transparent),
    radial-gradient(140px 160px at 50% 100%, rgba(76, 255, 196, 0.06), transparent);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.03);
}

.app-btn {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  color: #a9bed3;
  border-radius: 14px;
  min-height: 46px;
  padding: 11px 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 6px 18px rgba(0, 0, 0, 0.16);
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease,
    transform 0.12s ease,
    box-shadow 0.15s ease;
}

.app-btn:hover {
  color: #dbeeff;
  border-color: rgba(94, 200, 255, 0.42);
  background:
    linear-gradient(180deg, rgba(94, 200, 255, 0.17), rgba(94, 200, 255, 0.07));
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 8px 20px rgba(18, 54, 84, 0.24);
}

.app-btn:active {
  transform: translateY(1px);
}

.app-btn.active {
  color: #f6fbff;
  border-color: rgba(120, 222, 255, 0.64);
  background:
    linear-gradient(180deg, rgba(94, 200, 255, 0.34), rgba(94, 200, 255, 0.16));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 0 28px rgba(94, 200, 255, 0.1),
    0 0 0 1px rgba(94, 200, 255, 0.1),
    0 10px 24px rgba(18, 78, 118, 0.3);
}

.content {
  padding: 12px;
  overflow-y: auto;
  display: grid;
  gap: 10px;
  grid-template-rows: auto 1fr auto;
}

.content.market-mode {
  grid-template-rows: 1fr;
}

.hidden-panel {
  display: none;
}

.tab-panel.hidden-panel {
  display: none !important;
}

.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 10px;
}

.hero-block, .panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(22, 38, 55, 0.92), rgba(16, 30, 44, 0.92));
  padding: 12px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.025),
    0 10px 24px rgba(3, 10, 18, 0.18);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.panel h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #e6f3ff;
}

.label { font-size: 11px; color: var(--muted); }
.value { font-size: 30px; font-weight: 800; margin-top: 6px; color: #f5fbff; text-shadow: 0 0 18px rgba(94, 200, 255, 0.08); }
.rep-sub-label { margin-top: 10px; }
.value-crim {
  font-size: 24px;
  color: #ffcab3;
  text-shadow: 0 0 18px rgba(255, 124, 82, 0.12);
}

.toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
  gap: 12px;
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 48px;
  height: 28px;
}

.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.switch-track {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.09);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #e8f2fc;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease;
}

.switch input:checked + .switch-track {
  background: var(--accent-soft);
  border-color: rgba(94, 200, 255, 0.62);
}

.switch input:checked + .switch-track::after {
  transform: translateX(20px);
  background: #bfe4ff;
}

.hint { color: var(--muted); font-size: 12px; }

.active-empty {
  font-size: 15px;
  font-weight: 600;
  color: #d7e8f7;
}

.active-empty-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.active-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.active-title {
  font-size: 18px;
  font-weight: 700;
  color: #eaf5ff;
}

.active-status {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #d4ecff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(94, 200, 255, 0.16);
}

.active-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.active-stat {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  padding: 8px 10px;
}

.active-k {
  font-size: 11px;
  color: var(--muted);
}

.active-v {
  margin-top: 3px;
  font-size: 14px;
  color: #e4f1fe;
  font-weight: 700;
}

.active-special {
  margin-top: 10px;
  border: 1px solid rgba(255, 110, 110, 0.35);
  border-radius: 10px;
  background: rgba(75, 12, 12, 0.2);
  padding: 8px 10px;
}

.active-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.active-actions .action {
  width: 100%;
}

.special-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #ffdbdb;
  margin-bottom: 7px;
}

.special-head span:last-child {
  font-weight: 700;
}

.vital-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.vital-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.3s linear;
}

.life-text-stable {
  color: #9ef3bf;
}

.life-text-warning {
  color: #ffd999;
}

.life-text-critical {
  color: #ffc0c0;
}

.life-text-unknown {
  color: #d7dfef;
}

.life-fill-stable {
  background: linear-gradient(90deg, #4be58b, #7af2c7);
}

.life-fill-warning {
  background: linear-gradient(90deg, #f7b34d, #ffd079);
}

.life-fill-critical {
  background: linear-gradient(90deg, #f15f5f, #ff9090);
}

.life-fill-unknown {
  background: linear-gradient(90deg, #75829b, #9eadc6);
}

.scam-special {
  border-color: rgba(255, 170, 70, 0.35);
  background: rgba(32, 22, 8, 0.24);
}

.suspect-ref {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 10px;
  align-items: stretch;
}

.suspect-photo {
  width: 108px;
  height: 108px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.2);
}

.suspect-photo.placeholder {
  display: grid;
  place-items: center;
  color: #d2d8e1;
  font-size: 12px;
}

.suspect-meta {
  display: grid;
  align-content: center;
  gap: 4px;
}

.suspect-label {
  font-size: 11px;
  color: var(--muted);
}

.suspect-model {
  font-size: 14px;
  color: #f2f6ff;
  font-weight: 700;
}

.suspect-intel {
  font-size: 12px;
  color: #9db7dd;
}

.suspect-hint {
  font-size: 12px;
  color: #d9b77f;
}

/* ── Repo gig: San Andreas licence plate ───────────────────────────── */
.repo-special {
  border-color: rgba(90, 140, 200, 0.4);
  background: rgba(8, 22, 40, 0.35);
}

/* Two-column layout: plate image left, vehicle info right */
.repo-vehicle-ref {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

.sa-plate {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 160px;
  height: 80px;
  background-image: url('emptyplate.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  border-radius: 5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.6);
  overflow: hidden;
  padding-bottom: 22px;
  flex-shrink: 0;
}

/* Large bold plate number overlay */
.sa-plate-number {
  font-family: 'Arial Black', 'Impact', Arial, sans-serif;
  font-size: 23px;
  font-weight: 900;
  color: #1a3a80;
  letter-spacing: 3px;
  line-height: 1;
  text-shadow: 1px 1px 0 rgba(255,255,255,0.4);
  user-select: none;
}

/* Vehicle info column */
.repo-vehicle-meta {
  display: grid;
  align-content: center;
  gap: 2px;
}

.repo-model-name {
  font-size: 15px;
  color: #f2f6ff;
  font-weight: 700;
}

.repo-plate-text {
  font-family: 'Arial Black', 'Impact', Arial, sans-serif;
  font-size: 14px;
  font-weight: 900;
  color: #adc8f5;
  letter-spacing: 2px;
}

.offers { display: grid; gap: 8px; }

.panel-inbox {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-active {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-active #active {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

#offers {
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.rep-panel {
  overflow-y: auto;
}

.rep-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Rep stat cards ─────────────────────────────────────── */
.rep-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.rep-card {
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: rgba(14, 26, 40, 0.72);
}

.rep-card-civ {
  border-color: rgba(94, 200, 255, 0.22);
  background: linear-gradient(160deg, rgba(8, 22, 36, 0.82), rgba(12, 26, 42, 0.82));
  box-shadow: inset 0 0 40px rgba(94, 200, 255, 0.04);
}

.rep-card-crim {
  border-color: rgba(255, 155, 90, 0.22);
  background: linear-gradient(160deg, rgba(24, 12, 6, 0.82), rgba(28, 14, 8, 0.82));
  box-shadow: inset 0 0 40px rgba(255, 140, 70, 0.04);
}

.rep-card-header {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.rep-card-civ .rep-card-header { color: rgba(94, 200, 255, 0.65); }
.rep-card-crim .rep-card-header { color: rgba(255, 160, 90, 0.65); }

.rep-card-num {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.01em;
}

.rep-card-civ .rep-card-num {
  color: #d4efff;
  text-shadow: 0 0 24px rgba(94, 200, 255, 0.22);
}

.rep-card-crim .rep-card-num {
  color: #ffd8be;
  text-shadow: 0 0 24px rgba(255, 150, 80, 0.18);
}

.rep-bar-wrap { display: flex; flex-direction: column; gap: 3px; }

.rep-bar-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.rep-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.22, 0.68, 0, 1.2);
}

.rep-fill-civ {
  background: linear-gradient(90deg, rgba(50, 160, 240, 0.9), #5ec8ff);
  box-shadow: 0 0 6px rgba(94, 200, 255, 0.5);
}

.rep-fill-crim {
  background: linear-gradient(90deg, rgba(220, 100, 40, 0.9), #ffb060);
  box-shadow: 0 0 6px rgba(255, 150, 70, 0.45);
}

.rep-bar-pct {
  font-size: 10px;
  font-weight: 700;
  text-align: right;
  letter-spacing: 0.04em;
}

.rep-card-civ .rep-bar-pct { color: rgba(94, 200, 255, 0.7); }
.rep-card-crim .rep-bar-pct { color: rgba(255, 160, 90, 0.7); }

.rep-card-next {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  min-height: 28px;
}

.rep-card-civ .rep-card-next strong { color: #c2e6ff; }
.rep-card-crim .rep-card-next strong { color: #ffd5b0; }

/* ── Rep unlock pills ───────────────────────────────────── */
.rep-unlocks-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rep-unlocks-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line);
}

.rep-unlock-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.rep-unlock-pill {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid;
  font-weight: 600;
  white-space: nowrap;
}

.rep-unlock-pill-civ {
  border-color: rgba(94, 200, 255, 0.28);
  color: rgba(148, 218, 255, 0.88);
  background: rgba(94, 200, 255, 0.07);
}

.rep-unlock-pill-crim {
  border-color: rgba(255, 155, 80, 0.28);
  color: rgba(255, 198, 142, 0.88);
  background: rgba(255, 140, 60, 0.07);
}

.messages {
  display: grid;
  gap: 9px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 3px;
}

.panel-messages {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-messages .panel-head {
  flex-shrink: 0;
}

.panel-settings {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.theme-editor {
  display: block;
  min-width: 0;
}

.theme-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 8px;
}

.theme-preset {
  min-width: 0;
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(8, 18, 28, 0.34);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.theme-preset:hover {
  border-color: rgba(var(--theme-accent-rgb, 94, 200, 255), 0.42);
  background: rgba(var(--theme-accent-rgb, 94, 200, 255), 0.08);
}

.theme-preset.active {
  border-color: rgba(var(--theme-accent-rgb, 94, 200, 255), 0.68);
  background: rgba(var(--theme-accent-rgb, 94, 200, 255), 0.16);
}

.theme-preset-name {
  font-size: 12px;
  font-weight: 850;
  color: var(--heading);
  text-align: left;
}

.theme-preset-swatches {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}

.theme-preset-swatches span {
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.theme-advanced {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 18, 28, 0.22);
  overflow: hidden;
}

.theme-advanced summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: var(--heading);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  user-select: none;
}

.theme-color-groups {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.theme-color-group {
  display: grid;
  gap: 6px;
}

.theme-color-group-title {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.theme-color-group-rows {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
  gap: 6px;
}

.theme-color-row {
  min-width: 0;
  min-height: 38px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: var(--card);
}

.theme-color-row strong {
  display: block;
  color: var(--text);
  font-size: 11px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-color-row input[type="color"] {
  width: 34px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.theme-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px 36px;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 42px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 18, 28, 0.32);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.theme-row > span:first-child {
  min-width: 0;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.theme-row-example {
  min-width: 0;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
  font-size: 10px;
  font-weight: 850;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-row-example[data-theme-example="background"] {
  background: var(--bg);
}

.theme-row-example[data-theme-example="background2"] {
  background: var(--bg2);
}

.theme-row-example[data-theme-example="screenGlow"] {
  box-shadow: inset 0 0 14px rgba(var(--theme-screenGlow-rgb, 94, 200, 255), 0.55);
}

.theme-row-example[data-theme-example="screenGlow2"] {
  box-shadow: inset 0 0 14px rgba(var(--theme-screenGlow2-rgb, 76, 255, 196), 0.55);
}

.theme-row-example[data-theme-example="statusTop"] {
  background: rgba(var(--theme-statusTop-rgb, 7, 14, 22), 0.95);
}

.theme-row-example[data-theme-example="statusBottom"] {
  background: rgba(var(--theme-statusBottom-rgb, 10, 19, 29), 0.95);
}

.theme-row-example[data-theme-example="sidebarTop"] {
  background: rgba(var(--theme-sidebarTop-rgb, 11, 26, 40), 0.95);
}

.theme-row-example[data-theme-example="sidebarBottom"] {
  background: rgba(var(--theme-sidebarBottom-rgb, 7, 14, 22), 0.95);
}

.theme-row-example[data-theme-example="panel"] {
  background: var(--panel-solid);
}

.theme-row-example[data-theme-example="panel2"] {
  background: rgba(var(--theme-panel2-rgb, 16, 30, 44), 0.95);
}

.theme-row-example[data-theme-example="card"] {
  background: var(--card);
}

.theme-row-example[data-theme-example="input"] {
  background: var(--input-bg);
}

.theme-row-example[data-theme-example="line"] {
  border-color: rgba(var(--theme-line-rgb, 190, 220, 245), 0.85);
}

.theme-row-example[data-theme-example="accent"] {
  border-color: rgba(var(--theme-accent-rgb, 94, 200, 255), 0.65);
  background: rgba(var(--theme-accent-rgb, 94, 200, 255), 0.16);
}

.theme-row-example[data-theme-example="accentAlt"] {
  border-color: rgba(var(--theme-accentAlt-rgb, 76, 255, 196), 0.65);
  background: rgba(var(--theme-accentAlt-rgb, 76, 255, 196), 0.16);
}

.theme-row-example[data-theme-example="buttonText"] {
  color: var(--buttonText);
}

.theme-row-example[data-theme-example="text"] {
  color: var(--text);
}

.theme-row-example[data-theme-example="heading"] {
  color: var(--heading);
}

.theme-row-example[data-theme-example="muted"] {
  color: var(--muted);
}

.theme-row-example[data-theme-example="success"] {
  border-color: rgba(var(--theme-success-rgb, 90, 230, 150), 0.45);
  background: rgba(var(--theme-success-rgb, 90, 230, 150), 0.13);
  color: var(--success);
}

.theme-row-example[data-theme-example="warning"] {
  border-color: rgba(var(--theme-warning-rgb, 255, 194, 94), 0.45);
  background: rgba(var(--theme-warning-rgb, 255, 194, 94), 0.13);
  color: var(--warning);
}

.theme-row-example[data-theme-example="danger"] {
  border-color: rgba(var(--theme-danger-rgb, 255, 105, 105), 0.45);
  background: rgba(var(--theme-danger-rgb, 255, 105, 105), 0.13);
  color: var(--danger);
}

.theme-row-example[data-theme-example="ownerAccent"] {
  border-color: rgba(var(--theme-ownerAccent-rgb, 255, 200, 70), 0.55);
  background: rgba(var(--theme-ownerAccent-rgb, 255, 200, 70), 0.12);
  color: var(--owner-accent);
}

.theme-row input[type="color"] {
  width: 34px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.theme-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.theme-preview {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.theme-preview-card,
.theme-preview-sample {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.theme-preview-screen {
  background:
    radial-gradient(180px 90px at 15% 0%, rgba(var(--theme-screenGlow-rgb, 94, 200, 255), 0.22), transparent),
    radial-gradient(180px 120px at 100% 100%, rgba(var(--theme-screenGlow2-rgb, 76, 255, 196), 0.14), transparent),
    linear-gradient(165deg, var(--bg), var(--bg2));
}

.theme-preview-topbar {
  padding: 8px 10px;
  background: linear-gradient(180deg, rgba(var(--theme-statusTop-rgb, 7, 14, 22), 0.9), rgba(var(--theme-statusBottom-rgb, 10, 19, 29), 0.74));
  color: var(--heading);
  font-size: 11px;
  font-weight: 800;
}

.theme-preview-body {
  display: grid;
  grid-template-columns: 72px 1fr;
  min-height: 116px;
}

.theme-preview-sidebar {
  padding: 10px;
  background: linear-gradient(180deg, rgba(var(--theme-sidebarTop-rgb, 11, 26, 40), 0.94), rgba(var(--theme-sidebarBottom-rgb, 7, 14, 22), 0.86));
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}

.theme-preview-panel {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 10px;
  background: linear-gradient(180deg, rgba(var(--theme-panel-rgb, 18, 33, 48), 0.9), rgba(var(--theme-panel2-rgb, 16, 30, 44), 0.78));
}

.theme-preview-heading {
  color: var(--heading);
  font-size: 13px;
  font-weight: 850;
}

.theme-preview-muted {
  color: var(--muted);
  font-size: 11px;
}

.theme-preview-cardline {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--card);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.theme-preview-input {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--input-bg);
  color: var(--muted);
  font-size: 11px;
}

.theme-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.theme-preview-sample {
  min-height: 36px;
  display: grid;
  place-items: center;
  padding: 8px;
  font-size: 11px;
  font-weight: 850;
  text-align: center;
}

.theme-preview-accent {
  border-color: rgba(var(--theme-accent-rgb, 94, 200, 255), 0.65);
  background: rgba(var(--theme-accent-rgb, 94, 200, 255), 0.18);
  color: var(--buttonText, var(--text));
}

.theme-preview-alt {
  border-color: rgba(var(--theme-accentAlt-rgb, 76, 255, 196), 0.65);
  background: rgba(var(--theme-accentAlt-rgb, 76, 255, 196), 0.16);
  color: var(--heading);
}

.theme-preview-success {
  border-color: rgba(var(--theme-success-rgb, 90, 230, 150), 0.45);
  background: rgba(var(--theme-success-rgb, 90, 230, 150), 0.13);
  color: var(--success);
}

.theme-preview-warning {
  border-color: rgba(var(--theme-warning-rgb, 255, 194, 94), 0.45);
  background: rgba(var(--theme-warning-rgb, 255, 194, 94), 0.13);
  color: var(--warning);
}

.theme-preview-danger {
  border-color: rgba(var(--theme-danger-rgb, 255, 105, 105), 0.45);
  background: rgba(var(--theme-danger-rgb, 255, 105, 105), 0.13);
  color: var(--danger);
}

.theme-preview-owner {
  border-color: rgba(var(--theme-ownerAccent-rgb, 255, 200, 70), 0.55);
  background: rgba(var(--theme-ownerAccent-rgb, 255, 200, 70), 0.12);
  color: var(--owner-accent);
}

/* Customer theme coverage. These rules intentionally sit late enough to
   recolor the main tablet surfaces without changing layout behavior. */
.tablet-screen {
  background:
    radial-gradient(1000px 420px at 10% -20%, rgba(var(--theme-screenGlow-rgb, 94, 200, 255), 0.2), transparent),
    radial-gradient(820px 500px at 110% 120%, rgba(var(--theme-screenGlow2-rgb, 76, 255, 196), 0.1), transparent),
    radial-gradient(520px 260px at 50% 110%, rgba(var(--theme-accent-rgb, 94, 200, 255), 0.08), transparent),
    linear-gradient(165deg, var(--bg), var(--bg2));
}

.statusbar {
  background: linear-gradient(180deg, rgba(var(--theme-statusTop-rgb, 7, 14, 22), 0.84), rgba(var(--theme-statusBottom-rgb, 10, 19, 29), 0.72));
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(var(--theme-sidebarTop-rgb, 11, 26, 40), 0.94), rgba(var(--theme-sidebarBottom-rgb, 7, 14, 22), 0.8)),
    radial-gradient(120px 180px at 50% -10%, rgba(var(--theme-accent-rgb, 94, 200, 255), 0.18), transparent),
    radial-gradient(140px 160px at 50% 100%, rgba(var(--theme-accentAlt-rgb, 76, 255, 196), 0.06), transparent);
}

.panel,
.hero-block,
.market-create-shell,
.market-browser-shell,
.market-results-frame,
.market-payout-card,
.owner-theme-shell,
.owner-row,
.owner-player-row,
.owner-ga-contract,
.owner-ga-grant-form,
.rep-card,
.message,
.offer,
.market-row,
.market-picker-card,
.market-photo-shell,
.theme-row {
  border-color: var(--line);
  background: linear-gradient(180deg, rgba(var(--theme-panel-rgb, 18, 33, 48), 0.88), rgba(var(--theme-panel2-rgb, 16, 30, 44), 0.78));
  color: var(--text);
}

.market-summary-strip,
.market-row,
.market-picker-card,
.market-payout-card,
.owner-row,
.owner-player-row,
.message,
.offer,
.theme-row {
  background: var(--card);
}

.market-input,
.owner-select,
.owner-list-input,
.owner-number-input,
input,
textarea,
select {
  border-color: var(--line);
  background: var(--input-bg);
  color: var(--text);
}

.market-input:focus,
.owner-select:focus,
.owner-list-input:focus,
.owner-number-input:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: rgba(var(--theme-accent-rgb, 94, 200, 255), 0.55);
  outline: none;
}

.brand,
.clock,
.panel-head h3,
.market-row-price,
.market-row-title,
.offer-title,
.owner-row-label,
.owner-player-name,
.market-photo-title,
.messages-subhead,
.value {
  color: var(--heading);
}

.app-btn,
.action,
.close-btn {
  border-color: var(--line);
  color: var(--buttonText, var(--text));
  background: linear-gradient(180deg, rgba(var(--theme-accent-rgb, 94, 200, 255), 0.11), rgba(var(--theme-panel2-rgb, 16, 30, 44), 0.34));
}

.app-btn:hover,
.action:hover,
.close-btn:hover {
  border-color: rgba(var(--theme-accent-rgb, 94, 200, 255), 0.5);
  background: linear-gradient(180deg, rgba(var(--theme-accent-rgb, 94, 200, 255), 0.22), rgba(var(--theme-accent-rgb, 94, 200, 255), 0.08));
}

.app-btn.active,
.market-subtab-btn.active,
.market-type-btn.active,
.owner-pm-type-btn.active,
.action:not(.action-secondary):not(.action-danger) {
  border-color: rgba(var(--theme-accent-rgb, 94, 200, 255), 0.65);
  background: linear-gradient(180deg, rgba(var(--theme-accent-rgb, 94, 200, 255), 0.34), rgba(var(--theme-accent-rgb, 94, 200, 255), 0.16));
  color: var(--buttonText, var(--text));
}

.switch input:checked + .switch-track,
.market-kind-pill,
.gig-blocked-toggle.open {
  border-color: rgba(var(--theme-accent-rgb, 94, 200, 255), 0.55);
  background: rgba(var(--theme-accent-rgb, 94, 200, 255), 0.16);
  color: var(--heading);
}

.market-check-row input,
.theme-row input[type="color"] {
  accent-color: var(--accent);
}

.owner-tab-btn,
.owner-tab-btn:hover,
.owner-tab-btn.active,
.owner-row-overridden {
  border-color: rgba(var(--theme-ownerAccent-rgb, 255, 200, 70), 0.55);
  background: rgba(var(--theme-ownerAccent-rgb, 255, 200, 70), 0.12);
  color: var(--owner-accent);
}

.market-silent-btn.active,
.action-block,
.action-block:hover {
  border-color: rgba(var(--theme-warning-rgb, 255, 194, 94), 0.55);
  background: rgba(var(--theme-warning-rgb, 255, 194, 94), 0.12);
  color: var(--warning);
}

.owner-status-ok,
.life-text-stable,
.market-create-status.success {
  color: var(--success);
}

.life-text-warning,
.owner-restart-badge,
.market-kind-pill-muted {
  color: var(--warning);
}

.action-danger,
.action-danger:hover,
.owner-status-error,
.life-text-critical,
.market-create-status.error {
  border-color: rgba(var(--theme-danger-rgb, 255, 105, 105), 0.45);
  background: rgba(var(--theme-danger-rgb, 255, 105, 105), 0.14);
  color: var(--danger);
}

.vital-fill.life-fill-stable,
.rep-fill-civ {
  background: linear-gradient(90deg, rgba(var(--theme-success-rgb, 90, 230, 150), 0.86), var(--success));
}

.vital-fill.life-fill-warning {
  background: linear-gradient(90deg, rgba(var(--theme-warning-rgb, 255, 194, 94), 0.86), var(--warning));
}

.vital-fill.life-fill-critical {
  background: linear-gradient(90deg, rgba(var(--theme-danger-rgb, 255, 105, 105), 0.86), var(--danger));
}

.rep-fill-crim {
  background: linear-gradient(90deg, rgba(var(--theme-warning-rgb, 255, 194, 94), 0.86), var(--warning));
}

.messages-empty {
  border: 1px dashed rgba(190, 220, 245, 0.22);
  border-radius: 10px;
  padding: 16px;
  color: var(--muted);
  background: rgba(8, 18, 28, 0.28);
  font-size: 13px;
}

.messages-subhead {
  margin: 4px 0 6px;
  color: #b8d7f2;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── Inbox header + blocked drawer ─────────────────────── */
.inbox-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gig-blocked-toggle {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  font-family: inherit;
}

.gig-blocked-toggle:hover {
  border-color: rgba(255, 190, 95, 0.45);
  background: rgba(255, 190, 95, 0.08);
  color: #ffd8a0;
}

.gig-blocked-toggle.has-blocked {
  border-color: rgba(255, 185, 80, 0.42);
  background: rgba(255, 185, 80, 0.08);
  color: #ffcc80;
}

.gig-blocked-toggle.open {
  border-color: rgba(255, 190, 95, 0.6);
  background: rgba(255, 190, 95, 0.14);
  color: #ffe0a8;
}

.gig-blocked-drawer {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 0 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.gig-blocked-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 2px 0;
}

.gig-blocked-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 185, 80, 0.18);
  border-radius: 8px;
  padding: 6px 10px;
  background: rgba(22, 14, 4, 0.48);
  color: #ffcf8a;
  font-size: 12px;
  font-weight: 600;
}

.msg-row {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid rgba(190, 220, 245, 0.18);
  border-radius: 10px;
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(12, 25, 38, 0.76), rgba(7, 16, 25, 0.72));
  color: #d8e9f8;
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.msg-avatar {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(94, 200, 255, 0.32);
  background: rgba(94, 200, 255, 0.12);
  color: #cceeff;
  font-size: 12px;
  font-weight: 800;
}

.msg-body {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.msg-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.msg-sender {
  color: #eef8ff;
  font-size: 13px;
  font-weight: 800;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-role {
  color: #9eb8ce;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(190, 220, 245, 0.18);
  border-radius: 999px;
  padding: 1px 7px;
  background: rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.msg-time {
  margin-left: auto;
  color: rgba(155, 177, 198, 0.78);
  font-size: 11px;
  white-space: nowrap;
}

.msg-text {
  color: #d8e9f8;
  line-height: 1.35;
}

.msg-success {
  border-color: rgba(90, 230, 150, 0.28);
}

.msg-success .msg-avatar {
  border-color: rgba(90, 230, 150, 0.38);
  background: rgba(90, 230, 150, 0.12);
  color: #bff8d3;
}

.msg-error {
  border-color: rgba(255, 115, 100, 0.3);
}

.msg-error .msg-avatar {
  border-color: rgba(255, 115, 100, 0.42);
  background: rgba(255, 115, 100, 0.12);
  color: #ffd1cc;
}

.market-summary {
  margin-bottom: 0;
}

.market-summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: #bcd0e4;
  font-size: 12px;
}

.market-summary-strip span {
  border: 1px solid rgba(190, 220, 245, 0.14);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(8, 18, 28, 0.28);
}

.market-summary-strip strong {
  color: #f3fbff;
  font-size: 12px;
}

.market-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(8, 18, 28, 0.36);
  color: #d8e9f8;
  font-size: 13px;
}

.panel-market {
  min-height: 0;
  height: 100%;
  display: grid;
  gap: 10px;
  grid-template-rows: auto auto auto 1fr;
  overflow: hidden;
}

.market-head {
  margin-bottom: 0;
}

.market-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.market-silent-btn.active {
  border-color: rgba(255, 194, 94, 0.58);
  background: rgba(255, 194, 94, 0.12);
  color: #ffd99a;
}

.market-subtabs {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  border-bottom: 1px solid rgba(190, 220, 245, 0.12);
  padding-bottom: 8px;
}

.market-subtab-btn {
  min-width: 92px;
}

.market-subtab-btn.active {
  border-color: rgba(94, 200, 255, 0.62);
  background: rgba(94, 200, 255, 0.2);
  color: #f6fbff;
}

.market-tab-body {
  min-height: 0;
  display: grid;
  overflow: hidden;
}

.market-section {
  min-height: 0;
  display: none;
  overflow: hidden;
}

.market-section.active {
  display: grid;
}

.market-section-mine.active {
  gap: 10px;
  grid-template-rows: auto 1fr;
}

.market-section-sell.active {
  overflow-y: auto;
  padding-right: 4px;
}

.market-create-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 10px 12px;
  background: rgba(8, 18, 28, 0.36);
  display: grid;
  gap: 9px;
}

.market-compose-shell {
  min-height: min-content;
  grid-template-rows: none;
  align-content: start;
}

.market-create-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.market-type-toggle {
  display: flex;
  gap: 6px;
}

.market-type-btn.active {
  border-color: rgba(94, 200, 255, 0.62);
  background: rgba(94, 200, 255, 0.2);
}

.market-search-row {
  display: grid;
}

.market-picker-list {
  display: grid;
  gap: 5px;
  grid-template-columns: 1fr;
  min-height: 0;
  max-height: 170px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid rgba(190, 220, 245, 0.1);
  border-radius: 8px;
  background: rgba(7, 14, 22, 0.28);
}

.market-picker-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 24, 36, 0.62);
  color: #e4f1fe;
  padding: 7px;
  cursor: pointer;
  display: grid;
  gap: 9px;
  grid-template-columns: 44px 1fr;
  align-items: center;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.market-picker-card:hover {
  border-color: rgba(94, 200, 255, 0.42);
  background: rgba(15, 31, 46, 0.92);
  transform: translateY(-1px);
}

.market-picker-card.selected {
  border-color: rgba(94, 200, 255, 0.6);
  background: rgba(20, 51, 72, 0.72);
  box-shadow: inset 3px 0 0 rgba(94, 200, 255, 0.72);
}

.market-picker-thumb {
  width: 44px;
  height: 44px;
}

.market-picker-meta {
  min-width: 0;
}

.market-picker-title {
  font-size: 13px;
  font-weight: 700;
  color: #e7f2fd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.market-photo-shell {
  border: 1px solid rgba(190, 220, 245, 0.14);
  border-radius: 10px;
  padding: 10px;
  background: rgba(9, 20, 31, 0.52);
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.market-photo-title {
  color: #eef8ff;
  font-size: 13px;
  font-weight: 800;
}

.market-photo-preview {
  width: 190px;
  height: 92px;
  min-height: 0;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(190, 220, 245, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.market-photo-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.market-photo-action {
  white-space: nowrap;
}

.market-photo-preview-button {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 1px solid rgba(190, 220, 245, 0.2);
  border-radius: 8px;
  background-color: rgba(3, 8, 13, 0.72);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  cursor: zoom-in;
}

.market-vehicle-photo-image {
  object-fit: contain;
}

.market-photo-placeholder {
  min-height: 0;
  height: 100%;
  width: 100%;
}

.market-photo-viewer {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(2, 7, 12, 0.9);
}

.market-photo-viewer.hidden-panel {
  display: none !important;
}

.market-photo-viewer-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid rgba(190, 220, 245, 0.22);
  background: rgba(255, 255, 255, 0.04);
}

.market-photo-viewer-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 31;
}

.market-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: center;
}

.market-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.market-check-row input {
  width: 15px;
  height: 15px;
  accent-color: #5ec8ff;
}

.market-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(7, 14, 22, 0.68);
  color: #e4f1fe;
  padding: 9px 10px;
  font-size: 13px;
  outline: none;
}

.market-input:focus {
  border-color: rgba(94, 200, 255, 0.5);
}

.market-create-status {
  min-height: 18px;
}

.market-create-status-error {
  color: #ffb6b6;
}

.market-create-status-ok {
  color: #aef1c8;
}

.market-create-submit {
  width: 100%;
}

.market-list {
  display: grid;
  gap: 8px;
}

.market-browser-shell {
  height: 100%;
  min-height: 0;
  display: grid;
  gap: 10px;
  grid-template-rows: auto 1fr;
}

.market-browser-toolbar {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr);
  gap: 10px;
  align-items: center;
}

.market-browse-search {
  min-width: 0;
}

.market-results-frame {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: rgba(8, 18, 28, 0.36);
  display: grid;
  gap: 8px;
  grid-template-rows: auto 1fr;
}

.market-payouts {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.market-payout-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(8, 18, 28, 0.36);
  display: grid;
  gap: 6px;
}

.market-payout-card span,
.market-payout-card small {
  color: var(--muted);
  font-size: 12px;
}

.market-payout-card strong {
  color: #f3fbff;
  font-size: 24px;
}

.market-payout-rules {
  grid-column: 1 / -1;
}

.market-section-payouts {
  align-content: start;
  gap: 10px;
}

.market-payout-claim {
  justify-self: start;
}

.market-results-meta {
  min-height: 16px;
}

.market-list-cards {
  max-height: 100%;
  overflow-y: auto;
  padding-right: 4px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  align-content: start;
  gap: 10px;
}

.market-results-list {
  min-height: 0;
}

.market-row {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: rgba(8, 18, 28, 0.36);
  min-width: 0;
  min-height: 228px;
}

.market-card {
  align-items: flex-start;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.market-card:hover {
  border-color: rgba(94, 200, 255, 0.38);
  background: rgba(11, 25, 38, 0.52);
}

.market-row-meta {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.market-row-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 0;
  overflow: hidden;
}

.market-row-body {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.market-row-title {
  font-size: 12px;
  font-weight: 700;
  color: #e7f2fd;
  line-height: 1.25;
  min-height: 30px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.market-row-detail {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.market-row-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.market-kind-pill {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #d8efff;
  padding: 3px 6px;
  border-radius: 999px;
  border: 1px solid rgba(94, 200, 255, 0.24);
  background: rgba(94, 200, 255, 0.08);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-kind-pill-muted {
  color: #bcd0e4;
  border-color: rgba(190, 220, 245, 0.16);
  background: rgba(255, 255, 255, 0.03);
}

.market-row-footer {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.market-row-price {
  color: #f3fbff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.market-row-expiry {
  white-space: nowrap;
  flex-shrink: 0;
}

.market-row-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.market-row-actions .action {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
}

.market-buy-qty {
  min-height: 34px;
  padding: 7px 9px;
  text-align: center;
}

.market-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid rgba(190, 220, 245, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

.market-image-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  border: 1px solid rgba(190, 220, 245, 0.2);
  display: grid;
  place-items: center;
  font-size: 11px;
  color: #a9bed3;
  background: rgba(255, 255, 255, 0.04);
}

.offer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(180, 205, 225, 0.2);
  border-radius: 10px;
  padding: 10px;
  background: rgba(8, 18, 28, 0.4);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.offer:hover {
  border-color: rgba(94, 200, 255, 0.46);
  background: rgba(10, 28, 42, 0.58);
}

.offer-title { font-weight: 700; font-size: 14px; margin-bottom: 2px; color: #e7f2fd; }
.offer-meta { min-width: 0; display: grid; gap: 3px; }
.offer-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.action {
  border: 1px solid rgba(94, 200, 255, 0.5);
  background: linear-gradient(180deg, rgba(94, 200, 255, 0.24), rgba(94, 200, 255, 0.14));
  color: #e9f5ff;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease;
}

.panel-active #cancel {
  margin-top: 8px;
}

.action:hover {
  background: linear-gradient(180deg, rgba(94, 200, 255, 0.34), rgba(94, 200, 255, 0.18));
}

.action:active {
  transform: translateY(1px);
}

.action-secondary {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.action-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

.action-block {
  border-color: rgba(255, 190, 95, 0.45);
  background: rgba(255, 190, 95, 0.14);
  color: #ffeacd;
}

.action-block:hover {
  background: rgba(255, 190, 95, 0.22);
}

.action-danger {
  border-color: rgba(255, 105, 105, 0.45);
  background: rgba(255, 105, 105, 0.14);
  color: #ffdede;
}

.action-danger:hover {
  background: rgba(255, 105, 105, 0.22);
}

.action-danger.confirming {
  border-color: rgba(255, 175, 80, 0.6);
  background: rgba(255, 175, 80, 0.2);
  color: #fff2dd;
}

.action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Owner tab button (amber accent) ───────────────────────────────── */
.owner-tab-btn {
  border-color: rgba(255, 200, 70, 0.4);
  color: #ffeaaa;
  margin-top: auto; /* push to bottom of sidebar */
}

.owner-tab-btn:hover {
  color: #fff5cc;
  border-color: rgba(255, 200, 70, 0.65);
  background:
    linear-gradient(180deg, rgba(255, 200, 70, 0.22), rgba(255, 200, 70, 0.1));
}

.owner-tab-btn.active {
  color: #fff3cc;
  border-color: rgba(255, 215, 80, 0.8);
  background:
    linear-gradient(180deg, rgba(255, 210, 70, 0.36), rgba(255, 190, 50, 0.18));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 0 28px rgba(255, 200, 70, 0.12),
    0 0 0 1px rgba(255, 200, 70, 0.12),
    0 10px 24px rgba(100, 80, 0, 0.28);
}

/* ── Owner panel layout ────────────────────────────────────────────── */
.content.owner-mode {
  grid-template-rows: 1fr;
}

.panel-owner {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}

.owner-panel-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.owner-subtabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 8px 0 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}

.owner-subtab-btn {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 18, 28, 0.44);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.owner-subtab-btn:hover {
  border-color: rgba(var(--theme-accent-rgb, 94, 200, 255), 0.42);
  background: rgba(var(--theme-accent-rgb, 94, 200, 255), 0.08);
}

.owner-subtab-btn.active {
  border-color: rgba(var(--theme-accent-rgb, 94, 200, 255), 0.62);
  background: rgba(var(--theme-accent-rgb, 94, 200, 255), 0.18);
  color: var(--heading);
}

.owner-section {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.owner-section.active {
  display: flex;
  flex-direction: column;
}

.owner-section-players {
  gap: 8px;
}

/* Settings body — scrollable */
.owner-theme-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(8, 18, 28, 0.24);
  margin-bottom: 12px;
  min-width: 0;
  overflow: hidden;
}

.owner-theme-hint {
  margin-bottom: 10px;
}

.owner-settings-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  padding-top: 4px;
}

.owner-settings-body-compact {
  flex: 0 0 auto;
  overflow: visible;
  padding-right: 0;
}

/* Group header */
.owner-group-header {
  margin-top: 12px;
  margin-bottom: 5px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.owner-group-header:first-child {
  margin-top: 2px;
}

/* Individual setting row */
.owner-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  margin-bottom: 6px;
  background: rgba(8, 18, 28, 0.36);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.owner-row-overridden {
  border-color: rgba(255, 200, 70, 0.38);
  background: rgba(26, 20, 6, 0.44);
}

.owner-row-info {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 2px;
}

.owner-row-label {
  font-size: 13px;
  font-weight: 700;
  color: #e7f2fd;
  display: flex;
  align-items: center;
  gap: 7px;
}

.owner-row-desc {
  font-size: 11px;
}

.owner-restart-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffd999;
  border: 1px solid rgba(255, 200, 70, 0.4);
  border-radius: 999px;
  padding: 1px 7px;
  background: rgba(255, 200, 70, 0.1);
}

/* Right-side controls */
.owner-row-controls {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.owner-list-input {
  width: 220px;
  min-height: 70px;
  resize: vertical;
  font-size: 12px;
  line-height: 1.35;
}

.owner-switch {
  cursor: pointer;
  display: inline-flex;
}

.owner-select {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(7, 14, 22, 0.68);
  color: #e4f1fe;
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.owner-select:focus {
  border-color: rgba(94, 200, 255, 0.5);
}

.owner-number-input {
  width: 88px;
}

.owner-save-btn, .owner-reset-btn {
  white-space: nowrap;
  font-size: 12px;
  padding: 7px 10px;
}

/* Status toast in panel header */
.owner-status-msg {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  min-width: 0;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.owner-status-ok {
  color: #9ef3bf;
  background: rgba(78, 230, 130, 0.12);
  border: 1px solid rgba(78, 230, 130, 0.3);
}

.owner-status-error {
  color: #ffc0c0;
  background: rgba(255, 100, 100, 0.12);
  border: 1px solid rgba(255, 100, 100, 0.3);
}

/* ── Owner player manager ──────────────────────────────────────────── */
.owner-settings-label {
  margin-top: 8px;
  margin-bottom: 4px;
}

.owner-pm-shell {
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: rgba(8, 18, 28, 0.44);
  display: grid;
  gap: 8px;
  margin-bottom: 4px;
}

.owner-pm-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.owner-pm-head .messages-subhead {
  margin: 0;
}

.owner-pm-refresh-btn {
  font-size: 12px;
  padding: 6px 10px;
}

.owner-player-list {
  display: grid;
  gap: 5px;
  max-height: 130px;
  overflow-y: auto;
}

.owner-player-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: rgba(6, 14, 22, 0.5);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.owner-player-row:hover {
  border-color: rgba(94, 200, 255, 0.35);
  background: rgba(10, 24, 36, 0.7);
}

.owner-player-row.selected {
  border-color: rgba(255, 200, 70, 0.55);
  background: rgba(26, 20, 6, 0.55);
}

.owner-player-name {
  font-size: 13px;
  font-weight: 700;
  color: #e7f2fd;
}

.owner-player-rep {
  text-align: right;
  white-space: nowrap;
}

.owner-pm-form {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
}

.owner-pm-type-toggle {
  display: flex;
  gap: 6px;
}

.owner-pm-type-btn {
  font-size: 12px;
  padding: 7px 10px;
  white-space: nowrap;
}

.owner-pm-amount {
  min-width: 0;
}

/* ── Owner gig access manager ──────────────────────────────────────── */
.owner-ga-shell {
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: rgba(14, 28, 42, 0.6);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.owner-ga-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.owner-ga-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.owner-ga-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.owner-ga-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.owner-ga-tag {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid;
  font-weight: 600;
  white-space: nowrap;
}

.owner-ga-tag-rep {
  border-color: rgba(94, 200, 255, 0.35);
  color: rgba(160, 220, 255, 0.9);
  background: rgba(94, 200, 255, 0.08);
}

.owner-ga-granted-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.owner-ga-granted-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid rgba(255, 200, 70, 0.24);
  border-radius: 8px;
  background: rgba(26, 20, 6, 0.42);
}

.owner-ga-granted-name {
  font-size: 12px;
  font-weight: 700;
  color: #ffeaaa;
}

.owner-ga-revoke-btn {
  font-size: 11px;
  padding: 4px 9px;
}

.owner-ga-grant-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.owner-ga-select {
  min-width: 0;
}

.owner-ga-grant-btn {
  white-space: nowrap;
  font-size: 12px;
  padding: 7px 12px;
}

.owner-trust-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.owner-trust-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, auto);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(94, 200, 255, 0.22);
  border-radius: 8px;
  background: rgba(6, 21, 31, 0.5);
}

.owner-trust-info {
  min-width: 0;
}

.owner-trust-name {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-trust-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.owner-trust-controls {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.owner-trust-select {
  min-width: 0;
}

.owner-trust-apply-btn {
  white-space: nowrap;
  font-size: 11px;
  padding: 6px 10px;
}

@media (max-width: 960px) {
  .workspace { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .hero { grid-template-columns: 1fr; }
  .content { grid-template-rows: auto auto auto; }
  .active-grid { grid-template-columns: 1fr; }
  .market-subtabs { flex-wrap: wrap; }
  .market-subtab-btn { flex: 1 1 120px; }
  .market-browser-toolbar { grid-template-columns: 1fr; }
  .market-form-grid { grid-template-columns: 1fr; }
  .market-photo-shell { grid-template-columns: 1fr; }
  .market-photo-preview { width: 100%; }
  .market-payouts { grid-template-columns: 1fr; }
  .theme-preview { grid-template-columns: 1fr; }
}

@media (max-width: 1180px) {
  .theme-editor {
    grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  }

  .theme-row {
    grid-template-columns: minmax(0, 1fr) 56px 34px;
    gap: 6px;
    padding: 7px;
  }

  .theme-row-example {
    font-size: 9px;
    padding-inline: 4px;
  }
}

/* Final theme pass: keep customer color choices authoritative over later
   feature-specific tablet rules. */
.tablet-screen {
  color: var(--text);
}

.panel,
.hero-block,
.offer,
.message,
.rep-card,
.market-summary-strip,
.market-create-shell,
.market-browser-shell,
.market-results-frame,
.market-picker-card,
.market-photo-shell,
.market-row,
.market-payout-card,
.owner-subtab-btn,
.owner-theme-shell,
.owner-row,
.owner-player-row,
.owner-ga-contract,
.owner-ga-grant-form,
.owner-trust-row,
.theme-row {
  border-color: var(--line);
  background: linear-gradient(180deg, rgba(var(--theme-panel-rgb, 18, 33, 48), 0.88), rgba(var(--theme-panel2-rgb, 16, 30, 44), 0.74));
  color: var(--text);
}

.market-row,
.market-picker-card,
.market-payout-card,
.owner-row,
.owner-player-row,
.owner-trust-row,
.message,
.offer,
.theme-row {
  background: var(--card);
}

.market-input,
.owner-select,
.owner-trust-select,
.owner-list-input,
.owner-number-input,
input,
textarea,
select {
  border-color: var(--line);
  background: var(--input-bg);
  color: var(--text);
}

.brand,
.clock,
.panel-head h3,
.offer-title,
.market-row-title,
.market-row-price,
.market-photo-title,
.owner-row-label,
.owner-player-name,
.owner-trust-name,
.messages-subhead,
.value {
  color: var(--heading);
}

.hint,
.label,
.owner-row-desc,
.owner-trust-meta,
.market-row-detail,
.chip {
  color: var(--muted);
}

.app-btn,
.owner-subtab-btn,
.action,
.close-btn {
  border-color: var(--line);
  color: var(--buttonText, var(--text));
}

.app-btn.active,
.market-subtab-btn.active,
.market-type-btn.active,
.owner-subtab-btn.active,
.owner-pm-type-btn.active,
.action:not(.action-secondary):not(.action-danger) {
  border-color: rgba(var(--theme-accent-rgb, 94, 200, 255), 0.65);
  background: linear-gradient(180deg, rgba(var(--theme-accent-rgb, 94, 200, 255), 0.34), rgba(var(--theme-accent-rgb, 94, 200, 255), 0.16));
  color: var(--buttonText, var(--text));
}

.app-btn:hover,
.owner-subtab-btn:hover,
.action:hover,
.close-btn:hover,
.market-picker-card.selected,
.market-row.selected {
  border-color: rgba(var(--theme-accent-rgb, 94, 200, 255), 0.55);
  background: rgba(var(--theme-accent-rgb, 94, 200, 255), 0.14);
}

.switch input:checked + .switch-track,
.market-kind-pill,
.market-type-btn.active,
.market-subtab-btn.active {
  border-color: rgba(var(--theme-accent-rgb, 94, 200, 255), 0.55);
  background: rgba(var(--theme-accent-rgb, 94, 200, 255), 0.16);
  color: var(--heading);
}

.owner-tab-btn,
.owner-tab-btn:hover,
.owner-tab-btn.active,
.owner-row-overridden {
  border-color: rgba(var(--theme-ownerAccent-rgb, 255, 200, 70), 0.55);
  background: rgba(var(--theme-ownerAccent-rgb, 255, 200, 70), 0.12);
  color: var(--owner-accent);
}

.market-silent-btn.active,
.action-block,
.action-block:hover {
  border-color: rgba(var(--theme-warning-rgb, 255, 194, 94), 0.55);
  background: rgba(var(--theme-warning-rgb, 255, 194, 94), 0.12);
  color: var(--warning);
}

.action-danger,
.action-danger:hover,
.owner-status-error {
  border-color: rgba(var(--theme-danger-rgb, 255, 105, 105), 0.45);
  background: rgba(var(--theme-danger-rgb, 255, 105, 105), 0.14);
  color: var(--danger);
}

.owner-status-ok,
.market-create-status.success,
.life-text-stable {
  color: var(--success);
}

.owner-restart-badge,
.market-kind-pill-muted,
.life-text-warning {
  color: var(--warning);
}
