/* ===================== design tokens ===================== */

:root {
  --accent-ink: #655000;
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-2: #f6f6f4;
  --border: #e3e3de;
  --divider: #eeeeea;
  --text: #262626;
  --text-2: #3c3c38;
  --muted: #686862;
  --muted-2: #73736d;
  --accent: #ffcc22;
  --accent-2: #f0bc08;
  --accent-soft: #fff4bd;
  --accent-contrast: #262626;
  --good: #17945f;
  --good-soft: #e2f7ee;
  --bad: #bd3448;
  --bad-soft: #fbe9ea;
  --warn: #b3720a;
  --warn-soft: #fbeed7;
  --track-off: #d8d8d2;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 28px;

  --shadow-sm: 0 1px 2px rgba(31, 23, 32, 0.05), 0 2px 6px -2px rgba(31, 23, 32, 0.08);
  --shadow-md: 0 2px 4px rgba(31, 23, 32, 0.05), 0 12px 28px -14px rgba(31, 23, 32, 0.22);
  --shadow-lg: 0 8px 16px -6px rgba(31, 23, 32, 0.18), 0 24px 48px -24px rgba(31, 23, 32, 0.3);
  --shadow-frame: 0 30px 60px -20px rgba(20, 10, 20, 0.35), 0 2px 8px rgba(20, 10, 20, 0.12);

  --app-max-width: 430px;

  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171717;
    --panel: #222222;
    --panel-2: #2c2c29;
    --border: #484840;
    --divider: #383832;
    --text: #fafaf5;
    --text-2: #e8e8df;
    --muted: #bebeb2;
    --muted-2: #adada0;
    --accent: #ffcc22;
    --accent-2: #f0bc08;
    --accent-soft: rgba(255, 204, 34, 0.14);
    --accent-contrast: #262626;
    --good: #43d18a;
    --good-soft: rgba(67, 209, 138, 0.14);
    --bad: #e2818c;
    --bad-soft: rgba(226, 129, 140, 0.14);
    --warn: #e0b166;
    --warn-soft: rgba(224, 177, 102, 0.14);
    --track-off: #484840;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25), 0 2px 6px -2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.3), 0 14px 30px -14px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 10px 20px -6px rgba(0, 0, 0, 0.45), 0 28px 56px -24px rgba(0, 0, 0, 0.6);
    --shadow-frame: 0 40px 80px -24px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.4);
  }
}
:root[data-theme="dark"] {
  --accent-ink: #ffda59;
  color-scheme: dark;
  --bg: #171717; --panel: #222222; --panel-2: #2c2c29; --border: #484840; --divider: #383832;
  --text: #fafaf5; --text-2: #e8e8df; --muted: #bebeb2; --muted-2: #adada0;
  --accent: #ffcc22; --accent-2: #f0bc08; --accent-soft: rgba(255, 204, 34, 0.14); --accent-contrast: #262626;
  --good: #43d18a; --good-soft: rgba(67, 209, 138, 0.14); --bad: #e2818c; --bad-soft: rgba(226, 129, 140, 0.14);
  --warn: #e0b166; --warn-soft: rgba(224, 177, 102, 0.14); --track-off: #484840;
}
:root[data-theme="light"] {
  --accent-ink: #655000;
  color-scheme: light;
  --bg: #ffffff; --panel: #ffffff; --panel-2: #f6f6f4; --border: #e3e3de; --divider: #eeeeea;
  --text: #262626; --text-2: #3c3c38; --muted: #686862; --muted-2: #73736d;
  --accent: #ffcc22; --accent-2: #f0bc08; --accent-soft: #fff4bd; --accent-contrast: #262626;
  --good: #17945f; --good-soft: #e2f7ee; --bad: #bd3448; --bad-soft: #fbe9ea;
  --warn: #b3720a; --warn-soft: #fbeed7; --track-off: #d8d8d2;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Desktop: present the app as a phone. Real mobile viewports: full-bleed. */
@media (min-width: 560px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 16px;
    background:
      radial-gradient(60% 50% at 15% 10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%),
      radial-gradient(50% 40% at 90% 90%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%),
      var(--bg);
  }
  .screen {
    width: var(--app-max-width);
    max-height: 900px;
    height: 92vh;
    border-radius: 40px;
    overflow: hidden;
    box-shadow: var(--shadow-frame);
    border: 1px solid var(--border);
  }
  #screen-login.screen { display: flex; }
}

h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -0.02em; }
p { margin: 0; }

.hidden { display: none !important; }
.hidden-field { display: none; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

/* ===================== typography helpers ===================== */

.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 0 0 14px;
}
.eyebrow {
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 4px;
}
code {
  background: var(--accent-soft);
  color: var(--accent-ink);
  padding: 0.15em 0.45em;
  border-radius: 6px;
  font-size: 0.85em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ===================== form controls ===================== */

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 14px;
}
label.inline-label { display: inline-block; }
label.grow { flex: 1 1 auto; min-width: 0; }

input, select, textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  min-height: 46px;
}
textarea { resize: vertical; min-height: 90px; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-ink);
  background: var(--panel);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder, textarea::placeholder { color: var(--muted-2); opacity: 1; }
input[readonly] { opacity: 0.65; }
input[type="file"] { padding: 9px 10px; min-height: 0; }

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 10px;
}
.row:last-child { margin-bottom: 0; }
.row > button { flex: 0 0 auto; }

fieldset { border: none; margin: 0; padding: 0; }

/* iOS-style toggle switch, built entirely from a real <input type=checkbox
   class="switch">, so no markup beyond a class attribute is needed and
   app.js's plain .checked reads/writes keep working unmodified. */
input[type="checkbox"].switch {
  appearance: none;
  -webkit-appearance: none;
  width: 46px;
  height: 27px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--track-off);
  position: relative;
  flex: none;
  cursor: pointer;
  transition: background 0.18s ease;
}
input[type="checkbox"].switch::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.18s cubic-bezier(.4,0,.2,1);
}
input[type="checkbox"].switch:checked { background: var(--accent); }
input[type="checkbox"].switch:checked::before { transform: translateX(19px); }
input[type="checkbox"].switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ===================== buttons ===================== */

button {
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease, filter 0.15s ease, opacity .15s ease;
  box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--accent) 70%, transparent);
  min-height: 44px;
}
button:hover { filter: brightness(1.06); }
button:active { transform: scale(0.97); filter: brightness(0.96); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; filter: none; box-shadow: none; }

button.primary-btn { background: var(--accent); color: var(--accent-contrast); }
button.full-width { width: 100%; }

