/* app.css - the one stylesheet every screen is drawn from (D365, D368).

   It began as the approved canvas's foundations.css (docs/reference/redesign-a,
   D367) and is the product's own from here: a change to the look is a change
   to this file.

   Three layers, in this order:
     1. tokens      every size, space, radius, colour and shadow, defined once;
                    light values first, dark values after (the same names)
     2. components  the parts screens are made of; they read tokens only
     3. utilities   small single-purpose classes on the same scales, for the
                    layout a component does not own

   Nothing outside this file writes a raw value. A screen carries classes,
   never a style attribute. Change a token here and every screen follows. */

/* The font (D367): IBM Plex Sans Arabic, shipped with the product under its
   open licence (fonts/ibm-plex-sans-arabic/OFL.txt) rather than fetched from
   Google - the Content-Security-Policy lets nothing in from outside. One file
   a script and a weight; the browser fetches only the scripts a page uses. */
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/ibm-plex-sans-arabic/arabic-400.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/ibm-plex-sans-arabic/arabic-500.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/ibm-plex-sans-arabic/arabic-600.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/ibm-plex-sans-arabic/arabic-700.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/ibm-plex-sans-arabic/latin-ext-400.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/ibm-plex-sans-arabic/latin-ext-500.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/ibm-plex-sans-arabic/latin-ext-600.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/ibm-plex-sans-arabic/latin-ext-700.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/ibm-plex-sans-arabic/latin-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/ibm-plex-sans-arabic/latin-500.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/ibm-plex-sans-arabic/latin-600.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/ibm-plex-sans-arabic/latin-700.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ============================== 1. tokens ============================== */

:root,
[data-theme="light"] {
  color-scheme: light;

  /* type: seven sizes, three weights */
  --font: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --font-mono: ui-monospace, monospace;
  --fs-12: 12px;
  --fs-13: 13px;
  --fs-14: 14px;
  --fs-16: 16px;
  --fs-20: 20px;
  --fs-24: 24px;
  --fs-26: 26px;
  --fw-400: 400;
  --fw-500: 500;
  --fw-600: 600;
  --fw-700: 700;
  --lh-tight: 1.3;
  --lh-snug: 1.5;
  --lh-body: 1.7;

  /* spacing: a step of four */
  --sp-4: 4px;
  --sp-8: 8px;
  --sp-12: 12px;
  --sp-16: 16px;
  --sp-20: 20px;
  --sp-24: 24px;
  --sp-32: 32px;
  --sp-48: 48px;

  /* radius: four */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-round: 999px;

  /* sizes that are not spacing */
  --control-h: 40px;
  --control-h-sm: 32px;
  --icon-btn: 44px;
  --side-w: 276px;
  --side-w-collapsed: 76px;
  --footer-h: 36px;
  --content-max: 1240px;
  --field-max: 480px;
  --menu-w: 380px;

  /* colour roles */
  --page: #F1F2EF;
  --surface: #FFFFFF;
  --sunken: #F6F6F3;
  --hover: #F3F5F9;
  --row-hover: #F7F9FD;
  --neutral-soft: #EDEEF0;

  --text: #1B1F24;
  --text-2: #454D57;
  --muted: #5B6470;
  --subtle: #7A838F;
  --faint: #8A929C;

  --line: #E3E5E8;
  --line-strong: #D3D7DB;
  --line-soft: #EEF0F2;
  --line-hover: #BFC5CB;
  --sep: #B8BEC6;

  --brand: #1F4FB5;
  --brand-hover: #173C8C;
  --brand-text: #1F4FB5;
  --brand-soft: #EEF3FC;
  --brand-sel: #E8EEFA;
  --brand-line: #D3DFF5;
  --brand-mid: #8FA6DD;
  --on-brand: #FFFFFF;

  --ok: #1E8A4C;
  --ok-text: #17633A;
  --ok-soft: #E3F2E8;
  --ok-line: #CFE6D8;
  --ok-wash: #F4F9F6;

  --warn: #B7791F;
  --warn-text: #7E4505;
  --warn-soft: #FBEEDA;
  --warn-wash: #FBF1DC;
  --warn-line: #E0C48F;

  --danger: #B4232C;
  --danger-text: #9B1C25;
  --danger-soft: #FBE5E6;
  --danger-line: #E6B8BB;
  --danger-wash: #FFF7F7;

  --info: #1C4B76;
  --info-soft: #E3EDF7;
  --accent: #4A31B8;
  --accent-soft: #EDE8FB;

  --shadow-1: 0 1px 2px rgba(27, 31, 36, .05);
  --shadow-2: 0 2px 8px rgba(27, 31, 36, .05);
  --shadow-3: 0 6px 24px rgba(27, 31, 36, .10);
  --focus-ring: var(--brand-line);
  --backdrop: rgba(15, 18, 23, .45);
  /* the palette of docs/reference/design-refine (D381): a cool blue-grey ground, white surfaces, a brighter blue */
  --page: #F3F5FB;
  --surface: #FFFFFF;
  --sunken: #F6F8FC;
  --hover: #EEF3FD;
  --row-hover: #F5F8FE;
  --neutral-soft: #EDF1F7;
  --text: #0F1B2D;
  --text-2: #33415A;
  --muted: #5A6880;
  --subtle: #75839A;
  --faint: #8794A8;
  --line: #E4E9F2;
  --line-strong: #D3DBE8;
  --line-soft: #EDF1F7;
  --line-hover: #B9C4D6;
  --sep: #B3BECF;
  --brand: #1366FD;
  --brand-hover: #0B54D6;
  --brand-text: #0B5BE3;
  --brand-soft: #EAF1FF;
  --brand-sel: #E7EFFE;
  --brand-line: #BBD3FD;
  --brand-mid: #7AA6FB;
  --ok: #15A05A;
  --ok-text: #0E7A43;
  --ok-soft: #E6F8EE;
  --ok-line: #BFE8D2;
  --ok-wash: #F3FBF7;
  --warn: #D98200;
  --warn-text: #A35A00;
  --warn-soft: #FDF1D7;
  --warn-wash: #FFF6E6;
  --warn-line: #F0D39A;
  --danger: #DC3545;
  --danger-text: #B42318;
  --danger-soft: #FDE8E8;
  --danger-line: #F5B8BA;
  --danger-wash: #FFF6F6;
  --shadow-1: 0 1px 2px rgba(15, 27, 45, .05);
  --shadow-2: 0 2px 8px rgba(15, 27, 45, .06);
  --shadow-3: 0 8px 28px rgba(15, 27, 45, .12);
  /* the frame (D377): the colours of the side menu, the top bar, the footer and the ground they sit on */
  --f-ground: #F3F5FB;
  --f-side: #FFFFFF;
  --f-active-bg: var(--brand-sel);
  --f-active-text: var(--brand-text);
  --f-kid-bg: var(--brand-sel);
  --f-kid-text: var(--brand-text);
  --f-head: #FFFFFF;
  --f-ctrl: #F5F7FB;
  --f-head-line: #E4E9F2;
  --f-foot: #FFFFFF;
  --f-foot-line: #E4E9F2;
  --f-shadow: 0 1px 2px rgba(15, 27, 45, .05);
  --f-notice-btn: #FFFFFF;
  --f-logo-bg: var(--brand);
  --f-logo-text: var(--on-brand);
}

/* Dark: the same names, other values. The browser's choice until the person
   picks one, then their pick - the product's own rule (D217). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0F1217;
    --surface: #171B21;
    --sunken: #1C2128;
    --hover: #232931;
    --row-hover: #1F252D;
    --neutral-soft: #262C35;
    --text: #E7EAEE;
    --text-2: #C5CBD3;
    --muted: #9BA3AE;
    --subtle: #858E99;
    --faint: #6C757F;
    --line: #2B323B;
    --line-strong: #3A424D;
    --line-soft: #232930;
    --line-hover: #4A535F;
    --sep: #4A535F;
    --brand: #3D6BE0;
    --brand-hover: #5480EA;
    --brand-text: #8CB0FA;
    --brand-soft: #1A2742;
    --brand-sel: #1E2E50;
    --brand-line: #2E4672;
    --brand-mid: #4F6FB5;
    --on-brand: #FFFFFF;
    --ok: #3DAE6E;
    --ok-text: #7DD3A0;
    --ok-soft: #15301F;
    --ok-line: #24503A;
    --ok-wash: #12201A;
    --warn: #D29A3A;
    --warn-text: #EDC27A;
    --warn-soft: #35270F;
    --warn-wash: #2B2210;
    --warn-line: #5A4419;
    --danger: #E5484D;
    --danger-text: #FF9EA1;
    --danger-soft: #3A181A;
    --danger-line: #5E2629;
    --danger-wash: #251416;
    --info: #8FC1EE;
    --info-soft: #142839;
    --accent: #B9A8FF;
    --accent-soft: #282250;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-2: 0 2px 8px rgba(0, 0, 0, .45);
    --shadow-3: 0 6px 24px rgba(0, 0, 0, .6);
    --backdrop: rgba(0, 0, 0, .6);
    /* the palette of docs/reference/design-refine (D381), dark: deep navy, not grey */
    --page: #0A1424;
    --surface: #111D2F;
    --sunken: #0D1A29;
    --hover: #172640;
    --row-hover: #14233A;
    --neutral-soft: #1B2A40;
    --text: #E8EEF8;
    --text-2: #C4D0E2;
    --muted: #93A4BF;
    --subtle: #7C8EAB;
    --faint: #667896;
    --line: #1E2E45;
    --line-strong: #2A3E5B;
    --line-soft: #162338;
    --line-hover: #3A5073;
    --sep: #3A5073;
    --brand: #2566EE;
    --brand-hover: #3C7AF5;
    --brand-text: #7DB0FF;
    --brand-soft: #0F2447;
    --brand-sel: #0C2B5C;
    --brand-line: #1F4D96;
    --brand-mid: #3D6FC6;
    --ok: #2FBF71;
    --ok-text: #6FE0A4;
    --ok-soft: #153A33;
    --ok-line: #1F5A47;
    --ok-wash: #0F2621;
    --warn: #E0A030;
    --warn-text: #F2BF63;
    --warn-soft: #3A2D18;
    --warn-wash: #2A231C;
    --warn-line: #6B4F1E;
    --danger: #F0555A;
    --danger-text: #FF9EA1;
    --danger-soft: #3A1B22;
    --danger-line: #62282E;
    --danger-wash: #26151B;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-2: 0 2px 8px rgba(0, 0, 0, .45);
    --shadow-3: 0 8px 28px rgba(0, 0, 0, .6);
    /* the frame (D377), dark */
    --f-ground: #0A1424;
    --f-side: #0B1625;
    --f-active-bg: var(--brand-sel);
    --f-active-text: var(--brand-text);
    --f-kid-bg: var(--brand-sel);
    --f-kid-text: var(--brand-text);
    --f-head: #101D30;
    --f-ctrl: #14243A;
    --f-head-line: #1C2C43;
    --f-foot: #0C1727;
    --f-foot-line: #1C2C43;
    --f-shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --f-notice-btn: #3A2D18;
    --f-logo-bg: var(--brand);
    --f-logo-text: var(--on-brand);
  }
}

[data-theme="dark"] {
  color-scheme: dark;
  --page: #0F1217;
  --surface: #171B21;
  --sunken: #1C2128;
  --hover: #232931;
  --row-hover: #1F252D;
  --neutral-soft: #262C35;
  --text: #E7EAEE;
  --text-2: #C5CBD3;
  --muted: #9BA3AE;
  --subtle: #858E99;
  --faint: #6C757F;
  --line: #2B323B;
  --line-strong: #3A424D;
  --line-soft: #232930;
  --line-hover: #4A535F;
  --sep: #4A535F;
  --brand: #3D6BE0;
  --brand-hover: #5480EA;
  --brand-text: #8CB0FA;
  --brand-soft: #1A2742;
  --brand-sel: #1E2E50;
  --brand-line: #2E4672;
  --brand-mid: #4F6FB5;
  --on-brand: #FFFFFF;
  --ok: #3DAE6E;
  --ok-text: #7DD3A0;
  --ok-soft: #15301F;
  --ok-line: #24503A;
  --ok-wash: #12201A;
  --warn: #D29A3A;
  --warn-text: #EDC27A;
  --warn-soft: #35270F;
  --warn-wash: #2B2210;
  --warn-line: #5A4419;
  --danger: #E5484D;
  --danger-text: #FF9EA1;
  --danger-soft: #3A181A;
  --danger-line: #5E2629;
  --danger-wash: #251416;
  --info: #8FC1EE;
  --info-soft: #142839;
  --accent: #B9A8FF;
  --accent-soft: #282250;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-2: 0 2px 8px rgba(0, 0, 0, .45);
  --shadow-3: 0 6px 24px rgba(0, 0, 0, .6);
  --backdrop: rgba(0, 0, 0, .6);
  /* the palette of docs/reference/design-refine (D381), dark: deep navy, not grey */
  --page: #0A1424;
  --surface: #111D2F;
  --sunken: #0D1A29;
  --hover: #172640;
  --row-hover: #14233A;
  --neutral-soft: #1B2A40;
  --text: #E8EEF8;
  --text-2: #C4D0E2;
  --muted: #93A4BF;
  --subtle: #7C8EAB;
  --faint: #667896;
  --line: #1E2E45;
  --line-strong: #2A3E5B;
  --line-soft: #162338;
  --line-hover: #3A5073;
  --sep: #3A5073;
  --brand: #2566EE;
  --brand-hover: #3C7AF5;
  --brand-text: #7DB0FF;
  --brand-soft: #0F2447;
  --brand-sel: #0C2B5C;
  --brand-line: #1F4D96;
  --brand-mid: #3D6FC6;
  --ok: #2FBF71;
  --ok-text: #6FE0A4;
  --ok-soft: #153A33;
  --ok-line: #1F5A47;
  --ok-wash: #0F2621;
  --warn: #E0A030;
  --warn-text: #F2BF63;
  --warn-soft: #3A2D18;
  --warn-wash: #2A231C;
  --warn-line: #6B4F1E;
  --danger: #F0555A;
  --danger-text: #FF9EA1;
  --danger-soft: #3A1B22;
  --danger-line: #62282E;
  --danger-wash: #26151B;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-2: 0 2px 8px rgba(0, 0, 0, .45);
  --shadow-3: 0 8px 28px rgba(0, 0, 0, .6);
  /* the frame (D377), dark */
  --f-ground: #0A1424;
  --f-side: #0B1625;
  --f-active-bg: var(--brand-sel);
  --f-active-text: var(--brand-text);
  --f-kid-bg: var(--brand-sel);
  --f-kid-text: var(--brand-text);
  --f-head: #101D30;
  --f-ctrl: #14243A;
  --f-head-line: #1C2C43;
  --f-foot: #0C1727;
  --f-foot-line: #1C2C43;
  --f-shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --f-notice-btn: #3A2D18;
  --f-logo-bg: var(--brand);
  --f-logo-text: var(--on-brand);
}

/* ---- the frame's choices (D377): dark side menu, blue top bar; a person's pick, kept by their browser ---- */
[data-frame="dark"] {
  --f-ground: #E7E9EE;
  --f-side: #1B2333;
  --f-active-bg: #2F62D6;
  --f-kid-bg: rgba(255, 255, 255, .10);
  --f-kid-text: #FFFFFF;
  --f-active-text: #FFFFFF;
}
[data-frame="blue"] {
  --f-ground: #E6ECF5;
  --f-head: #D6E3FA;
  --f-ctrl: #FFFFFF;
  --f-head-line: #B9CDF2;
  --f-foot: rgba(214, 227, 250, .6);
  --f-foot-line: #C6D6F5;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"])[data-frame="dark"] {
    --f-side: #0A0F18;
  }
  :root:not([data-theme="light"])[data-frame="blue"] {
    --f-head: #172540;
    --f-head-line: #2E4672;
  }
}
[data-theme="dark"][data-frame="dark"] {
  --f-side: #0A0F18;
}
[data-theme="dark"][data-frame="blue"] {
  --f-head: #172540;
  --f-head-line: #2E4672;
}

