/* EasyGov.ai app — official green/navy/cream, system fonts only, mobile-first. */
:root {
  --g: #0b6e4f;
  --g2: #e8f5ef;
  --g-deep: #085a40;
  --ink: #14213d;
  --mut: #5b6475;
  --bd: #e3e7ee;
  --cream: #faf8f3;
  --paper: #ffffff;
  --danger: #8a3b2a;
  --danger-bd: rgba(138, 59, 42, 0.35);
  --shadow: 0 1px 2px rgba(20, 33, 61, .06), 0 8px 24px rgba(20, 33, 61, .05);
  --shadow-up: 0 8px 28px rgba(20, 33, 61, .12);
  --r: 16px;
  --tap: 44px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sa-green: #007749;
  --sa-gold: #ffb81c;
  --sa-blue: #001489;
  --sa-red: #de3831;
  --sa-black: #000000;
  --sa-white: #ffffff;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: var(--g); }
a:hover { color: var(--g-deep); }
.hidden { display: none !important; }
.skip {
  position: absolute; left: -999px; top: 0;
}
.skip:focus { left: 8px; top: 8px; z-index: 80; background: var(--paper); padding: 8px 12px; border-radius: 8px; }

.shell {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: var(--safe-t) var(--safe-r) 0 var(--safe-l);
}
.wrap { width: min(1040px, calc(100% - 32px)); margin-inline: auto; min-width: 0; }

header.app-head {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--cream) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bd);
}
header.app-head .row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; min-height: 56px; padding: 8px 0;
}
.brand {
  display: flex; align-items: center; gap: 9px;
  text-decoration: none; color: var(--ink);
  font-weight: 800; letter-spacing: -0.03em; font-size: 1.12rem;
}
.brand img { width: 30px; height: 30px; border-radius: 8px; flex: 0 0 auto; }
.brand b { color: var(--g); font-weight: 800; }
.head-actions { display: flex; align-items: center; gap: 8px; min-width: 0; }

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: 999px;
  font-size: 0.82rem; font-weight: 600;
  border: 1px solid var(--bd); background: var(--paper); color: var(--ink);
  min-height: 36px;
}
.pill.primary { background: var(--g); color: #fff; border-color: transparent; }
.pill svg { width: 15px; height: 15px; flex: 0 0 auto; }

button.avatar-btn {
  width: 40px; height: 40px; padding: 0; border: 0; background: transparent;
  position: relative; flex: 0 0 auto; border-radius: 50%;
}
button.avatar-btn:focus-visible { outline: 2px solid var(--g); outline-offset: 3px; }
.avatar-ring {
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid var(--g);
  display: grid; place-items: center;
  background: var(--g2);
}
button.avatar-btn.is-guest .avatar-ring { border-color: color-mix(in srgb, var(--g) 45%, var(--bd)); }
.avatar-face {
  width: 32px; height: 32px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; position: relative;
  background: linear-gradient(160deg, var(--g-deep), var(--g));
  color: #fff; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em;
}
.avatar-face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar-face svg { width: 18px; height: 18px; }

main { flex: 1; padding: 18px 0 28px; min-width: 0; }
.hero { margin-bottom: 18px; }
.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  font-weight: 700; color: var(--g);
  background: var(--g2); border: 1px solid color-mix(in srgb, var(--g) 18%, var(--bd));
  padding: 5px 11px; border-radius: 999px;
}
h1 { font-size: clamp(1.45rem, 4vw, 2rem); letter-spacing: -0.03em; line-height: 1.15; margin: 10px 0 6px; font-weight: 800; }
.lead { color: var(--mut); max-width: 42ch; font-size: 0.98rem; }

.search {
  margin: 16px 0 12px; display: flex; align-items: center; gap: 8px;
  background: var(--paper); border: 1px solid var(--bd); border-radius: 14px;
  padding: 4px 4px 4px 14px; box-shadow: var(--shadow);
}
.search svg { width: 18px; height: 18px; color: var(--mut); flex: 0 0 auto; }
.search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: none;
  font: inherit; font-size: 16px; color: var(--ink); padding: 10px 4px;
}
.search input::placeholder { color: var(--mut); }

