/* Colours and fonts follow the JanAI design tokens (janai-website/design/system/tokens.css). */
:root {
  --primary: #401490; --primary-hover: #33007b; --primary-tint: #e6e2ff;
  --accent: #fe6c07; --accent-text: #b83600; --accent-soft: #fff0e3;
  --paper: #f7f4ed; --card: #ffffff; --sunk: #efeae0; --night: #101b33;
  --ink: #16233f; --ink-muted: #5a6780; --line: #ddd6c8; --error: #b3261e; --ok: #1f7a3d;
  --brand-font-display: "Baloo 2", system-ui, sans-serif;
  --brand-font-body: "Noto Sans", "Noto Sans Devanagari", "Noto Sans Kannada", system-ui, sans-serif;
  --font-display: var(--brand-font-display);
  --font-body: var(--brand-font-body);
  --radius: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.55 var(--font-body); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5rem; }
h1 { font-size: clamp(2.2rem, 9vw, 3.4rem); font-weight: 800; }
/* Type scale. Sizes grow smoothly with the screen between a phone value and a laptop value, so nothing is
   oversized on a 360px phone or undersized on a laptop:
     body text            16px phone   17px laptop
     section heading h2   22px phone   25.6px laptop
     sub-heading h3       18.5px phone 20px laptop
     challenge headline   26px phone   34px laptop  (.spotlight-question)
   The #SolveForBharat title (h1) is brand and keeps its own size. */
h2 { font-size: clamp(1.375rem, 1.15rem + 1vw, 1.6rem); font-weight: 700; }
h3 { font-size: clamp(1.15rem, 1.05rem + .45vw, 1.25rem); font-weight: 700; margin-top: 1.5rem; }
@media (max-width: 599px) { body:not(.admin):not(.login-page), .admin .hero { font-size: 16px; } }
p { margin: 0 0 .75rem; }
a { color: var(--primary); }
[hidden] { display: none !important; }
.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--ink-muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.eyebrow { font-weight: 700; letter-spacing: .08em; font-size: .85rem; margin: 0 0 .25rem; }
.eyebrow.accent { color: var(--accent); }