/* a dark side menu reads light text on its own ground */
[data-frame="dark"] .side {
  color-scheme: dark;
  --text: #F2F5FB;
  --text-2: #C9D0DC;
  --muted: #9AA6BA;
  --subtle: #8794AB;
  --faint: #74839C;
  --line: rgba(255, 255, 255, .14);
  --line-strong: rgba(255, 255, 255, .22);
  --line-soft: rgba(255, 255, 255, .10);
  --line-hover: rgba(255, 255, 255, .30);
  --hover: rgba(255, 255, 255, .08);
  --surface: rgba(255, 255, 255, .06);
  --sunken: rgba(255, 255, 255, .07);
  --brand-text: #B4CBFB;
  --brand-sel: rgba(120, 160, 255, .28);
  --brand-line: rgba(140, 170, 255, .45);
}

/* the blue frame folds into a blue menu with white marks (wide screens only: a narrow screen never folds it) */
@media (min-width: 901px) {
  [data-frame="blue"][data-side="collapsed"] {
    --f-side: var(--brand);
    --f-active-bg: #FFFFFF;
    --f-active-text: #1F4FB5;
    --f-logo-bg: #FFFFFF;
    --f-logo-text: #1F4FB5;
  }
  [data-frame="blue"][data-side="collapsed"] .side {
    color-scheme: dark;
    --text: #FFFFFF;
    --text-2: #DCE6FB;
    --muted: #C3D3F6;
    --subtle: #B2C5F2;
    --faint: #A0B6EC;
    --line: rgba(255, 255, 255, .22);
    --line-strong: rgba(255, 255, 255, .30);
    --line-soft: rgba(255, 255, 255, .16);
    --hover: rgba(255, 255, 255, .12);
    --surface: rgba(255, 255, 255, .10);
    --sunken: rgba(255, 255, 255, .10);
  }
}

/* the three swatches that choose a frame */
.sw-clean {
  --sw-a: #FFFFFF;
  --sw-b: #E9EDF3;
}
.sw-dark {
  --sw-a: #1B2333;
  --sw-b: #2F62D6;
}
.sw-blue {
  --sw-a: #D6E3FA;
  --sw-b: #1F4FB5;
}



/* on paper: the light theme's tokens, whatever the screen shows */
@media print {
  :root:root:root {
  color-scheme: light;

  /* type: seven sizes, three weights */
  --font: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --font-mono: ui-monospace, monospace;
  --fs-12: 12px;
  --fs-13: 13px;
  --fs-14: 14px;
  --fs-16: 16px;
  --fs-20: 20px;
  --fs-24: 24px;
  --fs-26: 26px;
  --fw-400: 400;
  --fw-500: 500;
  --fw-600: 600;
  --fw-700: 700;
  --lh-tight: 1.3;
  --lh-snug: 1.5;
  --lh-body: 1.7;

  /* spacing: a step of four */
  --sp-4: 4px;
  --sp-8: 8px;
  --sp-12: 12px;
  --sp-16: 16px;
  --sp-20: 20px;
  --sp-24: 24px;
  --sp-32: 32px;
  --sp-48: 48px;

  /* radius: four */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-round: 999px;

  /* sizes that are not spacing */
  --control-h: 40px;
  --control-h-sm: 32px;
  --icon-btn: 44px;
  --side-w: 276px;
  --side-w-collapsed: 76px;
  --footer-h: 36px;
  --content-max: 1240px;
  --field-max: 480px;
  --menu-w: 380px;

  /* colour roles */
  --page: #F1F2EF;
  --surface: #FFFFFF;
  --sunken: #F6F6F3;
  --hover: #F3F5F9;
  --row-hover: #F7F9FD;
  --neutral-soft: #EDEEF0;

  --text: #1B1F24;
  --text-2: #454D57;
  --muted: #5B6470;
  --subtle: #7A838F;
  --faint: #8A929C;

  --line: #E3E5E8;
  --line-strong: #D3D7DB;
  --line-soft: #EEF0F2;
  --line-hover: #BFC5CB;
  --sep: #B8BEC6;

  --brand: #1F4FB5;
  --brand-hover: #173C8C;
  --brand-text: #1F4FB5;
  --brand-soft: #EEF3FC;
  --brand-sel: #E8EEFA;
  --brand-line: #D3DFF5;
  --brand-mid: #8FA6DD;
  --on-brand: #FFFFFF;

  --ok: #1E8A4C;
  --ok-text: #17633A;
  --ok-soft: #E3F2E8;
  --ok-line: #CFE6D8;
  --ok-wash: #F4F9F6;

  --warn: #B7791F;
  --warn-text: #7E4505;
  --warn-soft: #FBEEDA;
  --warn-wash: #FBF1DC;
  --warn-line: #E0C48F;

  --danger: #B4232C;
  --danger-text: #9B1C25;
  --danger-soft: #FBE5E6;
  --danger-line: #E6B8BB;
  --danger-wash: #FFF7F7;

  --info: #1C4B76;
  --info-soft: #E3EDF7;
  --accent: #4A31B8;
  --accent-soft: #EDE8FB;

  --shadow-1: 0 1px 2px rgba(27, 31, 36, .05);
  --shadow-2: 0 2px 8px rgba(27, 31, 36, .05);
  --shadow-3: 0 6px 24px rgba(27, 31, 36, .10);
  --focus-ring: var(--brand-line);
  --backdrop: rgba(15, 18, 23, .45);
  /* the palette of docs/reference/design-refine (D381): a cool blue-grey ground, white surfaces, a brighter blue */
  --page: #F3F5FB;
  --surface: #FFFFFF;
  --sunken: #F6F8FC;
  --hover: #EEF3FD;
  --row-hover: #F5F8FE;
  --neutral-soft: #EDF1F7;
  --text: #0F1B2D;
  --text-2: #33415A;
  --muted: #5A6880;
  --subtle: #75839A;
  --faint: #8794A8;
  --line: #E4E9F2;
  --line-strong: #D3DBE8;
  --line-soft: #EDF1F7;
  --line-hover: #B9C4D6;
  --sep: #B3BECF;
  --brand: #1366FD;
  --brand-hover: #0B54D6;
  --brand-text: #0B5BE3;
  --brand-soft: #EAF1FF;
  --brand-sel: #E7EFFE;
  --brand-line: #BBD3FD;
  --brand-mid: #7AA6FB;
  --ok: #15A05A;
  --ok-text: #0E7A43;
  --ok-soft: #E6F8EE;
  --ok-line: #BFE8D2;
  --ok-wash: #F3FBF7;
  --warn: #D98200;
  --warn-text: #A35A00;
  --warn-soft: #FDF1D7;
  --warn-wash: #FFF6E6;
  --warn-line: #F0D39A;
  --danger: #DC3545;
  --danger-text: #B42318;
  --danger-soft: #FDE8E8;
  --danger-line: #F5B8BA;
  --danger-wash: #FFF6F6;
  --shadow-1: 0 1px 2px rgba(15, 27, 45, .05);
  --shadow-2: 0 2px 8px rgba(15, 27, 45, .06);
  --shadow-3: 0 8px 28px rgba(15, 27, 45, .12);
  /* the frame (D377): the colours of the side menu, the top bar, the footer and the ground they sit on */
  --f-ground: #F3F5FB;
  --f-side: #FFFFFF;
  --f-active-bg: var(--brand-sel);
  --f-active-text: var(--brand-text);
  --f-kid-bg: var(--brand-sel);
  --f-kid-text: var(--brand-text);
  --f-head: #FFFFFF;
  --f-ctrl: #F5F7FB;
  --f-head-line: #E4E9F2;
  --f-foot: #FFFFFF;
  --f-foot-line: #E4E9F2;
  --f-shadow: 0 1px 2px rgba(15, 27, 45, .05);
  --f-notice-btn: #FFFFFF;
  --f-logo-bg: var(--brand);
  --f-logo-text: var(--on-brand);
  }
}

/* ============================ 2. components ============================ */

/* ---- base ---- */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--text); font-family: var(--font); }
a { color: var(--brand-text); }
a:hover { color: var(--brand-hover); }
[data-theme="dark"] a:hover { color: var(--text); }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }

/* ---- the application frame ---- */
.app { min-height: 100vh; display: flex; flex-direction: column; background: var(--page); color: var(--text); font-family: var(--font); }
.shell { flex: 1; display: flex; flex-wrap: wrap; align-items: stretch; }
.content { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }

/* the test-environment banner */
.envbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--sp-8) var(--sp-16); padding: var(--sp-8) var(--sp-32); background: var(--warn-wash); color: var(--warn-text); border-bottom: 1px solid var(--warn-line); font-size: var(--fs-14); font-weight: var(--fw-500); }
.envbar .btn { min-height: var(--control-h-sm); font-size: var(--fs-13); background: var(--surface); border-color: var(--warn-line); color: var(--warn-text); }
.vsep { width: 1px; height: 14px; background: var(--line-strong); }
.envbar .vsep { background: var(--warn-line); }

/* the side menu */
/* the company being worked on, at the top of the side menu; it opens the switch */
.company { display: flex; align-items: center; gap: var(--sp-12); width: 100%; padding: var(--sp-8) var(--sp-12) var(--sp-8) var(--sp-8); margin-bottom: var(--sp-8); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.company:hover { background: var(--hover); border-color: var(--line-hover); }
.company-mark { flex: none; width: 36px; height: 36px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--ok-soft); color: var(--ok-text); font-weight: var(--fw-700); }
.company-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.company-name b { font-size: var(--fs-14); font-weight: var(--fw-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-name span { font-size: var(--fs-12); color: var(--muted); }
.company > svg { flex: none; color: var(--muted); }
.side { flex: 0 0 var(--side-w); width: var(--side-w); background: var(--surface); border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; gap: var(--sp-8); padding: var(--sp-20) var(--sp-16); }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-12); padding: 0 var(--sp-8) var(--sp-16); }
.logo { width: 34px; height: 34px; border-radius: var(--r-md); background: var(--brand); color: var(--on-brand); display: flex; align-items: center; justify-content: center; font-weight: var(--fw-700); }
.brandtext { font-weight: var(--fw-700); font-size: var(--fs-16); }
.navlist { display: flex; flex-direction: column; gap: var(--sp-4); }
.spacer { flex: 1; min-height: var(--sp-12); }
.grp { font-size: var(--fs-12); font-weight: var(--fw-600); color: var(--subtle); padding: var(--sp-16) var(--sp-12) var(--sp-8); margin-top: var(--sp-8); border-top: 1px solid var(--line-soft); }
.nav { display: flex; align-items: center; gap: var(--sp-12); min-height: var(--icon-btn); padding: 0 var(--sp-12); border-radius: var(--r-md); color: var(--text-2); text-decoration: none; font-size: var(--fs-14); font-weight: var(--fw-500); }
.nav:hover { background: var(--hover); color: var(--text-2); }
.nav.on { background: var(--brand-sel); color: var(--brand-text); font-weight: var(--fw-600); box-shadow: inset -3px 0 0 var(--brand); }
.nav.on:hover { background: var(--brand-sel); }
.nav.sumon { color: var(--brand-text); font-weight: var(--fw-600); }
.inv-g > summary { list-style: none; cursor: pointer; }
.inv-g > summary::-webkit-details-marker { display: none; }
.inv-g[open] > summary .chev { transform: rotate(180deg); }
.subs { display: flex; flex-direction: column; gap: 1px; margin: var(--sp-4) 0; padding-inline-start: var(--sp-32); }
.sub { display: flex; align-items: center; gap: var(--sp-12); min-height: 38px; padding: 0 var(--sp-12); border-radius: var(--r-md); color: var(--text-2); text-decoration: none; font-size: var(--fs-14); font-weight: var(--fw-500); }
.sub:hover { background: var(--hover); color: var(--text-2); }
.sub.on { background: var(--brand-sel); color: var(--brand-text); font-weight: var(--fw-600); }
.sub.on:hover { background: var(--brand-sel); }
.sub .cnt { font-size: var(--fs-12); color: var(--muted); }
.sdt { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.sg { font-size: var(--fs-12); color: var(--subtle); font-weight: var(--fw-600); padding: var(--sp-12) var(--sp-12) var(--sp-4); }
.ssep { height: 1px; background: var(--line-soft); margin: var(--sp-8) var(--sp-12); }
.sbt { width: var(--control-h); height: var(--control-h); flex: 0 0 var(--control-h); border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.sbt:hover { background: var(--hover); }
/* the environment the person is in, one row; changing it opens a window that asks */
.envrow { display: flex; align-items: center; gap: var(--sp-8); padding: var(--sp-4) var(--sp-4) var(--sp-4) var(--sp-12); border-radius: var(--r-md); border: 1px solid var(--warn-line); background: var(--warn-wash); color: var(--warn-text); font-size: var(--fs-13); font-weight: var(--fw-600); }
.envrow .lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.envrow .btn { min-height: var(--control-h-sm); padding: 0 var(--sp-12); background: var(--surface); border-color: var(--warn-line); color: var(--warn-text); font-size: var(--fs-13); }
.envrow.real { border-color: var(--line); background: var(--sunken); color: var(--text-2); }
.envrow.real .btn { border-color: var(--line-strong); color: var(--text); }

/* a window that asks before something that is hard to undo (the environment) */
.scrim { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: var(--sp-24); background: var(--backdrop); }
.dialog { width: 100%; max-width: var(--field-max); display: flex; flex-direction: column; gap: var(--sp-16); padding: var(--sp-24); background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-3); }
.dialog-actions { display: flex; flex-wrap: wrap; gap: var(--sp-8); }

/* the person's corner, at the foot of the side menu: who is signed in (their
   account), the language, the light or dark look, and signing out. Each
   choice shows which one is in force. */
.side-foot { display: flex; flex-direction: column; gap: var(--sp-12); padding-top: var(--sp-12); border-top: 1px solid var(--line-soft); }
.prefs { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-8); }
.me { display: flex; align-items: center; gap: var(--sp-12); min-width: 0; padding: var(--sp-8) var(--sp-8) var(--sp-8) var(--sp-12); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.me-mark { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--on-brand); font-weight: var(--fw-700); text-decoration: none; }
.me-mark:hover { color: var(--on-brand); background: var(--brand-hover); }
.me-name { display: flex; flex-direction: column; min-width: 0; flex: 1; text-decoration: none; color: var(--text); }
.me-name b { font-size: var(--fs-14); font-weight: var(--fw-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-name span { font-size: var(--fs-12); color: var(--muted); }
.me-name:hover { color: var(--text); }
.me-name:hover b { color: var(--brand-text); }
.me-out { flex: none; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--r-md); background: transparent; color: var(--muted); cursor: pointer; }
.me-out:hover { background: var(--danger-soft); color: var(--danger-text); }
.toggle { display: flex; gap: 2px; padding: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.toggle > * { min-width: 40px; min-height: var(--control-h-sm); padding: 0 var(--sp-8); display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); font: inherit; font-size: var(--fs-13); font-weight: var(--fw-500); cursor: pointer; text-decoration: none; }
.toggle > *:hover { background: var(--hover); color: var(--text); }
.toggle > .on, .toggle > .on:hover { background: var(--brand-sel); color: var(--brand-text); font-weight: var(--fw-600); }
.me-out:focus-visible, .me-mark:focus-visible, .me-name:focus-visible, .toggle > *:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }


