/*
  Legend kit · parts
  Every class Legend uses is defined here, under the part it belongs to, using tokens only
  (no px, colours or timings: those live in tokens.css). The Kit page reads each "@part" header for
  what the part is for. Its rules live in kit/rules.ts, each with the test that checks it.
  npm test fails if the app uses a class that isn't here, a raw value creeps in, or a part goes unused.
*/

/* @part Base
   The page itself: type, colour, selected words, scrollbars, and how every button, field and shortcut starts out.
*/
* { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: var(--weight-regular) var(--type-body)/var(--leading) var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
input:focus, textarea:focus, input:focus-visible, textarea:focus-visible { outline: none; box-shadow: none; border: 0; }
button:focus-visible { outline: none; background-color: var(--press); }
mark { background: var(--marker); color: var(--on-marker); border-radius: var(--r-xs); padding: 0 var(--hair); }
::selection { background: var(--sel-text); }
* { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.app { display: flex; height: 100%; }
.grow { flex: 1; }
.faint { color: var(--faint); }
.faintword { font-size: var(--type-callout); color: var(--faint); }
b, strong { font-weight: var(--weight-strong); } /* bold words use the kit's strong weight, never the browser's own */
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* @part Icon
   One line-drawn set on a 16-point grid with a 1.5-point line, like SF Symbols.
*/
.icon { flex: none; display: block; width: var(--icon); height: var(--icon); }
.icon.sm { width: var(--icon-sm); height: var(--icon-sm); }
.icon.xs { width: var(--icon-xs); height: var(--icon-xs); }

/* @part Keys
   A keyboard shortcut, written key by key the way Legend App does ("⌘ Enter").
*/
kbd { font: var(--weight-regular) var(--type-callout)/1 var(--font); color: var(--faint); margin-left: auto; padding-left: var(--s3); }
kbd.keys { display: inline-flex; gap: var(--s0); white-space: nowrap; }
kbd.cap { margin: 0; padding: 0 var(--s1); height: var(--ctl-xs); align-items: center; border-radius: var(--r-sm); background: var(--chip); color: var(--muted); font-size: var(--type-caption); }

/* @part Button
   A word you press. Plain is the default; Primary for the one thing a sheet is for.
*/
.btn { height: var(--ctl-h); padding: 0 var(--s3); border-radius: var(--r); background: var(--chip); font-size: var(--type-callout); display: inline-flex; align-items: center; gap: var(--s2); white-space: nowrap; transition: background var(--quick) var(--ease); }
.btn:hover { background: var(--press); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.primary:hover { opacity: .9; }
.btn.danger { background: var(--red); color: var(--on-red); }
.btn.ghost { background: none; color: var(--muted); }
.btn.ghost:hover { background: var(--hover); color: var(--ink); }
.btn.small { height: var(--ctl-sm); padding: 0 var(--s2); font-size: var(--type-callout); }
.link-btn { color: var(--link); font-size: inherit; padding: var(--s0) var(--s1); border-radius: var(--r-sm); }
.link-btn:hover { background: var(--hover); }

/* @part Tool
   An icon you press, in a header or inside a field.
*/
.tool.edge { margin-left: calc(var(--tool-inset) * -1); }
.tool.on { color: var(--yellow); } /* the star of a saved outline, filled like a starred note's */
.tool { width: var(--ctl-h); height: var(--ctl-h); display: grid; place-items: center; border-radius: var(--r); color: var(--muted); transition: background var(--quick) var(--ease), color var(--quick) var(--ease); }
.tool:hover { background: var(--hover); color: var(--ink); }
.tool:active { background: var(--press); }
.tool:disabled { opacity: .35; pointer-events: none; }
.in-field { width: var(--ctl-in); height: var(--ctl-in); display: grid; place-items: center; border-radius: var(--r-sm); color: var(--faint); flex: none; }
.in-field:hover { background: var(--hover); color: var(--ink); }

/* @part Field
   Somewhere to type. A quiet fill that brightens while you're in it.
*/
.field { display: flex; align-items: center; gap: var(--s2); background: var(--field); border-radius: var(--r); height: var(--ctl-h); padding: 0 var(--s1) 0 var(--s2); color: var(--faint); transition: background var(--quick) var(--ease); }
.field:focus-within { background: var(--field-on); }
.field input { flex: 1; min-width: 0; background: none; border: 0; height: 100%; color: var(--ink); font-size: var(--type-callout); }
.field input::placeholder { color: var(--faint); }
.field.filter { flex: 0 1 var(--w-filter); width: var(--w-filter); min-width: 0; }
.field.big { height: var(--head-h); padding: 0 var(--s4); gap: var(--s3); background: transparent; border-bottom: var(--hair) solid var(--line); border-radius: 0; }
.field.big input { font-size: var(--type-body); }
.field.compose { height: auto; align-items: flex-end; padding: var(--s2) var(--s2) var(--s2) var(--s3); border-radius: var(--r-lg); }
.field.compose textarea { flex: 1; border: 0; background: none; resize: none; font-size: var(--type-body); line-height: var(--leading-ui); padding: var(--s1) 0; color: var(--ink); max-height: var(--compose-max); }
.field.compose textarea::placeholder { color: var(--faint); }
.paste { margin: var(--s3) var(--s5) 0; width: calc(100% - var(--s5) * 2); background: var(--field); border: 0; border-radius: var(--r); padding: var(--s2) var(--s3); resize: vertical; font-size: var(--type-callout); }
.paste:focus { background: var(--field-on); }

/* @part Chip
   A small choice that can be on or off: filters, formats, the starting choices in a menu.
*/
.chiprow { display: flex; flex-wrap: wrap; gap: var(--s1); }
.chip { height: var(--ctl-sm); padding: 0 var(--s3); border-radius: var(--r); background: var(--chip); font-size: var(--type-callout); color: var(--ink); display: inline-flex; align-items: center; gap: var(--s1); flex: none; white-space: nowrap; transition: background var(--quick), color var(--quick); }
.chip:hover { background: var(--press); }
.chip.yes { background: var(--blue-strong); color: var(--on-blue); }
.chip.no { background: var(--red); color: var(--on-red); }

/* @part Segmented
   Two to four choices where exactly one is on, like a Mac segmented control.
*/
.seg { display: flex; background: var(--chip); border-radius: var(--r); padding: var(--s0); gap: var(--s0); }
.seg button { flex: 1; height: var(--ctl-sm); padding: 0 var(--s2); border-radius: calc(var(--r) - var(--s0)); font-size: var(--type-callout); color: var(--muted); white-space: nowrap; transition: background var(--swift), color var(--swift); }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--seg-on); color: var(--ink); box-shadow: var(--shadow-sm); }

/* @part Switch
   On or off, for a setting that takes effect at once.
*/
.switches { padding: var(--s0) 0; min-width: var(--w-menu-min); }
.switchrow { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); width: 100%; height: var(--menu-h); padding: 0 var(--s2); border-radius: var(--r); font-size: var(--type-callout); }
.switchrow:hover { background: var(--hover); }
.switch { width: var(--switch-w); height: var(--switch-h); border-radius: var(--r-full); background: var(--press); position: relative; transition: background var(--swift); }
.switch span { position: absolute; top: var(--s0); left: var(--s0); width: calc(var(--switch-h) - var(--s0) * 2); height: calc(var(--switch-h) - var(--s0) * 2); border-radius: var(--r-full); background: var(--knob); transition: transform var(--swift) var(--ease); box-shadow: var(--knob-shadow); }
.switch.on { background: var(--blue); }
.switch.on span { transform: translateX(calc(var(--switch-w) - var(--switch-h))); }

