/* ═══════════════════════════════════════════════════════════════════════
   Exposome Leads — an instrument for a loud, bright exhibition hall.

   The ground is deep water-ink rather than white: phones get held at arm's
   length under hall floodlights all day, and dark chrome keeps the card
   photo and the type as the only bright things on screen.

   Every colour here is pulled from the Exposome mark itself — its blue,
   its green — so the app and the stall read as one thing.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --ink:        #071518;
  --ink-2:      #0B1F23;
  --surface:    #102A2F;
  --surface-2:  #17383F;
  --surface-3:  #1E4550;
  --line:       #21474F;
  --line-soft:  #17343A;

  --green:      #6CB33F;   /* the mark's green — primary action */
  --green-deep: #4E8C2A;
  --lime:       #A9E05C;   /* live state, the sync crest */
  --blue:       #2E7CC4;   /* the mark's blue — information */
  --amber:      #F2B33D;   /* waiting, needs a look */
  --clay:       #E4705B;   /* something failed */

  --text:       #E9F3F1;
  --text-dim:   #B4C9C8;
  --muted:      #7F9B9C;

  --display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --body:    'IBM Plex Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono:    'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --r-sm: 8px;
  --r:    14px;
  --r-lg: 22px;

  --pad: 18px;
  --tap: 54px;

  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --ease: cubic-bezier(.22, .68, .32, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

body { display: flex; flex-direction: column; }

h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; letter-spacing: -0.015em; }

:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
  border-radius: 4px;
}

[hidden] { display: none !important; }

/* ───────────────────────────────────────────────────────── buttons ── */

.btn {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  min-height: var(--tap);
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--r);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: transform 90ms var(--ease), background 140ms var(--ease), opacity 140ms var(--ease);
}
.btn:active { transform: scale(.975); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn--block { display: block; width: 100%; }

.btn--primary { background: var(--green); color: #062009; }
.btn--primary:active { background: var(--green-deep); }

.btn--ghost { border-color: var(--line); background: var(--surface); color: var(--text); }
.btn--ghost:active { background: var(--surface-2); }

.btn--quiet {
  min-height: 40px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}
.btn--quiet:active { color: var(--text); }

/* ───────────────────────────────────────────────────────── fields ── */

.field { display: block; margin-bottom: 10px; }
.field__label {
  display: block;
  margin-bottom: 5px;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}

.control {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  font-family: var(--body);
  font-size: 16px;   /* never below 16 — iOS zooms the page otherwise */
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  transition: border-color 120ms var(--ease), background 120ms var(--ease);
  appearance: none;
}
.control::placeholder { color: #5E7A7C; }
.control:focus {
  outline: none;
  border-color: var(--green);
  background: var(--surface-2);
}
.control--mono { font-family: var(--mono); font-size: 15px; letter-spacing: -0.01em; }
.control--area { min-height: 96px; resize: vertical; line-height: 1.5; }

select.control {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right 20px center, right 14px center;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 40px;
}
select.control option { background: var(--surface); color: var(--text); }

.control.is-filled { border-color: var(--surface-3); }

/* Fields the OCR just wrote, so the user knows what to check. */
.control.is-read {
  border-color: rgba(108, 179, 63, .5);
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
              linear-gradient(90deg, rgba(169,224,92,.25), transparent) border-box;
  animation: settle 700ms var(--ease);
}
@keyframes settle { from { background-color: rgba(108,179,63,.14); } }

.fieldset { margin-bottom: 4px; }

/* ── collapsible contact block ──────────────────────────────────────── */

.fold { margin-bottom: 4px; }
.fold__summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 4px;
  list-style: none;
  cursor: pointer;
}
.fold__summary::-webkit-details-marker { display: none; }
.fold__title {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--green);
}
.fold__note {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fold__chev {
  flex: none;
  width: 8px; height: 8px;
  border-right: 1.8px solid var(--muted);
  border-bottom: 1.8px solid var(--muted);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 160ms var(--ease);
}
.fold[open] .fold__chev { transform: rotate(225deg) translate(-2px, -2px); }

.subhead {
  margin: 22px 0 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--green);
}

/* ═════════════════════════════════════════════════════════ sign in ══ */

.view--signin {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-top) + 24px) var(--pad) calc(var(--safe-bottom) + 24px);
  background:
    radial-gradient(120% 70% at 50% 0%, #0E2A2E 0%, var(--ink) 62%);
}

