/* Meridian — STR Ops */

:root, [data-theme="light"] {
  --paper: #F6F3EC;           /* warm off-white, the main canvas */
  --paper-2: #EFEBE1;         /* subtle surface */
  --card: #FFFFFF;
  --ink: #14170F;             /* near-black with green bias */
  --ink-2: #3A3D33;
  --ink-3: #6B6E62;
  --ink-4: #9A9C91;
  --rule: #E3DED1;            /* warm hairline */
  --rule-2: #D5CFBE;
  --accent: #2F4A2B;          /* deep moss */
  --accent-2: #4B6B43;
  --accent-ink: #F6F3EC;
  --gold: #B98A2E;
  --rose: #C24A3D;
  --sky: #3F6787;
  --status-ok: #3F7A4A;
  --status-warn: #B98A2E;
  --status-risk: #C24A3D;
  --kbd: #E8E3D4;
  --shadow-1: 0 1px 0 rgba(20, 23, 15, 0.04), 0 1px 2px rgba(20, 23, 15, 0.04);
  --shadow-2: 0 2px 6px rgba(20, 23, 15, 0.06), 0 8px 24px rgba(20, 23, 15, 0.06);
}

[data-theme="dark"] {
  --paper: #0F110C;
  --paper-2: #16190F;
  --card: #1B1E14;
  --ink: #EDE9DC;
  --ink-2: #C6C3B5;
  --ink-3: #8E8F82;
  --ink-4: #63655C;
  --rule: #2A2D21;
  --rule-2: #3A3D30;
  --accent: #B6D39B;
  --accent-2: #9BBE80;
  --accent-ink: #0F110C;
  --gold: #D9B260;
  --rose: #E07F71;
  --sky: #8FB2CE;
  --status-ok: #9BBE80;
  --status-warn: #D9B260;
  --status-risk: #E07F71;
  --kbd: #2A2D21;
  --shadow-1: 0 1px 0 rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-2: 0 2px 6px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.3);
}

