/* COPY of Ridge/template/ridge.css: never edit here, refresh with Ridge/tools/sync.mjs */
/* Ridge - template/ridge.css: the shared look of every Ridge app page, taken VERBATIM from Mingo\lib\theme.ps1 on
   2026-10-09 (SPEC sections 13, 50, 51, 52 there). Every custom property is named after the PowerShell token it comes from
   (Fg2 -> --fg2, GlassBlur -> --glass-blur, CurrentTint -> --current-tint), so the two files can be diffed token by token.
   ARGB hex in theme.ps1 is written here as rgba().

   Where each token lives in theme.ps1:
     light palette  Color line 28 (CardBg .. Ground1), 29 (Fg .. Current), 30 (GoodFill .. ErrorText), 32 (Glass*), 35 (GlassIn*), 43 (CurrentTint, CurrentHover)
     dark palette   Color line 48, 51, 52, 60 (Glass*), 61 (GlassIn*), 67
     sizes          Size lines 143-170 (cited inline below), Radius line 77, CardWidth / CardHeight / RailWidth line 78, Font line 76

   Palettes, as Mingo uses them (SPEC section 13): LIGHT is the default and the larger view; DARK is the small card only.
   The host sets the URL hash (#small / #big) and the app's script mirrors it onto <html data-mode>, which picks the palette:
     :root                    light (the big card, and a plain browser tab)
     :root[data-mode="small"] dark (the 400 x 269 card)

   Below the tokens: the two grounds, then the COMPONENTS ported from Mingo\lib\theme.ps1's style dictionary ($Script:ThemeXaml,
   lines 277-707) and lib\ui.ps1's builders, as plain classes prefixed rg- (second pass, 2026-10-09). Each cites its source. An app
   loads this file first and adds only its own content styles; it never restyles a component. A copy lives in each app
   (Wingo\app\ui\ridge.css, refreshed by `npm run sync-ridge`); this file is the original. */

:root {
  /* @tokens light */
  /* light palette: Mingo lib\theme.ps1 lines 28-43 */
  --card-bg: #FFFFFF;
  --card-bg2: rgba(0, 0, 0, .051);
  --hover: rgba(0, 0, 0, .078);
  --rail-bg: rgba(0, 0, 0, .031);
  --thumb: rgba(0, 0, 0, .200);
  --base: #FFFFFF;
  --field: #FFFFFF;
  --scrim: rgba(0, 0, 0, 0.32);   /* behind a modal plate (the practice sheet's) */
  --ink: #1A1C22;
  --ground0: #FCF8F2;
  --ground1: #F3F1EE;
  --fg: #1A1C22;
  --fg2: #5A5F6B;
  --fg3: #8A8F9A;
  --line: rgba(0, 0, 0, .102);
  --edge: rgba(0, 0, 0, .161);
  --accent: #E53935;
  --good: #21A04A;
  --warn: #F5B800;
  --current: #3B6EA8;
  --good-fill: rgba(33, 160, 74, .549);
  --warn-fill: rgba(245, 184, 0, .722);
  --good-tint: #E4F4E9;
  --warn-tint: #FFF6D6;
  --good-text: #187A38;
  --warn-text: #966900;
  --error-text: #C62828;
  --glass: rgba(250, 247, 242, .902);
  --glass-blur: rgba(255, 255, 255, .561);
  --glass-sheen: rgba(255, 255, 255, .302);
  --glass-edge: rgba(255, 255, 255, .620);
  --glass-hi: rgba(255, 255, 255, .851);
  --glass-lo: rgba(255, 255, 255, .251);
  --glass-in: rgba(255, 255, 255, .549);
  --glass-in-hover: rgba(255, 255, 255, .922);
  --glass-in-edge: rgba(0, 0, 0, .102);
  --glass-in-hi: #FFFFFF;
  --current-tint: rgba(59, 110, 168, .122);
  --current-hover: #34619A;
  --chart-rule: rgba(0, 0, 0, .341);
  /* the newspaper rarity ladder, fill + ink (theme.ps1 lines 41-42; SPEC section 6) and the sentence order map (Ramp, line 44) */
  --tier1: #E2E4E9; --tier2: #D0EDE5; --tier3: #E0E3F9; --tier4: #ECDDF6; --tier5: #FADDB0;
  --tier1-ink: #3E4553; --tier2-ink: #155947; --tier3-ink: #333F8E; --tier4-ink: #5B2E86; --tier5-ink: #7A4A08;
  --ramp-0: #E53935; --ramp-1: #F5761A; --ramp-2: #F5B800; --ramp-3: #8BC34A; --ramp-4: #21A04A;
  /* sizes: Mingo lib\theme.ps1 Size (lines 143-170) and Radius (77) */
  --body: 13px; --small: 12px; --note: 11px; --empty: 14px; --arrow: 15px; --close: 16px;        /* line 143 */
  --grip-width: 18px; --chevron: 18px; --card-inset: 16px;                                       /* 144-145 */
  --switch-width: 34px; --switch-height: 18px; --knob: 14px; --knob-ring: 4.5px; --ring-stroke: 1.5px;   /* 157-158 */
  --radius: 16px; --glass-radius: 8px;                                                           /* 77: the larger view's corners; the glass card's (window.ps1 GlassRadius) */
  --radius-panel: 12px; --radius-control: 8px; --radius-rail: 10px; --radius-tip: 10px;          /* 159 */
  --radius-capsule: 13px; --radius-status: 15px; --radius-edit: 15px;                            /* 162 */
  --radius-button: 8px; --radius-button-large: 10px;                                             /* an action button: under 40 px tall / 40 px or more (2026-11-13) */
  --segment-height: 22px; --radius-segment: 11px; --radius-track: 14px;                          /* 163 */
  --close-button: 26px; --rail-inset: 6px; --rail-width: 98px;                                   /* 164, 78 */
  --page-pad: 26px; --page-top: 2px; --scroll-lane: 8px; --panel-pad: 14px; --text-inset: 15px; --panel-gap: 12px;   /* 170 */
  --scroll-fade: 16px;                                                                           /* 171: the scroll edge (section 91) */
  --font-ui: "Segoe UI", system-ui, sans-serif;                                                  /* 76: Font.Ui */
  --font-zh: "Microsoft YaHei UI", "Microsoft JhengHei UI", SimSun, sans-serif;                  /* 76: Font.Zh */
  /* @end tokens */
  color-scheme: light;
}

