/* ============================================================================
   hs-tokens.css — the design system's tokens. The only stylesheet with raw design values.
   Every system file (hs-typography, hs-btns, hs-form-styles, hs-components) and every feature file reads
   these; none of them writes a colour, a face or a size of its own. Spec and usage: /design-system.

   Two surfaces share one set of semantic tokens:
     Studio  (:root, [data-surface="studio"])  the stylist app: neutral ink, the stylist's accent (Teal without one), Söhne Leicht body.
     Atelier ([data-surface="atelier"])         client-facing pages (the Closet, Catalogs): warm ink on paper,
                                                the stylist's own accent, Söhne Leicht body.
   A component never asks which surface it is on: it reads --t-ink, --t-accent… and the surface decides.
   The stylist's own chrome inside an Atelier page sets data-surface="studio" on its container.
   --stylist-accent (and -strong) is printed on <html> on every page: the logged-in stylist's team's, or on a Closet or Catalog
   that team's (Team::accentStyle, CB-301); both surfaces read it, so a Studio panel inside the Closet keeps it.

   Legacy names (--CHARCOAL, --TEAL, --FONT-BODY…) stay in hs-custom-properties.css; the Studio values below
   point at them so the two can't drift.
   ============================================================================ */

/* ── surface-independent: faces and scales ── */
:root {
	--t-display:  "Sanomat", Georgia, serif;                                  /* names, headings, section titles */
	--t-ui:       "Soehne", "Helvetica Neue", Helvetica, Arial, sans-serif;    /* everything functional */
	--t-mono:     "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;  /* links and code: a copyable value, an embed code */
	--t-wordmark: "Medio", serif;                                             /* the wordmark only */
	--t-btn:      var(--FONT-BODY);                                           /* Overpass: the .btn-sans-* track */

	--t-on-danger: #FFFFFF;             /* text on a danger fill (badges): white on both surfaces */
	--t-ok:        #2E7D4F;             /* a status dot: on, connected */
	--t-warn:      #B08900;             /* a status dot: paused */
	--t-on-photo:  rgba(255, 255, 255, .95);   /* a mark's chip over a photo */
	--t-on-photo-ring: rgba(25, 24, 22, .06);
	--t-veil:      rgba(255, 255, 255, .5);    /* over a photo that is busy */

	--t-fs-micro:    11px;              /* counts under icons, swatch names */
	--t-fs-small:    12px;              /* counts beside rows, meta */
	--t-fs-ui:       13px;              /* filter fields, text buttons, chips; 14px on phones */
	--t-fs-item:     14.25px;           /* a row's name (.t-item): a setting, a notice, a trashed piece; 15.25px on phones (D14, Jeremy, Oct 28) */
	--t-fs-menu:     13px;              /* a menu row (.t-menu-item); 15px on phones */
	--t-fs-help:     13px;
--t-fs-secondary: 13px;   /* .t-secondary, the sentence under a heading */              /* a field's or an option's help (.t-help, .t-help-opt); 14px on phones */
	--t-fs-contents: 13.5px;            /* the contents rail */
	--t-fs-label:    10.5px;            /* spaced capitals: eyebrows, caps text buttons, tabs; 12.5px on phones */
	--t-fs-tag:      10px;              /* a .t-tag's capitals; 11.5px on phones (Jeremy, Nov 12) */
	--t-fs-list-title: 13.5px;          /* a section's title in a phone list (.t-list-title); 17px on phones */
	--t-fs-list-title-sm: 12.5px;       /* the same in a stuck header (.t-list-title.sm); 15px on phones */
	--t-fs-input:    15px;              /* field values; 16px on touch, where iOS zooms smaller fields */

	/* spacing — the name is the px */
	--sp-2: 2px;  --sp-4: 4px;  --sp-6: 6px;  --sp-8: 8px;  --sp-12: 12px; --sp-16: 16px;
	--sp-14: 14px; --sp-18: 18px; --sp-20: 20px; --sp-24: 24px; --sp-28: 28px; --sp-32: 32px; --sp-40: 40px; --sp-48: 48px;

	/* shape (control corners are per surface, below) */
	--r-badge: 2px;                     /* count badges: a small squared tab, never a pill */
	--r-sheet: 14px;                    /* the top corners of a phone sheet */
	--r-pill:  999px;                   /* badges, switches */
	--r-round: 50%;                     /* avatars, radio dots */

	/* elevation: what floats has a shadow; everything else is separated by a line */
	--e-raise:   0 10px 24px -16px rgba(25, 24, 22, .22);   /* a bar that has content scrolling under it; a card lifted on hover */
	--e-menu:    0 2px 6px rgba(25, 24, 22, .10), 0 24px 48px -14px rgba(25, 24, 22, .28); /* small menus under their trigger (white cards). Overlays get shadow alone, never a hairline ring (Jeremy, Nov 11): the tight contact shadow is the edge */
	--e-dialog:  0 30px 70px rgba(25, 24, 22, .30);   /* dialogs */
	--e-toast:   0 14px 36px rgba(25, 24, 22, .28);   /* a message toast */
	--e-float:   0 10px 30px rgba(25, 24, 22, .16), 0 1px 2px rgba(25, 24, 22, .08); /* glass buttons over the page (the room bar) */
	--e-fab:     0 10px 30px rgba(25, 24, 22, .22);   /* a filled round button over the page */
	--e-drag:    0 0 0 1px rgba(25, 24, 22, .08), 0 16px 36px rgba(25, 24, 22, .24); /* a row you are dragging */
	--e-lift:    0 22px 44px rgba(25, 24, 22, .30);   /* a photo you are dragging */
	--e-card:    0 0 0 1px rgba(25, 24, 22, .07), 0 8px 22px -14px rgba(25, 24, 22, .22); /* a notice card */
	--e-bar-top: 0 -1px 0 rgba(25, 24, 22, .08);      /* a bar fixed to the bottom */
	--e-focus:   0 0 0 3px rgba(35, 35, 35, .12);   /* focus-visible on a control */
	--e-knob:    0 1px 2px rgba(0, 0, 0, .2);       /* a switch's knob */

	/* motion */
	--m-fast: .12s;                     /* hover, press, a colour change */
	--m-base: .2s;                      /* open, close, fade */
	--m-slow: .28s;                     /* a sheet or a bar sliding in */
	--m-ease: cubic-bezier(.2, .8, .2, 1); /* decelerating: things arrive and settle */

	/* control heights */
	--h-xs: 24px; --h-sm: 30px; --h-md: 36px; --h-lg: 40px; --h-xl: 42px; --h-hit: 44px; --h-field: 46px; --h-touch: 48px;
	--h-bar: 52px;  --h-bar-touch: 56px; --h-bar-phone: 48px;   /* the studio bar */
	--page-gutter: 48px;                /* a page's side margin (the Studio page, its head, anything fixed beside it): 32 from 1099 down, 16 on phones */
	--h-masthead: 68px; --h-masthead-phone: 64px;               /* the brand bar */
	--h-fab: 58px;                                              /* round buttons in the phone's room bar */
	--h-filterbar: 60px; --h-filterbar-lg: 68px;                /* the filter bar stuck / on the page and on touch */

	/* dimming */
	--o-dim: .36;                       /* an option with nothing behind it (0 pieces) */
	--o-disabled: .55;                  /* an action that can't run yet */

	/* stacking */
	--z-bar: 4; --z-float: 6; --z-scrim: 8; --z-overlay: 9; --z-toast: 1045;   /* a toast above every page layer (the Closet's sticky heads, fixed bars, sheets and their scrims reach 1042: the Trash), under a Bootstrap modal (1050): a tap on its button never lands on what's under it (closet-sheets, an iPhone, Oct 29) */

	/* fields (hs-form-styles.css) — the fixed half; the colour half follows each surface below */
	--f-h:               var(--h-field);  /* field height */
	--f-h-inner:         44px;            /* field inside a group (the border is on the group) */
	--f-h-compact:       33px;            /* narrow toolbar search (a modal filter) */
	--f-h-compact-inner: 31px;            /* the same, inside a group */
	--f-h-pair:          var(--h-xl);     /* a toolbar row beside .btn-display */
	--f-h-pair-inner:    var(--h-xl);     /* the same, inside a group */
	--f-pad:             14px;            /* field padding: help and addons align to it */
	--f-ring:            0 0 0 3px rgba(35, 35, 35, .08);  /* a focused field */
	--f-ctl-card:        14px;            /* the radio inside a choice card */
	--f-gap:             20px;            /* between field groups */
	--f-gap-opt:         10px;            /* between stacked options */
}
/* touch: 16px values (iOS zooms smaller fields) and 48px thumb rows */
@media (max-width: 760px), (pointer: coarse) { :root { --t-fs-input: 16px; } }
/* phones: the reading floor (Jeremy, Oct 22; titles raised Oct 23; raised again Oct 26: "not mobile friendly"): titles in lists 17
   (iOS body size), stuck 15, a row's name 16, body 15, UI text, meta, captions and help 14, spaced capitals 12 */
