/*! pages.css 1.1.0 | DJ2000-UK/app-workbench */
/* More's pages, the same in every app (DJ, 2026-11-30: "All the pages should be
   design-wise consistent across"; he picked Kaizen's version). A page under More
   has a ‹ back link, a title in heavy capitals, then glass panels with sentence-case
   copy, tall rounded buttons with bold capital words, 16 px rounded fields, and
   choices as rounded tiles. See docs/PAGES.md.

   Put class="settings-page" on the element that holds a page under More (the
   starter sets it on <main> for every page More opens). More itself, the grouped
   list, keeps its large title and is not a settings page.

   Unlayered on purpose, unlike the other shared stylesheets: More's pages must look
   the same in every app, so these rules (scoped .settings-page, two classes deep)
   win over an app's own button, field and title rules there. Load this file after
   the app's own stylesheet. Colours come from the family's tokens only. */

.settings-page {
  --pages-radius: 24px;
  --pages-control-radius: 16px;
  --pages-field-radius: 14px;
  --pages-glass: color-mix(in srgb, var(--void) 47%, transparent);
  --pages-edge: color-mix(in srgb, var(--ink) 12%, transparent);
  --pages-sheen: linear-gradient(145deg, color-mix(in srgb, var(--ink) 7.5%, transparent), color-mix(in srgb, var(--ink) 1.8%, transparent));
  --pages-shadow: inset 0 1px color-mix(in srgb, var(--ink) 5.5%, transparent), 0 20px 54px color-mix(in srgb, var(--void) 45%, transparent);
  --pages-tile: color-mix(in srgb, var(--ink) 4%, transparent);
  --pages-picked-edge: rgba(var(--accent-rgb), .7);
  --pages-picked: rgba(var(--accent-rgb), .14);
  gap: 14px;
  font-family: var(--font-sans);
}

/* One font on More's pages: an app's own body or label font (Shinpo's mono) never
   shows here. Fields that hold an address or code keep the mono font. */
.settings-page :is(h1, h2, h3, p, span, strong, small, b, em, label, legend, li, dt, dd, a, button, input, select, textarea, summary) { font-family: var(--font-sans); }
.settings-page :is(.text-input--mono, code, kbd) { font-family: var(--font-mono); }

/* The back link and the title: ‹ More, then the page's name in heavy capitals. */
.settings-page .back-btn {
  min-height: 44px;
  padding: 0 14px 0 10px;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  color: var(--muted-bright);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}
.settings-page .back-btn span { font-size: 20px; line-height: 1; }
.settings-page .page-head h1 {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: .05em;
  line-height: 1.2;
  text-transform: uppercase;
  overflow-wrap: break-word;
}
.settings-page .page-head p,
.settings-page .page-intro { margin: 0; color: var(--muted-bright); font-size: .92rem; font-weight: 400; letter-spacing: 0; line-height: 1.5; text-transform: none; }

/* Panels: the glass card each part of a page sits in. */
.settings-page .panel {
  display: grid;
  min-width: 0;
  padding: 18px;
  gap: 14px;
  align-content: start;
  border: 1px solid var(--pages-edge);
  border-radius: var(--pages-radius);
  background-color: var(--pages-glass);
  background-image: var(--pages-sheen);
  box-shadow: var(--pages-shadow);
  -webkit-backdrop-filter: blur(26px) saturate(132%);
  backdrop-filter: blur(26px) saturate(132%);
}
.settings-page .panel__head { display: flex; min-width: 0; margin: 0; gap: 12px; align-items: baseline; justify-content: space-between; }
.settings-page .panel__head h2 { min-width: 0; margin: 0; color: var(--ink); font-family: var(--font-sans); font-size: 1rem; font-weight: 900; letter-spacing: .08em; line-height: 1.2; text-transform: uppercase; }
.settings-page .panel__head > span:not(.badge) { flex: 0 0 auto; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }

/* Words: sentence case for anything people read. */
.settings-page .copy { margin: 0; color: var(--muted-bright); font-family: var(--font-sans); font-size: .92rem; line-height: 1.5; letter-spacing: 0; text-transform: none; }
.settings-page .copy--muted { color: var(--muted); }
.settings-page .copy strong { color: var(--ink); }
.settings-page .copy:empty { display: none; }
.settings-page .footnote { margin: 0; color: var(--muted); font-family: var(--font-sans); font-size: .82rem; line-height: 1.5; letter-spacing: 0; text-transform: none; }
.settings-page .notice { margin: 0; padding: 12px 14px; border-radius: var(--pages-field-radius); font-size: .88rem; line-height: 1.45; }

