/* askback — mobile-first UI on the virtualQ design language (tokens + Panton, per health-dashboard). */
@font-face { font-family: 'Panton'; src: url('./fonts/Panton-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Panton'; src: url('./fonts/Panton-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Panton'; src: url('./fonts/Panton-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --background: #f4f6fa; --foreground: #111827;
  --card: #ffffff; --card-foreground: #111827;
  --muted: #f1f5f9; --muted-foreground: #667085;
  --border: #dbe3ec; --border-strong: #c9d4df; --input: #9aa8b7;
  --primary: #4a7b90; --primary-hover: #5d91a6; --primary-dark: #354855;
  --ok: #88b96d; --ok-soft: #e8f4e2; --warn: #f5d05e; --warn-soft: #fff6d8;
  --down: #ef9666; --down-soft: #fff0e8; --danger: #dc2626;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(15,23,42,.08), 0 8px 24px rgba(15,23,42,.04);
  --font-sans: Inter, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-brand: Panton, var(--font-sans);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans); color: var(--foreground); background: var(--background);
  min-width: 320px; -webkit-font-smoothing: antialiased; line-height: 1.45;
}
h1, h2, h3, .brand { font-family: var(--font-brand); font-weight: 600; }
button { font-family: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted-foreground); }

/* App shell */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--border);
}
.brand { font-size: 18px; font-weight: 700; color: var(--primary-dark); }
.brand span { color: var(--primary); }
.topbar .who { font-size: 13px; color: var(--muted-foreground); display: flex; gap: 10px; align-items: center; }
.linkbtn { background: none; border: 0; color: var(--primary); cursor: pointer; font-size: 13px; padding: 4px; }

.tabs { display: flex; gap: 4px; padding: 8px 12px 0; background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 57px; z-index: 9; }
.tab { flex: 1; text-align: center; padding: 10px 8px; border: 0; background: none; color: var(--muted-foreground); font-size: 14px; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; }
.tab[aria-selected='true'] { color: var(--primary); border-bottom-color: var(--primary); }

main { width: min(100%, 640px); margin: 0 auto; padding: 16px; }
.screen { display: flex; flex-direction: column; gap: 14px; }

/* Cards */
.vq-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.vq-card-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.vq-card-header h2, .vq-card-header h3 { margin: 0; font-size: 15px; }
.vq-card-content { padding: 16px; display: flex; flex-direction: column; gap: 12px; }

.decision-q { font-size: 17px; font-weight: 600; font-family: var(--font-brand); line-height: 1.35; }
.decision-ctx { font-size: 14px; color: var(--muted-foreground); }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--muted); color: var(--muted-foreground); }
.badge.session { background: #eef4f7; color: var(--primary-dark); }
.badge.u-high { background: var(--down-soft); color: #9a4b1f; }
.badge.u-normal { background: var(--muted); }
.badge.u-low { background: var(--ok-soft); color: #3f6b2c; }
.age { font-size: 12px; color: var(--muted-foreground); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 16px; border-radius: 6px; border: 1px solid transparent; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-ghost { background: var(--card); color: var(--foreground); border-color: var(--border-strong); }
.btn-ghost:hover:not(:disabled) { background: var(--muted); }
.btn-danger { background: #fff; color: var(--danger); border-color: #f3c9c9; }
.btn-block { width: 100%; }

.options { display: flex; flex-direction: column; gap: 8px; }
.option { position: relative; text-align: left; padding: 12px 14px; }
.option .lbl { font-weight: 600; }
.option .desc { font-size: 13px; font-weight: 400; color: var(--muted-foreground); margin-top: 2px; }
.option[aria-pressed='true'] { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.rec-tag { position: absolute; top: 8px; right: 10px; font-size: 11px; font-weight: 700; color: var(--primary); }

/* Inputs */
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted-foreground); }
input[type=text], input[type=tel], textarea {
  width: 100%; font: inherit; color: var(--foreground); padding: 10px 12px;
  border: 1px solid var(--input); border-radius: 6px; background: #fff;
}
textarea { resize: vertical; min-height: 64px; }
.answer-row { display: flex; gap: 8px; align-items: flex-end; }
.answer-row textarea { flex: 1; }
.actions { display: flex; gap: 8px; }

/* Token secret / code block */
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--primary-dark); color: #eaf1f4; padding: 12px; border-radius: 6px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.token-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.token-row:last-child { border-bottom: 0; }
.token-row .tid { font-size: 13px; }
.token-row.revoked { opacity: .5; }

/* States */
.empty { text-align: center; color: var(--muted-foreground); font-size: 14px; padding: 40px 16px; }
.skeleton { height: 96px; border-radius: var(--radius); background: linear-gradient(90deg, #eef2f6 25%, #e4eaf0 37%, #eef2f6 63%); background-size: 400% 100%; animation: pulse 1.4s ease infinite; }
@keyframes pulse { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--primary-dark); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; box-shadow: var(--shadow); z-index: 50; }

/* Deep-link highlight */
.flash { animation: flash 2s ease; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--primary); } 100% { box-shadow: var(--shadow); } }

/* Recent / history */
.recent-h { margin: 6px 2px 0; font-size: 13px; font-weight: 700; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: .04em; }
.recent-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.recent-item .q { font-size: 14px; }
.recent-item .a { font-size: 13px; color: var(--muted-foreground); margin-top: 2px; }
.st { flex: none; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.st.answered { background: var(--ok-soft); color: #3f6b2c; }
.st.dismissed { background: var(--muted); color: var(--muted-foreground); }
.st.timed_out { background: var(--down-soft); color: #9a4b1f; }

/* Login overlay */
.overlay { position: fixed; inset: 0; background: var(--background); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 100; }
.login-card { width: 100%; max-width: 380px; text-align: center; }
.login-card .brand { font-size: 30px; display: block; margin-bottom: 6px; }
.login-card p { color: var(--muted-foreground); margin: 0 0 20px; }
.gbtn { display: flex; align-items: center; justify-content: center; gap: 10px; }

@media (min-width: 560px) { .decision-q { font-size: 18px; } }