/* dark palette: lines 48-67. The small card is always dark, like Mingo's; a page that follows the OS or a setting marks
   <html data-theme="dark"> (Mingo resolves its "system" choice to dark or light in script, so no media query lives here). */
:root[data-mode="small"], :root[data-theme="dark"] {
  /* @tokens dark */
  --card-bg: rgba(43, 45, 51, .922);
  --card-bg2: rgba(255, 255, 255, .090);
  --hover: rgba(255, 255, 255, .141);
  --rail-bg: rgba(255, 255, 255, .047);
  --thumb: rgba(255, 255, 255, .251);
  --base: #FFFFFF;
  --field: #34373E;
  --scrim: rgba(0, 0, 0, 0.5);
  --ink: #1A1C22;
  --ground0: #221D27;
  --ground1: #17131B;
  --fg: #ECEDF0;
  --fg2: #C2C6CE;
  --fg3: #AFB4BE;
  --line: rgba(255, 255, 255, .122);
  --edge: rgba(255, 255, 255, .200);
  --accent: #FF5A52;
  --good: #3DD46A;
  --warn: #FFC83D;
  --current: #8FB6EC;
  --good-fill: rgba(61, 212, 106, .502);
  --warn-fill: rgba(255, 200, 61, .702);
  --good-tint: #2F4A3A;
  --warn-tint: #4D4528;
  --good-text: #3DD46A;
  --warn-text: #FFC83D;
  --error-text: #FF8A80;
  --glass: rgba(23, 24, 29, .929);
  --glass-blur: rgba(20, 21, 26, .851);
  --glass-sheen: rgba(255, 255, 255, .051);
  --glass-edge: rgba(255, 255, 255, .180);
  --glass-hi: rgba(255, 255, 255, .259);
  --glass-lo: rgba(255, 255, 255, .051);
  --glass-in: rgba(255, 255, 255, .071);
  --glass-in-hover: rgba(255, 255, 255, .149);
  --glass-in-edge: rgba(255, 255, 255, .102);
  --glass-in-hi: rgba(255, 255, 255, .102);
  --current-tint: rgba(141, 180, 234, .200);
  --current-hover: #A5C5F0;
  --chart-rule: rgba(255, 255, 255, .341);
  /* lines 65-66 / 70: the dark ladder, and the QUIET ramp (the sentence reads first) */
  --tier1: #3C3F46; --tier2: #224640; --tier3: #343A6A; --tier4: #472F60; --tier5: #5A4220;
  --tier1-ink: #D6DAE2; --tier2-ink: #BDEBD9; --tier3-ink: #CBD0FA; --tier4-ink: #E3CDF6; --tier5-ink: #FFD79B;
  --ramp-0: #F26D66; --ramp-1: #F2954F; --ramp-2: #EFC458; --ramp-3: #A9D75E; --ramp-4: #55CC7A;
  /* @end tokens */
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
html { background: transparent; overflow: hidden; }
body { margin: 0; color: var(--fg); font: var(--body)/1.45 var(--font-ui); display: flex; flex-direction: column; overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--current); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: var(--empty); font-weight: 600; }
:root[data-mode="small"] body { font-size: var(--small); scrollbar-width: none; }
:root[data-mode="small"] body::-webkit-scrollbar { display: none; }
.big-only { }
:root[data-mode="small"] .big-only { display: none !important; }
:root:not([data-mode="small"]) .small-only { display: none !important; }

/* ---------- the two grounds ---------- */
/* the small card's sheet (section 50, Get-GlassBrush in window.ps1): the sheen over the panel colour, top down, gone by 55 %. The host
   asks Windows for the acrylic blur behind the window; the page paints the sheet itself so the look never depends on the host. */
.glass-sheet { background: linear-gradient(to bottom, var(--glass-sheen) 0%, transparent 55%), var(--glass-blur); }
/* the larger view's ground (section 51, Get-GroundBrush): warm paper, Ground0 at the top to Ground1 at the bottom, opaque */
.paper-ground { background: linear-gradient(to bottom, var(--ground0), var(--ground1)); }
/* the body takes the ground of the card it is in */
:root[data-mode="small"] body { background: linear-gradient(to bottom, var(--glass-sheen) 0%, transparent 55%), var(--glass-blur); }
:root:not([data-mode="small"]) body { background: linear-gradient(to bottom, var(--ground0), var(--ground1)); }
/* the glass-in layer (section 50 / 51): what is set into the sheet or stands on the paper, a panel, a well, a control at rest / under the pointer */
.glass-in { background: var(--glass-in); border: 1px solid var(--glass-in-edge); border-radius: var(--radius-control); }
.glass-in:hover { background: var(--glass-in-hover); }
.panel { background: var(--glass-in); border: 1px solid var(--glass-in-edge); border-radius: var(--radius-panel); padding: var(--panel-pad); }

/* =====================================================================================================================
   COMPONENTS, ported from Mingo. Every number is the WPF one. Hover = GlassIn -> GlassInHover (Set-Hover's rule); "this one"
   = Current (SPEC section 21); a disabled control = opacity .35 (Theme.DisabledOpacity, theme.ps1 'Pressable' line 301), never a
   colour change; every clickable thing shows the hand cursor and takes no keyboard focus ring except the switch and the text box.
   ===================================================================================================================== */

