/* ==========================================================================
   Dil Punjab — Base styles & component library
   Depends on tokens.css. Class names map 1:1 to Flutter widgets / admin components.
   ========================================================================== */

/* ---- Reset ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--secondary-text); text-underline-offset: 3px; }
a:hover { color: var(--primary-text); }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-xs); }
::selection { background: var(--rose-100); color: var(--ink-950); }
h1, h2, h3, h4 { margin: 0; line-height: var(--leading-tight); letter-spacing: -0.02em; }
p { margin: 0; }

/* Components set their own display; keep the hidden attribute authoritative. */
[hidden] { display: none !important; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: 100;
  background: var(--secondary); color: var(--on-secondary);
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm); font-weight: 700;
}
.skip-link:focus { top: var(--space-4); }

/* ---- Typography -------------------------------------------------------- */
.display { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.015em; line-height: 1.02; }
.display em { font-style: italic; color: var(--primary-text); }
.h1 { font-size: var(--text-3xl); font-weight: var(--weight-black); }
.h2 { font-size: var(--text-2xl); font-weight: var(--weight-black); }
.h3 { font-size: var(--text-xl); font-weight: var(--weight-bold); }
.h4 { font-size: var(--text-lg); font-weight: var(--weight-bold); }
.body-lg { font-size: var(--text-lg); }
.body-sm { font-size: var(--text-sm); }
.caption { font-size: var(--text-xs); }
.muted { color: var(--text-muted); }
.eyebrow {
  font-size: var(--text-xs); font-weight: var(--weight-bold);
  letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted);
}
.text-primary { color: var(--primary-text); }

/* ---- Layout helpers ---------------------------------------------------- */
.container { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 0 var(--space-4); }
@media (min-width: 720px) { .container { padding: 0 var(--space-8); } }
.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.stack-sm { display: flex; flex-direction: column; gap: var(--space-2); }
.row { display: flex; align-items: center; gap: var(--space-3); }
.row-wrap { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.spacer { flex: 1; }
.grid-auto { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }

/* ---- Icon -------------------------------------------------------------- */
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 32px; height: 32px; }
.icon-fill { fill: currentColor; stroke: none; }