/* the top bar */
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-12); padding: var(--sp-12) var(--sp-32); background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; box-shadow: var(--shadow-2); }
/* where the page sits, at the start of the top bar */
.crumbs { display: flex; align-items: center; min-width: 0; flex: 0 1 auto; min-height: var(--control-h-sm); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: var(--sp-4); font-size: var(--fs-14); flex-wrap: nowrap; white-space: nowrap; }
.bc { display: inline-flex; align-items: center; gap: var(--sp-8); padding: var(--sp-4) var(--sp-8); border-radius: var(--r-sm); color: var(--muted); text-decoration: none; font-weight: var(--fw-500); }
.bc:hover { background: var(--hover); color: var(--text); }
.bcc { display: inline-flex; align-items: center; padding: var(--sp-4) var(--sp-12); border-radius: var(--r-sm); background: var(--brand-soft); color: var(--brand-text); font-weight: var(--fw-600); }
.bs { color: var(--faint); display: flex; }
.hsearch { display: flex; align-items: center; gap: var(--sp-8); flex: 0 1 420px; min-width: 200px; height: var(--control-h); padding: 0 var(--sp-16); border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--sunken); color: var(--muted); }
.hsearch svg { flex: none; }
.hsearch input { border: 0; background: transparent; font: inherit; font-size: var(--fs-14); flex: 1; outline: none; color: var(--text); min-width: 0; }
.hstat { display: flex; align-items: center; gap: var(--sp-16); padding-inline: var(--sp-4); font-size: var(--fs-13); white-space: nowrap; }
.hstat a { display: inline-flex; align-items: center; gap: var(--sp-8); color: inherit; text-decoration: none; }
.hstat a:hover { color: var(--text); }
.ibtn { display: inline-flex; align-items: center; justify-content: center; width: var(--icon-btn); height: var(--icon-btn); border-radius: var(--r-lg); border: 0; background: transparent; color: var(--text-2); font: inherit; cursor: pointer; position: relative; text-decoration: none; }
.ibtn:hover { background: var(--hover); color: var(--text-2); }
.ibtn-dot { position: absolute; top: var(--sp-8); inset-inline-end: var(--sp-8); width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.ibtn-badge { position: absolute; top: 6px; inset-inline-end: 6px; min-width: 18px; height: 18px; border-radius: var(--r-round); background: var(--danger); color: var(--on-brand); font-size: var(--fs-12); display: flex; align-items: center; justify-content: center; padding: 0 var(--sp-4); }

/* the footer, and the bars that stay above it */
.appfoot { position: sticky; bottom: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-8) var(--sp-24); min-height: var(--footer-h); padding: var(--sp-8) var(--sp-32); background: var(--surface); border-top: 1px solid var(--line); font-size: var(--fs-13); color: var(--muted); }
.savebar { position: sticky; bottom: var(--footer-h); z-index: 15; margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-12); padding: var(--sp-16) var(--sp-32); background: var(--surface); border-top: 1px solid var(--line); }
.totalbar { position: sticky; bottom: calc(var(--footer-h) + var(--sp-16)); margin-bottom: var(--sp-16); box-shadow: var(--shadow-3); display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-24); padding: var(--sp-16) var(--sp-20); }

/* ---- page layouts ---- */
.page { padding: var(--sp-32) var(--sp-32) var(--sp-48); display: flex; flex-direction: column; gap: var(--sp-24); max-width: var(--content-max); width: 100%; }
.page.wide { max-width: none; padding-top: var(--sp-24); }
.page.flush { padding-bottom: 0; flex: 1; }
.page-split { padding: var(--sp-32) var(--sp-32) var(--sp-48); display: flex; flex-wrap: wrap; gap: var(--sp-24); align-items: flex-start; max-width: var(--content-max); width: 100%; }
.page-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-20); }
.page-aside { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-16); }
.page-task { flex: 1 1 560px; min-width: 0; max-width: 640px; margin-inline: auto; display: flex; flex-direction: column; gap: var(--sp-20); }
.page-title { margin: 0; font-size: var(--fs-26); font-weight: var(--fw-700); line-height: var(--lh-tight); }
.page-lead { margin: var(--sp-8) 0 0; font-size: var(--fs-14); color: var(--muted); }
.card-title { margin: 0; font-size: var(--fs-16); font-weight: var(--fw-600); }
.section-title { margin: 0; font-size: var(--fs-20); font-weight: var(--fw-700); }
.stat-num { font-size: var(--fs-24); font-weight: var(--fw-700); margin-top: var(--sp-4); }

/* ---- controls ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-8); min-height: var(--control-h); padding: 0 var(--sp-16); border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-14); font-weight: var(--fw-500); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--hover); border-color: var(--line-hover); color: var(--text); }
.btn.pri { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.pri:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--on-brand); }
.btn.sm { min-height: var(--control-h-sm); padding: 0 var(--sp-12); font-size: var(--fs-13); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--brand-text); }
.btn.ghost:hover { background: var(--brand-soft); border-color: transparent; }
.btn.dng { color: var(--danger-text); border-color: var(--danger-line); }
.btn.dng:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger-text); }
.btn.wide { min-width: 200px; }
.btn.block { width: 100%; }
.btn[disabled], .btn.is-off { opacity: .55; cursor: not-allowed; }
.btn.pri[disabled]:hover, .btn.pri.is-off:hover { background: var(--brand); border-color: var(--brand); }
.btn.pri .kbd { background: transparent; color: var(--on-brand); border-color: var(--brand-mid); }

.field { display: flex; flex-direction: column; gap: var(--sp-8); font-size: var(--fs-13); color: var(--text-2); font-weight: var(--fw-500); }
.inp { height: var(--control-h); padding: 0 var(--sp-12); border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); font: inherit; font-size: var(--fs-14); color: var(--text); width: 100%; }
.inp.ro { background: var(--sunken); color: var(--muted); }
.inp.ltr { direction: ltr; text-align: start; }
.inp.err, .err { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.hint { font-size: var(--fs-13); color: var(--muted); }
.pin { height: 56px; font-size: var(--fs-24); letter-spacing: .5em; text-align: center; direction: ltr; }
.check { width: 16px; height: 16px; }
.fc { display: inline-flex; align-items: center; gap: var(--sp-8); height: var(--control-h-sm); padding: 0 var(--sp-16); border-radius: var(--r-round); border: 1px solid var(--line-strong); background: var(--surface); font: inherit; font-size: var(--fs-13); color: var(--text-2); cursor: pointer; }
.fc:hover { border-color: var(--brand-mid); }
.fc.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.fc.on:hover { border-color: var(--brand); }
.fc b { font-weight: var(--fw-600); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--page); border-radius: var(--r-lg); }
.seg button { min-height: var(--control-h-sm); padding: 0 var(--sp-16); border: 0; border-radius: var(--r-md); background: transparent; font: inherit; font-size: var(--fs-14); color: var(--text-2); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--brand-text); font-weight: var(--fw-600); box-shadow: var(--shadow-1); }
.kbd { font-family: var(--font-mono); font-size: var(--fs-12); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: var(--r-sm); padding: 0 var(--sp-4); color: var(--muted); background: var(--surface); }
.disclose { cursor: pointer; color: var(--brand-text); font-weight: var(--fw-500); min-height: var(--control-h-sm); display: flex; align-items: center; }
.copybox { flex: 1 1 260px; min-width: 0; height: var(--control-h); display: flex; align-items: center; padding: 0 var(--sp-16); border: 1px solid var(--ok-line); border-radius: var(--r-md); background: var(--surface); font-size: var(--fs-14); color: var(--text-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
progress.meter { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 6px; margin-top: var(--sp-8); border: 0; border-radius: var(--r-round); background: var(--neutral-soft); overflow: hidden; }
progress.meter::-webkit-progress-bar { background: var(--neutral-soft); border-radius: var(--r-round); }
progress.meter::-webkit-progress-value { background: var(--brand); border-radius: var(--r-round); }
progress.meter::-moz-progress-bar { background: var(--brand); border-radius: var(--r-round); }

.btn:focus-visible, .ibtn:focus-visible, .nav:focus-visible, .sub:focus-visible, .fc:focus-visible,
a:focus-visible, summary:focus-visible, .tabx:focus-visible, .sbt:focus-visible, .company:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.inp:focus, input:focus-visible, select:focus-visible { border-color: var(--brand); outline: 2px solid var(--focus-ring); outline-offset: 0; }

/* ---- surfaces ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card.ok-card { background: var(--ok-wash); border-color: var(--ok-line); }
.card.picked { border-color: var(--brand-mid); box-shadow: 0 0 0 3px var(--brand-sel); }
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-12); padding: var(--sp-16) var(--sp-20); border-bottom: 1px solid var(--line-soft); }
.alert-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-16); padding: var(--sp-16) var(--sp-20); border-bottom: 1px solid var(--line-soft); }
.alert-row.urgent { background: var(--danger-wash); box-shadow: inset -3px 0 0 var(--danger); }
.alert-row:last-child { border-bottom: 0; }
.tile { width: 40px; height: 40px; border-radius: var(--r-lg); display: flex; align-items: center; justify-content: center; flex: none; }
.tile.lg { width: 52px; height: 52px; border: 1px solid transparent; }
.tile.lg.ok { border-color: var(--ok-line); }
.tile.lg.tone-brand { border-color: var(--brand-line); }
.tile.round { width: 44px; height: 44px; border-radius: 50%; }
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1px; background: var(--line-soft); }
.statgrid > div { background: var(--surface); padding: var(--sp-16) var(--sp-20); }

/* status words, dots and tags */
.pill { display: inline-flex; align-items: center; gap: var(--sp-8); padding: 3px var(--sp-12); border-radius: var(--r-round); font-size: var(--fs-13); font-weight: var(--fw-500); white-space: nowrap; }
.pill.sm { padding: 1px var(--sp-8); }
.pill.lg { padding: 3px var(--sp-12); font-size: var(--fs-13); }
.chip, .tg { display: inline-flex; padding: 1px var(--sp-8); border-radius: var(--r-sm); font-size: var(--fs-12); background: var(--brand-soft); color: var(--brand-text); }
.tg { margin-inline-end: var(--sp-4); }
.chip.lg { font-size: var(--fs-13); padding: 2px var(--sp-12); }
.tchip { display: inline-flex; align-items: center; gap: var(--sp-8); padding: 2px var(--sp-12); border-radius: var(--r-sm); font-size: var(--fs-13); background: var(--brand-soft); color: var(--brand-text); border: 1px solid var(--brand-line); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.sep-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--sep); }
.ok { background: var(--ok-soft); color: var(--ok-text); }
.warn { background: var(--warn-soft); color: var(--warn-text); }
.bad { background: var(--danger-soft); color: var(--danger-text); }
.info { background: var(--info-soft); color: var(--info); }
.mute { background: var(--neutral-soft); color: var(--text-2); }
.tone-brand { background: var(--brand-sel); color: var(--brand-text); }
.tone-accent { background: var(--accent-soft); color: var(--accent); }
.solid-ok { background: var(--ok); color: var(--on-brand); }

/* notices */
.nt { display: flex; gap: var(--sp-12); align-items: flex-start; padding: var(--sp-16); border-radius: var(--r-lg); font-size: var(--fs-14); line-height: var(--lh-body); }
.nt.bad { background: var(--danger-soft); color: var(--danger-text); border: 1px solid var(--danger-line); }
.nt.warn { background: var(--warn-wash); color: var(--warn-text); border: 1px solid var(--warn-line); }
.nt.ok { background: var(--ok-soft); color: var(--ok-text); border: 1px solid var(--ok-line); }
.nt.plain { background: var(--surface); }
.nt.tight { padding: var(--sp-8) var(--sp-16); }
.nt svg { flex: none; margin-top: var(--sp-4); }

/* key and value rows */
.kv { display: flex; justify-content: space-between; gap: var(--sp-12); font-size: var(--fs-14); padding: var(--sp-8) 0; border-bottom: 1px solid var(--line-soft); }
.kv2 { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-16); font-size: var(--fs-14); padding: var(--sp-12) 0; border-bottom: 1px solid var(--line-soft); }
.kv2:last-child { border-bottom: 0; }
.kv2 > span:first-child { color: var(--muted); flex: none; }
.kv2 > span:last-child { text-align: end; min-width: 0; }
.trow { display: flex; justify-content: space-between; font-size: var(--fs-14); padding: var(--sp-8) 0; }

/* tables */
.th { font-size: var(--fs-13); color: var(--muted); font-weight: var(--fw-500); text-align: start; padding: var(--sp-12) var(--sp-16); border-bottom: 1px solid var(--line); background: var(--sunken); }
.td { padding: var(--sp-12) var(--sp-16); border-bottom: 1px solid var(--line-soft); font-size: var(--fs-14); }
.th.dense { padding-inline: var(--sp-12); white-space: nowrap; }
.td.dense { padding: var(--sp-12); vertical-align: top; }
tbody tr:hover .td { background: var(--row-hover); }
.table { width: 100%; border-collapse: collapse; min-width: 560px; }
.tablebox { overflow-x: auto; }
.tabs { display: flex; gap: var(--sp-24); padding: 0 var(--sp-20); border-bottom: 1px solid var(--line); }
.tabx { display: inline-flex; align-items: center; min-height: 48px; color: var(--muted); text-decoration: none; font-size: var(--fs-14); font-weight: var(--fw-500); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabx.on { color: var(--brand-text); border-color: var(--brand); font-weight: var(--fw-600); }
.tbl { display: grid; align-items: center; gap: var(--sp-12); padding: var(--sp-12) var(--sp-20); border-bottom: 1px solid var(--line-soft); font-size: var(--fs-14); }
.tbl.h { background: var(--sunken); font-size: var(--fs-13); color: var(--muted); font-weight: var(--fw-500); min-height: var(--control-h); }
.tbl:last-child { border-bottom: 0; }
.tblbox { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.cols-rates { grid-template-columns: 1.4fr 1fr 1fr 80px; }
.cols-jobs { grid-template-columns: 90px 110px 1.8fr 130px 100px; }

/* the invoice's lines, a grid */
.r { display: grid; grid-template-columns: 36px 70px minmax(0, 1fr) 110px 120px; align-items: center; gap: var(--sp-8); min-height: 54px; padding: 0 var(--sp-20); border-bottom: 1px solid var(--line-soft); font-size: var(--fs-14); }
.r:hover { background: var(--row-hover); }
.r input[type=checkbox], .g input[type=checkbox] { width: 16px; height: 16px; }
.g { display: grid; grid-template-columns: 40px minmax(200px, 2.4fr) 150px 84px 80px 110px 90px minmax(150px, 1.3fr) 120px; align-items: stretch; border-bottom: 1px solid var(--line-soft); font-size: var(--fs-14); }
.g > * { padding: 0 var(--sp-12); display: flex; align-items: center; min-height: 48px; }
.g:not(.gh):hover { background: var(--row-hover); }
.g.has-error { background: var(--danger-wash); }
.gh > * { min-height: var(--control-h); font-size: var(--fs-13); color: var(--muted); background: var(--sunken); font-weight: var(--fw-500); }
.lines { min-width: 1040px; }
.cell-focus { outline: 2px solid var(--brand); outline-offset: -2px; background: var(--brand-soft); border-radius: var(--r-sm); }
.cell-error { outline: 2px solid var(--danger); outline-offset: -2px; border-radius: var(--r-sm); color: var(--danger-text); font-weight: var(--fw-700); }
.line-error { padding: var(--sp-8) 60px var(--sp-12) var(--sp-12); font-size: var(--fs-13); color: var(--danger-text); background: var(--danger-wash); border-bottom: 1px solid var(--line-soft); }
.span-8 { grid-column: span 8; }
.invhead { display: grid; grid-template-columns: minmax(260px, 2fr) repeat(4, minmax(130px, 1fr)); gap: var(--sp-16); padding: var(--sp-20); }
.fakefield { display: flex; align-items: center; gap: var(--sp-8); height: var(--control-h); padding: 0 var(--sp-12); border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); font-size: var(--fs-14); color: var(--text); }

/* the path of a document */
.step { flex: 1 1 140px; display: flex; flex-direction: column; gap: var(--sp-4); position: relative; }
.sdot { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: flex; align-items: center; justify-content: center; }
.st { display: inline-flex; align-items: center; gap: var(--sp-8); font-size: var(--fs-14); }
.sd { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.step-line { width: 36px; height: 2px; background: var(--ok); }

/* settings: the overview - a card for each group, its icon, its name, its pages */
.setgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--sp-20); align-items: start; }
.setcard { display: flex; flex-direction: column; overflow: hidden; }
.setcard-head { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-12); padding: var(--sp-20) var(--sp-20) var(--sp-16); }
.setcard-icon { width: 48px; height: 48px; border-radius: var(--r-lg); display: flex; align-items: center; justify-content: center; }
.setcard-head p { margin: var(--sp-4) 0 0; font-size: var(--fs-13); color: var(--muted); line-height: var(--lh-snug); }
.setlinks { display: flex; flex-direction: column; }
.srow .go { flex: none; color: var(--faint); }
.srow:hover .go { color: var(--brand-text); }
.srow { display: flex; align-items: center; gap: var(--sp-12); min-height: 50px; padding: 0 var(--sp-20); border-top: 1px solid var(--line-soft); text-decoration: none; color: inherit; }
.srow:hover { background: var(--row-hover); color: inherit; }
.srow .t { font-weight: var(--fw-500); font-size: var(--fs-14); color: var(--text); }
.srow .s { margin-inline-start: auto; font-size: var(--fs-13); color: var(--muted); display: flex; align-items: center; gap: var(--sp-8); white-space: nowrap; }
.grp-h { display: flex; align-items: center; gap: var(--sp-12); padding: var(--sp-20) var(--sp-20) var(--sp-12); }
.gi { width: 40px; height: 40px; border-radius: var(--r-lg); display: flex; align-items: center; justify-content: center; flex: 0 0 40px; }