/* --- the scroll bar (theme.ps1 279-298): a 6 px capsule thumb in an 8 px lane, no arrows ------------------------------------- */
.rg-scroll { overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--thumb) transparent; }
.rg-scroll::-webkit-scrollbar { width: var(--scroll-lane); background: transparent; }
.rg-scroll::-webkit-scrollbar-thumb { background: var(--thumb); border-radius: 3px; border: 1px solid transparent; background-clip: padding-box; }
.rg-scroll::-webkit-scrollbar-button { display: none; }
/* --- the scroll edge (lib\ui.ps1 Set-ScrollFade, the 'PageScroll' template; SPEC section 91, 2026-11-06): a scroller with more content beyond
   an edge fades its content out over the last --scroll-fade at that edge, into whatever ground lies behind it; nothing fades while the content
   fits, at the top while at the top, at the end once the end is reached. Native: two strips of the ground over the content. Here: a mask on the
   scroller, so the ground behind shows through - the mask's two lengths are driven by the scroller's own scroll position (scroll-driven
   animations, Chromium 115+: the WebView2 runtime and Chrome), no script. Each animation runs over the first / last --scroll-fade of scrolling
   and holds its end values outside that range; no scrollable overflow = no timeline = the initial 0px, i.e. no mask at all. */
@property --rg-fade-top { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --rg-fade-end { syntax: '<length>'; inherits: false; initial-value: 0px; }
.rg-scroll { mask-image: linear-gradient(to bottom, transparent 0, #000 var(--rg-fade-top), #000 calc(100% - var(--rg-fade-end)), transparent 100%); }
@supports (animation-timeline: scroll()) {
  .rg-scroll { animation: rg-fade-top linear both, rg-fade-end linear both; animation-timeline: scroll(self); animation-range: 0 var(--scroll-fade), calc(100% - var(--scroll-fade)) 100%; }
}
@keyframes rg-fade-top { from { --rg-fade-top: 0px; } to { --rg-fade-top: var(--scroll-fade); } }
@keyframes rg-fade-end { from { --rg-fade-end: var(--scroll-fade); } to { --rg-fade-end: 0px; } }

/* --- the rail (ui\rail.ps1 48-91; the 'RailButton' style, theme.ps1 316-339) --------------------------------------------------
   a floating glass sheet (Get-GlassBrush -Blur: the sheen over the thin sheet) inside the GlassInEdge hairline at RadiusRail, RailInset
   clear of the window's left / top / bottom edge, RailWidth wide, padding 0,5; items at the top, Settings at the bottom. An item = an
   18 px line symbol (Theme.Icon, 1.5 px round strokes, no fill) + a 6 px gap + its label at RailLabel 13, both Fg2; margin 4,1; padding
   6,5,4,5; radius 8. Hover (the OTHER items only): GlassIn. Current: GlassInHover inside the hairline, label AND symbol Current. */
.rg-rail { width: var(--rail-width); flex: 0 0 var(--rail-width); margin: var(--rail-inset) 0 var(--rail-inset) var(--rail-inset); padding: 5px 0;
  display: flex; flex-direction: column; border-radius: var(--radius-rail); border: 1px solid var(--glass-in-edge);
  background: linear-gradient(to bottom, var(--glass-sheen) 0%, transparent 55%), var(--glass-blur); box-shadow: inset 0 1px 0 var(--glass-in-hi); }
.rg-rail-bottom { margin-top: auto; }
.rg-rail-item { display: flex; align-items: center; gap: 6px; margin: 1px 4px; padding: 5px 4px 5px 6px; border-radius: var(--radius-control);
  border: 1px solid transparent; background: transparent; color: var(--fg2); font-size: 13px; cursor: pointer; text-align: left; width: calc(100% - 8px); user-select: none; }
.rg-rail-item:hover { background: var(--glass-in); }
.rg-rail-item[aria-current="page"] { background: var(--glass-in-hover); border-color: var(--glass-in-edge); color: var(--current); cursor: default; }
.rg-rail-item svg { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
/* the page beside the rail (theme.ps1 Size line 170; lib\ui.ps1 Get-PageMargin 659): content starts PagePad right of the rail's gap and PageTop
   under the title bar, and ends PagePad + ScrollLane from the window's right edge; panels are PanelGap apart */
.rg-pages { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rg-page { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: var(--page-top) calc(var(--page-pad) + var(--scroll-lane)) 16px var(--page-pad); }
.rg-page-head { font-size: var(--empty); font-weight: 600; margin-bottom: 10px; }

/* --- glyphs x < > (lib\ui.ps1 New-GlyphIcon 205-227; SPEC section 65): a path, Stretch Fill, centred by layout, 1.5 px round strokes,
   sized from the font size it replaced: x = 0.5 x size square, a chevron 0.6 x size tall and half as wide. Stroke = currentColor, so the
   button's hover colour and disabled look carry. Markup: <svg class="rg-glyph" viewBox="0 0 1 1"><path d="M0,0 L1,1 M1,0 L0,1"/></svg> (x),
   viewBox "0 0 1 2" with d="M1,0 L0,1 L1,2" (<) or "M0,0 L1,1 L0,2" (>); set --glyph-size to the font size, default Small 12. */
.rg-glyph { --glyph-size: 12px; display: inline-block; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke; overflow: visible; pointer-events: none; }
.rg-glyph path { vector-effect: non-scaling-stroke; }
.rg-glyph.x { width: calc(var(--glyph-size) * 0.5); height: calc(var(--glyph-size) * 0.5); }
.rg-glyph.chevron { height: calc(var(--glyph-size) * 0.6); width: calc(var(--glyph-size) * 0.3); }

/* --- buttons ---------------------------------------------------------------------------------------------------------------------
   SHAPE SAYS THE KIND (the owner, 2026-11-13; Mingo SPEC section 51 "Button shape"): a button that performs a command is a rounded RECTANGLE -
   --radius-button 8 under 40 px tall, --radius-button-large 10 from 40 px (an app's own taller button reads it) -, and the capsule stays for chips, segments, status
   buttons, the back link and the icon-only round buttons (.rg-icon, .rg-close, the chat's send / stop / latest).
   Action (theme.ps1 'Action'; lib\ui.ps1 New-IconButton): 24 px tall, the glass-in fill inside its hairline, Small Fg2, padding 10,0,
   min width 24; hover = GlassInHover and Fg. .rg-btn-bare = Background Transparent: no fill, no hairline until the pointer is over it.
   Primary (466-488; the setup page's Start, section 54): the ONE filled button, StatusLarge 30 tall, RadiusButton 8, Current with Base
   text, SemiBold Body, min width 88, padding 18,0; CurrentHover under the pointer. A destructive button: ErrorText, and armed by a first
   click (Ridge standard) = the ErrorText fill with Base text until it is clicked again or 3 s pass. */
.rg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 24px; min-width: 24px; padding: 0 10px;
  border-radius: var(--radius-button); border: 1px solid var(--glass-in-edge); background: var(--glass-in); color: var(--fg2); font-size: var(--small);
  cursor: pointer; white-space: nowrap; user-select: none; }
.rg-btn:hover { background: var(--glass-in-hover); border-color: var(--glass-in-edge); color: var(--fg); }
.rg-btn:disabled, .rg-btn[aria-disabled="true"] { opacity: .35; cursor: default; pointer-events: none; }
.rg-btn-bare { background: transparent; border-color: transparent; }
.rg-btn-primary { height: 30px; min-width: 88px; padding: 0 18px; border-radius: var(--radius-button); background: var(--current); border-color: var(--current);
  color: var(--base); font-size: var(--body); font-weight: 600; }
.rg-btn-primary:hover { background: var(--current-hover); border-color: var(--current-hover); color: var(--base); }
.rg-btn-danger { color: var(--error-text); }
.rg-btn-danger:hover { color: var(--error-text); }
.rg-btn-danger[data-armed="1"] { background: var(--error-text); border-color: var(--error-text); color: var(--base); }
.rg-btn.rg-icon { width: 24px; padding: 0; border-radius: var(--radius-capsule); }   /* icon-only: stays round */
/* the round x of a title line (expanded.ps1 76-78: Size.Close 16 in a CloseButton 26 disc, Flat look) */
.rg-close { width: var(--close-button); height: var(--close-button); min-width: 0; padding: 0; border-radius: 50%; }
.rg-close .rg-glyph { --glyph-size: var(--close); }

/* --- chips (theme.ps1 'Chip' 381-401; lib\ui.ps1 New-Checkbox 519 / New-RadioChip 568): a capsule of the glass-in fill inside its hairline, padding
   3,10, Small Fg2, margin 0,0,6,6; hover GlassInHover; checked = a Current hairline and Fg text. One class for a <button aria-pressed>, a
   <label> around a hidden input, or a static tag. */
.rg-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--radius-capsule); border: 1px solid var(--glass-in-edge);
  background: var(--glass-in); color: var(--fg2); font-size: var(--small); cursor: pointer; user-select: none; white-space: nowrap; }
.rg-chip:hover { background: var(--glass-in-hover); }
.rg-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.rg-chip[aria-pressed="true"], .rg-chip:has(input:checked), .rg-chip.is-on { border-color: var(--current); color: var(--fg); }
.rg-chip.rg-static { cursor: default; }
.rg-chip.rg-static:hover { background: var(--glass-in); }
.rg-chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* --- the segmented control (lib\ui.ps1 New-SegmentTrack 768-790; theme.ps1 'Segment' 402-422): a capsule track of the glass-in fill inside its
   hairline, padding 2, RadiusTrack 14; a segment SegmentHeight 22, padding 10,0, RadiusSegment 11, bare at rest, GlassIn under the pointer; the
   selected one is the raised capsule (GlassInHover inside the hairline) with its label in Current. .rg-stretch shares the width equally. */
.rg-track { display: inline-flex; padding: 2px; border-radius: var(--radius-track); border: 1px solid var(--glass-in-edge); background: var(--glass-in); }
.rg-track.rg-stretch { display: flex; }
.rg-track.rg-stretch > .rg-segment { flex: 1; }
.rg-segment { height: var(--segment-height); padding: 0 10px; border-radius: var(--radius-segment); border: 1px solid transparent; background: transparent;
  color: var(--fg2); font-size: var(--small); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; user-select: none; white-space: nowrap; }
.rg-segment:hover { background: var(--glass-in); }
.rg-segment[aria-pressed="true"], .rg-segment.is-on, .rg-segment:has(input:checked) { background: var(--glass-in-hover); border-color: var(--glass-in-edge); color: var(--current); }

/* --- the switch (theme.ps1 489-521; lib\ui.ps1 New-Switch 526): a SwitchWidth x SwitchHeight track, CardBg2 in an Edge hairline, the Knob Fg3 at the
   left with 2 px air; on = the track Current (never green: green means Known), the knob Base at the right; the knob jumps, no animation. Hover:
   the knob Fg2. Keyboard focus = a Current ring 1.5 px at -3, radius 12. ONLY the switch is the hit target: its row label carries no handler.
   Markup: <label class="rg-switch-row"><span>Label</span><span class="rg-switch"><input type="checkbox"><i></i></span></label> */
.rg-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px; font-size: var(--body); color: var(--fg); }
.rg-switch-row > span:first-child { pointer-events: none; }
.rg-switch { position: relative; display: inline-block; width: var(--switch-width); height: var(--switch-height); flex: 0 0 auto; cursor: pointer; }
.rg-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.rg-switch i { position: absolute; inset: 0; border-radius: 9px; background: var(--card-bg2); border: 1px solid var(--edge); pointer-events: none; }   /* the drawn track: the click goes to the input under it (2026-11-10: it sat on top and swallowed every click) */
.rg-switch i::after { content: ""; position: absolute; top: 50%; left: 2px; width: var(--knob); height: var(--knob); margin-top: calc(var(--knob) / -2); border-radius: 50%; background: var(--fg3); }
.rg-switch:hover i::after { background: var(--fg2); }
.rg-switch input:checked + i { background: var(--current); border-color: var(--current); }
.rg-switch input:checked + i::after { left: auto; right: 2px; background: var(--base); }
.rg-switch input:focus-visible + i { outline: 1.5px solid var(--current); outline-offset: 3px; }

/* --- the radio ring (theme.ps1 'Radio' 443-465, the shared 'Knob' template 312-315): a Knob 14 ellipse, empty with an Fg3 ring at RingStroke 1.5 at
   rest, Fg2 under the pointer; checked = a Current ring KnobRing 4.5 thick around a Base centre (the slider thumb's look). The whole cell is the click. */
.rg-radio { display: inline-flex; align-items: center; justify-content: center; min-height: 30px; cursor: pointer; }
.rg-radio input { position: absolute; opacity: 0; width: 0; height: 0; }
.rg-radio i { width: var(--knob); height: var(--knob); border-radius: 50%; border: var(--ring-stroke) solid var(--fg3); background: transparent; }
.rg-radio:hover i { border-color: var(--fg2); }
.rg-radio input:checked + i { border: var(--knob-ring) solid var(--current); background: var(--base); }

/* --- the slider (theme.ps1 522-562; SPEC section 36): a 2 px Line rail filled Current up to the thumb, the Base Knob with its Current ring, one small
   Fg3 tick per stop under it and NO stop labels: one label under the thumb, centred and clamped to the rail's ends. The thumb's 7 px radius is reserved
   at both ends, so stop i of n sits at 7 + i / (n - 1) x (width - 14). The fill needs the value: the app sets --pct (0..1) on the input (one line of
   JS on input), and places the label at left: calc(7px + var(--pct) * (100% - 14px)). Markup:
   <div class="rg-slider"><input type="range" min max step style="--pct:.5"><div class="rg-ticks"><i></i>...</div><span class="rg-slider-label">Every 10 minutes</span></div> */
.rg-slider { position: relative; padding-bottom: 18px; }
.rg-slider input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; margin: 0; background: transparent; cursor: pointer; display: block; }
.rg-slider input[type="range"]::-webkit-slider-runnable-track { height: 2px; border-radius: 1px; margin: 0 7px;
  background: linear-gradient(to right, var(--current) 0, var(--current) calc(var(--pct, 0) * 100%), var(--line) calc(var(--pct, 0) * 100%), var(--line) 100%); }
