/* Additions to the mock's style.css for the live app. Neutral colours only: nothing red or blue. */

.linklike {
  background: none; border: none; padding: 0; cursor: pointer;
  font: inherit; font-size: 0.85rem; color: var(--poppy-deep); text-decoration: underline;
}
.sample-form { margin-top: 0.8rem; display: flex; gap: 0.4rem; align-items: baseline; flex-wrap: wrap; }
.hint { font-size: 0.82rem; color: var(--ink-soft); margin-top: 0.4rem; }
.ballot-meta .change { font-size: 0.78rem; margin-left: auto; }
@media (max-width: 640px) {
  .hint { font-size: 0.9rem; }
  .sample-form { flex-direction: column; align-items: flex-start; gap: 0; }
  .linklike { font-size: 1rem; text-align: left; min-height: var(--tap); line-height: 1.4; }
  .ballot-meta .change { font-size: 0.9rem; min-height: var(--tap); min-width: var(--tap); display: inline-flex; align-items: center; justify-content: flex-end; }
}

/* reading progress */
.progress { margin: 1.4rem 0 0.4rem; max-width: 28rem; }
.progress-text { font-family: var(--mono); font-size: 0.78rem; margin-bottom: 0.3rem; }
@media (max-width: 640px) { .progress-text { font-size: 0.85rem; } }
.progress-bar { height: 8px; background: var(--paper-deep); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; background: var(--teal); transition: width 0.4s; }
.ready { margin-top: 0.5rem; font-weight: 700; color: var(--teal); }

/* stars and read ticks */
.star {
  margin-left: auto; cursor: pointer; font: inherit; font-size: 0.8rem;
  background: transparent; border: 1px solid var(--line); border-radius: 3px; padding: 0.2rem 0.6rem; color: var(--ink);
}
.star[aria-pressed="true"] { border-color: var(--poppy-deep); color: var(--poppy-deep); }
.read-tick { font-family: var(--mono); font-size: 0.72rem; color: var(--teal); }
.starred-list { margin-left: 1.2rem; }
.starred-list li { margin: 0.3rem 0; }
@media (max-width: 640px), (pointer: coarse) {
  .star { min-height: var(--tap); min-width: var(--tap); padding: 0.4rem 0.85rem; font-size: 0.9rem; border-color: var(--ink-soft); }
  .read-tick { font-size: 0.8rem; }
  .starred-list li { margin: 0; }
  .starred-list a { display: inline-flex; align-items: center; min-height: var(--tap); }
}

/* measure page */
.actions { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin: 0.4rem 0 1rem; }
.actions .star { margin-left: 0; }
.measure-page .src, .hint .src { text-decoration: none; color: var(--teal); }
.hint .src:hover { color: var(--paper); }
.measure-page .actions { margin-top: 1rem; }
.missing { font-style: italic; color: var(--ink-soft); }
.args .col p { font-size: 0.9rem; white-space: pre-line; }

/* ask */
.ask { margin-top: 2.5rem; border-top: 2px dashed var(--ink-soft); padding-top: 0.5rem; }
.ask-form { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.8rem; max-width: 40rem; }
.ask-form input {
  flex: 1 1 16rem; min-width: 0; font: inherit; font-size: 1rem; padding: 0.75rem 1rem;
  border: 2px solid var(--ink); background: #fffdf8; border-radius: 3px;
}
/* Phones: the question box and the Ask button share one line, so the button stays visible above the
   on-screen keyboard. */
@media (max-width: 640px) {
  .ask-form { flex-wrap: nowrap; gap: 0.5rem; }
  .ask-form input { flex: 1 1 auto; padding: 0.7rem 0.8rem; }
  .ask-form .btn { flex: 0 0 auto; padding: 0.7rem 1.1rem; font-size: 1rem; }
  .answer { padding: 0.9rem 1rem; }
  .answer .points li p { font-size: 1rem; }
  .answer blockquote { font-size: 0.95rem; }
  .findings, .prepared-note { font-size: 0.88rem; }
}
.ask-result { margin-top: 1rem; max-width: 46rem; }
.answer { background: #fffdf8; border: 1px solid var(--line); padding: 1rem 1.2rem; }
.answer .points { list-style: none; }
.answer .points li { margin-bottom: 0.9rem; }
.answer blockquote { border-left: 3px solid var(--teal); padding-left: 0.8rem; margin-top: 0.3rem; font-size: 0.88rem; color: var(--ink-soft); }
.verdict { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal); }
.verdict.blocked { color: var(--ink-soft); }
.findings { font-size: 0.82rem; color: var(--ink-soft); margin: 0.4rem 0 0 1.2rem; }
.ask-progress { max-width: 28rem; }
.ask-progress .progress-bar { margin: 0.6rem 0 0.3rem; }
.ask-progress .progress-bar span { transition: width 0.5s linear; }
.thinking { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.5; } }
@media (prefers-reduced-motion: reduce) {
  .thinking { animation: none; }
  .progress-bar span, .ask-progress .progress-bar span { transition: none; }
}

