/* =====================================================================================================================
   scale-compact.css: the compact scale, a proposal behind a flag (21 October 2026). Nothing here applies unless the page was
   opened with ?scale=compact (prototype/index.html sets <html data-scale="compact">). The study that explains it, with now and
   proposed side by side: ../../old/explore/scale-study/index.html.

   Janne, 21 October 2026: "What is the ratio between everything we have? What would be the design system? I also think our
   buttons are maybe a bit too big ... I would maybe prefer those buttons also to be not fully round, but with a smaller corner
   radius, like the one that is very common and maybe the one that a reference product also uses."

   The proposal in one line: headings and controls one step smaller, reading text unchanged.
   - Type, still five sizes: 32, 24, 20, 16, 12 (was 40, 28, 20, 16, 12). Each step 1.2 to 1.33 times the next.
   - Buttons 40 tall, 8 px corners, 16 px sides, 16 Regular. The 44 px target stays: an invisible ::after reaches 2 px above
     and below the button, so the pointer area is 44 tall while the drawn button is 40.
   - Corners: 12 cards and dialogs, 8 boxes, inner containers, buttons, chips and fields, 6 tags and markers; round only for
     avatars, dots, the arrow disc and round icon buttons.
   - Hero spacing: title to line 12 (was 16), line to buttons 24 (was 32), between buttons 12 (was 16), the mint's top 56 from 1024
     (was 72).
   type-scale.js knows this set when the flag is on (it snaps to 32/24/20/16/12 instead of 40/28/20/16/12).
   No font-size inside a media or container query. !important where v8 uses it, so these rules win among the !importants.
   ===================================================================================================================== */

/* branch-rounder (Janne, 8 November 2026): Shopify's proportions. "I think maybe our buttons could be slightly rounder ... especially
   in the policies. I think they're somehow less rounded"; "Use C: buttons 12 px, cards 16, inner parts 10"; "You use the Shopify
   proportions. Please then update it in the design system so it's updated everywhere." Shopify's buttons carry a corner of about
   a third of their height; ours at 40 tall had a fifth. So: controls 12, cards 16, inner containers and boxes 10, tags 8. */
/* ---------- The proposed values: ONE block, unscoped (variables only, so they change nothing on their own). The study page
   reads the same block, so this is the single source if it becomes the system ---------- */
:root {
  /* Type: size / line height */
  --v8c-fs-32: 32px; --v8c-lh-32: 40px;   /* page title, hero figure (2.0 x body) */
  --v8c-fs-24: 24px; --v8c-lh-24: 32px;   /* page section titles, Bold ("Your policies", "Ongoing claims"), and figures in cards (1.5 x body) */
  --v8c-fs-20: 20px; --v8c-lh-20: 24px;   /* titles inside a section: a card, a table, a box, Bold (1.25 x body); the lead 20/28 Regular */
  --v8c-lh-lead: 28px;
  --v8c-fs-16: 16px; --v8c-lh-16: 24px;   /* everything read, buttons, table heads (the body) */
  --v8c-fs-12: 14px; --v8c-lh-12: 20px;   /* badges, tags, claim numbers (0.75 x body) */
  /* Buttons */
  --v8c-btn-h: 40px;        /* drawn height */
  --v8c-btn-hit: 44px;      /* pointer target, through ::after */
  --v8c-btn-px: 16px;       /* left and right inside */
  --v8c-btn-r: 12px;         /* corners */
  --v8c-btn-gap: 12px;      /* between buttons side by side */
  /* Radii */
  --v8c-r: 16px;            /* cards, plates, the insight, dialogs */
  --v8c-r-in: 10px;          /* a container inside a 12 card */
  --v8c-r-sm: 10px;          /* boxes, fields, rows, thumbnails, header bands */
  --v8c-r-ctl: 12px;         /* buttons, chips, the segmented control, the ask field (was the full pill) */
  --v8c-r-field: 8px;        /* fields, selects and the search (README 216: one step squarer than buttons, nests in the assistant's ring) */
  --v8c-r-tag: 8px;         /* tags, badges, markers */
  --v8c-r-round: 50%;       /* only avatars, dots, the arrow disc, round icon buttons */
  /* Hero spacing */
  --v8c-top: 56px;          /* the mint zone's top to its first line, from 1024 (24 below, unchanged) */
  --v8c-title-lead: 12px;
  --v8c-lead-acts: 24px;
}