@media (max-width: 1099px) { :root { --page-gutter: 32px; } }
@media (max-width: 767px) { :root { --t-fs-small: 14px; --t-fs-ui: 14px; --t-fs-item: 15.25px; --t-fs-menu: 15px; --t-fs-help: 14px; --t-fs-label: 12.5px; --t-fs-tag: 11.5px; --t-fs-secondary: 15px; --t-fs-list-title: 17px; --t-fs-list-title-sm: 15px; --page-gutter: 16px; } }
html.touch { --f-h-pair: var(--btn-display-h-touch); --f-h-pair-inner: var(--btn-display-h-touch); }   /* a field paired with .btn-display matches its touch height on either surface */

/* ── Studio: the stylist app (the default), and the stylist's own chrome inside an Atelier page ── */
:root, [data-surface="studio"] {
	--t-ink:        var(--CHARCOAL);    /* primary text, filled controls */
	--t-ink-2:      var(--GUNMETAL);    /* secondary text, control outlines */
	--t-body:       #434343;            /* running text */
	--t-muted:      #7A7A7A;            /* labels, metadata */
	--t-muted-2:    #9A9A9A;            /* placeholders, decorative counts: fails AA as text, never alone */
	--t-help:       #767676;            /* help text: AA on white */
	--t-hairline:   #E2E2E2;            /* rules, card borders */
	--t-field:      #C9C9C9;            /* field borders */
	--t-canvas:     #FCFCFC;            /* page ground */
	--t-surface:    #FFFFFF;            /* cards, fields, dialogs */
	--t-tint:       #F4F4F4;            /* a photo's ground (a piece, a thumbnail) and a disabled control */
	--t-highlight:  var(--t-tint);      /* "you are here": the current row, a focused suggestion */
	--t-disabled:   var(--t-tint);      /* a disabled field, box or choice card */
	--t-ui-weight:  300;                /* Söhne's UI weight: Leicht on both surfaces (Jeremy, Nov 9; Buch 400 read as Arial, Oct 26) */
	--t-chosen:     var(--stylist-accent, var(--t-ink));   /* what is chosen or primary: a check, a radio's dot, the display button, progress, New; the stylist's accent, else ink */
	--t-on-chosen:  var(--t-surface);
	--t-notif:      var(--stylist-accent, var(--t-danger));   /* a count badge: the stylist's accent, else red */
	--t-on-notif:   var(--t-on-danger);
	/* a hovered (or keyed-to) menu row, and what sits in it: its meta, a switch, a danger item */
	--t-menu-hover:        var(--t-wash);
	--t-menu-hover-ink:    var(--t-ink);
	--t-menu-hover-ink-2:  var(--t-muted);
	--t-menu-hover-sw-on:  var(--t-accent);
	--t-menu-hover-sw-off: var(--t-field);
	--t-menu-hover-knob:   var(--t-surface);
	--t-menu-hover-knob-on: var(--t-surface);
	--t-menu-hover-danger: var(--t-wash);
	--t-menu-hover-danger-ink: var(--t-danger);
	--t-wash:       rgba(35, 35, 35, .05); /* hover, a highlighted menu item, a trigger whose menu is open */
	--t-hairline-2: #ECECEC;            /* a rule inside a white card or a menu */
	--t-faded:      #9A9A9A;            /* a hidden item's title, beside its "Hidden" note: never alone */
	--t-hairline-soft: rgba(35, 35, 35, .06); /* the edge of a bar over the page */
	--t-addon:      #F8F8F8;            /* field addons */
	--t-well:       #F4F4F4;            /* a shaded box grouping a sub-form */
	--t-well-line:  #ECECEC;            /* the well's border */
	--t-accent:     var(--stylist-accent, var(--TEAL));   /* the single accent: the stylist's (CB-301, both surfaces: Jeremy, Oct 28), else Teal */
	--t-accent-2:   var(--stylist-accent-strong, var(--stylist-accent, var(--TEAL-DARK)));   /* accent hover; the display button's hover */
	--t-on-accent:  #FFFFFF;            /* text on an accent fill */
	--t-on-accent-muted: rgba(255, 255, 255, .78); /* secondary text on an accent bar */
	--t-on-accent-wash: rgba(255, 255, 255, .16);  /* hover on an accent bar */
	--t-on-ink:     #FFFFFF;            /* text on an ink fill (a chosen tile) */
	--t-on-ink-2:   rgba(255, 255, 255, .7); /* its count */
	--t-danger:     var(--RUBY);        /* errors, counts, destructive actions: icons and fills */
	--t-danger-ink: #BC3126;            /* danger TEXT (an error line, a danger notice's title): 5.8:1 on white, 5.3:1 on the nav grey; --t-danger is 4.1:1 */
	--t-nav-bg:     #F6F6F6;            /* (FAINT-GRAY) the Studio nav's ground behind the white page (#F6F6F6); danger ink is 5.3:1 on it */
	--t-warn-ink:   #8A6A00;            /* warning icons and text (a warning notice's icon): the --t-warn hue at 4.9:1 on white; --t-warn itself (2.9:1) is for a dot */
	--t-bar:        var(--CHARCOAL);    /* dark bars, toasts, tooltips */
	--t-on-bar:     #FFFFFF;            /* text and icons on a dark bar */
	--t-on-bar-muted: #A8A8A8;          /* secondary text on a dark bar (AA) */
	--t-bar-line:   #444444;            /* a rule inside a dark bar */
	--t-glass:      rgba(255, 255, 255, .64); /* a translucent button over the page: colour and shape move under it, no readable text (blur 24px, saturate 1.9) */
	--t-glass-line: rgba(35, 35, 35, .08);
	--t-scrim:      rgba(35, 35, 35, .32); /* behind a dialog or a sheet */
	--t-scrim-soft: rgba(35, 35, 35, .24); /* below a bar that stays in use (the Refine drawer) */
	--t-photo-edge: rgba(35, 35, 35, .65); /* ink at 65%: an edge drawn on a photo that must show on white and on dark (the Finds cropper's frame and handles) */

	--r-ctl:          1px;              /* control, card and tile corners: v4's hairline round, on both surfaces (Jeremy, Oct 26) */

	/* choice controls (hs-form-styles.css): sizes follow the device (phones below), colours the surface */
	--f-ctl:        15px;               /* checkbox and radio box */
	--f-ctl-bw:     1px;                /* its border */
	--f-ctl-bd:     var(--t-ink-2);
	--f-ctl-top:    2.3px;              /* centres the box on the label's first line */
	--f-dot:        7px;                /* a chosen radio's dot */
	--f-choice-lh:  1.35;               /* a choice label's line height */
	--f-sw-w: 32px; --f-sw-h: 18px; --f-sw-knob: 14px; --f-sw-top: 1px;  /* switch */
	--f-sw-on:      var(--t-accent);
	--f-sw-off:     var(--t-field);

	--t-body-weight:  300;              /* Söhne Leicht */
	--t-body-size:    14.5px;           /* running text (.t-body-app) */
	--t-body-lh:      1.55;
	--t-body-lg-size: 16px;             /* longer reading text (.t-body-lg) */
	--t-body-lg-lh:   1.55;

	/* buttons: the action face (hs-typography .btn-display, hs-components .btn-sans-*). Studio is v4's:
	   a Sanomat display button in sentence case and the Overpass caps track */
	--btn-display-font:    500 16.5px/1 var(--t-display);
	--btn-display-ls:      -.01em;
	--btn-display-case:    none;
	--btn-display-h:       var(--h-xl);
	--btn-display-h-touch: var(--h-hit);   /* 44 on touch: the Studio prototype's (v171) phone heads, still a full tap target; the Atelier keeps 48 */
	--btn-sans-face:       var(--FONT-BODY);
	--btn-sans-ls:         .08rem;
	--btn-sans-lg-size:    14px;        /* .btn-sans-lg and -xl */
	--btn-sans-lg-weight:  300;
	--btn-ink:             var(--t-ink-2); /* .btn-ghost-dark: outline, text and .full fill */
}

