/* =====================================================================
   The Cantina — Small tools frame (1 Nov 2026).
   The lighter tier: single-purpose pages under /small/ that share one frame so a new one is an hour's work, not a
   day's. Every small tool links, in this order: shared/theme.css, this file, shared/looks.css, shared/header.css,
   then its own <style> for anything specific. Classic palette is the landing page's harbour-at-night; a tool may
   override --accent / --accent-text. Rebel and Imperial come from looks.css as everywhere else.

   Type rule (27 Oct 2026, site-wide): one text face, one heading face; prose is one size (15px, written in rem);
   a note goes quieter by colour, never by shrinking. 12.5px is for what is scanned, not read (labels, pills, .footnote).
   ===================================================================== */
:root {
  --bg: #0c1626; --bg-elev: #13213a; --bg-elev-2: #1a2b49; --bg-input: #0a1220;
  --text: #edf1f7; --text-dim: #a7b4c8;
  --accent: #f2b84b; --accent-text: #1a1204; --accent-soft: rgba(242, 184, 75, .14);
  --border: #24365a; --danger: #ff7b72; --success: #5ad38f;
  --display: "Archivo", var(--font); --ui: var(--font);
  --radius: 10px;
}
body { font-size: 0.9375rem; line-height: 1.55; background: radial-gradient(ellipse 70% 45% at 78% -8%, rgba(242, 184, 75, 0.12), transparent 65%), var(--bg); }
.site-header { position: sticky; top: 0; z-index: 20; }
.site-header .brand { font-family: var(--display); font-stretch: 112%; letter-spacing: .01em; }
.site-header .brand .mark { display: inline-flex; color: var(--accent); }
.site-header .brand .mark svg { width: 22px; height: 22px; display: block; }

.page-wrap { max-width: 720px; }
.page-wrap.wide { max-width: 1080px; }
h1 { font-family: var(--display); font-stretch: 118%; font-weight: 800; font-size: clamp(1.75rem, 4.5vw, 2.5rem); line-height: 1.1; letter-spacing: -0.01em; margin: 0 0 8px; }
h2 { font-family: var(--display); font-stretch: 112%; font-weight: 700; font-size: 1.125rem; margin: 28px 0 8px; }
h3 { font-family: var(--display); font-stretch: 112%; font-weight: 700; font-size: 1rem; margin: 18px 0 6px; }
p, li { font-size: 0.9375rem; }
p { margin: 0 0 12px; }
.lead { color: var(--text-dim); max-width: 60ch; }
.muted { color: var(--text-dim); }
.footnote, .label, .pill { font-size: 0.78125rem; }   /* 12.5px: scanned, not read */
.label { color: var(--text-dim); font-weight: 600; letter-spacing: .02em; }

/* Cards and panels */
.card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; margin: 14px 0; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
[data-look="rebel"] .card { border-radius: 0; box-shadow: inset 4px 0 0 var(--secondary); background: var(--panel-bg); }
[data-look="imperial"] .card { border-radius: 0; background: var(--panel-bg); border-left: 2px solid var(--accent); }

/* Forms */
.field { margin-bottom: 14px; }
.field label, .field .label { display: block; margin-bottom: 6px; }
.field input, .field select, .field textarea, .input {
  font: inherit; font-size: 0.9375rem; width: 100%; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-input); color: var(--text);
}
.field textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.field .hint { color: var(--text-dim); margin-top: 6px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row > .field { flex: 1 1 180px; margin-bottom: 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }

/* Buttons (shared pattern from theme.css, sized for thumbs) */
.btn { font-size: 0.9375rem; padding: 10px 18px; min-height: 44px; }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: transparent; }
.btn.big { font-family: var(--display); font-stretch: 112%; font-weight: 800; font-size: 1.125rem; padding: 14px 24px; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 0.78125rem; }
[data-look="rebel"] .btn, [data-look="imperial"] .btn { font-family: var(--ui); letter-spacing: .03em; border-radius: var(--radius); }
[data-look="imperial"] .btn { font-weight: 700; letter-spacing: .05em; }
[data-look="rebel"] h1, [data-look="rebel"] h2, [data-look="rebel"] h3, [data-look="rebel"] .site-header .brand { font-family: var(--display); font-weight: 400; font-stretch: normal; letter-spacing: .03em; }
[data-look="imperial"] h1, [data-look="imperial"] h2, [data-look="imperial"] h3, [data-look="imperial"] .site-header .brand { font-family: var(--display); font-weight: 400; font-stretch: normal; letter-spacing: .04em; }
[data-look="imperial"] h1 { font-size: clamp(1.25rem, 3.2vw, 1.75rem); }