/* ---- Logo -------------------------------------------------------------- */
.logo { display: inline-flex; align-items: center; gap: var(--space-2); text-decoration: none; color: inherit; }
.logo img { height: 40px; width: auto; }
.logo-chip {
  width: 40px; height: 40px; border-radius: var(--radius-sm); background: #fff;
  display: grid; place-items: center; box-shadow: var(--shadow-xs); border: 1px solid var(--ink-100);
  overflow: hidden;
}
.logo-chip img { width: 28px; height: auto; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  --btn-bg: var(--surface-2); --btn-fg: var(--text); --btn-bd: transparent;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--control-h); padding: 0 var(--space-6);
  border-radius: var(--radius-md); border: 1.5px solid var(--btn-bd);
  background: var(--btn-bg); color: var(--btn-fg);
  font-weight: var(--weight-bold); font-size: var(--text-md); line-height: 1; text-decoration: none; white-space: nowrap;
  transition: background var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base);
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:hover { color: var(--btn-fg); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn-primary { --btn-bg: var(--primary); --btn-fg: var(--on-primary); box-shadow: var(--shadow-primary); }
.btn-primary:hover:not(:disabled) { --btn-bg: var(--primary-hover); }
.btn-primary:active:not(:disabled) { --btn-bg: var(--primary-pressed); }
.btn-secondary { --btn-bg: var(--secondary); --btn-fg: var(--on-secondary); }
.btn-secondary:hover:not(:disabled) { --btn-bg: var(--secondary-hover); }
.btn-outline { --btn-bg: transparent; --btn-fg: var(--text); --btn-bd: var(--border-strong); }
.btn-outline:hover:not(:disabled) { --btn-bg: var(--surface-2); }
.btn-ghost { --btn-bg: transparent; --btn-fg: var(--text); padding: 0 var(--space-3); }
.btn-ghost:hover:not(:disabled) { --btn-bg: var(--surface-2); }
.btn-danger { --btn-bg: var(--danger); --btn-fg: #fff; }
.btn-danger-ghost { --btn-bg: transparent; --btn-fg: var(--danger); }
.btn-danger-ghost:hover:not(:disabled) { --btn-bg: var(--danger-soft); }
.btn-gesture { --btn-bg: var(--gradient-gesture); --btn-fg: #fff; background: var(--gradient-gesture); }
.btn-accent { --btn-bg: var(--accent); --btn-fg: var(--on-accent); }
.btn-sm { min-height: var(--control-h-sm); padding: 0 var(--space-3); font-size: var(--text-sm); border-radius: var(--radius-sm); }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] {
  --btn-bg: var(--surface-3); --btn-fg: var(--text-disabled); box-shadow: none; cursor: not-allowed;
}
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid var(--btn-fg); border-right-color: transparent; animation: spin .7s linear infinite;
}
.btn.is-loading .icon { opacity: 0; }

.icon-btn {
  display: inline-grid; place-items: center; width: var(--tap-min); height: var(--tap-min);
  border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: background var(--dur-base), transform var(--dur-fast);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.plain { border-color: transparent; background: transparent; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Form fields
   ========================================================================== */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: var(--text-sm); font-weight: var(--weight-bold); color: var(--text); display: flex; gap: var(--space-2); align-items: baseline; }
.label .opt { font-weight: var(--weight-medium); color: var(--text-muted); font-size: var(--text-xs); }
.help { font-size: var(--text-xs); color: var(--text-muted); display: flex; gap: 6px; align-items: flex-start; }
.help .icon { width: 14px; height: 14px; margin-top: 1px; }
.error-text { font-size: var(--text-xs); color: var(--danger); font-weight: var(--weight-semi); display: flex; gap: 6px; align-items: flex-start; }
.error-text .icon { width: 14px; height: 14px; margin-top: 1px; }

.input-wrap {
  position: relative; display: flex; align-items: center; gap: var(--space-2);
  min-height: var(--control-h); padding: 0 var(--space-4);
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-md);
  transition: border-color var(--dur-base), box-shadow var(--dur-base);
}
.input-wrap > .icon { color: var(--text-muted); }
.input-wrap:hover { border-color: var(--border-strong); }
.input-wrap:focus-within { border-color: var(--secondary); box-shadow: 0 0 0 4px var(--secondary-soft); }
.input-wrap.is-invalid { border-color: var(--danger); }
.input-wrap.is-invalid:focus-within { box-shadow: 0 0 0 4px var(--danger-soft); }
.input-wrap.is-valid { border-color: var(--success); }
.input-wrap.is-disabled { background: var(--surface-2); opacity: .7; }
.input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  font-size: var(--text-md); font-weight: var(--weight-medium); height: calc(var(--control-h) - 4px);
}
.input::placeholder { color: var(--text-muted); font-weight: var(--weight-regular); }
/* The wrapper (.input-wrap) owns the focus ring; the bare input must not draw a second one. */
.input:focus, .input:focus-visible { outline: none; box-shadow: none; border-radius: 0; }
/* Browser autofill: keep our surface colour and text colour instead of Chrome's blue/lavender fill. */
.input:-webkit-autofill, .input:-webkit-autofill:hover, .input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
  box-shadow: 0 0 0 1000px var(--surface) inset;
  caret-color: var(--text);
  transition: background-color 9999s ease-out 0s;
}
.input:autofill { background: transparent; }
.input-suffix { color: var(--text-muted); font-size: var(--text-sm); }
.input-action { margin-right: calc(var(--space-2) * -1); }

select.input { appearance: none; cursor: pointer; padding-right: var(--space-6); }
.select-wrap::after {
  content: ""; position: absolute; right: var(--space-4); width: 8px; height: 8px; pointer-events: none;
  border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: translateY(-2px) rotate(45deg);
}