[data-accent="moss"]   { --accent: #2F4A2B; --accent-2: #4B6B43; }
[data-accent="ink"]    { --accent: #1E2430; --accent-2: #2F3847; }
[data-accent="rust"]   { --accent: #8C3A1E; --accent-2: #A9522F; }
[data-accent="cobalt"] { --accent: #1E3A7A; --accent-2: #2B4E9B; }
[data-theme="dark"][data-accent="moss"]   { --accent: #B6D39B; --accent-2: #9BBE80; --accent-ink:#0F110C;}
[data-theme="dark"][data-accent="ink"]    { --accent: #AEB8CA; --accent-2: #95A1B8; --accent-ink:#0F110C;}
[data-theme="dark"][data-accent="rust"]   { --accent: #E9A488; --accent-2: #D38B6E; --accent-ink:#0F110C;}
[data-theme="dark"][data-accent="cobalt"] { --accent: #9CB4E5; --accent-2: #7E9DD8; --accent-ink:#0F110C;}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--paper); color: var(--ink); font-family: 'Inter', system-ui, sans-serif; font-size: 14px; letter-spacing: -0.005em; }
body { min-height: 100vh; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input, textarea, select { font: inherit; color: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--rule-2); border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

.serif { font-family: 'Fraunces', 'Times New Roman', serif; font-feature-settings: "ss01"; letter-spacing: -0.015em; }
.mono  { font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.tnum  { font-variant-numeric: tabular-nums; }

/* ───────────────── App shell ───────────────── */

.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--paper);
  border-right: 1px solid var(--rule);
  padding: 20px 16px;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 18px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px;
}
.logo-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--ink); color: var(--paper);
  display: grid; place-items: center; font-family: 'Fraunces', serif; font-weight: 600; font-size: 17px;
}
.logo-word { font-family: 'Fraunces', serif; font-size: 18px; font-weight: 500; letter-spacing: -0.02em; }
.logo-sub { font-size: 11px; color: var(--ink-3); margin-left: auto; }

.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 10px; letter-spacing: 0.12em; color: var(--ink-4); text-transform: uppercase; padding: 6px 10px; font-weight: 600; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 8px;
  color: var(--ink-2); font-size: 13.5px; font-weight: 450;
  cursor: pointer; transition: background 120ms, color 120ms;
  position: relative;
}
.nav-item:hover { background: var(--paper-2); color: var(--ink); }
.nav-item.active { background: var(--ink); color: var(--paper); }
.nav-item.active .nav-icon { color: var(--paper); }
.nav-item .nav-icon { width: 16px; height: 16px; color: var(--ink-3); flex: 0 0 16px; }
.nav-item.active .nav-icon { color: var(--paper); }
.nav-item .nav-badge {
  margin-left: auto; font-size: 11px; font-weight: 500;
  background: var(--paper-2); padding: 2px 7px; border-radius: 10px; color: var(--ink-3);
}
.nav-item.active .nav-badge { background: rgba(255,255,255,0.14); color: var(--paper); }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding-top: 12px; border-top: 1px solid var(--rule); }
.portfolio-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 10px;
  background: var(--paper-2);
  cursor: pointer;
}
.portfolio-pill .pav { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 600; font-size: 12px; }
.portfolio-pill .pinfo { flex: 1; min-width: 0; }
.portfolio-pill .pinfo .pname { font-size: 12.5px; font-weight: 500; color: var(--ink); }
.portfolio-pill .pinfo .pmeta { font-size: 11px; color: var(--ink-3); }

/* ───────────────── Main area ───────────────── */
.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  position: sticky; top: 0; z-index: 5;
  background: rgba(246, 243, 236, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
  padding: 14px 32px;
  display: flex; align-items: center; gap: 20px;
}
[data-theme="dark"] .topbar { background: rgba(15, 17, 12, 0.85); }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.crumbs .now { color: var(--ink); font-weight: 500; }
.topbar-search {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 10px; padding: 7px 12px;
  width: 360px; color: var(--ink-3);
  transition: border 120ms, background 120ms;
}
.topbar-search:focus-within { border-color: var(--accent); background: var(--card); }
.topbar-search input { border: 0; background: transparent; outline: none; flex: 1; font-size: 13.5px; color: var(--ink); }
.topbar-search input::placeholder { color: var(--ink-4); }
.kbd { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; background: var(--kbd); padding: 1px 6px; border-radius: 4px; color: var(--ink-3); }

.iconbtn {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  color: var(--ink-2);
  border: 1px solid transparent;
  transition: background 120ms, border 120ms;
  position: relative;
}
.iconbtn:hover { background: var(--paper-2); border-color: var(--rule); }
.iconbtn .dot { position: absolute; top: 6px; right: 7px; width: 7px; height: 7px; background: var(--rose); border-radius: 50%; border: 2px solid var(--paper); }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 500;
  border: 1px solid var(--rule);
  background: var(--card);
  color: var(--ink);
  transition: all 120ms;
}
.btn:hover { border-color: var(--rule-2); }
.btn-primary {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}
.btn-primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn-accent {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
}
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--paper-2); }

/* Pages */
.page { padding: 28px 32px 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-title {
  font-family: 'Fraunces', serif;
  font-size: 40px; font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--ink);
}
.page-title em { font-style: italic; color: var(--ink-3); font-weight: 400; }
.page-sub { font-size: 13px; color: var(--ink-3); margin-top: 8px; }

.section-title {
  font-family: 'Fraunces', serif;
  font-size: 22px; font-weight: 400; letter-spacing: -0.02em;
  color: var(--ink);
}
.eyebrow { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-4); font-weight: 600; }

/* Card */
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 20px;
}
.card-tight { padding: 16px; }
.card-flat { background: transparent; border: 1px solid var(--rule); border-radius: 14px; padding: 20px; }
.card-ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.card-ink .ink-muted { color: rgba(246,243,236,0.62); }

/* ───────────── Dashboard ───────────── */
.kpi-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; border: 1px solid var(--rule); border-radius: 14px; background: var(--card); overflow: hidden; }
.kpi { padding: 18px 22px; border-right: 1px solid var(--rule); position: relative; }
.kpi:last-child { border-right: 0; }
.kpi .kpi-label { font-size: 11px; color: var(--ink-3); letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500; }
.kpi .kpi-value { font-family: 'Fraunces', serif; font-weight: 400; font-size: 32px; letter-spacing: -0.02em; margin-top: 8px; line-height: 1; }
.kpi .kpi-delta { font-size: 12px; margin-top: 8px; display: flex; align-items: center; gap: 6px; color: var(--ink-3); }
.kpi .kpi-delta .up { color: var(--status-ok); font-weight: 500; }
.kpi .kpi-delta .down { color: var(--status-risk); font-weight: 500; }
.kpi .kpi-spark { position: absolute; bottom: 12px; right: 18px; opacity: 0.5; }