/* Notes and errors */
.note { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; color: var(--text-dim); background: rgba(127,127,127,.06); }
.note strong { color: var(--text); }
.error { color: var(--danger); }
.hidden { display: none !important; }

/* Lists of small tools (small/index.html) */
.tool-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 12px; }
.tool-list li a.tool-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center; padding: 16px 18px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px; color: inherit; text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
.tool-list li a.tool-row:hover { border-color: var(--accent); transform: translateY(-1px); text-decoration: none; }
.tool-list .tool-name { grid-column: 1; grid-row: 1; font-family: var(--display); font-stretch: 112%; font-weight: 700; font-size: 1.0625rem; }
.tool-list .tool-what { grid-column: 1; grid-row: 2; color: var(--text-dim); margin: 0; max-width: 68ch; }
.tool-list .tool-open { grid-column: 2; grid-row: 1 / span 2; color: var(--accent); font-weight: 600; white-space: nowrap; }
[data-look="rebel"] .tool-list li a.tool-row { border-radius: 0; box-shadow: inset 4px 0 0 var(--secondary); background: var(--panel-bg); }
[data-look="imperial"] .tool-list li a.tool-row { border-radius: 0; background: var(--panel-bg); border-left: 2px solid var(--accent); }
[data-look="rebel"] .tool-list .tool-open { color: #9a3a0c; }
@media (max-width: 480px) { .tool-list li a.tool-row { grid-template-columns: 1fr; } .tool-list .tool-open { grid-column: 1; grid-row: 3; } }

/* Shared foot on every small tool: the way back, and the invitation that makes these worth passing on */
.small-foot { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--text-dim); display: flex; gap: 8px 18px; flex-wrap: wrap; align-items: baseline; }
.small-foot a { color: var(--text-dim); text-decoration: underline; }
.small-foot a:hover { color: var(--text); }
[data-look="rebel"] .small-foot a { color: #3d1d08; }

@media (prefers-reduced-motion: reduce) { .tool-list li a.tool-row { transition: none; } .tool-list li a.tool-row:hover { transform: none; } }

/* Small tool pages carry a second mark next to the home doorway: the Small tools list (Ben, 3 Nov 2026). The thin
   rule moves to the second mark, so the pair reads as one group. */
.site-home:has(+ .site-small)::after { display: none; }
.site-small { margin-left: -4px; }

/* Date and time fields: desktop Chrome draws the calendar/clock icon black unless told the field is dark, so it
   vanished on our navy inputs and the picker looked like plain text (Ben, 3 Nov 2026). */
.field input[type="date"], .field input[type="time"] { color-scheme: dark; }
.field input[type="date"]::-webkit-calendar-picker-indicator, .field input[type="time"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .85; }

/* "Paste a list" (shared/names.js): beside "+ Add" on row-by-row pages, under the box on the others */
.paste-list { margin: 8px 8px 0 0; }

/* A made list's other actions (look-alike review, 13 Nov 2026): a labelled list of rows, so they can't be taken for
   one another or for Share. Used by Bring a plate, Wish list, Packing list, Which day suits and Duty roster. */
.more-label { margin: 18px 0 2px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim, inherit); opacity: .8; }
.more-menu { display: block; }
.more-menu > .btn { display: flex; width: 100%; justify-content: space-between; align-items: center; text-align: left; min-height: 48px; margin: 0; padding: 0 2px;
  background: none; border: 0; border-bottom: 1px solid var(--border, rgba(128,128,128,.3)); border-radius: 0; box-shadow: none; font-weight: 600; color: inherit; text-decoration: none; clip-path: none; }
