/* spec2 shared styles — /standard and /upgrades. Same palette and type as the main platform.
   Every class is prefixed s2- so page styles never collide. */
:root {
  /* Palette "飘渺香桂": lilac #DDCFDB, beige #DECBB7, mauve #C1ADAD, sage #AFBFAD, yellow #DAC890.
     Each hue has one job, so no single colour takes over the page:
       lilac  = accent: buttons, links, selection, focus          (--s2-accent-*)
       beige  = surfaces: page canvas, washes, category bands      (--s2-canvas, --s2-wash, --s2-beige-*)
       mauve  = information notes and pills, strong borders        (--s2-mauve-*, --s2-line-strong)
       sage   = positive states only: active, done, credit         (--s2-green-*)
       yellow = waiting, warnings, upgrades                        (--s2-amber-*)
     The swatches are used as-is for fills and borders; text uses deeper shades of the same hue (all >= 4.5:1). */
  --s2-canvas: #FAF8F3; --s2-paper: #FFFFFF; --s2-wash: #F6F1EA; --s2-glass: rgba(250, 248, 243, .84);
  --s2-ink: #3B3439; --s2-muted: #6F646B; --s2-faint: #978C92; --s2-on-accent: #FFFFFF;
  --s2-line: #ECE5DF; --s2-line-strong: #D8CCCB;
  --s2-accent: #78617F; --s2-accent-soft: #F3ECF2; --s2-accent-ink: #5B4762; --s2-accent-line: #DDCFDB;
  --s2-green: #5A7360; --s2-green-soft: #E8EFE6; --s2-green-ink: #3E5444; --s2-green-line: #AFBFAD;
  --s2-amber: #82631A; --s2-amber-soft: #F7F0D8; --s2-amber-line: #DAC890; --s2-amber-ink: #5E4A12;
  --s2-mauve: #7D5F62; --s2-mauve-soft: #F4EDEC; --s2-mauve-line: #D5C6C6; --s2-mauve-ink: #5C4346;
  --s2-beige-soft: #F3E9DD; --s2-beige-line: #DECBB7; --s2-beige-ink: #5E4A36;
  --s2-red: #A3352B; --s2-red-soft: #FBEAE7; --s2-red-line: #E2B4AE; --s2-red-ink: #6F1F18;
  /* the five swatches with their text colours, cycled by level number (.lv-h1 ... .lv-h5) */
  --s2-h1: #DDCFDB; --s2-h1-ink: #4F3D55; --s2-h2: #DECBB7; --s2-h2-ink: #5E4A36; --s2-h3: #C1ADAD; --s2-h3-ink: #4A3536;
  --s2-h4: #AFBFAD; --s2-h4-ink: #2F4335; --s2-h5: #DAC890; --s2-h5-ink: #4E3D0C;
  --s2-blend: linear-gradient(90deg, #DDCFDB, #DECBB7 26%, #C1ADAD 50%, #AFBFAD 74%, #DAC890);
  --s2-backdrop: #EEE7DD; --s2-focus: rgba(120, 97, 127, .55); --s2-focus-soft: rgba(120, 97, 127, .12);
  --s2-shade: rgba(59, 52, 57, .38); --s2-shadow: rgba(59, 52, 57, .12); --s2-shadow-soft: rgba(59, 52, 57, .06);
  --s2-shadow-strong: rgba(59, 52, 57, .18);
  /* fine paper grain (plum-grey specks, alpha 0-.14), tiled; laid over gradients to give them a plaster feel */
  --s2-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .36 0 0 0 0 .3 0 0 0 0 .34 .28 0 0 0 -.03'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --s2-radius: 12px;
  --s2-font: "Avenir Next", Avenir, "PingFang SC", "Segoe UI", system-ui, sans-serif;
  --s2-display: var(--s2-font);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* the page: an ivory canvas with a breath of lilac top right and sage bottom left; cards are white paper on top */
body { margin: 0; color: var(--s2-ink); font: 15px/1.55 var(--s2-font); padding-bottom: 72px; background: var(--s2-canvas); }
/* behind everything: four soft pools of palette colour that drift very slowly ... */
body::before { content: ""; position: fixed; inset: -18vmax; z-index: -1; pointer-events: none;
  background: radial-gradient(40vmax 32vmax at 80% 24%, color-mix(in srgb, var(--s2-h1) 62%, transparent), transparent 70%),
              radial-gradient(34vmax 28vmax at 16% 78%, color-mix(in srgb, var(--s2-h4) 38%, transparent), transparent 70%),
              radial-gradient(30vmax 26vmax at 64% 80%, color-mix(in srgb, var(--s2-h5) 24%, transparent), transparent 70%),
              radial-gradient(30vmax 24vmax at 34% 20%, color-mix(in srgb, var(--s2-h2) 36%, transparent), transparent 70%);
  animation: s2-drift 46s ease-in-out infinite alternate; will-change: transform; }
/* ... then flowing lines from the top right (bg-lines.svg) and the paper grain */
body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: url("/spec2/bg-lines.svg?v=2") top right / max(1200px, 78vw) auto no-repeat, var(--s2-grain); }
@keyframes s2-drift { from { transform: translate3d(-3%, -2%, 0) rotate(0deg) scale(1); } to { transform: translate3d(3%, 3%, 0) rotate(9deg) scale(1.1); } }
@keyframes s2-flow { from { background-position: 0 0; } to { background-position: 100% 0; } }
a { color: var(--s2-accent); }
h1 { font: 600 27px/1.25 var(--s2-display); margin: 0 0 4px; letter-spacing: -.015em; text-wrap: balance; }
h2 { font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--s2-accent);
     border-bottom: 1px solid var(--s2-line); padding-bottom: 7px; margin: 34px 0 14px; }
