/* Let's play Agda — site styles. No external resources: the site is cross-origin isolated. */

:root {
  --bg: #ffffff;
  --bg-soft: #f5f7fa;
  --bg-code: #f6f7f9;
  --fg: #1c2331;
  --muted: #5d6779;
  --line: #e2e6ed;
  --accent: #4f46e5;
  --accent-soft: #eceafd;
  --accent-fg: #ffffff;
  --ok: #178a4c;
  --warn: #b25e09;
  --danger: #c0392b;

  /* Agda's own colours */
  --kw: #b45309;
  --cm: #b3261e;
  --st: #b3261e;
  --nu: #8e24aa;
  --dt: #1d4ed8;
  --ct: #15803d;
  --fn: #1d4ed8;
  --fd: #be185d;
  --so: #1d4ed8;
  --sy: #6b7280;
  --hole-bg: #fde68a;
  --hole-fg: #422006;

  --nav-w: 19.5rem;
  --topbar-h: 3.25rem;
  --editor-w: 0px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "JuliaMono", "Cascadia Code", "Cascadia Mono", "DejaVu Sans Mono", "Noto Sans Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1420; --bg-soft: #161c2b; --bg-code: #151b29; --fg: #e5e9f2; --muted: #9aa5ba; --line: #263044;
    --accent: #8b85ff; --accent-soft: #232a4a; --accent-fg: #0f1420; --ok: #4ade80; --warn: #fbbf24; --danger: #f87171;
    --kw: #fbbf24; --cm: #f87171; --st: #f87171; --nu: #d8a4f5; --dt: #7aa2ff; --ct: #6ee7a0; --fn: #7aa2ff;
    --fd: #f472b6; --so: #7aa2ff; --sy: #8d97aa; --hole-bg: #713f12; --hole-fg: #fef3c7;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1420; --bg-soft: #161c2b; --bg-code: #151b29; --fg: #e5e9f2; --muted: #9aa5ba; --line: #263044;
  --accent: #8b85ff; --accent-soft: #232a4a; --accent-fg: #0f1420; --ok: #4ade80; --warn: #fbbf24; --danger: #f87171;
  --kw: #fbbf24; --cm: #f87171; --st: #f87171; --nu: #d8a4f5; --dt: #7aa2ff; --ct: #6ee7a0; --fn: #7aa2ff;
  --fd: #f472b6; --so: #7aa2ff; --sy: #8d97aa; --hole-bg: #713f12; --hole-fg: #fef3c7;
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* The document itself never scrolls: #main (and the sidebar and the editor) do, inside the page. Without this Safari on iOS lets
   a drag that a scroller does not use move the whole page (a bounce, the toolbar) behind a fixed editor panel. */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 17px/1.65 var(--font); -webkit-text-size-adjust: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- layout ---------------------------------------------------------- */
.app {
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, 1fr) var(--editor-w);
  grid-template-rows: var(--topbar-h) minmax(0, 1fr);
  /* --kb-bottom: the height of the on-screen keyboard where it covers the page (Safari does not resize the page for it: see fitToKeyboard in app.js) */
  height: calc(100vh - var(--kb-bottom, 0px)); height: calc(100dvh - var(--kb-bottom, 0px));
}
.topbar {
  grid-column: 1 / -1; display: flex; align-items: center; gap: .5rem; padding: 0 .75rem;
  border-bottom: 1px solid var(--line); background: var(--bg); z-index: 20;
}
.brand { display: flex; align-items: center; gap: .5rem; color: var(--fg); font-weight: 650; margin-right: auto; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-logo { font-size: 1.5rem; }
.icon-btn {
  display: inline-grid; place-items: center; min-width: 2.2rem; height: 2.2rem; padding: 0 .4rem; border: 1px solid transparent;
  border-radius: .5rem; background: transparent; cursor: pointer; color: var(--muted); font-size: 1.1rem;
}
.icon-btn:hover { background: var(--bg-soft); color: var(--fg); }
/* the language menu: a globe, and under it a list of the languages */
.lang-menu { position: relative; }
.lang-list {
  position: absolute; right: 0; top: calc(100% + .35rem); z-index: 40; min-width: 9.5rem; margin: 0; padding: .3rem; list-style: none;
  background: var(--bg); border: 1px solid var(--line); border-radius: .6rem; box-shadow: 0 8px 24px rgb(0 0 0 / .18);
}
.lang-list[hidden] { display: none; }
.lang-list a { display: flex; align-items: baseline; padding: .4rem .7rem .4rem .4rem; border-radius: .4rem; color: var(--fg); text-decoration: none; white-space: nowrap; }
.lang-list a:hover, .lang-list a:focus-visible { background: var(--bg-soft); text-decoration: none; }
.lang-list a::before { content: ""; flex: none; width: 1.3rem; text-align: center; color: var(--accent); }
.lang-list a[aria-current="true"] { font-weight: 600; }
.lang-list a[aria-current="true"]::before { content: "✓"; }
.icon-btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.nav-toggle { display: none; }

.sidebar { grid-row: 2; grid-column: 1; overflow-y: auto; border-right: 1px solid var(--line); background: var(--bg-soft); padding: .75rem .5rem 2rem; font-size: .93rem; line-height: 1.4; }
#main { grid-row: 2; grid-column: 2; overflow-y: auto; scroll-behavior: smooth; scroll-padding-top: 1rem; }
.editor-panel { grid-row: 2; grid-column: 3; position: relative; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--bg); min-width: 0; }
.editor-panel[hidden] { display: none; }
.app.editor-open { --editor-w: var(--editor-size, 46vw); }