.signin { width: 100%; max-width: 420px; }
.signin__logo { display: block; width: 168px; height: auto; margin-bottom: 14px; }
.signin__event {
  margin: 0 0 34px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--green);
}
.signin__title { font-size: 38px; line-height: 1.05; margin-bottom: 10px; }
.signin__lede { margin: 0 0 30px; color: var(--text-dim); font-size: 15px; max-width: 34ch; }
.signin__form .btn { margin-top: 10px; }
.signin__error {
  margin: 4px 0 0;
  color: var(--clay);
  font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════ shell ══ */

.shell { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(var(--safe-top) + 12px) var(--pad) 12px;
  background: var(--ink);
}
.topbar__logo { width: 116px; height: auto; opacity: .95; }

.who {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-dim);
  font-family: var(--body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.who__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(108,179,63,.16);
}
.who.is-offline .who__dot { background: var(--amber); box-shadow: 0 0 0 3px rgba(242,179,61,.16); }

/* ── the sync bar: the one thing worth glancing at all day ──────────── */

.syncbar {
  position: relative;
  height: 8px;
  background: var(--ink-2);
  overflow: hidden;
}
.syncbar__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  background: linear-gradient(90deg, var(--green-deep), var(--green));
  transition: width 640ms var(--ease);
}
.syncbar__crest {
  position: absolute;
  top: 0;
  height: 8px;
  width: 46px;
  left: 100%;
  margin-left: -23px;
  fill: var(--lime);
  transition: left 640ms var(--ease);
}
.syncbar.is-waiting .syncbar__crest { animation: swell 2.6s ease-in-out infinite; }
/* A stuck lead colours the crest only. The filled part really is on the
   sheet, and painting it red would say otherwise. */
.syncbar.is-failed .syncbar__crest { fill: var(--clay); animation: pulse 1.4s ease-in-out infinite; }
@keyframes swell { 0%,100% { transform: translateY(1.5px); } 50% { transform: translateY(-1.5px); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

.syncbar__caption {
  margin: 0;
  padding: 7px var(--pad) 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .05em;
  color: var(--muted);
}
.syncbar__caption.is-waiting { color: var(--amber); }
.syncbar__caption.is-failed  { color: var(--clay); }

.main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px var(--pad) 24px;
}

/* ═════════════════════════════════════════════════════════ capture ══ */

/* The camera target is the hero. It is deliberately enormous: it has to be
   hit one-handed, without looking, while shaking someone's hand. */
.target {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / .74;
  max-height: 46vh;
  margin: 6px 0 14px;
  padding: 0;
  border: 0;
  border-radius: var(--r-lg);
  background:
    radial-gradient(90% 90% at 50% 42%, #143137 0%, var(--ink-2) 78%);
  color: var(--text);
  cursor: pointer;
  transition: transform 110ms var(--ease);
}
.target:active { transform: scale(.985); }

.target__bracket {
  position: absolute;
  width: 30px; height: 30px;
  border: 2.5px solid var(--green);
  opacity: .85;
}
.target__bracket--tl { top: 16px; left: 16px;  border-right: 0; border-bottom: 0; border-radius: 12px 0 0 0; }
.target__bracket--tr { top: 16px; right: 16px; border-left: 0;  border-bottom: 0; border-radius: 0 12px 0 0; }
.target__bracket--bl { bottom: 16px; left: 16px;  border-right: 0; border-top: 0; border-radius: 0 0 0 12px; }
.target__bracket--br { bottom: 16px; right: 16px; border-left: 0;  border-top: 0; border-radius: 0 0 12px 0; }

.target__body {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.target__icon {
  width: 78px; height: 55px;
  margin-bottom: 14px;
  fill: none;
  stroke: var(--text-dim);
  stroke-width: 1.6;
  stroke-linecap: round;
}
.target__scan { stroke: var(--lime); stroke-width: 2.4; }
.target:active .target__scan { stroke: var(--green); }

.target__label { font-family: var(--display); font-size: 23px; font-weight: 600; }
.target__hint  { font-size: 13.5px; color: var(--muted); }

.tally {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}
.tally__row { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.tally__row--sub { margin-top: 8px; }
.tally__num {
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 600;
  line-height: 1;
  color: var(--lime);
  font-variant-numeric: tabular-nums;
}
.tally__num--sm { font-size: 17px; color: var(--text-dim); }
.tally__unit { font-size: 13.5px; color: var(--muted); }
.tally__sep { width: 1px; height: 13px; background: var(--line); margin: 0 5px; }

.notice {
  margin-top: 18px;
  padding: 13px 15px;
  border: 1px solid rgba(242,179,61,.32);
  border-radius: var(--r);
  background: rgba(242,179,61,.07);
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.5;
}
.notice strong { color: var(--amber); font-weight: 600; }
.notice--bad { border-color: rgba(228,112,91,.35); background: rgba(228,112,91,.08); }
.notice--bad strong { color: var(--clay); }

/* ═══════════════════════════════════════════════════════════ lists ══ */

.listhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.listhead__title { font-size: 22px; }

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--ink-2);
  border: 1px solid var(--line-soft);
}
.segmented__opt {
  min-height: 32px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.segmented__opt.is-on { background: var(--surface-2); color: var(--text); }

.leadlist { display: flex; flex-direction: column; gap: 9px; }

.card {
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 0 13px;
  width: 100%;
  padding: 0 14px 0 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: background 120ms var(--ease);
}
.card:active { background: var(--surface-2); }
.card__spine { display: block; background: var(--line); }
.card--hot  .card__spine { background: var(--clay); }
.card--warm .card__spine { background: var(--amber); }
.card--cold .card__spine { background: var(--blue); }

.card__main {
  min-width: 0;
  align-self: center;
  padding: 13px 0;
}
.card__name,
.card__co,
.card__meta {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card__name {
  font-family: var(--display);
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.3;
}
.card__co { font-size: 13.5px; color: var(--muted); line-height: 1.35; }
.card__meta {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: #6C8A8C;
}
.card .pip { align-self: center; flex: none; }

.recent { margin-top: 10px; }

.pip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.pip::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.pip--ok      { color: var(--green); }
.pip--waiting { color: var(--amber); }
.pip--failed  { color: var(--clay); }

.empty {
  margin: 34px 0;
  text-align: center;
  color: var(--muted);
  font-size: 14.5px;
}

/* ══════════════════════════════════════════════════════════ team ══ */

.statgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.stat {
  padding: 15px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  background: var(--surface);
}
.stat__num {
  display: block;
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.05;
  color: var(--lime);
  font-variant-numeric: tabular-nums;
}
.stat__num--hot { color: var(--clay); }
.stat__label { font-size: 12.5px; color: var(--muted); }

.ranks { display: flex; flex-direction: column; gap: 11px; }
.rank { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; }
.rank__name { font-size: 14.5px; }
.rank__num {
  font-family: var(--mono);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.rank__track {
  display: block;
  grid-column: 1 / -1;
  height: 5px;
  border-radius: 3px;
  background: var(--ink-2);
  overflow: hidden;
}
.rank__bar {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--green-deep), var(--lime));
  transition: width 500ms var(--ease);
}
.rank.is-you .rank__name { color: var(--lime); font-weight: 600; }

.health { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.health__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  background: var(--surface);
  font-size: 14px;
}
.health__val { font-family: var(--mono); font-size: 14px; font-variant-numeric: tabular-nums; }

/* ═══════════════════════════════════════════════════════ tab bar ══ */

.tabbar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding-bottom: var(--safe-bottom);
  border-top: 1px solid var(--line-soft);
  background: rgba(7,21,24,.92);
  backdrop-filter: blur(14px);
}
.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 0 9px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .02em;
  cursor: pointer;
}
.tab svg {
  width: 23px; height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}
.tab.is-on { color: var(--lime); }
.tab__badge {
  position: absolute;
  top: 6px;
  left: 50%;
  margin-left: 6px;
  min-width: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--amber);
  color: #2A1A00;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 17px;
}