.tabs {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: 0 0 auto; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--bd); background: var(--paper);
  font-weight: 600; font-size: 0.88rem; color: var(--ink); min-height: 36px;
}
.tabs button[aria-pressed="true"] { background: var(--g); color: #fff; border-color: var(--g); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 12px;
  min-width: 0;
}
.card {
  background: var(--paper); border: 1px solid var(--bd); border-radius: var(--r);
  padding: 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0;
  box-shadow: var(--shadow);
}
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.mono {
  width: 40px; height: 40px; border-radius: 12px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: var(--g2); color: var(--g); font-weight: 800; font-size: 0.82rem;
}
.card h3 { font-size: 1.02rem; letter-spacing: -0.02em; min-width: 0; }
.card p { color: var(--mut); font-size: 0.9rem; }
.card-actions { display: flex; align-items: center; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.card .go, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 14px; border-radius: 12px; font-weight: 700; font-size: 0.9rem;
  background: var(--g); color: #fff; text-decoration: none; border: 0; min-height: 40px;
}
.card .go:hover, .btn:hover { background: var(--g-deep); color: #fff; }
.btn.sec, .ghost, .pin {
  background: var(--paper); color: var(--ink); border: 1px solid var(--bd); font-weight: 600;
}
.pin {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; padding: 0;
}
.pin[aria-pressed="true"] { background: var(--g2); border-color: color-mix(in srgb, var(--g) 35%, var(--bd)); color: var(--g); }
.pin svg { width: 18px; height: 18px; }
.tag { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--g); }
.empty { color: var(--mut); padding: 20px 4px; font-size: 0.95rem; }