.rg-slider input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: var(--knob); height: var(--knob); border-radius: 50%; margin-top: -6px;
  background: var(--base); border: var(--knob-ring) solid var(--current); box-sizing: border-box; }
.rg-ticks { display: flex; justify-content: space-between; margin: 0 7px; height: 4px; }
.rg-ticks i { width: 1px; height: 4px; background: var(--fg3); }
.rg-slider-label { position: absolute; top: 24px; left: calc(7px + var(--pct, 0) * (100% - 14px)); transform: translateX(-50%); font-size: var(--small); color: var(--fg2); white-space: nowrap; pointer-events: none; }
.rg-slider-label.at-start { left: 0; transform: none; }
.rg-slider-label.at-end { left: auto; right: 0; transform: none; }

/* --- the text box (theme.ps1 'EditBox' 563-593): a 30 px capsule of the glass-in fill inside its hairline (RadiusEdit 15), padding 4,8, Body Fg, caret
   Fg, selection Current; hover GlassInHover; focus = GlassInHover with a Current hairline and no other ring. A multi-line box (.rg-edit-area) keeps the
   look at RadiusPanel. A <select> is the same capsule with its own arrow. */
.rg-edit { width: 100%; height: 30px; padding: 4px 8px; border-radius: var(--radius-edit); border: 1px solid var(--glass-in-edge); background: var(--glass-in);
  color: var(--fg); caret-color: var(--fg); font-size: var(--body); outline: none; }