/* settings: a form page */
.fs { padding: var(--sp-20); display: flex; flex-direction: column; gap: var(--sp-16); }
.fg { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-16); }
.rq { display: flex; gap: var(--sp-12); align-items: flex-start; font-size: var(--fs-14); line-height: var(--lh-body); padding: var(--sp-8) 0; }
.rq.note { background: var(--warn-wash); border-radius: var(--r-md); padding: var(--sp-12); color: var(--warn-text); }
.chk { display: flex; gap: var(--sp-12); align-items: flex-start; font-size: var(--fs-14); line-height: var(--lh-body); }
.rcard { padding: var(--sp-20); display: flex; flex-direction: column; gap: var(--sp-12); }

/* settings: a machine, a key, a connection */
.ac { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); display: flex; flex-direction: column; }
.ac.bad { background: var(--surface); color: inherit; border-color: var(--danger-line); }
.ach { display: flex; align-items: center; gap: var(--sp-12); padding: var(--sp-16) var(--sp-20); border-bottom: 1px solid var(--line-soft); }
.acb { padding: var(--sp-8) var(--sp-20) var(--sp-4); }
.acf { display: flex; flex-wrap: wrap; gap: var(--sp-8); padding: var(--sp-16) var(--sp-20) var(--sp-20); border-top: 1px solid var(--line-soft); }

/* settings: people and roles */
.av { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: var(--fw-700); font-size: var(--fs-16); flex: none; }
.av.lg { width: 52px; height: 52px; font-size: var(--fs-20); }
.ur { display: grid; grid-template-columns: minmax(220px, 2.2fr) minmax(150px, 1.6fr) 130px 110px 120px; align-items: center; gap: var(--sp-12); min-height: 64px; padding: var(--sp-8) var(--sp-20); border-bottom: 1px solid var(--line-soft); font-size: var(--fs-14); }
.ur.uh { min-height: 42px; background: var(--sunken); font-size: var(--fs-13); color: var(--muted); font-weight: var(--fw-500); }
.ur:not(.uh):hover { background: var(--row-hover); }
.ur a.nm { color: var(--text); font-weight: var(--fw-600); text-decoration: none; }
.ur a.nm:hover { color: var(--brand-text); }
.rl { display: flex; align-items: center; gap: var(--sp-12); padding: var(--sp-16); border-bottom: 1px solid var(--line-soft); text-decoration: none; color: var(--text); border-inline-start: 3px solid transparent; }
.rl:hover { background: var(--row-hover); color: var(--text); }
.rl.on { background: var(--brand-soft); border-inline-start-color: var(--brand); }
.rolelist { flex: 1 1 280px; max-width: 340px; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-16); }
.pg { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-4) 0 var(--sp-16); }
.pg h3 { margin: 0 0 var(--sp-4); font-size: var(--fs-14); font-weight: var(--fw-600); color: var(--text); padding-bottom: var(--sp-8); border-bottom: 1px solid var(--line-soft); }
.pr { display: flex; align-items: flex-start; gap: var(--sp-12); padding: var(--sp-8) 0; font-size: var(--fs-14); line-height: var(--lh-snug); cursor: pointer; }
.pr.tight { padding: var(--sp-4) 0; }
.pr.flat { padding: 0; align-items: center; }
.pr input { margin-top: var(--sp-4); width: 16px; height: 16px; flex: none; }
.pr.flat input { margin-top: 0; }
.pr small { display: block; color: var(--subtle); font-size: var(--fs-12); font-family: var(--font-mono); direction: ltr; text-align: start; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 var(--sp-32); }
.act { display: flex; flex-wrap: wrap; gap: var(--sp-8); }
.choice { display: flex; align-items: flex-start; gap: var(--sp-12); padding: var(--sp-12) var(--sp-16); border: 1px solid var(--line); border-radius: var(--r-lg); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice input { margin-top: var(--sp-4); width: 16px; height: 16px; }
.choice b { font-weight: var(--fw-600); font-size: var(--fs-14); }
.choice span { display: block; font-size: var(--fs-13); color: var(--muted); margin-top: 2px; }
.tl { display: flex; gap: var(--sp-12); padding: var(--sp-8) 0; border-bottom: 1px solid var(--line-soft); font-size: var(--fs-14); }
.tl .tm { color: var(--subtle); font-size: var(--fs-13); flex: none; width: 74px; }

/* the folded side menu: wide screens only */
@media (min-width: 901px) {
  [data-side="collapsed"] .side .company { justify-content: center; padding: var(--sp-4); border-color: transparent; }
  [data-side="collapsed"] .side { flex-basis: var(--side-w-collapsed); width: var(--side-w-collapsed); padding-inline: var(--sp-12); }
  [data-side="collapsed"] .side .lbl,
  [data-side="collapsed"] .side .subs,
  [data-side="collapsed"] .side .grp,
  [data-side="collapsed"] .side .chev,
  [data-side="collapsed"] .side .pill,
  [data-side="collapsed"] .side .brandname,
  [data-side="collapsed"] .side .me-name,
  [data-side="collapsed"] .side .prefs,
  [data-side="collapsed"] .side .envrow .btn { display: none; }
  [data-side="collapsed"] .side .nav { justify-content: center; padding: 0; }
  [data-side="collapsed"] .side .side-head { justify-content: center; }
  [data-side="collapsed"] .side .envrow { justify-content: center; padding: var(--sp-12) 0; }
  [data-side="collapsed"] .side .me { flex-direction: column; padding: var(--sp-8) 0; background: transparent; border: 0; box-shadow: none; }
}

/* ---- the frame as the product draws it (D368) ----
   What the canvas drew with its own machinery and a page needs from this
   file instead: the native window, the menus under the top bar's buttons,
   the search's answers, the banner, the sign-in page and narrow screens. */
[hidden] { display: none !important; }
/* an arrow drawn for right-to-left points the other way in English */
[dir="ltr"] .mirror { transform: scaleX(-1); }
[dir="ltr"] .nav.on { box-shadow: inset 3px 0 0 var(--brand); }
[dir="ltr"] .alert-row.urgent { box-shadow: inset 3px 0 0 var(--danger); }
.btn > svg, .nav > svg, .sub > svg { flex: none; }

/* On a wide screen the frame is the window's height and the page scrolls
   inside it: the side menu's foot - the environment, the language and look,
   the person - and the footer's state stay on screen however long the page,
   and the test banner stays above everything. The bars that stood above the
   footer now stand at the foot of the scrolling page. */
@media (min-width: 901px) {
  .app { height: 100vh; min-height: 0; }
  .shell { min-height: 0; flex-wrap: nowrap; }
  .side { overflow-y: auto; }
  .content { overflow-y: auto; }
  .appfoot { position: static; }
  .savebar { bottom: 0; }
  .totalbar { bottom: var(--sp-16); }
}

/* A note behind a mark must not be cut off by the table's own scrolling box, so once it is
   shown the script places it against the window (`--tip-x`, `--tip-y`) */
.tip.placed .tip-body { position: fixed; inset-inline-start: auto; top: var(--tip-y); left: var(--tip-x); bottom: auto; }

/* A figure in a cell or a block is laid out left to right and aligned the way the page is: a `direction: ltr`
   on the block itself turns its `text-align: start/end` against its heading's, which is the defect this project
   has met on every screen that put `.num` on a cell. `plaintext` orders the digits and the sign by themselves. */
td.num, th.num, dd.num, p.num, div.num:not(.ltr) { direction: inherit; unicode-bidi: plaintext; }

/* the note behind a mark: the gap between it and the mark does not close it, so its link can be reached */
.tip-body::before { content: ''; position: absolute; inset-inline: 0; top: calc(-1 * var(--sp-8)); height: var(--sp-8); }
.tip.up .tip-body::before, .tip.above .tip-body::before { top: auto; bottom: calc(-1 * var(--sp-8)); }

/* the invoice's lines as a grid to type in (D372): the drawing's nine columns and a tenth for the line's own buttons */
.lines.editable { min-width: 1160px; }
.lines.editable .g { grid-template-columns: 36px minmax(220px, 2.4fr) 140px 90px 70px 120px 90px minmax(170px, 1.4fr) 120px 76px; }
.cell-input { width: 100%; min-width: 0; align-self: stretch; border: 0; background: transparent; color: inherit; font: inherit; font-size: var(--fs-14); border-radius: var(--r-sm); }
.cell-input:focus { outline: 2px solid var(--brand); outline-offset: -2px; background: var(--brand-soft); }
/* a figure's name shows only where a line is a card (parts/mobile.css); the box round the input is the cell itself */
.cell-lbl { display: none; }
.g > .cellbox { padding: 0; }
.cellbox .cell-input { padding: 0 var(--sp-12); }
.line-more { display: flex; flex-direction: column; gap: var(--sp-16); padding: var(--sp-16) var(--sp-20); background: var(--sunken); border-bottom: 1px solid var(--line-soft); }
.tax-row { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)) auto; gap: var(--sp-12); align-items: end; }
/* a withholding chip holds the box that takes it off this line: struck through when it is not charged */
.tg input[type=checkbox] { margin: 0; }
.tg input[type=checkbox]:not(:checked) ~ bdi { text-decoration: line-through; opacity: .6; }
.tg.warn { cursor: pointer; }

/* a tax chip on a line: its code and its amount, apart */
.tg { gap: var(--sp-4); }

/* a document's path: a step that has not come yet, and the line before it */
.step-line.todo { background: var(--line-strong); }

/* a button inside a menu is a row of it, like a link */
button.menu-item { width: 100%; border: 0; background: transparent; color: var(--text); font: inherit; text-align: start; cursor: pointer; }
button.menu-item:hover { background: var(--hover); }
.menu-item.danger, .menu-item.danger > svg { color: var(--danger-text); }
.menu form { display: contents; }

/* the figures that make a total (a list, or a bar under the lines) */
.totals { margin: 0; display: flex; flex-direction: column; }
.totals-row { display: flex; justify-content: space-between; gap: var(--sp-12); padding: var(--sp-8) 0; font-size: var(--fs-14); border-bottom: 1px solid var(--line-soft); }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; }
.totals-row.grand { border-bottom: 0; font-size: var(--fs-16); font-weight: var(--fw-700); }
.totals-row.grand dt { color: var(--text); }
.totals-bar { flex-direction: row; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-8) var(--sp-24); padding: var(--sp-16) var(--sp-20); background: var(--sunken); }
.totals-bar .totals-row { border: 0; padding: 0; gap: var(--sp-8); }

/* links that are drawn as buttons and chips are not underlined; a sortable heading is, on hover */
a.fc, a.tchip { text-decoration: none; }
.th a { text-decoration: none; }
.th a:hover { text-decoration: underline; }

/* a form that is one button: in the person's card, in the footer's state */
.me form { display: contents; }
.hstat form { display: contents; }
.hstat button { display: inline-flex; align-items: center; gap: var(--sp-8); padding: 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.hstat button:hover { color: var(--text); }
/* a file input in the page's language (app.js puts the words around it) */
.filepick { display: inline-flex; align-items: center; gap: var(--sp-12); cursor: pointer; }
.filepick:focus-within .btn { outline: 2px solid var(--brand); outline-offset: 2px; }

/* the window that asks, as the browser's own <dialog>: it keeps the focus
   inside and closes on Escape */
dialog.dialog { margin: auto; padding: var(--sp-24); }
/* `.dialog` is a flex column, which would otherwise draw a closed one */
dialog.dialog:not([open]) { display: none; }
dialog.dialog::backdrop { background: var(--backdrop); }
.dialog .dialog-body { margin: 0; font-size: var(--fs-14); line-height: var(--lh-body); color: var(--text-2); }

/* a menu under a top-bar button: Activity and the bell. A <details>, so it
   opens without script */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; top: calc(100% + var(--sp-8)); inset-inline-end: 0; z-index: 30; width: var(--menu-w); max-width: calc(100vw - var(--sp-32)); max-height: 70vh; overflow: auto; display: flex; flex-direction: column; gap: 2px; padding: var(--sp-8); background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-3); }
.menu-panel h3 { margin: 0; padding: var(--sp-8) var(--sp-12) var(--sp-4); font-size: var(--fs-13); font-weight: var(--fw-600); color: var(--muted); }
.menu-item { display: flex; align-items: center; gap: var(--sp-12); min-height: var(--control-h); padding: var(--sp-8) var(--sp-12); border-radius: var(--r-md); color: var(--text); text-decoration: none; font-size: var(--fs-14); line-height: var(--lh-body); }
a.menu-item:hover { background: var(--hover); color: var(--text); }
.menu-item > svg { flex: none; color: var(--muted); }
.menu-item .count { margin-inline-start: auto; font-size: var(--fs-12); color: var(--muted); }
.menu-empty { margin: 0; padding: var(--sp-12); font-size: var(--fs-14); color: var(--muted); }
.menu-foot { padding: var(--sp-8) var(--sp-12) var(--sp-4); }
/* a panel that scrolls keeps each row's height: squeezed, a long row's lines ran over the next one (D428) */
.menu-panel > *, .menu-panel > form > * { flex: none; }
.menu-foot .btn { width: 100%; justify-content: center; }
/* the bell's events (D428): the document and what happened to it, the rest under it, how long ago at the end */
button.menu-item.ev { align-items: flex-start; }
.menu-item.ev > svg { margin-top: 3px; }
.ev-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.ev-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-12); min-width: 0; }
.ev-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-8); min-width: 0; }
.ev-amount { flex: none; font-size: var(--fs-13); font-weight: var(--fw-500); }
.ev-title { font-weight: var(--fw-600); }
.ev-what { font-size: var(--fs-12); line-height: 1.6; padding: 0 var(--sp-8); border-radius: var(--r-round); background: var(--hover); color: var(--muted); }
.ev-what[data-status="valid"] { background: var(--ok-wash); color: var(--ok-text); }
.ev-what[data-status="invalid"], .ev-what[data-status="rejected"] { background: var(--danger-wash); color: var(--danger-text); }
.ev-detail { min-width: 0; font-size: var(--fs-13); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-when { flex: none; font-size: var(--fs-12); color: var(--muted); }
.activity-row { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-8) var(--sp-12); border-radius: var(--r-md); font-size: var(--fs-14); }
.activity-row .hint { font-size: var(--fs-12); }

/* the search's answers, under the box */
.hsearch { position: relative; }
.hsearch input::-webkit-search-cancel-button { display: none; }
.search-results { position: absolute; top: calc(100% + var(--sp-8)); inset-inline: 0; z-index: 30; max-height: 60vh; overflow: auto; padding: var(--sp-8); background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-3); }
.search-results h3 { margin: 0; padding: var(--sp-8) var(--sp-12) var(--sp-4); font-size: var(--fs-12); font-weight: var(--fw-600); color: var(--muted); }
.search-results a { display: flex; align-items: center; gap: var(--sp-12); padding: var(--sp-8) var(--sp-12); border-radius: var(--r-md); color: var(--text); text-decoration: none; font-size: var(--fs-14); }
.search-results a:hover, .search-results a[aria-selected="true"] { background: var(--hover); color: var(--text); }
.search-results .hint { margin-inline-start: auto; }

/* what the scheduled health check found, under the top bar on every page */
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-8) var(--sp-16); padding: var(--sp-12) var(--sp-32); font-size: var(--fs-14); border-bottom: 1px solid var(--warn-line); background: var(--warn-wash); color: var(--warn-text); }
.banner.bad { border-color: var(--danger-line); background: var(--danger-wash); color: var(--danger-text); }
.banner p { margin: 0; }
.banner .btn { min-height: var(--control-h-sm); font-size: var(--fs-13); }
.flashes { display: flex; flex-direction: column; gap: var(--sp-8); }

/* the pages before signing in */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-16); padding: var(--sp-24) var(--sp-16); background: var(--page); }
.auth-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: var(--sp-20); padding: var(--sp-32); }
.auth-brand { display: flex; align-items: center; gap: var(--sp-12); }
.auth-tools { display: flex; align-items: center; justify-content: center; gap: var(--sp-8); }