.more-menu > .btn::after { content: '›'; font-size: 1.25rem; font-weight: 400; opacity: .6; margin-left: 12px; }
.more-menu > .btn.hidden { display: none; }
/* A row that has opened a panel under the list, and the panel itself (Duty roster, 15 Nov 2026). */
.more-menu > .btn[aria-expanded="true"] { font-weight: 700; box-shadow: inset 0 -3px 0 var(--accent); }
.more-menu > .btn[aria-expanded="true"]::after { content: '▴'; font-size: .875rem; opacity: 1; }
.card.panel { margin: 12px 0 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -2px 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.panel-head h2 { margin: 0; font-size: 1.0625rem; }
.panel-head .btn { flex: none; min-height: 40px; }
.more-menu > .btn:hover { filter: none; text-decoration: underline; }
.more-away { display: inline-block; margin-top: 14px; min-height: 44px; line-height: 44px; font-size: 0.875rem; }
/* Remove as a word at the end of a row, in place of a bare cross beside the main button */
.btn.rm-word { background: none; border: 0; box-shadow: none; padding: 0 4px; min-height: 44px; margin-left: auto; font-size: 0.8125rem; font-weight: 500; text-decoration: underline; opacity: .8; color: inherit; width: auto; clip-path: none; }
.btn.rm-word.warn { color: var(--danger, #e2725b); opacity: 1; }

/* Not saved yet (shared/small-net.js): stays at the bottom of the screen until the change has been sent. */
.net-bar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 900; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; max-width: 640px; margin: 0 auto; padding: 10px 14px; border-radius: 12px; background: var(--bg-elev); color: var(--text); border: 1px solid var(--danger); border-left-width: 5px; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); font-size: .9375rem; }
.net-bar.hidden { display: none; }
.net-bar-text { flex: 1 1 200px; }
.net-bar .btn { flex: none; min-height: 40px; }
/* A link that could not be opened. */
.net-problem h1 { margin: 0 0 6px; font-size: 1.375rem; }
.net-problem p { margin: 0 0 14px; }
.net-problem .net-problem-new { margin: 14px 0 0; }
/* A long title with no spaces (a pasted web address) wraps instead of pushing the page sideways. */
main h1, main h2 { overflow-wrap: anywhere; }

/* Examples (19 Nov 2026): the "See an example" link and the Example bar (shared/small-example.js) */
.ex-link { margin: -4px 0 18px; }
.ex-link a { color: var(--accent); font-weight: 700; text-decoration: none; }
.ex-link a:hover, .ex-link a:focus-visible { text-decoration: underline; }
.demo-bar { scroll-margin-top: 84px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--accent); border-radius: 12px; background: var(--bg-elev); color: var(--text-dim); font-size: .875rem; line-height: 1.45; }
.demo-bar .demo-pill { margin-right: auto; font-size: .6875rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); background: var(--accent); border-radius: 999px; padding: 3px 9px; }
.demo-bar .demo-tip { flex: 1 1 100%; }
.demo-bar .btn { min-height: 44px; }
.demo-bar .demo-facts { flex: 1 1 100%; list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.demo-bar .demo-facts li { padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-elev-2, transparent); color: var(--text); font-weight: 600; font-size: .8125rem; }
.demo-end { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; margin: 24px 0 8px; padding: 14px; border: 1px solid var(--accent); border-radius: 12px; background: var(--bg-elev); color: var(--text-dim); font-size: .9375rem; }
.demo-end .btn { min-height: 44px; }
[data-look="rebel"] .demo-end, [data-look="imperial"] .demo-end, [data-look="rebel"] .demo-bar .demo-facts li, [data-look="imperial"] .demo-bar .demo-facts li { border-radius: 0; }
[data-look="rebel"] .demo-bar, [data-look="imperial"] .demo-bar, [data-look="rebel"] .demo-bar .demo-pill, [data-look="imperial"] .demo-bar .demo-pill { border-radius: 0; }