/* ask: prepared answers */
.prepared-note { font-size: 0.8rem; color: var(--ink-soft); margin: 0.6rem 0 0; }

.rules { margin: 0.6rem 0 1rem 1.3rem; max-width: 46rem; }
.rules li { margin: 0.5rem 0; }

/* suggested questions, search, ask page, methodology */
.suggest {
  font: inherit; font-size: 0.82rem; cursor: pointer; background: #fffdf8;
  border: 1.5px solid var(--ink-soft); border-radius: 999px; padding: 0.35rem 0.9rem; color: var(--ink);
}
.suggest:hover { border-color: var(--poppy-deep); color: var(--poppy-deep); }
.suggest:disabled { opacity: 0.6; cursor: progress; }
/* Phones: suggested questions become full-width rows, easy to tap and to read in full. */
@media (max-width: 640px), (pointer: coarse) {
  .suggest { min-height: var(--tap); padding: 0.55rem 1rem; font-size: 0.95rem; text-align: left; line-height: 1.35; }
}
@media (max-width: 640px) {
  .canned { flex-direction: column; align-items: stretch; gap: 0.5rem; }
  .suggest { border-radius: 1.4rem; }
}
.filter-chip { text-decoration: none; color: var(--ink); padding: 0.3rem 0.8rem; }
.meta-line .chip { text-decoration: none; color: inherit; }
@media (max-width: 640px), (pointer: coarse) {
  .meta-line { line-height: 2.2; }
  a.chip { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 0.7rem; margin: 0.15rem 0.1rem; font-size: 0.8rem; vertical-align: middle; }
}
.pick { display: flex; gap: 0.6rem; align-items: center; margin: 1.6rem 0 0.4rem; flex-wrap: wrap; }
.pick label { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; }
.pick select { font: inherit; font-size: 1rem; min-height: var(--tap); padding: 0.55rem 0.8rem; border: 2px solid var(--ink); background: #fffdf8; border-radius: 3px; max-width: 100%; }
.never { font-family: var(--serif); font-size: 1.15rem; }

/* sign-in and community */
.signout { display: inline; }
.auth-chip { font: inherit; cursor: pointer; }
.flash { margin-bottom: 1.2rem; }
.signin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; margin-top: 1.6rem; }
.signin-grid .panel { background: #fffdf8; border: 1.5px solid var(--ink); padding: 1.3rem; }
.signin-grid h2 { margin-top: 0; }
.signin-grid label { display: block; font-size: 0.85rem; margin: 0.8rem 0; }
.signin-grid input:not([type=hidden]) { display: block; width: 100%; margin-top: 0.3rem; font: inherit; font-size: 1rem; padding: 0.6rem 0.8rem; border: 2px solid var(--ink); border-radius: 3px; background: #fff; }
.community { margin-top: 3rem; }
.community .zone-label a { color: inherit; }
.inline { display: inline; }
.linklike.small { font-size: 0.7rem; margin-left: 0.4rem; }
.composer textarea, .composer input[type=url] { display: block; width: 100%; font: inherit; font-size: 1rem; padding: 0.7rem; border: 1.5px solid var(--ink-soft); border-radius: 3px; margin: 0.6rem 0; background: #fffdf8; }
.composer textarea { min-height: 5rem; }
details.composer summary { list-style: none; display: inline-block; margin-top: 0.8rem; }
.status.bridged { background: var(--teal); color: var(--paper); }
.rate { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-top: 0.6rem; font-size: 0.8rem; }
.rate select { font: inherit; font-size: 1rem; padding: 0.25rem 0.4rem; }
@media (max-width: 640px) { .signin-grid { grid-template-columns: 1fr; } }
.official { font-family: var(--mono); font-size: 0.66rem; color: var(--good); border: 1px solid var(--good); border-radius: 999px; padding: 0.05rem 0.45rem; margin-left: 0.3rem; }
.args.who .col p { font-size: 0.85rem; color: var(--ink-soft); }
.args.who h2 { border-bottom-width: 1px; }
.analysis { margin: 1.4rem 0; border: 1px solid var(--line); background: #fffdf8; padding: 0.8rem 1rem; }
.analysis summary { cursor: pointer; font-family: var(--serif); font-weight: 600; font-size: 1.05rem; }
.analysis-text { white-space: pre-line; font-size: 0.9rem; margin: 0.8rem 0; max-width: 46rem; }
@media (max-width: 640px), (pointer: coarse) {
  .analysis summary { min-height: var(--tap); padding: 0.4rem 0; }
}
@media (max-width: 640px) {
  .analysis-text, .args .col p { font-size: 1rem; }
  .equal-note { font-size: 0.88rem; }
}
.gap { margin-top: 2rem; }
.subhead { font-family: var(--serif); font-size: 1.1rem; margin: 1rem 0 0.4rem; }
/* "More measures": the summary looks and works like a button, with the count up front. */
details.maybe { margin-top: 1.4rem; }
details.maybe summary {
  cursor: pointer; font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 0.8rem;
  border: 1.5px solid var(--ink); background: #fffdf8; padding: 0.7rem 1rem; min-height: var(--tap);
}
details.maybe summary strong { color: var(--ink); font-size: 1rem; }

/* Local measures on phones: three lines of the question, so a long list stays scannable; the full
   question is one tap away. */
@media (max-width: 640px) {
  .card.local .summary { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; margin-bottom: 0.7rem; }
  .card.local h3 { font-size: 1.15rem; }
  .card.local .foot .hint { margin-top: 0; }
}
.ballot-question { border-left: 4px solid var(--poppy); background: #fffdf8; padding: 1rem 1.2rem; font-size: 1.02rem; }
.docs { margin: 0.4rem 0 0 1.2rem; } .docs li { margin: 0.3rem 0; }
@media (max-width: 640px) {
  .ballot-question { padding: 0.9rem 1rem; }
  .docs li { margin: 0.7rem 0; line-height: 1.6; }
  .args.who .col p { font-size: 0.95rem; }
}

/* ---------- languages (English · Español · 中文) ---------- */
.lang-switch { display: flex; align-items: center; gap: 0.15rem; font-size: 0.8rem; }
.lang-switch a {
  color: var(--ink-soft); text-decoration: none; font-weight: 600;
  padding: 0.15rem 0.45rem; border: 1px solid transparent; border-radius: 999px;
}
.lang-switch a:hover { color: var(--ink); border-color: var(--line); }
.lang-switch a[aria-current] { color: var(--ink); border-color: var(--line-strong); }
.lang-switch .sep { color: var(--ink-soft); }
.lang-switch .lang-short { display: none; }
@media (max-width: 640px), (pointer: coarse) {
  .lang-switch a { display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); min-width: var(--tap); }
}
/* Phones: the switcher shares the brand's row; the nav keeps its own full-width row underneath. */
@media (max-width: 640px) {
  .site-header .brand { order: 0; }
  .lang-switch { order: 1; margin-left: auto; font-size: 0.85rem; gap: 0; }
  .lang-switch .sep { display: none; }
  /* short labels (EN, ES, 中文) so the switcher fits beside the brand; each link's name stays the full
     language name (aria-label), which contains the visible label */
  .lang-switch .lang-full { display: none; }
  .lang-switch .lang-short { display: inline; }
  .lang-switch a { padding: 0 0.3rem; }
  .site-nav { order: 2; }
}
.lang-note { font-size: 0.85rem; }
.lang-flag {
  font-family: var(--mono); font-size: 0.68rem; color: var(--ink-soft); white-space: nowrap;
  border: 1px solid var(--line); border-radius: 999px; padding: 0.05rem 0.45rem; margin-left: 0.2rem;
}
.site-footer .translation-note { flex-basis: 100%; margin: 0.4rem 0 0; font-size: 0.75rem; }

/* Traditional Chinese: system CJK fonts only (no CJK web font is downloaded). Latin text keeps the
   site's faces; Chinese characters fall through to PingFang TC (Apple), Microsoft JhengHei (Windows)
   or Noto Sans CJK TC (Android, Linux). Headings use the sans CJK faces too: serif CJK faces read
   poorly at small sizes on phones. */
:root:lang(zh-Hant) {
  --sans: "Public Sans", "Public Sans Fallback", "PingFang TC", "Microsoft JhengHei", "Noto Sans CJK TC",
    "Noto Sans TC", "Heiti TC", sans-serif;
  --serif: "Fraunces", "Fraunces Fallback", "PingFang TC", "Microsoft JhengHei", "Noto Sans CJK TC",
    "Noto Sans TC", "Heiti TC", sans-serif;
}
:root:lang(zh-Hant) body { line-height: 1.75; }
/* Spanish runs about a quarter longer than English: long words may break rather than overflow. */
:root:lang(es) main { overflow-wrap: break-word; }