/* @part Badge
   A count or a date that rides along on a line: a pill, a priority dot, a star, a small word.
*/
.badge { min-width: var(--ctl-xs); height: var(--ctl-xs); padding: 0 var(--s1); border-radius: var(--r-full); background: var(--blue-strong); color: var(--on-blue); font-size: var(--type-caption); font-weight: var(--weight-strong); display: grid; place-items: center; margin-left: auto; }
.pill { font-size: var(--type-caption); font-weight: var(--weight-strong); line-height: calc(var(--ctl-xs) - var(--s0)); padding: 0 var(--s2); border-radius: var(--r-full); background: var(--pill); color: var(--muted); }
.pill.late { background: var(--red); color: var(--on-red); }
.pdot { width: var(--dot); height: var(--dot); border-radius: var(--r-full); }
.pdot.p1 { background: var(--red); }
.pdot.p2 { background: var(--orange); }
.pdot.p3 { background: var(--yellow); }
.starmark { color: var(--yellow); display: inline-flex; }
.metaword { font-size: var(--type-caption); color: var(--faint); display: inline-flex; align-items: center; gap: var(--s0); }
.mirrormark { color: var(--faint); display: inline-flex; align-items: center; height: var(--first-line); flex: none; }
.sdot { width: var(--dot); height: var(--dot); border-radius: var(--r-full); background: var(--green); flex: none; }
.sdot.small { width: var(--dot-sm); height: var(--dot-sm); }
.sdot.bad { background: var(--red); }

/* @part Menu
   A list that opens from a button or a right-click, like a Mac menu.
*/
.menu { position: fixed; z-index: var(--z-menu); min-width: var(--w-menu-min); max-width: var(--w-menu-max); background: var(--menu); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: var(--s1); animation: pop var(--quick) var(--ease); }
.menu.wide { width: var(--w-menu); max-width: var(--w-menu); }
.menu.note-menu { width: var(--w-menu); max-width: var(--w-menu); }
.menu.view-menu { width: var(--w-menu-wide); max-width: var(--w-menu-wide); }
.menu.slash { position: absolute; top: calc(100% + var(--s1)); left: 0; }
@keyframes pop { from { opacity: 0; transform: translateY(calc(var(--nudge) * -1)) scale(.985); } }
.view-cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s1); }
.menu-label { font-size: var(--type-callout); color: var(--faint); padding: var(--s3) var(--s2) var(--s1); }
.menu-label:first-child { padding-top: var(--s2); }
.menu-item { display: flex; align-items: center; gap: var(--s3); width: 100%; height: var(--menu-h); padding: 0 var(--s2); border-radius: var(--r); font-size: var(--type-callout); text-align: left; color: var(--ink); transition: background var(--quick); }
.menu-item:hover { background: var(--hover); }
.menu-item:active, .menu-item.chosen { background: var(--press); }
.menu-item:focus-visible { background: var(--hover); }
.menu-item:disabled { color: var(--faint); pointer-events: none; }
.menu-item:disabled .mi-icon, .menu-item:disabled kbd { opacity: .5; }
.mi-icon { width: var(--icon); color: var(--muted); display: grid; place-items: center; }
.mi-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-foot { font-size: var(--type-callout); color: var(--faint); padding: var(--s2) var(--s2) var(--s1); line-height: var(--leading-ui); }
.menu-dates { display: grid; grid-template-columns: auto 1fr; gap: var(--s0) var(--s3); padding: var(--s2) var(--s2) var(--s1); font-size: var(--type-callout); color: var(--faint); }
.menu-dates span:nth-child(even) { text-align: right; font-variant-numeric: tabular-nums; }
.divider { height: var(--hair); background: var(--line); margin: var(--s1); }
/* Parts carry no outside space; inside a menu, the menu gives rows of chips, segments and pickers their edge. */
.menu .chiprow, .menu .seg, .menu .pickrow { margin: 0 var(--s2) var(--s2); }
.datefield { position: relative; cursor: pointer; }
.datefield input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* @part Picker
   One row of square buttons for a note's type, and colour swatches for its priority.