/* Timeline — the surprise */
.timeline-card { padding: 0; overflow: hidden; }
.timeline-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--rule); }
.timeline-legend { display: flex; gap: 16px; font-size: 11.5px; color: var(--ink-3); }
.timeline-legend .dotl { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: middle; }
.timeline-stage { position: relative; padding: 28px 22px 18px; }
.timeline-axis {
  position: relative; height: 18px; margin-bottom: 6px;
  border-bottom: 1px solid var(--rule);
  user-select: none;
}
.timeline-tick { position: absolute; bottom: 0; transform: translateX(-50%); font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--ink-4); padding-bottom: 4px; }
.timeline-tick::before { content:''; position: absolute; bottom: -5px; left: 50%; width: 1px; height: 5px; background: var(--rule-2); }

.scrubber {
  position: absolute; top: 10px; bottom: 10px;
  width: 2px; background: var(--accent);
  box-shadow: 0 0 0 3px rgba(47,74,43,0.12);
  cursor: ew-resize;
  z-index: 3;
  transition: left 40ms linear;
}
.scrubber::before {
  content: ''; position: absolute; top: -6px; left: -6px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 3px var(--card);
}
.scrubber-time {
  position: absolute; top: -26px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--paper);
  padding: 3px 8px; border-radius: 6px; font-family: 'JetBrains Mono', monospace; font-size: 11px;
  white-space: nowrap;
}

.timeline-rows { display: flex; flex-direction: column; gap: 2px; }
.timeline-row {
  position: relative; height: 44px;
  display: flex; align-items: center;
  border-radius: 6px;
}
.timeline-row:hover { background: var(--paper-2); }
.trow-label {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 200px; display: flex; align-items: center; gap: 10px;
  font-size: 12.5px;
  z-index: 2;
  padding-right: 12px;
}
.trow-label .pic { width: 28px; height: 28px; border-radius: 6px; background: var(--paper-2); background-size: cover; background-position: center; border: 1px solid var(--rule); flex: 0 0 28px; display: grid; place-items: center; font-family: 'Fraunces', serif; font-size: 14px; color: var(--ink-3); }
.trow-label .tmeta { min-width: 0; }
.trow-label .tname { font-weight: 500; color: var(--ink); }
.trow-label .tprop { font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.timeline-track { position: absolute; left: 212px; right: 0; top: 0; bottom: 0; }
.tblock {
  position: absolute; top: 50%; transform: translateY(-50%);
  height: 22px; border-radius: 11px;
  display: flex; align-items: center; padding: 0 10px;
  font-size: 11px; font-weight: 500; gap: 6px;
  cursor: pointer; transition: transform 140ms, box-shadow 140ms;
  white-space: nowrap; overflow: hidden;
}
.tblock:hover { transform: translateY(-50%) scale(1.02); box-shadow: var(--shadow-1); z-index: 2; }
.tblock.stay { background: var(--accent); color: var(--accent-ink); }
.tblock.turnover { background: repeating-linear-gradient(45deg, var(--gold), var(--gold) 4px, rgba(185,138,46,0.65) 4px, rgba(185,138,46,0.65) 8px); color: #2a1e06; }
.tblock.checkout-span { background: rgba(63,103,135,0.18); color: var(--sky); border: 1px dashed var(--sky); }
.tblock.checkin-span { background: rgba(63,122,74,0.18); color: var(--status-ok); border: 1px dashed var(--status-ok); }
.tblock.active {
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--accent);
}

.pulse-dot {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); z-index: 2;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(47,74,43,0.45); }
  50%     { box-shadow: 0 0 0 10px rgba(47,74,43,0); }
}

.timeline-now {
  position: absolute; top: 30px; bottom: 10px;
  width: 1px; background: var(--rose); z-index: 1; opacity: 0.7;
  pointer-events: none;
}
.timeline-now::before {
  content: 'NOW'; position: absolute; top: -14px; left: -16px;
  font-family: 'JetBrains Mono', monospace; font-size: 9px; color: var(--rose);
  letter-spacing: 0.1em;
}