button.secondary {
  background: var(--panel-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  box-shadow: none;
}
button.secondary:hover { border-color: var(--accent-ink); color: var(--accent-ink); }
button.secondary.danger { color: var(--bad); }
button.secondary.danger:hover { border-color: var(--bad); background: var(--bad-soft); }

button.link-btn {
  background: none;
  border: none;
  box-shadow: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  padding: 6px;
  min-height: 0;
}
button.link-btn:hover { color: var(--accent-ink); transform: none; }

button.icon-btn {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: none;
  width: 42px;
  height: 42px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}
button.icon-btn:hover { border-color: var(--accent-ink); color: var(--accent-ink); background: var(--accent-soft); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  color: var(--muted);
}
.status:empty { padding: 0; margin: 0; }
.status.ok { color: var(--good); background: var(--good-soft); }
.status.err { color: var(--bad); background: var(--bad-soft); }

/* ===================== list / card primitives ===================== */

.card-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 0 0 14px;
  box-shadow: var(--shadow-sm);
}
.card-section > h3, .card-section > h4 { font-size: 14px; margin-bottom: 4px; }
.card-section > .hint:first-of-type { margin-top: 2px; }

.list-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 0 0 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--divider);
}
.list-row:last-child { border-bottom: none; }
.list-row-text { min-width: 0; }
.list-row-text .title { display: block; font-size: 14.5px; font-weight: 600; color: var(--text); }
.list-row-text .sub { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.list-row.pressable { cursor: pointer; transition: background .12s ease; }
.list-row.pressable:hover { background: var(--panel-2); }
.list-row .chevron { color: var(--muted-2); font-size: 18px; flex: none; }

.privacy-actions { margin-top: 10px; }
.privacy-rectification { margin-top: 8px; }
.privacy-rectification textarea { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px; }
.privacy-rectification > .hint:last-of-type { margin-top: 8px; }
.privacy-requests { margin-top: 8px; }
.privacy-request-row { align-items: flex-start; }
.privacy-request-text { display: grid; gap: 7px; }
.privacy-request-meta-wrap { display: flex; flex-wrap: wrap; gap: 5px 14px; }
.privacy-request-meta { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.privacy-download-btn { flex: none; }

@media (max-width: 560px) {
  .privacy-request-row { flex-direction: column; }
  .privacy-download-btn { width: 100%; }
  .privacy-actions > button { flex: 1 1 100%; }
}

.entry-row {
  padding: 11px 0;
  border-top: 1px solid var(--divider);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}
.entry-row:first-child { border-top: none; }
.history-row { padding: 11px 0; border-top: 1px solid var(--divider); color: var(--muted); font-size: 12.5px; }
.history-row:first-child { border-top: none; }

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-ink);
  margin: 0 6px 6px 0;
}

/* legacy aliases kept so existing markup/classes render consistently */
.safety-card, .date-plan-panel { }

table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--divider); }
th { color: var(--muted); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
td code { word-break: break-all; }
tr:last-child td { border-bottom: none; }

/* ===================== screens ===================== */

.screen { min-height: 100vh; background: var(--bg); }

/* ---- login ---- */

#screen-login {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  overflow-y: auto;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 26px 26px;
  box-shadow: var(--shadow-md);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand svg { flex: none; filter: drop-shadow(0 2px 6px color-mix(in srgb, var(--accent) 45%, transparent)); }
.brand-center { justify-content: center; margin-bottom: 6px; }

.auth-card h1 { font-size: 1.5rem; }

.auth-tagline {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 26px;
}

.auth-card .status { display: flex; margin: 6px 0 10px; }
.auth-card .status:not(:empty) { border-radius: 14px; overflow-wrap: anywhere; line-height: 1.5; font-size: 14px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 14px 0; color: var(--muted); font-size: 12px; font-weight: 600; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; border-top: 1px solid var(--divider); }
.google-login-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.google-mark { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #fff; color: #174ea6; font: 700 15px Arial, sans-serif; }
#passwordRecoveryPanel .hint { font-size: 14px; line-height: 1.5; }
#passwordRecoveryPasswordHint { display: block; margin-bottom: 12px; }
#passwordRecoveryPanel button:disabled { opacity: 1; background: var(--panel-2); color: var(--muted); border-color: var(--border); }

.dev-disclosure {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}
.dev-disclosure summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  list-style: none;
}
.dev-disclosure summary::-webkit-details-marker { display: none; }
.dev-disclosure summary::before { content: "\25B8  "; }
.dev-disclosure[open] summary::before { content: "\25BE  "; }
.dev-disclosure summary:hover { color: var(--accent-ink); }
.dev-disclosure .row { margin-top: 12px; }

/* ---- app shell ---- */

#screen-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg);
}

.appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(10px);
  flex: none;
}
.appbar .brand { gap: 8px; }
.appbar-title { font-weight: 800; font-size: 17px; letter-spacing: -0.02em; }
.appbar-actions { display: flex; align-items: center; gap: 8px; }

.app-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 18px 28px;
  width: 100%;
  margin: 0 auto;
}

.tab-panel { animation: panel-in .2s ease-out; }
@keyframes panel-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.tab-panel h2.screen-title { margin: 2px 0 4px; font-size: 22px; }
.page-heading { margin-bottom: 18px; }
.page-heading .screen-title { margin-bottom: 3px; }
.page-heading .hint { margin-bottom: 0; }

.profile-hero { display: flex; align-items: center; gap: 14px; margin: 2px 0 18px; }
.profile-hero .screen-title { margin-bottom: 2px; }
.profile-hero .hint { margin: 0; }
.profile-avatar {
  width: 54px; height: 54px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent-soft));
  color: var(--accent-ink);
  font-size: 1.6rem; font-weight: 800;
  border: 1px solid var(--border);
}
.profile-actions { display: flex; gap: 10px; margin-bottom: 10px; position: sticky; top: -18px; z-index: 5; padding: 10px 0; background: linear-gradient(var(--bg) 70%, transparent); }
.profile-actions button { flex: 1; }

.media-requirement {
  display: grid; gap: 6px; min-width: 0;
  padding: 14px; margin: 4px 0 18px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--accent-soft);
  overflow: hidden;
}
.media-requirement > * { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.media-requirement strong { font-size: 13.5px; color: var(--text); }
.media-requirement small { color: var(--muted); font-size: 11.5px; }
.media-picker {
  display: block; width: 100%; min-width: 0; margin-top: 4px;
  padding: 10px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--panel); cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--text-2);
}
.media-picker input { display: block; width: 100%; max-width: 100%; min-width: 0; margin-top: 8px; }

.chat-compose {
  display: flex; align-items: center; gap: 10px;
  position: sticky; bottom: 0;
  padding: 10px 0 2px;
  background: linear-gradient(transparent, var(--bg) 30%);
}
.chat-compose input { flex: 1; margin-top: 0; }