/* ---- sidebar --------------------------------------------------------- */
ol.toc, ol.toc ol { list-style: none; margin: 0; padding: 0; }
ol.toc ol { margin-left: .75rem; border-left: 1px solid var(--line); padding-left: .35rem; }
/* Every entry has a column for its mark, of the same width (a triangle for a section, a circle for a page, nothing
   for a page under construction), so that the texts of the entries of a list start at the same place. */
.toc { --mark: 1rem; --gap: .45rem; --inset: .5rem; }
.toc summary { display: flex; align-items: baseline; gap: var(--gap); list-style: none; cursor: pointer; padding: .35rem var(--inset); border-radius: .4rem; font-weight: 600; user-select: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::before { content: "▶"; font-size: .6em; color: var(--muted); flex: none; width: var(--mark); text-align: center; }
.toc details[open] > summary::before { content: "▼"; }
.toc summary:hover { background: var(--bg); }
.toc li.page a { display: flex; align-items: baseline; gap: var(--gap); padding: .28rem var(--inset); border-radius: .4rem; color: var(--fg); }
.toc li.page a:hover { background: var(--bg); text-decoration: none; }
.toc li.page a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.toc li.page a::before { content: "○"; font-size: .75em; color: var(--muted); flex: none; width: var(--mark); text-align: center; }
.toc li.page[data-status="some"] a::before { content: "◐"; color: var(--warn); }
.toc li.page[data-status="all"] a::before { content: "●"; color: var(--ok); }
.toc li.page[data-status="visited"] a::before { content: "·"; }
.toc li.wip { padding: .28rem var(--inset) .28rem calc(var(--inset) + var(--mark) + var(--gap)); color: var(--muted); }
.activity { margin: 1.5rem .5rem 0; font-size: .8rem; color: var(--muted); }
.activity-grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, .75rem); grid-auto-columns: .75rem; gap: 2px; margin-top: .4rem; }
.activity-grid .daybox { width: .75rem; height: .75rem; margin: 0; border-radius: .15rem; }
.sidebar-foot { margin-top: 1.5rem; padding: 0 .5rem; font-size: .8rem; color: var(--muted); }