h3 { font-size: 16px; margin: 0 0 6px; }
.s2-muted { color: var(--s2-muted); }
.s2-small { font-size: 12.5px; }
.s2-num { font-variant-numeric: tabular-nums; }
.s2-right { text-align: right; }
.s2-hidden { display: none !important; }

/* top bar */
#s2-bar { position: sticky; top: 0; z-index: 30; background: var(--s2-glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
          border-bottom: 1px solid var(--s2-line);
          display: flex; align-items: center; gap: 6px 16px; padding: 9px 18px; flex-wrap: wrap; }
.s2-brand { color: var(--s2-accent); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.s2-nav { display: flex; gap: 4px; }
.s2-nav a { color: var(--s2-muted); font-weight: 500; font-size: 13.5px; text-decoration: none; padding: 5px 10px; border-radius: 99px; white-space: nowrap; }
.s2-nav a:hover { background: var(--s2-paper); }
.s2-nav a[aria-current="page"] { color: var(--s2-accent-ink); background: var(--s2-accent-soft); font-weight: 600; }
.s2-who { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--s2-muted); flex-wrap: wrap; }
.s2-who b { color: var(--s2-ink); font-weight: 600; }
.s2-as { border: 1px dashed var(--s2-amber-line); background: var(--s2-amber-soft); border-radius: 99px; padding: 2px 4px 2px 10px;
         display: inline-flex; align-items: center; gap: 4px; color: var(--s2-amber); font-weight: 600; }
.s2-as select { border: 0; background: transparent; font: inherit; color: inherit; padding: 2px 2px; cursor: pointer; }

/* layout */
.s2-wrap { max-width: 1320px; margin: 0 auto; padding: 28px 20px; }   /* every page: the same width, so headers line up */
.s2-head { display: flex; gap: 12px 24px; align-items: flex-end; flex-wrap: wrap; position: relative; padding-bottom: 18px; margin-bottom: 22px; }
/* the page rule: the five palette colours melting into each other */
.s2-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 99px;
                  background: var(--s2-blend) 0 0 / 220% 100%; animation: s2-flow 16s ease-in-out infinite alternate; }
/* the page title is inked with the palette's deep shades */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .s2-head h1 { background: linear-gradient(100deg, var(--s2-accent-ink), var(--s2-mauve) 60%, var(--s2-green) 120%);
                -webkit-background-clip: text; background-clip: text; color: transparent; }
}
.s2-head .s2-lede { color: var(--s2-muted); max-width: 64ch; margin: 0; }
.s2-head .s2-actions { margin-left: auto; }
.s2-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.s2-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.s2-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.s2-card { background: var(--s2-paper); border: 1px solid var(--s2-line); border-radius: 16px; padding: 16px 18px; box-shadow: 0 1px 2px var(--s2-shadow-soft); }
a.s2-card, button.s2-card { display: block; text-decoration: none; color: inherit; text-align: left; font: inherit; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
a.s2-card:hover, button.s2-card:hover { border-color: var(--s2-accent-line); box-shadow: 0 8px 22px var(--s2-shadow-soft); }
.s2-kick { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--s2-muted); font-weight: 700; }
.s2-empty { border: 1.5px dashed var(--s2-line-strong); border-radius: 16px; padding: 28px 20px; text-align: center; color: var(--s2-muted); }
/* THE notice component, app-wide: one card (lilac tint, lilac edge, a round icon on the left) for every message,
   in the page (.s2-note) and floating (.s2-toast, S2.toast). Only the icon says what kind it is:
   i lilac = information (.s2-info, and a plain toast), check sage = done (.s2-ok), ! yellow = warning (a plain
   .s2-note, .s2-warn), ! red = error (.s2-err). Never style a message any other way. */
.s2-note, .s2-toast { display: flex; align-items: center; gap: 10px; background: var(--s2-accent-soft); color: var(--s2-ink);
                      border: 1.5px solid var(--s2-accent-line); border-radius: 14px; padding: 10px 16px 10px 12px;
                      font-size: 14px; font-weight: 500; line-height: 1.45; text-align: left; }
.s2-note::before, .s2-toast::before { content: "!"; flex: none; align-self: flex-start; display: inline-grid; place-items: center;
                      width: 22px; height: 22px; margin-top: 1px; border-radius: 99px; font-size: 12.5px; font-weight: 800;
                      background: var(--s2-amber); color: var(--s2-on-accent); }
