/* Dictio's account panel. The brand is "Morning" (docs/brand/brandbook.md): oat and milk
   grounds, aubergine ink, a plum main button, butter for the quiet button and the selected
   row, sage for "done". The header is the morning sky of the app icon with the sun's three
   arcs; persimmon appears there and nowhere else. One column, phone first. */

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("/fonts/figtree.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --milk: #FCF8F1;
  --oat: #F7EFE2;
  --aubergine: #2F1F2E;
  --plum: #5E3560;
  --butter: #FAE6AC;
  --sage: #35704E;
  --ground: var(--milk);
  --ground-quiet: var(--oat);
  --ink: var(--aubergine);
  --ink-soft: #645563;
  --line: #E6DBCB;
  --action: var(--plum);
  --action-ink: var(--oat);
  --selected: var(--butter);
  --done: var(--sage);
  /* The bars of a chart and the ring around what has the keyboard: plum on paper, lit plum on night. */
  --accent: var(--plum);
  --sky-top: #2F1F2E;
  --sky-bottom: #5E3560;
  --measure: 40rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #2D202D;
    --ground-quiet: #231823;
    --ink: #F7EFE2;
    --ink-soft: #C3B6C0;
    --line: #453545;
    --action: #7A4A7C;
    --selected: #3D2D3D;
    --done: #A9D3A5;
    --accent: #B57BB8;
    --sky-top: #1A121A;
    --sky-bottom: #3E2440;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 1rem/1.5 "Figtree", -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
}
[hidden] { display: none !important; }

h1, h2 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-variation-settings: "SOFT" 100, "WONK" 0;
  font-optical-sizing: auto;
  letter-spacing: -0.01em;
  margin: 0;
}
h1 { font-size: 1.75rem; line-height: 1.2; }
h2 { font-size: 1.5rem; line-height: 1.25; }
p { margin: 0; }
a { color: inherit; text-underline-offset: 0.18em; }
.soft { color: var(--ink-soft); }
.small { font-size: 0.875rem; }

.column { max-width: var(--measure); margin: 0 auto; padding: 0 1.25rem; }

