@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&family=Roboto+Mono:wght@400;500;600&display=swap');

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

:root {
  --bg:        #eef2ff;
  --surface:   #ffffff;
  --border:    #e2e8f0;
  --border-l:  #f1f5f9;
  --text:      #0f172a;
  --muted:     #64748b;

  --blue:      #3b82f6;
  --blue-d:    #2563eb;
  --blue-l:    #dbeafe;
  --green:     #10b981;
  --green-d:   #059669;
  --green-l:   #d1fae5;
  --red:       #ef4444;
  --red-d:     #dc2626;
  --red-l:     #fee2e2;
  --amber:     #f59e0b;
  --amber-d:   #d97706;
  --amber-l:   #fef3c7;
  --purple:    #8b5cf6;
  --purple-d:  #7c3aed;
  --purple-l:  #ede9fe;
  --teal:      #14b8a6;
  --teal-l:    #ccfbf1;
  --pink:      #ec4899;
  --pink-l:    #fce7f3;

  --nav-bg:    #0f172a;
  --shadow-sm: 0 1px 3px rgba(15,23,42,.07), 0 1px 2px rgba(15,23,42,.05);
  --shadow:    0 4px 16px rgba(15,23,42,.10), 0 2px 4px rgba(15,23,42,.06);
  --shadow-lg: 0 12px 40px rgba(15,23,42,.14), 0 4px 8px rgba(15,23,42,.06);
}