.s2-note > :not(button):not(.s2-btn) { flex: 1 1 auto; min-width: 0; }
.s2-note[hidden], .s2-note:empty { display: none; }
.s2-note + .s2-note { margin-top: 8px; }
.s2-note.s2-info::before, .s2-toast::before { content: "i"; background: var(--s2-accent); }
.s2-note.s2-info::before, .s2-toast:not(.s2-ok):not(.s2-err):not(.s2-warn)::before { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 700; font-size: 14px; }
.s2-note.s2-ok::before, .s2-toast.s2-ok::before { content: "\2713"; background: var(--s2-green); }
.s2-note.s2-warn::before, .s2-toast.s2-warn::before { content: "!"; background: var(--s2-amber); }
.s2-note.s2-err::before, .s2-toast.s2-err::before { content: "!"; background: var(--s2-red); }
.s2-note.s2-err, .s2-toast.s2-err { color: var(--s2-red-ink); }

/* buttons */
.s2-btn { font: 600 13.5px var(--s2-font); border: 1px solid var(--s2-line-strong); background: var(--s2-paper); color: var(--s2-ink);
          border-radius: 99px; padding: 7px 15px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
          transition: background-color .12s, border-color .12s; }
.s2-btn:hover { border-color: var(--s2-accent-line); background: var(--s2-accent-soft); }
.s2-btn:focus-visible, .s2-nav a:focus-visible, a.s2-card:focus-visible, button.s2-card:focus-visible { outline: 2px solid var(--s2-accent); outline-offset: 2px; }
.s2-btn.s2-primary { background: var(--s2-accent); border-color: transparent; color: var(--s2-on-accent);
                     background-image: linear-gradient(135deg, var(--s2-accent), color-mix(in srgb, var(--s2-accent) 45%, var(--s2-mauve)));
                     background-origin: border-box; box-shadow: 0 3px 12px color-mix(in srgb, var(--s2-accent) 28%, transparent);
                     transition: transform .15s, box-shadow .15s, filter .15s; }
.s2-btn.s2-primary:hover { border-color: transparent; background-color: var(--s2-accent); filter: brightness(.93); transform: translateY(-1px);
                           box-shadow: 0 6px 18px color-mix(in srgb, var(--s2-accent) 36%, transparent); }
.s2-btn.s2-primary:active { transform: none; }
.s2-btn.s2-primary[disabled] { transform: none; box-shadow: none; filter: none; }
.s2-btn.s2-danger { color: var(--s2-red); border-color: var(--s2-red-line); }
.s2-btn.s2-danger:hover { background: var(--s2-red-soft); border-color: var(--s2-red); }
.s2-btn.s2-sm { font-size: 12.5px; padding: 4px 11px; }
.s2-btn.s2-ghost { border-color: transparent; background: none; color: var(--s2-accent); padding-left: 8px; padding-right: 8px; }
.s2-btn.s2-ghost:hover { background: var(--s2-accent-soft); border-color: transparent; }
.s2-btn[disabled] { opacity: .5; cursor: not-allowed; }

/* pills */
.s2-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; padding: 2px 9px; border-radius: 99px;
           background: var(--s2-wash); color: var(--s2-muted); border: 1px solid var(--s2-line); white-space: nowrap; }
.s2-pill.s2-ok { background: var(--s2-green-soft); color: var(--s2-green-ink); border-color: var(--s2-green-line); }
.s2-pill.s2-wait { background: var(--s2-amber-soft); color: var(--s2-amber); border-color: var(--s2-amber-line); }
.s2-pill.s2-late { background: var(--s2-red-soft); color: var(--s2-red); border-color: var(--s2-red-line); }
.s2-pill.s2-info { background: var(--s2-mauve-soft); color: var(--s2-mauve); border-color: var(--s2-mauve-line); }
.s2-pill.s2-upgrade { background: var(--s2-amber-line); color: var(--s2-amber-ink); border-color: var(--s2-amber-line); }
/* level colours: the palette in order, one swatch per level number (shared.js S2.levelHue). The badge carries lv-hN;
   a Level card or a Design Library section takes the swatch of the badge inside it, as --lv / --lv-ink. */
:root { --lv: var(--s2-h1); --lv-ink: var(--s2-h1-ink); }
.lv-h1, :is(.lv-card, .lib-level):has(.lv-h1) { --lv: var(--s2-h1); --lv-ink: var(--s2-h1-ink); }
.lv-h2, :is(.lv-card, .lib-level):has(.lv-h2) { --lv: var(--s2-h2); --lv-ink: var(--s2-h2-ink); }
.lv-h3, :is(.lv-card, .lib-level):has(.lv-h3) { --lv: var(--s2-h3); --lv-ink: var(--s2-h3-ink); }
.lv-h4, :is(.lv-card, .lib-level):has(.lv-h4) { --lv: var(--s2-h4); --lv-ink: var(--s2-h4-ink); }
.lv-h5, :is(.lv-card, .lib-level):has(.lv-h5) { --lv: var(--s2-h5); --lv-ink: var(--s2-h5-ink); }
/* a swatch chip: lit from the top left, with a hairline highlight */
.s2-pill.s2-lv, .lv-badge { background: var(--lv); color: var(--lv-ink); border-color: transparent;
  background-image: linear-gradient(135deg, color-mix(in srgb, var(--lv) 55%, var(--s2-paper)), var(--lv));
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--s2-paper) 70%, transparent), 0 1px 2px var(--s2-shadow); }
.s2-pill.s2-demo { background: var(--s2-paper); color: var(--s2-mauve); border: 1px dashed var(--s2-mauve); }