/* the menu button, and narrow screens: the side menu folds away behind it */
.only-narrow { display: none; }
@media (max-width: 900px) {
  .only-narrow { display: inline-flex; }
  .side { display: none; }
  [data-menu="open"] .side { display: flex; position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 40; overflow: auto; box-shadow: var(--shadow-3); }
  .topbar, .appfoot, .savebar, .banner { padding-inline: var(--sp-16); }
  .page, .page-split { padding-inline: var(--sp-16); }
  .hsearch { flex: 1 1 200px; }
  .envbar { padding-inline: var(--sp-16); }
}

/* a page fills the column on any screen (Amr, 2026-10-25): the canvas capped it at --content-max and left a wide
   window half empty. One-task pages (.page-task) keep their own narrow measure. */
.page, .page-split { max-width: none; }

/* ---- the floating frame (D377, Amr 2026-10-25) ----
   The side menu, the top bar and the footer are separate rounded panels that float on a coloured ground, and the page
   scrolls between them (`.pane`). Their colours are the `--f-*` tokens (frame-tokens/): white by default, or
   `data-frame="dark"` for a dark side menu, `data-frame="blue"` for a blue top bar and footer and a blue menu when it is
   folded. The person's choice is kept by their browser (theme.js, app.js), like the light or dark look. */
:root { --side-w: 248px; }
.app { background: var(--f-ground); }
/* the practice environment's band is flat and full width, above the side menu and the page, as the flat frame is */
.envbar { margin: 0; border: 0; border-bottom: 1px solid var(--warn-line); border-radius: 0; padding-block: var(--sp-8); }
/* D388: the practice environment is the calm navy of the information tone - a place to try things, not a fault - so that amber is left to what needs attention and red to what is wrong */
.envbar { background: var(--info-soft); color: var(--info); border-bottom-color: color-mix(in srgb, var(--info) 22%, var(--surface)); }
.envbar .btn { border-color: color-mix(in srgb, var(--info) 30%, var(--surface)); color: var(--info); }
.envbar .btn:hover { background: color-mix(in srgb, var(--info) 8%, var(--surface)); }
.envbar .vsep { background: color-mix(in srgb, var(--info) 30%, var(--surface)); }
.banner > b { display: inline-flex; align-items: center; gap: var(--sp-8); }
.shell { padding: 0; gap: 0; }
/* the side menu's scrollbar is a thin line that shows while the pointer is over the menu, and is not drawn at all when the menu fits */
.side { scrollbar-width: thin; scrollbar-color: transparent transparent; transition: scrollbar-color .2s ease; }
.side:hover, .side:focus-within { scrollbar-color: var(--line-strong) transparent; }
.side { overflow-x: hidden; color: var(--text); background: var(--f-side); border: 0; border-inline-end: 1px solid var(--f-head-line); border-radius: 0; box-shadow: none; padding: var(--sp-16) var(--sp-12); gap: var(--sp-4); }
/* `.shell > .col` is the name before D379; a running server's cached template still uses it */
.frame-col, .shell > .col { flex: 999 1 560px; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 0; }
.content { flex: 1 1 0; min-height: 0; min-width: 0; gap: var(--sp-12); padding: var(--sp-12) var(--sp-16) 0; }
.topbar { position: relative; top: auto; z-index: 10; background: var(--f-head); border: 1px solid var(--f-head-line); border-radius: var(--r-lg); padding: var(--sp-8) var(--sp-12); box-shadow: var(--f-shadow); }
.pane { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.appfoot { margin: 0; padding: var(--sp-8) var(--sp-24); border: 0; border-top: 1px solid var(--f-foot-line); border-radius: 0; background: var(--f-foot); }
.pane > form { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }

/* the side menu: the active page filled, the pages of an open section tinted */
.nav.on, .nav.on:hover { background: var(--f-active-bg); color: var(--f-active-text); }
.nav.sumon { color: var(--f-kid-text); }
.sub.on, .sub.on:hover { background: var(--f-kid-bg); color: var(--f-kid-text); }
/* the pages of an open section sit a little in from their section, not a whole icon's width (the canvas's 32px read as a large shift) */
.subs { padding-inline-start: var(--sp-8); }
.sub svg { flex: none; color: var(--subtle); }
.sub.on svg { color: inherit; }
/* a count is a pill at the end of its row, as the side menu is drawn in docs/reference/design-refine */
.sub .cnt { padding: 1px var(--sp-12); border-radius: var(--r-round); background: var(--warn-soft); color: var(--warn-text); font-size: var(--fs-13); font-weight: var(--fw-600); }
.side .company { margin: 0 0 var(--sp-8); border-color: var(--f-head-line); background: var(--f-side); }
.side .company-mark { border-radius: 50%; background: var(--ok); color: var(--on-brand); }
.side .company-cap { display: block; font-size: var(--fs-12); color: var(--muted); }
.side .grp { border-top: 0; margin-top: 0; padding: var(--sp-12) var(--sp-12) var(--sp-4); }
.side-head { justify-content: flex-start; padding: 0 var(--sp-8) var(--sp-16); }
.side-head .brandtext { font-size: var(--fs-16); font-weight: var(--fw-700); }
.side .logo { background: var(--f-logo-bg); color: var(--f-logo-text); }
.framepick { align-self: stretch; justify-content: space-between; }
.framepick > button { flex: 1 1 0; min-width: 0; }
.swatch { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-strong); background: linear-gradient(135deg, var(--sw-a) 50%, var(--sw-b) 50%); }
.only-wide { display: inline-flex; }

/* the top bar: the controls sit on the frame's own tint */
.topbar .ibtn { background: var(--f-ctrl); }
.topbar .ibtn:hover { background: var(--hover); }
.hsearch { flex: 1 1 320px; background: var(--f-ctrl); border-color: var(--f-head-line); }
.topbar > .grow { display: none; }
.bc-home span { margin-inline-start: var(--sp-4); }
/* a long page name gives way (it is cut with an ellipsis) before the search, the bell or the person's card are squeezed */
.topbar .crumbs { flex: 0 1 auto; max-width: 34%; min-width: 0; }
.topbar .me, .topbar details.menu, .topbar > .btn, .topbar > .ibtn { flex: none; }
.me-name span, .me-name b { white-space: nowrap; }
.topbar .me { padding: 0 var(--sp-4) 0 0; padding-inline-start: var(--sp-12); margin-inline-start: var(--sp-4); border: 0; border-inline-start: 1px solid var(--f-head-line); border-radius: 0; background: transparent; box-shadow: none; }
.topbar .me-mark { width: 38px; height: 38px; }

@media (min-width: 901px) {
  .content { overflow: hidden; }
  .pane { overflow-y: auto; }
  [data-side="collapsed"] .side .brandname { display: flex; }
  [data-side="collapsed"] .side .brandtext,
  [data-side="collapsed"] .side .framepick { display: none; }
}
@media (max-width: 900px) {
  .only-wide { display: none; }
  /* a phone's top bar is two rows: the menu and the buttons, then the search (the page has its own title, so the path is left out) */
  .topbar { flex-wrap: wrap; row-gap: var(--sp-8); }
  .topbar .crumbs { display: none; }
  .topbar > .grow { display: block; flex: 1 1 0; }
  .topbar .me { flex: none; }
  .topbar { gap: var(--sp-4); }
  .topbar .ibtn, .topbar > .btn.pri { width: 40px; height: 40px; min-height: 40px; }
  .topbar .me-mark { width: 34px; height: 34px; }
  .topbar .me-out { width: 32px; }
  .topbar .hsearch { order: 9; flex: 1 1 100%; }
  .topbar .hsearch .kbd { display: none; }
  .topbar .me { margin-inline-start: 0; padding-inline-start: 0; border: 0; }
  .topbar .me-name { display: none; }
  .topbar > .btn.pri { font-size: 0; gap: 0; padding: 0; width: var(--icon-btn); justify-content: center; }
  .topbar > .btn.pri svg { margin: 0; }
  .bc-home span { display: none; }
  .shell { padding: var(--sp-8); gap: var(--sp-8); }
  .frame-col, .shell > .col { flex: 1 1 100%; gap: var(--sp-8); }
  .content { gap: var(--sp-8); }
  .topbar { position: sticky; top: var(--sp-8); }
  .envbar { margin: 0; }
}

/* a side-menu section slides open and shut, the chevron turns with it (a
   browser without ::details-content just opens at once, as before) */
.inv-g .chev { transition: transform .25s ease; }
.inv-g .subs { transition: opacity .25s ease; opacity: 0; }
.inv-g[open] .subs { opacity: 1; }
@supports selector(::details-content) {
  :root { interpolate-size: allow-keywords; }
  .inv-g::details-content {
    block-size: 0;
    overflow: clip;
    transition: block-size .25s ease, content-visibility .25s allow-discrete;
  }
  .inv-g[open]::details-content { block-size: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .inv-g .chev, .inv-g .subs, .inv-g::details-content { transition: none; }
}

/* a folded side menu: the pointer over a section's icon shows its pages in a
   panel beside the menu (app.js puts `fly` on the section and places the panel) */
@media (min-width: 901px) {
  [data-side="collapsed"] .side .inv-g.fly > .subs {
    display: flex;
    position: fixed;
    z-index: 60;
    min-width: 260px;
    max-height: calc(100vh - 16px);
    overflow-y: auto;
    margin: 0;
    padding: var(--sp-12);
    color: var(--text);
    background: var(--f-side);
    border: 1px solid var(--f-head-line);
    border-radius: 20px;
    box-shadow: var(--shadow-3);
    animation: fly-in .22s ease-out;
  }
}
.fly-head { display: none; }
.sub .sdt { display: none; flex: none; }
.subs form { display: contents; }
.subs button.sub { width: 100%; border: 0; background: transparent; font: inherit; font-size: var(--fs-14); font-weight: var(--fw-500); color: var(--text-2); cursor: pointer; text-align: start; }
[data-side="collapsed"] .side .inv-g.fly > .subs .fly-head { display: flex; align-items: center; gap: var(--sp-12); padding: var(--sp-8) var(--sp-12) var(--sp-12); margin-bottom: var(--sp-8); border-bottom: 1px solid var(--line-soft); font-size: var(--fs-20); font-weight: var(--fw-700); color: var(--text); }
[data-side="collapsed"] .side .inv-g.fly > .subs .fly-head svg { color: var(--brand-text); }
/* in the panel a status is a coloured dot and a count a plain figure; in the menu itself, an icon and a pill */
[data-side="collapsed"] .side .inv-g.fly .sub.has-dot > svg { display: none; }
[data-side="collapsed"] .side .inv-g.fly .sub .sdt { display: inline-block; }
[data-side="collapsed"] .side .inv-g.fly .sub .cnt { padding: 0; background: transparent; color: var(--text-2); font-weight: var(--fw-700); }
@keyframes fly-in {
  from { opacity: 0; transform: translateY(-6px) scale(.97); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  [data-side="collapsed"] .side .inv-g.fly > .subs { animation: none; }
}

/* on paper: the page alone, the whole of it, as long as it is */
@media print {
  .app { height: auto; }
  .content { overflow: visible; }
  .side, .topbar, .appfoot, .envbar, .banner, .savebar, dialog { display: none !important; }
  .page, .page-split { max-width: none; padding: 0; }
  .shell { padding: 0; display: block; }
  .frame-col, .shell > .col, .content { display: block; }
  .pane { overflow: visible; }
}


/* a form that holds the page and its save bar: it fills the column, so the bar sits at the bottom of the
   window even when the form is short (the bar's own auto margin has something to push against) */
.content > form { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }

/* the breadcrumb gives way before anything else does: on a wide screen the top bar stays on one row and the
   last step is cut with an ellipsis; on a phone only the home and the page itself are kept */
.bcc { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs li:last-child { min-width: 0; overflow: hidden; }
@media (min-width: 901px) {
  .topbar { flex-wrap: nowrap; }
  .crumbs { flex: 0 1 auto; overflow: hidden; }
  .topbar .btn, .topbar .ibtn { flex-shrink: 0; }
  /* the search gives way after the breadcrumb, never the person's card (Amr, 2026-11-17: at 1100px
     the name was cut off the bar's far edge, because the search held its 320px) */
  .topbar .hsearch { flex-shrink: 1; min-width: 120px; }
  /* the card keeps its size; a long name or role is cut with an ellipsis at 12rem, and the whole name is in
     the link's title */
  .topbar .me-name { max-width: 12rem; }
  .topbar .me-name span { overflow: hidden; text-overflow: ellipsis; }
}
/* between the phone and a wide screen New invoice is its icon, as on a phone, and the search drops
   its Ctrl K hint - so the name and role stay whole with the side menu open */
@media (min-width: 901px) and (max-width: 1199px) {
  .topbar .hsearch .kbd { display: none; }
  .topbar > .btn.pri { font-size: 0; gap: 0; padding: 0; width: var(--icon-btn); justify-content: center; }
  .topbar > .btn.pri svg { margin: 0; }
}
/* below 1100px the path is left out, as on a phone - the page has its own title, and a path cut to one
   letter says nothing */
@media (min-width: 901px) and (max-width: 1099px) {
  .topbar .crumbs { display: none; }
  /* and the name has less room: a long one is cut at 6rem, which still holds a role such as Administrator */
  .topbar .me-name { max-width: 6rem; }
  .topbar .hsearch { min-width: 100px; }
}
@media (max-width: 600px) {
  .crumbs ol > li:not(:first-child):not(:last-child):not(:nth-last-child(2)) { display: none; }
  .crumbs { flex: 1 1 0; }
}

/* a list with nothing in it (D388): across the list's whole width, centred, with the way forward under it */
.empty { display: flex; flex-direction: column; align-items: center; gap: var(--sp-12); padding: var(--sp-48) var(--sp-24); text-align: center; }
.empty-title { margin: var(--sp-4) 0 0; font-size: var(--fs-16); font-weight: var(--fw-600); }
.empty-hint { margin: 0; max-width: 420px; font-size: var(--fs-14); line-height: var(--lh-body); color: var(--muted); }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-8); margin-top: var(--sp-8); }
.empty-actions:empty { display: none; }

/* ---- account ---- */
/* account: what is shown once (a key, a code, the recovery codes), the QR that
   carries the same secret, and a column of ticks. The signed-out pages and the
   wizard use only classes that already exist. */
.secret { display: flex; align-items: center; justify-content: center; padding: var(--sp-16) var(--sp-20); border: 1px dashed var(--warn-line); border-radius: var(--r-md); background: var(--warn-wash); color: var(--warn-text); font-family: var(--font-mono); font-size: var(--fs-16); font-weight: var(--fw-700); letter-spacing: .06em; direction: ltr; text-align: center; overflow-wrap: anywhere; user-select: all; }
.secret strong, .secret code { font: inherit; letter-spacing: inherit; }
.secret code { font-size: var(--fs-24); }
.codes { margin: 0; padding-inline-start: var(--sp-24); columns: 2; column-gap: var(--sp-32); text-align: start; }
.codes li { padding: var(--sp-4) 0; }
/* the encoder draws its own white ground and black modules, so a phone reads it on a dark screen too */
.qr { display: flex; justify-content: center; }
.qr svg { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.tick { text-align: center; width: 110px; }

/* the account page: who you are on top, a tab for each thing you change, and the way to what reaches you */
.acct { display: flex; flex-direction: column; gap: var(--sp-16); }
.acct-head { padding: 0; overflow: hidden; }
.acct-who { display: flex; align-items: center; gap: var(--sp-16); flex-wrap: wrap; padding: var(--sp-20) var(--sp-24) var(--sp-16); }
.acct-who > .grow { flex: 1 1 220px; }
.acct-tabs { padding-inline: var(--sp-24); background: var(--sunken); }
.acct-tabs .tabx { flex: none; white-space: nowrap; }
.acct-tab-out { gap: var(--sp-8); margin-inline-start: auto; }
.acct-tab-out:hover { color: var(--brand-text); }
.acct-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: var(--sp-16); align-items: start; }
.acct-grid[hidden] { display: none; }
@media (max-width: 700px) {
  .acct-who, .acct-tabs { padding-inline: var(--sp-16); }
  .acct-tabs { gap: var(--sp-16); overflow-x: auto; overflow-y: hidden; }
  .acct-grid { grid-template-columns: 1fr; }
}

/* ---- authority ---- */
/* Settings > ETA connection, Signing and the PIN page (authority group, D373).
   The tables of these pages are grids of fixed columns; on a narrow screen the
   box scrolls sideways rather than squeezing a column to nothing. */
.scroll-x > .tbl.cols-jobs { min-width: 700px; }
.scroll-x > .tbl.cols-rates { min-width: 560px; }
.tbl.cols-jobs { grid-template-columns: 80px 150px minmax(160px, 1.6fr) 130px 90px; }
/* the token an agent signs with, chosen from the ones it has seen */
.pick { width: auto; min-width: 240px; max-width: 100%; }
/* the part of Settings > Signing that follows the server (D393): a column like the page's own, so the cards keep their spacing */
.live { display: flex; flex-direction: column; gap: var(--sp-20); }

/* ---- catalogue ---- */
/* ---- the catalogue pages: customers, items, the GPC search (D374) ---- */

/* a text box with more than one line: the field's fixed height is for one-line controls */
textarea.inp { height: auto; min-height: 96px; padding-block: var(--sp-8); resize: vertical; line-height: var(--lh-body); }

/* the GPC bricks a search found: on the page each is a row of its own, under the box each is a line of the list */
.gpc { display: flex; flex-direction: column; gap: var(--sp-8); }
.gpc-row { display: flex; align-items: center; gap: var(--sp-12); padding: var(--sp-12) var(--sp-16); border: 1px solid var(--line-soft); border-radius: var(--r-md); color: var(--text); text-decoration: none; font-size: var(--fs-14); }
.gpc-row:hover, .gpc-row[aria-selected="true"] { background: var(--hover); border-color: var(--brand-mid); color: var(--text); }
.search-results .gpc { gap: 2px; }
.search-results .gpc-row { padding: var(--sp-8) var(--sp-12); border-color: transparent; }

/* a cell that holds a code or a figure keeps it on one line; the description is the cell that gives way */
.td.nowrap { white-space: nowrap; }
.td.col-desc { min-width: 180px; }

/* the item's tax rows have four boxes, not the invoice line's five */
.fs > .tax-row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* a short table in the narrow column is as wide as the column */
.page-aside .table { min-width: 0; }

/* the customer form laid out by type (D425): a star on what is needed, and what does not
   apply to the chosen type hidden. Only hidden - a browser without :has() shows every box,
   and the server ignores what does not apply. */
.req { color: var(--danger-text); font-weight: var(--fw-600); }
.cust-form summary.card-title { margin: 0; }
.cust-form:not(:has(input[name="type"][value="B"]:checked)) .only-b { display: none; }
.cust-form:not(:has(input[name="type"][value="P"]:checked)) .only-p { display: none; }
.cust-form:not(:has(input[name="type"][value="F"]:checked)) .only-f { display: none; }

/* notes keep the lines they were typed with (D426) */
.pre-line { white-space: pre-line; }

/* ---- company ---- */
/* Settings pages about the company and its rules (branches, companies, numbering, approval,
   plan, table goods, lists, AI). Only what the shared vocabulary does not already draw. */

/* Numbering: four short boxes (prefix, digits, suffix, next number) in one row where they fit. */
.fg.fg-4 { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }

/* A grid of cards that never asks for more than the screen has (auto-420 does, on a phone). */
.cards-420 { grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); }