.date-plan-panel {
  margin: 0 0 16px; padding: 18px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}
.date-plan-panel h3 { margin-bottom: 4px; font-size: 15px; }
.date-plan-panel .panel-sub { color: var(--muted); font-size: 12.5px; margin-bottom: 14px; }
.date-plan-panel .field-group { display: grid; gap: 10px; margin-bottom: 12px; }
.date-plan-panel .field-group label {
  margin-bottom: 0; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700;
}
.date-plan-panel .field-group input, .date-plan-panel .field-group select { margin-top: 5px; }
.date-plan-panel .row { margin-bottom: 10px; }
.date-plan-panel .row:last-child { margin-bottom: 0; }
.date-plan-panel .venue-row { align-items: center; flex-wrap: wrap; margin-top: 12px; }
.date-plan-panel .venue-row button { flex: 1 1 auto; }
.date-plan-panel .venue-row select { flex: 1 1 100%; min-width: 0; margin-top: 0; }
.date-plan-panel .action-row { display: flex; flex-wrap: wrap; gap: 8px; }
.date-plan-panel .action-row button { flex: 1 1 auto; }
.date-plan-panel .action-row .status { flex-basis: 100%; }

.chat-date-plan-controls { display: flex; align-items: center; gap: 12px; margin: 8px 0 18px; }
.chat-date-plan-controls p { flex: 1; min-width: 0; color: var(--text-2); font-size: 14px; overflow-wrap: anywhere; }
.chat-date-plan-controls button { flex: none; }
.date-plan-dialog {
  width: min(430px, calc(100vw - 32px)); max-height: calc(100dvh - 40px);
  margin: auto; padding: 0; overflow-x: hidden; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--panel); color: var(--text); box-shadow: var(--shadow-lg);
}
.date-plan-dialog::backdrop { background: rgb(0 0 0 / .48); }
.date-plan-dialog-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  position: sticky; top: 0; z-index: 1; padding: 20px 20px 16px;
  background: var(--panel); border-bottom: 1px solid var(--border);
}
.date-plan-dialog-header > div { min-width: 0; }
.date-plan-dialog-header h2 { font-size: 22px; line-height: 1.2; margin-bottom: 6px; }
.date-plan-dialog-header p { color: var(--text-2); font-size: 14px; overflow-wrap: anywhere; }
.date-plan-close { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; }
.date-plan-dialog .date-plan-panel { border: 0; border-radius: 0; box-shadow: none; margin: 0; padding: 20px; }
.date-plan-dialog .panel-sub { font-size: 14px; line-height: 1.5; }
.date-plan-dialog .field-help { font-size: 14px; line-height: 1.5; }
.date-plan-dialog input, .date-plan-dialog select { font-size: 16px; min-width: 0; }
.date-plan-dialog .field-group .row { flex-wrap: wrap; }
.date-plan-dialog .field-group .row label { flex: 1 1 100%; }
.date-plan-dialog .status { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 559px) {
  .date-plan-dialog { width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .date-plan-dialog .date-plan-panel { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
}

.section-title {
  margin: 26px 0 4px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.section-title:first-of-type { margin-top: 4px; }

.bottom-nav {
  display: flex;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  backdrop-filter: blur(10px);
  flex: none;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-btn {
  flex: 1;
  background: none; border: none; box-shadow: none; border-radius: 0;
  color: var(--muted-2);
  font-weight: 700;
  font-size: 11px;
  min-height: 60px;
  padding: 9px 4px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: color .15s ease;
}
.nav-btn .nav-icon { font-size: 21px; line-height: 1; transition: transform .15s ease; }
.nav-btn:hover { transform: none; filter: none; color: var(--accent-ink); }
.nav-btn.active { color: var(--accent-ink); }
.nav-btn.active .nav-icon { transform: translateY(-1px) scale(1.08); }

@media (max-width: 380px) {
  .app-main { padding: 16px 14px 24px; }
}

/* ---- discover ---- */

.deck-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.deck-toolbar .status { flex: 1; min-width: 0; }

.deck-stage { min-height: 56vh; display: flex; }
.deck-cards { flex: 1; display: flex; }

.card {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow-md);
  display: flex; flex-direction: column;
  position: relative;
}
.card img, .card-photo-placeholder { width: 100%; flex: 1; object-fit: cover; min-height: 300px; }
.card-photo-placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 3.6rem; font-weight: 800; color: var(--accent-ink);
  background: linear-gradient(160deg, var(--accent-soft), var(--panel-2));
}
.card-info { padding: 16px 18px 20px; background: var(--panel); position: relative; }
.card-info::before {
  content: ""; position: absolute; left: 0; right: 0; top: -40px; height: 40px;
  background: linear-gradient(transparent, color-mix(in srgb, var(--panel) 85%, transparent));
  pointer-events: none;
}
.card-info h3 { font-size: 19px; }
.card-info .meta { color: var(--muted); font-size: 13px; margin-top: 3px; }

.boost-badge {
  display: inline-flex; align-items: center; gap: 4px;
  margin: 0 0 8px; padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--warn-soft); color: var(--warn);
  font-size: 11.5px; font-weight: 800;
}
.boost-corner {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  padding: 5px 10px; border-radius: var(--radius-pill);
  background: var(--warn-soft); color: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
  font-size: 11px; font-weight: 800;
  box-shadow: var(--shadow-sm);
}

.deck-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 6px; color: var(--text);
  border: 1.5px dashed var(--border); border-radius: var(--radius-lg);
  padding: 40px 24px;
  background: var(--panel-2);
}
.deck-empty > h3 { margin: 0; font-weight: 800; font-size: 17px; line-height: 1.25; }
.deck-empty .hint { max-width: 26ch; }
.discovery-requirements {
  display: grid;
  gap: 8px;
  width: min(100%, 300px);
  padding: 0;
  margin: 12px 0 0;
  list-style: none;
  text-align: left;
}
.discovery-requirements li { display: flex; align-items: center; gap: 9px; min-height: 22px; font-size: 13px; color: var(--text-2); }
.discovery-requirement-mark { display: inline-flex; width: 18px; height: 18px; flex: 0 0 18px; align-items: center; justify-content: center; color: var(--muted); }
.discovery-requirement-mark svg { display: block; width: 17px; height: 17px; }
.discovery-requirements li.complete .discovery-requirement-mark { color: var(--good); }
.discovery-requirement-label { flex: 1; }
.discovery-requirement-state { color: var(--muted); font-size: 11px; white-space: nowrap; }
.discovery-requirements li.complete .discovery-requirement-state { color: var(--text-2); }
.deck-empty-actions { display: grid; gap: 8px; width: min(100%, 240px); margin-top: 10px; }
.deck-empty-actions button { width: 100%; }