/* ---------- The tokens, remapped under the flag ---------- */
html[data-scale="compact"] {
  --v8-fs-40: var(--v8c-fs-32); --v8-lh-40: var(--v8c-lh-32);
  --v8-fs-28: var(--v8c-fs-24); --v8-lh-28: var(--v8c-lh-24);
  --v8-r: var(--v8c-r);
  --v8-r-in: var(--v8c-r-in);
  --v8-r-sm: var(--v8c-r-sm);
  --v8-r-tag: var(--v8c-r-tag);
  --v8-r-pill: var(--v8c-r-ctl);
  --v8-r-field: var(--v8c-r-field);
}
@media (min-width: 1024px) { html[data-scale="compact"] { --v8-top: var(--v8c-top); } }

/* ---------- Headings: the section title takes the card title's 20 Bold ink (README 63.8, now the system) ---------- */
/* Two heading steps (Janne, 21 October 2026, night: "should we add two sizes ... 20 ... a really good header for smaller sections,
   like tables ... inside the cards ... a bit more important sections ... maybe 24 ... when it says 'Your policies,' it looks funky
   that it's actually the same size as the title of the cards"): a page section's title is 24 Bold ink; a title inside a section
   (a card, a table, a box) stays 20 Bold ink */
html#v8[data-scale="compact"] #app .v8-h2 { font-size: var(--v8c-fs-24) !important; line-height: var(--v8c-lh-24) !important; font-weight: 700 !important; color: var(--v8-ink); }

/* ---------- The hero's rhythm ---------- */
html#v8[data-scale="compact"] #app .v8-hero .v8-lead { margin-top: var(--v8c-title-lead); }
html#v8[data-scale="compact"] #app .v8-hero-acts { margin-top: var(--v8c-lead-acts); }
html#v8[data-scale="compact"] #app :is(.v8-acts, .v8-hero-acts) { gap: var(--v8c-btn-gap); }

/* ---------- Buttons: 40 drawn, 44 to the pointer ---------- */
html#v8[data-scale="compact"] :is(#app, .v8-dlgw, .aiw, .cov-drawer, .dv-wrap) .v8-btn { position: relative; min-height: var(--v8c-btn-h); padding-left: var(--v8c-btn-px); padding-right: var(--v8c-btn-px); border-radius: var(--v8c-btn-r); }
html#v8[data-scale="compact"] :is(#app, .v8-dlgw, .aiw, .cov-drawer, .dv-wrap) .v8-btn-ai { padding-left: 12px; }
/* The hit area: 2 px above and below, so the target is 44 tall; buttons side by side are 12 apart, so the bands never meet */
html#v8[data-scale="compact"] :is(#app, .v8-dlgw, .aiw, .cov-drawer, .dv-wrap) .v8-btn::after { content: ""; position: absolute; inset: calc((var(--v8c-btn-h) - var(--v8c-btn-hit)) / 2) 0; }
/* The older buttons and the side menu's File a new claim */
html#v8[data-scale="compact"] #app .btn, html#v8[data-scale="compact"] body .cov-drawer .btn, html#v8[data-scale="compact"] body .dv-wrap .btn { min-height: var(--v8c-btn-h) !important; border-radius: var(--v8c-btn-r) !important; }
html#v8[data-scale="compact"] #app header.rail.rail2 .rail-cta { height: 36px !important; border-radius: var(--v8c-btn-r) !important; }   /* the compact menu's row height (README 80) */
/* What stays round: the count dots in the menu and the top bar are numbers in a dot, not controls */
html#v8[data-scale="compact"] #app header.rail.rail2 .nav-item .count, html#v8[data-scale="compact"] #app .topbar .tb-msg .count { border-radius: 999px !important; }
/* Progress bars and meter caps stay fully round at their own height (a 6 px bar with 8 px corners is already round) */
/* The insight's outlined action ("See how to lower your risk"), a button in all but name */
html#v8[data-scale="compact"] #app .v8-insx > .v8-ins-go.v8-ins-go-w { position: relative; min-height: var(--v8c-btn-h); padding: 0 var(--v8c-btn-px); border-radius: var(--v8c-btn-r); }
html#v8[data-scale="compact"] #app .v8-insx > .v8-ins-go.v8-ins-go-w::after { content: ""; position: absolute; inset: calc((var(--v8c-btn-h) - var(--v8c-btn-hit)) / 2) 0; }


