/* Count My Opinion USA website. Mobile first, system fonts, no external resources. */
:root {
  --navy: #1e3a8a;
  --navy-dark: #172e6e;
  --ink: #111827;
  --muted: #4b5563;
  --line: #d1d5db;
  --soft: #f3f4f6;
  --white: #ffffff;
  --focus: #f59e0b;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
}
img { max-width: 100%; height: auto; }
a { color: var(--navy); text-underline-offset: 0.15em; }
a:hover { color: var(--navy-dark); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; }
h1 { font-size: 2rem; margin: 0.5rem 0 1rem; }
h2 { font-size: 1.5rem; margin: 2rem 0 0.75rem; }
h3 { font-size: 1.125rem; margin: 1.25rem 0 0.5rem; }
abbr { text-decoration: none; }
.wrap { max-width: 64rem; margin: 0 auto; padding: 0 1rem; }
.prose { max-width: 44rem; }
.skip {
  position: absolute; left: 0.5rem; top: -4rem; z-index: 10;
  background: var(--white); color: var(--navy); padding: 0.75rem 1rem; border: 2px solid var(--navy);
}
.skip:focus { top: 0.5rem; }
main:focus { outline: none; }

.top { border-bottom: 1px solid var(--line); background: var(--white); }
.top-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; padding-top: 0.5rem; padding-bottom: 0.5rem; }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; font-weight: 700; color: var(--ink); text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1rem; list-style: none; margin: 0; padding: 0; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; }
.nav a[aria-current="page"] { font-weight: 700; }

.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0.625rem 1.25rem;
  border: 2px solid var(--navy); border-radius: 0.5rem; background: var(--navy); color: var(--white);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.button:hover { background: var(--navy-dark); color: var(--white); }
.button.ghost { background: transparent; color: var(--navy); }
.button.ghost:hover { background: var(--soft); color: var(--navy-dark); }
.nav .button.small { min-height: 40px; padding: 0.375rem 1rem; color: var(--white); }

.hero { background: var(--soft); padding: 2.5rem 0; text-align: center; }
.hero-logo { display: block; margin: 0 auto; }
.lead { font-size: 1.1875rem; max-width: 40rem; margin: 0 auto 1.5rem; color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin: 1.5rem 0; }
.platforms { list-style: none; padding: 0; margin: 1rem auto 0; color: var(--muted); }
.platforms li { margin: 0.25rem 0; }

.cards { list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: 1fr; }
.cards li { border: 1px solid var(--line); border-radius: 0.75rem; padding: 1rem 1.25rem; }
.cards h3 { margin-top: 0.25rem; }
.band { padding-bottom: 2rem; }
.steps { padding-left: 1.25rem; }
.steps li { margin: 0.5rem 0; }
.page { padding: 1.5rem 1rem 3rem; }
.page .lead { margin-left: 0; }
.updated { color: var(--muted); }
.notice { border-left: 4px solid var(--navy); background: var(--soft); padding: 0.75rem 1rem; margin: 1rem 0; }
.choice { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1rem 0; }
.choice form { margin: 0; }
details { border-bottom: 1px solid var(--line); padding: 0.5rem 0; }
summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9375rem; overflow-wrap: anywhere; }
table { border-collapse: collapse; width: 100%; margin: 1rem 0; }
th, td { text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); padding: 0.5rem; }

