/* fox.css - the pages' look, as an iphone's: a nav bar at the top,
   the title large under it until it scrolls away, rows with thin
   lines between, a toolbar at the bottom for a page's commands. the
   system's font; one accent, the icons'. light, or dark when the
   system is */
:root {
  --bg: #ffffff;
  --text: #000000;
  --dim: #8e8e93;
  --sep: #c6c6c8;       /* the lines between rows, under the bar */
  --fill: #e9e9eb;      /* their messages; a row being pressed */
  --field: #f2f2f7;     /* text fields, keys */
  --accent: #b5532a;
  --on-accent: #ffffff;
  --error: #d70015;
  --light: #f3f1ec;     /* checkers squares */
  --dark: #d8cfbf;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --text: #ffffff;
    --dim: #8e8e93;
    --sep: #38383a;
    --fill: #26252a;
    --field: #1c1c1e;
    --accent: #e08a5c;
    --on-accent: #ffffff;
    --error: #ff6961;
    --light: #2a2826;
    --dark: #4a4338;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; } /* hidden, whatever display a rule gives it */
/* a quick second tap is a tap, not a zoom, as in an app: calc's keys,
   checkers' squares, the puzzle's tiles. pinching still zooms */
html { touch-action: manipulation; }
html { background: var(--bg); zoom: var(--zoom, 1); } /* the text size setting */
/* bold text, a setting: what's plain gets heavier */
html.bold body, html.bold input, html.bold textarea, html.bold button { font-weight: 600; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
main { max-width: 680px; margin: 0 auto; padding: 0 16px 40px; }
body.has-toolbar main { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
a { color: var(--accent); text-decoration: none; }
p { margin: 0 0 12px; }

/* the bars: see-through, the page blurred under them */
.navbar, .toolbar {
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

/* the nav bar: ‹ the parent, the title, actions. its line and its
   title show once the page's large title has scrolled under it */
.navbar {
  position: sticky; top: 0;
  padding-top: env(safe-area-inset-top);
  border-bottom: 0.5px solid transparent;
  transition: border-color 0.2s;
}
.navbar.edge { border-bottom-color: var(--sep); }
.navbar .in {
  max-width: 680px; margin: 0 auto; height: 44px; padding: 0 8px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center;
}
.navbar .left { justify-self: start; min-width: 0; max-width: 100%; }
.navbar .back {
  display: flex; align-items: center; gap: 4px; height: 44px; padding-right: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.navbar .back svg { width: 12px; height: 21px; flex: none; }
.navbar .back .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; margin-left: 2px; }
.navbar .title {
  font-weight: 600; max-width: 56vw; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: opacity 0.2s;
}
.navbar.large:not(.edge) .title { opacity: 0; }
/* the server away: a quiet line under the bar, the title showing */
.navbar .status { text-align: center; font-size: 12px; color: var(--dim); padding-bottom: 4px; }
.navbar.away .title { opacity: 1; }
.navbar:not(.away) .status { display: none; }
.navbar .right { justify-self: end; display: flex; align-items: center; }
.large-title { font-size: 34px; font-weight: 700; line-height: 1.2; margin: 4px 0 12px; cursor: pointer; }

/* the toolbar: a page's commands, at the bottom */
.toolbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 0.5px solid var(--sep);
}
.toolbar .in {
  max-width: 680px; margin: 0 auto; min-height: 49px; padding: 6px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

/* buttons: words or icons in the accent; no boxes but the main one */
button { font: inherit; color: var(--accent); background: none; border: none; padding: 0; cursor: pointer; }
button:disabled { color: var(--dim); cursor: default; }
button:focus:not(:focus-visible) { outline: none; }
.danger { color: var(--error); }
.icon {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.icon svg { width: 24px; height: 24px; }
.navbar button.word { height: 44px; padding: 0 8px; font-weight: 600; }
button.main {
  width: 100%; padding: 14px; border-radius: 12px; font-weight: 600;
  background: var(--accent); color: var(--on-accent);
}
button.main.danger { background: var(--error); }

/* rows: across the page, a thin line between, inset; a link row has a
   chevron and darkens while pressed */
.list { margin: 0 -16px; }
.row {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 44px; padding: 11px 16px; color: var(--text);
}
.row + .row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 0.5px solid var(--sep); }
.row.app + .row.app::before { left: 58px; }
a.row:active, label.row:active { background: var(--fill); }
.row .grow { flex: 1; min-width: 0; }
.row .sub { color: var(--dim); font-size: 15px; }
.row .chev { color: var(--sep); flex: none; display: flex; }
.row img { width: 30px; height: 30px; border-radius: 7px; flex: none; }
.section { color: var(--dim); font-size: 13px; text-transform: uppercase; margin: 26px 0 6px; }
.empty { color: var(--dim); padding: 28px 0; text-align: center; }

/* text fields: filled, rounded */
input, select, textarea { font: inherit; color: var(--text); }
input {
  width: 100%; padding: 11px 14px; border: none; border-radius: 10px; outline: none;
  background: var(--field);
}
input::placeholder, textarea::placeholder { color: var(--dim); }
input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent); }
.stack { display: flex; flex-direction: column; gap: 10px; max-width: 420px; }

.error { color: var(--error); font-size: 15px; min-height: 1.35em; }
.dim { color: var(--dim); }

/* scrollbars: thin, and out of sight until the pointer is over the page */
html { scrollbar-width: thin; scrollbar-color: transparent transparent; }
html:hover { scrollbar-color: var(--sep) transparent; }