/* The buttons for every page, with or without the flag (Janne, 21 October 2026, night: "the new style of button should be applied
   everywhere"): 40 drawn, 44 hit, 8 px corners, 12 apart; the compact type and corners stay behind ?scale=compact */
html#v8 #app :is(.v8-acts, .v8-hero-acts) { gap: var(--v8c-btn-gap); }
html#v8 :is(#app, .v8-dlgw, .aiw, .cov-drawer, .dv-wrap) .v8-btn { position: relative; min-height: var(--v8c-btn-h); padding-left: var(--v8c-btn-px); padding-right: var(--v8c-btn-px); border-radius: var(--v8c-btn-r); }
html#v8 :is(#app, .v8-dlgw, .aiw, .cov-drawer, .dv-wrap) .v8-btn-ai { padding-left: 12px; }
html#v8 :is(#app, .v8-dlgw, .aiw, .cov-drawer, .dv-wrap) .v8-btn::after { content: ""; position: absolute; inset: calc((var(--v8c-btn-h) - var(--v8c-btn-hit)) / 2) 0; }
html#v8 #app .btn, html#v8 body .cov-drawer .btn, html#v8 body .dv-wrap .btn { min-height: var(--v8c-btn-h) !important; border-radius: var(--v8c-btn-r) !important; }
html#v8 #app header.rail.rail2 .rail-cta { height: 36px !important; border-radius: var(--v8c-btn-r) !important; }   /* the compact menu's row height (README 80) */
html#v8 #app header.rail.rail2 .nav-item .count, html#v8 #app .topbar .tb-msg .count { border-radius: 999px !important; }
html#v8 #app .v8-insx > .v8-ins-go.v8-ins-go-w { position: relative; min-height: var(--v8c-btn-h); padding: 0 var(--v8c-btn-px); border-radius: var(--v8c-btn-r); }
html#v8 #app .v8-insx > .v8-ins-go.v8-ins-go-w::after { content: ""; position: absolute; inset: calc((var(--v8c-btn-h) - var(--v8c-btn-hit)) / 2) 0; }

/* The heroes' town, one step smaller with the compact scale (Janne, 21 October 2026, night: "the illustration is a bit too big in the
   hero"): each building piece 52 instead of 64, the pitch 72 instead of 88 */
html#v8[data-scale="compact"] #app .v8-town img { width: 52px; height: 52px; }
html#v8[data-scale="compact"] #app .v8-town img + img { margin-left: 20px; }
/* Home's scene is a grid, not a row: its pieces fill their cells, so the compact scale shrinks the cell instead (52/64 of it), and
   the stacked piece stands on the one below again; at 52 in a 96 cell it floated 44 above it (Jordi, 22 October 2026) */
html#v8[data-scale="compact"] #app .v8-town.v8-scene { --v8-scene-u: 80px; }
@media (max-width: 1359px) { html#v8[data-scale="compact"] #app .v8-town.v8-scene { --v8-scene-u: 52px; } }
/* push: also answers to the page area's width (branch ai-drawer README, the push layout) */
@container app (max-width: 1359px) { html#v8[data-scale="compact"] #app .v8-town.v8-scene { --v8-scene-u: 52px; }}
@media (max-width: 1023px) { html#v8[data-scale="compact"] #app .v8-town.v8-scene { --v8-scene-u: 32px; } }
html#v8[data-scale="compact"] #app .v8-town.v8-scene img { width: var(--v8-scene-u); height: var(--v8-scene-u); margin: 0; }

/* The side menu's File a new claim lines up with the menu's icons (Janne, 21 October 2026, night: "the padding should be followed the
   same way. The button goes too much to the left compared to the icons above it"): the items' icons sit 12 inside the item, so the
   button starts 12 in too */
html#v8 #app header.rail.rail2 .rail-cta { margin-left: 10px !important; }   /* 10 since the compact menu (README 80) */