.textarea-wrap { align-items: stretch; padding: var(--space-3) var(--space-4); flex-direction: column; }
.textarea { border: 0; outline: none; background: transparent; resize: vertical; min-height: 96px; font-size: var(--text-md); line-height: var(--leading-body); }
.counter { align-self: flex-end; font-size: var(--text-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.counter.is-near { color: var(--warning); font-weight: 700; }

.phone-group { display: grid; grid-template-columns: minmax(104px, 36%) minmax(0, 1fr); gap: var(--space-2); }
.phone-group > * { min-width: 0; }

/* PIN / OTP */
.pin-group { display: flex; gap: var(--space-2); }
.pin-cell {
  flex: 1 1 0; min-width: 0; max-width: 56px; height: 60px; text-align: center; font-size: var(--text-2xl); font-weight: 800;
  border: 1.5px solid var(--border); border-radius: var(--radius-md); background: var(--surface);
  caret-color: var(--primary);
}
.pin-cell:focus { outline: none; border-color: var(--secondary); box-shadow: 0 0 0 4px var(--secondary-soft); }
.pin-cell.filled { border-color: var(--border-strong); }

/* Choice cards (gender, intent) */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: var(--space-2); }
.choice {
  position: relative; display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--control-h); padding: var(--space-2) var(--space-3);
  border: 1.5px solid var(--border); border-radius: var(--radius-md); background: var(--surface);
  font-weight: var(--weight-semi); cursor: pointer; text-align: center;
  transition: border-color var(--dur-base), background var(--dur-base);
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:hover { border-color: var(--border-strong); }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-text); }
.choice:has(input:focus-visible) { box-shadow: var(--focus-ring); }
.choice-col { justify-content: flex-start; text-align: left; padding: var(--space-3) var(--space-4); line-height: 1.3; }
.choice-col small { font-weight: 500; color: var(--text-muted); font-size: var(--text-xs); }
.choice .check {
  margin-left: auto; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border-strong);
  display: grid; place-items: center; flex: none;
}
.choice:has(input:checked) .check { background: var(--primary); border-color: var(--primary); }
.choice:has(input:checked) .check::after { content: ""; width: 8px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }

/* Checkbox */
.checkbox { display: flex; gap: var(--space-3); align-items: flex-start; cursor: pointer; font-size: var(--text-sm); min-height: var(--tap-min); padding-top: 10px; }
.checkbox input {
  appearance: none; width: 22px; height: 22px; flex: none; margin: 0;
  border: 1.5px solid var(--border-strong); border-radius: 6px; background: var(--surface); display: grid; place-items: center;
}
.checkbox input:checked { background: var(--secondary); border-color: var(--secondary); }
.checkbox input:checked::after { content: ""; width: 10px; height: 6px; border-left: 2.5px solid var(--on-secondary); border-bottom: 2.5px solid var(--on-secondary); transform: rotate(-45deg) translate(1px, -1px); }
.checkbox input:focus-visible { box-shadow: var(--focus-ring); }

/* Switch (immediate on/off settings) */
.switch { display: flex; align-items: center; gap: var(--space-3); cursor: pointer; min-height: var(--tap-min); }
.switch input { appearance: none; width: 48px; height: 28px; border-radius: 999px; background: var(--ink-300); position: relative; flex: none; margin: 0; transition: background var(--dur-base); }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform var(--dur-base) var(--ease-spring); }
.switch input:checked { background: var(--success); }
.switch input:checked::after { transform: translateX(20px); }
.switch input:focus-visible { box-shadow: var(--focus-ring); }

/* Range (age range) */
.range-display { font-weight: 800; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; accent-color: var(--primary); height: var(--tap-min); }

