/* Upken web pages: one small stylesheet for every page.
   No web fonts, no images, no scripts. Colours are the app's own theme roles
   (docs/design/TOKENS.md v2.0.0 on p2/feed-reader, look B "Aurora": light and
   dark, which pass WCAG AA there); light or dark follows the phone's setting. */

:root {
  color-scheme: light dark;
  --bg: #F4F2FA;         /* light bg */
  --surface: #ECE8F7;    /* light raised */
  --text: #1A1626;       /* light text */
  --muted: #6B6585;      /* light textMuted */
  --border: #D9D3EC;     /* light border */
  --link: #6B4FD8;       /* light link */
  --accent: #9D85FF;     /* accent */
  --note-bg: #FFF1EA;    /* light streakChip */
  --note-text: #AB5836;  /* light coralText */
  --draft-bg: #C63030;   /* light danger */
  --draft-text: #FFFFFF;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #110E1C;       /* dark bg */
    --surface: #1B1630;  /* dark surface */
    --text: #F6F4FF;     /* dark text */
    --muted: #ABA4C9;    /* dark textMuted */
    --border: #3A3160;   /* dark border */
    --link: #B8A6FF;     /* dark link */
    --accent: #9D85FF;
    --note-bg: #2A1E2E;  /* dark streakChip */
    --note-text: #FF8A5B;/* dark coralText */
    --draft-bg: #3A1E2A; /* dark dangerBg */
    --draft-text: #FF8A8A;
  }
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 16px;
}

header.site {
  border-bottom: 1px solid var(--border);
}

header.site .wrap {
  display: flex;
  align-items: center;
  min-height: 3.5rem;
}

.brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.brand span { color: var(--link); }

main { padding: 1.5rem 0 3rem; }

h1 { font-size: 1.75rem; line-height: 1.25; margin: 0.5rem 0 1rem; }
h2 { font-size: 1.3rem; line-height: 1.3; margin: 2.25rem 0 0.75rem; }
h3 { font-size: 1.1rem; line-height: 1.35; margin: 1.75rem 0 0.5rem; }
h4 { font-size: 1rem; margin: 1.5rem 0 0.5rem; }

p, ul, ol, table, blockquote { margin: 0 0 1rem; }
ul, ol { padding-left: 1.4rem; }
li { margin: 0.25rem 0; }
li > ul, li > ol { margin: 0.25rem 0 0; }

a { color: var(--link); text-underline-offset: 0.15em; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

strong { font-weight: 700; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--surface);
  padding: 0.05em 0.3em;
  border-radius: 4px;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

blockquote {
  margin-left: 0;
  margin-right: 0;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
}

blockquote > :last-child { margin-bottom: 0; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.97rem;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--border);
}

th { background: var(--surface); }

/* On a phone, each table row becomes a small card, with the column name above each value. */
@media (max-width: 640px) {
  table, thead, tbody, tr, th, td { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  tr {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    padding: 0.25rem 0;
  }
  td { border-bottom: 0; padding: 0.35rem 0.75rem; }
  td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--muted);
  }
}

footer.site {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.95rem;
  padding: 1.25rem 0 2rem;
}

footer.site ul {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

/* The open page for shared links (open.html): the app's wordmark, "Up", the violet bar, "ken" (the app's
   Logo: 4 x 21 points beside 27-point letters, 3 points either side), never mirrored. */
.open { padding-top: 1.5rem; }

.logo {
  display: inline-flex;
  align-items: center;
  direction: ltr;
  font-weight: 800;
  font-size: 2.25rem;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin: 0 0 1.25rem;
}

.logo-bar {
  display: inline-block;
  width: 0.15em;
  height: 0.78em;
  margin: 0 0.11em;
  border-radius: 0.075em;
  background: var(--accent);
}

.stores { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.stores li { margin: 0; }

.store {
  display: inline-block;
  padding: 0.7rem 1.1rem;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

/* Draft builds only: a banner, and every [CHECK] or [DECIDE] note and unfilled placeholder is highlighted. */
.draft-banner {
  background: var(--draft-bg);
  color: var(--draft-text);
  font-weight: 700;
  text-align: center;
  padding: 0.6rem 16px;
}

mark.note, mark.ph {
  background: var(--note-bg);
  color: var(--note-text);
  border-radius: 3px;
  padding: 0 0.15em;
}

mark.ph { font-weight: 700; }

@media print {
  header.site, footer.site, .draft-banner { display: none; }
  body { background: #FFFFFF; color: #000000; }
}