body {
  font-family: 'Roboto', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

.num  { font-family: 'Roboto Mono', monospace; }
.up   { color: var(--green-d); }
.down { color: var(--red-d);   }

/* ── Scrollbar ── */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Navbar ── */
.navbar {
  background: var(--nav-bg);
  position: sticky; top: 0; z-index: 30;
  border-bottom: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.navbar-inner {
  max-width: 1600px; margin: 0 auto;
  padding: 0 24px; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
}
.navbar-logo {
  font-weight: 700; font-size: 17px; color: #fff; letter-spacing: .4px;
}
.navbar-logo span {
  background: linear-gradient(90deg, #818cf8, #a78bfa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.navbar-nav  { display: flex; gap: 2px; margin-left: 8px; }
.nav-link {
  padding: 6px 14px; border-radius: 5px;
  font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,.6);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.nav-link:hover  { background: rgba(255,255,255,.10); color: rgba(255,255,255,.9); }
.nav-link.active { background: rgba(255,255,255,.14); color: #fff; }
.navbar-right { display: flex; align-items: center; gap: 10px; }
.navbar-right .text-muted,
.navbar-right .text-xs { color: rgba(255,255,255,.45); }

/* ── Live pulse dot ── */
@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,.6); }
  60%       { box-shadow: 0 0 0 5px rgba(16,185,129,0); }
}
@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.6); }
  60%       { box-shadow: 0 0 0 5px rgba(239,68,68,0); }
}
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot-green { background: var(--green); animation: pulse-green 2s infinite; }
.dot-red   { background: var(--red);   animation: pulse-red   2s infinite; }
.dot-gray  { background: #475569; }

/* ── Page ── */
.page { max-width: 1600px; margin: 0 auto; padding: 24px; }

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 13px 20px;
  border-bottom: 1px solid var(--border-l);
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(to bottom, #fafcff, #f8fafc);
}
.card-title {
  font-size: 13px; font-weight: 700; color: var(--text); letter-spacing: .2px;
}
.card-body { padding: 16px 20px; }

/* ── Stat cards ── */
.stats-bar   { display: grid; gap: 12px; }
.stats-bar-4 { grid-template-columns: repeat(4,1fr); }
.stats-bar-5 { grid-template-columns: repeat(5,1fr); }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-card-accent {
  height: 4px;
  background: var(--blue);
  border-radius: 0;
}
.stat-card[data-accent="teal"]   .stat-card-accent { background: linear-gradient(90deg, var(--teal), #06b6d4); }
.stat-card[data-accent="purple"] .stat-card-accent { background: linear-gradient(90deg, var(--purple), #6366f1); }
.stat-card[data-accent="amber"]  .stat-card-accent { background: linear-gradient(90deg, var(--amber), #f97316); }
.stat-card[data-accent="green"]  .stat-card-accent { background: linear-gradient(90deg, var(--green), #34d399); }
.stat-card[data-accent="red"]    .stat-card-accent { background: linear-gradient(90deg, var(--red), #f87171); }
.stat-card-body { padding: 12px 16px 14px; }
.stat-label {
  font-size: 10px; color: var(--muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 5px;
}
.stat-value {
  font-size: 22px; font-weight: 700;
  font-family: 'Roboto Mono', monospace; color: var(--text);
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: 5px; border: 1px solid transparent;
  font-size: 13px; font-weight: 500; font-family: 'Roboto', sans-serif;
  cursor: pointer; transition: all .15s; text-decoration: none;
  letter-spacing: .2px;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff; border-color: #2563eb;
  box-shadow: 0 2px 8px rgba(37,99,235,.35);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 4px 14px rgba(37,99,235,.45);
  transform: translateY(-1px);
}
.btn-danger {
  background: var(--red-l); color: var(--red-d); border-color: #fca5a5;
}
.btn-danger:hover:not(:disabled) { background: #fecaca; }

.btn-default {
  background: var(--surface); color: var(--text);
  border-color: var(--border); box-shadow: var(--shadow-sm);
}
.btn-default:hover:not(:disabled) { background: #f8fafc; box-shadow: var(--shadow); }

.btn-ghost { background: transparent; color: rgba(255,255,255,.8); border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,.12); color: #fff; }

.btn-sm { padding: 4px 11px; font-size: 12px; }

/* ── Badge ── */
.badge {
  display: inline-block; padding: 2px 9px;
  border-radius: 5px; font-size: 11px; font-weight: 700;
  letter-spacing: .3px;
}
.badge-green { background: var(--green-l);  color: #065f46; }
.badge-red   { background: var(--red-l);    color: #991b1b; }
.badge-gray  { background: #f1f5f9;         color: var(--muted); }
.badge-amber { background: var(--amber-l);  color: #92400e; }
.badge-blue  { background: var(--blue-l);   color: #1e40af; }

/* ── Form controls ── */
.form-input {
  width: 100%; max-width: 360px;
  padding: 8px 12px;
  border: 1.5px solid var(--border); border-radius: 5px;
  font-size: 13px; font-family: 'Roboto', sans-serif; color: var(--text);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.form-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59,130,246,.18);
}
.form-input-mono { font-family: 'Roboto Mono', monospace; font-size: 12px; }
.form-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.form-hint  { font-size: 11px; color: var(--muted); margin-top: 3px; }
.form-row   {
  display: grid; grid-template-columns: 200px 1fr; gap: 16px;
  align-items: start; padding: 12px 0; border-bottom: 1px solid var(--border-l);
}
.form-row:last-child { border-bottom: none; }

/* ── Table ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }

thead tr:first-child th { border-bottom: none; }
thead th {
  padding: 9px 10px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
thead tr:first-child th.th-ce {
  background: linear-gradient(to bottom, #ecfdf5, #d1fae5);
  color: var(--green-d); border-bottom: 2px solid #6ee7b7;
}
thead tr:first-child th.th-pe {
  background: linear-gradient(to bottom, #fff5f5, #fee2e2);
  color: var(--red-d); border-bottom: 2px solid #fca5a5;
}
thead tr:first-child th.th-strike {
  background: #f8fafc; border-bottom: 2px solid var(--border);
}

tbody tr { border-top: 1px solid #f1f5f9; transition: background .1s; }
tbody tr:hover { background: #f8fafc; }
tbody td { padding: 7px 10px; white-space: nowrap; font-family: 'Roboto Mono', monospace; }

.ce-col { background: rgba(16,185,129,.03); }
.pe-col { background: rgba(239,68,68,.03); }
tbody tr:hover .ce-col { background: rgba(16,185,129,.07); }
tbody tr:hover .pe-col { background: rgba(239,68,68,.07); }

.tr-atm .ce-col { background: rgba(245,158,11,.10) !important; }
.tr-atm .pe-col { background: rgba(245,158,11,.10) !important; }
.tr-atm { background: var(--amber-l) !important; }
.tr-atm:hover { background: #fde68a !important; }

/* ── Strike column ── */
.strike-col {
  text-align: center; font-weight: 700; font-size: 12px;
  background: #f8fafc;
  border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  color: var(--text);
}
.strike-col-atm { background: var(--amber-l); color: #92400e; }

/* ── Summary rows ── */
.repeat-head-row td {
  background: #e8edf5; font-size: 10px; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
  padding: 7px 10px; border-top: 2px solid var(--border);
  font-family: 'Roboto', sans-serif;
}
.totals-row td     { background: #f0fdf4; font-weight: 600; color: #065f46; border-top: 1px solid #a7f3d0; }
.difference-row td { background: var(--blue-l); font-weight: 600; color: #1e40af; border-top: 1px solid #93c5fd; }
.recorded-row td   { background: var(--amber-l); font-weight: 500; color: #92400e; border-top: 1px solid #fcd34d; }
.middle-row td     { background: var(--purple-l); font-weight: 700; color: #5b21b6; border-top: 1px solid #c4b5fd; }
.middle-row .mid-label { font-size: 10px; font-weight: 600; color: var(--purple-d); display: block; line-height: 1.4; text-transform: uppercase; letter-spacing: .05em; }
.middle-row .mid-val   { font-size: 15px; font-weight: 700; font-family: 'Roboto Mono', monospace; }
.max-highlight     { background: var(--blue-l) !important; font-weight: 700 !important; color: var(--blue-d) !important; }

/* ── Day Type card ── */
.dt-card {
  display: flex; align-items: stretch;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-sm);
  overflow: hidden; margin-bottom: 20px;
}
.dt-main {
  padding: 20px 32px; min-width: 180px; text-align: center;
  border-right: 1px solid var(--border);
  background: linear-gradient(to bottom, #fafcff, #f0f4ff);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.dt-main-label {
  font-size: 10px; color: var(--muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px;
}
.dt-main-value { font-size: 26px; font-weight: 700; font-family: 'Roboto Mono', monospace; }
.dt-main-value.ce  { color: var(--green-d); }
.dt-main-value.pe  { color: var(--red-d);   }
.dt-main-value.neu { color: var(--muted);   }
.dt-conds { display: flex; flex: 1; }
.dt-cond {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 16px 20px; gap: 6px;
  border-right: 1px solid var(--border-l);
  transition: background .15s;
}
.dt-cond:last-child { border-right: none; }
.dt-cond:hover { background: #fafcff; }
.dt-cond-title {
  font-size: 10px; color: var(--muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
}
.dt-cond-val { font-size: 13px; font-weight: 700; font-family: 'Roboto Mono', monospace; }
.dt-cond-met     { color: var(--green-d); }
.dt-cond-unmet   { color: var(--red-d);   }
.dt-cond-neutral { color: #94a3b8;        }

/* ── Sidebar / Simulator ── */
.split-layout { display: grid; grid-template-columns: 280px 1fr; gap: 20px; }
.combo-list   { display: flex; flex-direction: column; gap: 8px; }
.combo-item {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 12px 14px;
  cursor: pointer; text-align: left; width: 100%;
  transition: border-color .15s, box-shadow .15s, transform .1s;
  box-shadow: var(--shadow-sm);
}
.combo-item:hover  { border-color: var(--blue); box-shadow: var(--shadow); transform: translateX(2px); }
.combo-item.selected { border-color: var(--blue); background: var(--blue-l); }
.combo-key   { font-family: 'Roboto Mono', monospace; font-size: 11px; font-weight: 600; }
.combo-meta  { display: flex; justify-content: space-between; align-items: center; margin-top: 5px; }
.combo-trades { font-size: 11px; color: var(--muted); }
.combo-pnl   { font-family: 'Roboto Mono', monospace; font-size: 12px; font-weight: 700; }

/* ── Flex utils ── */
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.ml-auto { margin-left: auto; }
.mb-4    { margin-bottom: 16px; }
.mb-5    { margin-bottom: 20px; }
.text-sm    { font-size: 13px; }
.text-xs    { font-size: 11px; }
.text-muted { color: var(--muted); }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--nav-bg); color: #f8fafc;
  padding: 11px 18px; border-radius: 8px; font-size: 13px;
  border-left: 3px solid var(--blue);
  opacity: 0; transition: opacity .25s, transform .25s;
  pointer-events: none; z-index: 100;
  box-shadow: var(--shadow-lg); transform: translateY(8px);
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ── Login ── */
.login-wrap {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 45%, #0c4a6e 100%);
  padding: 24px;
}
.login-card {
  background: #fff; border-radius: 12px;
  width: 100%; max-width: 380px;
  box-shadow: 0 24px 64px rgba(0,0,0,.4);
  overflow: hidden;
}
.login-card-top {
  height: 5px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6, #06b6d4);
}
.login-card-body { padding: 36px 32px 32px; }
.login-logo {
  text-align: center; margin-bottom: 28px;
  font-size: 22px; font-weight: 700; color: var(--text);
}
.login-logo span {
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.login-subtitle {
  text-align: center; font-size: 13px; color: var(--muted); margin-top: 4px; margin-bottom: 28px;
}
.login-label  { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.login-input  {
  width: 100%; padding: 10px 14px; margin-bottom: 16px;
  border: 1.5px solid var(--border); border-radius: 5px;
  font-size: 14px; font-family: 'Roboto', sans-serif; color: var(--text);
  background: #fafafa; outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.login-input:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px rgba(59,130,246,.18); }
.btn-login {
  width: 100%; padding: 11px; font-size: 14px; font-weight: 700;
  justify-content: center; margin-top: 6px; border-radius: 5px;
}
.error-msg {
  background: var(--red-l); border: 1px solid #fca5a5;
  color: var(--red-d); border-radius: 5px;
  padding: 9px 12px; font-size: 13px; margin-top: 12px;
}

/* ── Condition Cards (C1–C5) ── */
.cond-cards-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.cond-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 16px 48px 16px;
  position: relative;
  overflow: hidden;
  transition: border-color .3s;
  min-height: 130px;
  box-shadow: var(--shadow-sm);
}
.cond-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent, var(--blue));
  opacity: .45;
}
.cond-card.cc-active::before  { background: var(--green);  opacity: 1; }
.cond-card.cc-sell::before    { background: var(--red);    opacity: 1; }
.cond-card.cc-buy::before     { background: var(--green);  opacity: 1; }
.cond-card.cc-fired::before   { background: var(--amber);  opacity: 1; animation: cond-pulse .9s infinite; }
@keyframes cond-pulse { 0%,100%{opacity:1} 50%{opacity:.25} }
.card-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 10px;
  font-weight: 500;
}
.card-main {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 6px;
  font-family: 'Roboto Mono', monospace;
}
.card-main.cm-green  { color: var(--green-d); }
.card-main.cm-red    { color: var(--red-d);   }
.card-main.cm-amber  { color: var(--amber-d); }
.card-main.cm-muted  { color: var(--muted);   }
.card-sub {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}
.card-sub span { color: var(--text); }
.card-br {
  position: absolute;
  bottom: 12px; right: 16px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1;
}

/* ── Settings ── */
.section-gap    { margin-bottom: 20px; }
.expiry-item    { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.expiry-tag     {
  font-family: 'Roboto Mono', monospace; font-size: 12px;
  background: var(--blue-l); border: 1px solid #93c5fd;
  border-radius: 5px; padding: 5px 12px; color: #1e40af; min-width: 130px;
}
.btn-remove     { background: none; border: none; color: #cbd5e1; font-size: 16px; cursor: pointer; line-height: 1; padding: 2px 6px; border-radius: 3px; transition: color .15s, background .15s; }
.btn-remove:hover { color: var(--red-d); background: var(--red-l); }
.add-expiry-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.save-bar       { position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--border); padding: 14px 0; margin-top: 24px; display: flex; align-items: center; gap: 12px; }
.saved-msg      { font-size: 13px; color: var(--green-d); font-weight: 600; }


/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE — Tablet & Mobile
   ══════════════════════════════════════════════════════════════════ */

/* ── Tablet (≤ 900px) ── */
@media (max-width: 900px) {
  .stats-bar-5 { grid-template-columns: repeat(3, 1fr); }
  .stats-bar-4 { grid-template-columns: repeat(2, 1fr); }
  .split-layout { grid-template-columns: 220px 1fr; }
  .cond-cards-row { grid-template-columns: repeat(2, 1fr); }
}

/* ── Mobile (≤ 768px) ── */
@media (max-width: 768px) {

  /* Page */
  .page { padding: 10px; }

  /* ── Navbar ── */
  .navbar-inner {
    height: auto;
    padding: 10px 12px 0;
    align-items: flex-start;
  }
  /* Logo + nav container: stack logo above nav links */
  .navbar-inner > div:first-child {
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
    min-width: 0;
    gap: 0;
  }
  .navbar-logo { font-size: 15px; padding-bottom: 2px; }
  .navbar-nav {
    margin-left: 0;
    overflow-x: auto;
    scrollbar-width: none;
    flex-wrap: nowrap;
    padding: 4px 0 8px;
    gap: 2px;
    width: 100%;
  }
  .navbar-nav::-webkit-scrollbar { height: 0; }
  .nav-link { white-space: nowrap; font-size: 12px; padding: 5px 10px; }
  .navbar-right { flex-shrink: 0; padding-top: 2px; gap: 6px; }

  /* ── Top bar: stats + buttons — vertical stack ── */
  .flex-between.mb-5 {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  /* Override inline margin-right on stats div */
  .flex-between.mb-5 > .stats-bar { margin-right: 0 !important; }
  .flex-between.mb-5 > div:last-child { justify-content: flex-end; flex-wrap: wrap; gap: 6px; }

  /* ── Stat cards — 2 columns ── */
  .stats-bar-5,
  .stats-bar-4 { grid-template-columns: repeat(2, 1fr); }
  .stat-card-body { padding: 10px 12px 12px; }
  .stat-label     { font-size: 9px; }
  .stat-value     { font-size: 18px; }

  /* ── Day Type card — vertical layout ── */
  .dt-card { flex-direction: column; }
  .dt-main {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    min-width: unset;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 14px;
  }
  .dt-main-label { margin-bottom: 0; }
  .dt-main-value { font-size: 22px; }
  .dt-conds { overflow-x: auto; scrollbar-width: none; }
  .dt-conds::-webkit-scrollbar { height: 0; }
  .dt-cond  { min-width: 90px; padding: 12px 14px; }

  /* ── Condition cards — 2 columns ── */
  .cond-cards-row { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .cond-card { padding: 12px 12px 42px; min-height: 108px; }
  .card-main { font-size: 18px; }
  .card-br   { font-size: 20px; bottom: 10px; right: 12px; }
  .card-label { font-size: 9px; letter-spacing: 1px; }

  /* ── Cards ── */
  .card-body   { padding: 12px 14px; }
  .card-header { padding: 10px 14px; flex-wrap: wrap; gap: 6px; }
  .card-title  { font-size: 12px; }

  /* ── Form rows — single column ── */
  .form-row { grid-template-columns: 1fr; gap: 4px; padding: 10px 0; }
  .form-input { max-width: 100%; }

  /* ── Split layout (Simulator) — stack ── */
  .split-layout { grid-template-columns: 1fr; }
  .combo-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
  }

  /* ── Tables ── */
  tbody td { padding: 6px 8px; font-size: 11px; }
  thead th { padding: 7px 8px; font-size: 9px; }

  /* ── Toast ── */
  .toast { bottom: 14px; right: 14px; left: 14px; font-size: 12px; }

  /* ── Save bar (Settings) ── */
  .save-bar { flex-wrap: wrap; gap: 8px; padding: 10px 0; }

  /* ── Buttons ── */
  .btn    { padding: 6px 13px; font-size: 12px; }
  .btn-sm { padding: 4px 10px; font-size: 11px; }
}

/* ── Small mobile (≤ 480px) ── */
@media (max-width: 480px) {
  .page { padding: 8px; }

  .navbar-logo { font-size: 13px; }

  .stats-bar-5,
  .stats-bar-4 { grid-template-columns: 1fr 1fr; }
  .stat-value  { font-size: 15px; }

  .cond-cards-row { grid-template-columns: 1fr 1fr; gap: 6px; }
  .cond-card  { padding: 10px 10px 38px; min-height: 96px; }
  .card-main  { font-size: 15px; }
  .card-br    { font-size: 18px; bottom: 8px; right: 8px; }
  .card-label { letter-spacing: .5px; }
  .card-sub   { font-size: 10px; }

  .dt-main-value  { font-size: 18px; }
  .dt-cond        { padding: 10px 10px; min-width: 76px; }
  .dt-cond-val    { font-size: 12px; }
  .dt-cond-title  { font-size: 9px; }

  .combo-list { grid-template-columns: 1fr 1fr; }
  .combo-item { padding: 9px 10px; }
  .combo-key  { font-size: 10px; }

  thead th { padding: 5px 6px; font-size: 9px; }
  tbody td { padding: 5px 6px; font-size: 11px; }

  .btn    { font-size: 12px; padding: 6px 11px; }
  .btn-sm { font-size: 11px; padding: 3px 8px; }
}