/* ==========================================================================
   Chips, badges, pills
   ========================================================================== */
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 var(--space-3);
  border-radius: var(--radius-pill); border: 1.5px solid var(--border); background: var(--surface);
  font-size: var(--text-sm); font-weight: var(--weight-semi); color: var(--text-subtle); white-space: nowrap;
  transition: background var(--dur-base), border-color var(--dur-base), color var(--dur-base);
}
button.chip { cursor: pointer; }
button.chip:hover { border-color: var(--border-strong); }
.chip[aria-pressed="true"], .chip[aria-selected="true"], .chip.is-active {
  background: var(--secondary); border-color: var(--secondary); color: var(--on-secondary);
}
.chip .count { background: var(--primary); color: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px; line-height: 18px; }
.chip-static { border-color: transparent; background: var(--surface-2); }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: var(--weight-bold); letter-spacing: .02em; line-height: 18px;
}
.badge .icon { width: 12px; height: 12px; }
.badge-verified { background: var(--info-soft); color: var(--info); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-neutral { background: var(--surface-3); color: var(--text-subtle); }
.badge-primary { background: var(--primary-soft); color: var(--primary-text); }
.badge-solid { background: var(--primary); color: #fff; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-300); box-shadow: 0 0 0 2px rgba(255,255,255,.9); flex: none; }

.pill-status {
  display: inline-flex; align-items: center; gap: var(--space-2); padding: 6px 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--surface); font-size: var(--text-xs); font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
}
.pill-status .dot { background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); animation: pulse 2s var(--ease-out) infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px transparent; } }

/* ==========================================================================
   Cards & surfaces
   ========================================================================== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-5); }
.card-elevated { border-color: transparent; box-shadow: var(--shadow-md); }
.card-soft { background: var(--surface-2); border-color: transparent; }
.card-title { font-weight: 800; font-size: var(--text-lg); }
.divider { height: 1px; background: var(--border); border: 0; margin: var(--space-4) 0; }
.divider-label { display: flex; align-items: center; gap: var(--space-3); color: var(--text-muted); font-size: var(--text-xs); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.divider-label::before, .divider-label::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Avatar */
.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-3); display: grid; place-items: center; font-weight: 800; color: var(--text-subtle); overflow: hidden; }
.avatar-sm { width: 36px; height: 36px; font-size: var(--text-sm); }
.avatar-lg { width: 72px; height: 72px; font-size: var(--text-xl); }
.avatar-xl { width: 112px; height: 112px; font-size: var(--text-2xl); }
.avatar-ring { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--primary); }
.avatar-vibe { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--accent); }

/* Prompt answer card */
.prompt-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5); }
.prompt-card .q { font-size: var(--text-sm); font-weight: 700; color: var(--text-muted); display: flex; gap: var(--space-2); align-items: center; }
.prompt-card .a { font-size: var(--text-lg); font-weight: 600; margin-top: var(--space-2); line-height: var(--leading-snug); }

/* Settings list rows */
.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.list-row {
  display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: var(--space-3) var(--space-4);
  text-decoration: none; color: var(--text); width: 100%; background: none; border: 0; text-align: left;
}
.list-row + .list-row { border-top: 1px solid var(--border); }
a.list-row:hover, button.list-row:hover { background: var(--surface-2); color: var(--text); }
.list-row .lr-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--surface-2); flex: none; }
.list-row .lr-text { flex: 1; min-width: 0; }
.list-row .lr-title { font-weight: 700; display: block; }
.list-row .lr-sub { display: block; }
.list-row .lr-sub { font-size: var(--text-sm); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .chev { color: var(--text-muted); }
.list-header { font-size: var(--text-xs); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); padding: var(--space-5) var(--space-1) var(--space-2); }

/* ==========================================================================
   Tabs & segmented control
   ========================================================================== */
.tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tab {
  position: relative; min-height: var(--tap-min); padding: 0 var(--space-3); border: 0; background: none;
  font-weight: 700; color: var(--text-muted); white-space: nowrap;
}
.tab[aria-selected="true"] { color: var(--text); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: var(--space-3); right: var(--space-3); bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--primary); }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: var(--radius-md); padding: 4px; gap: 4px; }
.segmented button { min-height: 40px; border: 0; border-radius: 10px; background: transparent; font-weight: 700; color: var(--text-muted); font-size: var(--text-sm); }
.segmented button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ==========================================================================
   Progress & stepper
   ========================================================================== */