/* ---- connections ---- */
/* Settings: the connections (API keys, webhooks, Telegram) and the system pages (D373).
   Built from the drawn Settings parts; only what nothing there covers is added. */

/* A list of keys: the users list's row (.ur) with its own columns. Below the width the
   card gives it, the five cells stack and each says what it is (the cell's data-label). */
.cr-box { container-type: inline-size; }
.ur.cr-key { grid-template-columns: minmax(140px, 1.3fr) minmax(150px, 2.4fr) 110px minmax(130px, 1fr) 90px; }
.cr .nm { font-weight: var(--fw-600); color: var(--text); }
@container (max-width: 720px) {
  .ur.cr { grid-template-columns: 1fr; gap: var(--sp-8); align-items: start; }
  .ur.cr.uh { display: none; }
  .ur.cr > [data-label]::before { content: attr(data-label); display: block; font-size: var(--fs-12); color: var(--muted); margin-bottom: 2px; }
}

/* A secret shown once: the whole of it stays readable and selectable, wrapped where it must. */
.copybox.once { height: auto; min-height: var(--control-h); padding-block: var(--sp-12); white-space: normal; overflow-wrap: anywhere; text-overflow: clip; font-family: var(--font-mono); user-select: all; }

/* A fixed line of text the reader will type or compare: a header, a prefix. */
.codebox { direction: ltr; text-align: start; padding: var(--sp-8) var(--sp-12); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--sunken); font-family: var(--font-mono); font-size: var(--fs-13); color: var(--text-2); overflow-wrap: anywhere; }

.nowrap { white-space: nowrap; }

/* an environment that is not connected yet: what is missing and the three things that fix it */
.envnc { max-width: 680px; padding: 0; overflow: hidden; }
.envnc-head { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-12); padding: var(--sp-24); }
.envnc-head .tile.warn { border-color: var(--warn-line); }
.envnc-title { margin: 0; font-size: var(--fs-20); font-weight: var(--fw-600); line-height: 1.4; }
.envnc-text { margin: 0; font-size: var(--fs-14); line-height: var(--lh-body); color: var(--muted); max-width: 52ch; }
.envnc-steps { list-style: none; margin: 0; padding: var(--sp-16) var(--sp-24); display: flex; flex-direction: column; gap: var(--sp-16); border-top: 1px solid var(--line-soft); background: var(--sunken); }
.envnc-steps li { display: flex; align-items: flex-start; gap: var(--sp-12); }
.envnc-steps li > div { display: flex; flex-direction: column; gap: var(--sp-4); font-size: var(--fs-14); line-height: var(--lh-body); }
.envnc-n { flex: none; width: 28px; height: 28px; border-radius: var(--r-round); display: inline-flex; align-items: center; justify-content: center; font-size: var(--fs-13); font-weight: var(--fw-600); background: var(--brand-soft); color: var(--brand-text); border: 1px solid var(--brand-line); }
.envnc-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-8); padding: var(--sp-16) var(--sp-24); border-top: 1px solid var(--line-soft); }

/* ---- documents ---- */
/* documents (D373): the pages around invoices that are not the list, the invoice page or the new invoice -
   credit notes, templates, reports, reconciliation, notifications, bring-in, search, and the invoice's printed
   and mailed copies. Only what the shared vocabulary above does not already say. */

/* the period buttons of Reports are links */
.seg a { display: inline-flex; align-items: center; min-height: var(--control-h-sm); padding: 0 var(--sp-16); border-radius: var(--r-md); background: transparent; font-size: var(--fs-14); color: var(--text-2); text-decoration: none; }
.seg a:hover { color: var(--text); }
.seg a.on { background: var(--surface); color: var(--brand-text); font-weight: var(--fw-600); box-shadow: var(--shadow-1); }

/* a credit note's two boxes per line, and the reason beside a finding's buttons */
.inp.cn-box { width: 120px; text-align: end; }
.fnote { height: var(--control-h-sm); min-width: 140px; max-width: 200px; font-size: var(--fs-13); }

/* a finding: what the portal says against what we say */
.ftable .td { vertical-align: top; }
.diff { display: grid; grid-template-columns: auto auto; justify-content: start; gap: var(--sp-4) var(--sp-12); align-items: baseline; font-size: var(--fs-13); }
.diff .diff-label { color: var(--muted); }
.diff .value { font-weight: var(--fw-500); }
.diff .value.portal { color: var(--info); }
.diff .value.local { color: var(--text); }
.diff .gap { color: var(--danger-text); font-weight: var(--fw-600); margin-inline-start: var(--sp-8); }

/* the raw body of a notification delivery, as ETA wrote it */
pre.json { margin: 0; padding: var(--sp-16) var(--sp-20); overflow: auto; max-height: 520px; font-family: var(--font-mono); font-size: var(--fs-13); line-height: var(--lh-snug); direction: ltr; text-align: start; background: var(--sunken); color: var(--text); }

/* the search page: the same groups as the box's list, laid out in the page */
.search-results.in-page { position: static; max-height: none; overflow: visible; padding: var(--sp-8) var(--sp-16) var(--sp-16); border: 0; border-radius: 0; box-shadow: none; background: transparent; }

/* the invoice's printed copy: a document, always drawn light, with its own width */
.invoice-logo { display: block; max-height: 64px; max-width: 220px; margin-bottom: var(--sp-12); }
.invoice-sheet { width: 100%; max-width: 900px; margin-inline: auto; padding: var(--sp-32); display: flex; flex-direction: column; gap: var(--sp-24); background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-2); }
.sheet-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--sp-24); align-items: start; }
.sheet-title { margin: 0 0 var(--sp-12); font-size: var(--fs-24); font-weight: var(--fw-700); line-height: var(--lh-tight); }
.sheet-parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--sp-16); }
.sheet-label { margin: 0 0 var(--sp-4); font-size: var(--fs-12); font-weight: var(--fw-600); color: var(--muted); }
.sheet-foot { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--sp-24); align-items: start; }
.sheet-notes ul { margin: 0; padding-inline-start: var(--sp-20); }
.sheet-totals { max-width: 360px; margin-inline-start: auto; width: 100%; }
.sheet-tail { padding-top: var(--sp-12); border-top: 1px solid var(--line-soft); }
.invoice-sheet .table { min-width: 0; }
.invoice-sheet .td, .invoice-sheet .th { padding-inline: var(--sp-8); }

/* on paper: the sheet alone, as A4 would hold it - no frame, no controls, no card around it */
@media print {
  .no-print { display: none !important; }
  /* the sheet keeps its own (light) surface: the page behind it may be the dark theme's, and the sheet's text
     is always the light theme's dark ink */
  .invoice-sheet { max-width: none; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
  .invoice-sheet tr, .sheet-foot, .sheet-parties { break-inside: avoid; }
  .invoice-sheet .scroll-x { overflow: visible; }
  @page { size: A4; margin: 14mm; }
}

/* a narrow screen: the invoice head wraps (its customer takes a row), where its columns had a minimum wider than the screen */
@media (max-width: 900px) {
  .invhead { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .invhead > :first-child { grid-column: 1 / -1; }
}

/* the next-step card: the way on stands at the end of the row, across from what is said, not a third of the way in */
.next-actions.b-420 { flex: 1 1 auto; justify-content: flex-end; }
@media (max-width: 700px) { .next-actions.b-420 { justify-content: flex-start; } }

/* the path to the portal: a column to a step - its mark with the line on to the next, then its name and when it was reached */
.journey { display: flex; gap: var(--sp-8); padding: var(--sp-20) var(--sp-24); }
.journey .st { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: stretch; gap: var(--sp-8); }
.journey .st:last-child { flex: 0 1 auto; min-width: max-content; }
.journey .st-top { display: flex; align-items: center; gap: var(--sp-8); }
.journey .sd { width: 28px; height: 28px; }
.journey .step-line { flex: 1 1 auto; width: auto; min-width: 12px; }
.journey .st > span:last-child { display: flex; flex-direction: column; gap: 2px; line-height: var(--lh-body); }
@media (max-width: 700px) {
  .journey { padding: var(--sp-16); gap: var(--sp-4); }
  .journey .st:last-child { min-width: 0; flex: 1 1 0; }
  .journey .st > span:last-child b { font-size: var(--fs-13); }
}
.journey .st > span:last-child .num { align-self: flex-start; }

/* the headings of the cards beside a document: a small label with an accent, over a line, so the card's own words stand out under it */
.page-aside .card-title { display: flex; align-items: center; gap: var(--sp-8); margin: 0 0 var(--sp-12); padding-bottom: var(--sp-12); border-bottom: 1px solid var(--line-soft); font-size: var(--fs-13); font-weight: var(--fw-600); color: var(--muted); }
.page-aside .card-title::before { content: ""; flex: none; width: 4px; height: 16px; border-radius: var(--r-round); background: var(--brand); }

/* the window that adds a customer from the invoice (D395): wide enough for its boxes two to a row, so the address
   needs no scrolling on a laptop */
dialog.dialog.dialog-wide { max-width: 720px; }

/* Supplier products (D431): the type is a choice as wide as its longest answer (never squeezed), the code
   one run, the description two lines at most (the whole of it in its title); the supplier keeps room
   for a name, and the description gives way first; on a narrower screen Save goes under the
   choice rather than off the card. */
.pk-supplier { min-width: 10rem; }
.pk-kind { width: 1%; }
.pk-kind select { flex: none; width: auto; min-width: 10rem; }
@media (max-width: 1280px) { .pk-kind form { flex-wrap: wrap; } }
.pk-desc { max-width: 26rem; min-width: 7rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- help ---- */
/* ---- the help (D387) ----
   The panel that slides in from the side of the window (the right in English, the left in Arabic) with the article for the
   page, a search over the rest, and the pages the panel opens (the full article, the center). The page behind the panel stays
   where it is and stays usable. Without script the panel never opens: the Help button is a link to the article's page. */
.helpdrawer {
  position: fixed; z-index: 50; inset-block: 0; inset-inline-end: 0;
  width: 420px; max-width: 100vw;
  display: flex; flex-direction: column;
  background: var(--surface); color: var(--text);
  border-inline-start: 1px solid var(--line); box-shadow: var(--shadow-3);
  transform: translateX(100%); visibility: hidden;
  transition: transform .2s ease, visibility 0s linear .2s;
}
[dir="rtl"] .helpdrawer { transform: translateX(-100%); }
.helpdrawer[data-open] { transform: none; visibility: visible; transition: transform .2s ease, visibility 0s; }
@media (prefers-reduced-motion: reduce) { .helpdrawer, .helpdrawer[data-open] { transition: none; } }
.helpdrawer-head { display: flex; align-items: flex-start; gap: var(--sp-12); padding: var(--sp-16) var(--sp-20) var(--sp-8); }
.helpdrawer-head .card-title { margin: 0; }
.helpdrawer-tabs { flex: none; }
.helpdrawer-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--sp-16) var(--sp-20) var(--sp-24); display: flex; flex-direction: column; gap: var(--sp-12); }
.helpdrawer-body[hidden] { display: none; }
.helpdrawer .tabx { background: none; border-top: 0; border-inline: 0; font-family: inherit; cursor: pointer; }

.help-article { display: flex; flex-direction: column; gap: var(--sp-12); }
.help-title { margin: 0; font-size: var(--fs-20); font-weight: var(--fw-600); line-height: 1.3; }
.help-meta { margin: 0; font-size: var(--fs-13); color: var(--muted); }
.help-p, .help-tip { margin: 0; font-size: var(--fs-14); line-height: var(--lh-body); }
.help-lead { font-size: var(--fs-16); color: var(--text-2); }
.help-tip { padding: var(--sp-12); border-radius: var(--r-md); background: var(--page); color: var(--text-2); }
.help-list { margin: 0; padding-inline-start: var(--sp-24); display: flex; flex-direction: column; gap: var(--sp-8); font-size: var(--fs-14); line-height: var(--lh-body); }
.help-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: var(--sp-12); font-size: var(--fs-14); line-height: var(--lh-body); }
.help-steps li { counter-increment: step; position: relative; padding-inline-start: 36px; }
.help-steps li::before { content: counter(step); position: absolute; inset-inline-start: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--brand-sel); color: var(--brand-text); font-size: var(--fs-12); font-weight: var(--fw-600); }
.help-foot { display: flex; flex-wrap: wrap; gap: var(--sp-8); padding-top: var(--sp-8); }
.helpdrawer-body .help-foot { position: sticky; bottom: calc(-1 * var(--sp-24)); margin: auto calc(-1 * var(--sp-20)) calc(-1 * var(--sp-24)); padding: var(--sp-12) var(--sp-20); background: var(--surface); border-top: 1px solid var(--line-soft); }
.help-hint { margin: 0; font-size: var(--fs-14); color: var(--muted); }
.help-empty { display: flex; flex-direction: column; align-items: center; gap: var(--sp-12); padding: var(--sp-32) var(--sp-16); text-align: center; color: var(--muted); }
.help-result-title { font-weight: var(--fw-600); font-size: var(--fs-14); color: var(--brand-text); }
.help-result-text { font-size: var(--fs-13); color: var(--muted); line-height: var(--lh-body); }