.swipe-actions { display: flex; justify-content: center; gap: 22px; margin-top: 18px; }

.round-btn {
  width: 62px; height: 62px; border-radius: 50%;
  font-size: 1.4rem; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.round-btn.pass-btn { background: var(--panel); color: var(--bad); border: 1px solid var(--border); box-shadow: var(--shadow-md); }
.round-btn.pass-btn:hover { border-color: var(--bad); }
.round-btn.like-btn { background: var(--accent); color: var(--accent-contrast); }

.report-inline { display: block; width: 100%; margin: 14px auto 0; background: transparent; color: var(--muted); border: 1px solid var(--border); box-shadow: none; }
.report-inline:hover { color: var(--bad); border-color: var(--bad); }

.profile-details-btn { width: 100%; margin-top: 10px; }
.profile-modal { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 18px; }
.profile-modal.hidden { display: none; }
.profile-modal-backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / 62%); }
.profile-modal-panel { position: relative; width: min(620px, 100%); max-height: min(88vh, 760px); overflow: auto; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--panel); box-shadow: var(--shadow-md); }
.profile-modal-close { position: absolute; top: 10px; right: 12px; width: 34px; height: 34px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 28px; line-height: 1; }
.profile-details-header { padding-right: 34px; }
.profile-details-header h2 { margin: 0; }
.profile-details-meta { margin: 4px 0 16px; color: var(--muted); }
.profile-details-media { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-bottom: 18px; }
.profile-details-media img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 12px; background: var(--panel-2); }
.profile-details-media video { grid-column: 1 / -1; width: 100%; max-height: 420px; object-fit: contain; border-radius: 12px; background: var(--panel-2); }
.profile-details-section { margin-top: 18px; }
.profile-details-section h3 { margin: 0 0 7px; font-size: 14px; }
.profile-details-section p { margin: 0; color: var(--muted); line-height: 1.5; }
.profile-detail-item { padding: 10px 12px; margin-bottom: 8px !important; border-radius: 10px; background: var(--panel-2); color: var(--text) !important; }
.profile-topic-list { display: flex; flex-wrap: wrap; gap: 7px; }
.profile-topic-list span { padding: 5px 10px; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 700; }

/* ---- secret ---- */

.secret-badge {
  display: inline-flex; align-items: center;
  font-size: 12px; font-weight: 800;
  padding: 6px 13px; border-radius: var(--radius-pill);
  margin-bottom: 16px;
}
.secret-badge.state-none { color: var(--muted); background: var(--panel-2); border: 1px solid var(--border); }
.secret-badge.state-pending, .secret-badge.state-running { color: var(--warn); background: var(--warn-soft); }
.secret-badge.state-approved { color: var(--good); background: var(--good-soft); }
.secret-badge.state-rejected { color: var(--bad); background: var(--bad-soft); }

/* ---- consent panel: rendered as a blocking modal dialog, not inline
   content, since app.js shows/hides it independently of tab switching --
   as inline content it used to reappear pinned above whichever tab was
   currently active. ---- */

.consent-panel.hidden-field { display: none; }
.consent-panel {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  margin: 0;
  border: none;
  border-radius: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(20, 10, 16, 0.5);
  backdrop-filter: blur(3px);
  box-shadow: none;
  animation: overlay-in .2s ease-out;
}
.consent-panel::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
}
.consent-panel > .consent-panel-head,
.consent-panel > .hint,
.consent-panel > #googleDobForm,
.consent-panel > #consentItems,
.consent-panel > #onboardBtnApp,
.consent-panel > #consentStatus {
  position: relative;
  width: 100%;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}
.consent-panel > .consent-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--panel);
  padding: 18px 14px 2px 22px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg);
  animation: modal-in .25s cubic-bezier(.2,.8,.3,1.1);
}
.consent-panel > .consent-panel-head h2 { font-size: 17px; }
.consent-panel > .consent-panel-head .icon-btn { width: 34px; height: 34px; font-size: 1.3rem; }
.consent-panel > .hint {
  background: var(--panel);
  padding: 6px 22px 14px;
  margin-bottom: 0;
  box-shadow: var(--shadow-lg);
}
.consent-panel > #consentItems {
  background: var(--panel);
  padding: 0 22px;
  max-height: 50vh;
  overflow-y: auto;
}
.consent-panel > #googleDobForm {
  background: var(--panel);
  padding: 0 22px 20px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.google-dob-form > label { color: var(--text-2); margin-bottom: 6px; }
.google-dob-form > .hint { margin: 0 0 14px; }
.google-dob-form > .primary-btn { width: 100%; }
.google-dob-form > .status:not(:empty) { margin: 8px 0 0; }
.google-dob-form button:disabled { cursor: wait; opacity: .7; }
.consent-panel > #onboardBtnApp {
  background: var(--panel);
  border-radius: 0;
  margin: 0;
  padding-left: 22px; padding-right: 22px;
}
.consent-panel > #consentStatus {
  background: var(--panel);
  padding: 0 22px 20px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-height: 8px;
}
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

