/* VORM design tokens: the one place where the site's and the admin's look is decided.
   2026-11 space design (TONE + MOOD renders of the new clinic): night, stone, indirect light, fiber-optic light. The
   clinic is a black room - matte black panels, rough charcoal stone, a textured dark ceiling, light from hidden strips
   that pools on the floor and under the counters, round lamps, and a canopy of thin fiber-optic strands, each ending
   in a small point of white light. No colour: the blue in the renders is the wall screens' video, not the room, and
   the earlier olive theme is gone. The page is the business cards' neutral black (RGB 12, 13, 13).

   Five layers. Component CSS (site.css and the files after it, admin.css) uses layers 2 to 5 only, never a raw
   colour, radius or shadow; tools/check-tokens.mjs fails when one slips in. Gradient stops may use a channel from
   layer 1 with their own alpha (rgb(var(--night-rgb) / .6)), because a gradient's shape is part of its component.
   1 palette       the room's materials, as channels and steps
   2 roles         what a value is for: surfaces, text, lines, fills, shades, states, elevation, radius, layout, motion
   3 light         the room's effects: wash, edge, pool, halo, strip, grain, canopy
   4 parts         one recipe per kind of thing (panel, glass, offer, bar, button, choice, mark, focus); a component
                   rule names its part, so all panels change together
   5 scales        type, space, the size of what you press, motion (2026-11-06): one step per role, so the same kind
                   of thing has the same size everywhere. css/parts.css builds the shared parts from them; both are
                   drawn on admin/design.html. */