*/
.pickrow { display: flex; gap: var(--s1); }
.pick { flex: 1; height: var(--ctl-h); display: grid; place-items: center; border-radius: var(--r); background: var(--chip); color: var(--muted); transition: background var(--quick), color var(--quick); }
.pick:hover { background: var(--press); color: var(--ink); }
.pick.yes { background: var(--blue-strong); color: var(--on-blue); }
.swatch { width: var(--w-swatch); height: var(--ctl-sm); display: grid; place-items: center; border-radius: var(--r); color: var(--on-red); transition: filter var(--quick), transform var(--quick) var(--ease); }
.swatch:hover { filter: brightness(1.12); }
.swatch:active { transform: scale(.96); }
.swatch.p1 { background: var(--red); }
.swatch.p2 { background: var(--orange); color: var(--on-yellow); }
.swatch.p3 { background: var(--yellow); color: var(--on-yellow); }
.swatch.none { background: var(--chip); color: var(--ink); }
.swatch.none:hover { background: var(--press); filter: none; }

/* @part Settings window
   Settings in one window: what you can set down the left, its page on the right, grouped like the Mac's System Settings.
*/
.dialog.window { flex-direction: row; width: var(--w-window); height: var(--h-window); max-height: none; position: relative; }
.win-nav { flex: none; width: var(--w-win-nav); background: var(--side); padding: var(--s3) var(--s2); display: flex; flex-direction: column; border-right: var(--hair) solid var(--line); }
.win-title { font-weight: var(--weight-strong); font-size: var(--type-body); padding: var(--s2) var(--s2) var(--s3); }
.win-body { flex: 1; min-width: 0; overflow-y: auto; padding: var(--s6) var(--s6) var(--s7); }
.win-page { width: 100%; }
.scrim.full { align-items: center; }
.win-close { position: absolute; top: var(--s2); right: var(--s2); }
.win-head { margin-bottom: var(--s4); }
.win-head h2 { margin: 0; font-size: var(--type-headline); font-weight: var(--weight-strong); }
.win-head .crumb { font-size: var(--type-callout); color: var(--muted); }
.set-group { margin-bottom: var(--s5); }
.set-group-title { font-size: var(--type-callout); font-weight: var(--weight-strong); color: var(--faint); padding: 0 var(--s1) var(--s2); }
.set-group-body { background: var(--chip); border-radius: var(--r-lg); padding: var(--s1) 0; }
.set-group .setrow { padding: var(--s2) var(--s3); }
.set-group .sethint { padding: var(--s2) var(--s1) 0; }
.theme-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--w-theme-card), 1fr)); gap: var(--s3); padding: var(--s2); }
.theme-card { position: relative; }
.theme-pick { display: flex; flex-direction: column; gap: var(--s2); width: 100%; text-align: left; border-radius: var(--r-lg); padding: var(--s1); }
.theme-pick:hover { background: var(--hover); }
.theme-card.on .theme-pick { background: var(--press); }
.theme-swatch { display: flex; height: var(--h-theme-card); border-radius: var(--r); overflow: hidden; background: var(--local-card-bg); }
.theme-side { width: 30%; background: var(--local-card-side); }
.theme-page { flex: 1; display: flex; flex-direction: column; gap: var(--s1); padding: var(--s3) var(--s2); }
.theme-line { height: var(--s1); width: 55%; border-radius: var(--r-full); background: color-mix(in srgb, var(--local-card-text) 55%, transparent); }
.theme-line.long { width: 80%; background: var(--local-card-text); }
.theme-dot { width: var(--s3); height: var(--s3); border-radius: var(--r-full); background: var(--local-card-accent); margin-top: auto; }
.theme-name { display: flex; align-items: center; gap: var(--s1); font-size: var(--type-callout); padding: 0 var(--s1) var(--s1); }
.theme-tick { width: var(--icon); height: var(--icon); border-radius: var(--r-full); background: var(--blue-strong); color: var(--on-blue); display: grid; place-items: center; }
.theme-x { position: absolute; top: var(--s2); right: var(--s2); background: var(--menu); }
.theme-card:hover .theme-x { opacity: 1; }
.color-pick { display: inline-flex; align-items: center; gap: var(--s3); }
.swatch-pick { width: var(--ctl-sm); height: var(--ctl-sm); border-radius: var(--r-full); background: var(--local-pick); box-shadow: inset 0 0 0 var(--hair) var(--line); cursor: pointer; overflow: hidden; }
.swatch-pick input { opacity: 0; width: 100%; height: 100%; border: 0; padding: 0; cursor: pointer; }
.text-box { width: 100%; border: 0; border-radius: var(--r); background: var(--field); color: var(--ink); font: inherit; font-size: var(--type-callout); line-height: var(--leading-ui); padding: var(--s2) var(--s3); resize: vertical; }
.text-box:focus { background: var(--field-on); }
.set-pad { padding: var(--s2) var(--s3); display: flex; flex-direction: column; gap: var(--s2); }
.list-row { display: flex; align-items: center; gap: var(--s2); padding-right: var(--s2); border-radius: var(--r); }
.list-row.on { background: var(--press); }
.list-main { display: flex; align-items: center; gap: var(--s3); flex: 1; min-width: 0; padding: var(--s2) var(--s3); text-align: left; color: var(--ink); border-radius: var(--r); }
.list-main:hover:not(:disabled) { background: var(--hover); }
.list-main > svg { color: var(--faint); }
.list-words { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.list-title { font-size: var(--type-callout); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-detail { font-size: var(--type-callout); color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more-options { display: inline-flex; align-items: center; gap: var(--s1); font-size: var(--type-callout); color: var(--link); padding: var(--s2) var(--s1); margin-bottom: var(--s3); }
.brief { font-family: var(--mono); font-size: var(--type-callout); line-height: var(--leading-ui); white-space: pre-wrap; color: var(--muted); padding: var(--s3); max-height: var(--code-max); overflow: auto; }

/* @part Sheet
   A card that comes down over the page for one job: search, commands, import, settings.
*/
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: var(--z-scrim); display: flex; justify-content: center; align-items: flex-start; padding-top: var(--sheet-top); animation: fade var(--quick); }
@keyframes fade { from { opacity: 0; } }
.dialog { width: var(--w-sheet); max-width: calc(100vw - var(--s4) * 2); max-height: var(--sheet-max); background: var(--menu); border-radius: var(--r-xl); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; animation: pop var(--swift) var(--ease); }
.dialog h3 { margin: 0; font-size: var(--type-body); font-weight: var(--weight-strong); padding: var(--s5) var(--s5) var(--s2); }
.dialog-foot { display: flex; align-items: center; gap: var(--s4); padding: var(--s2) var(--s4); border-top: var(--hair) solid var(--line); font-size: var(--type-callout); color: var(--faint); }
.dialog-foot > span { display: inline-flex; align-items: center; gap: var(--s1); }
.dialog-actions { display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s5) 0; flex-wrap: wrap; }
.dialog-actions.flush { padding: var(--s1) 0 0; }
.import, .settings { padding-bottom: var(--s5); }
.settings .divider { margin: var(--s3) var(--s5); }

/* @part Results
   The list inside Search and Commands: a path in small grey above the words.
*/
.results { overflow-y: auto; padding: var(--s1); }
.result { display: grid; grid-template-columns: 1fr auto; grid-template-areas: 'path why' 'text text'; gap: var(--hair) var(--s3); width: 100%; text-align: left; padding: var(--s2) var(--s3); border-radius: var(--r); }
.result.on { background: var(--hover); }
.result.cmd { display: flex; align-items: center; height: var(--ctl-h); padding: 0 var(--s3); }
.r-path { grid-area: path; font-size: var(--type-caption); color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-text { grid-area: text; font-size: var(--type-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-why { grid-area: why; font-size: var(--type-caption); color: var(--faint); white-space: nowrap; }
.empty-hint { color: var(--faint); font-size: var(--type-callout); padding: var(--s3) var(--edge-x); }
.results .empty-hint { padding: var(--s3); }

/* @part Setting
   One line in Settings: what it is on the left, the choice on the right, a hint underneath.
*/
.setrow { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: var(--s3) var(--s5) var(--s2); font-size: var(--type-callout); }
.setrow .seg { flex: none; min-width: var(--w-setting); }
.set-name { display: flex; flex-direction: column; gap: var(--s0); }
.set-controls { display: flex; flex-direction: column; align-items: flex-end; gap: var(--s1); }
.sethint { font-size: var(--type-callout); color: var(--faint); padding: 0 var(--s5) var(--s2); line-height: var(--leading-ui); }

/* @part Drop zone
   Where a file can be dropped, and what an import found.
*/
.drop { margin: var(--s3) var(--s5) 0; border-radius: var(--r-lg); background: var(--chip); padding: var(--s5); display: flex; flex-direction: column; align-items: center; gap: var(--s2); text-align: center; color: var(--muted); font-size: var(--type-callout); transition: background var(--quick); }
.drop b { color: var(--ink); font-weight: var(--weight-strong); }
.drop.over { background: var(--drop); }
.result-line { padding: var(--s3) var(--s5) 0; font-size: var(--type-callout); color: var(--muted); }
.result-line.bad { color: var(--ink); }
.result-line.bad::before { content: ''; display: inline-block; width: var(--dot); height: var(--dot); border-radius: var(--r-full); background: var(--red); margin-right: var(--s2); }
.result-box { margin: var(--s3) var(--s5) 0; padding: var(--s3) 0 0; border-top: var(--hair) solid var(--line); }
.result-box .dialog-actions { padding: var(--s3) 0 0; }
.result-title { font-size: var(--type-callout); color: var(--muted); }
.result-grid { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s5); margin-top: var(--s2); font-size: var(--type-callout); color: var(--faint); }
.result-grid span { display: flex; flex-direction: column; }
.result-grid b { font-size: var(--type-headline); font-weight: var(--weight-strong); color: var(--ink); font-variant-numeric: tabular-nums; }

/* @part Sidebar
   Places on top, actions at the foot, like a Mac sidebar.
*/
.side { flex: none; width: var(--w-side); background: var(--side); display: flex; flex-direction: column; border-right: var(--hair) solid var(--line); position: relative; }
.brand { font-weight: var(--weight-strong); font-size: var(--type-body); letter-spacing: var(--tracking-head); height: var(--head-h); display: flex; align-items: center; padding: 0 var(--s4); flex: none; }
.side-scroll { flex: 1; overflow-y: auto; padding: var(--s1) var(--s2) var(--s3); }
.side-section { margin-top: var(--s4); }
.side-label { display: flex; align-items: center; gap: var(--s0); height: var(--ctl-h); padding: 0; font-size: var(--type-callout); font-weight: var(--weight-strong); color: var(--faint); border-radius: var(--r); } /* plain grey words, like a menu's section names */
.side-head { display: flex; align-items: center; gap: var(--s1); flex: 1; min-width: 0; height: 100%; padding: 0 var(--s2); color: inherit; font: inherit; text-align: left; touch-action: none; }
.side-head .side-text, .side-item.folds .side-text { flex: 0 1 auto; } /* a section's or folder's arrow sits right after its name */
.side-label .side-fold { opacity: 0; }
.side-label:hover .side-fold, .side-head[aria-expanded='false'] .side-fold { opacity: 1; } /* a folded section always shows its arrow */
.side-label:hover .side-x { opacity: 1; }
.side-hint { font-size: var(--type-callout); line-height: var(--leading-ui); color: var(--faint); padding: var(--s0) var(--s2) var(--s1) var(--side-words-x); }
.side-item { display: flex; align-items: center; width: 100%; height: var(--ctl-h); border-radius: var(--r); color: var(--muted); font-size: var(--type-callout); transition: background var(--quick) var(--ease), color var(--quick) var(--ease); }
.side-item:hover, .side-main:focus-visible { color: var(--ink); background-color: transparent; }
.side-item:active { background: var(--press); }
.side-item.on { background: var(--press); color: var(--ink); }
.side-main { display: flex; align-items: center; gap: var(--s2); flex: 1; min-width: 0; height: 100%; padding: 0 var(--s1) 0 var(--s2); text-align: left; color: inherit; touch-action: none; }
.side-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.side-ico { width: var(--icon); height: var(--icon); display: grid; place-items: center; flex: none; color: inherit; }
.side-dot { width: var(--dot-sm); height: var(--dot-sm); border-radius: var(--r-full); background: var(--ghost); }
.side-item.on .side-dot, .side-item:hover .side-dot { background: var(--muted); }
.side-fold { display: grid; place-items: center; width: var(--icon); color: var(--faint); transition: transform var(--swift) var(--ease); }
.side-fold.open { transform: rotate(90deg); }
.side-fold.up.open { transform: rotate(-90deg); }
.side-x { width: var(--ctl-sm); height: var(--ctl-sm); display: grid; place-items: center; flex: none; opacity: 0; color: var(--faint); border-radius: var(--r); margin-right: var(--s0); }
.side-item:hover .side-x { opacity: 1; }
.side-x:hover { background: var(--hover); color: var(--ink); }
.side-name { flex: 1; min-width: 0; height: var(--ctl-sm); border: 0; border-radius: var(--r-sm); background: var(--field-on); color: var(--ink); font: inherit; padding: 0 var(--s1); }
.side-more { display: flex; flex-direction: column; }
.side-pin { display: grid; place-items: center; color: var(--faint); }
.side-find { display: flex; align-items: center; gap: var(--s2); height: var(--ctl-h); padding: 0 var(--s1) 0 var(--s2); color: var(--faint); }
.side-more-list { padding-bottom: var(--s1); }
.side-foot { padding: var(--s2); border-top: var(--hair) solid var(--line); }
.status { display: flex; align-items: baseline; gap: var(--s2); font-size: var(--type-callout); line-height: var(--leading-ui); color: var(--faint); padding: var(--s2) var(--s2) var(--s1) var(--side-words-x); }
.status span { flex: 1; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; } /* a status is read whole: it wraps, up to three lines */
.side-item.drop-into, .side-label.drop-into { background: var(--blue-strong); color: var(--on-blue); }
.side-item.drop-into .side-dot { background: var(--on-blue); }

/* @part Pane
   A column of notes with one header row: a title that appears when you scroll, and its tools.
*/
.panes { flex: 1; display: flex; min-width: 0; overflow-x: auto; }
.pane { flex: 1 1 0; min-width: var(--w-pane-min); position: relative; display: flex; flex-direction: column; border-right: var(--hair) solid var(--line); }
.pane:last-child { border-right: 0; }
.pane-head { display: flex; align-items: center; gap: var(--s3); height: var(--head-h); padding: 0 var(--s3) 0 var(--edge-x); flex: none; box-shadow: 0 var(--hair) 0 transparent; transition: box-shadow var(--calm) var(--ease); position: relative; z-index: var(--z-head); }
.pane-head.scrolled { box-shadow: 0 var(--hair) 0 var(--line); }
.pane-title { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; overflow: hidden; opacity: 0; transform: translateY(var(--nudge)); transition: opacity var(--calm) var(--ease), transform var(--calm) var(--ease); pointer-events: none; }
.pane-title.shown { opacity: 1; transform: none; }
.pane-title h2 { margin: 0; font-size: var(--type-body); font-weight: var(--weight-strong); line-height: var(--leading-ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.pane.focused .pane-title h2 { color: var(--ink); }
.pane-tools { display: flex; align-items: center; gap: var(--s1); flex: 0 1 auto; min-width: 0; }
.pane-body-wrap { flex: 1; display: flex; min-height: 0; }
.pane-body { flex: 1; overflow-y: auto; padding: 0 var(--s5) 0 0; cursor: text; }
.tail { height: var(--tail); }
.count { font-size: var(--type-callout); color: var(--faint); padding: 0 0 var(--s3) var(--edge-x); display: flex; gap: var(--s2); align-items: baseline; }
.group-head { font-size: var(--type-callout); font-weight: var(--weight-strong); color: var(--muted); padding: var(--s5) 0 var(--s2) var(--edge-x); display: flex; gap: var(--s2); }
.group-head:first-of-type { padding-top: var(--s1); }
.group-head span { font-weight: var(--weight-regular); }
.selbar { display: flex; align-items: center; gap: var(--s2); }
.selcount { font-size: var(--type-callout); color: var(--muted); padding: 0 var(--s1); white-space: nowrap; }

/* @part Title
   Where you are, at the top of the notes: the path in small grey, then the note as a big title you can edit.
*/
.zoom-head { padding: var(--s5) var(--s5) var(--s6) var(--edge-x); }
.zoom-crumbs { font-size: var(--type-callout); line-height: var(--leading-ui); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: var(--s1); }
.crumb { color: inherit; border-radius: var(--r-sm); padding: 0 var(--s0); margin: 0 calc(var(--s0) * -1); }
.crumb:hover { color: var(--ink); background: var(--hover); }
.sep { margin: 0 var(--s2); color: var(--faint); }
.zoom-title { display: block; width: 100%; margin: 0; padding: 0; border: 0; background: none; resize: none; overflow: hidden; font-size: var(--type-title); font-weight: var(--weight-title); line-height: var(--leading-title); letter-spacing: var(--tracking-title); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; caret-color: var(--blue); }
textarea.zoom-title::placeholder { color: var(--faint); }
.lede { font-size: var(--type-body); color: var(--muted); max-width: var(--w-lede); margin: var(--s2) 0 0; }

/* @part Outline row
   One note: fold arrow, mark (dot, box or number), words, and its details at the right.
*/
.row { scroll-margin-block: var(--keep-clear); display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; padding: var(--row-pad) var(--s2) var(--row-pad) calc(var(--depth) * var(--indent)); position: relative; isolation: isolate; }
.gutter { display: flex; align-items: center; height: var(--first-line); flex: none; }
.fold { width: var(--fold-w); height: var(--first-line); display: grid; place-items: center start; padding-left: var(--s1); color: var(--faint); opacity: 0; transition: opacity var(--quick); }
.fold.none { pointer-events: none; }
.row:hover .fold:not(.none), .fold.shown { opacity: 1; }
.fold:hover { color: var(--ink); }
.fold svg { transition: transform var(--swift) var(--ease); }
.fold.open svg { transform: rotate(90deg); }
.dot { width: var(--mark-w); height: var(--first-line); display: grid; place-items: center; flex: none; touch-action: none; }
.dot span { width: var(--dot); height: var(--dot); border-radius: var(--r-full); background: var(--ghost); transition: transform var(--quick) var(--ease), background var(--quick); }
.dot:hover span { background: var(--ink); transform: scale(1.25); }
.dot.bare span { background: transparent; }
.num { width: var(--mark-w); text-align: right; color: var(--faint); font-size: var(--type-callout); font-variant-numeric: tabular-nums; flex: none; touch-action: none; }
.num:hover { color: var(--ink); }
.box { width: var(--box); height: var(--box); margin: 0 calc((var(--mark-w) - var(--box)) / 2); border-radius: var(--r-sm); box-shadow: inset 0 0 0 var(--stroke) var(--ghost); display: grid; place-items: center; flex: none; touch-action: none; transition: background var(--quick), box-shadow var(--quick); }
.box:hover { box-shadow: inset 0 0 0 var(--stroke) var(--muted); }
.box.ticked { background: var(--green); box-shadow: none; color: var(--on-green); }
.main { flex: 1; min-width: 0; padding-left: var(--mark-gap); }
.line { display: flex; flex-wrap: nowrap; align-items: flex-start; column-gap: var(--s3); min-height: var(--first-line); }
.text { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; flex: 1 1 auto; }
.text.empty { min-width: var(--s7); }
.k-heading > .main .text, .k-heading > .main .editor { font-weight: var(--weight-strong); }
.row.k-heading.top > .main .text, .row.k-heading.top > .main .editor { font-size: var(--type-headline); letter-spacing: var(--tracking-head); }
.row.k-heading.top { --first-line: var(--first-line-head); padding-top: calc(var(--row-pad) + var(--head-room)); } /* the room is inside the row, so a selection band covers it */
.k-code .text, .k-code .editor { font-family: var(--mono); font-size: var(--type-callout); background: var(--code); border-radius: var(--r); padding: var(--s2) var(--s3); display: block; width: 100%; }
.row.done > .main .text { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--ghost); }
.row.context > .main .text { color: var(--muted); }
.row > .crumbs { grid-column: 2; padding-left: var(--mark-gap); } /* a list's path sits above the words, so the mark stays on their first line */
.crumbs { font-size: var(--type-caption); color: var(--faint); line-height: var(--leading-ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.editwrap { flex: 1 1 auto; min-width: 0; position: relative; }
.editor { display: block; width: 100%; resize: none; overflow: hidden; border: 0; padding: 0; margin: 0; background: transparent; line-height: var(--leading); white-space: pre-wrap; overflow-wrap: anywhere; caret-color: var(--blue); }
.editor.note { font-size: var(--type-callout); color: var(--muted); }
.noteline { font-size: var(--type-callout); line-height: var(--leading-ui); color: var(--muted); white-space: pre-wrap; margin-top: var(--hair); }
.meta { display: inline-flex; align-items: center; gap: var(--s2); flex: none; margin-left: auto; height: var(--first-line); }
.tag { color: var(--muted); }
.ilink { color: var(--link); cursor: pointer; border-radius: var(--r-xs); }
.ilink:hover, .url:hover { text-decoration: underline; text-underline-offset: var(--underline); }
.ilink.inline { font: inherit; color: var(--link); padding: 0; }
.url { color: var(--link); text-decoration: none; }
code { font-family: var(--mono); font-size: var(--type-callout); background: var(--code); border-radius: var(--r-sm); padding: 0 var(--s0); }
.row.sel::before { content: ''; position: absolute; z-index: -1; top: 0; bottom: 0; right: 0; left: calc(var(--depth) * var(--indent) + var(--fold-w) - var(--s1)); background: var(--sel); }

/* @part Add item
   The last line of every outline: press it to start a new note at the end.
*/
.add-item { display: inline-flex; align-items: center; gap: calc(var(--mark-gap) + (var(--mark-w) - var(--icon-sm)) / 2); height: var(--ctl-h); margin: var(--s2) 0 0 calc(var(--fold-w) + (var(--mark-w) - var(--icon-sm)) / 2 - var(--s2)); padding: 0 var(--s3) 0 var(--s2); border-radius: var(--r); font-size: var(--type-callout); font-weight: var(--weight-strong); color: var(--faint); transition: background var(--quick) var(--ease), color var(--quick) var(--ease); }
.add-item:hover { background: var(--hover); color: var(--ink); }
.add-item:active { background: var(--press); }

/* @part Text view
   Any pane shown as Markdown, plain text, JSON, CSV or OPML, ready to copy or download.
*/
.format { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.format-bar { display: flex; align-items: center; gap: var(--s2); padding: var(--s1) var(--s4) var(--s3) var(--s5); flex-wrap: wrap; }
.format-bar .seg { flex: none; }
.format-text { flex: 1; margin: 0; overflow: auto; padding: var(--s1) var(--s5) var(--s7); font: var(--type-callout)/var(--leading) var(--mono); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }

/* @part Links list
   Beside a pane: what links to the note you're in, where it's mentioned, and what's close.
*/
.links { width: var(--w-panel); flex: none; border-left: var(--hair) solid var(--line); overflow-y: auto; padding: var(--s0) var(--s3) var(--s5); }
.links-head { display: flex; align-items: center; justify-content: space-between; font-size: var(--type-callout); font-weight: var(--weight-strong); padding: var(--s1) 0 var(--s1) var(--s2); }
.links-for { font-size: var(--type-callout); color: var(--muted); padding: 0 var(--s2) var(--s1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.links-empty, .links-none { font-size: var(--type-callout); color: var(--faint); padding: var(--s0) var(--s2) var(--s2); }
.linkitem { display: flex; align-items: center; gap: var(--s1); border-radius: var(--r); }
.linkitem:hover { background: var(--hover); }
.linktext { flex: 1; min-width: 0; text-align: left; padding: var(--s1) var(--s2); display: flex; flex-direction: column; }
.lt { font-size: var(--type-callout); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp { font-size: var(--type-caption); color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkitem .btn { margin-right: var(--s1); opacity: 0; }
.linkitem:hover .btn { opacity: 1; }

/* @part Chat
   The side panel that talks to your notes through the Mac helper: messages, steps it took, the box you type in.
*/
.chat { width: var(--w-chat); flex: none; display: flex; flex-direction: column; border-left: var(--hair) solid var(--line); background: var(--bg); min-width: 0; position: relative; }
.chat-head { display: flex; align-items: center; gap: var(--s1); height: var(--head-h); padding: 0 var(--s2) 0 var(--s4); flex: none; }
.chat-title { font-size: var(--type-body); font-weight: var(--weight-strong); margin-right: var(--s1); }
.model { display: inline-flex; align-items: center; gap: var(--s1); height: var(--ctl-sm); padding: 0 var(--s2); border-radius: var(--r); font-size: var(--type-callout); color: var(--muted); }
.model:hover { background: var(--hover); color: var(--ink); }
.chat-body { flex: 1; overflow-y: auto; padding: var(--s1) var(--s4) var(--s4); display: flex; flex-direction: column; gap: var(--s4); }
.starters p, .connect p { font-size: var(--type-callout); color: var(--muted); line-height: var(--leading); margin: var(--s1) 0 var(--s3); }
.connect p b { color: var(--ink); font-weight: var(--weight-strong); }
.starter { display: block; width: 100%; text-align: left; padding: var(--s2) var(--s3); border-radius: var(--r); background: var(--chip); font-size: var(--type-callout); margin-bottom: var(--s1); transition: background var(--quick); }
.starter:hover { background: var(--press); }
.msg { display: flex; flex-direction: column; gap: var(--s2); }
.msg.user { align-items: flex-end; }
.bubble { max-width: 88%; background: var(--blue-strong); color: var(--on-blue); padding: var(--s2) var(--s3); border-radius: var(--r-xl); font-size: var(--type-body); line-height: var(--leading-ui); white-space: pre-wrap; overflow-wrap: anywhere; }
.rich { font-size: var(--type-body); line-height: var(--leading); overflow-wrap: anywhere; }
.rich p { margin: 0 0 var(--s2); white-space: pre-wrap; }
.rich p:last-child { margin-bottom: 0; }
.rich ul { margin: 0 0 var(--s2); padding-left: var(--s4); }
.rich li { margin: var(--s0) 0; }
.codeblock { position: relative; background: var(--code); border-radius: var(--r); margin: 0 0 var(--s2); }
.codeblock pre { margin: 0; padding: var(--s2) var(--s3); font: var(--type-callout)/var(--leading) var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: var(--code-max); overflow: auto; }
.codeblock .copy { position: absolute; top: var(--s1); right: var(--s1); }
.steps { display: flex; flex-direction: column; gap: var(--s0); }
.steps-sum { display: inline-flex; align-items: center; gap: var(--s2); font-size: var(--type-callout); color: var(--muted); padding: var(--s0) var(--s1); margin-left: calc(var(--s1) * -1); border-radius: var(--r); align-self: flex-start; max-width: 100%; text-align: left; }
.steps-sum:hover { background: var(--hover); color: var(--ink); }
.step { display: flex; align-items: center; gap: var(--s2); font-size: var(--type-callout); color: var(--muted); padding: var(--s0) 0 var(--s0) var(--s0); }
.step-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.working { font-size: var(--type-callout); color: var(--faint); display: flex; align-items: baseline; gap: var(--s0); }
.dots { display: inline-flex; gap: var(--s0); margin-left: var(--s1); }
.dots i { width: var(--dot-xs); height: var(--dot-xs); border-radius: var(--r-full); background: var(--faint); animation: blink var(--blink) infinite; }
.dots i:nth-child(2) { animation-delay: calc(var(--blink) / 6); }
.dots i:nth-child(3) { animation-delay: calc(var(--blink) / 3); }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.turn-foot { display: flex; align-items: baseline; gap: var(--s1); font-size: var(--type-callout); }
.turn-foot .link-btn, .turn-foot .faintword { font-size: var(--type-callout); }
.chat-input { padding: var(--s3); flex: none; }
.send { width: var(--ctl-sm); height: var(--ctl-sm); border-radius: var(--r); background: var(--ink); color: var(--bg); display: grid; place-items: center; flex: none; transition: opacity var(--quick); }
.send svg { transform: rotate(90deg); }
.send:hover { opacity: .88; }
.send:disabled { opacity: .25; pointer-events: none; }
.send.stop span { width: calc(var(--icon-xs) - var(--s0)); height: calc(var(--icon-xs) - var(--s0)); border-radius: var(--s0); background: var(--bg); }

/* @part Move and resize
   Dragging a note by its dot, and dragging a column's edge to change its width.
*/
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none !important; }
body.resizing, body.resizing * { cursor: col-resize !important; user-select: none !important; }
body.sweeping, body.sweeping * { user-select: none; cursor: default; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: var(--z-drag); pointer-events: none; max-width: var(--w-panel); padding: var(--s1) var(--s3); border-radius: var(--r); background: var(--menu); box-shadow: var(--shadow); font-size: var(--type-callout); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drop-line { position: fixed; z-index: var(--z-drop); height: var(--s0); border-radius: var(--s0); background: var(--blue); pointer-events: none; display: none; }
.drop-line::before { content: ''; position: absolute; left: calc(var(--s1) * -1); top: calc((var(--s0) - var(--s2)) / 2); width: var(--s2); height: var(--s2); border-radius: var(--r-full); background: var(--blue); }
.col-edge { position: relative; flex: none; width: 0; z-index: var(--z-edge); cursor: col-resize; }
.col-edge::after { content: ''; position: absolute; top: 0; bottom: 0; left: calc(var(--s1) * -1); width: var(--s2); }
.col-edge::before { content: ''; position: absolute; top: 0; bottom: 0; left: calc(var(--hair) * -1); width: var(--s0); background: transparent; transition: background var(--swift); }
.col-edge:hover::before, body.resizing .col-edge:active::before { background: var(--ghost); }
.side-edge, .chat-edge { position: absolute; top: 0; bottom: 0; }
.side-edge { right: 0; }
.chat-edge { left: 0; }

/* @part Recover
   What shows if one part of the screen hits a bug: a calm card in its place, never a blank page.
*/
.recover { margin: var(--s7) auto; padding: var(--s5); max-width: var(--w-lede); text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--s3); }
.recover-title { margin: 0; font-size: var(--type-body); font-weight: var(--weight-strong); }
.recover-says { margin: 0; font-size: var(--type-callout); color: var(--muted); line-height: var(--leading); }

/* @part Kit page
   This page: each token and part, shown with the real thing, its rules, and where Legend uses it.
*/
.kit { padding: 0 0 var(--s7) var(--edge-x); max-width: calc(var(--w-sheet) + var(--w-panel)); }
.kit-jump { margin: var(--s4) 0 var(--s6); }
.kit-section { font-size: var(--type-headline); font-weight: var(--weight-strong); letter-spacing: var(--tracking-head); margin: var(--s7) 0 var(--s2); scroll-margin-top: var(--s4); }
.kit-section:first-of-type { margin-top: 0; }
.kit-group { font-size: var(--type-callout); font-weight: var(--weight-strong); color: var(--muted); margin: var(--s5) 0 var(--s1); }
.kit-token { display: grid; grid-template-columns: var(--ctl-h) minmax(0, 1fr) auto; align-items: center; gap: var(--s3); min-height: var(--ctl-h); border-bottom: var(--hair) solid var(--line); padding: var(--s1) 0; }
.kit-token.keyrow { grid-template-columns: calc(var(--s7) * 2) minmax(0, 1fr); }
.kit-token.keyrow kbd { margin-left: 0; padding-left: 0; }
.kit-name { font: var(--type-callout)/var(--leading-ui) var(--mono); color: var(--ink); }
.kit-what { font-size: var(--type-callout); color: var(--faint); line-height: var(--leading-ui); }
.kit-value { font: var(--type-callout)/var(--leading-ui) var(--mono); color: var(--muted); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: var(--w-menu-min); }
.kit-swatch { width: var(--ctl-sm); height: var(--ctl-sm); border-radius: var(--r); box-shadow: inset 0 0 0 var(--hair) var(--line); }
.kit-bar { height: var(--s1); border-radius: var(--r-full); background: var(--blue); max-width: 100%; }
.kit-corner { width: var(--ctl-sm); height: var(--ctl-sm); background: var(--chip); }
.kit-type { line-height: var(--leading-ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kit-part { padding: var(--s5) 0; border-bottom: var(--hair) solid var(--line); scroll-margin-top: var(--s4); }
.kit-part h3 { margin: 0; font-size: var(--type-body); font-weight: var(--weight-strong); }
.kit-rules { margin: var(--s2) 0 0; padding-left: var(--s4); font-size: var(--type-callout); color: var(--muted); line-height: var(--leading); }
.kit-specimen { margin: var(--s3) 0 0; padding: var(--s4); border-radius: var(--r-lg); background: var(--side); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); position: relative; isolation: isolate; }
.kit-specimen.column { flex-direction: column; align-items: stretch; }
.kit-specimen .menu, .kit-specimen .dialog { position: static; animation: none; }
.kit-facts { margin: var(--s3) 0 0; display: grid; grid-template-columns: auto 1fr; gap: var(--s1) var(--s3); font-size: var(--type-callout); color: var(--faint); }
.kit-facts dt { color: var(--muted); }
.kit-facts dd { margin: 0; font-family: var(--mono); overflow-wrap: anywhere; }

/* @part Small screens
   Below a tablet's width the sidebar and side lists step away and chat covers the page.
*/
@media (max-width: 1100px) { .chat { width: var(--w-chat-narrow) !important; } }
.side-toggle, .side-scrim { display: none; }
@keyframes slide-in { from { transform: translateX(-100%); } }
@media (max-width: 760px) {
  .side, .links { display: none; }
  .side-toggle { display: contents; }
  .side.shown { display: flex; position: fixed; inset: 0 auto 0 0; width: var(--w-side) !important; z-index: var(--z-scrim); box-shadow: var(--shadow); animation: slide-in var(--quick) var(--ease); }
  .side-scrim { display: block; position: fixed; inset: 0; background: var(--scrim); z-index: var(--z-float); animation: fade var(--quick); }
  .pane { min-width: 0; }
  .field.filter { width: auto; }
  .chat { position: fixed; inset: 0; width: auto !important; z-index: var(--z-float); }
  .scrim.full { padding-top: 0; }
  .dialog.window { flex-direction: column; width: 100vw; max-width: none; height: 100dvh; border-radius: 0; }
  .win-nav { width: auto; flex-direction: row; gap: var(--s1); overflow-x: auto; padding: var(--s2) var(--s7) var(--s2) var(--s2); border-right: 0; border-bottom: var(--hair) solid var(--line); flex: none; }
  .win-nav .win-title { display: none; }
  .win-page { width: auto; flex: none; }
  .win-body { padding: var(--s4) var(--s4) var(--s7); }
  .setrow { flex-wrap: wrap; }
  .set-controls, .setrow .seg { width: 100%; min-width: 0; }
}