/* forms */
.s2-field { display: grid; gap: 4px; margin-bottom: 12px; }
.s2-field > span, .s2-label { font-size: 12px; font-weight: 600; color: var(--s2-muted); }
.s2-input, .s2-select, .s2-textarea { font: 14px var(--s2-font); color: var(--s2-ink); background: var(--s2-paper); border: 1px solid var(--s2-line-strong);
          border-radius: 10px; padding: 7px 10px; width: 100%; }
/* our own dropdown arrow (the native one sits flush against the rounded edge): two gradient strokes in the
   muted colour, with room on the right */
.s2-select { -webkit-appearance: none; appearance: none; padding-right: 32px; cursor: pointer;
             background-image: linear-gradient(45deg, transparent 50%, var(--s2-muted) 50%), linear-gradient(135deg, var(--s2-muted) 50%, transparent 50%);
             background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.s2-select:disabled { cursor: default; opacity: .6; }
.s2-input:focus, .s2-select:focus, .s2-textarea:focus { outline: 3px solid var(--s2-focus-soft); outline-offset: 0; border-color: var(--s2-accent); }
.s2-textarea { min-height: 78px; resize: vertical; }
.s2-check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }

/* tables */
.s2-tablewrap { overflow-x: auto; border: 1px solid var(--s2-line); border-radius: var(--s2-radius); background: var(--s2-paper); }
table.s2-table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.s2-table th, .s2-table td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--s2-line); vertical-align: top; }
.s2-table th { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--s2-muted); background: var(--s2-wash); white-space: nowrap; }
.s2-table tr:last-child td { border-bottom: 0; }
.s2-table td.s2-num, .s2-table th.s2-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.s2-table tfoot td { font-weight: 700; background: var(--s2-wash); }
.s2-thumb { width: 54px; height: 54px; object-fit: contain; border-radius: 6px; border: 1px solid var(--s2-line); background: var(--s2-paper); display: block; }
.s2-thumb.s2-none { display: grid; place-items: center; color: var(--s2-faint); font-size: 10px; background: var(--s2-wash); }

/* stepper + tabs */
.s2-steps { display: flex; flex-wrap: wrap; margin: 0 0 22px; padding: 0; list-style: none; counter-reset: s2step; }
.s2-steps button { font: 500 13px var(--s2-font); color: var(--s2-ink); background: var(--s2-wash); padding: 9px 16px; border: 1px solid var(--s2-line); border-left: none; cursor: pointer; }
.s2-steps li:first-child button { border-radius: 10px 0 0 10px; border-left: 1px solid var(--s2-line); }
.s2-steps li:last-child button { border-radius: 0 10px 10px 0; }
.s2-steps button::before { counter-increment: s2step; content: counter(s2step); font: 600 13px var(--s2-display); color: var(--s2-accent); margin-right: 7px; }
.s2-steps button:hover { background: var(--s2-accent-soft); }
.s2-steps button[aria-current="step"] { background: var(--s2-accent-soft); color: var(--s2-accent-ink); border-color: var(--s2-accent-line); font-weight: 600; }
.s2-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--s2-line); margin-bottom: 20px; }
.s2-tabs button { font: 600 13.5px var(--s2-font); background: none; border: 0; border-bottom: 2.5px solid transparent; color: var(--s2-muted); padding: 8px 12px; cursor: pointer; margin-bottom: -1px; }
.s2-tabs button[aria-selected="true"] { color: var(--s2-accent-ink); border-bottom-color: var(--s2-accent); }
.s2-tabs .s2-count { background: var(--s2-red); color: var(--s2-on-accent); border-radius: 99px; font-size: 11px; padding: 0 6px; margin-left: 5px; }

/* modal + toast */
.s2-overlay { position: fixed; inset: 0; background: var(--s2-shade); z-index: 100; display: grid; place-items: center; padding: 16px; }
.s2-modal { background: var(--s2-paper); border-radius: 18px; width: min(520px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 18px 50px var(--s2-shadow-strong); }
.s2-modal.s2-wide { width: min(860px, 100%); }
.s2-modal > header { padding: 16px 20px 0; }
.s2-modal > header h3 { font: 600 19px var(--s2-display); margin: 0; }
.s2-modal > .s2-body { padding: 14px 20px; overflow-y: auto; }
.s2-modal > footer { padding: 12px 20px 16px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--s2-line); }
/* toasts: the notice component, floating high in the middle of the screen */
#s2-toasts { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px;
             justify-items: center; width: max-content; max-width: min(520px, calc(100vw - 32px)); pointer-events: none; }
.s2-toast { pointer-events: auto; min-width: 260px; padding: 12px 18px 12px 14px; font-size: 15px; font-weight: 600;
            border-color: var(--s2-accent); box-shadow: 0 14px 36px var(--s2-shadow-strong); animation: s2-toast-in .2s ease-out; }
.s2-toast::before { width: 24px; height: 24px; font-size: 13px; align-self: center; margin-top: 0; }
@keyframes s2-toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .s2-toast { animation: none; } }