/* Right rail */
.rail { display: flex; flex-direction: column; gap: 16px; }

.stat-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--rule); font-size: 13px; }
.stat-row:last-child { border-bottom: 0; }
.stat-row .lbl { color: var(--ink-3); }
.stat-row .val { font-family: 'JetBrains Mono', monospace; color: var(--ink); font-weight: 500; font-size: 13px; }

/* Heatmap */
.heatmap { display: grid; grid-template-columns: 110px repeat(30, 1fr); gap: 2px; font-size: 11px; }
.heatmap .hm-head { color: var(--ink-4); font-family: 'JetBrains Mono', monospace; font-size: 10px; text-align: center; padding-bottom: 4px; }
.heatmap .hm-prop { color: var(--ink-2); font-size: 12px; padding-right: 10px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.heatmap .hm-prop .pdot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-4); }
.hm-cell {
  aspect-ratio: 1 / 1;
  border-radius: 3px;
  background: var(--paper-2);
  cursor: pointer;
  transition: transform 120ms;
}
.hm-cell:hover { transform: scale(1.3); z-index: 1; position: relative; }
.hm-cell.booked { background: var(--accent); }
.hm-cell.booked.soft { background: var(--accent-2); opacity: 0.75; }
.hm-cell.blocked { background: repeating-linear-gradient(45deg, var(--ink-3), var(--ink-3) 2px, transparent 2px, transparent 4px); }
.hm-cell.today { outline: 1.5px solid var(--rose); outline-offset: -1px; }

/* Inbox items */
.msg-item { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--rule); cursor: pointer; }
.msg-item:last-child { border-bottom: 0; }
.msg-item:hover .msg-name { color: var(--accent); }
.msg-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--paper-2); color: var(--ink-2); display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: 0 0 32px; }
.msg-body { flex: 1; min-width: 0; }
.msg-row1 { display: flex; justify-content: space-between; gap: 8px; }
.msg-name { font-size: 13px; font-weight: 500; }
.msg-time { font-size: 11px; color: var(--ink-4); font-family: 'JetBrains Mono', monospace; flex: 0 0 auto; }
.msg-preview { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-tag { display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 4px; margin-top: 4px; font-weight: 500; letter-spacing: 0.04em; }
.msg-tag.urgent { background: rgba(194,74,61,0.12); color: var(--rose); }
.msg-tag.ai { background: rgba(47,74,43,0.1); color: var(--accent-2); }

/* Tables */
.table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
.table th {
  text-align: left;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600;
  color: var(--ink-4);
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
}
.table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--rule);
}
.table tr:hover td { background: var(--paper-2); cursor: pointer; }
.table tr:last-child td { border-bottom: 0; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 500;
  padding: 3px 8px; border-radius: 20px;
  background: var(--paper-2); color: var(--ink-2);
}
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-4); }
.chip.ok::before { background: var(--status-ok); }
.chip.warn::before { background: var(--status-warn); }
.chip.risk::before { background: var(--status-risk); }
.chip.ink { background: var(--ink); color: var(--paper); }
.chip.ink::before { background: var(--accent); }

/* Reservation detail */
.res-grid { display: grid; grid-template-columns: 1fr 360px; gap: 24px; }
.res-hero {
  display: flex; gap: 20px; padding: 24px;
  background: var(--card); border: 1px solid var(--rule); border-radius: 16px;
}
.res-hero .res-photo {
  width: 200px; height: 140px; border-radius: 10px;
  background: linear-gradient(135deg, #3a4d3a, #8a9e7a);
  background-size: cover; background-position: center;
  flex: 0 0 200px;
  position: relative;
}
.res-hero .res-photo::after {
  content: ''; position: absolute; inset: 0; border-radius: 10px;
  background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,0.4));
}