.rg-edit::selection { background: var(--current); color: var(--base); }
.rg-edit::placeholder { color: var(--fg3); }
.rg-edit:hover { background: var(--glass-in-hover); }
.rg-edit:focus, .rg-edit:focus-within { background: var(--glass-in-hover); border-color: var(--current); }
textarea.rg-edit, .rg-edit-area { height: auto; min-height: 56px; border-radius: var(--radius-panel); padding: 7px 10px; resize: vertical; line-height: 1.4; }
select.rg-edit { width: auto; padding-right: 26px; appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><path d='M2.5,3.75 L5,6.25 L7.5,3.75' fill='none' stroke='%238A8F9A' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 10px 10px; }

/* --- panels and tiles (lib\ui.ps1 New-GlassPanel 741-760; theme.ps1 'Tile' 423-442): the glass-in fill inside its 1 px hairline at RadiusPanel 12, one inner top
   highlight line (GlassInHi), content inset PanelPad; a tile is a panel that is a choice: GlassInHover under the pointer, checked = the raised fill inside a
   Current hairline. Text standing on the ground beside a panel is inset TextInset so it shares the panel text's left edge. */
.rg-panel { background: var(--glass-in); border: 1px solid var(--glass-in-edge); border-radius: var(--radius-panel); padding: var(--panel-pad); box-shadow: inset 0 1px 0 var(--glass-in-hi); }
.rg-panel + .rg-panel { margin-top: var(--panel-gap); }
.rg-tile { display: block; width: 100%; text-align: left; background: var(--glass-in); border: 1px solid var(--glass-in-edge); border-radius: var(--radius-panel); padding: 8px 10px;
  box-shadow: inset 0 1px 0 var(--glass-in-hi); color: var(--fg); cursor: pointer; }