@media (max-width: 640px) {
  .s2-wrap { padding: 20px 16px; }
  h1 { font-size: 24px; }
  .s2-who { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  body::before, .s2-head::after { animation: none; }
  .s2-btn.s2-primary, .s2-btn.s2-primary:hover { transition: none; transform: none; }
}
@media print {
  #s2-bar, .s2-noprint, #s2-toasts { display: none !important; }
  body { padding: 0; background: var(--s2-paper); }
  body::before, body::after { display: none; }
  .s2-head h1 { background: none; color: var(--s2-ink); }
  .s2-head::after { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .s2-wrap { max-width: none; padding: 0; }
}

/* left sidebar (filled by app.js); the top bar keeps the menu toggle and the local test-user switch */
#s2-side { position: fixed; top: 0; left: 0; bottom: 0; width: 232px; border-right: 1px solid var(--s2-line);
           background: var(--s2-grain), linear-gradient(180deg, var(--s2-accent-soft), var(--s2-wash) 46%, var(--s2-green-soft));
           display: flex; flex-direction: column; justify-content: space-between; padding: 18px 12px 14px; overflow-y: auto; z-index: 40; }
.s2-side-nav { display: grid; gap: 2px; align-content: start; }
.s2-side-link { display: flex; align-items: center; gap: 10px; color: var(--s2-muted); font-weight: 500; font-size: 14px; text-decoration: none; padding: 8px 10px; border-radius: 10px; white-space: nowrap; }
.s2-ico { width: 19px; height: 19px; flex: none; }
.s2-brandrow { display: flex; align-items: center; gap: 8px; padding: 0 2px 16px; margin-bottom: 12px; border-bottom: 1px solid var(--s2-accent-line); }
.s2-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--s2-ink); flex: 1; min-width: 0; border-radius: 10px; }
.s2-logo img { width: 40px; height: 40px; flex: none; border-radius: 10px; }
.s2-logotext { display: grid; line-height: 1.2; }
.s2-logotext b { font-size: 17px; font-weight: 600; color: var(--s2-ink); letter-spacing: -.01em; }
.s2-logotext small { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--s2-faint); }
.s2-railbtn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--s2-faint); cursor: pointer; }
.s2-railbtn:hover { background: var(--s2-glass); color: var(--s2-ink); }
.s2-logo:focus-visible, .s2-railbtn:focus-visible { outline: 2px solid var(--s2-accent); outline-offset: 2px; }
a.s2-side-link:hover { background: var(--s2-glass); }
a.s2-side-link[aria-current="page"] { color: var(--s2-accent-ink); background: var(--s2-paper); font-weight: 600; box-shadow: 0 1px 3px var(--s2-shadow); }
a.s2-side-link:focus-visible, .s2-side-out:focus-visible, .s2-toggle:focus-visible { outline: 2px solid var(--s2-accent); outline-offset: 2px; }
.s2-side-link.sp-future { border: 0; border-radius: 8px; padding: 7px 12px; white-space: normal; color: var(--s2-faint); font-size: 14px; }
.s2-side-foot { border-top: 1px solid var(--s2-green-line); padding-top: 10px; margin-top: 16px; display: grid; gap: 4px; }
.s2-side-user { display: grid; gap: 1px; font-size: 13px; line-height: 1.3; min-width: 0; }
.s2-side-user b, .s2-side-user span { overflow: hidden; text-overflow: ellipsis; }
.s2-side-link.s2-side-me { white-space: normal; }
.s2-side-out { font-size: 12.5px; margin-top: 4px; }
.s2-toggle { display: none; font: inherit; font-size: 13.5px; background: var(--s2-paper); border: 1px solid var(--s2-line-strong); border-radius: 8px; padding: 4px 10px; cursor: pointer; color: var(--s2-ink); }
@media (min-width: 900px) {
  body { padding-left: 232px; }
  #s2-bar { display: none; }            /* phones only: the menu toggle; the sidebar has the brand */
  body.s2-rail { padding-left: 76px; }
  body.s2-rail #s2-side { width: 76px; padding-left: 10px; padding-right: 10px; }
  body.s2-rail .s2-side-text { display: none; }
  /* collapsed: a small logo and the expand button share one row */
  body.s2-rail .s2-brandrow { gap: 4px; justify-content: space-between; padding-bottom: 14px; }
  body.s2-rail .s2-logo { flex: none; }
  body.s2-rail .s2-logo img { width: 28px; height: 28px; border-radius: 7px; }
  body.s2-rail .s2-railbtn { width: 24px; height: 24px; }
  body.s2-rail .s2-side-link { justify-content: center; padding: 9px 0; }
}
@media (max-width: 899px) {
  .s2-toggle { display: inline-block; }
  .s2-railbtn { display: none; }
  #s2-side { transform: translateX(-100%); transition: transform .18s ease; box-shadow: none; padding-top: 64px; }
  #s2-side.s2-open { transform: none; box-shadow: 8px 0 30px var(--s2-shadow-strong); }
  #s2-bar { z-index: 50; }
}
@media (prefers-reduced-motion: reduce) { #s2-side { transition: none; } }
@media print {
  #s2-side { display: none !important; }
  body { padding-left: 0 !important; }
}

/* Settings page (view_settings.js) */
.st-wrap > :not(.s2-head) { max-width: 900px; }   /* the page and its header are full width; the cards stay readable */
.st-card { background: var(--s2-paper); border: 1px solid var(--s2-line); border-radius: 16px; padding: 18px 20px; margin-bottom: 18px; box-shadow: 0 1px 2px var(--s2-shadow-soft); }
.st-card h2 { font: 600 18px/1.3 var(--s2-display); margin: 0 0 12px; }
.st-row { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 6px 0; font-size: 14px; border-top: 1px solid var(--s2-line); }
.st-row:first-of-type { border-top: 0; }
.st-label { color: var(--s2-muted); }

/* S2.editable: names that rename in place (a pencil on hover; click to type on an underline, same font, no box) */
.s2-editable { cursor: pointer; display: inline; outline: none; border-radius: 4px; }
.s2-editable:focus-visible { box-shadow: 0 0 0 2px var(--s2-accent-line); }
.s2-pencil { display: inline-block; margin-left: .35em; font-size: .8em; color: var(--s2-accent); opacity: 0; vertical-align: -.05em;
             transition: opacity .12s; pointer-events: none; }
.s2-editable:hover .s2-pencil, .s2-editable:focus-visible .s2-pencil, tr:hover .s2-editable .s2-pencil, .s2-edhover:hover .s2-editable .s2-pencil { opacity: 1; }
.s2-editable.s2-is-editing .s2-pencil { display: none; }
input.s2-editing { font: inherit; color: inherit; letter-spacing: inherit; background: transparent; border: 0; border-radius: 0; padding: 0; margin: 0;
                   border-bottom: 1.5px solid var(--s2-accent); outline: none; box-shadow: none; min-width: 4ch; max-width: 100%;
                   field-sizing: content; line-height: inherit; vertical-align: baseline; }
/* multiline (a paragraph): block, line breaks kept; edited in a growing textarea with the same underline */
.s2-editable.s2-edmulti { display: block; white-space: pre-wrap; }
.s2-edplaceholder { color: var(--s2-faint); font-style: italic; }
textarea.s2-editing-multi { display: block; width: 100%; resize: none; overflow: hidden; font: inherit; color: inherit; letter-spacing: inherit;
                            background: transparent; border: 0; border-radius: 0; padding: 0; margin: 0; line-height: inherit;
                            border-bottom: 1.5px solid var(--s2-accent); outline: none; box-shadow: none; field-sizing: content; }
/* a pencil that always shows (e.g. the house price): <span class="s2-edshow"> around the editable */
.s2-edshow .s2-pencil { opacity: .75; }
@media (prefers-reduced-motion: reduce) { .s2-pencil { transition: none; } }
@media print { .s2-pencil { display: none !important; } }

/* THE dropdown (S2.dropdown): a button with a caret and a panel under it; a menu is a list of .s2-dropdown-item */
.s2-dropdown { position: relative; display: inline-flex; }
.s2-caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; margin-left: 2px; }
.s2-dropdown-panel { position: absolute; z-index: 30; top: calc(100% + 6px); right: 0; min-width: 240px; display: grid; padding: 4px;
                     background: var(--s2-paper); border: 1px solid var(--s2-line-strong); border-radius: 12px; box-shadow: 0 10px 28px var(--s2-shadow-strong); }