.hero { background: var(--primary); color: #fff; padding: 20px 0 28px; }
.hero .logo img { display: block; margin-bottom: 14px; background: #fff; border-radius: 10px; padding: 4px; }
.hero .tagline { color: #e6e2ff; font-size: 1.05rem; margin: 0; }

/* Step 1: choose a challenge (on the cream page background, directly under the purple header) */
.intro { padding: 26px 0 0; }
.intro .muted { margin-bottom: 16px; }
.challenge-picker { margin-bottom: 0; }
.challenge-picker select, #idea-form select {
  appearance: none; -webkit-appearance: none; padding-right: 44px; text-overflow: ellipsis;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M3 6l5 5 5-5' fill='none' stroke='%2316233f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 16px center;
}
.challenge-picker select { min-height: 56px; font-weight: 600; }

/* Step 2: Challenge Spotlight. The chosen challenge's question is the page's main message: one white surface with
   a hairline border (no shadow, so it does not read as another form card), a short orange rule, a small label,
   then the headline in the display font. Filled from challenges.json by app.js. */
.spotlight { margin: 18px 0 0; padding: 22px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.spotlight::before { content: ""; display: block; width: 44px; height: 4px; margin-bottom: 14px; border-radius: 2px; background: var(--accent); }
.spotlight-eyebrow { margin: 0 0 10px; font-size: .8rem; font-weight: 700; letter-spacing: .1em; color: var(--accent-text); }
.spotlight-question { margin: 0; font-size: clamp(1.625rem, 1.19rem + 1.94vw, 2.125rem); font-weight: 800; line-height: 1.15; letter-spacing: -.005em; color: var(--ink); text-wrap: balance; overflow-wrap: break-word; }
.spotlight-description { margin: 12px 0 0; font-size: 1em; line-height: 1.65; color: var(--ink-muted); }
.own-problem textarea { display: block; margin-top: 16px; min-height: 120px; }
/* A short fade when the challenge changes; the surface itself stays still. */
.spotlight.is-changing > * { animation: spotlight-in .22s ease-out both; }
@keyframes spotlight-in { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .spotlight.is-changing > * { animation: none; } }
@media (min-width: 600px) { .spotlight { padding: 28px; } }
/* Very small phones (320px): a little less padding so the text column stays wide enough. */
@media (max-width: 359px) { .spotlight, .card { padding: 18px 16px; } .rec-btn { width: 152px; height: 152px; } }
#challenge-error { margin: 12px 0 0; }
.encourage { margin: 22px 0 0; }

.card { background: var(--card); border-radius: var(--radius); padding: 20px; margin: 16px 0; box-shadow: 0 1px 2px rgba(22,35,63,.06), 0 4px 16px rgba(22,35,63,.06); }
.card.night { background: var(--night); color: #fff; }
.card.night p { color: #c3cad9; }

.field { display: block; margin: 0 0 16px; }
.label { display: block; font-weight: 600; margin-bottom: 6px; }
input[type=text], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 12px 14px; min-height: 50px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid var(--primary-tint); outline-offset: 1px; border-color: var(--primary); }
.counter { display: block; text-align: right; font-size: .9rem; margin-top: 4px; }

.three-things { background: var(--sunk); border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; }
.three-things ul { margin: 0; padding-left: 1.2rem; }
.three-things .label { margin: 0 0 4px; }

.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--sunk); border-radius: 14px; padding: 4px; margin-bottom: 14px; }
.mode-tabs button { font: 600 1rem var(--font-body); border: 0; background: transparent; color: var(--ink-muted); padding: 12px 8px; border-radius: 10px; min-height: 48px; cursor: pointer; }
.mode-tabs button[aria-selected=true] { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(22,35,63,.15); }
.panel { margin-bottom: 16px; }
.panel-title { font-weight: 700; margin-bottom: 2px; }

.recorder { text-align: center; padding: 8px 0 4px; }
.rec-btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  width: 168px; height: 168px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: var(--ink); font: 700 1rem var(--font-body);
  box-shadow: 0 6px 20px rgba(254,108,7,.35); margin: 8px auto;
}
.rec-dot { width: 34px; height: 34px; border-radius: 50%; background: #fff; }
.rec-btn.recording { background: #d64e00; color: #fff; animation: pulse 1.4s ease-in-out infinite; }
.rec-btn.recording .rec-dot { border-radius: 6px; width: 28px; height: 28px; }
@keyframes pulse { 50% { box-shadow: 0 0 0 14px rgba(254,108,7,.18); } }
@media (prefers-reduced-motion: reduce) { .rec-btn.recording { animation: none; } }
.timer { font: 700 1.4rem var(--font-display); font-variant-numeric: tabular-nums; margin: 6px 0; }
.playback audio { width: 100%; margin: 6px 0 10px; }
.notice { background: var(--accent-soft); color: var(--accent-text); border-radius: 10px; padding: 10px 12px; text-align: left; }

.row { display: flex; gap: 10px; justify-content: center; }
.wrap-row { flex-wrap: wrap; justify-content: flex-start; margin: 16px 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 18px; border-radius: 12px; border: 0; font: 600 1rem var(--font-body); text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { opacity: .6; cursor: progress; }
.btn-secondary { background: var(--primary-tint); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--ink-muted); text-decoration: underline; }
.btn-accent { background: var(--accent); color: var(--ink); }
.btn-whatsapp { background: #1f7a3d; color: #fff; }
.btn-block { width: 100%; font-size: 1.1rem; min-height: 56px; }

.consent { display: flex; gap: 12px; align-items: flex-start; margin: 8px 0 16px; font-size: .95rem; }
.consent input { width: 24px; height: 24px; flex: none; margin-top: 2px; accent-color: var(--primary); }
.error { background: #fdecea; color: var(--error); border-radius: 10px; padding: 10px 12px; font-weight: 600; }
.progress { height: 8px; background: var(--sunk); border-radius: 4px; overflow: hidden; margin-bottom: 12px; }
.progress div { height: 100%; width: 0; background: var(--primary); transition: width .2s; }

.done { text-align: center; }
.done .wrap-row { justify-content: center; }
.entry-id { font: 800 2.2rem var(--font-display); letter-spacing: .06em; color: var(--primary); background: var(--primary-tint); border-radius: 12px; padding: 8px 12px; display: inline-block; margin: 0 0 12px; }

.after { padding: 12px 0; }
.steps { padding-left: 1.3rem; }
.meetup .when { font: 700 1.3rem var(--font-display); color: var(--accent-text); margin-bottom: 4px; }
.footer { padding: 24px 16px 40px; color: var(--ink-muted); font-size: .9rem; text-align: center; }

.legal h1 { font-size: 2rem; margin-top: 24px; }
.legal h2 { font-size: 1.3rem; margin-top: 1.5rem; }

/* Admin */
/* Restrained enterprise look: neutral surfaces, hairline borders, small square-ish controls, brand colour only
   on the header, the active tab, primary actions and the selected page. */
.admin { --font-body: "IBM Plex Sans", "Noto Sans Devanagari", "Noto Sans Kannada", system-ui, sans-serif; --font-display: var(--font-body);
  --a-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; --a-line: #dfe2e7; --a-line-strong: #cbd0d8; --a-muted: #5b6577; --a-soft: #f7f8fa; background: #f4f5f7; }
.admin main { padding: 20px 24px 32px; }

/* Admin header: the user-facing #SolveForBharat header itself (.hero, same markup as public/index.html). The
   dashboard below uses IBM Plex, so the header gets the public brand fonts back. Then the navigation bar. */
.admin .hero { --font-display: var(--brand-font-display); --font-body: var(--brand-font-body); font-family: var(--font-body); }
.admin-inner { padding: 0 24px; display: flex; align-items: center; gap: 16px; }
.admin-nav { background: #fff; border-bottom: 1px solid var(--a-line); }
.admin-nav .admin-inner { gap: 4px; }
.admin-nav a { display: inline-block; padding: 13px 14px 10px; font-weight: 500; font-size: .9rem; color: var(--a-muted); text-decoration: none; border-bottom: 3px solid transparent; transition: color .15s, background-color .15s; }
.admin-nav a:hover { color: var(--primary); background: var(--a-soft); }
.admin-nav a.active { color: var(--primary); border-bottom-color: var(--accent); }
.admin-user { margin-left: auto; min-width: 0; font-size: .85rem; color: var(--a-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-user strong { color: var(--ink); font-weight: 500; }

/* Statistics: compact rounded pills with a coloured status dot (restored design) */
.admin-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.admin-stats .stat { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; font-size: .85rem; color: var(--ink-muted); background: #fff; border: 1px solid var(--line); border-radius: 999px; text-transform: capitalize; }
.admin-stats .stat strong { color: var(--ink); font-weight: 600; }
.admin-stats .stat { font-variant-numeric: tabular-nums; }
.admin-stats .stat:first-child { text-transform: none; }
.admin-stats .stat i { width: 8px; height: 8px; border-radius: 50%; background: #8b97b0; }
.admin-stats .stat-shortlisted i { background: var(--ok); }
.admin-stats .stat-rejected i { background: var(--error); }

/* Toolbar: filters on the left, export on the right; wraps on small screens */
.admin-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 10px; }
.admin-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.admin-toolbar select, .admin-toolbar .btn { height: 32px; min-height: 32px; font: 500 .82rem var(--font-body); border-radius: 4px; }
.admin-toolbar select { width: auto; padding: 0 8px; color: var(--ink); background-color: #fff; border: 1px solid var(--a-line-strong); }
.admin-toolbar .btn { padding: 0 14px; }
.admin-toolbar .btn-secondary { color: var(--ink); background: #fff; border: 1px solid var(--a-line-strong); }
.admin-toolbar .btn-secondary:hover { background: var(--a-soft); }
.admin-toolbar .btn-primary:hover { background: var(--primary-hover); }

/* Table: fixed layout with a minimum width, so narrow screens scroll sideways instead of squashing */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--a-line); border-radius: 6px; -webkit-overflow-scrolling: touch; }
.admin table { border-collapse: collapse; width: 100%; min-width: 1000px; table-layout: fixed; font-size: .875rem; font-weight: 400; font-variant-numeric: tabular-nums; }
.admin col.c-entry { width: 14%; }
.admin col.c-challenge { width: 15%; }
.admin col.c-person { width: 17%; }
.admin col.c-idea { width: 40%; }
.admin col.c-status { width: 14%; }
.admin td.empty { padding: 32px; text-align: center; color: var(--a-muted); }
.admin th { text-align: left; font-size: .7rem; font-weight: 500; letter-spacing: .07em; text-transform: uppercase; color: var(--a-muted); background: var(--a-soft); padding: 9px 14px; border-bottom: 1px solid var(--a-line); white-space: nowrap; }
.admin td { text-align: left; vertical-align: middle; padding: 12px 14px; border-bottom: 1px solid #eceef2; line-height: 1.4; overflow-wrap: anywhere; }
.admin tbody tr:last-child td { border-bottom: 0; }
.admin tbody tr:hover { background: #fafbfc; }
/* Each line of a cell is its own block element, so lines stack without depending on any display rule. */
.admin .entry-code { font: 500 .875rem var(--a-mono); letter-spacing: 0; color: var(--ink); white-space: nowrap; margin-bottom: 3px; }
.admin .cell-main { font-weight: 500; color: var(--ink); }
.admin .meta { font-size: .78rem; font-weight: 400; color: var(--a-muted); font-variant-numeric: tabular-nums; }
.admin .badge { display: block; margin-top: 2px; padding: 0; font-size: .78rem; font-weight: 400; color: var(--a-muted); background: none; border-radius: 0; }

/* Idea column: a Voice block and/or a Text block, each labelled */
.admin .idea-block + .idea-block { margin-top: 10px; padding-top: 10px; border-top: 1px solid #eceef2; }
.admin .type-badge { display: inline-block; margin-bottom: 4px; padding: 0 5px; font-size: .62rem; font-weight: 500; letter-spacing: .07em; line-height: 1.5; text-transform: uppercase; color: var(--a-muted); border: 1px solid var(--a-line-strong); border-radius: 2px; background: none; }
.admin .type-audio { color: var(--primary); border-color: #c9bfe6; }
/* pre-wrap keeps the visitor's paragraphs and line breaks; the column width does the wrapping */
.admin .idea-text { font-size: .875rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
/* Preview: 3 lines. Only when the page script (and so the dialog) is available; otherwise the full text just shows. */
.has-dialog .admin .idea-text.clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; white-space: normal; /* preview flows as one block; the dialog keeps the paragraphs */ }
.admin .view-details { display: none; margin-top: 4px; padding: 0; border: 0; background: none; font: 500 .8rem var(--font-body); color: var(--primary); cursor: pointer; }
.has-dialog .admin .view-details { display: inline-block; }
.admin .view-details:hover { text-decoration: underline; }
.admin .view-details:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 2px; }

/* Compact audio: the browser's own control (it shows the real duration), kept short */
.admin td audio { display: block; width: 100%; max-width: 300px; height: 32px; margin-top: 2px; }

/* Status: a plain admin dropdown. A thin left edge carries the colour, not a filled pill. */
.admin td select.status { width: 100%; max-width: 122px; height: 28px; min-height: 28px; padding: 0 4px 0 6px; font: 500 .8rem var(--font-body); text-transform: capitalize; color: var(--ink); background-color: #fff; border: 1px solid var(--a-line-strong); border-left-width: 3px; border-radius: 4px; cursor: pointer; }
.admin td select.status:hover { border-color: #aab1bd; }
.admin td select.status-new { border-left-color: #8b97b0; }
.admin td select.status-shortlisted { border-left-color: var(--ok); }
.admin td select.status-rejected { border-left-color: var(--error); }
.admin td select.status:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

/* Pagination: same 32px square controls as the toolbar */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 12px; }
.pager-info { margin: 0; font-size: .8rem; color: var(--a-muted); font-variant-numeric: tabular-nums; }
.pager-info strong { color: var(--ink); font-weight: 500; }
.pager-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pager-nav a, .pager-nav span { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 9px; font-size: .82rem; font-weight: 500; font-variant-numeric: tabular-nums; border-radius: 4px; text-decoration: none; }
.pager-nav a { color: var(--ink); background: #fff; border: 1px solid var(--a-line-strong); }
.pager-nav a:hover { background: var(--a-soft); border-color: #aab1bd; }
.pager-nav .pg-num.current { color: #fff; background: var(--primary); border: 1px solid var(--primary); }
.pager-nav .pg-step.disabled { color: #9aa3b2; background: var(--a-soft); border: 1px solid var(--a-line); cursor: not-allowed; }
.pager-nav .pg-gap { min-width: 18px; padding: 0; font-weight: 400; color: var(--a-muted); }
.pager-nav .pager-now { margin-left: 8px; padding: 0; min-width: 0; font-weight: 400; font-size: .8rem; color: var(--a-muted); }
.pager a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Loading: dim the table and run a thin progress bar under the nav while the next page loads */
.is-loading .table-wrap { opacity: .55; pointer-events: none; transition: opacity .15s; }
.is-loading .admin-nav { position: relative; overflow: hidden; }
.is-loading .admin-nav::after { content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: 35%; background: var(--accent); animation: admin-load 1s ease-in-out infinite; }
@keyframes admin-load { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

/* Details dialog */
.idea-dialog { width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: 8px; background: #fff; color: var(--ink); box-shadow: 0 20px 60px rgba(16, 27, 51, .35); overflow: hidden; }
.idea-dialog[open] { display: flex; flex-direction: column; }
.idea-dialog::backdrop { background: rgba(16, 27, 51, .55); }
.dlg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 14px 20px; background: var(--primary); color: #fff; }
.dlg-entry { font: 500 1.1rem/1.2 var(--a-mono); letter-spacing: 0; }
.dlg-meta { margin-top: 3px; font-size: .82rem; color: #e6e2ff; overflow-wrap: anywhere; }
.dlg-x { flex: none; width: 32px; height: 32px; border: 0; border-radius: 4px; background: rgba(255, 255, 255, .15); color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.dlg-x:hover { background: rgba(255, 255, 255, .28); }
.dlg-body { padding: 20px; overflow-y: auto; font-size: .98rem; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.dlg-foot { display: flex; justify-content: flex-end; padding: 10px 20px; border-top: 1px solid var(--a-line); background: var(--a-soft); }
.dlg-foot .btn { height: 32px; min-height: 32px; padding: 0 16px; border-radius: 4px; font-size: .82rem; font-weight: 500; color: var(--ink); background: #fff; border: 1px solid var(--a-line-strong); }
.dlg-foot .btn:hover { background: #f1f3f6; }

/* Small screens: pills wrap, full-width filter controls; the table scrolls sideways inside its container */
@media (max-width: 720px) {
  .admin main { padding: 16px 12px 28px; }
  .admin-inner { padding: 0 12px; }
  .admin-filters { width: 100%; }
  /* Keep the Entry column in view while the table scrolls sideways */
  .admin th:first-child, .admin td:first-child { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--a-line); }
  .admin td:first-child { background: #fff; }
  .admin th:first-child { background: var(--a-soft); }
  .admin-filters select { flex: 1 1 140px; }
  .admin-toolbar > .btn { width: 100%; }
  .pager-nav .pager-now { display: none; }
}

/* Admin: sign out (nav) */
.logout-form { margin: 0 0 0 12px; flex: none; }
.logout-btn { height: 30px; padding: 0 12px; font: 500 .82rem var(--font-body); color: var(--ink); background: #fff; border: 1px solid var(--a-line-strong); border-radius: 4px; cursor: pointer; }
.logout-btn:hover { background: var(--a-soft); border-color: #aab1bd; }
.logout-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Sign-in page: the public header (.hero) on top, then one centred card. Uses the public page's tokens and fonts. */
.login-page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--paper); }
.login-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 28px 16px 40px; }
.login-card { position: relative; width: 100%; max-width: 440px; background: var(--card); border: 1px solid rgba(22, 35, 63, .08); border-radius: var(--radius); padding: 30px 30px 24px; overflow: hidden; box-shadow: 0 1px 2px rgba(22, 35, 63, .05), 0 12px 32px rgba(22, 35, 63, .08); }
.login-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--accent); }
.login-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-bottom: 12px; border-radius: 12px; background: var(--primary-tint); color: var(--primary); }
.login-heading { margin: 0 0 4px; font: 700 1.65rem/1.2 var(--font-display); color: var(--ink); }
.login-intro { margin: 0 0 22px; font-size: .98rem; color: var(--ink-muted); }
.login-field { display: block; margin: 0 0 6px; font-size: .95rem; font-weight: 600; color: var(--ink); }
.login-card input[type=text], .login-card input[type=email] {
  display: block; width: 100%; height: 52px; min-height: 52px; margin: 0 0 18px; padding: 0 14px;
  font: 400 1rem var(--font-body); color: var(--ink); background: #fff;
  border: 1.5px solid var(--line); border-radius: 12px; transition: border-color .15s, box-shadow .15s;
}
.login-card input::placeholder { color: #8a94a8; }
.login-card input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint); }
.login-submit { width: 100%; min-height: 52px; margin-top: 4px; font: 600 1.05rem var(--font-body); border-radius: 12px; transition: background-color .15s, opacity .15s; }
.login-submit:disabled { opacity: .75; cursor: progress; }
.login-error, .login-notice { margin: 0 0 18px; padding: 11px 14px; font-size: .93rem; font-weight: 600; border-radius: 12px; }
.login-error { color: var(--error); background: #fdecea; border: 1px solid #f3c5c0; }
.login-notice { color: var(--ok); background: #e4f4ea; border: 1px solid #b9dfc6; }
.login-foot { margin: 20px 0 0; font-size: .85rem; line-height: 1.5; color: var(--ink-muted); text-align: center; }
/* Sign-in options: two full-width buttons in the same shape as the fields, white with a hairline border (Google's
   own sign-in button style), so the purple Send button stays the one primary action on each step. */
.auth-view { margin: 0; }
.auth-btn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 52px; margin: 0 0 12px; padding: 0 16px;
  font: 600 1rem var(--font-body); color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer;
  transition: border-color .15s, background-color .15s, box-shadow .15s; }
.auth-btn svg { flex: none; }
.auth-btn:hover:not(:disabled) { border-color: var(--primary); background: #faf8ff; }
.auth-btn:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint); }
.auth-btn:disabled { opacity: .55; cursor: not-allowed; }
#btn-email svg { color: var(--primary); }
.auth-back { display: block; margin: 14px auto 0; padding: 6px 8px; font: 600 .92rem var(--font-body); color: var(--primary); background: none; border: 0; border-radius: 8px; cursor: pointer; }
.auth-back:hover { text-decoration: underline; }
.auth-back:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* "Check your email" */
.auth-sent { text-align: center; }
.auth-sent-icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin-bottom: 10px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); }
.auth-sent-title { margin: 0 0 6px; font: 700 1.2rem/1.3 var(--font-display); color: var(--ink); }
.auth-sent-title:focus, .auth-confirm-text:focus { outline: none; }
.auth-sent-text { margin: 0 0 18px; font-size: .95rem; line-height: 1.55; color: var(--ink-muted); overflow-wrap: anywhere; }
.auth-sent-text strong { color: var(--ink); }
.auth-resend { width: 100%; min-height: 48px; border-radius: 12px; }
.auth-resend:disabled { opacity: .7; cursor: default; }
.auth-confirm-text { margin: 0 0 16px; font-size: .95rem; line-height: 1.55; color: var(--ink-muted); }
/* "Signing you in…" */
.auth-busy { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 116px; font-weight: 600; color: var(--ink); }
.auth-busy[hidden] { display: none; }
.auth-spinner { width: 22px; height: 22px; border: 3px solid var(--primary-tint); border-top-color: var(--primary); border-radius: 50%; animation: auth-spin .8s linear infinite; }
@keyframes auth-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .login-card input, .login-submit, .auth-btn { transition: none; } .auth-spinner { animation-duration: 2.4s; } }
@media (max-width: 480px) {
  .login-main { align-items: flex-start; padding: 24px 16px 40px; }
  .login-card { padding: 28px 20px 22px; }
  .login-heading { font-size: 1.5rem; }
}

/* Admin: a visitor's own problem statement, previewed under the challenge name (full text in View details) */
.admin .problem-text { margin: 3px 0 2px; font-size: .8rem; line-height: 1.4; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.has-dialog .admin .problem-text.clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; white-space: normal; }

/* Admin dashboard: the page loads its contents after checking the sign-in */
.admin-loading { display: flex; align-items: center; gap: 12px; padding: 40px 0; color: var(--a-muted); font-size: .95rem; }
.admin-message { margin: 24px 0; padding: 14px 16px; color: var(--ink); background: #fff; border: 1px solid var(--a-line); border-radius: 6px; }
.admin .entry-filter { margin: 0 0 10px; font-size: .85rem; color: var(--a-muted); }
.admin .entry-filter strong { font-family: var(--a-mono); font-weight: 500; color: var(--ink); }
.admin .audio-error { margin: 4px 0 0; color: var(--error); }
.admin-toolbar .btn.is-busy { opacity: .7; cursor: progress; }