/* ---- article --------------------------------------------------------- */
#content { max-width: 50rem; margin: 0 auto; padding: 1.5rem 1.5rem 4rem; }
#content h1 { font-size: 2.1rem; line-height: 1.2; margin: 1.2rem 0 1rem; letter-spacing: -.01em; }
#content h2 { font-size: 1.5rem; margin: 2.4rem 0 .7rem; padding-top: 1.2rem; border-top: 1px solid var(--line); line-height: 1.3; }
#content h3 { font-size: 1.2rem; margin: 1.8rem 0 .5rem; }
/* a heading that cannot break (non-breaking spaces, a long name) must not make the page wider than the screen */
#content :is(h1, h2, h3) { overflow-wrap: break-word; }
#content h1 .anchor, #content h2 .anchor, #content h3 .anchor { margin-left: .4rem; color: var(--muted); opacity: 0; font-weight: 400; }
#content :is(h1, h2, h3):hover .anchor, #content .anchor:focus { opacity: 1; }
#content p { margin: .85rem 0; }
#content ul, #content ol { padding-left: 1.5rem; margin: .8rem 0; }
#content li { margin: .25rem 0; }
#content li > p { margin: .4rem 0; }
#content blockquote { margin: 1rem 0; padding: .1rem 1rem; border-left: 3px solid var(--accent); background: var(--bg-soft); color: var(--muted); border-radius: 0 .4rem .4rem 0; }
#content hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.table-wrap { overflow-x: auto; margin: 1rem 0; }
#content table { border-collapse: collapse; font-size: .95rem; min-width: 100%; }
#content th, #content td { border: 1px solid var(--line); padding: .45rem .7rem; vertical-align: top; text-align: left; }
#content th { background: var(--bg-soft); }
#content code { font-family: var(--mono); font-size: .88em; background: var(--bg-code); border: 1px solid var(--line); border-radius: .3rem; padding: .05em .3em; font-variant-ligatures: none; }
#content pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.math { font-family: "Cambria Math", "STIX Two Math", "Times New Roman", serif; font-style: italic; }
.tex-unknown { color: var(--danger); font-family: var(--mono); }

/* ---- code ------------------------------------------------------------ */
pre.agda, pre.code {
  position: relative; margin: 1rem 0; padding: .9rem 1rem; overflow-x: auto; background: var(--bg-code); border: 1px solid var(--line);
  border-radius: .6rem; font: .88rem/1.55 var(--mono); font-variant-ligatures: none; tab-size: 2; white-space: pre;
}
pre.agda.header { padding: .4rem .8rem; font-size: .78rem; opacity: .75; background: transparent; }
pre.agda .decl { position: absolute; margin-top: -4.5rem; }
.kw { color: var(--kw); } .cm { color: var(--cm); } .st { color: var(--st); } .nu { color: var(--nu); } .pg { color: var(--sy); }
.dt { color: var(--dt); } .ct { color: var(--ct); } .fn { color: var(--fn); } .fd { color: var(--fd); } .so { color: var(--so); } .sy { color: var(--sy); }
.mo { color: var(--nu); } /* the module of an import: purple, as in Agda's own highlighting */
.hole { background: var(--hole-bg); color: var(--hole-fg); border-radius: .2rem; padding: 0 .15em; }
.copy-btn { position: absolute; top: .4rem; right: .4rem; opacity: 0; font: .75rem var(--font); border: 1px solid var(--line); background: var(--bg); border-radius: .4rem; padding: .15rem .5rem; cursor: pointer; color: var(--muted); }
.code-wrap:hover .copy-btn, .copy-btn:focus { opacity: 1; }