.foot { margin-top: 3rem; background: var(--soft); border-top: 1px solid var(--line); padding: 1.5rem 0 1rem; }
.foot-cols { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.foot h2 { font-size: 1rem; margin: 0.5rem 0; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { min-height: 44px; display: flex; align-items: center; }
.fine { color: var(--muted); font-size: 0.9375rem; }

@media (min-width: 40rem) {
  h1 { font-size: 2.5rem; }
  .cards { grid-template-columns: 1fr 1fr; }
  .foot-cols { grid-template-columns: repeat(3, 1fr); }
  .hero { padding: 4rem 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .button { border: 2px solid ButtonText; }
}
/* Admin pages (internal/adminsite): plain forms and one table. */
.admin-form textarea, .admin-form input[type="email"], .admin-form input[type="password"] { width: 100%; max-width: 40rem; font: inherit; }
.admin-form [readonly] { background: #eee; }
.admin-error { border-left: 4px solid #a00; padding: .5rem 1rem; background: #fdecec; }
.admin-list { border-collapse: collapse; width: 100%; }
.admin-list th, .admin-list td { border-bottom: 1px solid #ccc; padding: .4rem; text-align: left; vertical-align: top; }
.button.small { padding: .25rem .75rem; font-size: .9rem; }
/* Web app (internal/webapp): mobile first, a bottom tab bar on phones, a top bar on wide screens. */
.webapp .top-row { flex-wrap: nowrap; }
.profile { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; color: var(--navy); border-radius: 50%; }
.profile[aria-current="page"] { background: var(--soft); }
.icon { display: block; flex: none; }
.app-main { max-width: 40rem; padding-top: 0.5rem; padding-bottom: 2rem; }
.app-main h1 { font-size: 1.75rem; }
.app-main h2 { font-size: 1.25rem; margin: 1.25rem 0 0.5rem; }
.app-notice { border-left: 4px solid #15803d; background: #ecfdf3; padding: 0.5rem 1rem; }
.app-banner { border-left: 4px solid #b45309; background: #fffbeb; padding: 0.5rem 1rem; margin: 1rem 0 0; }
.app-error { border-left: 4px solid #b91c1c; background: #fdecec; padding: 0.5rem 1rem; }
.app-form label { display: block; font-weight: 600; }
/* A checkbox or radio with its words (the states pages, story 19-1): side by side, a 44px target. */
.app-form label.option { display: flex; align-items: center; gap: 0.625rem; min-height: 44px; font-weight: 400; }
.app-form label.option input { width: 1.25rem; height: 1.25rem; margin: 0; flex: none; accent-color: var(--navy); }
.app-form input:not([type="radio"]):not([type="checkbox"]), .app-form select { display: block; width: 100%; min-height: 44px; padding: 0.5rem 0.625rem; font: inherit; border: 1px solid var(--muted); border-radius: 0.375rem; }
.hint, .help { display: block; color: var(--muted); font-size: 0.9375rem; }
.card .when { margin: -0.25rem 0 0.5rem; color: var(--muted); font-size: 0.875rem; }
.stack { display: grid; gap: 0.75rem; margin: 1.5rem 0; }
.stack p { margin: 0.5rem 0 0; }
.stack form, .stack form .button { margin: 0; width: 100%; }
.card { border: 1px solid var(--line); border-radius: 0.75rem; padding: 1rem 1.25rem; margin: 1rem 0; }
.card h2, .card h3 { margin-top: 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-size: 1.125rem; font-weight: 700; line-height: 1.35; margin-bottom: 0.5rem; padding: 0; }
/* Story 17-5: the Unanswered | Answered switch and the answered card's compact table. */
.switch { display: inline-flex; border: 2px solid var(--navy); border-radius: 0.5rem; overflow: hidden; margin: 0.5rem 0; }
.switch a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem; color: var(--navy); text-decoration: none; font-weight: 600; }
.switch a[aria-current="true"] { background: var(--navy); color: var(--white); }
.card-table { width: 100%; border-collapse: collapse; margin: 0.5rem 0; }
.card-table th, .card-table td { padding: 0.25rem 0.5rem; white-space: nowrap; }
.card-table thead th { color: var(--muted); font-size: 0.875rem; font-weight: 600; }
.card-table tbody th { white-space: normal; }
.card-table tr.yours th, .card-table tr.yours td { font-weight: 700; }
.choice-button { min-height: 44px; width: 100%; text-align: left; padding: 0 0.5rem; font: inherit; color: var(--navy); background: transparent; border: 1px solid var(--line); border-radius: 0.375rem; cursor: pointer; }
.choice-button:hover { background: var(--soft); }
.check { color: var(--navy); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
textarea { width: 100%; font: inherit; padding: 0.5rem; border: 1px solid var(--muted); border-radius: 0.375rem; }
.choice-row { display: flex; align-items: center; gap: 0.75rem; min-height: 44px; padding: 0.25rem 0; cursor: pointer; }
.choice-row input { width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--navy); }
.row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.group { margin: 1rem 0; }
.group h3 { margin: 0.5rem 0 0.25rem; }
.total { margin: 0 0 0.5rem; color: var(--muted); }
.bar-row { margin: 0.5rem 0; }
.bar-label { display: flex; justify-content: space-between; gap: 1rem; margin: 0; }
progress { width: 100%; height: 0.75rem; accent-color: var(--navy); }
.choice-text { font-size: 1.125rem; margin: 0.25rem 0; }
.app-foot { padding-top: 1rem; padding-bottom: 1.5rem; text-align: center; }
.tabs ul { display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; margin: 0; padding: 0; }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.125rem; min-height: 56px; padding: 0.375rem 0.25rem; color: var(--muted); font-size: 0.8125rem; text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--navy); font-weight: 700; }
.tabs a[aria-current="page"] .icon { background: #dbe4fb; border-radius: 1rem; padding: 0 0.75rem; box-sizing: content-box; }
@media (max-width: 47.99rem) {
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--white); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .has-tabs { padding-bottom: 5rem; }
}
@media (min-width: 48rem) {
  .tabs { order: -1; border-bottom: 1px solid var(--line); }
  .webapp { display: flex; flex-direction: column; }
  .webapp .skip { order: -3; }
  .webapp .top { order: -2; }
  .tabs ul { max-width: 40rem; margin: 0 auto; }
  .tabs a { flex-direction: row; gap: 0.5rem; font-size: 1rem; }
}
.web-app-note { border-left: 4px solid var(--navy); background: var(--soft); padding: 0.75rem 1rem; }

/* My data: what each thing is, then what is kept. */
.data dt { font-weight: 600; margin-top: 0.75rem; }
.data dd { margin: 0.15rem 0 0; overflow-wrap: anywhere; }
.data .hint { display: block; }
.button.danger { background: #b91c1c; border-color: #b91c1c; color: var(--white); }
.button.danger:hover { background: #991b1b; }
/* Continue with Google (story 11-2): Google draws the button; this centres it above an "or" rule. */
.google-signin { margin: 1.5rem 0 0; }
.google-signin .g_id_signin { display: flex; justify-content: center; min-height: 44px; }
.google-signin .or { display: flex; align-items: center; gap: 0.75rem; color: var(--muted); margin: 1rem 0; }
.google-signin .or::before, .google-signin .or::after { content: ""; flex: 1; border-top: 1px solid var(--muted); opacity: 0.5; }