.consent-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-top: 1px solid var(--divider); }
.consent-row:first-child { border-top: none; }
.consent-row > div:first-child { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.consent-row > button { flex: none; }
.consent-row span, .consent-row small { color: var(--muted); font-size: 12.5px; }

/* ---- chat ---- */
.chat-list-header { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.chat-conversation-list { display:flex; flex-direction:column; gap:2px; margin:8px 0 14px; }
.chat-conversation-row { display:flex; align-items:center; gap:11px; width:100%; padding:12px 4px; border:0; border-bottom:1px solid var(--border); background:transparent; color:var(--text); text-align:left; cursor:pointer; }
.chat-conversation-row:hover { background:rgba(255,255,255,.04); }
.chat-avatar { display:grid; place-items:center; flex:0 0 42px; width:42px; height:42px; border-radius:50%; background:var(--accent-soft); color:var(--text); font-weight:800; font-size:12px; }
.chat-row-main { display:flex; min-width:0; flex:1; flex-direction:column; gap:3px; }
.chat-row-main strong { font-size:14px; }
.chat-row-main span { overflow:hidden; color:var(--muted); font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.chat-row-side { display:flex; min-width:42px; flex-direction:column; align-items:flex-end; gap:5px; color:var(--muted); font-size:10px; }
.chat-row-side b { display:grid; place-items:center; min-width:18px; height:18px; border-radius:50%; background:var(--accent); color:var(--accent-contrast); font-size:10px; }
.chat-empty { padding:24px 8px; color:var(--muted); text-align:center; }

.chat-messages {
  min-height: 280px; max-height: 440px; overflow-y: auto;
  margin: 4px 0 16px; padding: 16px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, var(--panel-2), var(--bg) 60%);
  scroll-behavior: smooth;
  display: flex; flex-direction: column;
}
.chat-messages:empty::before {
  content: "No messages yet — say hello 👋";
  margin: auto;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.chat-message {
  width: fit-content; max-width: 78%;
  padding: 10px 14px; margin: 5px 0;
  border: 1px solid var(--border); border-radius: 18px 18px 18px 5px;
  background: var(--panel); box-shadow: var(--shadow-sm);
  animation: bubble-in .18s ease-out;
}
.chat-message.mine {
  margin-left: auto; border-color: transparent; border-radius: 18px 18px 5px 18px;
  background: var(--accent); color: var(--accent-contrast);
}
@keyframes bubble-in { from { opacity: 0; transform: translateY(6px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.chat-sender { font-size: 10.5px; font-weight: 800; opacity: .75; margin-bottom: 3px; text-transform: uppercase; letter-spacing: .03em; }
.chat-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.4; }
.chat-meta { margin-top: 4px; font-size: 10.5px; opacity: .65; }
.chat-message.theirs .chat-meta { color: var(--muted); }
.message-report {
  margin-top: 7px; font-size: 10.5px; padding: 4px 10px; min-height: 0;
  background: transparent; color: inherit; opacity: .8; border: 1px solid currentColor; box-shadow: none;
}
.chat-message.theirs .message-report { color: var(--muted); border-color: var(--border); }
.message-report:hover { opacity: 1; }

.chat-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.chat-toolbar select { flex: 1 1 100%; margin-top: 0; }
.chat-toolbar .icon-row { display: flex; gap: 8px; margin-left: auto; }

/* ===================== dev panel ===================== */

.dev-fab {
  position: fixed; right: 18px; bottom: 18px;
  width: 48px; height: 48px; border-radius: 50%;
  padding: 0; font-size: 1.15rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel); color: var(--muted);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  z-index: 40;
}
.dev-fab:hover { color: var(--accent-ink); border-color: var(--accent-ink); }

.dev-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(420px, 100vw);
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: -16px 0 40px -16px rgba(0,0,0,0.3);
  z-index: 50;
  display: flex; flex-direction: column;
}
.dev-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.dev-panel-header strong { font-size: 14px; }
.dev-panel-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.dev-panel .panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 16px 16px 14px; box-shadow: var(--shadow-sm);
}
.dev-panel .panel h3 { margin-bottom: 12px; font-size: 13px; }
.dev-panel .panel h4 { margin: 16px 0 10px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.sensitive-attributes-list { display: flex; flex-direction: column; gap: 12px; }
.sensitive-attribute-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.sensitive-attribute-row > label { width: 100%; margin-bottom: 0; }
.sensitive-attribute-row > label input,
.sensitive-attribute-row > label select { width: 100%; }
.sensitive-attribute-row:last-child { border-bottom: 0; padding-bottom: 0; }
.sensitive-attribute-row .row { display: flex; flex-wrap: nowrap; width: 100%; margin: 0; }
.sensitive-attribute-row .row > button { flex: 1 1 0; min-width: 0; }

#log {
  max-height: 300px; overflow-y: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  margin-top: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
}
.log-entry { border-bottom: 1px solid var(--divider); padding: 9px 11px; }
.log-entry:last-child { border-bottom: none; }
.log-entry .line1 { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.log-entry .method { font-weight: 800; color: var(--accent-ink); }
.log-entry .code { font-weight: 800; padding: 0.05em 0.55em; border-radius: 999px; font-size: 0.9em; }
.log-entry .code.ok2xx { color: var(--good); background: var(--good-soft); }
.log-entry .code.warn4xx { color: var(--warn); background: var(--warn-soft); }
.log-entry .code.err5xx { color: var(--bad); background: var(--bad-soft); }
.log-entry .url { color: var(--muted); word-break: break-all; }
.log-entry pre { margin: 6px 0 0; white-space: pre-wrap; word-break: break-all; color: var(--muted); }

/* ===================== toast notifications ===================== */

.toast-container {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-14px) scale(.96);
  transition: opacity .22s cubic-bezier(.2,.8,.3,1.1), transform .22s cubic-bezier(.2,.8,.3,1.1);
}
.toast.show { opacity: 1; transform: translateY(0) scale(1); }
.toast.hide { opacity: 0; transform: translateY(-10px) scale(.97); }
.toast-icon {
  flex: none;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 12px; font-weight: 800;
  background: var(--accent-soft); color: var(--accent-ink);
}
.toast-ok .toast-icon { background: var(--good-soft); color: var(--good); }
.toast-err .toast-icon { background: var(--bad-soft); color: var(--bad); }
.toast-ok { border-color: color-mix(in srgb, var(--good) 30%, var(--border)); }
.toast-err { border-color: color-mix(in srgb, var(--bad) 30%, var(--border)); }
.toast-msg { flex: 1; min-width: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
.profile-photo-preview { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: .9rem; }
.profile-photo-preview img { width: 112px; height: 112px; object-fit: cover; border-radius: 14px; border: 1px solid rgba(255,255,255,.16); background: var(--panel-2); }
.profile-photo-preview video { width: 100%; max-height: 240px; object-fit: contain; border-radius: 14px; background: var(--panel-2); }
select[multiple] { min-height: 7rem; }

.chat-actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.chat-actions button { padding: 2px 8px; font-size: 11px; }

/* Basic camera verification, with accessible meaning on every badge. */
.photo-verification { margin-top: 18px; padding-top: 14px; border-top: 1px solid #dbe4ee; }
.photo-verification h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.photo-verification .camera-consent { display: flex; align-items: flex-start; gap: 12px; margin-block: 16px; min-height: 44px; font-size: 14px; line-height: 1.5; cursor: pointer; }
.photo-verification .camera-consent input[type="checkbox"] { appearance: auto; width: 18px; height: 18px; min-width: 18px; min-height: 18px; flex: 0 0 18px; padding: 0; margin: 3px 0 0; accent-color: var(--text); box-shadow: none; }
.verified-badge { display: inline-flex; align-items: center; gap: 5px; color: #1474d4; font-size: 13px; font-weight: 700; vertical-align: middle; white-space: nowrap; }
.verified-badge > span { display: inline-flex; align-items: center; justify-content: center; width: 19px; height: 19px; border-radius: 50%; background: #1474d4; color: white; font-size: 14px; }

.profile-public-fields .row { flex-wrap: wrap; }
.profile-public-fields .grow { min-width: min(200px, 100%); }
.profile-interest-picker { margin-top: 16px; }
.profile-interest-picker summary { cursor: pointer; padding: 12px 0; font-weight: 600; }
.profile-interest-picker summary .hint { margin-left: 8px; font-weight: 400; }
.profile-interest-picker fieldset { border: 0; padding: 0; margin: 0; }
.profile-interest-options { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(150px,100%),1fr)); gap: 4px 16px; }
.profile-interest-options label { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 0; cursor: pointer; }
.profile-interest-options input { width: auto; margin: 0; }
.profile-answer-list { margin: 0; display: grid; gap: 14px; }
.profile-answer-list dt { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.profile-answer-list dd { margin: 0; overflow-wrap: anywhere; }

/* Retention controls inherit the developer panel's visual system. */
.retention-panel { color: var(--text); }
.retention-panel .hint { color: var(--text-2); }
.retention-panel details { margin-block: 16px; }
.retention-panel summary { cursor: pointer; padding-block: 8px; font-weight: 600; }
.retention-panel input, .retention-panel select, .retention-panel textarea { max-width: 100%; box-sizing: border-box; }
.retention-panel textarea { min-height: 72px; width: 100%; }
.retention-panel h4 { margin: 24px 0 12px; }
.retention-item { border-bottom: 1px solid var(--border); padding-block: 12px; overflow-wrap: anywhere; }
.retention-item p { margin: 6px 0; font-size: 13px; }
.retention-panel pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
.retention-panel #retentionSamples { white-space: pre-wrap; }
.retention-confirm { display: flex; gap: 10px; align-items: flex-start; margin-block: 20px 8px; }
.retention-confirm input { flex: 0 0 auto; width: auto; margin-top: 4px; }
.retention-panel :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.retention-panel label, .retention-panel h4 { color: var(--text-2); }

/* Profile editing: stable columns and explicit discovery/location groups. */
#tab-profile .profile-section-heading { font-size: 18px; line-height: 1.3; margin: 0 0 18px; }
#tab-profile :is(input, select, textarea, fieldset, .card-section) { scroll-margin-top: 72px; scroll-margin-bottom: 16px; }
#tab-profile .profile-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 16px; }
#tab-profile label { min-width: 0; font-size: 13px; color: var(--text-2); }
#tab-profile input, #tab-profile select, #tab-profile textarea { min-width: 0; max-width: 100%; font-size: 16px; }
#tab-profile .field-help { display: block; margin: 8px 0 16px; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.5; }
.profile-age { color: var(--text-2); font-size: 13px; font-weight: 600; }
.profile-age output { display: block; padding: 12px 0 2px; min-height: 46px; font-size: 20px; font-weight: 700; color: var(--text); }
.profile-age small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
#tab-profile fieldset { margin: 0; padding: 0; min-width: 0; border: 0; }
#tab-profile fieldset legend { padding: 0; font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.profile-choice-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 24px; }
#tab-profile .profile-choice-options label { display: flex; align-items: center; gap: 10px; min-height: 48px; margin: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); background: var(--panel); font-weight: 500; cursor: pointer; overflow-wrap: anywhere; }
#tab-profile .profile-choice-options input { appearance: auto; width: 18px; height: 18px; min-height: 18px; flex: 0 0 18px; padding: 0; margin: 0; accent-color: #262626; }
#tab-profile .profile-choice-options label:has(input:checked) { background: var(--accent-soft); border-color: var(--accent-ink); }
#tab-profile .profile-choice-options label:focus-within { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.location-summary { margin-bottom: 14px; font-weight: 600; font-size: 14px; }
.location-access-dialog { width: min(390px, calc(100% - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 24px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--panel); color: var(--text); box-shadow: var(--shadow-md); }
.location-access-dialog::backdrop { background: rgb(0 0 0 / .48); }
.location-access-dialog h2 { margin-bottom: 16px; font-size: 24px; line-height: 1.2; }
.location-access-dialog p { margin-bottom: 16px; line-height: 1.5; }
.location-access-dialog button + button { margin-top: 10px; }
#discoveryDeviceLocationBtn { margin-bottom: 14px; }
.profile-location-advanced { margin-top: 18px; border-top: 1px solid var(--border); }
.profile-location-advanced summary { min-height: 48px; padding-block: 14px; color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; }
.profile-location .status { display: block; white-space: normal; overflow-wrap: anywhere; }
.profile-location .status:empty { display: none; }
#tab-profile .card-section > .row { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 0; }
@media (max-width: 350px) {
  .profile-choice-options { grid-template-columns: minmax(0, 1fr); }
  #tab-profile .profile-field-grid { gap: 10px; }
}

/* Reference direction: sunny yellow actions, quiet white screens, charcoal sign-in. */
::selection { background: #ffcc22; color: #262626; }
input, textarea { caret-color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; }
.ui-icon { flex: none; display: block; }
.brand { color: var(--text); }
.brand svg { filter: none; }
.brand > svg { color: var(--accent-ink); }
button { box-shadow: none; transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 120ms ease; }
button:hover { filter: none; }
button.primary-btn { background: var(--accent); }
button.primary-btn:enabled:hover { background: var(--accent-2); }
button.secondary:enabled:hover, button.icon-btn:enabled:hover { color: var(--text); background: var(--accent-soft); border-color: var(--accent); }
button:enabled:active { transform: scale(.97); filter: none; }
button:disabled:hover { background: var(--panel-2); color: var(--muted); border-color: var(--border); }
input, select, textarea { border-radius: 14px; background: var(--panel-2); color: var(--text); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[type="checkbox"].switch:checked { background: var(--text); border-color: var(--text); }
.section-title { font-size: 16px; text-transform: none; letter-spacing: -.02em; color: var(--text); margin-top: 28px; }
.card-section { box-shadow: none; border-radius: 18px; }

#screen-login {
  --bg: #191919; --panel: #191919; --panel-2: #30302d; --border: #51514a;
  --text: #fffef5; --text-2: #f2f0e4; --muted: #c7c5b8; --muted-2: #b8b6a8;
  --accent: #ffcc22; --accent-2: #f0bc08; --accent-ink: #ffda59;
  --accent-soft: #39331e; --accent-contrast: #262626;
  --bad: #ffa4a9; --bad-soft: #41282b; --good: #86deb1; --good-soft: #203b2e;
  color-scheme: dark;
  background: var(--bg); color: var(--text); padding: 36px 28px;
}
.auth-card { background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0; max-width: 340px; margin-block: auto; }
.auth-card .brand { color: var(--accent); margin-bottom: 40px; }
.auth-card h1 { font-size: 33px; letter-spacing: -.035em; font-weight: 750; }
.auth-card .brand > svg { width: 30px; height: 30px; color: var(--accent); }
.auth-tagline { font-size: clamp(28px, 7vw, 36px); line-height: 1.12; font-weight: 800; letter-spacing: -.035em; color: var(--accent); text-align: left; margin-bottom: 32px; max-width: 10ch; }
.auth-card label { color: var(--text-2); font-size: 12px; }
.auth-card input { border-radius: 999px; background: #fffef8; color: #262626; border-color: transparent; min-height: 48px; padding-inline: 18px; }
.auth-card input::placeholder { color: #686862; }
.auth-card .full-width { min-height: 46px; }
.auth-card .link-btn { color: var(--muted); }
.auth-card .link-btn:hover { color: var(--accent); }
.auth-card #realSignupBtn { background: var(--accent); color: var(--accent-contrast); border-color: transparent; }
.dev-disclosure { border-top-style: solid; margin-top: 18px; }
.dev-disclosure summary { padding-block: 6px; }
.dev-disclosure[open] { padding-bottom: 8px; }
.dev-disclosure table { table-layout: fixed; width: 100%; }
.dev-disclosure td { overflow-wrap: anywhere; }

.appbar { background: var(--panel); backdrop-filter: none; border-bottom: 0; padding: 16px 18px 10px; }
.appbar-title { font-size: 28px; font-weight: 750; letter-spacing: -.035em; }
.appbar .brand > svg { width: 23px; color: var(--text); }
.appbar .icon-btn { background: var(--accent); border: 0; }
.app-main { padding-top: 12px; min-height: 0; }
.page-heading { margin-bottom: 14px; }
.tab-panel h2.screen-title { font-size: 26px; line-height: 1.2; }
.bottom-nav { background: var(--panel); backdrop-filter: none; padding: 6px 4px max(8px, env(safe-area-inset-bottom)); }
.nav-btn { color: var(--muted); min-height: 60px; font-size: 10px; font-weight: 600; gap: 5px; }
.nav-btn .nav-icon { width: 42px; height: 28px; display: grid; place-items: center; border-radius: 999px; }
.nav-btn.active { color: var(--text); }
.nav-btn.active .nav-icon { background: var(--accent); color: #262626; transform: none; }
.nav-btn:hover { color: var(--text); }
.nav-btn .ui-icon { width: 22px; height: 22px; }
.deck-toolbar { margin-bottom: 8px; gap: 8px; }
#rewindHelp { font-size: 11px; margin-bottom: 10px; }
.deck-stage { min-height: 350px; }
.card { border: 0; border-radius: 18px; box-shadow: none; background: var(--panel-2); }
.card-portrait { position: relative; min-height: 280px; height: clamp(280px, 38dvh, 380px); overflow: hidden; background: #37372e; }
.card-portrait > img { width: 100%; height: 100%; min-height: 0; display: block; object-fit: cover; }
.card-photo-missing { display: grid; place-items: center; height: 100%; padding-bottom: 70px; color: #eee9d2; background: #37372e; }
.card-info { position: absolute; inset: auto 0 0; padding: 55px 18px 22px; color: white; background: linear-gradient(transparent, rgb(0 0 0 / .78)); }
.card-info::before { content: none; }
.card-info h3 { font-size: 27px; line-height: 1.2; letter-spacing: -.025em; }
.card-info .meta { color: #fff; font-size: 13px; margin-top: 7px; }
.card-shared { margin: 10px 10px 0; padding: 12px 14px; background: var(--panel); border-radius: 14px; }
.card-shared > p { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.profile-topic-list span { background: var(--panel-2); color: var(--text-2); font-weight: 500; }
.card > .profile-actions { position: static; margin: 0; padding: 10px; gap: 8px; background: none; }
.card .profile-details-btn { margin: 0; background: var(--panel); }
.card > .profile-actions .danger { flex: 0 0 auto; }
.swipe-actions { gap: 20px; margin-top: 16px; }
.round-btn { width: 60px; height: 60px; }
.round-btn .ui-icon { width: 26px; height: 26px; }
.round-btn.pass-btn { color: var(--text); box-shadow: none; background: var(--panel-2); }
.round-btn.like-btn { background: var(--accent); width: 68px; height: 68px; margin-top: -4px; }
#superLikeBtnMain { background: var(--panel); color: var(--text); border: 1px solid var(--border); }
.report-inline { font-size: 12px; min-height: 36px; border-color: transparent; }
.deck-empty { border: 0; background: var(--accent-soft); }
  .deck-empty > h3 { font-size: 24px; line-height: 1.2; max-width: 16ch; }
.profile-avatar { background: var(--accent-soft); color: var(--text); border: 0; }
.profile-modal-panel { border-radius: 24px; }
.profile-interest-picker { border-radius: 16px; }
.chat-conversation-row { padding: 16px 6px; }
.chat-conversation-row:enabled:hover { background: var(--panel-2); }
.chat-avatar { width: 48px; height: 48px; flex-basis: 48px; }
.chat-messages { background: var(--panel); border: 0; padding-inline: 0; }
.chat-message { box-shadow: none; background: var(--panel-2); border-color: transparent; }
.chat-message.mine { background: var(--accent-soft); color: var(--text); }
.chat-compose input { border-radius: 999px; min-width: 0; }
.date-plan-panel { box-shadow: none; border-radius: 18px; }
.dev-fab { background: #262626; color: #ffcc22; border: 1px solid #ffcc22; display: grid; place-items: center; }
.discovery-help { margin-top: 12px; font-size: 12px; color: var(--muted); }
.discovery-help summary { cursor: pointer; min-height: 44px; padding-block: 12px; }
.discovery-help .hint { margin-bottom: 8px; }
button:focus-visible, input[type="checkbox"].switch:focus-visible, .retention-panel :focus-visible { outline-color: var(--accent-ink); }

@media (min-width: 560px) {
  body { background: #ffcc22; padding: 24px 16px; }
  .screen, #screen-app { height: min(900px, calc(100dvh - 48px)); min-height: 0; max-height: none; border: 8px solid #30302c; border-radius: 42px; box-shadow: 0 18px 45px rgb(92 67 0 / .18); }
  #screen-login { justify-content: flex-start; }
}
@media (max-width: 559px) {
  body:has(#screen-app:not(.hidden)) .dev-fab { top: 16px; right: 12px; bottom: auto; width: 38px; height: 38px; min-height: 38px; }
  .appbar-actions { padding-right: 40px; gap: 6px; }
  .appbar-actions .link-btn { font-size: 12px; }
  #screen-app { height: 100dvh; min-height: 0; }
  #screen-login { min-height: 100dvh; padding: 32px 24px; }
  .profile-modal { padding: 0; align-items: flex-end; }
  .profile-modal-panel { width: 100%; max-height: 90dvh; border-radius: 24px 24px 0 0; padding: 24px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  button:enabled:active, .nav-btn.active .nav-icon { transform: none; }
}
/* Cosmic Connections: results first, private settings grouped below. */
.astro-section { margin: 28px 0; padding: 20px 16px; border: 1px solid var(--border); border-radius: var(--radius-card, 18px); background: var(--panel); }
.astro-section .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.astro-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.astro-heading h3 { margin: 0; font-size: 18px; line-height: 1.3; letter-spacing: -.02em; }
#astrologyEditor .astro-text-button { width: auto; min-height: 44px; padding: 8px 0; border: 0; border-radius: 4px; background: transparent; box-shadow: none; color: var(--text-2); font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; flex: none; }
#astrologyEditor .astro-text-button:hover { color: var(--accent-ink); background: transparent; }
#astrologyEditor .astro-text-button:focus-visible, .astro-details summary:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; }
.astro-section .astro-intro { margin: 4px 0 20px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.astro-preview:empty { display: none; }
.astro-preview-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.astro-preview-head strong { font-size: 14px; font-weight: 600; }
.astro-visibility { color: var(--muted); font-size: 12px; }
.astro-placements { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 16px 0; border-block: 1px solid var(--divider); gap: 8px; }
.astro-placement { min-width: 0; padding-inline: 4px; }
.astro-placement + .astro-placement { border-left: 1px solid var(--divider); padding-left: 12px; }
.astro-placement dt { display: flex; gap: 6px; align-items: center; margin: 0 0 6px; color: var(--muted); font-size: 12px; font-weight: 500; }
.astro-placement svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.astro-placement dd { margin: 0; font-size: 17px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.astro-placement dd.astro-unavailable { font-size: 12px; font-weight: 400; color: var(--muted); }
.astro-empty { margin: 0; padding: 16px 0; border-block: 1px solid var(--divider); color: var(--muted); font-size: 14px; }
.astro-status { margin: 12px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.astro-status:empty { display: none; }
.astro-status[data-kind="error"] { color: var(--bad); }
.astro-status[data-kind="success"] { color: var(--good); }
.astro-fields { min-width: 0; }
.astro-details { margin-top: 20px; border-block: 1px solid var(--divider); }
.astro-details summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding: 14px 0; cursor: pointer; list-style: none; }
.astro-details summary::-webkit-details-marker { display: none; }
.astro-details summary strong { display: block; font-size: 15px; font-weight: 600; }
#astroDetailsSummary { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.astro-details summary > svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.8; flex: none; }
.astro-details[open] summary > svg { transform: rotate(180deg); }
.astro-details-body { display: grid; gap: 20px; padding: 0 0 20px; }
.astro-account-date { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding-block: 4px; }
.astro-account-date > span { font-size: 13px; font-weight: 600; }
.astro-account-date output { font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.astro-account-date small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.astro-field-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
.astro-field-heading > span { font-size: 13px; font-weight: 600; }
.astro-selected-city { display: grid; gap: 4px; }
.astro-selected-city strong { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.astro-selected-city > span { color: var(--muted); font-size: 12px; }
.astro-city-search { margin-top: 8px; }
.astro-search-row { display: flex; align-items: stretch; gap: 8px; }
#astrologyEditor .astro-search-row input { flex: 1 1 0; min-width: 0; margin: 0; }
#astrologyEditor .astro-search-row button { flex: 0 0 auto; width: auto; padding-inline: 16px; }
#astrologyEditor label { margin: 0; text-transform: none; letter-spacing: normal; font-size: 13px; font-weight: 600; line-height: 1.5; }
#astrologyEditor input:not([type="checkbox"]), #astrologyEditor select { font-size: 16px; width: 100%; min-width: 0; min-height: 46px; }
#astroPlaceField { display: block; margin-top: 12px; }
.astro-help { margin: 8px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.astro-help:empty { display: none; }
.astro-attribution { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
#astrologyEditor .astro-choice { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; font-size: 14px; font-weight: 400; cursor: pointer; }
.astro-choice > span { flex: 1; min-width: 0; }
.astro-choice strong { display: block; font-size: 15px; font-weight: 600; }
.astro-choice small { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.5; }
#astrologyEditor .astro-choice input[type="checkbox"]:not(.switch) { appearance: auto; width: 18px; height: 18px; min-height: 18px; min-width: 18px; flex: 0 0 18px; padding: 0; margin: 3px 0 0; accent-color: var(--accent); }
#astrologyEditor .astro-sharing { align-items: center; padding-block: 20px; }
#astrologyEditor .astro-sharing input.switch { margin: 0; }
#astrologyEditor .astro-sharing input.switch:checked { background: var(--accent); }
#astrologyEditor .astro-consent { padding-block: 16px; border-top: 1px solid var(--divider); }
.astro-time-fields { display: grid; gap: 12px; }
.astro-actions { display: grid; gap: 4px; margin-top: 8px; }
#astrologyEditor .astro-actions .primary-btn { width: 100%; min-height: 46px; }
#astrologyEditor .astro-remove { justify-self: center; color: var(--muted); font-size: 12px; font-weight: 500; }
#astrologyEditor button:disabled { cursor: default; opacity: .55; }
@media (max-width: 349px) { .astro-section { padding-inline: 12px; } .astro-heading h3 { font-size: 17px; } .astro-placement dd { font-size: 15px; } .astro-placement + .astro-placement { padding-left: 8px; } }
.matching-verification { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border); }
.matching-check-heading { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.matching-check-heading h3 { margin: 0; font-size: 20px; line-height: 1.25; letter-spacing: -.02em; }
.matching-check-heading button { flex-shrink: 0; }
.matching-check-facts { margin: 20px 0 8px; }
.matching-check-facts > div { display: grid; grid-template-columns: 1fr 1.35fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--divider); }
.matching-check-facts dt { color: var(--muted); font-size: 13px; }
.matching-check-facts dd { margin: 0; font-size: 14px; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.matching-compare-form { display: grid; gap: 10px; margin-top: 24px; }
.matching-compare-form > label { font-size: 14px; font-weight: 600; }
.matching-compare-form > input { width: 100%; min-width: 0; font-size: 16px; }
.matching-candidate-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.matching-candidate-actions button { font-size: 12px; }
.matching-compare-form .field-help { margin: 0 0 4px; }
.matching-spark-result { margin-top: 16px; padding: 18px; background: var(--accent-soft); border-radius: 16px; color: var(--accent-ink); }
.matching-spark-summary { margin: 0 0 8px; font-size: 20px; line-height: 1.3; font-weight: 750; }
.matching-spark-result .field-help { color: inherit; }
.matching-shared-topics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; font-size: 13px; }
.matching-topic { padding: 4px 9px; border: 1px solid currentColor; border-radius: 999px; text-transform: capitalize; }
@media (max-width: 350px) { .matching-check-heading { align-items: flex-start; flex-direction: column; } }