/* ---- exercises ------------------------------------------------------- */
.exercise { margin: 1.6rem 0; padding: .9rem 1rem 1rem; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: .6rem; background: var(--bg-soft); }
.exercise.solved { border-left-color: var(--ok); }
.exercise-head { display: flex; align-items: center; gap: .6rem; font-size: .85rem; color: var(--muted); }
.badge { background: var(--accent); color: var(--accent-fg); border-radius: 1rem; padding: .05rem .6rem; font-weight: 600; font-size: .78rem; }
.exercise.solved .badge { background: var(--ok); }
.exercise pre.agda { margin: .7rem 0; background: var(--bg); }
.exercise-actions { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.exercise-status { font-size: .88rem; color: var(--muted); }
.exercise.solved .exercise-status { color: var(--ok); font-weight: 600; }
.btn { border: 1px solid var(--line); background: var(--bg); border-radius: .5rem; padding: .4rem .9rem; cursor: pointer; font-weight: 550; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.primary:hover { filter: brightness(1.08); }
.btn[disabled] { opacity: .6; cursor: progress; }
/* a use of a declared name links to its declaration: coloured like the declaration, underlined on hover */
pre.agda a { text-decoration: none; }
pre.agda a:hover { text-decoration: underline; text-underline-offset: .15em; }
/* the names the reference solution uses: the name is blurred until clicked, then the chip is a link to the declaration.
   Only the name is blurred, not the chip (it stays a sharp, clickable box). The colour of the kind of name (green for a
   constructor, blue for a function, …) stays visible: the chip is tinted with it, and the name is bold and a little
   darker (lighter in the dark theme), because blurred thin strokes in that colour alone are a pale smudge on a light page.
   The chip's own colour is the kind's (.dt, .ct, .fn, .fd), which is what currentColor is here. */
.hints { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; margin-top: .75rem; font-size: .88rem; color: var(--muted); }
.hints .hint { padding: .05rem .45rem; border: 1px solid color-mix(in srgb, currentColor 55%, var(--line)); border-radius: .35rem; background: color-mix(in srgb, currentColor 16%, var(--bg)); font: 700 .85rem/1.5 var(--mono); user-select: none; cursor: pointer; }
.hints .hint:hover { border-color: var(--accent); }
.hints .hint .n { display: inline-block; color: color-mix(in srgb, currentColor 85%, var(--fg)); filter: blur(.35em) saturate(1.5); transition: filter .15s; }
.hints .hint.shown { user-select: text; }
.hints .hint.shown .n { color: inherit; filter: none; }
.your-code { margin-top: .8rem; }
.your-code-title, details.solution > summary { font-size: .85rem; color: var(--muted); }
details.solution { margin-top: .8rem; }
details.solution > summary { cursor: pointer; padding: .2rem 0; }
.your-code pre, details.solution pre { margin: .5rem 0 0; }
/* a block with a copy button is in a box (see enhance in app.js): the box has the block's margins, the block none */
.code-wrap { position: relative; margin: 1rem 0; }
.exercise .code-wrap { margin: .7rem 0; }
.your-code .code-wrap, details.solution .code-wrap { margin: .5rem 0 0; }
.code-wrap > pre.agda, .code-wrap > pre.code { margin: 0; }

/* ---- callouts -------------------------------------------------------- */
.Aside, .Hint, .More, .Todo { margin: 1.2rem 0; padding: .1rem 1rem; border-radius: .6rem; border: 1px solid var(--line); }
.Aside { background: var(--bg-soft); color: var(--muted); font-size: .95rem; }
.Hint { background: color-mix(in srgb, var(--accent) 8%, var(--bg)); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.More { border-style: dashed; }
.Todo { border-color: var(--danger); color: var(--danger); }
.Todo::before { content: var(--todo-label, "Todo"); display: block; font-weight: 700; margin-top: .6rem; } /* (the label is set on the page, in its language) */

/* What is particular to the writing of a language is by its :lang(), here Traditional Chinese: its fonts after the
   Latin ones, and an emphasis in italics does not read well in Chinese, so it is bold. (The words are in i18n/.) */
:root:lang(zh-Hant) { --font: "Inter", "Segoe UI", system-ui, -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Helvetica Neue", Arial, sans-serif; }
:lang(zh-Hant) #content em { font-style: normal; font-weight: 700; }
.collapse-toggle { display: inline-block; margin: .4rem 0; padding: .25rem .8rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--bg); cursor: pointer; font-size: .9rem; }
.collapse-toggle:hover { border-color: var(--accent); }

/* ---- pager, footer --------------------------------------------------- */
.pager { display: flex; justify-content: space-between; gap: 1rem; margin: 3rem 0 1rem; }
.pager a { display: block; flex: 1; max-width: 50%; padding: .7rem 1rem; border: 1px solid var(--line); border-radius: .6rem; color: var(--fg); }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager a span { display: block; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pager .next { text-align: right; margin-left: auto; }
.page-footer { margin-top: 2rem; font-size: .82rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 1rem; }

/* ---- search ---------------------------------------------------------- */
.search { position: relative; flex: 0 1 18rem; }
.search input { width: 100%; padding: .4rem .8rem; border: 1px solid var(--line); border-radius: .6rem; background: var(--bg-soft); color: var(--fg); font: .92rem var(--font); }
#search-results { position: absolute; top: 2.6rem; left: 0; right: 0; min-width: 22rem; max-height: 70vh; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: .6rem; box-shadow: 0 8px 30px rgb(0 0 0 / .18); z-index: 40; }
#search-results a { display: block; padding: .5rem .8rem; color: var(--fg); border-bottom: 1px solid var(--line); font-size: .9rem; line-height: 1.35; }
#search-results a:last-child { border-bottom: 0; }
#search-results a:hover, #search-results a.active { background: var(--accent-soft); text-decoration: none; }
#search-results small { display: block; color: var(--muted); }
#search-results mark { background: var(--hole-bg); color: var(--hole-fg); border-radius: .15rem; }

/* ---- editor panel ---------------------------------------------------- */
.editor-bar { display: flex; align-items: center; gap: .25rem; padding: .25rem .5rem; border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.editor-title { margin-right: auto; font-size: .85rem; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-panel iframe { flex: 1; width: 100%; border: 0; background: var(--bg); order: 1; }
/* candidates for what was typed after a backslash; under the editor, above a phone's keyboard */
.symbol-bar { order: 2; display: flex; gap: .35rem; overflow-x: auto; padding: .35rem .5rem; border-top: 1px solid var(--line); background: var(--bg-soft); scrollbar-width: none; overscroll-behavior-x: contain; }
.symbol-bar[hidden] { display: none; }
.symbol-bar::-webkit-scrollbar { display: none; }
.symbol-bar button { flex: none; min-width: 2.8rem; height: 2.9rem; padding: .1rem .55rem; display: grid; place-items: center; align-content: center; gap: .05rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--bg); color: var(--fg); cursor: pointer; touch-action: manipulation; }
.symbol-bar button:hover { border-color: var(--accent); }
.symbol-bar .sym-c { font: 1.3rem/1.1 var(--mono); }
.symbol-bar .sym-s { font: .62rem/1 var(--font); color: var(--muted); max-width: 5.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Agda's commands as buttons, below the symbol bar */
.command-bar { order: 3; display: flex; gap: .35rem; overflow-x: auto; padding: .35rem .5rem; border-top: 1px solid var(--line); background: var(--bg-soft); scrollbar-width: none; overscroll-behavior-x: contain; }
.command-bar[hidden] { display: none; }
.command-bar::-webkit-scrollbar { display: none; }
.command-bar button { flex: none; height: 2.9rem; padding: .1rem .75rem; display: grid; place-items: center; align-content: center; gap: .1rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--bg); color: var(--fg); cursor: pointer; touch-action: manipulation; white-space: nowrap; }
.command-bar button:hover { border-color: var(--accent); }
.command-bar button:active { background: var(--accent-soft); }
/* the bars are scrolled by a swipe, and have no scrollbar for that; with a mouse there is no swipe: a thin one (it shows that there is more), and the wheel scrolls sideways over them (app.js) */
@media (hover: hover) and (pointer: fine) {
  .symbol-bar, .command-bar { scrollbar-width: thin; scrollbar-color: var(--muted) transparent; }
  .symbol-bar::-webkit-scrollbar, .command-bar::-webkit-scrollbar { display: block; height: 8px; }
  .symbol-bar::-webkit-scrollbar-thumb, .command-bar::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 4px; }
  .symbol-bar::-webkit-scrollbar-track, .command-bar::-webkit-scrollbar-track { background: transparent; }
}
.command-bar .cmd-l { font: 600 .85rem/1.1 var(--font); }
.command-bar .cmd-s { font: .62rem/1 var(--mono); color: var(--muted); }
.editor-status { position: absolute; inset: 2.6rem 0 0 0; display: grid; place-items: center; text-align: center; padding: 2rem; background: color-mix(in srgb, var(--bg) 92%, transparent); color: var(--muted); font-size: .95rem; z-index: 2; pointer-events: none; }
.editor-status:empty { display: none; }
.editor-resizer { position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 5; }
.editor-resizer:hover, .resizing .editor-resizer { background: var(--accent-soft); }
.resizing iframe { pointer-events: none; }
.scrim { position: fixed; inset: var(--topbar-h) 0 0 0; background: rgb(0 0 0 / .4); z-index: 15; }

/* ---- small screens --------------------------------------------------- */
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .nav-toggle { display: inline-grid; }
  .sidebar { position: fixed; z-index: 25; top: var(--topbar-h); bottom: 0; left: 0; width: min(86vw, 22rem); transform: translateX(-102%); transition: transform .2s; }
  .app.nav-open .sidebar { transform: none; box-shadow: 0 0 30px rgb(0 0 0 / .3); }
  #main { grid-column: 1; }
  .app.editor-open { --editor-w: 0px; }
  .app.editor-open #main { overflow: hidden; } /* the editor covers the page: no scrolling of it behind the editor (it keeps its place) */
  .editor-panel { position: fixed; z-index: 30; inset: max(var(--topbar-h), var(--vv-top, 0px)) 0 var(--kb-bottom, 0px) 0; border-left: 0; }
  .editor-resizer { display: none; }
  #content { padding: 1rem 1rem 3rem; }
  .brand-name { display: none; }
  .search { flex: 1; }
  #search-results { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { #main { scroll-behavior: auto; } .sidebar { transition: none; } }
@media print { .topbar, .sidebar, .editor-panel, .pager, .copy-btn { display: none !important; } html, body { height: auto; overflow: visible; } .app { display: block; height: auto; } #main { overflow: visible; } }

.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 1rem); opacity: 0; transition: .3s; background: var(--bg-soft); color: var(--fg); border: 1px solid var(--line); padding: .6rem 1.1rem; border-radius: .6rem; z-index: 110; font-size: .95rem; box-shadow: 0 6px 24px rgb(0 0 0 / .3); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.update-bar { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 120; display: flex; align-items: center; gap: 1rem; background: var(--bg-soft); color: var(--fg); border: 1px solid var(--line); padding: .6rem .6rem .6rem 1.1rem; border-radius: .7rem; box-shadow: 0 6px 24px rgb(0 0 0 / .3); font-size: .95rem; }
.update-bar .btn { padding: .25rem .8rem; }

/* the old pages embed a few widgets; keep them tidy */
.char-table table { border-collapse: collapse; font-family: var(--mono); font-size: .85rem; }
.char-table td, .char-table th { border: 1px solid var(--line); padding: .2rem .5rem; }
.daybox { display: inline-block; width: 1em; height: 1em; border-radius: .2em; vertical-align: -.15em; margin-right: .3em; }
.daybox.active { background: #44a340; } .daybox.resting { background: #77c770; } .daybox.inactive { background: var(--line); }
