/* =====================================================================================================================
   certs-k.css: Get a certificate and Your certificates, redesigned (README 105, 22 October 2026). Markup: v8-rest.js
   (vCertificates, ceFormK, v8CeFoot, ceRowK); the certificate sheet itself is certs.js's ceSheet.
   Janne: "things look too large, too big. You should have those little subtle buttons that we have been designing, those little
   buttons that have strokes around them ... how you get one, I think that action needs a massive redesign. It should be much more
   aesthetic, like what we have in our styles."
   - ONE white box for the action (1 px line, 8 corners, as the boxed facts and the boxed documents list): the compact form on the
     left (5 parts), the certificate on a light gray panel on the right (6 parts: the form keeps room for the three chips on one line). Under 1200: the form, the certificate, Create.
   - The language: a small segmented control of curved squares on a gray track; the chosen one Fennia's selected green with a check.
   - The certificate's actions and the list's actions: the system's chip button (.v8-chipbtn).
   - Your certificates: the boxed list (one white box, hairlines between rows, the icon in a 44 gray square).
   Type 20/16 only, none in a media or container query. Fennia colour tokens only. No circles (README 70).
   ===================================================================================================================== */

/* ---------- The box ---------- */
html#v8 #app .v8-cek-box { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); grid-template-rows: auto 1fr; grid-template-areas: "form stage" "foot stage";
  border: 1px solid var(--v8-line); border-radius: var(--v8-r-pill); background: var(--v8-white); }
html#v8 #app .v8-cek-col { grid-area: form; min-width: 0; padding: var(--v8-6) var(--v8-6) 0; }
html#v8 #app .v8-cek-foot { grid-area: foot; min-width: 0; padding: var(--v8-5) var(--v8-6) var(--v8-6); }
html#v8 #app .v8-cek-foot:empty { padding: 0; }
html#v8 #app .v8-cek-stage { grid-area: stage; min-width: 0; padding: var(--v8-6); border-left: 1px solid var(--v8-line); border-radius: 0 calc(var(--v8-r-sm) - 1px) calc(var(--v8-r-sm) - 1px) 0; background: var(--v8-gray); }
/* Stacked, Create certificate (and, once made, its actions) comes right under the last field, the preview below it (Janne, 9 November
   2026: "on a smaller screen size, after the 'Who is the certificate for?' there should be the 'Create certificate' below the input
   field, and only the preview underneath"); the preview, now last, takes the box's bottom corners */
@media (max-width: 1199px) {
  html#v8 #app .v8-cek-box { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "form" "foot" "stage"; }
  html#v8 #app .v8-cek-col { padding-bottom: 0; }
  html#v8 #app .v8-cek-box:has(.v8-cek-foot:empty) .v8-cek-col { padding-bottom: var(--v8-6); }
  html#v8 #app .v8-cek-stage { border-left: 0; border-top: 1px solid var(--v8-line); border-radius: 0 0 calc(var(--v8-r-sm) - 1px) calc(var(--v8-r-sm) - 1px); }
  html#v8 #app .v8-cek-foot { padding-top: var(--v8-5); }
  html#v8 #app .v8-cek-form { max-width: 560px; }
}
/* push: also answers to the page area's width (branch ai-drawer README, the push layout) */
@container app (max-width: 1199px) {
  html#v8 #app .v8-cek-box { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "form" "foot" "stage"; }
  html#v8 #app .v8-cek-col { padding-bottom: 0; }
  html#v8 #app .v8-cek-box:has(.v8-cek-foot:empty) .v8-cek-col { padding-bottom: var(--v8-6); }
  html#v8 #app .v8-cek-stage { border-left: 0; border-top: 1px solid var(--v8-line); border-radius: 0 0 calc(var(--v8-r-sm) - 1px) calc(var(--v8-r-sm) - 1px); }
  html#v8 #app .v8-cek-foot { padding-top: var(--v8-5); }
  html#v8 #app .v8-cek-form { max-width: 560px; }}
@media (max-width: 639px) {
  html#v8 #app .v8-cek-col { padding: var(--v8-5) var(--v8-4) 0; }
  html#v8 #app .v8-cek-box:has(.v8-cek-foot:empty) .v8-cek-col { padding-bottom: var(--v8-5); }
  html#v8 #app .v8-cek-stage { padding: var(--v8-4); }
  html#v8 #app .v8-cek-foot { padding: var(--v8-5) var(--v8-4); }
  html#v8 #app .v8-cek-foot .v8-btn { width: 100%; }
}

/* ---------- The form: the system's fields, 24 apart ---------- */
html#v8 #app .v8-cek-form { display: grid; gap: 0;   /* the system puts 24 between two fields (.v8-field + .v8-field) */ margin: 0; }
html#v8 #app .v8-cek-f { margin: 0; }
html#v8 #app .v8-cek-f > .v8-label { margin-bottom: var(--v8-2); }

/* The language: a small segmented control. A gray track with a hairline, three equal curved squares 36 high (the chip's height),
   16 Regular ink; hover the green wash; the chosen one Fennia's selected green (#E6FAE7) with a 1 px green edge and a check, so the
   choice never rests on colour alone. Native radios underneath: Tab reaches the chosen one, the arrow keys move it */
html#v8 #app .v8-cek-seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--v8-1); max-width: 100%; padding: var(--v8-1);
  border-radius: var(--v8-r-sm); background: var(--v8-gray); box-shadow: inset 0 0 0 1px var(--v8-line); }