/* ═════════════════════════════════════════════════════════ sheet ══ */

.sheet { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; }
.sheet__scrim {
  position: absolute;
  inset: 0;
  background: rgba(2,9,10,.66);
  backdrop-filter: blur(3px);
  animation: fade 200ms var(--ease);
}
@keyframes fade { from { opacity: 0; } }

.sheet__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 94dvh;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: var(--ink-2);
  border-top: 1px solid var(--line);
  animation: rise 300ms var(--ease);
}
@keyframes rise { from { transform: translateY(100%); } }

.sheet__grip {
  width: 38px; height: 4px;
  margin: 9px auto 0;
  border-radius: 2px;
  background: var(--line);
  flex: none;
}

.sheet__head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 10px;
  flex: none;
}
.sheet__head .btn--quiet { justify-self: start; }
.sheet__title { font-family: var(--display); font-size: 15px; font-weight: 600; }
.sheet__state { justify-self: end; padding-right: 6px; }

.sheet__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px var(--pad) 20px;
}

.sheet__foot {
  flex: none;
  padding: 12px var(--pad) calc(12px + var(--safe-bottom));
  border-top: 1px solid var(--line-soft);
  background: var(--ink-2);
}
.sheet__foot--split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ── the photographed card ─────────────────────────────────────────── */