/* Voice panel */
.voice-panel {
  margin: 8px 0 18px; background: var(--ink); color: #f3f7f5;
  border-radius: 20px; padding: 16px 16px 14px; min-width: 0;
  display: grid; grid-template-columns: auto 1fr; gap: 14px 16px; align-items: center;
}
.voice-panel h2 { font-size: 1.05rem; letter-spacing: -0.02em; color: #fff; }
.voice-copy { min-width: 0; }
.voice-copy .hint, .voice-copy .status { font-size: 0.88rem; color: #c5d0cc; }
.voice-copy .status { color: #fff; font-weight: 700; margin-top: 2px; }
.orb-col { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.orb {
  width: 72px; height: 72px; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #d8fff0 0%, #3ddc84 28%, var(--g) 62%, #085a40 100%);
  box-shadow: 0 10px 28px rgba(11, 110, 79, 0.35);
  display: grid; place-items: center; color: var(--ink);
  touch-action: manipulation;
}
.orb svg { width: 28px; height: 28px; }
.orb:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.stop-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: #fff; color: var(--ink); font-weight: 700; font-size: 0.8rem;
}
.stop-pill[hidden], .stop-pill.hidden { display: none !important; }
.voice-log { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; max-height: 28vh; overflow: auto; }
.vmsg { max-width: 100%; padding: 8px 11px; border-radius: 12px; font-size: 0.88rem; line-height: 1.4; }
.vmsg.user { align-self: flex-end; background: rgba(255,255,255,.1); }
.vmsg.bot { align-self: flex-start; background: rgba(255,255,255,.08); }
.vmsg.err { align-self: center; color: #f0a58c; background: transparent; font-size: 0.84rem; }
.voice-form {
  grid-column: 1 / -1; display: flex; gap: 8px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px; padding: 4px 4px 4px 14px;
}
.voice-form input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: none;
  color: #fff; font: inherit; font-size: 16px;
}
.voice-form input::placeholder { color: #9aa8a3; }
.voice-form button {
  width: 40px; height: 40px; border-radius: 50%; background: var(--g); color: #fff;
  display: grid; place-items: center;
}
.voice-form button svg { width: 16px; height: 16px; }
.meter { width: 56px; height: 4px; border-radius: 99px; background: rgba(255,255,255,.15); overflow: hidden; opacity: 0; }
.meter i { display: block; height: 100%; width: 100%; transform-origin: left; transform: scaleX(0); background: #3ddc84; }
[data-voice="listening"] .meter { opacity: 1; }
[data-voice="listening"] .orb { box-shadow: 0 0 0 5px rgba(61, 220, 132, .25), 0 10px 28px rgba(11, 110, 79, .45); }
[data-voice="speaking"] .orb { background: radial-gradient(circle at 34% 28%, #fff6e6 0%, #e6cfa6 40%, #c4a574 100%); }

.notes {
  margin-top: 22px; background: var(--paper); border: 1px solid var(--bd);
  border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); min-width: 0;
}
.notes h2 { font-size: 1.05rem; margin-bottom: 8px; }
.notes form, .link-form { display: grid; gap: 8px; margin: 8px 0; }
.notes input, .notes textarea, .sheet input, .sheet textarea {
  width: 100%; min-width: 0; padding: 11px 12px; border-radius: 12px;
  border: 1px solid var(--bd); background: #fff; font: inherit; font-size: 16px; color: var(--ink);
}
.notes textarea { min-height: 72px; resize: vertical; }
.note-list, .link-list { list-style: none; display: grid; gap: 8px; margin-top: 8px; }
.note-list li, .link-list li {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  padding: 10px 0; border-top: 1px solid var(--bd); font-size: 0.92rem; min-width: 0;
}
.note-list li p, .link-list li a { overflow-wrap: anywhere; min-width: 0; }
.icon-x {
  width: 36px; height: 36px; border-radius: 10px; flex: 0 0 auto;
  border: 1px solid var(--bd); color: var(--mut);
}

footer.app-foot {
  border-top: 1px solid var(--bd);
  padding: 22px 0 calc(28px + var(--safe-b));
  color: var(--mut); font-size: 0.88rem;
}
footer.app-foot .row { display: flex; flex-wrap: wrap; gap: 10px 18px; justify-content: space-between; }
footer .fine { margin-top: 8px; font-size: 0.82rem; }

/* Banners */
.banner {
  position: sticky; z-index: 25;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px; font-size: 0.9rem; font-weight: 600;
}
.update-banner { top: 0; background: var(--ink); color: #fff; }
.install-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--paper); color: var(--ink);
  border-top: 1px solid var(--bd);
  padding: 12px 16px calc(12px + var(--safe-b));
  box-shadow: 0 -8px 24px rgba(20, 33, 61, .08);
}
body:has(.install-banner:not(.hidden)) { padding-bottom: 84px; }
.banner .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Sheets / drawer */
.sheet {
  position: fixed; inset: 0; background: rgba(20, 33, 61, 0.45);
  display: grid; align-items: end; z-index: 50;
}
.sheet .card, .sheet .settings-card {
  background: var(--paper); color: var(--ink);
  border-radius: 22px 22px 0 0;
  width: min(560px, 100%); margin-inline: auto;
  padding: 22px 22px calc(22px + var(--safe-b));
  max-height: min(92vh, 880px); overflow: hidden;
  display: flex; flex-direction: column;
}
.sheet h3 { font-size: 1.2rem; letter-spacing: -0.02em; }
.sheet .note { font-size: 0.92rem; color: var(--mut); margin: 0 0 12px; }
.sheet .close, .sheet .google-btn {
  width: 100%; padding: 12px; border-radius: 12px;
  background: var(--g); color: #fff; font-weight: 700; font-size: 1rem;
}
.sheet .google-btn:disabled, .sheet .apple-btn:disabled, .sheet .microsoft-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.sheet .apple-btn, .sheet .microsoft-btn, .sheet .ghost {
  width: 100%; margin-top: 8px; padding: 12px; border-radius: 12px;
  font-weight: 700; font-size: 1rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
}
.sheet .apple-btn { border: 0; background: #000; color: #fff; }
.sheet .microsoft-btn { border: 1px solid var(--bd); background: #fff; color: #1a1a1a; }
.sheet .apple-btn svg, .sheet .microsoft-btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.sheet .ghost { background: var(--g2); color: var(--ink); border: 0; font-weight: 700; }
.sheet .danger {
  width: 100%; margin-top: 8px; padding: 12px; border-radius: 12px;
  background: transparent; color: var(--danger); font-weight: 600;
  border: 1px solid var(--danger-bd);
}
.sheet .auth-err { color: var(--danger); font-size: 0.88rem; margin: 8px 0 0; }
.sheet .auth-ok { color: var(--g); font-size: 0.88rem; margin: 8px 0 0; }
.sheet .cookie-line { font-size: 0.8rem; color: var(--mut); margin-top: 14px; line-height: 1.45; }
.sheet .signed-as { font-size: 0.95rem; margin-bottom: 14px; }
.sheet .checks { display: grid; gap: 10px; margin: 14px 0 16px; }
.sheet label.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem; line-height: 1.45; cursor: pointer; }
.sheet label.check input { margin-top: 3px; flex: 0 0 auto; width: 16px; height: 16px; }
.sheet .email-or { text-align: center; color: var(--mut); margin: 16px 0 8px; font-size: 0.88rem; }
.sheet .email-row { display: grid; gap: 8px; margin-top: 4px; }
.sheet .otp-input { letter-spacing: 0.4em; text-align: center; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.sheet .email-help { font-size: 0.85rem; color: var(--mut); margin: 8px 0 0; }
.busy { opacity: 0.7; pointer-events: none; }

.settings-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 22px 8px;
}
.settings-card { padding: 0 !important; }
.settings-head h3 { margin: 0; }
.settings-head .icon-close {
  width: 36px; height: 36px; border-radius: 50%;
  background: #f1f3f6; color: var(--ink); font-size: 1.2rem; line-height: 1;
}
.settings-scroll { overflow: auto; padding: 0 22px calc(22px + var(--safe-b)); -webkit-overflow-scrolling: touch; }
.settings-sec { margin: 8px 0 18px; padding-top: 14px; border-top: 1px solid var(--bd); }
.settings-sec h4 {
  margin: 0 0 10px; font-size: 0.74rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--mut); font-weight: 700;
}
.sync-card { background: var(--g2); border-radius: 14px; padding: 14px 14px 16px; margin: 8px 0 6px; }
.sync-card h4 { color: var(--ink); letter-spacing: 0; text-transform: none; font-size: 1rem; font-weight: 800; margin-bottom: 8px; }
.toggle-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 8px 0; font-size: 0.92rem; }
.toggle-row input { width: 18px; height: 18px; margin-top: 2px; flex: 0 0 auto; }
.method-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.method-badge { font-size: 0.78rem; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: var(--g2); color: var(--ink); }
.ack-line { font-size: 0.88rem; color: var(--mut); margin: 6px 0; line-height: 1.45; }
.passkey-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0; font-size: 0.92rem; }
.passkey-row button { flex: 0 0 auto; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--danger-bd); color: var(--danger); font-weight: 600; font-size: 0.82rem; }
.pin-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pin-list button { padding: 6px 10px; border-radius: 999px; border: 1px solid var(--bd); font-size: 0.85rem; font-weight: 600; }

@media (min-width: 720px) {
  .settings-sheet { align-items: stretch; justify-content: end; }
  .settings-sheet .settings-card {
    width: min(420px, 100%); height: 100%; max-height: 100%;
    border-radius: 22px 0 0 22px; margin: 0;
  }
  .voice-panel { grid-template-columns: auto 1fr; padding: 20px 22px; }
}
@media (hover: hover) {
  .card { transition: transform 160ms ease, box-shadow 160ms ease; }
  .card:hover { transform: translateY(-2px); box-shadow: var(--shadow-up); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
html[data-saver="1"] *, html[data-saver="1"] *::before, html[data-saver="1"] *::after {
  animation: none !important; transition: none !important;
}
html[data-saver="1"] .orb { box-shadow: none; }
html[data-saver="1"] .card:hover { transform: none; box-shadow: var(--shadow); }

/* Privacy / landing reuse */
.doc { padding: 12px 0 48px; }
.doc h1 { margin: 8px 0 10px; }
.doc h2 { font-size: 1.15rem; margin: 28px 0 8px; letter-spacing: -0.02em; }
.doc p, .doc li { margin-bottom: 10px; }
.doc ul { margin: 0 0 14px 1.2rem; }
.doc .draft {
  background: #fff7e6; border: 1px solid #f3e0b5; border-radius: 12px;
  padding: 12px 14px; margin: 14px 0 18px; color: var(--ink);
}
code { font-family: var(--mono); font-size: 0.92em; background: #eeeae2; padding: 0.1em 0.35em; border-radius: 6px; }

:where(a,button,input,select,textarea,summary,[tabindex]):focus-visible {
  outline: 2px solid var(--g); outline-offset: 2px;
}
@media (pointer: coarse) {
  .btn, .card .go, .pill.primary { min-height: var(--tap); }
}
.ios-steps { margin-left: 1.2rem; display: grid; gap: 6px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.pad-hero { padding: 48px 0; }
.mt-16 { margin-top: 16px; }
.mt-18 { margin-top: 18px; }
.settings-lab { display: block; font-weight: 600; margin-bottom: 6px; }
[data-voice="listening"] .meter i { transform: none; animation: meter-pulse 1s ease-in-out infinite; }
@keyframes meter-pulse { 0%,100% { transform: scaleX(.28); } 50% { transform: scaleX(1); } }


/* Original SA flag / ribbon accents (not the Proudly SA trademark lockup). */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sa-bar {
  height: 5px; width: 100%;
  background: linear-gradient(90deg,
    var(--sa-black) 0 12%,
    var(--sa-gold) 12% 20%,
    var(--sa-green) 20% 48%,
    var(--sa-white) 48% 52%,
    var(--sa-red) 52% 76%,
    var(--sa-blue) 76% 100%);
}
.sa-flag {
  width: 27px; height: 18px; flex: 0 0 auto;
  border-radius: 2px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(20, 33, 61, .14);
  display: block;
}
.sa-flag use { display: block; }
.kicker { display: inline-flex; align-items: center; gap: 8px; }
.kicker .sa-flag { width: 18px; height: 12px; }
.sa-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 7px; border-radius: 999px;
  border: 1px solid var(--bd); background: var(--paper);
  box-shadow: inset 3px 0 0 var(--sa-gold);
  font-weight: 700; font-size: 0.82rem; color: var(--ink);
  letter-spacing: -0.01em; line-height: 1.3;
}
.sa-badge span { min-width: 0; }
footer.app-foot .sa-branding { display: grid; gap: 8px; justify-items: start; }