/* the help center: a search up top, then a card for each topic */
.help-hero { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-16) var(--sp-20); padding: var(--sp-24); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.help-hero-text { flex: 1 1 280px; min-width: 0; }
.help-hero-text .page-lead { margin: var(--sp-4) 0 0; }
.help-bigsearch { flex: 1 1 100%; display: flex; align-items: center; gap: var(--sp-8); padding: var(--sp-4) var(--sp-4) var(--sp-4) var(--sp-16); background: var(--page); border: 1px solid var(--line-strong); border-radius: var(--r-lg); color: var(--muted); }
.helpdrawer .helpdrawer-body .help-bigsearch { padding: var(--sp-4) var(--sp-12); flex: none; }
.helpdrawer-body .help-rows { margin: 0 calc(-1 * var(--sp-8)); }
.helpdrawer-body .help-rows a { padding-inline: var(--sp-8); border-radius: var(--r-md); }
.helpdrawer-body .help-empty { padding-top: var(--sp-32); }
[dir="rtl"] .help-bigsearch { padding: var(--sp-4) var(--sp-16) var(--sp-4) var(--sp-4); }
.help-bigsearch:focus-within { border-color: var(--brand); background: var(--surface); }
.help-bigsearch input { flex: 1 1 auto; min-width: 0; height: 40px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: var(--fs-16); outline: none; }
.help-topics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: var(--sp-16); align-items: start; }
.help-topic { padding: 0; overflow: hidden; }
.help-topic-head { display: flex; align-items: center; gap: var(--sp-12); padding: var(--sp-16) var(--sp-20); border-bottom: 1px solid var(--line-soft); }
.help-rows { list-style: none; margin: 0; padding: var(--sp-4) 0; }
.help-rows li + li { border-top: 1px solid var(--line-soft); }
.help-rows a { display: flex; align-items: center; gap: var(--sp-12); padding: var(--sp-12) var(--sp-20); color: var(--text); text-decoration: none; }
.help-rows a { transition: background-color .12s ease; }
.help-rows a:hover, .help-rows a:focus-visible { background: var(--brand-sel); }
.help-rows a:hover .help-result-title, .help-rows a:focus-visible .help-result-title { text-decoration: underline; }
.help-rows a:hover .help-result-text, .help-rows a:focus-visible .help-result-text { color: var(--text-2); }
.help-row-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.help-rows .help-result-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.help-row-go { flex: none; color: var(--muted); }
.help-row-go { transition: translate .12s ease, color .12s ease; }
.help-rows a:hover .help-row-go, .help-rows a:focus-visible .help-row-go { color: var(--brand-text); translate: 3px 0; }
[dir="rtl"] .help-rows a:hover .help-row-go, [dir="rtl"] .help-rows a:focus-visible .help-row-go { translate: -3px 0; }
.helpdrawer .tabx:hover { color: var(--text); }
.helpdrawer .help-foot .btn:hover { border-color: var(--brand); }

/* an article as a page: the article is a card, the way to its page and its topic stand beside it */
[dir="rtl"] .mirror-rtl { transform: scaleX(-1); }
.help-doc { padding: var(--sp-32) var(--sp-32) var(--sp-48); display: flex; flex-wrap: wrap; gap: var(--sp-24); align-items: flex-start; max-width: var(--content-max); width: 100%; }
.help-doc-main { flex: 1 1 520px; min-width: 0; max-width: 820px; padding: var(--sp-32) var(--sp-32); display: flex; flex-direction: column; gap: var(--sp-24); }
.help-doc-head { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-12); padding-bottom: var(--sp-20); border-bottom: 1px solid var(--line-soft); }
.help-doc-head .page-title { font-size: var(--fs-26); line-height: var(--lh-tight); }
.help-doc-head .pill { text-decoration: none; }
.help-doc-main .help-article { gap: var(--sp-16); }
.help-doc-main .help-p, .help-doc-main .help-steps, .help-doc-main .help-list, .help-doc-main .help-tip { font-size: var(--fs-16); line-height: 1.75; }
.help-doc-main .help-lead { font-size: var(--fs-20); color: var(--text-2); line-height: 1.7; }
.help-doc-main .help-steps { gap: var(--sp-16); }
.help-doc-main .help-steps li { padding-inline-start: 44px; }
.help-doc-main .help-steps li::before { width: 30px; height: 30px; font-size: var(--fs-14); }
.help-doc-main .help-tip { border-inline-start: 3px solid var(--brand); border-radius: var(--r-md); background: var(--brand-sel); color: var(--text); padding: var(--sp-16) var(--sp-20); }
.help-doc-side { flex: 1 1 260px; max-width: 320px; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-16); position: sticky; top: 0; }
.help-side-card { padding: var(--sp-16); display: flex; flex-direction: column; gap: var(--sp-8); }
.help-side-title { margin: 0; font-size: var(--fs-13); font-weight: var(--fw-600); color: var(--muted); }
.help-side-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.help-side-list a { display: block; padding: var(--sp-8) var(--sp-12); border-radius: var(--r-md); color: var(--text); text-decoration: none; font-size: var(--fs-14); transition: background-color .12s ease; }
.help-side-list a:hover, .help-side-list a:focus-visible { background: var(--brand-sel); }
.help-side-list a.on { background: var(--brand-sel); color: var(--brand-text); font-weight: var(--fw-600); }
.help-pager { display: flex; justify-content: space-between; gap: var(--sp-12); padding-top: var(--sp-20); border-top: 1px solid var(--line-soft); }
.help-pager-link { display: flex; align-items: center; gap: var(--sp-12); max-width: 48%; padding: var(--sp-12) var(--sp-16); border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--text); text-decoration: none; transition: background-color .12s ease, border-color .12s ease; }
.help-pager-link:hover, .help-pager-link:focus-visible { background: var(--brand-sel); border-color: var(--brand); }
.help-pager-link > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.help-pager-link .hint { font-size: var(--fs-12); }
.help-pager-link b { font-size: var(--fs-14); font-weight: var(--fw-600); }
.help-pager-link svg { flex: none; color: var(--muted); }

@media (max-width: 900px) {
  .help-doc { padding: var(--sp-16) var(--sp-4) var(--sp-24); }
  .help-doc-main { padding: var(--sp-20) var(--sp-16); }
  .help-doc-side { max-width: none; position: static; }
  .help-pager { flex-direction: column; }
  .help-pager-link { max-width: none; }
  .helpdrawer { width: 100vw; border-inline-start: 0; }
}

/* ---- home ---- */
/* the home page as docs/reference/design-refine draws it (D381): a header with its buttons, a notice above everything,
   the figures as tiles, what needs a person beside the quick actions, and the invoice shortcuts */
.dash-head { align-items: flex-start; justify-content: space-between; }
.dash-head form { margin: 0; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--sp-16); align-items: start; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }

.notice-bar { display: flex; align-items: center; gap: var(--sp-16); padding: var(--sp-12) var(--sp-16); border: 1px solid var(--warn-line); border-radius: var(--r-lg); background: var(--warn-wash); color: var(--warn-text); }
.notice-bar.bad { border-color: var(--danger-line); background: var(--danger-wash); color: var(--danger-text); }
.notice-bar .notice-icon { flex: none; display: inline-flex; }
.notice-bar .btn { flex: none; background: var(--f-notice-btn); border-color: var(--warn-line); color: var(--warn-text); }
.notice-bar.bad .btn { border-color: var(--danger-line); color: var(--danger-text); }

.stat-card { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-16); }
.stat-card .tile { width: 56px; height: 56px; }

.alert-row .btn { min-width: 140px; justify-content: center; }
.alert-row .btn:not(.pri) { background: transparent; border-color: var(--brand-line); color: var(--brand-text); }
.alert-row .btn:not(.pri):hover { background: var(--brand-soft); }

.quick { display: flex; flex-direction: column; gap: var(--sp-8); }
.quick-row { display: flex; align-items: center; gap: var(--sp-12); padding: var(--sp-12) var(--sp-16); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--text); text-decoration: none; font-weight: var(--fw-500); }
.quick-row:hover { background: var(--hover); color: var(--text); }
.quick-row > svg:first-child { color: var(--brand-text); }
.quick-row > svg:last-child { color: var(--muted); }

.shortcut { display: flex; align-items: center; gap: var(--sp-12); padding: var(--sp-12) var(--sp-16); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--text); text-decoration: none; }
.shortcut:hover { background: var(--hover); color: var(--text); }
.shortcut > svg:last-child { color: var(--muted); }
.shortcut-label { display: flex; align-items: center; gap: var(--sp-8); font-size: var(--fs-14); color: var(--text-2); }
.shortcut .stat-num { display: block; margin: 0; font-size: var(--fs-20); }

/* the latest invoices beside the biggest customers: the customers' card a little wider than the
   page's usual aside, since a company's name is long (step 7). One column on a narrow screen. */
.dash-pair { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 2fr); gap: var(--sp-24); align-items: start; }
@media (max-width: 1100px) { .dash-pair { grid-template-columns: minmax(0, 1fr); } }
/* a customer's row: the name gives way (cut with an ellipsis, whole in the row's title), the
   count and the amount never do */
.kv2.rank-row { align-items: center; }
.kv2.rank-row > span:first-child { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: var(--sp-4); color: var(--text); }
.kv2.rank-row > span:first-child > bdi { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv2.rank-row > span:first-child > .hint { flex: none; }
.kv2.rank-row > span:last-child { flex: none; white-space: nowrap; }
/* System status: each job that gave up, its reason, try again or ignore (D429). */
.job-list { list-style: none; margin: var(--sp-12) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-8); }
.job-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-8) var(--sp-16); padding: var(--sp-12); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--sunken); }
.job-what { flex: 1 1 240px; min-width: 0; }
.job-err { overflow-wrap: anywhere; }
.alert-row .job-row .btn { min-width: 0; width: auto; }

/* ---- mobile ---- */
/* ---- a phone (D385) ----
   The frame is drawn for a wide window; here it is made to fit a hand. Nothing below changes a wide screen: every rule
   is inside a narrow query. The page ends in the footer instead of the footer sitting over the page, the top bar is
   one row (its search opens when it is touched), the practice band is two short lines, a list's rows are cards, an
   invoice's lines are cards, and a form is typed in at a size the phone does not zoom for. */
@media (max-width: 900px) {
  /* the page is as tall as what is on it: the wide layout's zero-height flex basis (the window scrolls inside the frame
     there) left a phone's page overflowing a box one screen high, with the footer at that box's foot, over the page */
  .frame-col, .shell > .col, .content, .pane { min-height: auto; }
  .content, .pane { flex: 1 0 auto; }
  /* one gutter, not three: the shell, the column and the page each added their own */
  .shell { padding: 0; gap: 0; }
  .frame-col, .shell > .col { gap: 0; }
  .content { padding: var(--sp-8) var(--sp-8) 0; gap: var(--sp-8); }
  .page, .page-split { padding: var(--sp-16) var(--sp-4) var(--sp-24); gap: var(--sp-16); }

  /* the footer is the end of the page, not a strip over it */
  .appfoot { position: static; justify-content: center; text-align: center; padding: var(--sp-12) var(--sp-16); margin-top: var(--sp-8); }
  .appfoot .hstat { justify-content: center; flex-wrap: wrap; }

  /* the practice environment: its name and its button on one line, what it means under the name */
  .envbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; justify-items: start; gap: 0 var(--sp-12); padding: var(--sp-8) var(--sp-12); text-align: start; font-size: var(--fs-13); }
  .envbar > .iflex { grid-column: 1; grid-row: 1; }
  .envbar > .vsep { display: none; }
  .envbar > span:not(.iflex) { grid-column: 1; grid-row: 2; font-weight: var(--fw-400); line-height: var(--lh-body); }
  .envbar > .btn { grid-column: 2; grid-row: 1 / span 2; }

  /* the top bar is one row: the menu, the search (a button until it is touched), Activity, the bell, New invoice, the person */
  .topbar { flex-wrap: nowrap; row-gap: 0; padding: var(--sp-8); }
  .topbar .hsearch { order: 0; flex: none; width: 40px; min-width: 0; height: 40px; padding: 0; justify-content: center; }
  .topbar .hsearch svg { pointer-events: none; }
  .topbar .hsearch input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; opacity: 0; cursor: pointer; }
  .topbar .hsearch:is(:focus-within, :has(.search-results:not([hidden]))) { position: absolute; z-index: 25; inset-inline: var(--sp-8); top: var(--sp-8); width: auto; padding: 0 var(--sp-12); justify-content: flex-start; background: var(--surface); }
  .topbar .hsearch:is(:focus-within, :has(.search-results:not([hidden]))) svg { pointer-events: auto; }
  .topbar .hsearch:is(:focus-within, :has(.search-results:not([hidden]))) input { position: static; inset: auto; height: auto; padding: 0 var(--sp-8); opacity: 1; cursor: text; }
  .topbar .hsearch input:focus { outline: none; }
  .topbar .hsearch:focus-within { border-color: var(--brand); }
  /* a panel under a top-bar button is as wide as the screen allows, and starts at the screen's edge */
  .topbar details.menu { position: static; }
  .menu-panel { inset-inline: var(--sp-8); width: auto; max-width: none; top: calc(100% + var(--sp-4)); max-height: 75vh; }

  /* the side menu over the page: dimmed behind, its own width, never scrolling sideways */
  [data-menu="open"] .side { overflow-x: hidden; width: min(86vw, 320px); height: 100dvh; overscroll-behavior: contain; }
  [data-menu="open"] .app::after { content: ""; position: fixed; inset: 0; z-index: 35; background: var(--backdrop); }

  /* a phone has no keyboard to teach */
  .btn .kbd, div.keys-help { display: none; }

  /* a field is typed in at 16px, or the phone zooms the page when it is touched */
  input:not([type=checkbox]):not([type=radio]), select, textarea, .inp, .cell-input { font-size: var(--fs-16); }
  .inp, select.inp, .cell-input { min-height: 44px; }

  /* the bars that keep Save in view */
  .savebar { position: sticky; bottom: 0; padding: var(--sp-12) var(--sp-16); gap: var(--sp-8); }
  .savebar .btn { flex: 1 1 auto; justify-content: center; }
  .totalbar { position: sticky; bottom: var(--sp-8); margin-bottom: var(--sp-8); gap: var(--sp-4) var(--sp-16); padding: var(--sp-12) var(--sp-16); }
  .totalbar > .grow { display: none; }
  .totalbar > .fs-20 { flex: 1 1 100%; }
  .totalbar > .btn { flex: 1 1 0; justify-content: center; }
  .totalbar > .btn.ghost { flex: 0 0 auto; }
  .totalbar > [data-status] { flex: 1 1 100%; }

  /* a dialog fits the screen */
  dialog.dialog { width: calc(100vw - var(--sp-32)); max-width: none; padding: var(--sp-16); }
}