/* ── Atelier: client-facing pages. The stylist's accent arrives as --stylist-accent on the same element
   (server-rendered and contrast-checked against the canvas); without one it is ink. ── */
[data-surface="atelier"] {
	--btn-display-h-touch: var(--h-touch);   /* the Closet's display buttons stay 48 on touch */
	--t-ink:       #191816;
	--t-ink-2:     #55514B;
	--t-body:      #2A2825;             /* running text: notes, standfirsts */
	--t-muted:     #7A756D;
	--t-muted-2:   #ABA59B;
	--t-help:      #7A756D;
	--t-hairline:  #E3DED5;
	--t-field:     #D9D3C8;
	--t-canvas:    #FBFAF7;
	--t-surface:   #FFFFFF;
	--t-tint:      #F1EEE8;
	--t-highlight: #FFFFFF;             /* white lifts off the warm page; no greige (Jeremy, Oct 26) */
	--t-disabled:  #FFFFFF;             /* disabled is white too: only its grey text says so (Jeremy, Oct 26) */
	/* the stylist's accent marks what is chosen: checks, radios, switches, the display button, progress, New,
	   counts and Copied; never a danger action (Jeremy, Oct 26). Without an accent it is ink. */
	--t-chosen:    var(--t-accent);
	--t-on-chosen: var(--t-on-accent);
	--t-notif:     var(--t-accent);
	--t-on-notif:  var(--t-on-accent);
	/* a hovered menu row inverts to ink, and its switch with it; a danger item fills ruby (Jeremy, Oct 26) */
	--t-menu-hover:        var(--t-ink);
	--t-menu-hover-ink:    var(--t-on-ink);
	--t-menu-hover-ink-2:  var(--t-on-ink-2);
	--t-menu-hover-sw-on:  var(--t-on-ink);
	--t-menu-hover-sw-off: rgba(251, 250, 247, .3);
	--t-menu-hover-knob:   var(--t-on-ink);    /* off: a white knob on the faint track, as a dark switch (Jeremy's review, Oct 28: an ink knob vanished) */
	--t-menu-hover-knob-on: var(--t-ink);     /* on: the ink knob on the white track */
	--t-menu-hover-danger: var(--t-danger);
	--t-menu-hover-danger-ink: var(--t-on-danger);
	--t-wash:      rgba(25, 24, 22, .05);
	--t-hairline-2: #ECE9E3;
	--t-faded:     #8E887F;             /* a hidden section's title, beside its "Hidden" note: never alone */
	--t-hairline-soft: rgba(25, 24, 22, .06);
	--t-addon:     #FFFFFF;             /* the addon, the well and the bar's ink are white, not greige, and the well */
	--t-well:      #FFFFFF;             /* has no hairline: it lifts off the page by itself (Jeremy, Oct 26) */
	--t-well-line: transparent;
	--t-accent:    var(--stylist-accent, #191816);
	--t-accent-2:  var(--stylist-accent-strong, var(--stylist-accent, #191816));
	--t-on-accent: #FBFAF7;
	--t-on-accent-muted: rgba(251, 250, 247, .78);
	--t-on-accent-wash: rgba(251, 250, 247, .16);
	--t-on-ink:    #FBFAF7;
	--t-on-ink-2:  rgba(251, 250, 247, .7);
	--t-danger:    #B3261E;
	--t-danger-ink: #B3261E;            /* already 6.3:1 on the canvas */
	--t-bar:       #191816;             /* the studio bar, toasts and tooltips are ink */
	--t-on-bar:    #FFFFFF;
	--t-on-bar-muted: #ABA59B;
	--t-bar-line:  #3D3A35;
	--t-glass:     rgba(255, 255, 255, .64);
	--t-glass-line: rgba(25, 24, 22, .08);
	--t-scrim:     rgba(25, 24, 22, .32);
	--t-scrim-soft: rgba(25, 24, 22, .24);
	--t-photo-edge: rgba(25, 24, 22, .65);

	--f-ctl-bd:     var(--t-muted-2);
	--f-sw-on:      var(--t-accent);    /* on in the stylist's accent (ink without one) */
	--f-sw-off:     var(--t-hairline);

	--t-body-weight:  300;              /* Söhne Leicht, as the Studio's (Jeremy, Oct 26: was Buch 400) */
	--t-body-size:    14px;
	--t-body-lh:      1.45;
	--t-body-lg-size: 15px;
	--t-body-lg-lh:   1.6;

	/* buttons: the Studio's faces (Sanomat .btn-display, Overpass caps .btn-sans-*), in ink (Jeremy, Oct 26: was the boards' Söhne caps) */
	--btn-ink:             var(--t-ink);
}
/* phones, on every surface (a size is the device's, not the surface's: Jeremy, Oct 26), after both surface blocks so it wins:
   running text, and the choice controls at the boards' sizes */
@media (max-width: 767px) {
	:root, [data-surface] {
		--t-body-size: 15px;                /* (D12's phone floor; above the surfaces' 14.5 and 14, it lost to them: Oct 28) */
		--f-ctl: 18px; --f-ctl-bw: 1.5px; --f-ctl-top: 3px; --f-dot: 8px;
		--f-choice-lh: 1.72;                /* 24px lines at 14px */
		--f-sw-w: 44px; --f-sw-h: 26px; --f-sw-knob: 20px; --f-sw-top: -1px;
	}
}
/* the Atelier page root paints its own ground and ink (Studio containers inside it keep their own grounds) */
[data-surface="atelier"] { background-color: var(--t-canvas); color: var(--t-ink); }

/* ── derived tokens: declared on every surface root, so each resolves against its own surface ──
   (a custom property is computed where it is declared; one set on :root alone would carry Studio's values
   into an Atelier page) ── */
:root, [data-surface] {
	--t-zelle:      #6D1ED4;            /* Zelle's purple: a reported-payment stamp, tag, timeline dot. 7.5:1 on white, so it is text-safe; the same on both surfaces (a brand colour) */
	--t-venmo:      #008CFF;            /* Venmo's blue: a frame, a stamp fill, a dot. 3.4:1 on white, so never text: a Venmo tag keeps ink-2 text and takes the blue on its frame */
	--t-ok-on-bar:  #5DBB82;            /* a paid / ok line on a dark bar: 7.5:1 on --t-bar (--t-ok is for white) */
	--t-warn-on-bar: #D9A93A;           /* a warning line on a dark bar: 8.2:1 on --t-bar (--t-warn-ink is for white) */
	--t-wordmark-amp: var(--t-ink-2);   /* the & in an ink wordmark (.wordmark.ink): a step lighter than its ink. Never teal; a lone & is ink, or white on a dark ground */
	--f-border:    var(--t-field);
	--f-border-on: var(--t-ink);
	--f-help:      var(--t-help);
	--f-addon-bg:  var(--t-addon);
	--f-well:      var(--t-well);
	--f-well-bd:   var(--t-well-line);
	--f-value:     var(--t-body-weight) var(--t-fs-input)/1.2 var(--t-ui);
	--e-pop:       0 2px 6px rgba(25, 24, 22, .10), 0 28px 56px rgba(25, 24, 22, .22); /* a panel over the page: the Refine drawer, search suggestions, View (shadow alone, no ring) */
	--f-radius:    var(--r-ctl);        /* field corners */
}