:root {
  /* ---- 1 palette ---- */
  --night-rgb: 11 12 12;      /* the page: the cards' black */
  --panel-rgb: 20 21 21;      /* glass over the film */
  --black-rgb: 0 0 0;         /* shadows */
  --white-rgb: 236 234 229;   /* the room's white: text, hairlines, veils (a white lit from above, barely warm) */
  --fiber-rgb: 178 179 175;   /* a strand: silver */
  --light-rgb: 247 246 242;   /* the tip of a strand, the light from a hidden strip */
  --ok-rgb: 222 229 224;      /* done, published: the light is on (a white with the faintest cool) */
  --warn-rgb: 216 199 156;
  --bad-rgb: 224 153 138;
  --night: rgb(var(--night-rgb));
  --night-0: #050606;
  --night-2: #0f1010;
  --stone-1: #141515;
  --stone-2: #1a1b1b;
  --stone-3: #222323;
  --stone-4: #2c2d2d;
  --white: rgb(var(--white-rgb));
  --fiber: rgb(var(--fiber-rgb));
  --light: rgb(var(--light-rgb));

  /* ---- 2 roles ---- */
  /* surfaces, from the back of the room forward */
  --bg: var(--night);                 /* page */
  --bg-0: var(--night-0);             /* behind a closing sheet */
  --bg-2: var(--night-2);             /* drawers, sheets, a page one step forward */
  --panel: var(--stone-1);
  --panel-2: var(--stone-2);
  --raise: var(--stone-3);
  --face: linear-gradient(150deg, var(--stone-4), var(--stone-1));   /* an empty portrait or tile */
  --solid: var(--white);              /* a lit, solid surface: the main button, the QR tile */
  --solid-2: #d9d6cf;                 /* a quieter solid: a promotion's bar on the calendar */
  --on-solid: var(--night);
  --device: linear-gradient(145deg, #3a3b3b, #121313 40%, #262727);   /* the phone in the report scene */
  /* text */
  --text: var(--white);
  --text-2: rgb(var(--white-rgb) / .72);
  --text-3: rgb(var(--white-rgb) / .5);
  --text-4: rgb(var(--white-rgb) / .32);
  --label: var(--fiber);              /* eyebrows, numerals, small labels */
  --lit: var(--light);                /* what is lit: the current chapter, a choice, focus, an offer's price */
  /* lines: white hairlines, and lit lines for a choice */
  --divider: rgb(var(--white-rgb) / .08);
  --line: rgb(var(--white-rgb) / .12);
  --line-2: rgb(var(--white-rgb) / .2);
  --line-3: rgb(var(--white-rgb) / .3);
  --line-4: rgb(var(--white-rgb) / .42);
  --lit-line-1: rgb(var(--light-rgb) / .3);
  --lit-line: rgb(var(--light-rgb) / .5);
  --lit-line-2: rgb(var(--light-rgb) / .75);
  /* fills: white veils for panels and hover, lit veils for a choice */
  --fill-1: rgb(var(--white-rgb) / .025);
  --fill-2: rgb(var(--white-rgb) / .04);
  --fill-3: rgb(var(--white-rgb) / .06);
  --fill-4: rgb(var(--white-rgb) / .09);
  --fill-5: rgb(var(--white-rgb) / .16);
  --lit-fill-1: rgb(var(--light-rgb) / .035);
  --lit-fill-2: rgb(var(--light-rgb) / .06);
  --lit-fill-3: rgb(var(--light-rgb) / .11);
  --lit-fill-4: rgb(var(--light-rgb) / .24);
  --lit-fill-5: rgb(var(--light-rgb) / .55);
  /* shades: the night over things (scrims, backdrops, bars); glass: the panel colour over the film */
  --shade-1: rgb(var(--night-rgb) / .35);
  --shade-2: rgb(var(--night-rgb) / .58);
  --shade-3: rgb(var(--night-rgb) / .8);
  --shade-4: rgb(var(--night-rgb) / .92);
  --glass-1: rgb(var(--panel-rgb) / .52);
  --glass-2: rgb(var(--panel-rgb) / .64);
  --glass-3: rgb(var(--panel-rgb) / .84);
  --glass-4: rgb(var(--panel-rgb) / .93);
  /* states */
  --ok: rgb(var(--ok-rgb)); --warn: rgb(var(--warn-rgb)); --bad: rgb(var(--bad-rgb));
  --warn-2: #ecdfbd; --bad-2: #f1c9bf;   /* the same states as text on their own tint */
  /* elevation */
  --shadow-1: 0 6px 20px rgb(var(--black-rgb) / .45);
  --shadow-2: 0 18px 48px rgb(var(--black-rgb) / .5), 0 2px 8px rgb(var(--black-rgb) / .3);
  --shadow-3: 0 40px 120px rgb(var(--black-rgb) / .55);
  --shadow-drawer: -30px 0 90px rgb(var(--black-rgb) / .5);
  /* radius */
  --r-xs: 6px; --r-s: 10px; --r-m: 14px; --r-l: 20px; --r-xl: 26px; --r-2xl: 40px; --r-pill: 999px; --r-round: 50%;
  /* layout and motion (site) */
  --pad: clamp(20px, 4.4vw, 72px); --header: 76px; --ease: cubic-bezier(.2, .7, .2, 1);
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;

  /* ---- 3 light ---- */
  --wash: linear-gradient(180deg, rgb(var(--light-rgb) / .05), rgb(var(--light-rgb) / 0) 46%);   /* from a strip above */
  --edge: inset 0 1px 0 rgb(var(--light-rgb) / .07);                                              /* a lit top edge */
  --pool: 0 14px 34px -16px rgb(var(--light-rgb) / .42);                                          /* light pooling below */
  --underlight: 0 30px 44px -36px rgb(var(--light-rgb) / .26);                                     /* a counter lit from beneath */
  --halo: 0 0 10px rgb(var(--light-rgb) / .55), 0 0 2px rgb(var(--light-rgb) / .9);              /* a point of light */
  --strip: linear-gradient(90deg, rgb(var(--light-rgb) / 0), rgb(var(--light-rgb) / .34) 50%, rgb(var(--light-rgb) / 0));
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23g)'/%3E%3C/svg%3E");

  /* ---- 4 parts ---- */
  /* canopy: the fiber-optic ceiling over the top of a page (<vorm-canopy>, js/canopy.mjs). A page leaves
     --canopy-room above its title, so the strands hang over open dark, as over the counter in the renders. */
  --canopy-h: 300px;
  --canopy-room: 160px;
  --canopy-density: 210;     /* strands per 100 px of width of a 300 px tall box */
  --canopy-strand: .85;      /* strand brightness */
  --canopy-glow: .46;        /* halo strength */
  --canopy-motion: 10;       /* camera movement with the mouse, or the scroll on touch screens (0 holds the camera) */
  --canopy-fade: .42;        /* where the fade into the page starts, from the top (0..1) */
  --canopy-top-fade: 72px;   /* the strands come out of the ceiling's dark over this height: no hard edge under a bar */
  --canopy-still: url("/img/canopy-still.webp");   /* shown where WebGL2 is missing */
  /* Recipes for backgrounds are images only, so a rule can put a base colour after them:
     background: var(--panel-bg), var(--bg-2). */
  /* panel: a slab of stone, lit from a strip above (cards, list entries, the admin's cards) */
  --panel-bg: var(--grain), var(--wash), linear-gradient(var(--fill-2), var(--fill-2));
  --panel-line: var(--line);
  --panel-shadow: var(--edge), var(--underlight);
  /* glass: a panel over the film; the film shows through, blurred (--glass-tint: how much) */
  --glass-bg: var(--grain), var(--wash), linear-gradient(var(--glass-tint, var(--glass-3)), var(--glass-tint, var(--glass-3)));
  --glass-blur: blur(24px) saturate(1.05);
  /* feature (강조; was offer, 2026-11-16 대표님): a panel with its own light - what the clinic shows first on a page
     (a promotion, a doctor's marks). One or two on a screen; never a button, a choice or a warning (.ui-card--feature) */
  --feature-bg: var(--grain), linear-gradient(180deg, rgb(var(--light-rgb) / .075), rgb(var(--light-rgb) / .012) 62%);
  --feature-line: var(--lit-line-1);
  --feature-shadow: var(--edge), 0 28px 60px -44px rgb(var(--light-rgb) / .5);
  /* plate (2026-11-16): a logo's ground - the quieter solid, as the QR tile is the solid, so a society's or a
     company's mark keeps its own colours on the night and a wide wordmark is not cut (.ui-plate) */
  --plate: var(--solid-2);
  --plate-dark: var(--night);         /* the plate under a logo too light for --plate (white letters; js/partners.mjs logoTone) */
  /* stage (2026-11-30, 장비 · 대표님: '서로 다른 회사 장비라도 일관되게'): a device on a stone plinth in the black room,
     under one light from above, the same ground and light for every device, so
     a cut-out from any maker reads as one collection (.ui-device). The light one is the plate's solid, for comparing. */
  --stage-bg: var(--grain), radial-gradient(78% 52% at 50% -6%, rgb(var(--light-rgb) / .16), rgb(var(--light-rgb) / 0) 70%), linear-gradient(180deg, var(--stone-3), var(--night-2) 92%);
  --stage-line: var(--line);
  --stage-shadow: var(--edge);
  --stage-bg-light: var(--grain), radial-gradient(78% 52% at 50% -6%, rgb(255 255 255 / .55), rgb(255 255 255 / 0) 70%), linear-gradient(180deg, #e7e4dd, var(--solid-2) 92%);

  /* bar: the header and the bars of a sheet; its line is a lit strip */
  --bar-bg: var(--shade-3);
  --bar-blur: blur(18px);
  --bar-line: var(--line);
  /* the main button: a lit solid that throws light below it; the quiet one: a veil with a hairline */
  --btn-bg: var(--solid); --btn-fg: var(--on-solid); --btn-hover: var(--lit); --btn-glow: var(--pool);
  --btn-2-bg: var(--fill-4); --btn-2-line: var(--line-4);
  /* a choice (a chip, a token, a picked cell): lit veil, lit line */
  --pick-bg: var(--lit-fill-3); --pick-line: var(--lit-line-2);
  /* the one chosen in a picker (a day, a time; 2026-11-08): the same light, gathered - the whole line lit, a deeper
     veil, a glow - so it is found at once among many. Still light on the night, never the main button's solid face. */
  --chosen-bg: var(--lit-fill-4); --chosen-line: var(--lit); --chosen-fg: var(--lit);
  --chosen-glow: 0 0 0 1px var(--lit), 0 0 22px -6px rgb(var(--light-rgb) / .7);
  /* a reference kept in view (a booking's own time while it moves): a lit line and a tag, no veil */
  --ref-line: var(--lit-line-2);
  /* off: what cannot be pressed now (a button before its choice, a time someone holds, a day out of range): no face,
     a faint line, faint words - a filled grey reads as on */
  --off-line: var(--line); --off-fg: var(--text-4);
  /* the current place (chapter, tab, nav): a lit line that glows */
  --mark: var(--lit); --mark-glow: 0 0 8px rgb(var(--light-rgb) / .7);
  /* a point of light: the tip of a strand, before an eyebrow */
  --dot-size: 4px; --dot-bg: var(--lit); --dot-glow: var(--halo);
  /* focus */
  --focus: 2px solid var(--lit);
  /* a field's end icon (2026-11-08): a select's chevron, in the text's second tone; a date's calendar sits in the same
     box (--icon-end) at the field's inner edge, so every dropdown's arrow is where the calendar is */
  /* a field written right: a check in the lit tip's colour (2026-11-26) */
  --field-ok: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23f7f6f2' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --chevron-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23eceae5' stroke-opacity='.72' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

  /* ---- 5 scales ---- */
  /* type: one size per role; the titles grow with the screen from a phone to a wide desktop */
  --fs-label: 11px;                          /* caps labels (VORM Caps6): TREATMENTS, VISIT */
  --fs-meta: 12px;                           /* what can be skipped: counts, dates, a field's hint, a source */
  --fs-row-meta: 12px;                       /* the small lines under a treatment row's name: its devices (.t-meta)
                                                and its offer (.ui-marquee); 11.5px on phones, where the rows are
                                                tight (2026-11-13: one value, so the two lines match) */
  --fs-small: 13px;                          /* secondary lines, tags, small buttons, table cells, kickers */
  --fs-note: 14px;                           /* a condition that changes a decision: VAT, an offer's period and
                                                who it is for, an exception to the hours. Never in meta. */
  --fs-control: 14px;                        /* buttons, tabs, chips, a field's label */
  --fs-body: 15px;                           /* reading text, a row's name and price, what is typed */
  --fs-lead: 17px;                           /* the line under a page's title, a quote */
  --fs-title-s: 20px;                        /* a small card's title, a price that leads */
  --fs-title: clamp(22px, 2vw, 28px);        /* a card's title, a dialog's title */
  --fs-section: clamp(26px, 2.6vw, 40px);    /* a section's title */
  --fs-page: clamp(32px, 3.6vw, 52px);       /* a page's title */
  --fs-story: clamp(30px, 3.9vw, 60px);      /* the story's lines over the film */
  --fs-hero: clamp(46px, 7.2vw, 116px);      /* the opening line */
  --fw-regular: 400; --fw-medium: 500; --fw-bold: 600;
  --lh-tight: 1.1; --lh-snug: 1.35; --lh-body: 1.6;
  --ls-title: -.035em; --ls-heading: -.02em; --ls-label: .24em; --ls-numeral: .06em;
  --caps: "VORM Caps6", var(--sans);
  /* space: 4 px steps; --section between the sections of a page */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
  --sp-14: 56px; --sp-18: 72px; --sp-24: 96px;
  --section: clamp(72px, 10vw, 140px);
  /* what you press: s inside a card or a row, m in a bar or a row of choices, l the action of a screen;
     a tag (not pressed) and a field (typed in) have their own. --hit: the least a finger can press (2026-11-07,
     benchmark): m and l are at least that tall; s keeps its look and its pressable area grows to --hit on touch
     screens (css/parts.css). */
  --h-s: 34px; --h-m: 44px; --h-l: 52px; --h-tag: 26px; --h-field: 48px; --hit: 44px; --icon-end: 16px;
  /* the phone's booking bar at the foot of the screen (an l button with sp-3 around it); what floats on a phone
     sits --bar-h + sp-3 above the bottom (plus the safe area) */
  --bar-h: calc(var(--h-l) + 2 * var(--sp-3));
  /* motion: fast for colour, line and fill, base for small moves and reveals, slow for sheets and drawers */
  --dur-fast: .2s; --dur-base: .3s; --dur-slow: .5s;
  /* screen widths (a media query cannot read a variable, so the CSS writes these numbers):
     phone  (max-width: 760px), (orientation: portrait) and (max-width: 900px)
     tablet (max-width: 1080px)
     desktop above */

  color-scheme: dark;
}
@media (max-width: 760px) {
  :root { --canopy-h: 190px; --canopy-room: 84px; }
}
@media (max-width: 760px), (orientation: portrait) and (max-width: 900px) {
  :root { --fs-row-meta: 11.5px; }
}

/* The fiber canopy: <vorm-canopy class="canopy"> as the first child of a positioned box (js/canopy.mjs draws it,
   fade included). It hangs from the box's top edge and never takes clicks; without WebGL2 it shows the still. */
.canopy { display: block; position: absolute; z-index: 0; inset: 0 0 auto; height: var(--canopy-h); pointer-events: none; }
.canopy canvas { display: block; width: 100%; height: 100%; }
.canopy--still { background: var(--canopy-still) top center / cover no-repeat;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 var(--canopy-top-fade)); mask-image: linear-gradient(180deg, transparent, #000 var(--canopy-top-fade)); }

/* A point of light: the tip of a strand, before an eyebrow or on the current item. */
.lit-dot { display: inline-block; width: var(--dot-size); height: var(--dot-size); border-radius: var(--r-round); background: var(--dot-bg); box-shadow: var(--dot-glow); }