/* Buttons: tall, rounded, bold capitals. One primary per page. */
.settings-page .btn {
  display: inline-flex;
  min-height: 56px;
  padding: 12px 18px;
  gap: 10px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--pages-control-radius);
  background: var(--pages-tile);
  box-shadow: none;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: .9rem;
  font-weight: 850;
  letter-spacing: .08em;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
}
.settings-page :is(.btn--primary, .btn--solid) { border-color: transparent; background: var(--accent); color: var(--accent-ink); box-shadow: 0 12px 30px rgba(var(--accent-rgb), .18); }
.settings-page .btn--danger { border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 6%, transparent); color: var(--danger); }
.settings-page .btn--quiet { border-color: transparent; background: none; color: var(--muted-bright); }
.settings-page .btn--wide { width: 100%; }
.settings-page .btn:disabled,
.settings-page .btn[aria-disabled="true"] { border-color: var(--line); background: var(--pages-tile); box-shadow: none; color: var(--muted); opacity: .55; }
.settings-page .btn-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }

/* Fields: a small capital label over a 16 px rounded field (no zoom on focus). */
.settings-page .field { display: grid; gap: 6px; }
.settings-page .field > span,
.settings-page .field-label { color: var(--muted); font-family: var(--font-sans); font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.settings-page :is(.text-input, .select, .textarea, select, textarea, input:is([type="text"], [type="number"], [type="date"], [type="time"], [type="search"], [type="email"], [type="url"], [type="tel"])) {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--pages-field-radius);
  background: color-mix(in srgb, var(--void) 60%, transparent);
  box-shadow: none;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  letter-spacing: 0;
  text-transform: none;
}
.settings-page :is(.textarea, textarea) { min-height: 104px; padding-block: 12px; line-height: 1.45; }
.settings-page :is(.text-input, .select, .textarea, select, textarea, input):focus-visible { border-color: var(--accent); }
.settings-page :is(select, .select):disabled { color: var(--muted); opacity: .7; }

/* Choices of a few words: segmented tiles (Show and Hide, units, Export's choices). */
.settings-page .segmented { display: flex; flex-wrap: wrap; gap: 8px; }
.settings-page .segmented button {
  min-width: 52px;
  min-height: 52px;
  padding: 8px 12px;
  flex: 1 1 auto;
  border: 1px solid var(--line);
  border-radius: var(--pages-field-radius);
  background: color-mix(in srgb, var(--ink) 3%, transparent);
  color: var(--muted-bright);
  font-family: var(--font-sans);
  font-size: .85rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
  text-transform: none;
}
.settings-page .segmented button:is([aria-pressed="true"], [aria-checked="true"], [aria-selected="true"]) { border-color: var(--pages-picked-edge); background: var(--pages-picked); color: var(--ink); }

/* Choices that need a line each: a card with a radio, a name and what it means
   (Time zone: Follow this device, or Always use one time zone). */
.settings-page .choice-card {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  min-height: 52px;
  padding: 14px;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--pages-control-radius);
  background: color-mix(in srgb, var(--ink) 3%, transparent);
  cursor: pointer;
}
.settings-page .choice-card input { width: 20px; height: 20px; min-height: 0; margin: 1px 0 0; padding: 0; accent-color: var(--accent); }
.settings-page .choice-card strong { display: block; color: var(--ink); font-size: .95rem; font-weight: 700; line-height: 1.3; }
.settings-page .choice-card small { display: block; margin-top: 3px; color: var(--muted-bright); font-size: .82rem; line-height: 1.4; }
.settings-page .choice-card:has(input:checked) { border-color: var(--pages-picked-edge); background: rgba(var(--accent-rgb), .1); }
.settings-page .choice-card:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }

/* A setting with a switch or Show and Hide beside its name. */
.settings-page .setting__label strong { color: var(--ink); font-size: .95rem; font-weight: 700; letter-spacing: 0; text-transform: none; }
.settings-page .setting__label small { color: var(--muted-bright); font-size: .82rem; line-height: 1.4; letter-spacing: 0; text-transform: none; }
.settings-page .toggle-row { gap: 14px; }

/* Palette: two columns of tiles, each a dot in the palette's colour and its name. */
.settings-page .theme-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0;
  gap: 8px;
  border: 0;
  background: none;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.settings-page .theme-switcher button {
  display: inline-flex;
  min-width: 0;
  min-height: 52px;
  padding: 0 12px;
  flex-direction: row;
  gap: 9px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--pages-control-radius);
  background: var(--pages-tile);
  box-shadow: none;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: .9rem;
  font-weight: 800;
}
.settings-page .theme-switcher button > span {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--swatch, var(--accent));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 18%, transparent);
  color: transparent;
  font-size: 0;
  line-height: 0;
}
.settings-page .theme-switcher button b { min-width: 0; overflow: hidden; font-size: inherit; font-weight: inherit; letter-spacing: .01em; text-overflow: ellipsis; text-transform: none; white-space: nowrap; }
.settings-page .theme-switcher button[aria-pressed="true"] { border-color: var(--pages-picked-edge); background: var(--pages-picked); box-shadow: none; color: var(--ink); }

@media (min-width: 901px) {
  .settings-page .page-head h1 { font-size: 1.5rem; }
  .settings-page .panel { padding: 22px; }
}