@media (max-width: 700px) {
  /* a row of a list is a card: what is wide in a table is two short lines here */
  .scroll-x:has(> table[data-cards]) { overflow: visible; }
  table[data-cards], table[data-cards] tbody { display: block; min-width: 0; }
  table[data-cards] thead { display: none; }
  table[data-cards] tr { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-8) var(--sp-16); padding: var(--sp-12) var(--sp-16); border-bottom: 1px solid var(--line-soft); }
  table[data-cards] tr:last-child { border-bottom: 0; }
  table[data-cards] td { display: block; flex: 1 1 100%; min-width: 0; padding: 0; border: 0; text-align: start; }
  table[data-cards] td[data-label] { flex: 1 1 40%; order: 5; }
  table[data-cards] td[data-label]::before { content: attr(data-label); display: block; font-size: var(--fs-12); font-weight: var(--fw-400); color: var(--muted); }
  table[data-cards] td:last-child { order: 9; }
  table[data-cards] td .jc-e { justify-content: flex-start; }

  /* the documents' cards: number and status, the customer, the total and the date, the buttons */
  table[data-cards="documents"] tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--sp-8) 0; }
  table[data-cards="documents"] td { grid-column: 1 / -1; order: 0; }
  table[data-cards="documents"] td:nth-last-child(9) { grid-column: 1; grid-row: 1; padding-inline-end: var(--sp-12); }
  table[data-cards="documents"] td:nth-last-child(8) { grid-column: 2; grid-row: 1; font-size: var(--fs-16); }
  table[data-cards="documents"] td:nth-last-child(3) { grid-column: 3; grid-row: 1; }
  table[data-cards="documents"] td:nth-last-child(7) { grid-row: 2; }
  table[data-cards="documents"] td:nth-last-child(6), table[data-cards="documents"] td:nth-last-child(5) { display: none; }
  table[data-cards="documents"] td:nth-last-child(4) { grid-column: 1 / 3; grid-row: 3; }
  table[data-cards="documents"] td:nth-last-child(2) { grid-column: 3; grid-row: 3; text-align: end; }
  table[data-cards="documents"] td:nth-last-child(1) { grid-row: 4; }

  /* a line of an invoice is a card too: its item, its figures with their names, its taxes, its total */
  .lines.editable { min-width: 0; }
  .lines.editable .gh { display: none; }
  .lines.editable .g:not(.gh):not(.line-add) { grid-template-columns: 28px repeat(3, minmax(0, 1fr)); gap: var(--sp-8); padding: var(--sp-12); }
  .lines.editable .g:not(.gh):not(.line-add) > * { padding: 0; min-height: 0; min-width: 0; }
  .lines.editable .g:not(.gh):not(.line-add) > .cell-input { min-height: 44px; }
  .lines.editable .g > :nth-child(1) { grid-column: 1; grid-row: 1; align-self: center; }
  .lines.editable .g > :nth-child(2) { grid-column: 2 / -1; grid-row: 1; }
  .lines.editable .g > :nth-child(3) { grid-column: 2 / 4; grid-row: 2; }
  .lines.editable .g > :nth-child(5) { grid-column: 4; grid-row: 2; justify-content: flex-end; }
  .lines.editable .g > :nth-child(4) { grid-column: 2; grid-row: 3; }
  .lines.editable .g > :nth-child(6) { grid-column: 3; grid-row: 3; }
  .lines.editable .g > :nth-child(7) { grid-column: 4; grid-row: 3; }
  .lines.editable .g > :nth-child(8) { grid-column: 2 / -1; grid-row: 4; flex-wrap: wrap; }
  .lines.editable .g > :nth-child(9) { grid-column: 2 / 4; grid-row: 5; justify-content: space-between; font-size: var(--fs-16); }
  .lines.editable .g > :nth-child(10) { grid-column: 4; grid-row: 5; }
  .lines.editable .g > :nth-child(3):empty, .lines.editable .g > :nth-child(5):empty { display: none; }
  .lines.editable .g > [data-label]::before { content: attr(data-label); font-size: var(--fs-12); color: var(--muted); margin-inline-end: var(--sp-8); }
  .lines.editable .g > [data-line-taxes]::before { display: block; width: 100%; margin: 0; }
  .lines.editable .cellbox { flex-direction: column; align-items: stretch; gap: var(--sp-4); }
  .lines.editable .cell-lbl { display: block; font-size: var(--fs-12); color: var(--muted); }
  .lines.editable .cell-input { border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); padding: 0 var(--sp-8); }
  .lines.editable .mini { width: 40px; height: 40px; }
  .line-more { padding: var(--sp-12); }
  .tax-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lines.editable .g.line-add { display: flex; justify-content: center; padding: var(--sp-8) var(--sp-12); }
  .lines.editable .line-add .muted { display: none; }

  /* the users' list: a person, their roles and state, when they last came */
  .scroll-x .ur-table { min-width: 0; }
  .scroll-x .ur-table .ur.uh { display: none; }
  .scroll-x .ur-table .ur { grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-8) var(--sp-12); align-items: start; padding: var(--sp-12) var(--sp-16); }
  .scroll-x .ur-table .ur > :nth-child(1) { grid-column: 1 / -1; }
  .scroll-x .ur-table .ur > :nth-child(5) { grid-column: 1 / -1; }

  /* the filter chips are one row to swipe along, not five rows */
  nav.flex.wrap:has(> .fc) { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--sp-4)); padding: var(--sp-4); }
  nav.flex.wrap > .fc { flex: none; }

  /* home: the figures two to a row, a need's button under its words */
  .grid.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-8); }
  .stats .stat-card { flex-direction: column-reverse; align-items: flex-start; justify-content: flex-end; gap: var(--sp-8); padding: var(--sp-12); }
  .stats .stat-card .tile { width: 40px; height: 40px; }
  .stats .stat-num { font-size: var(--fs-20); }
  .alert-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--sp-8) var(--sp-12); align-items: center; }
  .alert-row .btn { grid-column: 1 / -1; width: 100%; }
  .notice-bar { flex-wrap: wrap; }
  .notice-bar .btn { width: 100%; justify-content: center; }
  .dash-head > .flex, .dash-head > div:last-child { width: 100%; }
  .dash-head .btn { flex: 1 1 auto; justify-content: center; }

  .page-title { font-size: var(--fs-24); }
}

/* ---- people ---- */
/* settings: users, roles and the audit log (D373) */

/* The users list is a five-column grid; below its natural width it scrolls
   inside the card instead of squeezing the names. */
.ur-table { min-width: 740px; }

/* The recent activity on a person's page carries a date as well as a time. */
.tl .tm.stamp { width: 104px; }

/* The audit log's "what changed": a field, then what it was and is now. */
.aud-diff { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--sp-4) var(--sp-12); font-size: var(--fs-13); }
.aud-diff .side { color: var(--muted); }
.aud-diff .value { overflow-wrap: anywhere; min-width: 0; }
.aud-diff .was { color: var(--danger-text); text-decoration: line-through; }
.aud-diff .now { color: var(--ok-text); }
.ur-table .ur { grid-template-columns: minmax(200px, 2fr) minmax(130px, 1.4fr) 120px 90px 140px; }
.aud-when { white-space: nowrap; }

/* ---- vendor ---- */
/* The vendor console and the self sign-up site (the two other applications, mounted by host).
   They draw the product's own frame, so nearly everything is already a class; what is here
   is only what the shown-once pages, the sign-up trap and the console's frame need. */

/* the console has no footer bar under the page, so Save keeps to the bottom of the screen */
.vd .savebar { bottom: 0; }

/* the sign-up form is a little wider than the sign-in card: six fields and their hints */
.auth-card.vd-signup { max-width: 480px; }

/* the payment page lists the plans with both prices and the choice's four figures */
.auth-card.vd-pay { max-width: 600px; }

/* a secret shown once: the authenticator key, in groups, to read or to type */
.vd-key { padding: var(--sp-12) var(--sp-16); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--sunken); font-family: var(--font-mono); font-size: var(--fs-16); font-weight: var(--fw-600); letter-spacing: .06em; direction: ltr; text-align: center; overflow-wrap: anywhere; }

/* an invitation link, shown whole because it is read aloud or pasted into a message */
.vd-link { padding: var(--sp-12) var(--sp-16); border: 1px solid var(--ok-line); border-radius: var(--r-md); background: var(--surface); font-size: var(--fs-14); color: var(--text-2); direction: ltr; text-align: start; word-break: break-all; }

/* the QR code draws its own white ground and black modules in any theme: a phone has to read it */
.vd-qr { display: flex; justify-content: center; }
.vd-qr svg { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--r-md); }

/* the ten recovery codes, two columns, one time only */
.vd-codes { margin: 0; padding: var(--sp-16); padding-inline-start: var(--sp-32); columns: 2; column-gap: var(--sp-32); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--sunken); direction: ltr; font-family: var(--font-mono); font-size: var(--fs-14); letter-spacing: .06em; line-height: 2; }

/* a field and its button on one line inside a table cell */
.vd-inline { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-8); }
.vd-inline .inp { width: auto; flex: 1 1 160px; min-width: 0; }

/* the sign-up trap: a field a person never sees and a bot fills (docs/20 4.4) - off the page, not hidden by display */
.vd-hp { position: absolute; inset-inline-start: -9999px; }

/* five short fields on a line (a plan's limits, its margin and prices) */
.fg.vd-narrow { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* a full-width link-button keeps its label centred: `.block` alone makes it a plain block */
a.btn.block { display: flex; }
/* ============================== 3. utilities ==============================
   Generated on the same scales; a value that is not on a scale has no class. */
.p-0 { padding:0; }
.px-0 { padding-inline:0; }
.py-0 { padding-block:0; }
.pt-0 { padding-top:0; }
.pb-0 { padding-bottom:0; }
.g-0 { gap:0; }
.mt-0 { margin-top:0; }
.mb-0 { margin-bottom:0; }
.p-4 { padding:var(--sp-4); }
.px-4 { padding-inline:var(--sp-4); }
.py-4 { padding-block:var(--sp-4); }
.pt-4 { padding-top:var(--sp-4); }
.pb-4 { padding-bottom:var(--sp-4); }
.g-4 { gap:var(--sp-4); }
.mt-4 { margin-top:var(--sp-4); }
.mb-4 { margin-bottom:var(--sp-4); }
.p-8 { padding:var(--sp-8); }
.px-8 { padding-inline:var(--sp-8); }
.py-8 { padding-block:var(--sp-8); }
.pt-8 { padding-top:var(--sp-8); }
.pb-8 { padding-bottom:var(--sp-8); }
.g-8 { gap:var(--sp-8); }
.gy-8 { row-gap:var(--sp-8); }
.mt-8 { margin-top:var(--sp-8); }
.mb-8 { margin-bottom:var(--sp-8); }
.ms-8 { margin-inline-start:var(--sp-8); }
.p-12 { padding:var(--sp-12); }
.px-12 { padding-inline:var(--sp-12); }
.py-12 { padding-block:var(--sp-12); }
.pt-12 { padding-top:var(--sp-12); }
.pb-12 { padding-bottom:var(--sp-12); }
.g-12 { gap:var(--sp-12); }
.gx-12 { column-gap:var(--sp-12); }
.mt-12 { margin-top:var(--sp-12); }
.mb-12 { margin-bottom:var(--sp-12); }
.p-16 { padding:var(--sp-16); }
.px-16 { padding-inline:var(--sp-16); }
.py-16 { padding-block:var(--sp-16); }
.pt-16 { padding-top:var(--sp-16); }
.pb-16 { padding-bottom:var(--sp-16); }
.g-16 { gap:var(--sp-16); }
.mt-16 { margin-top:var(--sp-16); }
.mb-16 { margin-bottom:var(--sp-16); }
.p-20 { padding:var(--sp-20); }
.px-20 { padding-inline:var(--sp-20); }
.py-20 { padding-block:var(--sp-20); }
.pt-20 { padding-top:var(--sp-20); }
.pb-20 { padding-bottom:var(--sp-20); }
.g-20 { gap:var(--sp-20); }
.mt-20 { margin-top:var(--sp-20); }
.mb-20 { margin-bottom:var(--sp-20); }
.p-24 { padding:var(--sp-24); }
.px-24 { padding-inline:var(--sp-24); }
.py-24 { padding-block:var(--sp-24); }
.pt-24 { padding-top:var(--sp-24); }
.pb-24 { padding-bottom:var(--sp-24); }
.g-24 { gap:var(--sp-24); }
.mt-24 { margin-top:var(--sp-24); }
.mb-24 { margin-bottom:var(--sp-24); }
.p-32 { padding:var(--sp-32); }
.px-32 { padding-inline:var(--sp-32); }
.py-32 { padding-block:var(--sp-32); }
.pt-32 { padding-top:var(--sp-32); }
.pb-32 { padding-bottom:var(--sp-32); }
.g-32 { gap:var(--sp-32); }
.mt-32 { margin-top:var(--sp-32); }
.mb-32 { margin-bottom:var(--sp-32); }
.p-48 { padding:var(--sp-48); }
.px-48 { padding-inline:var(--sp-48); }
.py-48 { padding-block:var(--sp-48); }
.pt-48 { padding-top:var(--sp-48); }
.pb-48 { padding-bottom:var(--sp-48); }
.g-48 { gap:var(--sp-48); }
.mt-48 { margin-top:var(--sp-48); }
.mb-48 { margin-bottom:var(--sp-48); }
.fs-12 { font-size:var(--fs-12); }
.fs-13 { font-size:var(--fs-13); }
.fs-14 { font-size:var(--fs-14); }
.fs-16 { font-size:var(--fs-16); }
.fs-20 { font-size:var(--fs-20); }
.fs-24 { font-size:var(--fs-24); }
.fs-26 { font-size:var(--fs-26); }
.fw-500 { font-weight:var(--fw-500); }
.fw-600 { font-weight:var(--fw-600); }
.fw-700 { font-weight:var(--fw-700); }
.bg-brand { background:var(--brand); }
.bg-danger { background:var(--danger); }
.c-danger-text { color:var(--danger-text); }
.bg-faint { background:var(--faint); }
.bg-info { background:var(--info); }
.c-muted { color:var(--muted); }
.bg-muted { background:var(--muted); }
.bg-ok { background:var(--ok); }
.c-ok-text { color:var(--ok-text); }
.bg-subtle { background:var(--subtle); }
.bg-sunken { background:var(--sunken); }
.c-surface { color:var(--on-brand); }
.bg-surface { background:var(--surface); }
.c-text { color:var(--text); }
.c-text-2 { color:var(--text-2); }
.bg-warn { background:var(--warn); }
.c-warn-text { color:var(--warn-text); }
.flex { display:flex; }
.iflex { display:inline-flex; }
.grid { display:grid; }
.block { display:block; }
.col { flex-direction:column; }
.wrap { flex-wrap:wrap; }
.ai-c { align-items:center; }
.ai-s { align-items:flex-start; }
.ai-e { align-items:flex-end; }
.jc-sb { justify-content:space-between; }
.jc-e { justify-content:flex-end; }
.as-s { align-self:flex-start; }
.grow { flex:1; }
.icon-slot { flex:0 0 20px; }
.fill { flex:999 1 560px; }
.b-160 { flex:0 1 160px; }
.b-300 { flex:1 1 300px; }
.b-360 { flex:1 1 360px; }
.b-420 { flex:2 1 420px; }
.min0 { min-width:0; }
.w-200 { width:200px; }
.mw-field { max-width:var(--field-max); }
.lh-body { line-height:var(--lh-body); }
.m-0 { margin:0; }
.mt-auto { margin-top:auto; }
.mt-n4 { margin-top:calc(-1 * var(--sp-4)); }
.g-1 { gap:1px; }
.bg-none { background:transparent; }
.b-0 { border:0; }
.bd { border:1px solid var(--line); }
.bb-0 { border-bottom:0; }
.bb-soft { border-bottom:1px solid var(--line-soft); }
.r-md { border-radius:var(--r-md); }
.ta-e { text-align:end; }
.ta-s { text-align:start; }
.is-off { opacity:.55;cursor:not-allowed; }
.clip { overflow:hidden; }
.scroll-x { overflow-x:auto; }
.ellipsis { overflow:hidden;white-space:nowrap;text-overflow:ellipsis; }
.ltr { direction:ltr; }
.break-all { word-break:break-all; }
.check { width:16px;height:16px; }
.auto-220 { grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); }
.auto-260 { grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); }
.auto-280 { grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); }
.auto-420 { grid-template-columns:repeat(auto-fit,minmax(420px,1fr)); }
.ai-start-grid { align-items:start; }
.minh-ctl { min-height:var(--control-h); }

/* a short note behind a small mark: what a refusal, a failure or a cancellation says, on hover, on focus
   and on a press, without leaving the list */
.tip { position: relative; display: inline-flex; }
.tip-btn { width: 24px; height: 24px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; font: inherit; cursor: pointer; }
.tip-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.tip-body { display: none; position: absolute; z-index: 20; top: calc(100% + var(--sp-8)); inset-inline-start: 0; width: 300px; max-width: calc(100vw - var(--sp-32)); flex-direction: column; gap: var(--sp-4); padding: var(--sp-12) var(--sp-16); background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-3); font-size: var(--fs-13); line-height: var(--lh-body); font-weight: var(--fw-400); white-space: normal; }
.tip-body b { font-size: var(--fs-14); font-weight: var(--fw-600); }
.tip:hover .tip-body, .tip:focus-within .tip-body, .tip.open .tip-body { display: flex; }
.tip.up .tip-body { top: auto; bottom: calc(100% + var(--sp-8)); }
/* a small icon button that sits beside a name: here, every invoice of this company */
.mini { width: 28px; height: 28px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-md); color: var(--muted); text-decoration: none; }
.mini:hover { background: var(--hover); color: var(--brand-text); }
.mini:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.bt-soft { border-top: 1px solid var(--line-soft); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
