/* The parts every web page shares (read only), the pages before sign-in included: the ground and type, a card, a note,
   a button, a field. Every colour, radius, duration and size comes from tokens.css, which tools/web_tokens.py makes from
   the App's own look; tools/check_web_pages.sh refuses one written here. As in the App: a card is a fill, never an
   outline; no words sit on --well; a state's chip sits only on a card (.surface). Nothing here names a signed-in page:
   this file and tokens.css are all the style a sign-in or pairing page loads (app.css is the four pages' shell). */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--text-body);
  line-height: var(--leading);
}
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.page:focus { outline: none; }
[hidden] { display: none !important; }

.page {
  max-width: var(--column);
  padding: var(--space-5) var(--space-4) var(--space-6);
  padding-left: max(var(--space-4), env(safe-area-inset-left));
  padding-right: max(var(--space-4), env(safe-area-inset-right));
}

/* The head: the page's name, 刷新 beside it, and when it last read AIOS under both. */
.head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--space-3);
  row-gap: var(--space-1);
}
.title { font-size: var(--text-title); line-height: var(--leading-tight); font-weight: var(--weight-strong); }
.fresh { grid-column: 1 / -1; color: var(--ink2); font-size: var(--text-small); }
.fresh:empty { display: none; }
.refresh {
  min-width: var(--target);
  min-height: var(--target);
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-field);
  background: var(--wash);
  color: var(--accent);
  font: inherit;
  font-weight: var(--weight-strong);
  cursor: pointer;
  transition: color var(--motion-small) var(--ease);
}
.refresh[aria-disabled="true"] { color: var(--ink2); cursor: default; }

.notes { margin-top: var(--space-4); }
.notes:empty { display: none; }
.body { margin-top: var(--space-4); }
.body > * + * { margin-top: var(--space-3); }

/* A card: the one surface. A state tints it the App's way: the card's fill under the state's colour, see-through. */
.surface { background: var(--card); border-radius: var(--radius-card); }
.tint-wait { background: linear-gradient(var(--tint-wait), var(--tint-wait)), var(--card); }
.tint-done { background: linear-gradient(var(--tint-done), var(--tint-done)), var(--card); }

/* A note: one sentence, what to do next, a few facts, an action, the machine's words folded under 细节. */
.note { padding: var(--space-4); }
.note-done { background: linear-gradient(var(--tint-done), var(--tint-done)), var(--card); }
.note-run { background: linear-gradient(var(--tint-accent), var(--tint-accent)), var(--card); }
.note-title { font-weight: var(--weight-strong); }
.note-quiet .note-title { font-weight: normal; color: var(--ink2); }
.note-next { margin-top: var(--space-1); color: var(--ink2); }
.note-lines { margin-top: var(--space-2); color: var(--ink2); }
.note-lines li + li { margin-top: var(--space-1); }
.action {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  margin-top: var(--space-3);
  padding: 0 var(--space-4);
  border-radius: var(--radius-field);
  background: var(--wash);
  color: var(--accent);
  font-weight: var(--weight-strong);
  text-decoration: none;
}
.note-details { margin-top: var(--space-2); color: var(--ink2); }
.note-details summary { display: list-item; min-height: var(--target); line-height: var(--target); cursor: pointer; }
.note-details p { font-size: var(--text-small); overflow-wrap: anywhere; }

.skeletons > * + * { margin-top: var(--space-3); }
.skeleton { height: 88px; border-radius: var(--radius-card); background: var(--wash); }

/* A button is the action's look; the main one is filled with the tint, as the App's main button, and the one that takes
   access away is the alarm's colour. A pressed one waits (aria-disabled) and keeps its place. */
button.action { border: 0; font: inherit; font-weight: var(--weight-strong); cursor: pointer; }
.action.primary { background: var(--tint); color: var(--on-tint); }
.action.danger { background: var(--alarm); color: var(--on-alarm); }
.action[aria-disabled="true"] { background: var(--wash); color: var(--ink2); cursor: default; }

/* One page with one task (sign in, pair this device, close remote access): its name, a sentence, the note, the buttons. */
.sheet { margin: 0 auto; }
.lead { margin-top: var(--space-2); color: var(--ink2); }
.sheet .notes { margin-top: var(--space-4); }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-1); }
.actions:empty { display: none; }
.aside { margin-top: var(--space-5); color: var(--ink2); font-size: var(--text-small); }
.aside:empty { display: none; }
.back { display: inline-flex; align-items: center; min-height: var(--target); margin-top: var(--space-4); }

/* A field: a fill, no outline; 17px so a phone does not zoom in on it. */
.field { display: grid; gap: var(--space-1); margin-top: var(--space-4); }
.field-label { font-weight: var(--weight-strong); }
.field-hint { color: var(--ink2); font-size: var(--text-small); }
.field-input {
  min-height: var(--target);
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-field);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-lead);
}

/* The pairing number, as large as the App shows it, so the two can be compared at a glance. */
.code { margin-top: var(--space-3); font-size: var(--text-figure); font-weight: var(--weight-strong); line-height: var(--leading-tight); }
.noscript { padding: var(--space-4); }