.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--gradient-brand); transition: width var(--dur-slow) var(--ease-out); }
.step-counter { font-size: var(--text-xs); font-weight: 800; padding: 4px 10px; border-radius: var(--radius-pill); background: var(--surface-2); font-variant-numeric: tabular-nums; }
.meter-ring { --p: 60; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: var(--text-sm);
  background: radial-gradient(closest-side, var(--surface) 76%, transparent 78% 100%), conic-gradient(var(--primary) calc(var(--p) * 1%), var(--surface-3) 0); }

/* ==========================================================================
   Feedback: alerts, toasts, empty states, skeletons
   ========================================================================== */
.alert { display: flex; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); font-size: var(--text-sm); align-items: flex-start; border: 1px solid transparent; }
.alert .icon { margin-top: 1px; }
.alert strong { display: block; font-weight: 800; }
.alert-info { background: var(--info-soft); color: var(--text); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.alert-info > .icon { color: var(--info); }
.alert-success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.alert-success > .icon { color: var(--success); }
.alert-warning { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.alert-warning > .icon { color: var(--warning); }
.alert-danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-danger > .icon { color: var(--danger); }
.alert-safety { background: var(--secondary-soft); border-color: color-mix(in srgb, var(--secondary) 20%, transparent); }
.alert-safety > .icon { color: var(--secondary); }

.toast {
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4);
  background: var(--ink-900); color: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  font-size: var(--text-sm); max-width: 380px;
}
.toast .t-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.1); flex: none; }
.toast strong { display: block; font-weight: 800; }
.toast .t-sub { color: #C4BECF; font-size: var(--text-xs); }
.toast .t-action { margin-left: auto; color: var(--rose-300); font-weight: 800; background: none; border: 0; min-height: var(--tap-min); padding: 0 var(--space-2); }
.toast-success .t-icon { background: rgba(61,214,140,.18); color: var(--green-300); }
.toast-error .t-icon { background: rgba(255,138,138,.18); color: var(--red-300); }

.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-3);
  padding: var(--space-10) var(--space-6); border: 1.5px dashed var(--border); border-radius: var(--radius-lg); background: var(--surface);
}
.empty .e-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); }
.empty .e-icon .icon { width: 28px; height: 28px; }
.empty h3 { font-size: var(--text-lg); font-weight: 800; }
.empty p { color: var(--text-muted); font-size: var(--text-sm); max-width: 30ch; }
.empty-plain { border: 0; background: none; }
/* Peeking variant: character grips the card's left edge; body is cut by the card's left and bottom edges. */
.empty-peek { position: relative; overflow: hidden; padding-left: calc(var(--space-6) + 96px); min-height: 220px; justify-content: center; }
.empty-peek .peek-art { position: absolute; left: 0; bottom: 0; height: 180px; width: auto; pointer-events: none; }