.rg-tile:hover { background: var(--glass-in-hover); }
.rg-tile[aria-pressed="true"], .rg-tile:has(input:checked) { background: var(--glass-in-hover); border-color: var(--current); }
.rg-tile input, .rg-segment input { position: absolute; opacity: 0; width: 0; height: 0; }
.rg-text-inset { padding-left: var(--text-inset); }
.rg-separator { height: 1px; background: var(--line); margin: 12px 0 10px; }

/* the host-provided General group (ridge-shell.js generalSettings; README "Big card layout"): the group title like Mingo's
   New-SettingsTitle (ui\settings.ps1: Body, 600, TextInset left, 6 under), its panel at Get-PanelPadding 6 6, the hairline at
   New-Separator 0,4,0,4, and the usual PanelGap before the app's own first panel */
.rg-general-head { font-size: var(--body); font-weight: 600; color: var(--fg); margin: 0 0 6px var(--text-inset); }
.rg-general > .rg-panel { padding: 6px var(--panel-pad); }
.rg-general .rg-separator { margin: 4px 0; }
.rg-general + .rg-panel { margin-top: var(--panel-gap); }

/* --- a list row with a status strip (SPEC section 59; ui\glossary-list.ps1): a 3 px strip at the row's left edge in the STATUS colour (Learning = Warn, Known = Good,
   New = none) and nothing dimmed; here as data-status on the row: warn / good / current / accent. The row itself is a quiet line, GlassIn under the pointer. */
.rg-row { position: relative; display: flex; align-items: baseline; gap: 8px; padding: 6px 10px 6px 13px; border-radius: var(--radius-control); }
.rg-row:hover { background: var(--glass-in); }
.rg-row::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 3px; border-radius: 2px; background: transparent; }
.rg-row[data-status="warn"]::before { background: var(--warn); }
.rg-row[data-status="good"]::before { background: var(--good); }
.rg-row[data-status="current"]::before { background: var(--current); }
.rg-row[data-status="accent"]::before { background: var(--accent); }

/* --- the status capsule and dots (theme.ps1 'StatusButton' 608-631, 'StatusDot' 632-654; lib\ui.ps1 New-StatusToggle 858): the 30 px Learning / Known word
   button = a RadiusStatus capsule of the glass-in fill, Fg2, GlassInHover + Fg under the pointer when not checked; checked = the status colour's fill
   (Theme.Status: learning Warn, known Good) with Ink / Base text. A dot = a 14 px hit area around a 9 px ring, Fg3 at RingStroke, Fg under the pointer,
   filled with the status colour when it is the one. */