.shot {
  position: relative;
  margin-bottom: 18px;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line-soft);
}
.shot__img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.shot__reading { position: absolute; inset: 0; background: rgba(7,21,24,.55); }
.shot__sweep {
  position: absolute;
  left: 0; right: 0;
  height: 46%;
  background: linear-gradient(180deg, transparent, rgba(169,224,92,.22) 62%, var(--lime));
  animation: sweep 1.5s var(--ease) infinite;
}
@keyframes sweep { from { top: -46%; } to { top: 100%; } }
.shot__readingtext {
  position: absolute;
  left: 0; right: 0; bottom: 12px;
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--lime);
}
.shot__retake {
  position: absolute;
  right: 9px; bottom: 9px;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(7,21,24,.82);
  color: var(--text);
  font-family: var(--body);
  font-size: 13px;
  cursor: pointer;
}

.dupe {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 16px;
  padding: 13px 15px;
  border: 1px solid rgba(242,179,61,.35);
  border-radius: var(--r);
  background: rgba(242,179,61,.08);
  font-size: 14px;
  color: var(--text-dim);
}
.dupe strong { color: var(--amber); font-weight: 600; }

/* ── dictation ─────────────────────────────────────────────────────── */

.dictate { position: relative; }
.dictate .control--area { padding-right: 66px; }
.mic {
  position: absolute;
  right: 9px; bottom: 9px;
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-dim);
  cursor: pointer;
  transition: transform 110ms var(--ease), background 140ms var(--ease);
}
.mic svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.mic.is-live {
  background: var(--clay);
  border-color: var(--clay);
  color: #2A0C06;
  transform: scale(1.06);
  box-shadow: 0 0 0 0 rgba(228,112,91,.5);
  animation: listen 1.5s ease-out infinite;
}
@keyframes listen {
  to { box-shadow: 0 0 0 18px rgba(228,112,91,0); }
}
.dictate__status {
  margin: 7px 2px 0;
  min-height: 17px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--muted);
}

/* ── chips & rating ────────────────────────────────────────────────── */

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-dim);
  font-family: var(--body);
  font-size: 13.5px;
  cursor: pointer;
  transition: background 120ms var(--ease), color 120ms var(--ease), border-color 120ms var(--ease);
}
.chip.is-on {
  background: var(--green);
  border-color: var(--green);
  color: #062009;
  font-weight: 600;
}

/* Tags the team typed in rather than ones shipped in the config. Marked so it
   is obvious the list is growing, not so they look second-class. */
.chip--learned { border-style: dashed; border-color: var(--surface-3); }
.chip--learned.is-on { border-style: solid; }

.chipadd {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 10px;
}
.chipadd__input { min-height: 44px; padding: 10px 13px; font-size: 15px; }
.chipadd__go {
  min-height: 44px;
  padding: 0 18px;
  border-color: var(--line);
  background: var(--surface-2);
  font-size: 15px;
}
.chipadd__go:active { background: var(--surface-3); }

.rating { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rate {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-height: 76px;
  padding: 12px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text-dim);
  font-family: var(--display);
  font-size: 15.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 120ms var(--ease), border-color 120ms var(--ease);
}
.rate small {
  font-family: var(--body);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--muted);
}
.rate--hot.is-on  { background: rgba(228,112,91,.16); border-color: var(--clay); color: var(--clay); }
.rate--warm.is-on { background: rgba(242,179,61,.16); border-color: var(--amber); color: var(--amber); }
.rate--cold.is-on { background: rgba(46,124,196,.16); border-color: var(--blue);  color: #7FB5E4; }
.rate.is-on small { color: inherit; opacity: .78; }

/* ── detail read-out ───────────────────────────────────────────────── */

.readout { display: flex; flex-direction: column; gap: 1px; margin-bottom: 18px; }
.readout__row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14.5px;
}
.readout__k {
  font-family: var(--display);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 3px;
}
.readout__v { word-break: break-word; }
.readout__v a { color: var(--lime); text-decoration: none; border-bottom: 1px solid rgba(169,224,92,.35); }
.readout__v--mono { font-family: var(--mono); font-size: 13.5px; }

.draft {
  margin-top: 6px;
  padding: 15px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  background: var(--surface);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  color: var(--text-dim);
}
.draft__subject {
  display: block;
  margin-bottom: 10px;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

/* ═════════════════════════════════════════════════════════ toast ══ */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 84px);
  z-index: 60;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  animation: toast 240ms var(--ease);
}
@keyframes toast { from { transform: translate(-50%, 14px); opacity: 0; } }
.toast--good { border-color: var(--green); }
.toast--bad  { border-color: var(--clay); color: #FFD9D0; }

/* ═════════════════════════════════════════════════════ larger ══ */

@media (min-width: 620px) {
  .main, .topbar, .syncbar__caption { max-width: 640px; margin-inline: auto; width: 100%; }
  .sheet { align-items: center; justify-content: center; padding: 24px; }
  .sheet__panel { max-width: 560px; border-radius: var(--r-lg); border: 1px solid var(--line); }
  .target { max-height: 340px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