.s2-dropdown-panel.s2-left { right: auto; left: 0; }
.s2-dropdown-panel[hidden] { display: none; }
.s2-dropdown-item { display: grid; gap: 1px; text-align: left; font: inherit; border: 0; background: none; padding: 8px 12px; border-radius: 8px; cursor: pointer; color: var(--s2-ink); }
.s2-dropdown-item b { font-size: 13.5px; font-weight: 600; }
.s2-dropdown-item span { font-size: 12px; color: var(--s2-muted); }
.s2-dropdown-item:hover, .s2-dropdown-item:focus-visible { background: var(--s2-accent-soft); outline: none; }
/* a menu item that is the current choice: the chosen mark (S2.chosenMark) before its label */
.s2-dropdown-item .s2-chosen { font-size: 17px; color: var(--s2-green); }
.s2-dropdown-item.s2-current { background: var(--s2-accent-soft); }
/* a picker list's band heading (e.g. Add from PM's line · section · group): small, muted, sticky at the list's top */
.s2-pickband { position: sticky; top: 0; z-index: 1; padding: 6px 8px; background: var(--s2-wash); color: var(--s2-muted); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
/* a picker's blocks (S2.pickBlock; S2.dropdown's {band} items): "Standard" on top, then "Upgrade", whose choices sit
   on the upgrade (amber) wash */
.s2-pickblock { display: grid; gap: 8px; align-content: start; }
.s2-pickblock > .s2-pickband, .s2-dropdown-panel > .s2-pickband { position: static; background: none; padding: 6px 4px 2px; }
.s2-pickblock-up > .s2-pickband, .s2-pickband.s2-pickband-up { color: var(--s2-amber); }
.s2-dropdown-panel > .s2-pickband { padding: 8px 12px 4px; }
.s2-dropdown-panel > .s2-pickband:first-child { padding-top: 4px; }
.s2-dropdown-item.s2-upgrade { background: var(--s2-amber-soft); border: 1px solid var(--s2-amber-line); margin-top: 3px; }
.s2-dropdown-item.s2-upgrade:hover, .s2-dropdown-item.s2-upgrade:focus-visible { background: color-mix(in srgb, var(--s2-amber-line) 45%, var(--s2-amber-soft)); }
.s2-dropdown-item.s2-upgrade.s2-current { border-color: var(--s2-accent); }
.s2-dropdown-item + .s2-pickband { margin-top: 4px; }

/* S2.printNode: while it prints, only #s2-print is on paper */
#s2-print { display: none; }
@media print {
  body.s2-printing > *:not(#s2-print) { display: none !important; }
  body.s2-printing #s2-print { display: block; }
  body.s2-printing { padding: 0 !important; background: none !important; }
  body.s2-printing::before, body.s2-printing::after { display: none !important; }
}
.s2-printdoc { max-width: 760px; margin: 0 auto; font: 13px/1.5 var(--s2-font); color: var(--s2-ink); }
.s2-printdoc h1 { font: 700 22px/1.25 var(--s2-display); margin: 0 0 14px; }
/* S2.downloadMenu's mark (e.g. "DRAFT — not confirmed"): fixed at the top, so it repeats on every printed page */
.s2-printmark { display: none; }
@media print {
  #s2-print .s2-printmark { display: block; position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 10; width: max-content;
                            padding: 3px 14px; border-radius: 0 0 10px 10px; font: 700 10px/1.4 var(--s2-font); letter-spacing: .12em; text-transform: uppercase;
                            color: var(--s2-amber-ink); background: var(--s2-amber-soft); border: 1px solid var(--s2-amber-line); border-top: 0;
                            -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #s2-print .s2-printnote { display: block; text-align: center; letter-spacing: 0; text-transform: none; color: var(--s2-amber); }
}

/* S2.packageCard extras (the card itself is .lv-card.lib-card in app.css): tagline, Choose / Preview, the selected state */
.s2-pill.s2-picked { background: var(--s2-accent); color: var(--s2-on-accent); border-color: transparent; }
.lv-card.lib-card.s2-selected { border-color: var(--s2-accent); box-shadow: 0 0 0 1.5px var(--s2-accent), 0 8px 24px -14px var(--s2-shadow); }
.lib-tagline { padding: 0 2px; font-size: 12px; color: var(--s2-muted); line-height: 1.35; }
.lib-cardacts { display: flex; gap: 6px; justify-content: flex-end; padding: 2px 2px 0; }

/* S2.chosenMark: the check before the name of whatever is chosen (cards, menu items, the closed picker) */
.s2-chosen { color: var(--s2-green); font-size: 17px; font-weight: 700; line-height: 1; margin-right: 6px; vertical-align: -0.06em; }

/* text for screen readers only */
.s2-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* S2.facts: a row of labelled values (label above, value below) */
.s2-facts { display: flex; flex-wrap: wrap; gap: 10px 36px; margin: 0; }
.s2-fact { display: grid; gap: 2px; align-content: start; min-width: 0; }
.s2-fact[hidden] { display: none; }
.s2-fact > dt { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--s2-muted); }
.s2-fact > dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 15px; color: var(--s2-ink); min-height: 24px; }