.steps { display: flex; align-items: center; gap: 0; margin-top: 8px; }
.step {
  flex: 1; display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border: 1px solid var(--rule); border-right: 0;
  font-size: 12px; color: var(--ink-3);
  cursor: pointer;
  background: var(--card);
  position: relative;
}
.step:first-child { border-top-left-radius: 10px; border-bottom-left-radius: 10px; }
.step:last-child { border-right: 1px solid var(--rule); border-top-right-radius: 10px; border-bottom-right-radius: 10px; }
.step .stepn { width: 20px; height: 20px; border-radius: 50%; background: var(--paper-2); display: grid; place-items: center; font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-3); flex: 0 0 20px; }
.step.done { color: var(--ink); background: var(--paper-2); }
.step.done .stepn { background: var(--accent); color: var(--accent-ink); }
.step.active { color: var(--ink); background: var(--ink); color: var(--paper); border-color: var(--ink); }
.step.active .stepn { background: var(--accent); color: var(--accent-ink); }

/* Finance */
.chart { height: 220px; width: 100%; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); margin-bottom: 18px; }
.tab {
  padding: 10px 14px;
  font-size: 13px; color: var(--ink-3);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  cursor: pointer;
}
.tab.active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500; }
.tab:hover { color: var(--ink); }
.tab .count { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-4); margin-left: 6px; }

/* Tweaks panel */
.tweaks {
  position: fixed; bottom: 20px; right: 20px; z-index: 100;
  background: var(--card); border: 1px solid var(--rule);
  border-radius: 14px; box-shadow: var(--shadow-2);
  padding: 16px; width: 260px;
  display: none;
}
.tweaks.open { display: block; }
.tweaks-title { font-family: 'Fraunces', serif; font-size: 16px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.tweaks-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.tweaks-row label { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500; }
.seg { display: flex; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.seg button { flex: 1; padding: 6px 8px; font-size: 12px; color: var(--ink-3); background: transparent; }
.seg button.on { background: var(--ink); color: var(--paper); }
.swatches { display: flex; gap: 6px; }
.swatch { width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--rule); cursor: pointer; }
.swatch.on { border-color: var(--ink); }

/* Check-in flow modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(20,23,15,0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: grid; place-items: center;
  animation: fadeIn 180ms;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--card); border-radius: 18px;
  width: 640px; max-width: calc(100vw - 40px);
  max-height: calc(100vh - 80px);
  overflow: hidden;
  display: flex; flex-direction: column;
  animation: rise 220ms cubic-bezier(.2,.9,.3,1);
}
@keyframes rise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { padding: 20px 24px 14px; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 24px; overflow: auto; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--rule); display: flex; gap: 10px; justify-content: flex-end; }

.flow-steps { display: flex; gap: 8px; margin-bottom: 20px; }
.flow-dot { flex: 1; height: 3px; background: var(--rule); border-radius: 2px; transition: background 200ms; }
.flow-dot.on { background: var(--accent); }

.id-card {
  border: 1px solid var(--rule); border-radius: 12px;
  padding: 16px; display: flex; gap: 14px; align-items: center;
  background: var(--paper-2);
}
.id-card .id-pic { width: 56px; height: 70px; border-radius: 6px; background: linear-gradient(180deg, #c9bfa6, #9c927a); flex: 0 0 56px; position: relative; overflow: hidden; }
.id-card .id-pic::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 50%; background: linear-gradient(180deg, transparent, rgba(0,0,0,0.2)); }

.key-card {
  background: var(--ink); color: var(--paper); border-radius: 14px;
  padding: 22px; font-family: 'JetBrains Mono', monospace;
  position: relative; overflow: hidden;
}
.key-card .keycode { font-size: 42px; font-weight: 500; letter-spacing: 0.1em; }
.key-card .keylbl { font-size: 11px; opacity: 0.7; letter-spacing: 0.1em; text-transform: uppercase; }
.key-card::after {
  content: ''; position: absolute; top: -40px; right: -40px;
  width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent), transparent 70%);
  opacity: 0.5;
}

/* Utility */
.g { display: grid; }
.f { display: flex; }
.aic { align-items: center; }
.jcs { justify-content: space-between; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; } .gap-24 { gap: 24px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-4 { margin-bottom: 4px; } .mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; } .mb-20 { margin-bottom: 20px; }
.flex-1 { flex: 1; }
.muted { color: var(--ink-3); }
.muted-2 { color: var(--ink-4); }
.small { font-size: 12px; }
.xsmall { font-size: 11px; }
.big { font-size: 16px; }
.num { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }
.bold { font-weight: 600; }
.md { font-weight: 500; }
.center { text-align: center; }
.right { text-align: right; }