html#v8 #app .v8-cek-seg label { position: relative; display: block; min-width: 0; cursor: pointer; }
html#v8 #app .v8-cek-seg span { display: flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 var(--v8-4); border-radius: var(--v8-r-tag); color: var(--v8-ink);
  font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 400 !important; white-space: nowrap; transition: background-color .16s ease-out, box-shadow .16s ease-out; }
html#v8 #app .v8-cek-seg span svg.i { display: none; flex: none; width: 16px; height: 16px; color: var(--v8-green-t); }
@media (hover: hover) { html#v8 #app .v8-cek-seg label:hover input:not(:checked) + span { background: var(--v8-hover); } }
html#v8 #app .v8-cek-seg input:checked + span { background: var(--fennia-primary-10, #E6FAE7); box-shadow: inset 0 0 0 1px var(--v8-green); }
html#v8 #app .v8-cek-seg input:checked + span svg.i { display: block; }
html#v8 #app .v8-cek-seg input:focus-visible + span { outline: var(--v8-focus); outline-offset: 0 !important; box-shadow: var(--v8-focus-glow) !important; }
@media (hover: none) { html#v8 #app .v8-cek-seg span { height: 44px; } }
@media (max-width: 399px) { html#v8 #app .v8-cek-seg { display: grid; width: 100%; } html#v8 #app .v8-cek-seg span { padding: 0 var(--v8-2); } }

/* ---------- The chips: the system's chip button (V8.btn kind "chip", base.css .v8-chipbtn). Only its Copied state's check is sized
   here (certs.js's ceCopy puts the check before "Copied") ---------- */
html#v8 #app :is(.v8-cek-acts, .v8-cek-racts) .v8-chipbtn svg.i { flex: none; width: 16px; height: 16px; color: currentColor; }
@media (prefers-reduced-motion: reduce) { html#v8 #app .v8-cek-seg span { transition: none; } }
@media (forced-colors: active) {
  html#v8 #app .v8-cek-seg { border: 1px solid CanvasText; }
  html#v8 #app .v8-cek-seg input:checked + span { outline: 2px solid Highlight; outline-offset: -2px; }
  html#v8 #app :is(.v8-cek-box, .v8-cek-list) { border-color: CanvasText; }
}

/* ---------- Once it's made: the check square, the line, the chips, then how to make another ---------- */
html#v8 #app .v8-cek-ready { display: flex; align-items: center; gap: var(--v8-3); margin: 0; color: var(--v8-ink); }
html#v8 #app .v8-cek-ready:focus { outline: none; }
html#v8 #app .v8-cek-ready:focus-visible { outline: var(--v8-focus); outline-offset: 0 !important; box-shadow: var(--v8-focus-glow) !important; }
html#v8 #app .v8-cek-ok { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: var(--v8-r-tag); background: var(--v8-green); color: var(--v8-white); }
html#v8 #app .v8-cek-ok svg.i { width: 16px; height: 16px; color: var(--v8-white); }
html#v8 #app .v8-cek-acts { display: flex; flex-wrap: wrap; gap: var(--v8-2); margin-top: var(--v8-4); }
html#v8 #app .v8-cek-again { margin: var(--v8-4) 0 0; max-width: 46ch; color: var(--v8-ink-2); }

/* ---------- The certificate on its panel: a white sheet with a hairline and a soft lift, 440 at most, held in view beside the form.
   Its words 16 (the title 20), the paper's spacing a step tighter than before ---------- */
html#v8 #app .v8-cek-stage .ce-sheet { position: sticky; top: var(--v8-5); display: flex; flex-direction: column; width: 100%; max-width: 440px; min-height: 0; aspect-ratio: auto; margin: 0 auto;
  padding: var(--v8-6); border: 0; border-radius: var(--v8-r-sm); background: var(--v8-white); color: var(--v8-ink); overflow-wrap: anywhere;
  box-shadow: 0 0 0 1px var(--v8-line), 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .05); }
html#v8 #app .v8-cek-stage .ce-sheet, html#v8 #app .v8-cek-stage .ce-sheet * { font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; }
html#v8 #app .v8-cek-stage .ce-top { display: flex; align-items: center; justify-content: space-between; gap: var(--v8-4); min-height: 40px; }
html#v8 #app .v8-cek-stage .ce-logo { width: 76px; height: auto; flex: none; }
html#v8 #app .v8-cek-stage .ce-mark { display: inline-flex; align-items: center; padding: 0; border: 0; border-radius: 0; color: var(--v8-ink-2); white-space: nowrap; }
html#v8 #app .v8-cek-stage .ce-seal { display: inline-flex; align-items: center; gap: var(--v8-2); }
html#v8 #app .v8-cek-stage .ce-seal svg { width: 36px; height: 36px; flex: none; overflow: visible; }
html#v8 #app .v8-cek-stage .ce-seal .ring { fill: none; stroke: var(--v8-pressed); stroke-width: 1; }
html#v8 #app .v8-cek-stage .ce-seal .disc { fill: var(--v8-green); }
html#v8 #app .v8-cek-stage .ce-seal .tick { fill: none; stroke: var(--v8-white); stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
html#v8 #app .v8-cek-stage .ce-seal-t { display: grid; white-space: nowrap; }
html#v8 #app .v8-cek-stage .ce-seal-t b { font-weight: 700 !important; }
html#v8 #app .v8-cek-stage .ce-seal-t span { color: var(--v8-ink-2); }
html#v8 #app .v8-cek-stage .ce-ttl { margin-top: var(--v8-5); }
html#v8 #app .v8-cek-stage .ce-t1 { color: var(--v8-ink); font-size: var(--v8-fs-20) !important; line-height: var(--v8-lh-20) !important; font-weight: 700 !important; }
html#v8 #app .v8-cek-stage .ce-no { margin-top: var(--v8-1); color: var(--v8-ink-2); }
html#v8 #app .v8-cek-stage .ce-code.ce-mask { color: var(--v8-ink-2); }
html#v8 #app .v8-cek-stage .ce-conf { margin: var(--v8-4) 0 0; max-width: 40ch; }
html#v8 #app .v8-cek-stage .ce-kv { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--v8-5); row-gap: var(--v8-2); margin: var(--v8-4) 0 0; padding: var(--v8-4) 0 0; border-top: 1px solid var(--v8-line); }
html#v8 #app .v8-cek-stage .ce-kv dt { color: var(--v8-ink-2); }
html#v8 #app .v8-cek-stage .ce-pols { display: grid; gap: var(--v8-4); margin: var(--v8-4) 0 0; padding: var(--v8-4) 0 0; border-top: 1px solid var(--v8-line); }
html#v8 #app .v8-cek-stage .ce-pol { display: grid; gap: 2px; padding: 0; border: 0; }
html#v8 #app .v8-cek-stage .ce-r { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: var(--v8-4); }
html#v8 #app .v8-cek-stage .ce-r .k { color: var(--v8-ink-2); }
html#v8 #app .v8-cek-stage .ce-r .v { margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; }
html#v8 #app .v8-cek-stage .ce-r1 .k { color: var(--v8-ink); font-weight: 700 !important; }
html#v8 #app .v8-cek-stage .ce-r1 .v { color: var(--v8-ink-2); }
html#v8 #app .v8-cek-stage .ce-none { padding: var(--v8-4); border: 1px dashed var(--v8-line-2); border-radius: var(--v8-r-sm); color: var(--v8-ink-2); text-align: center; }
html#v8 #app .v8-cek-stage .ce-end { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--v8-4); margin-top: var(--v8-5); padding-top: var(--v8-4); border-top: 1px solid var(--v8-line); }
html#v8 #app .v8-cek-stage .ce-valid { font-weight: 700 !important; }
html#v8 #app .v8-cek-stage .ce-chk { margin-top: var(--v8-1); }
html#v8 #app .v8-cek-stage .ce-note { margin: var(--v8-1) 0 0; max-width: 34ch; color: var(--v8-ink-2); }
html#v8 #app .v8-cek-stage .ce-qr { flex: none; width: 64px; height: 64px; }
html#v8 #app .v8-cek-stage .ce-qr .f, html#v8 #app .v8-cek-stage .ce-qr .d { fill: var(--v8-ink); }
html#v8 #app .v8-cek-stage .ce-sheet:not(.is-issued) .ce-qr .f, html#v8 #app .v8-cek-stage .ce-sheet:not(.is-issued) .ce-qr .d { fill: var(--v8-line); }
html#v8 #app .v8-cek-stage .ce-fade { animation: v8-cek-fade .16s ease-out both; }
@keyframes v8-cek-fade { from { opacity: 0; } }
@media (max-width: 1199px) { html#v8 #app .v8-cek-stage .ce-sheet { position: static; } }
/* push: also answers to the page area's width (branch ai-drawer README, the push layout) */
@container app (max-width: 1199px) { html#v8 #app .v8-cek-stage .ce-sheet { position: static; }}
@media (max-width: 639px) {
  html#v8 #app .v8-cek-stage .ce-sheet { padding: var(--v8-5); }
  html#v8 #app .v8-cek-stage .ce-r { flex-direction: column; }
  html#v8 #app .v8-cek-stage .ce-r .v { margin-left: 0; text-align: left; }
}
@media (forced-colors: active) { html#v8 #app .v8-cek-stage .ce-sheet { border: 1px solid CanvasText; } }

/* ---------- Your certificates: the boxed list ---------- */
html#v8 #app .v8-cek-list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--v8-line); border-radius: var(--v8-r-sm); background: var(--v8-white); }
html#v8 #app .v8-cek-list > li + li { border-top: 1px solid var(--v8-line); }
html#v8 #app .v8-cek-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; column-gap: var(--v8-4); align-items: center; min-height: 76px; padding: var(--v8-4); }
html#v8 #app .v8-cek-ric { display: grid; place-items: center; align-self: start; width: 44px; height: 44px; border-radius: 12px; background: var(--v8-gray); }
html#v8 #app .v8-cek-ric svg.i { width: 24px; height: 24px; color: var(--v8-ink-2); fill: currentColor; }
html#v8 #app .v8-cek-rtx { min-width: 0; }
html#v8 #app .v8-cek-rn { margin: 0; color: var(--v8-ink); font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 700 !important; letter-spacing: 0; }
html#v8 #app .v8-cek-rl, html#v8 #app .v8-cek-rc { margin: 0; color: var(--v8-ink-2); }
html#v8 #app .v8-cek-racts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--v8-2); }
/* The list sizes from its own width: under 720 the chips go under the words; under 440 (a phone) they start at the row's edge */
html#v8 #app .v8-cek-list { container: v8cek / inline-size; }
@container v8cek (max-width: 719px) {
  html#v8 #app .v8-cek-row { grid-template-columns: 44px minmax(0, 1fr); column-gap: var(--v8-3); row-gap: var(--v8-3); }
  html#v8 #app .v8-cek-racts { grid-column: 2; justify-content: flex-start; }
}
@container v8cek (max-width: 439px) { html#v8 #app .v8-cek-racts { grid-column: 1 / -1; } }
/* The policies as checkboxes (README 142, the audit's D23): the system's checkbox rows (base.css .v8-check, 44 to the pointer) under
   the legend and its hint, 8 under the hint; a policy that starts later is a disabled box with its date as the row's second line */
html#v8 #app .v8-cek-pols { margin: 0; padding: 0; border: 0; min-width: 0; }
html#v8 #app .v8-cek-pols > .v8-label { padding: 0; margin-bottom: var(--v8-1); }
html#v8 #app .v8-cek-pols > .v8-hint { margin: 0 0 var(--v8-2); }
html#v8 #app .v8-cek-checks { display: grid; gap: 0; }
html#v8 #app .v8-cek-checks .v8-check:has(input:disabled) { cursor: default; color: var(--v8-ink-2); }
html#v8 #app .v8-cek-checks .v8-check input:disabled { border-color: var(--fennia-neutral-40, #BDBDBD); cursor: default; }
html#v8 #app .v8-cek-pols + .v8-cek-f { margin-top: var(--v8-5); }
/* Nothing on the right until an insurance is picked (Janne, 22 October 2026, night: "on the right, there shouldn't show anything";
   README 151): the box is the form alone, and the certificate comes in beside it once she chooses */
html#v8 #app .v8-cek-box.v8-cek-none { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "form" "foot"; }
html#v8 #app .v8-cek-box.v8-cek-none .v8-cek-stage { display: none; }
html#v8 #app .v8-cek-box.v8-cek-none .v8-cek-col { padding-bottom: var(--v8-6); }
html#v8 #app .v8-cek-pols .v8-selw { max-width: 440px; }
/* README 213 (Janne, 9 November 2026: "This looks like a checkbox. You should have used the same style as we have in the risk
   assessment, when we have that light green background and the check mark"): "Your certificate is ready." takes the portal's status
   mark (Approved on Home and Claims, the assessments' checks): 24, mint, 8 corners, a 16 check in link green. A solid green square
   with a white tick read as a ticked checkbox she could untick */
html#v8 #app .v8-cek-ok { border-radius: 8px; background: var(--v8-mint); color: var(--v8-green-t); }
html#v8 #app .v8-cek-ok svg.i { color: var(--v8-green-t); fill: var(--v8-green-t); }