/* S2.stepPanel: a step's header band (circle, title, result, buttons, chevron), then the body set in under it */
.s2-step { margin: 30px 0 8px; }
/* a band: each step / section reads as its own block, above any chapter heading inside it. The primary's own
   tint (a lilac wash fading into paper), the card's hairline and shadow: no second surface colour on the page */
.s2-step-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px 18px;
                background: var(--s2-paper) linear-gradient(100deg, var(--s2-accent-soft), color-mix(in srgb, var(--s2-accent-soft) 25%, var(--s2-paper)) 70%);
                border: 1px solid var(--s2-accent-line); border-radius: 14px; box-shadow: 0 1px 2px var(--s2-shadow-soft); }
.s2-step-head.s2-step-can:hover { border-color: color-mix(in srgb, var(--s2-accent) 45%, var(--s2-accent-line)); }
.s2-step-head.s2-step-can { cursor: pointer; }
h2.s2-step-h { margin: 0; padding: 0; border: 0; font: 650 20px/1.3 var(--s2-display); letter-spacing: -.005em; text-transform: none; color: var(--s2-ink);
               flex: 0 1 auto; min-width: 0; }
.s2-step-toggle { display: inline-flex; align-items: center; gap: 10px; font: inherit; color: inherit; letter-spacing: inherit; text-align: left;
                  background: none; border: 0; padding: 0; margin: 0; border-radius: 8px; }
button.s2-step-toggle { cursor: pointer; }
button.s2-step-toggle:focus-visible { outline: 2px solid var(--s2-accent); outline-offset: 3px; }
.s2-step-can:hover .s2-step-title { color: var(--s2-accent-ink); }
.s2-step-n { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 99px; font: 700 13px/1 var(--s2-font);
             background: var(--s2-paper); color: var(--s2-accent-ink); border: 1.5px solid var(--s2-accent-line); }
.s2-step-done .s2-step-n { background: var(--s2-green); color: var(--s2-on-accent); border-color: var(--s2-green); }
/* the right-hand group (result, buttons, chevron) wraps as one piece under the title on narrow screens */
.s2-step-end { margin-left: auto; display: inline-flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px 12px; }
.s2-step-result { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14px; font-weight: 600;
                  color: var(--s2-ink); font-variant-numeric: tabular-nums; }