/* MARK: The sky */
.sky {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom));
  color: #F7EFE2;
}
.sky .column { position: relative; z-index: 1; padding-top: 1.25rem; padding-bottom: 8rem; }
.sky.plain .column { padding-bottom: 1.25rem; }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 2.75rem; }
.masthead img { display: block; height: 1.9rem; width: auto; }
.sky button.text { color: #F7EFE2; }
.balance { margin-top: 2.25rem; }
.balance .label { font-size: 0.9375rem; opacity: 0.85; }
.balance .amount {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-variation-settings: "SOFT" 100, "WONK" 0;
  font-size: clamp(2.75rem, 13vw, 4.25rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0.15rem 0 0.35rem;
}
.balance .words { font-size: 1.0625rem; }
.balance .parts { margin-top: 0.75rem; font-size: 0.875rem; opacity: 0.85; }
.balance .parts span { display: inline-block; margin-right: 1rem; }
.sun {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(30rem, 112%);
  transform: translateX(-50%);
  pointer-events: none;
}
.sun svg { display: block; width: 100%; height: auto; }
@media (prefers-reduced-motion: no-preference) {
  .sun svg { animation: rise 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  @keyframes rise { from { transform: translateY(55%); opacity: 0.4; } to { transform: none; opacity: 1; } }
}

/* MARK: Sections */
main section { padding: 2.25rem 0; border-bottom: 1px solid var(--line); }
main section:last-of-type { border-bottom: 0; }
main section > p { margin-top: 0.6rem; max-width: 34rem; }
main section > h2 + * { margin-top: 1rem; }

.notice {
  margin: 1.25rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  background: var(--ground-quiet);
  border-left: 0.25rem solid var(--done);
}
.notice.problem { border-left-color: var(--ink-soft); }
.testing { background: var(--butter); color: #2F1F2E; text-align: center; padding: 0.4rem 1rem; font-size: 0.875rem; }

/* MARK: Controls */
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: 0 1.5rem;
  border: 0; border-radius: 999px;
  background: var(--action); color: var(--action-ink);
  font-weight: 600;
}
.button.quiet { background: var(--butter); color: #2F1F2E; }
.button.danger { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.button:disabled { opacity: 0.45; cursor: default; }
button.text { background: none; border: 0; padding: 0.5rem 0; text-decoration: underline; text-underline-offset: 0.18em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sky :focus-visible { outline-color: #FAE6AC; }

.field { display: block; margin-top: 1rem; }
.field span { display: block; font-weight: 500; margin-bottom: 0.35rem; }
.field input[type="email"], .field input[type="text"], .field input[type="search"], .field input[type="number"] {
  width: 100%; max-width: 24rem; min-height: 3rem; padding: 0 0.9rem;
  border: 1.5px solid var(--line); border-radius: 0.75rem;
  background: var(--ground); color: var(--ink);
}
.field input[type="number"] { max-width: 8rem; }
/* A field the browser filled in itself: Chrome and Safari paint it pale yellow and keep our
   ink, which in the dark theme is cream on pale yellow, and Chrome sets the value in the
   system typeface. Paint our ground over theirs (a wide inner shadow, since their background
   cannot be overridden) and keep our ink and typeface. Firefox tints the field with a filter. */
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
  -webkit-box-shadow: 0 0 0 100rem var(--ground) inset;
  box-shadow: 0 0 0 100rem var(--ground) inset;
  transition: background-color 0s 86400s;
}
.field input:-webkit-autofill::first-line { font-family: "Figtree", system-ui, sans-serif; font-size: inherit; font-weight: inherit; }
.field input:autofill { filter: none; box-shadow: 0 0 0 100rem var(--ground) inset; }
.field .hint { font-weight: 400; margin: 0.35rem 0 0; }
textarea {
  display: block; width: 100%; max-width: 34rem; padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--line); border-radius: 0.75rem;
  background: var(--ground); color: var(--ink); line-height: 1.45; resize: vertical;
}
select {
  min-height: 2.75rem; max-width: 100%; padding: 0 0.6rem;
  border: 1.5px solid var(--line); border-radius: 0.75rem;
  background-color: var(--ground); color: var(--ink);
}
select:disabled { opacity: 0.5; }
.field input.code { max-width: 10rem; letter-spacing: 0.3em; font-size: 1.25rem; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; margin-top: 1.25rem; }
.check { display: flex; align-items: flex-start; gap: 0.6rem; margin-top: 1rem; max-width: 34rem; }
.check input { width: 1.2rem; height: 1.2rem; margin: 0.15rem 0 0; accent-color: var(--action); flex: none; }

/* MARK: Packs */
.packs { list-style: none; margin: 1rem 0 0; padding: 0; }
.pack {
  display: grid; grid-template-columns: auto 1fr; column-gap: 0.9rem; align-items: center;
  padding: 0.8rem 1rem; margin: 0 -1rem; border-radius: 1rem; cursor: pointer;
}
.pack:has(input:checked) { background: var(--selected); }
@media (prefers-color-scheme: light) { .pack:has(input:checked) { color: #2F1F2E; } .pack:has(input:checked) .soft { color: #5a4a58; } }
.pack input { width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--plum); }
.pack .price { font-family: "Fraunces", Georgia, serif; font-weight: 600; font-variation-settings: "SOFT" 100, "WONK" 0; font-size: 1.375rem; line-height: 1.2; }
.pack .gets { grid-column: 2; }

/* MARK: Numbers */
.scroll { overflow-x: auto; margin: 1rem -1.25rem 0; padding: 0 1.25rem; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 0.55rem 0.75rem 0.55rem 0; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
@media (max-width: 26rem) { table { font-size: 0.875rem; } th, td { padding-right: 0.5rem; } }
th:first-child, td:first-child { text-align: left; }
th:last-child, td:last-child { padding-right: 0; }
thead th { font-weight: 500; font-size: 0.875rem; color: var(--ink-soft); }
tbody tr:last-child td { border-bottom: 0; }
td .soft { display: block; font-size: 0.8125rem; }
.list { list-style: none; margin: 1rem 0 0; padding: 0; }
.list li { padding: 0.8rem 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.15rem 1rem; }
.list li:last-child { border-bottom: 0; }
.list .what { font-weight: 500; }
.list .detail { flex-basis: 100%; }
.tag { display: inline-block; padding: 0 0.5rem; border-radius: 999px; background: var(--ground-quiet); font-size: 0.8125rem; font-weight: 500; }

/* MARK: Documents */
.docs { list-style: none; padding: 0; margin: 1rem 0 0; }
.docs li { padding: 0.4rem 0; }
article { padding: 2rem 0 3rem; }
article h1 { margin-bottom: 0.5rem; }
article h2 { font-size: 1.25rem; margin-top: 2rem; }
article p, article ul { margin-top: 0.75rem; max-width: 36rem; }
article ul { padding-left: 1.2rem; }
/* The legal pages (K17): built by tools/legal/build.py from docs/legal. */
.legal .lead { color: var(--ink-soft); font-size: 0.9375rem; margin-top: 0; }
.legal .version { color: var(--ink-soft); font-size: 0.875rem; margin-top: 0.25rem; }
.legal h3 { font-size: 1.0625rem; margin-top: 1.5rem; }
.legal li + li { margin-top: 0.35rem; }
.legal .summary { margin: 1.5rem 0; padding: 0.35rem 1rem 0.9rem; border-radius: 0.75rem; background: var(--ground-quiet); max-width: 38rem; }
.legal .table { overflow-x: auto; margin-top: 1rem; }
.legal table { min-width: 28rem; }
.legal th, .legal td { text-align: left; white-space: normal; vertical-align: top; padding-right: 1rem; }
.legal tbody tr:last-child td { border-bottom: 1px solid var(--line); }
.legal code { font-size: 0.875em; }

/* MARK: Views (K8): the row of tabs under the sky, and what the three new views are made of */
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.views { background: var(--ground-quiet); border-bottom: 1px solid var(--line); }
.tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; padding-top: 0.5rem; padding-bottom: 0.5rem; }
.tabs button {
  min-height: 2.75rem; padding: 0 0.85rem;
  border: 0; border-radius: 999px; background: none;
  font-size: 0.9375rem; font-weight: 500;
}
/* What is selected is butter with aubergine ink, on paper and on night alike. */
.tabs button[aria-selected="true"] { background: var(--butter); color: #2F1F2E; font-weight: 600; }
@media (max-width: 26rem) { .tabs { padding-left: 0.7rem; padding-right: 0.7rem; } .tabs button { padding: 0 0.55rem; } }

h3 { font: 600 1.0625rem/1.3 "Figtree", -apple-system, "Segoe UI", sans-serif; margin: 1.75rem 0 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
details { margin-top: 1rem; }
summary { cursor: pointer; padding: 0.6rem 0; font-weight: 500; text-decoration: underline; text-underline-offset: 0.18em; }
.status { min-height: 1.4em; color: var(--ink-soft); }
.stale { margin-top: 0.5rem; padding: 0.45rem 0.8rem; border-radius: 0.75rem; background: var(--butter); color: #2F1F2E; }
.stale button.text { padding: 0.2rem 0; color: inherit; }

/* A row of choices, one of them taken. */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.chip { position: relative; }
.chip input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.chip span {
  display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0 0.9rem;
  border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--line); cursor: pointer;
}
.chip input:checked + span { background: var(--butter); color: #2F1F2E; box-shadow: none; font-weight: 600; }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }

/* MARK: Statistics */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.75rem; margin: 1.25rem 0 0; }
.tile { padding: 0.85rem 1rem; border-radius: 1rem; background: var(--ground-quiet); }
.tile dt { font-size: 0.875rem; color: var(--ink-soft); }
.tile dd, .fact dd { margin: 0; }
.figure {
  display: block;
  font-family: "Fraunces", Georgia, serif; font-weight: 600; font-variation-settings: "SOFT" 100, "WONK" 0;
  font-size: 1.5rem; line-height: 1.25;
}
.tile .change { font-size: 0.875rem; color: var(--ink-soft); }
.tile .note { display: block; }

.chart { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 0.6rem; margin-top: 1.25rem; }
.chart-y {
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end;
  height: 11rem; font-size: 0.75rem; line-height: 1; color: var(--ink-soft);
}
.bars { display: block; width: 100%; height: 11rem; overflow: visible; }
.bars .bar, .share .bar { fill: var(--accent); }
.bars .grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-x { grid-column: 2; display: flex; height: 1.1rem; margin-top: 0.4rem; font-size: 0.75rem; line-height: 1; color: var(--ink-soft); }
.chart-x > span { position: relative; flex: 1 1 0; min-width: 0; }
.chart-x > span > span { position: absolute; top: 0; left: 0; white-space: nowrap; }
.chart-x > span.end > span { left: auto; right: 0; }

.share { display: inline-block; width: 4.5rem; height: 0.5rem; margin-right: 0.5rem; vertical-align: middle; }
.share .track { fill: var(--line); }
td.part { white-space: nowrap; }
/* The three breakdowns share their columns, so the eye can run down them. */
.split table { table-layout: fixed; min-width: 31rem; }
.split th { white-space: normal; vertical-align: bottom; }
.split th:nth-child(1) { width: 27%; }
.split th:nth-child(2) { width: 27%; }
.split th:nth-child(3) { width: 14%; }
.split th:nth-child(4), .split th:nth-child(5) { width: 16%; }
.split td:first-child { white-space: normal; overflow-wrap: anywhere; }
tfoot th, tfoot td { border-top: 1.5px solid var(--ink-soft); border-bottom: 0; font-weight: 600; }

.facts { margin: 1rem 0 0; }
.fact { padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.fact:last-child { border-bottom: 0; }
.fact dt { font-weight: 500; }

/* MARK: Settings */
.options { margin-top: 1rem; }
.option {
  display: grid; grid-template-columns: auto 1fr; column-gap: 0.9rem; align-items: start;
  padding: 0.7rem 1rem; margin: 0 -1rem; border-radius: 1rem; cursor: pointer;
}
.option:has(input:checked) { background: var(--selected); }
@media (prefers-color-scheme: light) { .option:has(input:checked) { color: #2F1F2E; } .option:has(input:checked) .soft { color: #5a4a58; } }
.option input { grid-row: span 2; width: 1.25rem; height: 1.25rem; margin: 0.15rem 0 0; accent-color: var(--plum); }
.option .name { font-weight: 600; }
.option .hint { grid-column: 2; }

.rows { margin-top: 0.75rem; }
.setting {
  display: flex; align-items: center; justify-content: space-between; gap: 0.45rem 1rem;
  padding: 0.7rem 0; border-bottom: 1px solid var(--line);
}
.setting:last-child { border-bottom: 0; }
.setting .about { flex: 1 1 auto; min-width: 0; }
.setting label { display: block; font-weight: 500; }
.setting select { flex: none; max-width: 15rem; }
@media (max-width: 30rem) {
  .setting { flex-wrap: wrap; }
  .setting .about { flex-basis: 100%; }
  .setting select { width: 100%; max-width: 100%; }
}
.check .name, .check .hint { display: block; }
.check .name { font-weight: 500; }
.tone { padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.tone:last-child { border-bottom: 0; }
.tone label { display: block; margin-bottom: 0.35rem; font-weight: 500; }
.tone .row { margin-top: 0.6rem; }

/* MARK: Dictionary */
.things li { flex-wrap: nowrap; align-items: flex-start; gap: 0.5rem 1rem; }
.things .main { display: flex; flex-direction: column; flex: 1 1 auto; gap: 0.1rem; min-width: 0; overflow-wrap: anywhere; }
.things .actions { display: flex; flex: none; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0 0.9rem; }
.things .pre { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; white-space: pre-wrap; }
.things li.editing { display: block; }
.edit .field:first-child { margin-top: 0; }
@media (max-width: 30rem) {
  .things li { flex-wrap: wrap; }
  .things .actions { flex-basis: 100%; justify-content: flex-start; }
}

/* MARK: E-mail messages (K16): the question an account has not answered yet, and the row
   with the language of messages. The two answers look the same on purpose: neither is the
   one the page would rather hear. */
.ask { margin-top: 1.5rem; padding: 1.25rem 1.25rem 1.5rem; border-radius: 1rem; background: var(--ground-quiet); }
.ask h2 { font-size: 1.25rem; }
.ask p { margin-top: 0.6rem; max-width: 34rem; }
.ask .row { margin-top: 1rem; }
.ask .notice { margin-top: 1rem; background: var(--ground); }
.setting .name { display: block; font-weight: 500; }
.setting .chips { flex: none; margin-top: 0; }
.setting .chip { font-weight: 400; }

footer { padding: 2rem 0 3rem; color: var(--ink-soft); font-size: 0.875rem; }
footer .row { margin-top: 0; }
#signed-as:empty { display: none; }