.rg-status-btn { height: 30px; padding: 0 11px; border-radius: var(--radius-status); border: 1px solid var(--glass-in-edge); background: var(--glass-in); color: var(--fg2); font-size: var(--body); cursor: pointer; }
.rg-status-btn:hover { background: var(--glass-in-hover); color: var(--fg); }
.rg-status-btn[aria-pressed="true"][data-status="warn"] { background: var(--warn); border-color: var(--warn); color: var(--ink); }
.rg-status-btn[aria-pressed="true"][data-status="good"] { background: var(--good); border-color: var(--good); color: var(--base); }
.rg-dot { width: 14px; height: 14px; padding: 0; border: none; background: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.rg-dot i { width: 9px; height: 9px; border-radius: 50%; border: var(--ring-stroke) solid var(--fg3); background: transparent; }
.rg-dot:hover i { border-color: var(--fg); }
.rg-dot[aria-pressed="true"][data-status="warn"] i { background: var(--warn); border-color: var(--warn); }
.rg-dot[aria-pressed="true"][data-status="good"] i { background: var(--good); border-color: var(--good); }
.rg-dot[aria-pressed="true"][data-status="new"] i { background: var(--fg3); border-color: var(--fg3); }

/* --- the back link (SPEC section 64, expanded.ps1 BackButton): a BARE Flat button on the title line's left, a chevron path + the page's name at Body, Fg2, Fg
   under the pointer, margin PagePad - 10 so its text starts on the pages' left edge; shown only after a click into a sub-page. */
.rg-back { display: inline-flex; align-items: center; gap: 8px; height: 24px; padding: 0 10px; margin-left: calc(var(--page-pad) - 10px); border-radius: var(--radius-capsule);
  border: 1px solid transparent; background: transparent; color: var(--fg2); font-size: var(--body); cursor: pointer; }
.rg-back:hover { background: var(--glass-in-hover); border-color: var(--glass-in-edge); color: var(--fg); }
.rg-back .rg-glyph { --glyph-size: 15px; transform: translateY(1px); }

/* --- the tooltip / plate (theme.ps1 'ToolTip' 677-690; SPEC section 51): an OPAQUE Field plate inside the Edge hairline, RadiusTip 10, padding 9,4,9,5, Small Fg;
   no shadow. Also the toast and the chart tip. */
.rg-plate { background: var(--field); border: 1px solid var(--edge); border-radius: var(--radius-tip); padding: 4px 9px 5px; font-size: var(--small); color: var(--fg); }
/* the one tooltip (ridge-tip.js; Mingo's ToolTip style, theme.ps1 677-689: opaque Field plate, Edge hairline, RadiusTip,
   padding 9,4,9,5, Small, Fg, no shadow). Shown at once on hover or focus for any [data-tip]; never a native title tooltip. */
.rg-tip { position: fixed; z-index: 2147483000; max-width: min(360px, calc(100vw - 12px)); pointer-events: none;
  background: var(--field); border: 1px solid var(--edge); border-radius: var(--radius-tip); padding: 4px 9px 5px;
  font-size: var(--small); line-height: 1.35; color: var(--fg); white-space: normal; overflow-wrap: break-word; }
.rg-tip[hidden] { display: none; }

/* --- text states ---------------------------------------------------------------------------------------------------------------------------------- */
.rg-empty { color: var(--fg3); font-size: var(--empty); text-align: center; margin: auto; max-width: 28ch; }
.rg-pending { color: var(--fg2); }
.rg-error { color: var(--error-text); }
.rg-ok { color: var(--good-text); }
/* A PAGE APPEARS WHOLE (ridge-shell.js header, 2026-11-14): a page laid out while it draws is unseen (the page before it stays on the
   screen; ridge-shell sets `inert` too), and a slow draw past 400 ms shows one centered line on the page ground, in normal ink */
[data-ridge-pending] { opacity: 0 !important; }
.rg-loading { flex: 1; display: flex; align-items: center; justify-content: center; margin: 0; padding: 0 var(--page-pad);
  color: var(--fg); font-size: var(--empty); text-align: center; pointer-events: none; }
.rg-note { color: var(--fg3); font-size: var(--note); }
.rg-small { color: var(--fg2); font-size: var(--small); }

/* --- a chat bubble (no Mingo source; built from the tokens: hers = the glass-in panel at RadiusPanel, mine = the CurrentTint plate) ----------------- */
.rg-bubble { max-width: 82%; padding: 6px 10px; border-radius: var(--radius-panel); line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere; }
.rg-bubble.them { background: var(--glass-in); border: 1px solid var(--glass-in-edge); align-self: flex-start; border-bottom-left-radius: 4px; }
.rg-bubble.me { background: var(--current-tint); border: 1px solid transparent; align-self: flex-end; border-bottom-right-radius: 4px; }

/* --- the AI chat pane (ridge-chat.js; lifted from Wingo app/ui/app.css 187-273 "The AI pane" / "the answer, inside the AI pane", 2026-11-04;
   the "Mingo chat circle" mockup's pick box). The pane's INSIDE and its panel look: the app owns where it stands, its width and how it
   arrives (Wingo's .coach keeps the slide-in and the width). Top to bottom: the head (Clear chat, the x), the log, the arrow back to
   the latest, the preset row (only when the app gave presets), the composer. ----------------------------------------------------- */
/* the panel (app.css 188: a floating glass pane, the rail's twin) */
.rg-chat { position: relative; box-sizing: border-box; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px;
  border-radius: var(--radius-panel); border: 1px solid var(--glass-in-edge); background: var(--glass-in-hover); box-shadow: 0 4px 14px rgba(0, 0, 0, .12), inset 0 1px 0 var(--glass-in-hi); }
/* the head (app.css 192-195): Clear chat at the left, the x in the pane's corner */
.rg-chat-head { display: flex; align-items: center; min-height: 26px; padding-right: 32px; margin: -2px 0 -4px 0; }
.rg-chat-close { position: absolute; top: 9px; right: 9px; color: var(--fg2); z-index: 1; }
.rg-chat-clear[hidden] { display: none; }
/* the log (app.css 213, 245-260): a scrolling column of entries, nothing in it squeezed to fit (a long answer once crushed the
   bubble above it to a sliver); no scroll anchoring, the browser would pull the view down with an answer still being written;
   overflow-y alone turns the other axis to auto, so a chip too wide once slid the pane sideways */
.rg-chat-body { position: relative; flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
.rg-chat-log { flex: 1 1 0; min-height: 0; padding: 2px 6px 4px 2px; overflow-anchor: none; overflow-x: hidden; display: flex; flex-direction: column; gap: 7px; position: relative; }
.rg-chat-log > * { flex-shrink: 0; }
.rg-chat-entry { min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.rg-chat-entry > * { flex-shrink: 0; }
.rg-chat-entry + .rg-chat-entry { margin-top: 14px; }
/* the empty pane (app.css 222-226): the AI mark (Ridge's one sign for the model) and one centred line, data-empty (setEmpty) */
.rg-chat-log:empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.rg-chat-log:empty::before { content: ""; width: 26px; height: 26px; background: var(--fg3); opacity: .7;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none' stroke='black' stroke-width='1.1' stroke-linejoin='round'%3E%3Cpath d='M8,3.5 C8.4,7 9.5,8.6 13.5,10 C9.5,11.4 8.4,13 8,16.5 C7.6,13 6.5,11.4 2.5,10 C6.5,8.6 7.6,7 8,3.5 Z'/%3E%3Cpath d='M14,1.8 C14.2,3.4 14.6,3.9 16.2,4.3 C14.6,4.7 14.2,5.2 14,6.8 C13.8,5.2 13.4,4.7 11.8,4.3 C13.4,3.9 13.8,3.4 14,1.8 Z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none' stroke='black' stroke-width='1.1' stroke-linejoin='round'%3E%3Cpath d='M8,3.5 C8.4,7 9.5,8.6 13.5,10 C9.5,11.4 8.4,13 8,16.5 C7.6,13 6.5,11.4 2.5,10 C6.5,8.6 7.6,7 8,3.5 Z'/%3E%3Cpath d='M14,1.8 C14.2,3.4 14.6,3.9 16.2,4.3 C14.6,4.7 14.2,5.2 14,6.8 C13.8,5.2 13.4,4.7 11.8,4.3 C13.4,3.9 13.8,3.4 14,1.8 Z'/%3E%3C/svg%3E") center / contain no-repeat; }
.rg-chat-log:empty::after { content: attr(data-empty); max-width: 28ch; text-align: center; color: var(--fg3); font-size: var(--empty); }
/* the drop (the mockup's E2, the owner's rule 2026-11-04): while a picture is dragged over the pane an OPAQUE sheet of the Field
   surface covers the whole log, a dashed Current outline and one centred line; nothing shows through it, not the empty line and not a
   chat. Gone the moment the drag leaves. */
.rg-chat-drop { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; box-sizing: border-box; background: var(--field);
  border: 1.5px dashed var(--current); border-radius: var(--radius-panel); color: var(--current); font-weight: 600; pointer-events: none; }
.rg-chat-drop[hidden] { display: none; }
/* the question as my bubble over the answer (app.css 270-272); a picture pasted with it stands above the bubble, at my side */
.rg-chat-about { align-self: flex-end; max-width: 92%; white-space: pre-wrap; }
.rg-chat-shot { align-self: flex-end; max-width: 78%; max-height: 190px; width: auto; height: auto; object-fit: contain; border-radius: 10px; border: 1px solid var(--glass-in-edge); }
/* the waiting line under the question until the first word (ridge-chat.js `thinking`; the owner 2026-11-04: "like the thinking that flashes"):
   Wingo's app.css 309-316 shimmer, shared - the text in fg3 with a band of fg passing through it left to right, a gradient three text widths
   wide clipped to the glyphs, 1.8 s linear for ever; under reduced motion a plain fg2 line. Wingo's own .pending-view rule, the same recipe,
   still stands for its Odds / Rate lines. Native twin: lib\ui.ps1 New-RidgeChatPending (Theme.Thinking, Size.ChatThinkingMs). */
.rg-chat .rg-pending { align-self: flex-start; color: transparent;
  background: linear-gradient(90deg, var(--fg3) 0%, var(--fg3) 35%, var(--fg) 50%, var(--fg3) 65%, var(--fg3) 100%) 0 0 / 300% 100%;
  -webkit-background-clip: text; background-clip: text; animation: rg-shimmer 1.8s linear infinite; }
@keyframes rg-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .rg-chat .rg-pending { animation: none; color: var(--fg2); background: none; } }
/* the answer as running text (app.css 262-265). While it is being written there is no caret: ridge-stream.js shows it in whole
   words that fade in (each word a span.rg-unit, the fade its own animation, nothing to style here) */
.rg-chat-answer { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
/* away from the bottom of the chat: a round arrow over the pane's lower edge goes back to the latest (app.css 215-221) */
.rg-chat-latest-row { position: relative; height: 0; margin-top: -8px; }
.rg-chat-latest { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); width: 28px; height: 28px; min-width: 0; padding: 0; border-radius: 50%;
  background: var(--card-bg); border-color: var(--glass-in-edge); color: var(--fg2); box-shadow: 0 2px 8px rgba(0, 0, 0, .16); }
.rg-chat-latest:hover { background: var(--card-bg); color: var(--fg); }
.rg-chat-latest[hidden] { display: none; }
.rg-chat-latest svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* the preset row (app.css 14, 202, 210-211: Wingo's .row + .coach .presets): the app's capsules over a hairline; a pressed one is Current */
.rg-chat-presets { display: flex; align-items: center; gap: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.rg-chat-presets > .rg-btn { flex: 0 0 auto; padding: 0 9px; }
.rg-chat-presets > .rg-btn[aria-pressed="true"] { border-color: var(--current); color: var(--current); background: var(--current-tint); }
/* the composer (app.css 203-209, 240-241): the pasted thumbnail with its x, the box growing from one line to four (ridge-chat.js
   boxHeight), the round Send, Stop in its place while an answer is being written */
.rg-chat-composer { display: flex; align-items: flex-end; gap: 6px; }
.rg-chat-attach { display: inline-flex; align-items: center; gap: 4px; align-self: center; }
.rg-chat-attach[hidden] { display: none; }
.rg-chat-attach img { height: 28px; width: auto; border-radius: 4px; border: 1px solid var(--glass-in-edge); }
.rg-chat-composer textarea.rg-chat-box { flex: 1; min-width: 0; height: 32px; min-height: 32px; max-height: 112px; padding: 6px 12px; line-height: 1.4; resize: none; overflow-y: auto; border-radius: 16px; }
.rg-chat-send, .rg-chat-stop { flex: none; width: 32px; height: 32px; min-width: 0; padding: 0; border-radius: 50%; display: grid; place-items: center; }
.rg-chat-send[hidden], .rg-chat-stop[hidden] { display: none; }
.rg-chat-send svg, .rg-chat-stop svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rg-chat-stop svg { fill: currentColor; stroke: none; }
/* "Clear chat?" (app.css 196-201): asked before the chat is cleared, the way chat apps ask before deleting one: a question, Cancel
   and the red action, over a dimmed backdrop */
.rg-chat-ask { box-sizing: border-box; width: 260px; padding: 16px; border-radius: var(--radius-panel); border: 1px solid var(--glass-in-edge); background: var(--base); color: var(--fg); box-shadow: 0 10px 30px rgba(0, 0, 0, .28); }
.rg-chat-ask::backdrop { background: rgba(0, 0, 0, .28); }
.rg-chat-ask p { margin: 0 0 14px; font-weight: 600; }
.rg-chat-ask-row { display: flex; justify-content: flex-end; gap: 8px; }
.rg-chat-ask .rg-btn { height: 28px; padding: 0 14px; }
.rg-chat-ask-yes, .rg-chat-ask-yes:hover { background: var(--error-text); border-color: var(--error-text); color: var(--base); }

/* the notice (ui/toast.js; Ridge's Show-RidgeToast): bottom right, one at a time, the line under it empties toward the left */
.rg-toast { position: fixed; right: 16px; z-index: 80; width: min(320px, calc(100vw - 32px)); box-sizing: border-box; overflow: hidden;
  background: var(--field); border: 1px solid var(--edge); border-radius: var(--radius-tip); color: var(--fg); font-size: var(--body); }
.rg-toast-row { display: flex; align-items: center; gap: 8px; padding: 8px 6px 8px 14px; }
.rg-toast-text { flex: 1; min-width: 0; }
.rg-toast-x { width: 26px; height: 26px; padding: 0; border: 0; border-radius: 13px; background: none; color: var(--fg-2); font-size: 16px; line-height: 1; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .rg-toast-x:hover { background: var(--fill-quiet, var(--glass-in)); color: var(--fg); } }
.rg-toast-bar { display: block; height: 2px; background: var(--current); transform-origin: left center; }