.s2-step-result:empty, .s2-step-actions:empty { display: none; }
.s2-step-actions { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.s2-step-chev { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 99px; font-size: 18px; color: var(--s2-muted); }
.s2-step-can:hover .s2-step-chev { background: var(--s2-accent-soft); color: var(--s2-accent-ink); }
.s2-step-collapsed .s2-step-chev svg { transform: rotate(-90deg); }
.s2-step-body { padding: 16px 18px 0; }             /* set in: the content belongs to the band above it */
.s2-step-body[hidden] { display: none; }
.s2-step-plain h2.s2-step-h { font-size: 19px; }
/* o.card: one card, the band its top edge and the body inside it (no second frame around the band) */
.s2-step-card { background: var(--s2-paper); border: 1px solid var(--s2-accent-line); border-radius: 14px; box-shadow: 0 1px 2px var(--s2-shadow-soft); overflow: hidden; }
.s2-step-card > .s2-step-head { border: 0; border-bottom: 1px solid var(--s2-accent-line); border-radius: 0; box-shadow: none; }
.s2-step-card.s2-step-collapsed > .s2-step-head { border-bottom: 0; }
.s2-step-card > .s2-step-body { padding: 6px 18px 16px; }
/* a card step's own summary card or table is part of that card: no second frame; the table runs to the card's edges */
.s2-step-card > .s2-step-body > .s2-card { border: 0; border-radius: 0; box-shadow: none; padding: 10px 0 0; }
.s2-step-card > .s2-step-body > .s2-tablewrap { border: 0; border-radius: 0; margin: -6px -18px -16px; }
@media (max-width: 700px) { .s2-step-body { padding: 14px 6px 0; } .s2-step-card > .s2-step-body { padding: 6px 14px 14px; }
                            .s2-step-card > .s2-step-body > .s2-tablewrap { margin: -6px -14px -14px; } }
@media print { .s2-step { margin: 0; } .s2-step-body { padding: 0; } }   /* the header is hidden: no height above the book */

/* .s2-hint: "start here". A dashed outline that flashes once every 2 s around the one thing to do next (the house
   card's "Add price"; the book's Edit layout uses the same keyframes). Stops while the thing is being edited. */
.s2-hint { outline: 1.5px dashed transparent; outline-offset: 5px; border-radius: 6px; animation: s2-hint 2s ease-in-out infinite; }
.s2-hint:has(.s2-is-editing) { animation: none; outline-color: transparent; }
@keyframes s2-hint { 0%, 100% { outline-color: transparent; } 35%, 60% { outline-color: var(--s2-accent); } }
@media (prefers-reduced-motion: reduce) { .s2-hint { animation: none; outline-color: var(--s2-accent-line); } }
@media print { .s2-hint { animation: none; outline: 0; } }

/* S2.actionBar: fixed to the bottom of the page column (the .s2-wrap content width, beside the sidebar), opaque */
.s2-actionbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 0 20px; pointer-events: none; }
.s2-actionbar-in { max-width: 1280px; margin: 0 auto; pointer-events: auto; display: flex; align-items: center; gap: 8px 16px;
                   padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)) 18px; background: var(--s2-paper);
                   border: 1px solid var(--s2-line-strong); border-bottom: 0; border-radius: 0;   /* square: opaque edge to edge */
                   box-shadow: 0 -8px 24px var(--s2-shadow), 0 -1px 3px var(--s2-shadow-soft); }
.s2-actionbar-info { flex: 1 1 0%; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; font-size: 14px; color: var(--s2-muted); }
.s2-actionbar-info > :empty { display: none; }
.s2-actionbar-info > * { display: inline-flex; align-items: center; gap: 6px; }
.s2-actionbar-info > * + *::before { content: "\00b7"; margin: 0 10px; color: var(--s2-faint); }
.s2-actionbar-info > :first-child { color: var(--s2-ink); font-weight: 700; }
.s2-actionbar-act { flex: none; margin-left: auto; display: flex; gap: 8px; align-items: center; }
/* room under the page column that holds the bar (not every .s2-wrap) */
@media screen { body.s2-has-actionbar .s2-wrap:has(> .s2-actionbar) { padding-bottom: calc(28px + var(--s2-actionbar-h, 64px)); } }
@media (min-width: 900px) {
  .s2-actionbar { left: 232px; }                 /* beside the sidebar, like the page column */
  body.s2-rail .s2-actionbar { left: 76px; }
}
@media (max-width: 899px) {                     /* the content may wrap here: spacing instead of dots */
  .s2-actionbar-info { gap: 2px 14px; }
  .s2-actionbar-info > * + *::before { content: none; }
}
@media (max-width: 640px) { .s2-actionbar { padding: 0 16px; } .s2-actionbar-in { padding-left: 14px; } }
@media print { .s2-actionbar { display: none !important; } }

/* tabs with something at the end of their line (a filter): <div class="s2-tabs"> tabs… <span class="s2-tabs-end">…</span> */
.s2-tabs .s2-tabs-end { margin-left: auto; align-self: center; padding-bottom: 6px; }
.s2-tabs .s2-tabs-end .s2-input { width: 240px; max-width: 100%; }