.skeleton { background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 50%, var(--surface-3) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ==========================================================================
   Overlays: modal, bottom sheet
   ========================================================================== */
.overlay { position: absolute; inset: 0; background: var(--overlay); backdrop-filter: blur(6px); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.overlay.center { align-items: center; padding: var(--space-4); }
.sheet {
  width: 100%; background: var(--surface); border-radius: var(--radius-xl) var(--radius-xl) 0 0; padding: var(--space-3) var(--space-5) var(--space-6);
  box-shadow: var(--shadow-lg); max-height: 88%; overflow: auto;
}
.sheet-handle { width: 40px; height: 5px; border-radius: 99px; background: var(--border-strong); margin: 0 auto var(--space-4); }
.modal { width: 100%; max-width: 400px; background: var(--surface); border-radius: var(--radius-xl); padding: var(--space-6); box-shadow: var(--shadow-lg); }
.modal-head { display: flex; align-items: flex-start; gap: var(--space-3); margin-bottom: var(--space-4); }

/* ==========================================================================
   App shell pieces (Flutter reference)
   ========================================================================== */
.app-bar { display: flex; align-items: center; gap: var(--space-2); min-height: 60px; padding: var(--space-2) var(--space-3); }
.app-bar .title { flex: 1; font-size: var(--text-lg); font-weight: 800; text-align: center; }
.app-bar .title.left { text-align: left; font-size: var(--text-xl); }

.bottom-nav {
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  background: var(--surface); border-top: 1px solid var(--border); padding: 6px var(--space-2) calc(8px + env(safe-area-inset-bottom));
}
.nav-item {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; justify-content: center;
  border: 0; background: none; color: var(--text-muted); font-size: 11px; font-weight: 700; text-decoration: none;
}
.nav-item[aria-current="page"] { color: var(--primary-text); }
.nav-item .nb { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--primary); color: #fff; font-size: 10px; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.nav-camera { width: 60px; height: 60px; border-radius: 50%; margin: -22px auto 0; display: grid; place-items: center; background: var(--surface); box-shadow: 0 0 0 4px var(--accent), var(--shadow-md); color: var(--text); }

/* Discover profile card */
.profile-card {
  position: relative; border-radius: var(--radius-xl); overflow: hidden; background: var(--ink-800); color: #fff;
  box-shadow: var(--shadow-lg); isolation: isolate;
}
.profile-card .pc-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.profile-card::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(10,6,14,.85) 100%); }
.pc-dots { position: absolute; top: 10px; left: 12px; right: 12px; display: flex; gap: 4px; }
.pc-dots span { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,.4); }
.pc-dots span.on { background: #fff; }
.pc-info { position: absolute; left: 0; right: 0; bottom: 0; padding: var(--space-5); }
.pc-name { font-size: var(--text-2xl); font-weight: 800; letter-spacing: -0.02em; display: flex; align-items: baseline; gap: var(--space-2); }
.pc-name .age { font-weight: 600; font-size: var(--text-xl); opacity: .9; }
.pc-meta { font-size: var(--text-sm); font-weight: 600; opacity: .92; display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; }
.pc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--space-3); }
.pc-tag { background: rgba(255,255,255,.16); backdrop-filter: blur(8px); border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; display: inline-flex; gap: 5px; align-items: center; }
.pc-tag.intent { background: rgba(224,0,92,.85); }
.pc-info-btn { position: absolute; right: var(--space-4); bottom: var(--space-5); width: var(--tap-min); height: var(--tap-min); border-radius: 50%; border: 0; background: rgba(255,255,255,.2); backdrop-filter: blur(8px); color: #fff; display: grid; place-items: center; }

.action-row { display: flex; justify-content: center; align-items: center; gap: var(--space-4); }
.action-btn {
  display: grid; place-items: center; border-radius: 50%; border: 0; background: var(--surface); box-shadow: var(--shadow-md);
  transition: transform var(--dur-fast) var(--ease-spring);
}
.action-btn:active { transform: scale(.9); }
.action-btn.pass { width: 60px; height: 60px; color: var(--ink-600); }
.action-btn.like { width: 72px; height: 72px; background: var(--primary); color: #fff; box-shadow: var(--shadow-primary); }
.action-btn.gesture { width: 50px; height: 50px; color: var(--primary-text); font-size: 22px; }
.action-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: var(--text-muted); }

/* Chat */
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 20px; font-size: var(--text-md); line-height: 1.4; }
.bubble.them { background: var(--surface-2); border-bottom-left-radius: 6px; align-self: flex-start; }
.bubble.me { background: var(--secondary); color: var(--on-secondary); border-bottom-right-radius: 6px; align-self: flex-end; }
.bubble-meta { font-size: 11px; color: var(--text-muted); align-self: flex-end; display: flex; gap: 4px; align-items: center; }
.composer { display: flex; gap: var(--space-2); align-items: center; padding: var(--space-2) var(--space-3); border-top: 1px solid var(--border); background: var(--surface); }
.composer .input-wrap { flex: 1; min-height: 46px; border-radius: 999px; }

/* Utility */
.hide-mobile { display: none; }
@media (min-width: 720px) { .hide-mobile { display: initial; } .hide-desktop { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
