/* soundcheck - plain CSS, no build step. Edit freely. */

/* ============================================================
   COLOURS
   Every colour in this file comes from a variable below, so a
   theme is a swap of these values and nothing else.

   Dark is the default look. The rules underneath it switch to
   light when either (a) the Mac is set to light and no explicit
   choice has been made, or (b) Light is chosen in the account
   menu, which writes data-theme="light" onto <html>.

   THE ACCENT IS A SEVENTH SWAP ON TOP OF THOSE TWO. Six colours
   somebody can pick, each with its own dark and light value, in
   one block per colour below. They work by REDEFINING
   --dark-accent and --light-accent rather than by repeating the
   two palettes six times over - a custom property is resolved
   on the element it is read from, so the mapping at the foot of
   each palette picks up whichever accent won without knowing
   that any of this is here.

   Which one is on arrives as data-accent on <html>, written by
   the server out of a cookie - see src/accents.js. It is never
   decided in the browser, so a page is never one colour for a
   moment and then another.
   ============================================================ */

:root {
  /* --- the dark palette --- */
  --dark-bg: #0d0e12;
  --dark-panel: #14161b;
  --dark-input: #24272d;
  --dark-ink: #ececee;
  --dark-ink-contrast: #131418;   /* text drawn ON --ink */
  --dark-muted: #9a9da6;
  --dark-line: #2e3138;
  /* The field you are typing in: a clearly lifted border and a slightly
     lifted background, instead of a ring. Both are measured against the
     colours around them in test/contrast.test.js. */
  --dark-focus-line: #868f9e;
  --dark-focus-field: #2b3038;
  --dark-danger: #f2777a;
  --dark-danger-line: #6d2b2b;
  --dark-code-bg: #24272d;
  --dark-error-bg: #3a1d1d;
  --dark-error-line: #6d2b2b;
  --dark-error-ink: #fecaca;
  --dark-notice-bg: #15301f;
  --dark-notice-line: #2f6b47;
  --dark-notice-ink: #a7f3c8;
  /* The floating confirmation disc, and the row that just changed.
     The two discs are the SAME hex in both themes on purpose: it is a badge
     with its own boundary rather than page furniture, and a confirmation that
     is a different green depending on the hour reads as two different marks. */
  --dark-ok-disc: #15803d;
  --dark-bad-disc: #d12b2b;
  --dark-disc-ink: #ffffff;
  --dark-shadow: rgba(0, 0, 0, .5);
  --dark-backdrop: rgba(0, 0, 0, .55);
  /* FIVE COLOURS FOR THE STACKED CHARTS, and nothing else uses them.
     The reporting page draws one band per kind of gig, and a band has to be
     told from its neighbours - so these are spread around the wheel rather
     than being shades of the accent. THE FIRST BAND IS THE ACCENT ITSELF,
     which is why there is no --dark-tone-1: it is var(--accent), so the
     commonest band looks like the app it is in whichever colour that app is.
     COLOUR IS NEVER THE ONLY DIFFERENCE: a band also carries a pattern and
     always sits in the same place in the stack, and the key names it in words.
     See buildStackedChart in src/charts.js. */
  --dark-tone-2: #3fc7b4;
  --dark-tone-3: #e3a33c;
  --dark-tone-4: #f2748c;
  --dark-tone-5: #5aa9ec;
  --dark-tone-6: #a3cc5c;
  /* "No type recorded" is not a kind of work, it is a gap where nobody said
     which kind - so it is drawn in the same quiet grey every "not recorded"
     on the page uses. */
  --dark-tone-blank: #7b838f;
  --dark-inquiry-bg: #352a12;   --dark-inquiry-ink: #f5c96a;
  --dark-booked-bg: #15301f;    --dark-booked-ink: #7fdca0;
  --dark-completed-bg: #262833; --dark-completed-ink: #b9bccb;
  --dark-cancelled-bg: #1f2024; --dark-cancelled-ink: #8f929c;

  /* --- the light palette --- */
  --light-bg: #f6f7f9;
  --light-panel: #ffffff;
  --light-input: #f1f1f3;
  --light-ink: #18181b;
  --light-ink-contrast: #ffffff;
  --light-muted: #63636b;
  --light-line: #e6e8ec;
  --light-focus-line: #697180;
  --light-focus-field: #f1f4f9;
  --light-danger: #c92a2a;
  --light-danger-line: #f3c2c2;
  --light-code-bg: #f1f1f3;
  --light-error-bg: #fdecec;
  --light-error-line: #f3c2c2;
  --light-error-ink: #7f1d1d;
  --light-notice-bg: #dff5e6;
  --light-notice-line: #86efac;
  --light-notice-ink: #14532d;
  --light-ok-disc: #15803d;
  --light-bad-disc: #d12b2b;
  --light-disc-ink: #ffffff;
  --light-shadow: rgba(15, 23, 42, .15);
  --light-backdrop: rgba(15, 23, 42, .35);
  /* The same five, darkened for a white page - see the note in the dark
     palette above. */
  --light-tone-2: #0f8177;
  --light-tone-3: #a96a06;
  --light-tone-4: #c93a5c;
  --light-tone-5: #1f6cb0;
  --light-tone-6: #517d15;
  --light-tone-blank: #737b86;
  --light-inquiry-bg: #fff3d6;   --light-inquiry-ink: #8a5a00;
  --light-booked-bg: #dff5e6;    --light-booked-ink: #1d6b36;
  --light-completed-bg: #ececf2; --light-completed-ink: #45475a;
  --light-cancelled-bg: #f3f3f4; --light-cancelled-ink: #62626a;

  /* ============================================================
     THE SIX ACCENTS
     ============================================================
     FOUR VALUES EACH, PER THEME, and every one of them is a hex rather than a
     calculation so that test/contrast.test.js can measure all twenty-four
     pairs by arithmetic:

       accent      the colour itself - links, the filled button, the lit
                   sidebar row, the bar on today's line.
       accent-hover a step along it, for a link under the pointer.
       accent-ink  what is written ON the filled button. Nearly black on a
                   light accent, white on a dark one.
       accent-soft a wash of it, behind a lit menu row, a chip or a tab.
       accent-on-soft what is written on that wash. In dark it is the accent
                   itself; in LIGHT it is the hover value, which is the darker
                   of the two - a pale wash on a white card cannot carry the
                   lighter one at 4.5:1, and the deeper shade of the same hue
                   is what a designer would reach for anyway.

     Purple is the default and is therefore spelled out in the mapping below
     rather than in a block of its own. */
  --dark-accent-purple: #a690fb;
  --dark-accent-purple-hover: #bfaffc;
  --dark-accent-purple-ink: #140b2e;
  --dark-accent-purple-soft: #201b3e;
  --light-accent-purple: #6d4ae0;
  --light-accent-purple-hover: #5b3dc9;
  --light-accent-purple-ink: #ffffff;
  --light-accent-purple-soft: #ede8ff;

  --dark-accent-blue: #7cb4ff;
  --dark-accent-blue-hover: #a3cbff;
  --dark-accent-blue-ink: #0b1220;
  --dark-accent-blue-soft: #1c2a44;
  --light-accent-blue: #1d5fd1;
  --light-accent-blue-hover: #174ca8;
  --light-accent-blue-ink: #ffffff;
  --light-accent-blue-soft: #e0ebff;

  --dark-accent-teal: #5fd4c4;
  --dark-accent-teal-hover: #86e1d5;
  --dark-accent-teal-ink: #06201c;
  --dark-accent-teal-soft: #123532;
  --light-accent-teal: #0f7d72;
  --light-accent-teal-hover: #0b625a;
  --light-accent-teal-ink: #ffffff;
  --light-accent-teal-soft: #dcf3ef;

  --dark-accent-green: #7fd88f;
  --dark-accent-green-hover: #a3e4ae;
  --dark-accent-green-ink: #0b1f0f;
  --dark-accent-green-soft: #183420;
  --light-accent-green: #2f7d3a;
  --light-accent-green-hover: #24632d;
  --light-accent-green-ink: #ffffff;
  --light-accent-green-soft: #e1f3e3;

  --dark-accent-orange: #ffad66;
  --dark-accent-orange-hover: #ffc48f;
  --dark-accent-orange-ink: #2a1300;
  --dark-accent-orange-soft: #3d2614;
  --light-accent-orange: #b85400;
  --light-accent-orange-hover: #934300;
  --light-accent-orange-ink: #ffffff;
  --light-accent-orange-soft: #fdebd9;

  --dark-accent-pink: #f48fb1;
  --dark-accent-pink-hover: #f9b3cb;
  --dark-accent-pink-ink: #1a0d12;
  --dark-accent-pink-soft: #3a2130;
  --light-accent-pink: #c2255c;
  --light-accent-pink-hover: #a51d4d;
  --light-accent-pink-ink: #ffffff;
  --light-accent-pink-soft: #fbe4ec;

  /* Purple, unless one of the six blocks further down says otherwise. */
  --dark-accent: var(--dark-accent-purple);
  --dark-accent-hover: var(--dark-accent-purple-hover);
  --dark-accent-ink: var(--dark-accent-purple-ink);
  --dark-soft: var(--dark-accent-purple-soft);
  --dark-on-soft: var(--dark-accent-purple);
  --light-accent: var(--light-accent-purple);
  --light-accent-hover: var(--light-accent-purple-hover);
  --light-accent-ink: var(--light-accent-purple-ink);
  --light-soft: var(--light-accent-purple-soft);
  --light-on-soft: var(--light-accent-purple-hover);

  /* --- what the rest of the file actually uses: dark by default --- */
  color-scheme: dark;
  --bg: var(--dark-bg);
  --panel: var(--dark-panel);
  --input: var(--dark-input);
  --ink: var(--dark-ink);
  --ink-contrast: var(--dark-ink-contrast);
  --muted: var(--dark-muted);
  --line: var(--dark-line);
  --focus-line: var(--dark-focus-line);
  --focus-field: var(--dark-focus-field);
  --accent: var(--dark-accent);
  --accent-hover: var(--dark-accent-hover);
  --accent-ink: var(--dark-accent-ink);
  --soft: var(--dark-soft);
  --on-soft: var(--dark-on-soft);
  --danger: var(--dark-danger);
  --danger-line: var(--dark-danger-line);
  --code-bg: var(--dark-code-bg);
  --error-bg: var(--dark-error-bg);
  --error-line: var(--dark-error-line);
  --error-ink: var(--dark-error-ink);
  --notice-bg: var(--dark-notice-bg);
  --notice-line: var(--dark-notice-line);
  --notice-ink: var(--dark-notice-ink);
  --ok-disc: var(--dark-ok-disc);
  --bad-disc: var(--dark-bad-disc);
  --disc-ink: var(--dark-disc-ink);
  /* THE ROW THAT JUST CHANGED is a wash of the accent, which means it is one
     of the six and not a seventh blue nobody picked. It is the same wash the
     lit menu row and a chip use, so there is one "a little bit of accent"
     colour in the app rather than two that nearly match. */
  --settle: var(--soft);
  --shadow: var(--dark-shadow);
  --backdrop: var(--dark-backdrop);
  --tone-1: var(--accent);
  --tone-2: var(--dark-tone-2);
  --tone-3: var(--dark-tone-3);
  --tone-4: var(--dark-tone-4);
  --tone-5: var(--dark-tone-5);
  --tone-6: var(--dark-tone-6);
  --tone-blank: var(--dark-tone-blank);
  --inquiry-bg: var(--dark-inquiry-bg);     --inquiry-ink: var(--dark-inquiry-ink);
  --booked-bg: var(--dark-booked-bg);       --booked-ink: var(--dark-booked-ink);
  --completed-bg: var(--dark-completed-bg); --completed-ink: var(--dark-completed-ink);
  --cancelled-bg: var(--dark-cancelled-bg); --cancelled-ink: var(--dark-cancelled-ink);

  /* 12px corners on a card, 6px on everything you press - the prototype's
     two radii, named rather than typed out in a hundred places. */
  --radius: 12px;
  --radius-control: 6px;
  /* HOW WIDE A DATE OR A TIME BOX IS.
     Every other field in this app is as wide as the form, because what goes
     in it is a name, an address or a paragraph and there is no knowing how
     long. A date is "Jun 12, 2026" and a time is "9:30 PM" - a dozen
     characters at the outside - and a box stretched to 640px for twelve
     characters reads as a box you have got wrong rather than one you have
     filled in. */
  --field-date: 13rem;
  --field-time: 10.5rem;
  /* Every control is this tall - a button, a menu's button, the search box -
     so a row of them reads as one set rather than as several things that
     happen to sit side by side. It grows to 44px under the one breakpoint,
     which is a thumb rather than a pointer. */
  --control-h: 36px;
  /* The left menu, open and shut. Two numbers, read by the frame, by the body
     that makes room for it, and by the little round button on its edge. */
  --side-w: 232px;
  --side-shut-w: 64px;
  /* THE ACCOUNT MENU IS THIS WIDE WHETHER THE MENU IS WIDE OR NARROW.
     It used to be as wide as the row it comes out of, which meant it was one
     width beside a 232px menu and another beside a 64px one - and at the
     narrow end "System" no longer fitted beside its own icon and dropped onto
     a second line, leaving a notch in a row of three. A menu that changes
     shape depending on what is behind it is a menu that has two layouts to
     get right. This is one number, used by both. */
  --acct-menu-w: 264px;

  /* ============================================================
     HOW LONG ANYTHING TAKES, AND THERE ARE FOUR ANSWERS
     ============================================================

     Nearly everything in this app that used to change between one frame and
     the next now moves instead - a menu opening, a dialog arriving, a note
     being added or taken away, a row changing colour, the whole page going
     from light to dark. That is only an improvement while all of it agrees:
     a hundred hand-typed durations is a hundred chances for two things that
     happen together to take different lengths of time, which reads as the
     slower one lagging rather than as a decision.

     So there are THREE lengths for movement, named here, and every animation
     and every transition in this file is one of them.

       --blink   a colour under the pointer, a tick appearing. Short enough
                 that it is felt rather than watched.
       --beat    the ordinary one, and the one to reach for: a menu, a
                 dialog, a row arriving or leaving, the page changing shade.
       --swing   something that CHANGES SHAPE - a fold growing, the menu
                 going narrow - where the eye is following an edge across the
                 screen and needs a little longer to keep up with it.

     NOTHING HERE IS LONGER THAN A THIRD OF A SECOND. An animation Joel waits
     for is an animation that has stopped being free.

     AND TWO MORE THAT ARE NOT MOVEMENT AT ALL: how long a confirmation STAYS.
     Those are read rather than watched, so they are in a different business
     from the three above and are kept apart from them on purpose.

       --linger  the row that just changed, holding its highlight.
       --hold    the bar at the foot of the window.

     --ease is the one curve: quick to leave, gentle to arrive, which is what
     a thing being put somewhere looks like. It is the prototype's curve. */
  --blink: 120ms;
  --beat: 180ms;
  --swing: 260ms;
  --linger: 1100ms;
  --hold: 2600ms;
  --undo-hold: 9000ms;
  /* A BAR FILLING FROM EMPTY, A TIMELINE DRAWING DOWN - the one motion on
     an invoice somebody watches from one end to the other, so it takes the
     brand book's longest beat. Movement, not a wait: it is the only one here
     over a third of a second, and it is argued for in the brand book. */
  --draw: 400ms;
  --ease: cubic-bezier(.3, .8, .3, 1);
}

/* ============================================================
   THE SIX ACCENTS, ONE BLOCK EACH
   Each redefines the four values at the foot of the two
   palettes above. Nothing else in the file changes, because
   everything else reads --accent and friends.
   ============================================================ */
:root[data-accent="blue"] {
  --dark-accent: var(--dark-accent-blue);
  --dark-accent-hover: var(--dark-accent-blue-hover);
  --dark-accent-ink: var(--dark-accent-blue-ink);
  --dark-soft: var(--dark-accent-blue-soft);
  --dark-on-soft: var(--dark-accent-blue);
  --light-accent: var(--light-accent-blue);
  --light-accent-hover: var(--light-accent-blue-hover);
  --light-accent-ink: var(--light-accent-blue-ink);
  --light-soft: var(--light-accent-blue-soft);
  --light-on-soft: var(--light-accent-blue-hover);
}
:root[data-accent="teal"] {
  --dark-accent: var(--dark-accent-teal);
  --dark-accent-hover: var(--dark-accent-teal-hover);
  --dark-accent-ink: var(--dark-accent-teal-ink);
  --dark-soft: var(--dark-accent-teal-soft);
  --dark-on-soft: var(--dark-accent-teal);
  --light-accent: var(--light-accent-teal);
  --light-accent-hover: var(--light-accent-teal-hover);
  --light-accent-ink: var(--light-accent-teal-ink);
  --light-soft: var(--light-accent-teal-soft);
  --light-on-soft: var(--light-accent-teal-hover);
}
:root[data-accent="green"] {
  --dark-accent: var(--dark-accent-green);
  --dark-accent-hover: var(--dark-accent-green-hover);
  --dark-accent-ink: var(--dark-accent-green-ink);
  --dark-soft: var(--dark-accent-green-soft);
  --dark-on-soft: var(--dark-accent-green);
  --light-accent: var(--light-accent-green);
  --light-accent-hover: var(--light-accent-green-hover);
  --light-accent-ink: var(--light-accent-green-ink);
  --light-soft: var(--light-accent-green-soft);
  --light-on-soft: var(--light-accent-green-hover);
}
:root[data-accent="orange"] {
  --dark-accent: var(--dark-accent-orange);
  --dark-accent-hover: var(--dark-accent-orange-hover);
  --dark-accent-ink: var(--dark-accent-orange-ink);
  --dark-soft: var(--dark-accent-orange-soft);
  --dark-on-soft: var(--dark-accent-orange);
  --light-accent: var(--light-accent-orange);
  --light-accent-hover: var(--light-accent-orange-hover);
  --light-accent-ink: var(--light-accent-orange-ink);
  --light-soft: var(--light-accent-orange-soft);
  --light-on-soft: var(--light-accent-orange-hover);
}
:root[data-accent="pink"] {
  --dark-accent: var(--dark-accent-pink);
  --dark-accent-hover: var(--dark-accent-pink-hover);
  --dark-accent-ink: var(--dark-accent-pink-ink);
  --dark-soft: var(--dark-accent-pink-soft);
  --dark-on-soft: var(--dark-accent-pink);
  --light-accent: var(--light-accent-pink);
  --light-accent-hover: var(--light-accent-pink-hover);
  --light-accent-ink: var(--light-accent-pink-ink);
  --light-soft: var(--light-accent-pink-soft);
  --light-on-soft: var(--light-accent-pink-hover);
}

/* ============================================================
   THE SOUNDCHECK TOKENS - docs/invoicing/design/tokens.json
   ============================================================
   The invoice screens' own values, named --sc-*: dark first, light under
   the same two rules the rest of the palette uses further down. They sit
   here, with the hex, because every colour in this file is written at the
   top of it and read by name everywhere else. Their use is the block headed
   THE SOUNDCHECK LOOK at the foot of the file. */
:root {
  --sc-sidebar: #0d0e12;
  --sc-muted: #878d99;
  --sc-surface: #14161b;
  --sc-raised: #15171c;
  --sc-field: #111318;
  --sc-line: #1f2229;
  --sc-line-strong: #2a2e37;
  --sc-hair: #191c22;
  --sc-ink-2: #b8bdc7;
  --sc-dim: #6b717d;
  --sc-success: #5bd08e;
  --sc-meter: #1f232a;
  --sc-inset: rgba(255, 255, 255, .04);
  --sc-inset-p: rgba(255, 255, 255, .25);
  --sc-shadow-card: 0 1px 2px rgba(0, 0, 0, .4);
  --sc-shadow-pop: 0 12px 32px rgba(0, 0, 0, .55);
  --sc-scrim: rgba(5, 6, 10, .55);
  --sc-draft-bg: #1e2026;   --sc-draft-ink: #b8bdc7;
  --sc-sent-bg: #252337;    --sc-sent-ink: #a690fb;
  --sc-partly-bg: #30291b;  --sc-partly-ink: #e8b64c;
  --sc-overdue-bg: #311f23; --sc-overdue-ink: #f0787a;
  --sc-paid-bg: #192b25;    --sc-paid-ink: #5bd08e;
  --sc-void-ink: #878d99;
  --sc-toast-bg: #eef0f4;   --sc-toast-ink: #0d0e12;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --sc-sidebar: #f1f2f5;
  --sc-muted: #6b7280;
    --sc-muted: #6b7280;
    --sc-surface: #ffffff;
    --sc-raised: #ffffff;
    --sc-field: #ffffff;
    --sc-line: #e6e8ec;
    --sc-line-strong: #d9dce2;
    --sc-hair: #eef0f3;
    --sc-ink-2: #3f4451;
    --sc-dim: #7d838f;
    --sc-success: #1f8f4e;
    --sc-meter: #e6e8ec;
    --sc-inset: rgba(255, 255, 255, 0);
    --sc-inset-p: rgba(255, 255, 255, .18);
    --sc-shadow-card: 0 1px 2px rgba(16, 24, 40, .06);
    --sc-shadow-pop: 0 12px 32px rgba(16, 24, 40, .16);
    --sc-scrim: rgba(16, 24, 40, .35);
    --sc-draft-bg: #e9eaed;   --sc-draft-ink: #3f4451;
    --sc-sent-bg: #e8e2fa;    --sc-sent-ink: #5b3dc9;
    --sc-partly-bg: #f2e9d7;  --sc-partly-ink: #8a5a00;
    --sc-overdue-bg: #f6dddd; --sc-overdue-ink: #b02222;
    --sc-paid-bg: #ddeee4;    --sc-paid-ink: #176c3b;
    --sc-void-ink: #6b7280;
    --sc-toast-bg: #111318;   --sc-toast-ink: #f6f7f9;
  }
}
:root[data-theme="light"] {
  --sc-sidebar: #f1f2f5;
  --sc-surface: #ffffff;
  --sc-raised: #ffffff;
  --sc-field: #ffffff;
  --sc-line: #e6e8ec;
  --sc-line-strong: #d9dce2;
  --sc-hair: #eef0f3;
  --sc-ink-2: #3f4451;
  --sc-dim: #7d838f;
  --sc-success: #1f8f4e;
  --sc-meter: #e6e8ec;
  --sc-inset: rgba(255, 255, 255, 0);
  --sc-inset-p: rgba(255, 255, 255, .18);
  --sc-shadow-card: 0 1px 2px rgba(16, 24, 40, .06);
  --sc-shadow-pop: 0 12px 32px rgba(16, 24, 40, .16);
  --sc-scrim: rgba(16, 24, 40, .35);
  --sc-draft-bg: #e9eaed;   --sc-draft-ink: #3f4451;
  --sc-sent-bg: #e8e2fa;    --sc-sent-ink: #5b3dc9;
  --sc-partly-bg: #f2e9d7;  --sc-partly-ink: #8a5a00;
  --sc-overdue-bg: #f6dddd; --sc-overdue-ink: #b02222;
  --sc-paid-bg: #ddeee4;    --sc-paid-ink: #176c3b;
  --sc-void-ink: #6b7280;
  --sc-toast-bg: #111318;   --sc-toast-ink: #f6f7f9;
}


/* No choice saved yet + the Mac is in light mode. "data-theme" is only ever
   on the page when Dark or Light was picked deliberately, and an explicit
   Dark must beat the system here. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: var(--light-bg);
    --panel: var(--light-panel);
    --input: var(--light-input);
    --ink: var(--light-ink);
    --ink-contrast: var(--light-ink-contrast);
    --muted: var(--light-muted);
    --line: var(--light-line);
    --focus-line: var(--light-focus-line);
    --focus-field: var(--light-focus-field);
    --accent: var(--light-accent);
    --accent-hover: var(--light-accent-hover);
    --accent-ink: var(--light-accent-ink);
    --soft: var(--light-soft);
    --on-soft: var(--light-on-soft);
    --danger: var(--light-danger);
    --danger-line: var(--light-danger-line);
    --code-bg: var(--light-code-bg);
    --error-bg: var(--light-error-bg);
    --error-line: var(--light-error-line);
    --error-ink: var(--light-error-ink);
    --notice-bg: var(--light-notice-bg);
    --notice-line: var(--light-notice-line);
    --notice-ink: var(--light-notice-ink);
    --ok-disc: var(--light-ok-disc);
    --bad-disc: var(--light-bad-disc);
    --disc-ink: var(--light-disc-ink);
    --shadow: var(--light-shadow);
    --backdrop: var(--light-backdrop);
    --tone-2: var(--light-tone-2);
    --tone-3: var(--light-tone-3);
    --tone-4: var(--light-tone-4);
    --tone-5: var(--light-tone-5);
    --tone-6: var(--light-tone-6);
    --tone-blank: var(--light-tone-blank);
    --inquiry-bg: var(--light-inquiry-bg);     --inquiry-ink: var(--light-inquiry-ink);
    --booked-bg: var(--light-booked-bg);       --booked-ink: var(--light-booked-ink);
    --completed-bg: var(--light-completed-bg); --completed-ink: var(--light-completed-ink);
    --cancelled-bg: var(--light-cancelled-bg); --cancelled-ink: var(--light-cancelled-ink);
  }
}

/* Light picked in the account menu: same swap, whatever the Mac says. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: var(--light-bg);
  --panel: var(--light-panel);
  --input: var(--light-input);
  --ink: var(--light-ink);
  --ink-contrast: var(--light-ink-contrast);
  --muted: var(--light-muted);
  --line: var(--light-line);
  --focus-line: var(--light-focus-line);
  --focus-field: var(--light-focus-field);
  --accent: var(--light-accent);
  --accent-hover: var(--light-accent-hover);
  --accent-ink: var(--light-accent-ink);
  --soft: var(--light-soft);
  --on-soft: var(--light-on-soft);
  --danger: var(--light-danger);
  --danger-line: var(--light-danger-line);
  --code-bg: var(--light-code-bg);
  --error-bg: var(--light-error-bg);
  --error-line: var(--light-error-line);
  --error-ink: var(--light-error-ink);
  --notice-bg: var(--light-notice-bg);
  --notice-line: var(--light-notice-line);
  --notice-ink: var(--light-notice-ink);
  --ok-disc: var(--light-ok-disc);
  --bad-disc: var(--light-bad-disc);
  --disc-ink: var(--light-disc-ink);
  --shadow: var(--light-shadow);
  --backdrop: var(--light-backdrop);
  --tone-2: var(--light-tone-2);
  --tone-3: var(--light-tone-3);
  --tone-4: var(--light-tone-4);
  --tone-5: var(--light-tone-5);
  --tone-6: var(--light-tone-6);
  --tone-blank: var(--light-tone-blank);
  --inquiry-bg: var(--light-inquiry-bg);     --inquiry-ink: var(--light-inquiry-ink);
  --booked-bg: var(--light-booked-bg);       --booked-ink: var(--light-booked-ink);
  --completed-bg: var(--light-completed-bg); --completed-ink: var(--light-completed-ink);
  --cancelled-bg: var(--light-cancelled-bg); --cancelled-ink: var(--light-cancelled-ink);
}

* { box-sizing: border-box; }

/* ============================================================
   `hidden` HAS TO ACTUALLY HIDE.

   The browser's own rule is [hidden] { display: none }, which is
   a plain attribute selector - so ANY class selector in this
   file that sets display beats it. `.form label { display:
   flex }` did exactly that, and the two fields the picker hides
   behind its combobox stayed on screen and, worse, stayed in
   the Tab order: three stops for one control, two of them
   invisible to somebody using a mouse and unavoidable for
   somebody using a keyboard.

   This is the one rule in the file that uses !important, and it
   is the case the keyword exists for: an author rule that must
   outrank every other author rule, because it is not styling -
   it is the difference between an element being there and not.
   ============================================================ */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  /* GEIST, FOR EVERYTHING, NUMBERS INCLUDED - the typeface of the new look,
     loaded from Google Fonts in views/partials/header.ejs. Tabular figures so
     a column of amounts lines up. The system's own face stands in when the
     font has not arrived. */
  font: 15px/1.5 Geist, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Showing where the keyboard is ----------
   Two different jobs, done two different ways.

   BUTTONS AND LINKS get a ring, and only for the keyboard. A mouse click
   already said where you are, so a ring after a click is just noise. The
   first rule takes away the one browsers draw of their own accord; the
   second puts it back on :focus-visible, which is meant to mean exactly
   "indicate this one".

   The third rule is the belt to that pair of braces. Browsers do not all
   agree on when :focus-visible applies after a click - Safari and Chrome
   differ on <summary> in particular - so public/app.js writes
   data-input="mouse" or "key" onto <html> and this switches the ring off
   outright while the mouse is what is being used. With JavaScript off the
   attribute never appears and the browser's own judgement stands.

   TEXT BOXES do not get a ring at all - see "A field you are typing in"
   below. :focus-visible is no help there: browsers deliberately keep
   reporting it on a text box after a mouse click, which is how the loud
   ring survived the last attempt at this. */
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html[data-input="mouse"] :focus-visible { outline: none; }

/* ---------- A field you are typing in ----------
   Somebody filling in a form has to be able to see which box their typing
   is going into, whether they got there by mouse or by Tab. That is said
   here with the field's own border and background rather than with a ring
   round the outside: the border lifts to --focus-line and the inside lifts
   to --focus-field. Quiet, but not subtle enough to miss - both colours are
   measured against their neighbours in test/contrast.test.js, which holds
   them to the 3:1 WCAG asks for a non-text indicator.

   The :not()s do two jobs. They keep out the controls this makes no sense
   for - a radio has no border of ours to shift, so it keeps the keyboard
   ring above - and they carry the weight this rule needs to beat the
   per-form rules further down the file. A bare "select:focus" weighs exactly
   the same as ".form select" and loses to it for being higher up, which is
   how a focused dropdown quietly kept its resting border the first time. */
input:not([type="radio"]):not([type="checkbox"]):focus,
select:not([disabled]):not([size]):focus,
textarea:not([disabled]):not([readonly]):focus {
  outline: none;
  border-color: var(--focus-line);
  background: var(--focus-field);
}

/* ---------- "Restart me" banner ----------
   Written by views/partials/header.ejs when src/freshness.js has noticed the
   running process is behind the files on disk. Uses the error colours on
   purpose: this is not a tip, it is the reason the page below it is wrong. */
.stale-banner {
  margin: 0; padding: 10px 24px;
  background: var(--error-bg); border-bottom: 1px solid var(--error-line);
  color: var(--error-ink); font-size: 13px; line-height: 1.5;
}
.stale-banner kbd {
  font: inherit; font-weight: 700;
  background: var(--code-bg); color: var(--ink);
  padding: 0 5px; border-radius: 4px;
}
.stale-banner code {
  background: var(--code-bg); color: var(--ink);
  padding: 1px 5px; border-radius: 4px; font-size: 12px;
}

/* ============================================================
   THE FRAME
   ============================================================

   Joel's side is a column down the left; a client's side is a quiet bar
   across the top with the name of the app in it and nothing else to press
   except the account row.

   WHY THE TOP BAR BECAME A COLUMN. The bar had five links and was going to
   have seven, then nine. Five links in a row that will not break is about 350
   pixels, and a phone can be 360 wide once its scrollbar has had its share -
   so every place added to a horizontal bar was a place closer to a bar that
   could not be read. The bar's answer was a Manage dropdown that stopped at
   five; a column simply has room for the next one. The grouping stays, which
   was the good half of the old decision: four places Joel opens on purpose,
   and a Manage group of the things set up once and looked at rarely.

   NOTHING HERE NEEDS JAVASCRIPT. The collapse is a form post against a
   cookie; the drawer is a checkbox and two labels; the account menu is the
   same <details> every other menu in this app is. See the notes in
   views/partials/sidebar.ejs. ---------- */

/* THE PAGE MAKES ROOM FOR THE MENU rather than the menu floating over it.
   padding on <body>, so the banners at the top of the page are pushed across
   with everything else - they are page content, not chrome.

   AND IT TRAVELS AT THE SAME SPEED THE MENU DOES, which is the fix for the
   complaint "the sidebar animates but the page content beside it jumps
   instantly". The menu had a transition and the padding that makes room for
   it did not, so the column slid and the page arrived - two movements, in one
   gesture, finishing at different times. One length and one easing, named
   once at the top of this file, so there is no second number to keep in
   step. */
body.with-sidebar {
  padding-left: var(--side-w);
  transition: padding-left var(--swing) var(--ease);
}
html[data-sidebar="shut"] body.with-sidebar { padding-left: var(--side-shut-w); }

.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; z-index: 30;
  width: var(--side-w);
  display: flex; flex-direction: column; gap: 2px;
  padding: 16px 12px;
  background: var(--panel); border-right: 1px solid var(--line);
  overflow-y: auto; overflow-x: hidden;
  /* It changes width when the cookie changes and slides in as a drawer on a
     phone. Both are listed here; prefers-reduced-motion switches them off at
     the foot of this block. */
  transition: width var(--swing) var(--ease), transform var(--swing) var(--ease);
}
/* WHAT CHANGES IS THE WIDTH AND NOTHING ELSE. The padding used to shrink with
   it - 12px to 10px - which sounds like nothing and was not: every icon in
   the column slid two pixels left while the column itself slid 168, so the
   contents and the container were travelling different distances at the same
   time. That is exactly what "pieces moving independently" looks like. The
   padding stays put, the rows stay left-aligned at every width (see ICONS
   ONLY below), and the icons do not move at all during the collapse - they
   simply stop having words beside them. */
html[data-sidebar="shut"] .sidebar { width: var(--side-shut-w); }

/* ---------- NOTHING IN THE FRAME IS TEXT YOU CAN PICK OUT ----------

   THE COMPLAINT: double-click anywhere in the left menu and every word in it
   went blue - Dashboard, Gigs, Clients, Reports, Manage, the wordmark, the
   name on the account row, the lot. Dragging across it did the same.

   WHICH IS WHAT A BROWSER IS SUPPOSED TO DO, and is wrong here anyway: a
   browser cannot tell a column of links from a column of prose, and a
   double-click on a word is normally a request for that word. Nobody has ever
   wanted to copy the word "Gigs" out of a menu. What they were doing is
   pressing it twice, or starting a drag that ended up on it, and the app
   answering with a wall of highlight.

   SO THE CHROME IS NOT SELECTABLE and the page is, which is the same rule
   every application on this machine follows: the menu bar is furniture, the
   document is text. The mini bar on a phone is the same furniture, where the
   same drag is a long press that pops up Copy / Look Up.

   -webkit- as well as plain, because an iPhone needs it. WHAT STAYS
   SELECTABLE IS WHAT SOMEBODY TYPES: the search box is a real field with real
   text in it, and a field you cannot select inside is a field you cannot
   correct. That is the one exception and it is said as one. */
.sidebar, .mini-top {
  -webkit-user-select: none;
  user-select: none;
}
.sidebar input, .sidebar textarea, .mini-top input {
  -webkit-user-select: text;
  user-select: text;
}

/* THE BLANK SPACE OF THE MENU IS NOT A CONTROL. It was one for two rounds - a
   submit button stretched behind every row, a pointer cursor over the air and
   a highlight on the edge button to match - and it meant the menu changed
   shape under a hand that was only passing through. Only the round button on
   the edge opens and shuts it now. */

.side-brand {
  display: flex; align-items: center; height: 36px; padding: 0 10px;
  color: var(--ink); font-size: 19px; font-weight: 700; letter-spacing: -.02em;
}
.side-brand { position: relative; }
.side-brand:hover { text-decoration: none; color: var(--accent); }
/* "sc" IS DRAWN WHERE "soundcheck" STARTS, and the two crossfade. Out of the
   flow, so it costs no width and the long word does not have to make room for
   it; at the same left edge, so what somebody sees is one word shortening
   rather than two words taking turns. It used to be display: none and
   display: block, which is a swap with no middle - the long word vanished a
   frame before the short one arrived. */
.side-brand-short {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  opacity: 0; pointer-events: none;
  transition: opacity var(--swing) var(--ease);
}
html[data-sidebar="shut"] .side-brand-short { opacity: 1; }
.side-new { margin: 12px 0 8px; width: 100%; }
.plus-icon { flex: 0 0 auto; width: 18px; height: 18px; }

/* ONE ROW IN THE MENU, and the same shape whether it is a link, a <summary>
   or a submit button - which is why this is a class rather than three rules.
   36px, a 6px corner, the icon then the word, and nothing drawn until the
   pointer is on it. */
.side-item {
  display: flex; align-items: center; gap: 12px;
  height: 36px; padding: 0 10px;
  border: 0; border-radius: var(--radius-control); background: none;
  color: var(--muted); font: inherit; font-size: 14px; text-align: left;
  width: 100%; white-space: nowrap; cursor: pointer;
}
.side-item { transition: background-color var(--blink) ease, color var(--blink) ease; }
.side-item:hover { background: var(--input); color: var(--ink); text-decoration: none; }
/* WHERE YOU ARE: the soft wash of the accent, the accent's own ink on it, and
   the weight. Three things rather than one, because colour alone is not
   enough - see the note on charts. */
.side-item.is-here {
  background: var(--soft); color: var(--on-soft); font-weight: 600;
}
.side-icon { flex: 0 0 auto; width: 18px; height: 18px; }

/* The label over the Manage group. A word, not a fold.

   AND IT IS THE SAME HEIGHT AT BOTH WIDTHS, which is why there is a ::before
   in here. "Manage" has nowhere to go at 64px and the break it marks still
   has to be there, so the word crossfades into a hairline rather than being
   replaced by one. It used to be a 1px box when the menu was shut, so the
   four rows below it rose 17px during the collapse and dropped 17px back
   during the expand - which is the "layout jank" half of the complaint. The
   box does not change size now; only what is drawn inside it does. */
.side-group {
  position: relative;
  margin: 0; padding: 14px 10px 4px;
  font-size: 12px; color: var(--muted);
  white-space: nowrap;
  transition: color var(--swing) var(--ease);
}
.side-group::before {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 7px;
  height: 1px; background: var(--line); opacity: 0;
  transition: opacity var(--swing) var(--ease);
}
.side-nav { display: flex; flex-direction: column; gap: 2px; }

/* ============================================================
   THE MANAGE FOLD
   ============================================================

   One row with a chevron, and six rows that fold open under it. Which way it
   is comes from the server as data-open on .side-manage - see
   views/partials/sidebar.ejs - so the menu ARRIVES folded or open and this
   file only draws the difference.

   THE SLIDE IS A GRID ROW GOING FROM 0fr TO 1fr, which is the one way to
   animate a box to "as tall as whatever is in it" without measuring it in
   script: the row is a fraction of its own content, and a fraction can be
   travelled. It takes --swing, the app's one length for a thing that changes
   shape, on the app's one curve - the same pair the menu's own width uses,
   so the fold and the column it lives in move alike.

   FOLDED, THE SIX LINKS ARE NOT THERE FOR THE KEYBOARD EITHER. A row squeezed
   to nothing is still in the Tab order unless something says otherwise, and
   six invisible stops in a menu is a keyboard that seems to have stuck. So
   they go to visibility: hidden - but only AFTER the slide, which is what the
   delay on that one transition is: hidden at once on the way shut would be
   the rows vanishing and then an empty box closing. */
.side-manage { display: flex; flex-direction: column; gap: 2px; }
.side-manage-form { margin: 0; }
.side-chevron {
  flex: 0 0 auto; width: 14px; height: 14px; margin-left: auto;
  transition: transform var(--swing) var(--ease), opacity var(--swing) var(--ease);
}
.side-manage[data-open="yes"] .side-chevron { transform: rotate(180deg); }
.side-manage-items {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows var(--swing) var(--ease);
}
.side-manage[data-open="yes"] > .side-manage-items { grid-template-rows: 1fr; }
.side-manage-inner {
  min-height: 0; overflow: hidden;
  display: flex; flex-direction: column; gap: 2px;
  visibility: hidden;
  transition: visibility 0s linear var(--swing);
}
.side-manage[data-open="yes"] .side-manage-inner { visibility: visible; transition-delay: 0s; }
.side-manage-word { overflow: hidden; text-overflow: ellipsis; }
/* The heading the flyout carries. In a fold the row above already says it. */
.side-fly-title { display: none; }

/* ---------- MANAGE READS AS A HEADING, NOT AS A FIFTH PLACE ----------

   THE COMPLAINT: with an icon, 14px words and the same hover as Gigs and
   Clients, "Manage" looked like one more page to open. It is the name of a
   group, so it is drawn as one: small, muted, no icon, no wash under the
   pointer, and the chevron kept on the right because it still folds.

   ITS PAGES SIT UNDER IT, a little in from the edge, straight on the menu's
   own background like the rows above - no panel behind them and no line
   down their side (Joel, October 2026: the gray box and the line made the
   group read as something stuck on). The indent is what says they belong
   to the heading. Each row's own hover wash is the same as every other's.

   IT IS NEVER LIT. The page you are on is one of the rows; a heading that
   also lit would be two things claiming to be where you are.

   THE ICON IS STILL IN THE MARKUP, squeezed to nothing, because the menu shut
   to icons has no room for a word and Manage is one icon there - see MANAGE,
   WHEN THE MENU IS ICONS. It grows back over the same length the column
   takes to shrink, so the two shapes are travelled between rather than
   swapped. */
.side-manage-toggle {
  margin-top: 8px;
  font-size: 12px; font-weight: 500; letter-spacing: .02em;
}
.side-manage-toggle:hover { background: none; }
.side-manage-toggle .side-icon {
  width: 0; opacity: 0; margin-right: -12px;
  transition: width var(--swing) var(--ease), opacity var(--swing) var(--ease),
              margin-right var(--swing) var(--ease);
}
.side-manage-inner { margin-left: 24px; }
@media (prefers-reduced-motion: reduce) {
  .side-chevron, .side-manage-items, .side-manage-inner { transition: none; }
}
@media (prefers-reduced-motion: reduce) {
  .side-manage-toggle .side-icon { transition: none; }
}
.side-rest { flex: 1 1 auto; min-height: 16px; }

/* The search box, as it sits in the column: full width, the menu's own height,
   and its answers hang off it exactly as they hung off the top bar. */
.side-search { padding: 0 0 8px; }
.side-search .site-search { max-width: none; width: 100%; }
/* The icon that stands in for it when there is no room for a box. Not drawn
   while the menu is open. */
.side-search-shut {
  margin: 0;
  position: absolute; left: 0; right: 0; top: 0;
  opacity: 0; pointer-events: none;
  transition: opacity var(--swing) var(--ease);
}
html[data-sidebar="shut"] .side-search-shut { opacity: 1; pointer-events: auto; }

/* ---------- ICONS ONLY ----------
   What goes when the menu is 64px wide: every word, the group label, the
   search box. What stays: the icons, the plus, and the two-letter wordmark.

   THE WORDS ARE HIDDEN FROM THE EYE AND NOT FROM THE PAGE. display: none
   would take them out of the document, and the name of every row in this menu
   would go with them - a screen reader would be left with eight unlabelled
   icons.

   SO THEY SHRINK AND FADE, OVER THE SAME LENGTH THE COLUMN TAKES, which is
   the fix for "labels popping in before or after the width settles". They
   used to be moved off screen with clip-path, which is a jump: the words were
   gone in one frame and the column spent the next quarter of a second
   catching up, so the collapse read as two events. A box that is clipped to
   nothing is hidden the same way clip-path hides it - the text is still laid
   out and still read aloud - and it can be travelled to rather than switched
   to.

   max-width RATHER THAN width, because the words are different lengths and
   none of them should be stretched to the longest. 180px is past the widest
   of them at 232px of column, so nothing is truncated while the menu is
   open. */
.side-text {
  max-width: 180px; overflow: hidden; white-space: nowrap;
  transition: max-width var(--swing) var(--ease), opacity var(--swing) var(--ease);
}
html[data-sidebar="shut"] .side-text { max-width: 0; opacity: 0; }

/* THE BOX AND THE ICON THAT REPLACES IT, IN ONE SLOT. They lie on top of each
   other and crossfade, so the rows underneath do not move while the swap
   happens - see the note in views/partials/sidebar.ejs. The height is the
   search box's own, held here so that the slot does not collapse when the
   only thing in the flow has faded out. */
.side-find { position: relative; }
.side-search { transition: opacity var(--swing) var(--ease); }
html[data-sidebar="shut"] .side-search { opacity: 0; pointer-events: none; }
html[data-sidebar="shut"] .side-search .site-search { visibility: hidden; }

/* ---------- AND THE LABEL THAT APPEARS BESIDE AN ICON ----------

   A row shut to an icon still has to say which page it is. The browser's own
   title tooltip did that badly: it waits a second, it is drawn in the system's
   font wherever the pointer happens to be, and for somebody moving through the
   menu with the Tab key it never appears at all. So the label is the app's
   own: a small chip beside the row, on hover AND on keyboard focus.

   IT IS NOT A MENU POPPING OUT. The row does not widen, the menu does not
   reopen, and nothing on the page moves - the chip is out of the flow and
   takes no clicks. The round button on the edge stays the only way to make
   the menu wide again, which is what it is for.

   WHY THE MENU STOPS CLIPPING WHILE IT IS NARROW. A chip beside a 64px column
   is a chip outside it, and overflow: hidden would cut it off at the seam.
   Shut, this menu is nine rows of 36px and has no scrolling left to do, so
   there is nothing to lose by letting it paint outside itself. The short
   window that WOULD need to scroll is caught at the foot of this block. */
html[data-sidebar="shut"] .sidebar { overflow: visible; }
html[data-sidebar="shut"] .side-item,
html[data-sidebar="shut"] .side-new { position: relative; }
.side-tip { display: none; }
html[data-sidebar="shut"] .side-tip {
  display: block;
  position: absolute; left: calc(100% + 10px); top: 50%; z-index: 40;
  transform: translateY(-50%) translateX(-4px);
  padding: 5px 10px; border-radius: var(--radius-control);
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  box-shadow: 0 4px 14px var(--shadow);
  font-size: 13px; font-weight: 500; line-height: 1.2;
  white-space: nowrap; pointer-events: none;
  opacity: 0;
  transition: opacity var(--blink) ease, transform var(--blink) var(--ease);
}
html[data-sidebar="shut"] .side-item:hover > .side-tip,
html[data-sidebar="shut"] .side-item:focus-visible > .side-tip,
html[data-sidebar="shut"] .side-new:hover > .side-tip,
html[data-sidebar="shut"] .side-new:focus-visible > .side-tip {
  opacity: 1; transform: translateY(-50%);
}
/* A window too short for the shut menu scrolls it again, and a menu that
   scrolls has to clip - so the chips go there rather than being cut in half.
   The rows still carry their words off screen, so nothing loses its name. */
@media (max-height: 620px) {
  html[data-sidebar="shut"] .sidebar { overflow-y: auto; overflow-x: hidden; }
  html[data-sidebar="shut"] .side-tip { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-sidebar="shut"] .side-tip { transition: none; transform: translateY(-50%); }
}
/* ============================================================
   MANAGE, WHEN THE MENU IS ICONS: ONE ICON AND A FLYOUT
   ============================================================

   Six more icons in a 64px column would be ten unlabelled pictures in a row.
   So Manage stays ONE icon, and its six pages are a small menu that appears
   beside it - the one place in this column where something does pop out,
   because here there is a choice to make rather than a name to read.

   WHAT OPENS IT, AND WHY THERE ARE THREE WAYS IN:
     :hover          a pointer resting on the icon, or on the flyout itself.
     :focus-within   the keyboard arriving on the icon, or moving on into the
                     six links - so Tab walks into the menu rather than past it.
     [data-fly]      a tap or a click, set by public/app.js, for a finger -
                     which cannot hover - and for anybody who expects a press
                     to hold a menu open.
   The first two need no script at all.

   WHAT SHUTS IT: the pointer leaving, the focus leaving, a press anywhere
   else, or Escape. Escape has to beat :focus-within, since the keyboard is
   still on the icon when it is pressed - that is what data-fly="shut" is.

   THE SAME LIST AS THE FOLD, not a second copy: .side-manage-items is taken
   out of the column and stood beside it. The 10px on its left is clear air
   that is still part of it, so the pointer can cross from the icon to the
   menu without the hover letting go on the way.

   WHETHER THE FOLD ITSELF IS OPEN MAKES NO DIFFERENCE HERE. Shut or open, in
   an icons-only menu the six are never drawn in the column. */
html[data-sidebar="shut"] .side-manage { position: relative; }
html[data-sidebar="shut"] .side-chevron { opacity: 0; width: 0; }
/* SHUT TO ICONS, MANAGE IS AN ICON AGAIN, the same size and the same hover as
   the four above it - there is no word here for it to be a heading with. */
html[data-sidebar="shut"] .side-manage-toggle .side-icon {
  width: 18px; opacity: 1; margin-right: 0;
}
html[data-sidebar="shut"] .side-manage-toggle:hover { background: var(--input); }
/* YOU ARE ON ONE OF ITS PAGES AND CANNOT SEE WHICH. In a wide menu the heading
   is never lit - only the row is. But icons-only there IS no row: the six are
   in a flyout that is shut. So here, and only here, the icon carries the mark;
   otherwise the menu would have no "you are here" in it at all. */
html[data-sidebar="shut"] .side-manage.holds-here .side-manage-toggle {
  background: var(--soft); color: var(--on-soft); font-weight: 600;
}
html[data-sidebar="shut"] .side-manage-items {
  display: block; transition: none;
  position: absolute; left: 100%; top: -6px; z-index: 40;
  padding-left: 10px;
  visibility: hidden; opacity: 0; pointer-events: none;
  transform: translateX(-4px);
  transition: opacity var(--blink) ease, transform var(--blink) var(--ease),
              visibility 0s linear var(--blink);
}
/* Pinned to the window by the script when it can be - see flyManage in
   public/app.js - so a menu short enough to scroll cannot clip it. */
html[data-sidebar="shut"] .side-manage-items.is-pinned {
  position: fixed; left: var(--fly-left); top: var(--fly-top);
}
html[data-sidebar="shut"] .side-manage-inner {
  visibility: inherit; transition: none; overflow: visible;
  min-width: 208px; margin-left: 0; padding: 6px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); box-shadow: 0 10px 30px var(--shadow);
}
html[data-sidebar="shut"] .side-fly-title {
  display: block; margin: 0; padding: 6px 10px 4px;
  font-size: 12px; color: var(--muted);
}
html[data-sidebar="shut"] .side-manage:not([data-fly="shut"]):hover > .side-manage-items,
html[data-sidebar="shut"] .side-manage:not([data-fly="shut"]):focus-within > .side-manage-items,
html[data-sidebar="shut"] .side-manage[data-fly="open"] > .side-manage-items {
  visibility: visible; opacity: 1; pointer-events: auto; transform: none;
  transition-delay: 0s;
}
@media (prefers-reduced-motion: reduce) {
  html[data-sidebar="shut"] .side-manage-items { transition: none; transform: none; }
}

/* THE GROUP LABEL BECOMES A LINE. Without the break, the four places and the
   four Manage pages are eight identical icons in a row with nothing saying
   which is which kind. The word goes to transparent rather than away, so the
   box it sits in keeps its height - see .side-group above. */
html[data-sidebar="shut"] .side-group { color: transparent; }
html[data-sidebar="shut"] .side-group::before { opacity: 1; }

/* NOTHING IS RE-CENTRED WHEN THE MENU NARROWS, and that is deliberate. The
   rows used to switch to justify-content: center with their padding taken
   off, which moved every icon in the column sideways at the moment the column
   was already moving - two travels at once, which is what read as pieces
   moving independently. Left-aligned at 10px inside a 12px column puts an
   icon 22px from the edge; centred inside the 40px that is left at 64px would
   have put it at 23px. One pixel, for a whole second movement. It stays
   left. */

/* ---------- THE LITTLE ROUND BUTTON ON THE EDGE ----------
   On the seam between the menu and the page, so it belongs to neither and is
   obviously about the join. It moves with the menu. */
.side-edge { position: fixed; top: 22px; left: calc(var(--side-w) - 12px); z-index: 31; margin: 0;
             transition: left var(--swing) var(--ease); }
html[data-sidebar="shut"] .side-edge { left: calc(var(--side-shut-w) - 12px); }
.side-edge-button {
  width: 24px; height: 24px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); color: var(--muted); cursor: pointer;
  box-shadow: 0 1px 3px var(--shadow);
}
.side-edge-button:hover { color: var(--ink); border-color: var(--muted); }
.side-edge-button svg { width: 14px; height: 14px; transition: transform var(--swing) var(--ease); }
html[data-sidebar="shut"] .side-edge-button svg { transform: rotate(180deg); }

/* ---------- THE DRAWER ----------
   The switch, the sheet behind it and the mini bar are all drawn only under
   the breakpoint - see the one @media at the foot of this file. Here they are
   simply off. */

/* THE SWITCH IS PINNED TO THE WINDOW, NOT TO THE TOP OF THE PAGE, and that is
   a fix rather than tidiness. It is a real checkbox moved off screen, so that
   the keyboard can still reach it and Space still works it - and pressing the
   burger, which is a <label>, hands the focus to it. A browser scrolls a
   newly focused control into view; an absolutely positioned one sits at the
   top of the DOCUMENT; so every tap on the burger threw the page back to the
   top before the drawer had even opened. position: fixed puts it in the
   window instead, where it is already in view and there is nothing to scroll
   to. Nothing about how it looks changes: it is still one clipped pixel.

   WRITTEN WITH THE ELEMENT IN FRONT OF IT, because .visually-hidden - which
   this also carries - sets position: absolute and is further down the file.
   Two single classes weigh the same, and the later one wins. */
input.drawer-switch { position: fixed; top: 0; left: 0; }

.mini-top { display: none; }
.drawer-sheet { display: none; }
.mini-rest { flex: 1 1 auto; }

/* ---------- THE ACCOUNT ROW AND ITS MENU ----------
   The row is a <summary>, so this is the same kind of menu as every other
   menu in the app: it opens by click and by keyboard, shuts on Escape and on
   a click elsewhere, and is put where there is room by public/app.js. */
.pref-menu { position: relative; }
.pref-menu > summary {
  list-style: none; cursor: pointer;
}
.pref-menu > summary::-webkit-details-marker { display: none; }
.acct-row {
  display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 8px;
  border-radius: var(--radius-control);
  color: var(--muted); font-size: 14px;
}
.acct-row { transition: background-color var(--blink) ease, color var(--blink) ease; }
.acct-row:hover { background: var(--input); color: var(--ink); }
.pref-menu[open] > .acct-row { background: var(--input); color: var(--ink); }
.acct-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
             white-space: nowrap; }
.acct-chevron { flex: 0 0 auto; width: 14px; height: 14px; }
/* The chevron points at where the menu will go, and flips when it has gone
   there. Up on Joel's side, because the row is on the floor of the window;
   down on a client's, because the row is in a bar at the top. */
.pref-menu-up .acct-chevron { transform: rotate(0deg); }
.pref-menu-up[open] .acct-chevron { transform: rotate(180deg); }
.pref-menu:not(.pref-menu-up) .acct-chevron { transform: rotate(180deg); }
.pref-menu:not(.pref-menu-up)[open] .acct-chevron { transform: rotate(0deg); }
/* THE NAME AND THE CHEVRON SHRINK AND FADE with everything else in the
   column, over the same length, rather than being switched off. Same reason
   as .side-text above: display: none is a jump in one frame while the column
   spends a quarter of a second catching up, and the account row at the foot
   of the menu was the loudest example of it - a name and a chevron are a lot
   of ink to lose in one frame. The row keeps its padding and its left
   alignment, so the face does not move at all. */
html[data-sidebar="shut"] .acct-name,
html[data-sidebar="shut"] .acct-chevron { max-width: 0; opacity: 0; }
.acct-name, .acct-chevron {
  max-width: 180px;
  transition: max-width var(--swing) var(--ease), opacity var(--swing) var(--ease),
              transform var(--beat) ease;
}

/* THE ROUND BADGE BESIDE SOMEBODY'S NAME: their picture, or one letter in the
   accent's wash when they have none. Drawn by views/partials/avatar.ejs and
   nowhere else, at three sizes.

   THE PICTURE FILLS THE CIRCLE AND IS CENTRED IN IT. object-fit: cover is the
   whole of "centred automatically" for a picture that was uploaded without the
   crop step: whatever shape it is, the middle of it is what shows. */
.avatar {
  flex: 0 0 auto;
  width: 24px; height: 24px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  background: var(--soft); color: var(--on-soft);
  font-size: 12px; font-weight: 600;
  overflow: hidden;
}
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.avatar-big { width: 32px; height: 32px; font-size: 14px; }
.avatar-huge { width: 72px; height: 72px; font-size: 28px; }

/* ---------- WHO THE ACCOUNT MENU IS, AT THE TOP OF IT ---------- */
.pref-who {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 6px 10px; border-bottom: 1px solid var(--line);
}
.pref-who-words { display: flex; flex-direction: column; min-width: 0; }
.pref-who-name { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pref-who-email { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- YOUR OWN PICTURE: ADD, REPLACE, REMOVE ----------
   See views/partials/photo-control.ejs.

   TWO SHAPES, AND WHICH ONE IS DRAWN IS DECIDED BY WHETHER THE CROP STEP CAN
   RUN. Without scripting it is the browser's own file box and an Upload
   button. public/app.js writes data-photo-ready on the control when it has
   everything the crop step needs, and only then does the file box become one
   button and Upload go away - so nothing is ever hidden that has not got
   something doing its job instead.

   THE FILE BOX IS MOVED OFF SCREEN, NOT REMOVED: it is still what the keyboard
   lands on and what Space opens, and the ring it would draw is put on the
   button that stands in for it. */
.photo-control { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 0 0 18px; }
.photo-side { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.photo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.photo-actions form { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.photo-pick { display: inline-flex; align-items: center; max-width: 100%; }
.photo-pick input { max-width: 100%; font: inherit; font-size: 13px; color: var(--muted); }
.photo-pick-face { display: none; cursor: pointer; }
[data-photo-ready] .photo-pick-face { display: inline-flex; }
[data-photo-ready] .photo-pick input {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
[data-photo-ready] .photo-send { display: none; }
.photo-pick:has(input:focus-visible) .photo-pick-face { outline: 2px solid var(--accent); outline-offset: 2px; }
html[data-input="mouse"] .photo-pick:has(input:focus-visible) .photo-pick-face { outline: none; }
.photo-control .muted-sm { margin: 0; }
/* A message that is not there takes no room. The class sets display, which
   would otherwise beat the attribute. */
.field-error[hidden] { display: none; }

/* ---------- THE CROP STEP ----------
   The app's own dialog, with the picture behind a circle - the shape it will
   be drawn in everywhere. The square is the stage the picture is dragged
   about on; the ring is one element with an enormous shadow, which is what
   darkens everything outside the circle without a second image.

   touch-action: none ON THE STAGE, so a finger dragging the picture drags the
   picture and not the page behind the dialog, and two fingers pinch it rather
   than zooming the browser. */
.crop-dialog { width: min(340px, calc(100vw - 32px)); }
.crop-stage {
  position: relative; width: 240px; max-width: 100%; aspect-ratio: 1;
  margin: 4px auto 0; overflow: hidden; border-radius: 10px;
  background: #000; cursor: grab; touch-action: none;
  -webkit-user-select: none; user-select: none;
}
.crop-stage:active { cursor: grabbing; }
.crop-stage img {
  position: absolute; left: 0; top: 0; max-width: none;
  pointer-events: none; will-change: transform;
}
.crop-ring {
  position: absolute; inset: 0; border-radius: 999px; pointer-events: none;
  border: 2px solid rgba(255, 255, 255, .85);
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .55);
}
.crop-zoom { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; font-size: 13px; color: var(--muted); }
.crop-zoom input { flex: 1 1 auto; min-width: 0; accent-color: var(--accent); }
.crop-dialog .crop-hint { margin: 0; text-align: center; }
.crop-dialog .field-error { margin-top: 8px; }

/* ---------- TABS: ALL, TEAM, CLIENTS ----------
   Links, drawn as a row of pills with the one that is on in the accent's
   wash - the same three signals the menu uses for "you are here". A count
   sits in each, a step quieter than its word. */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.tab {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: var(--control-h); padding: 0 14px; border-radius: 999px;
  background: var(--input); color: var(--muted); font-size: 14px;
  transition: background-color var(--blink) ease, color var(--blink) ease;
}
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.is-on { background: var(--soft); color: var(--on-soft); font-weight: 600; }
.tab-count { font-size: 12px; font-weight: 500; opacity: .8; }
@media (prefers-reduced-motion: reduce) { .tab { transition: none; } }

/* ---------- USERS: ONE ROW A PERSON ----------
   Picture, name over address, what they are, and what can be done - one line
   on a laptop. A list rather than a table, for the reason the old People list
   was: under 700px each row has to wrap, and a table cannot. */
.user-card { padding: 0; }
.user-list { list-style: none; margin: 0; padding: 0; }
.user-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
}
.user-row + .user-row { border-top: 1px solid var(--line); }
.user-who { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.user-name { font-weight: 600; overflow-wrap: anywhere; }
.user-name a { color: var(--ink); }
.user-name a:hover { color: var(--accent); }
.user-email { overflow-wrap: anywhere; }
.user-role { flex: 0 0 72px; font-size: 13px; color: var(--muted); }
.user-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.user-actions .more-panel { right: 0; left: auto; }
.user-tag {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  background: var(--input); color: var(--muted);
  font-size: 11px; font-weight: 500; vertical-align: 1px;
}
.user-tag.is-out { color: var(--danger); }
.user-row.is-out .avatar, .user-row.is-out .user-name a { opacity: .6; }
.user-head-who { display: flex; align-items: center; gap: 16px; min-width: 0; }
.user-head-who h1 { margin: 0; overflow-wrap: anywhere; }
.user-head-who p { margin: 2px 0 0; }
.user-client-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 0; }
.user-help { display: flex; flex-wrap: wrap; gap: 8px; }
.user-help form { margin: 0; }
.referrer-merge { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 4px; }
.referrer-merge select { width: auto; min-width: 220px; max-width: 100%; }

main { max-width: 1060px; margin: 0 auto; padding: 24px; }

/* ============================================================
   THE TYPE SCALE, AND THE HEADING THAT WAS NOT ONE
   ============================================================

   h2 USED TO BE 15px, UPPERCASE, LETTER-SPACED AND MUTED - which made it
   quieter than the text underneath it. A heading that is quieter than its own
   contents is not a heading, it is a label, and the page had no second level
   at all as a result. h3 was then 13px uppercase BOLD, which made it louder
   than the h2 above it: the two levels were the wrong way round.

   So all three are ordinary headings now, in full ink, each one a step
   smaller than the last. Nothing else about any screen has moved - the words
   are the words they were, in the order they were. */
h1 { font-size: 26px; line-height: 32px; font-weight: 600; margin: 0 0 4px; }
h2 { font-size: 17px; line-height: 24px; font-weight: 600; margin: 0 0 12px;
     color: var(--ink); letter-spacing: normal; text-transform: none; }
h3 { font-size: 15px; line-height: 22px; font-weight: 600; margin: 0 0 8px;
     color: var(--ink); letter-spacing: normal; text-transform: none; }

.page-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
}
.page-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- Cards ---------- */
/* 12px corners and 24px of room inside, which is the prototype's card. The
   line around it is unchanged - it was already right. */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.card-head { display: flex; justify-content: space-between; align-items: baseline; }
.card-head h2 { margin-bottom: 12px; }

/* ---------- Stat tiles ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
/* Counts and money are two grids so each row fills the width. Close the gap
   between them so they still read as one block of numbers. */
.stats + .stats { margin-top: -8px; }
.stat {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 24px;
  display: flex; flex-direction: column; gap: 2px; color: var(--ink);
}
a.stat:hover { border-color: var(--muted); text-decoration: none; }
/* A BIGGER NUMBER AND A QUIETER LABEL UNDER IT. The number was 22px with a
   12px uppercase label, which made the label compete with it; it is now a
   sentence-case line in the muted colour, the way every other quiet line on
   a page is written. */
.stat-value { font-size: 28px; line-height: 32px; font-weight: 600; }
.stat-label { font-size: 13px; line-height: 18px; color: var(--muted);
              text-transform: none; letter-spacing: normal; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
/* A COLUMN HEADING IS A LABEL, NOT A SHOUT. It was 11px, uppercase and
   letter-spaced, which made a row of five of them the loudest line on a page
   of records - and uppercase is also the slowest thing on a screen to read.
   13px, sentence case, in the quiet colour: the same treatment every other
   small label in the app gets. */
th {
  text-align: left; font-size: 13px; font-weight: 500;
  text-transform: none; letter-spacing: normal; color: var(--muted);
  padding: 8px 12px; border-bottom: 1px solid var(--line);
}
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
/* A WHOLE ROW THAT CAN BE PRESSED SAYS SO UNDER THE POINTER. A wash across
   every cell rather than an underline on the one word that happens to be a
   link - the row is the target, so the row is what lights up. Only where a
   table has asked for it, which is where the rows really do open something. */
tr.is-openable { cursor: pointer; }
tr.is-openable:hover > td { background: var(--input); }
tr:last-child td { border-bottom: none; }
.col-date { white-space: nowrap; }
.col-money { text-align: right; white-space: nowrap; }
th.col-money { text-align: right; }

.muted { color: var(--muted); }
.muted-sm { display: block; font-size: 12px; color: var(--muted); }
.empty { color: var(--muted); margin: 6px 0; }

/* ---------- Status badges ---------- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; line-height: 18px; font-weight: 500;
  border: 1px solid transparent; white-space: nowrap;
}
.badge-inquiry   { background: var(--inquiry-bg);   color: var(--inquiry-ink); }
.badge-booked    { background: var(--booked-bg);    color: var(--booked-ink); }
.badge-completed { background: var(--completed-bg); color: var(--completed-ink); }
.badge-cancelled { background: var(--cancelled-bg); color: var(--cancelled-ink); }

.status-switcher { display: flex; gap: 8px; flex-wrap: wrap; }
/* NO HIGHLIGHT BEHIND THE BADGES AFTER A CHANGE, and its absence is the fix.
   [data-settled] below brightens a ROW and settles back, which is right for a
   line in a list and wrong for this: the switcher is a full-width strip four
   badges tall at most, so what it drew was a flat blue line across the page.
   It looked like something broken rather than something confirmed.

   WHAT SAID IT WORKED IS STILL THERE, and it is the half that was doing the
   work: the badge that has just become the current one gets the border and
   the check mark, and .settles fades that label in rather than snapping it.
   The confirmation is the badge, which is what he was looking at. */
.status-switcher[data-settled] { animation: none; }
.status-switcher form { display: inline; }
.status-switcher button { cursor: pointer; font-family: inherit; }
/* Faded, but not so faded that the label stops being readable - the
   opacity here is checked by test/contrast.test.js. */
.status-switcher .is-choice { opacity: .94; }
.status-switcher .is-choice:hover { opacity: 1; }
.status-switcher .is-current { border-color: currentColor; }

/* ---------- THE BADGE IN A LIST ROW, WHICH IS ALSO THE CONTROL ----------

   IT LOOKS EXACTLY LIKE THE BADGE IT REPLACED until somebody shows an interest
   in it. No border, no background, no caret sitting in a column of a hundred
   and fifty rows: a list is for reading first, and a control drawn in every
   row is a page of buttons rather than a table of gigs.

   The caret appears on hover and whenever the menu is open, which is the
   moment it means something. Keyboard focus gets the app's ordinary ring
   through :focus-visible near the top of this file. */
.status-pick { display: inline-block; position: relative; }
.status-pick > summary {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
}
.status-pick > summary::-webkit-details-marker { display: none; }
.status-caret {
  width: 9px; height: 7px; flex: 0 0 auto;
  color: var(--muted); opacity: 0;
  transition: opacity var(--blink) ease-out;
}
.status-pick > summary:hover .status-caret,
.status-pick > summary:focus-visible .status-caret,
.status-pick[open] .status-caret { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .status-caret { transition: none; }
}

/* Every status, one under the other, in the same badges the gig page uses -
   so the two places this is offered read as one control in two rooms. */
.status-panel {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 25;
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px var(--shadow);
}
.status-panel form { display: block; }
.status-panel button {
  display: block; width: 100%; cursor: pointer;
  font-family: inherit; text-align: center; white-space: nowrap;
}
.status-panel .is-choice { opacity: .94; }
.status-panel .is-choice:hover { opacity: 1; }
.status-panel .is-current { border-color: currentColor; }

/* A ROW THAT NO LONGER MATCHES THE FILTERS AND IS BEING HELD ON SCREEN ANYWAY,
   because it is the one just changed and it must not vanish under his hand.
   Marked down the left edge, so it reads as "still here for a reason" rather
   than as a filter that has stopped working. */
tr.is-held > td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.col-status { white-space: nowrap; }

/* ---------- Filters ---------- */
/* A STRIP OF TABS. The one you are on is a wash of the accent with the
   accent's own ink on it - the same "you are here" the left menu uses - rather
   than being filled with the page's own ink, which made it the blackest or
   whitest thing on the screen for no reason. */
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.filters a {
  height: 32px; display: inline-flex; align-items: center;
  padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 500;
  background: none; border: 1px solid var(--line); color: var(--muted);
}
.filters a.active {
  background: var(--soft); border-color: transparent; color: var(--on-soft);
  font-weight: 600;
}
.filters a:hover { text-decoration: none; color: var(--ink); border-color: var(--muted); }
.filters a.active:hover { color: var(--on-soft); border-color: transparent; }

/* ---------- THE ANSWER UNDER THE FILTERS CHANGES, IT DOES NOT BLINK ----------

   Asked for something: what is on screen eases back a little, at once, on
   --blink. The answer lands at that same faintness and eases up to full on
   --swing. There is never a frame with nothing in it, which is the difference
   between a change and a flash. The marks are written by showNarrowed in
   public/app.js; with scripting off none of this exists and the page loads. */
[data-filter-results][data-results="leaving"] {
  opacity: .45;
  transition: opacity var(--blink) ease;
}
[data-filter-results][data-results="arriving"] {
  animation: results-arrive var(--swing) var(--ease);
}
@keyframes results-arrive { from { opacity: .45; } }
@media (prefers-reduced-motion: reduce) {
  [data-filter-results][data-results="leaving"] { opacity: 1; transition: none; }
  [data-filter-results][data-results="arriving"] { animation: none; }
}

/* ---------- Narrowing the gig list ----------

   ONE LINE, AND IT STAYS ONE LINE. A button, then whatever is actually on as
   small removable tags, then the way out. It sits in the page's own flow above
   a table Joel reads constantly, so it has no card, no background and no
   border around it: what draws the eye is a tag, because a tag is a fact about
   what he is looking at.

   nowrap on the row and the scrolling on the tags are the same decision. There
   are ten filters today and there will be more; a row that wrapped would put a
   second line above the table again, which is the thing this replaced. */
.gig-filters {
  display: flex; flex-wrap: nowrap; align-items: center;
  gap: 8px; margin: 0 0 10px;
}

/* THE BUTTON THAT HOLDS ALL OF THEM. Drawn like the controls it replaced -
   same height, same border, same quiet ink - so nothing about the row looks
   like a new kind of thing. */
.filter-menu { position: relative; flex: 0 0 auto; }
.filter-menu > summary {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: var(--control-h); padding: 0 10px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--input); color: var(--muted);
  /* 16px, not the page's 15px: anything smaller and iOS zooms the whole page
     when the control is tapped. The same reason the planning form's boxes
     are 16px - see the note there. */
  font-size: 16px; line-height: 1.5;
  max-width: 100%;
}
.filter-menu > summary::-webkit-details-marker { display: none; }
.filter-menu > summary:hover { border-color: var(--accent); }
.filter-face { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-caret { flex: 0 0 auto; width: 11px; height: 8px; opacity: .8; }
.filter-sliders { flex: 0 0 auto; width: 15px; height: 15px; }
/* SOMETHING IS ON. The accent border and full-strength ink, the same as every
   other "this is set" in the app - and the tags beside it say what. */
.filter-menu.is-on > summary {
  border-color: var(--accent); color: var(--ink); font-weight: 600;
}
.filter-menu[open] > summary { border-color: var(--accent); color: var(--ink); }

/* THE PANEL FLOATS, like every other menu in this app, so opening it moves
   nothing on the page underneath. public/app.js puts it wherever there is room
   - see A MENU OPENS WHERE THERE IS ROOM FOR IT in that file - so the height
   below is what it would LIKE rather than a promise about the window. */
.filters-panel {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 25;
  width: max-content; min-width: 280px; max-width: min(360px, 92vw);
  max-height: min(70vh, 520px); overflow-y: auto; overscroll-behavior: contain;
  padding: 6px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px var(--shadow);
}

/* ONE FILTER, AS A ROW IN THAT PANEL. Its name on the left, what it is set to
   on the right, and the options underneath when it is opened. name="gig-filter"
   in the markup is what keeps it to one at a time - the browser's own
   accordion, no JavaScript in it. */
.filter-group + .filter-group { border-top: 1px solid var(--line); }
.filter-group > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 8px; border-radius: 7px;
  font-size: 14px; color: var(--ink);
}
.filter-group > summary::-webkit-details-marker { display: none; }
.filter-group > summary:hover { background: var(--input); }
.filter-group-name { flex: 0 0 auto; }
.filter-group > summary .filter-face {
  flex: 1 1 auto; min-width: 0; text-align: right;
  font-size: 13px; color: var(--muted);
}
/* A filter that is set says so on its own row, so a shut panel of ten rows
   still answers "which of these have I touched" at a glance. */
.filter-group.is-on > summary { font-weight: 600; }
.filter-group.is-on > summary .filter-face { color: var(--accent); font-weight: 600; }
.filter-group[open] > summary .filter-caret { transform: rotate(180deg); }
.filter-group .filter-caret { transition: transform var(--beat) ease; }
@media (prefers-reduced-motion: reduce) {
  .filter-group .filter-caret { transition: none; }
}

.filter-group fieldset { border: none; margin: 0; padding: 0 0 6px; min-width: 0; }
.filter-option { display: block; cursor: pointer; }
/* The box itself is off screen rather than removed, so the keyboard still
   reaches it and the form still posts with JavaScript switched off. What is
   drawn is the label wrapped round it - the same arrangement the preferences
   menu uses. */
.filter-option input {
  position: absolute; width: 1px; height: 1px; margin: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.filter-option-face {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 6px 18px; border-radius: 7px;
  font-size: 14px; color: var(--ink);
}
.filter-option-label { flex: 1 1 auto; min-width: 0; }
/* HOW MANY THIS ONE WOULD GIVE BACK. Right-aligned in a column of its own so
   the numbers read down the panel rather than trailing after words of
   different lengths. */
.filter-count {
  flex: 0 0 auto; min-width: 2ch; text-align: right;
  font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted);
}
.filter-option:hover .filter-option-face { background: var(--input); }
/* The same wash a chip and a lit menu row get, rather than a solid fill: a
   panel of ten filters with four of them ticked was ten rows of which four
   were the loudest thing on the screen. */
.filter-option input:checked + .filter-option-face {
  background: var(--soft); color: var(--on-soft); font-weight: 600;
}
.filter-option input:checked + .filter-option-face .filter-count {
  color: var(--on-soft); opacity: .85;
}
/* A DEAD END, SHOWN RATHER THAN HIDDEN. An option that would give nothing
   back is a fact about the data, so it stays on the list and stays pressable -
   it simply reads as quieter, which is what "there is nothing down here" looks
   like. Nothing appears or disappears as the ticks change. */
.filter-option.is-empty .filter-option-face { color: var(--muted); }
.filter-option input:focus-visible + .filter-option-face {
  outline: 2px solid var(--accent); outline-offset: -2px;
}
html[data-input="mouse"] .filter-option input:focus-visible + .filter-option-face {
  outline: none;
}

/* THE DATE RANGE'S OWN FOLD. Two boxes and a two-way choice rather than a list
   of tick boxes, because a date has no count to put beside it. */
.filter-range { display: flex; flex-direction: column; gap: 8px; padding: 2px 8px 6px; }
.filter-range label { display: flex; flex-direction: column; gap: 3px; }
.filter-range-label { font-size: 12px; color: var(--muted); }
.filter-range input {
  width: 100%; min-height: var(--control-h); padding: 0 8px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--input); color: var(--ink);
  /* 16px for the same reason every other box in the app is: anything smaller
     and iOS zooms the page when it is tapped. */
  font: inherit; font-size: 16px;
}
.filter-range-clear {
  display: block; padding: 4px 8px 8px;
  font-size: 13px; color: var(--muted);
}
.filter-range-clear:hover { color: var(--accent); }

/* THE CALENDAR OPENS INSIDE THE PANEL, NOT OVER IT - the one place in the app
   where it does. A panel that can scroll clips anything hanging out of it, and
   a calendar floating over its own menu would be a menu on a menu; in the flow
   it simply makes this fold taller and the panel scrolls down to it, which is
   why the date range is the last fold in the list. */
.filters-panel .datebox { flex-wrap: wrap; }
.filters-panel .datebox-panel {
  position: static; flex: 1 0 100%; width: auto;
  margin: 6px 0 0; box-shadow: none; background: var(--input);
}

/* Apply is the no-JavaScript path. public/app.js submits on change and marks
   the form, which takes the button away - see the note in that file. */
/* ---------- SAVED FILTER SETS ----------

   AT THE TOP OF THE FILTERS PANEL, under the one word "Saved". A row is the
   set's name - which is a link, and the whole of how it is applied - and
   three dots beside it. The dots open three things UNDER the row rather than
   in a menu floating off it: this panel scrolls, and a menu hung off a row in
   a box that scrolls is cut off by the box. See views/partials/filters.ejs.

   THE ONE THAT IS ON NOW is the soft wash of the accent with its own ink,
   the same pair that marks where you are in the left menu - and says "on
   now" in words, because colour alone is not enough. */
.saved-sets { padding: 2px 0 6px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.saved-sets-label { margin: 0; padding: 6px 8px 4px; font-size: 12px; color: var(--muted); }
/* A ROW IS A BLOCK, AND THE DOTS ARE PINNED TO ITS RIGHT-HAND END. The name
   keeps clear of them with a margin. That is all the layout there is, and it
   is this plain on purpose: the dots are a <details>, and what a <details>
   does with flex and grid children differs between browsers. Pinned, the
   summary is out of the flow, so the details has no height while it is shut;
   open, the three things in it simply follow the name on the lines below. */
.saved-set { position: relative; }
.saved-apply {
  display: flex; align-items: center; gap: 8px;
  min-height: 36px; margin-right: 40px; padding: 0 8px;
  border-radius: var(--radius-control);
  color: var(--ink); text-decoration: none;
}
.saved-apply:hover { background: var(--input); text-decoration: none; }
.saved-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-set.is-applied > .saved-apply { background: var(--soft); color: var(--on-soft); font-weight: 600; }
.saved-on { flex: 0 0 auto; margin-left: auto; font-size: 12px; font-weight: 400; }
/* The dots. A <summary>, drawn as the small square button it behaves as. */
.saved-more > summary {
  position: absolute; right: 0; top: 0;
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-control);
  color: var(--muted);
}
.saved-more > summary::-webkit-details-marker { display: none; }
.saved-more > summary:hover, .saved-more[open] > summary { background: var(--input); color: var(--ink); }
.saved-more > summary svg { width: 18px; height: 18px; }
/* What the dots open: a block under the row, set in a little so it reads as
   belonging to the row above it and not as the next row. */
.saved-options {
  display: flex; flex-direction: column; gap: 2px;
  margin: 2px 0 6px 8px; padding-left: 8px;
  border-left: 2px solid var(--line);
}
.saved-options .more-item:disabled { color: var(--muted); cursor: default; background: none; }
.saved-rename > summary { list-style: none; }
.saved-rename > summary::-webkit-details-marker { display: none; }
.saved-rename-box { display: flex; gap: 6px; padding: 4px 10px 8px; }
/* THE TWO BOXES A NAME IS TYPED INTO - renaming a set here, and naming a new
   one in the Save panel below. Drawn as the date boxes in this same panel
   are, and 16px for the reason every box in the app is: anything smaller and
   iOS zooms the page when it is tapped. */
.saved-rename-box input, .filter-save-row input {
  flex: 1 1 auto; min-width: 0;
  min-height: var(--control-h); padding: 0 8px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--input); color: var(--ink);
  font: inherit; font-size: 16px;
}

/* SAVE, AT THE END OF THE STRIP. Words only, like Clear beside it: it is a
   thing to do occasionally, not a state the row is in, so it does not get the
   bordered box the Filters button has. Its panel opens under it like the
   others and hangs from its RIGHT edge, because that is the end of the row
   it sits at. */
.filter-menu.filter-save > summary {
  min-height: 0; padding: 5px 4px;
  border: 0; background: none;
  font-size: 13px; color: var(--muted);
}
.filter-menu.filter-save > summary:hover,
.filter-menu.filter-save[open] > summary { color: var(--accent); }
.filter-save-panel { left: auto; right: 0; min-width: 300px; padding: 12px; }
.filter-save-label { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 600; }
.filter-save-row { display: flex; gap: 8px; }
.filter-save-says { margin: 8px 0 0; }

.gig-filters[data-auto-submit] .filter-apply { display: none; }
.filter-apply { flex: 0 0 auto; }
.filter-clear {
  flex: 0 0 auto;
  font-size: 13px; color: var(--muted);
  padding: 5px 4px;
}
.filter-clear:hover { color: var(--accent); }

/* WHAT IS ON, ONE TAG EACH. The strip takes whatever room is left and scrolls
   inside itself, so ten tags cannot push the button or the Clear link off the
   row and cannot start a second one. */
.filter-tags {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-wrap: nowrap; align-items: center; gap: 6px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scrollbar-width: thin;
  /* Room for the scrollbar when there is one, so it is never sitting on top
     of the tags themselves. */
  padding-bottom: 2px;
}
/* Filled rather than outlined: what is narrowing the list should be the
   easiest thing in the row to see. */
/* A CHIP: a soft wash of the accent with the accent's own ink on it, which is
   the app's one "a little bit of accent" shape - the lit menu row, the current
   tab and the row that just changed are all drawn out of the same pair. It
   was a solid fill, which made a row of four of them the loudest thing on the
   gig list. */
.filter-chip {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 100%;
  min-height: 28px; padding: 0 10px;
  border: 0; border-radius: 999px;
  background: var(--soft); color: var(--on-soft);
  font-size: 13px; font-weight: 500; white-space: nowrap;
}
.filter-chip:hover { text-decoration: none; filter: brightness(1.08); }

/* How many of how many, in the page's own voice. Small and quiet, because it
   is read in passing rather than looked up. */
.filter-summary {
  margin: 0 0 16px;
  font-size: 13px; color: var(--muted);
}
.filter-summary strong { color: var(--ink); }

/* THE PERIODS ANYBODY ASKS FOR, as links at the top of the date fold. Links
   rather than a sixth kind of control, so they can be bookmarked and
   middle-clicked; drawn as a wrapping row of small pills, because they are a
   short closed list and reading down a column of them would be slower. */
.filter-presets {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px 8px 4px;
}
.filter-preset {
  display: inline-flex; align-items: center;
  min-height: 30px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 999px;
  background: none; color: var(--muted);
  font-size: 13px; white-space: nowrap;
}
.filter-preset:hover { border-color: var(--muted); color: var(--ink); text-decoration: none; }
/* Whichever one is on gets the accent's wash, the same as every other "you
   are here" in the app. */
.filter-preset.is-on {
  border-color: transparent; background: var(--soft);
  color: var(--on-soft); font-weight: 600;
}
/* The date control standing on its own beside the Filters button, on a page
   whose whole content is a period. Its panel is a little wider, because the
   presets inside it are words rather than tick boxes. */
.filter-calendar { flex: 0 0 auto; width: 15px; height: 15px; }
.filters-panel-dates { min-width: 300px; max-width: min(400px, 92vw); }
.filters-panel-dates fieldset { border: none; margin: 0; padding: 0 0 6px; min-width: 0; }
.filters-panel-dates > .filter-range { padding-top: 6px; }
.filters-panel-dates legend.filter-range-label { padding: 6px 8px 2px; }


/* ============================================================
   FOUR BUTTONS, NOT SIX
   ============================================================

   There were six styles and three more pressable shapes besides, which meant
   nothing on a page said how important it was - everything was drawn at
   roughly the same volume and the eye had nowhere to land. There are four
   now, and the difference between them is how loud they are:

     PRIMARY    filled with the accent. The one thing this screen is for.
                One per screen, ideally; never two side by side.
     SECONDARY  a raised fill and NO border. "Also a thing you can do."
                This is what a bare `.btn` is, which is why most of the app
                did not have to change a single class.
     GHOST      words only, in the muted colour. Cancel, Back, Clear - the
                way out of something rather than a step in it.
     DANGER     an outline in the alarm colour that FILLS when you are on it,
                so a destructive button announces itself twice: once at rest
                and again under your hand.

   The borders went because a border is the loudest thing a small control has,
   and three shapes with a border each is three shapes shouting. A filled
   secondary is quieter and still unmistakably a button.

   36px and 6px corners, matching every other control. Under the single
   breakpoint they all grow to 44px, which is a thumb. */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  min-height: var(--control-h); padding: 0 14px;
  border-radius: var(--radius-control);
  border: 0; background: var(--input); color: var(--ink);
  font-size: 14px; font-weight: 500; font-family: inherit;
  cursor: pointer; text-decoration: none;
}
/* IT LIGHTS RATHER THAN SNAPPING. One blink, which is short enough that it
   reads as the button responding rather than as something being animated. */
.btn { transition: filter var(--blink) ease, background-color var(--blink) ease,
                   border-color var(--blink) ease, color var(--blink) ease; }
.btn:hover { filter: brightness(1.1); text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
/* WORDS ONLY. No fill, no border, nothing to press until you are on it - so
   it reads as the quiet way out of whatever is in front of you. */
.btn-ghost { background: none; color: var(--muted); }
.btn-ghost:hover { background: none; color: var(--ink); filter: none; }
/* ============================================================
   THE ONE BUTTON A CLIENT CAME HERE TO PRESS - AND IT IS THE
   PRIMARY ONE, LIKE EVERY OTHER PRIMARY BUTTON HERE.

   IT USED TO BE BLUE. The argument was that Soundcheck exists
   so a couple can tell Joel what they want played, that
   everything else on their page is context for that one action,
   and that the app's accent was Joel's indigo and meant nothing
   to a client. So there was a fifth button style, used once, in
   a colour that appeared nowhere else.

   BOTH HALVES OF THAT ARGUMENT WENT. The accent is six colours
   somebody picks now, so "Joel's indigo" is not a fixed fact
   about the app - and a client's side is purple whatever is in
   anybody's cookie, on purpose, so the accent on her page IS a
   colour that appears once as the thing to press. Four button
   styles was a settled decision of the redesign and a fifth one
   for one button was the last thing standing against it.

   WHAT IT KEEPS is the only part that was about SIZE rather
   than colour: it is bigger than an ordinary button and goes
   full width on a phone, because it is the one thing on the
   page. That is .btn-lead, and it is a size rather than a fifth
   style - it carries no colour of its own at all.
   ============================================================ */
.btn-lead {
  font-size: 16px; font-weight: 600;
  padding: 11px 20px;
  box-shadow: 0 2px 10px var(--shadow);
}

/* THE ONLY BUTTON IN THE APP THAT KEEPS ITS BORDER, and that is the point of
   it: an outline in the alarm colour at rest, filled in the alarm colour the
   moment the pointer is on it. --panel rather than --input behind it so the
   outline is the only thing drawn until it fills. */
.btn-danger {
  color: var(--danger); border: 1px solid var(--danger-line);
  background: var(--panel);
}
.btn-danger:hover {
  background: var(--danger); border-color: var(--danger);
  color: var(--panel); filter: none;
}
/* "Remove", on the people list. It was a fourth danger shape; it is the ghost
   button in the alarm colour now, which is what it was trying to be. */
.btn-quiet-danger { background: none; color: var(--danger); }
.btn-quiet-danger:hover, .btn-quiet-danger:focus-visible {
  background: none; color: var(--danger); filter: none;
  text-decoration: underline;
}
.page-actions form { display: inline; }

/* THE CLIENTS PAGE'S SORT. Nothing new to look at: the label is the form
   labels' small bold word, and the box is a form's box - the same padding,
   line, corners, fill and SIXTEEN PIXELS, for the reason given on .form
   input below - sized to what is in it rather than to the row. */
/* The row it shares with "+ Add client" wraps rather than squeezing the
   button onto two lines on a phone. */
.list-sort-actions { flex-wrap: wrap; }
.list-sort-actions .btn { white-space: nowrap; }
.list-sort { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.list-sort label { display: inline-flex; gap: 8px; align-items: center; }
.list-sort-label { font-size: 13px; font-weight: 600; }
.list-sort select {
  padding: 9px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-control);
  font: 16px/22px inherit; font-family: inherit;
  background: var(--input); color: var(--ink);
  min-height: 40px; width: auto; max-width: 100%;
}

/* ============================================================
   THE ••• MENU
   ============================================================

   What a record's page does rarely: look at it as the client, delete it. Both
   used to be buttons in the row at the top, which made the page offer four
   equally weighted things to press - and the loudest of the four was Delete,
   because it is the one drawn in the alarm colour.

   A <details> with a floating panel, which is the one menu shape in this app:
   it opens by click and by keyboard, closes on Escape and on a click
   elsewhere, and is placed where there is room by public/app.js - none of
   which is written here, because all of it is written once. With scripting
   switched off it is a fold with working links and forms in it. */
.more-menu { position: relative; display: inline-block; }
.more-menu > summary { list-style: none; }
.more-menu > summary::-webkit-details-marker { display: none; }
.more-button { padding: 0 10px; min-width: 40px; }
.more-button svg { width: 18px; height: 18px; }
.more-menu[open] > .more-button { filter: brightness(1.1); }
.more-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20;
  min-width: 220px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 8px 24px var(--shadow);
  display: flex; flex-direction: column; gap: 2px;
}
.more-panel form { display: block; margin: 0; }
/* The same row the account menu's Settings and Sign out are, because they are
   the same kind of thing: you press it and you are somewhere else. */
.more-item {
  display: flex; align-items: center;
  min-height: 34px; padding: 0 10px; width: 100%;
  border: 0; border-radius: var(--radius-control); background: none;
  color: var(--ink); font: inherit; font-size: 14px; text-align: left;
  white-space: nowrap; cursor: pointer;
  transition: background-color var(--blink) ease, color var(--blink) ease;
}
.more-item:hover { background: var(--input); text-decoration: none; }
.more-item-danger { color: var(--danger); }
.more-item-danger:hover { background: var(--error-bg); color: var(--error-ink); }

.link-danger {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--danger); font-size: 12px; font-family: inherit;
}
/* Its twin in the ordinary colour - Edit beside Delete on a note. The same
   size and the same weight, so the two read as one pair of actions rather
   than as a link and a button that happen to be next to each other.

   --on-soft RATHER THAN --accent, which is the app's existing name for "the
   accent, dark enough to write on a tinted surface". This is the only place
   that uses this class, and the only place it appears is at the foot of a
   note - which is an --input box now rather than the white card it used to be
   drawn on. Two of the six accents fell to 4.44:1 against that, measured, and
   this is the colour the app already keeps for exactly that problem. In dark
   mode the two names are the same colour, so nothing there changes at all. */
.link-quiet {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--on-soft); font-size: 12px; font-family: inherit;
}

/* ============================================================
   A THING YOU PRESS IS NOT A THING YOU READ
   ============================================================

   THE COMPLAINT: open a menu and shut it again quickly, and a word on the
   screen goes blue. The browser counts two quick presses as a double-click,
   and a double-click on words selects the word under it - whether those words
   are a paragraph or the name of a menu. It happened on the filters, on a
   status badge, on Manage, anywhere somebody pressed twice in a hurry.

   SO THE WORDS ON A CONTROL CANNOT BE SELECTED, EVERYWHERE, BY WHAT THEY ARE
   rather than by a list of the ones that were noticed: every button, every
   heading of a menu or a fold, every dropdown, every tick-box and radio row
   with its words, and anything built to act as one. A control added next year
   is one of those things and is covered without anybody remembering this.

   Text boxes are not on the list and must never be: they are the one place a
   double-click selecting a word is exactly what is wanted. And nothing here
   is put on a label that holds a text box, because Safari on a phone will not
   let somebody type into a box inside something marked unselectable. */
button,
summary,
select,
.btn,
[role="button"],
[role="menuitem"],
[role="option"],
[role="tab"],
.check-row,
.filter-option,
.plan-option,
.filter-chip,
.badge {
  -webkit-user-select: none;
  user-select: none;
}

/* ---------- Forms ---------- */
.form { max-width: 640px; display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 5px; }
.form label > span { font-size: 13px; font-weight: 600; }
.form label em { font-weight: 400; color: var(--muted); font-style: normal; }
/* ============================================================
   A BOX YOU TYPE IN
   ============================================================
   6px corners like every other control, a raised fill that lifts to the panel
   colour when the keyboard is in it, and - the one number here that is not a
   matter of taste - SIXTEEN PIXELS. Anything smaller and Safari on an iPhone
   zooms the whole page in the moment a field is tapped, and the person is
   then looking at a form twice the width of their screen. It was `inherit`
   (15px) before, which is exactly the bug. */
.form input, .form select, .form textarea {
  padding: 9px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-control);
  font: 16px/22px inherit; font-family: inherit;
  background: var(--input); color: var(--ink); width: 100%;
}
.form input, .form select { min-height: 40px; }
/* A DATE AND A TIME ARE SIZED TO WHAT GOES IN THEM, EVERYWHERE THEY APPEAR.
   The rule above hands every field width: 100%, which is right for a name and
   absurd for "9:30 PM". A cap rather than a fixed width, so the box still
   shrinks on a narrow phone instead of pushing the form sideways, and so the
   label above it goes on being as wide as the form.

   FOUR SHAPES, ONE SIZE EACH. The browser's own date control on the gig form;
   the plain typable box the planning form uses; and the two wrappers app.js
   builds around them when it hangs a calendar or a time list off the side.
   The wrapper is what gets capped in that case - the input inside it is
   flex: 1 1 auto and fills whatever it is given. */
.form input[type="date"],
.form input[data-date-input],
.form .datebox,
.plan-question input[data-date-input],
.plan-question .datebox,
.inline-date input,
/* The wrapper app.js builds around the inquiry date on the gig page. Without
   it the cap lands on the input, which .datebox > input below then removes -
   and the box grows to whatever the browser feels like, which on a phone was
   wider than the page. */
.inline-date .datebox,
.deposit-state input[type="date"],
/* ...and the one app.js now builds around the deposit's date, for the same
   reason: the cap belongs to the wrapper the moment there is one. */
.deposit-state .datebox { max-width: var(--field-date); }

.form input[type="time"],
.form input[data-time-input],
.form .timebox,
.plan-question input[data-time-input],
.plan-question .timebox { max-width: var(--field-time); }

/* And inside the pair of wrappers, the input is the whole width of it again -
   the cap belongs to the wrapper, or the panel hanging off it would be capped
   with it. */
.datebox > input, .timebox > input { max-width: none; }

/* THE BOXES LINE UP EVEN WHEN ONE OF THEM HAS SOMETHING WRONG WITH IT.
   A message above one field makes that field's label two lines where its
   neighbour's is one, so the boxes in a row ended up at two different heights
   - which reads as a drawing error rather than as an error message. The label
   grows upwards instead: each one is pushed to the floor of its own cell, so
   whichever of three has a complaint, the three boxes are on one line. */
.form-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px; align-items: end;
}
.form-actions { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.field-hint { margin: -6px 0 0; }
.field-hint code {
  background: var(--code-bg); padding: 1px 5px; border-radius: 4px; font-size: 11px;
}

/* A heading INSIDE a form, marking off a group of related fields. Sized to
   sit under the field labels around it rather than shout over them. */
.form-heading {
  margin: 10px 0 -4px; font-size: 13px; font-weight: 700;
  padding-bottom: 6px; border-bottom: 1px solid var(--line);
}

/* A tick and its words, side by side - every other label in a form stacks
   its words above its box, which for a checkbox puts them in the wrong
   order and leaves the tick stretched across the whole width. */
/* Higher specificity than ".form label" above, which would otherwise keep
   flex-direction: column and stack the tick on top of its own label. */
.form .check-row { flex-direction: row; align-items: center; gap: 8px; }
.check-row > span { font-weight: 600; }

/* THE BUG THIS FIXES, because it was the worst-looking thing in the app.

   The shared rule above gives every input in a form width: 100%. For a text
   box that is right. For a RADIO it stretched the control across the whole
   fieldset, which draws the dot in the MIDDLE and leaves the words stranded
   against the far edge - so on "Which events" no label appeared to belong to
   any button. Checkboxes were already excused; radios were not, and there
   was no reason for the difference.

   Written on the element rather than inside .check-row so that a radio added
   anywhere in any form tomorrow is right without anybody remembering this. */
.form input[type="checkbox"],
.form input[type="radio"] { width: auto; margin: 0; flex: 0 0 auto; }

/* The referral pair: a tick, and a name that only matters once it is on.
   Hiding the name box is done in CSS alone so it is right from the first
   paint and needs no JavaScript. A browser without :has() shows the box all
   the time, which is untidy and still works - and the server drops any name
   that arrives with the tick off either way. */
.referral { display: flex; flex-direction: column; gap: 10px; }
.referral:has(input[type="checkbox"]:not(:checked)) .referral-name,
.referral:has(input[type="checkbox"]:not(:checked)) .muted-sm { display: none; }

/* ============================================================
   THE PICKER: "ONE I HAVE USED BEFORE, OR A NEW ONE"

   Client, venue and referrer, all three. See
   views/partials/picker.ejs for what it is made of and
   public/app.js for what it becomes.

   WITH NO JAVASCRIPT this is two ordinary fields stacked - a
   dropdown and a text box - and everything below styles the
   thing app.js builds in their place. .is-live is what says
   that happened, so nothing here can leave the plain version
   looking half-built.
   ============================================================ */

.picker { display: flex; flex-direction: column; gap: 5px; }
.picker .picker-existing, .picker .picker-new { gap: 5px; }
.picker-hint { margin: 2px 0 0; }
.picker-heading { font-size: 13px; font-weight: 600; }

.picker-box { position: relative; }

/* IT HAS TO LOOK LIKE SOMETHING YOU CAN TYPE IN, which is exactly what the old
   referrer field got wrong: it accepted typing and looked like a dropdown, so
   nobody ever typed. A text cursor, a text box's border, and no chevron
   pretending the only way in is a click at one end. */
.picker-input {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px;
  font: inherit; background: var(--input); color: var(--ink);
  cursor: text;
}

/* The list. Sized so a long list scrolls rather than running off the page,
   and over everything below it rather than pushing the form about. */
.picker-panel {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 40;
  margin: 0; padding: 4px; list-style: none;
  max-height: 264px; overflow-y: auto; overscroll-behavior: contain;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 10px 30px var(--shadow);
}
.picker-panel[hidden] { display: none; }

.picker-row {
  padding: 7px 10px; border-radius: 6px; cursor: pointer;
  overflow-wrap: anywhere;
}
.picker-row:hover { background: var(--focus-field); }
/* The row the keyboard is on. The accent block, the same as the time list, so
   "where am I" reads the same in both. */
.picker-row.is-on { background: var(--accent); color: var(--accent-ink); }

/* "None of them" is a way back to blank rather than a thing on the list, and
   the last row is a thing to make rather than a thing to pick. Both are said
   quietly, so the real choices are what the eye lands on. */
.picker-row.is-none { color: var(--muted); }
.picker-row.is-none.is-on { color: var(--accent-ink); }
.picker-row.is-new {
  border-top: 1px solid var(--line); border-radius: 0 0 6px 6px;
  margin-top: 4px; padding-top: 10px; font-weight: 600;
}
.picker-empty { padding: 8px 10px; color: var(--muted); }

/* ---------- Venues ---------- */

/* "Where were the old gigs?" - two answers, side by side, neither of them a
   default. Each button carries its own sentence underneath saying what IT
   will do, because that is the thing to read. See views/venues/moved.ejs. */
.moved-choices {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px; margin: 18px 0;
}
.moved-choices form {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 14px; border: 1px solid var(--line); border-radius: var(--radius);
}
.moved-choices p { margin: 0; }

/* DELETE, AND DON'T. Side by side, and wrapping onto two lines on a phone
   rather than squeezing - the one thing that must never happen here is the
   two of them ending up close enough together to hit the wrong one. Both are
   ordinary buttons: the words say which is which, and the alarm colour on the
   first is the second signal rather than the only one. */
.delete-choices {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  margin: 18px 0 6px;
}
.delete-choices form { margin: 0; }

/* A short list of records with no table around it. */
.plain-list { margin: 12px 0; padding-left: 20px; }
.plain-list li { margin-bottom: 4px; }
.plain-list .muted-sm { margin-left: 6px; }

/* ---------- Fixing a referrer's name, on the reporting page ---------- */
/* Folded away by default: it is a thing Joel does twice a year, and the table
   above it is what the page is for. See the note in views/reports.ejs. */
.referrer-fix { margin-top: 18px; }
.referrer-fix summary {
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted);
}
.referrer-fix summary:hover { color: var(--ink); }
.referrer-fix[open] summary { margin-bottom: 8px; }
.referrer-fix-forms {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px; margin-top: 12px;
}
.referrer-fix-forms form {
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
  padding: 14px; border: 1px solid var(--line); border-radius: var(--radius);
}
.referrer-fix-forms h3 { margin: 0; font-size: 14px; }
.referrer-fix-forms label { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.referrer-fix-forms label > span { font-size: 13px; font-weight: 600; }
.referrer-fix-forms select, .referrer-fix-forms input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; background: var(--input); color: var(--ink);
}

/* ---------- THE ACCOUNT MENU'S PANEL ----------

   THE PANEL IS THE ONE THING THAT FLOATS, AND IT HOLDS EVERYTHING.
   It used to be the <form>, with the way to Settings sitting outside it as a
   second child of the <details> - which meant that opening the menu put that
   link into the frame, in the ordinary flow, and the frame grew and pushed the
   page about. Everything that appears on opening is inside this box now, and
   this box is out of the layout, so nothing behind it moves by a pixel.
   See the note in views/partials/preferences-menu.ejs.

   IT IS AS WIDE AS THE ROW IT COMES OUT OF, in the column down the left -
   left: 0 and right: 0 rather than a width - so it reads as the row opening
   rather than as a panel that happened to land near it. In the client's top
   bar it hangs off the right-hand end of the row instead, which is where
   there is room. */
.pref-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20;
  width: 280px; padding: 8px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px var(--shadow);
  display: flex; flex-direction: column; gap: 6px;
}
/* RISING OUT OF THE ROW, on Joel's side: the row is on the floor of the
   window, so a panel below it would be off the bottom of the screen.

   ONE WIDTH, WHETHER THE MENU IS WIDE OR NARROW. It used to be as wide as the
   row - which is a different number in each of the two shapes, and at the
   narrow end it was too few pixels for "System" to sit beside its own icon.
   See --acct-menu-w. The panel is drawn in the same place and at the same
   size either way now, so changing the shape of the menu changes nothing at
   all about the menu that opens out of it. */
.pref-menu-up > .pref-panel {
  top: auto; bottom: calc(100% + 6px); left: 0; right: auto;
  width: var(--acct-menu-w);
}
html[data-sidebar="shut"] .pref-menu-up > .pref-panel {
  left: 0; right: auto; width: var(--acct-menu-w);
}
.pref-panel form { display: flex; flex-direction: column; gap: 6px; max-width: none; }
.pref-group { border: none; padding: 0; margin: 0; min-width: 0; }
/* The quiet name over a row of segments. Three of these one under another -
   Appearance, Time, Accent - is a list that needs its labels; one of them did
   not. */
.pref-legend { padding: 6px 4px 4px; font-size: 12px; color: var(--muted); }
.pref-save { margin-top: 4px; }

/* One row of the menu that is a door rather than a switch: Settings, and Sign
   out. Both are drawn the same, because they are the same kind of thing - you
   press it and you are somewhere else. */
.pref-item {
  display: flex; align-items: center;
  min-height: 34px; padding: 0 10px;
  border: 0; border-radius: var(--radius-control); background: none;
  color: var(--ink); font: inherit; font-size: 14px; text-align: left;
  width: 100%; cursor: pointer;
}
.pref-item:hover { background: var(--input); text-decoration: none; }
.pref-foot form { margin: 0; display: block; }

/* ---------- A SEGMENTED CONTROL, AND THE HIGHLIGHT THAT SLIDES ----------
   Two settings with two and three answers each. As a list of radio buttons
   with a sentence under every one, that was eight lines to read in a menu
   whose whole job is to be glanced at; as two rows of segments it is two.

   THE RADIO IS STILL THE CONTROL. It is moved off screen rather than removed,
   so the keyboard still walks the group with the arrow keys, the label still
   works as a hit target, and the form still posts with JavaScript switched
   off. What is styled is the label wrapped round it, plus one span that moves.

   EQUAL WIDTHS, AND THE HIGHLIGHT CENTRED UNDER WHICHEVER IS ON. The columns
   are grid-auto-columns: 1fr, so two options are two halves and three are
   three thirds whatever the words in them are. The highlight is one span,
   one width - the track divided by --seg-n - and one `left` that changes:
   which option is checked is matched with :has() on the group, so THIS SLIDES
   WITH NO JAVASCRIPT AT ALL. With JavaScript off it is still in the right
   place; it simply arrives there rather than travelling. */
.seg {
  position: relative;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  padding: 3px;
  background: var(--input); border-radius: var(--radius-control);
}
.seg-slide {
  position: absolute; top: 3px; bottom: 3px; left: 3px;
  width: calc((100% - 6px) / var(--seg-n, 2));
  border-radius: 4px;
  background: var(--panel);
  box-shadow: 0 1px 3px var(--shadow);
  transition: left var(--swing) var(--ease);
  pointer-events: none;
}
/* nth-of-type counts labels, so the span above is not one of them. Four is
   more than any preference has and is here so that a third or fourth choice
   added to one needs nothing in this file. */
.seg:has(.seg-item:nth-of-type(2) input:checked) > .seg-slide {
  left: calc(3px + 1 * (100% - 6px) / var(--seg-n, 2));
}
.seg:has(.seg-item:nth-of-type(3) input:checked) > .seg-slide {
  left: calc(3px + 2 * (100% - 6px) / var(--seg-n, 2));
}
.seg:has(.seg-item:nth-of-type(4) input:checked) > .seg-slide {
  left: calc(3px + 3 * (100% - 6px) / var(--seg-n, 2));
}
.seg-item { cursor: pointer; min-width: 0; position: relative; z-index: 1; }
/* Off screen, not display:none, which would take it out of the tab order and
   out of the arrow-key group along with it. */
.seg-item input {
  position: absolute; width: 1px; height: 1px; margin: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.seg-face {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 0 5px;
  min-height: 30px; padding: 4px; border-radius: 4px;
  font-size: 13px; font-weight: 500; line-height: 1.3;
  color: var(--muted);
  text-align: center;
  transition: color var(--beat) ease;
}
.seg-icon { flex: 0 0 auto; width: 14px; height: 14px; opacity: .85; }
.seg-label { white-space: nowrap; }
/* The current time written the way that choice writes it. Not a description -
   it is the difference between the two, demonstrated. */
.seg-eg {
  flex: 1 0 100%; font-size: 11px; font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.seg-item:hover .seg-face { color: var(--ink); }
/* THE CHOSEN ONE IS THE ONE WITH THE HIGHLIGHT BEHIND IT, so all it needs is
   full ink. It used to be filled with the accent, which made the control the
   loudest thing in the menu and gave the row of dots underneath nothing to be
   louder than. Both colours are measured in test/contrast.test.js. */
.seg-item input:checked + .seg-face { color: var(--ink); font-weight: 600; }
/* The keyboard ring goes round the segment, since the radio itself is off
   screen and has nothing to draw one on. Same treatment as everywhere else -
   see the note on :focus-visible near the top of this file. */
.seg-item input:focus-visible + .seg-face {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
html[data-input="mouse"] .seg-item input:focus-visible + .seg-face { outline: none; }
@media (prefers-reduced-motion: reduce) {
  .seg-slide, .seg-face { transition: none; }
}

/* ---------- SIX DOTS ----------
   The accent picker. Real radio buttons, so the arrow keys walk the six and
   the form posts with JavaScript switched off - what is drawn is the label.
   Spread across the panel rather than bunched, so each is its own target. */
.dots { display: flex; justify-content: space-between; gap: 8px; padding: 2px 4px 6px; }
.dot { cursor: pointer; line-height: 0; }
.dot input {
  position: absolute; width: 1px; height: 1px; margin: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.dot-face {
  display: block; width: 22px; height: 22px; border-radius: 999px;
  transition: transform var(--blink) ease, box-shadow var(--blink) ease;
}
.dot:hover .dot-face { transform: scale(1.12); }
/* WHICH ONE IS ON: a ring, held off the dot by a gap in the panel's own
   colour, so it reads as a halo rather than as a seventh colour. */
.dot input:checked + .dot-face {
  box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--ink);
}
.dot input:focus-visible + .dot-face {
  outline: 2px solid var(--accent); outline-offset: 4px;
}
html[data-input="mouse"] .dot input:focus-visible + .dot-face { outline: none; }
@media (prefers-reduced-motion: reduce) { .dot-face { transition: none; } }

/* THE WAY TO SETTINGS AND THE WAY OUT, at the bottom of the panel and under a
   line. Everything above saves the instant it is pressed; these two are doors,
   and the line is what says so before it is read. */
.pref-foot {
  margin-top: 2px; padding-top: 6px;
  border-top: 1px solid var(--line);
}

/* ---------- Search (in the top bar, and its results page) ---------- */
.site-search {
  position: relative;
  flex: 1 1 200px;
  max-width: 340px;
  min-width: 0;
  margin: 0;
}
.site-search-input {
  width: 100%;
  /* Exactly as tall as "+ Gig" and the sliders button, so the top bar reads
     as one row of controls rather than three heights side by side. */
  height: var(--control-h); padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--input); color: var(--ink);
  font: inherit; font-size: 14px;
}
.site-search-input::placeholder { color: var(--muted); }
.site-search-input:hover { border-color: var(--accent); }
/* Focus is the shared field treatment near the top of this file - a lifted
   border and a lifted background, no ring. */

/* The panel under the box. Built by public/app.js; without it the box is
   still a form and Enter still goes to the results page. */
.site-search-panel {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30;
  max-height: min(70vh, 460px); overflow: auto;
  padding: 6px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px var(--shadow);
}
.site-search-panel[hidden] { display: none; }
.search-group + .search-group { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.search-group-label {
  margin: 2px 0 4px; padding: 0 8px;
  font-size: 12px; font-weight: 500; color: var(--muted);
  text-transform: none; letter-spacing: normal;
}
.search-result {
  display: block; padding: 6px 8px; border-radius: 7px;
  color: var(--ink); font-size: 14px; line-height: 1.35;
}
.search-result:hover { text-decoration: none; }
/* WHERE THE ARROW KEYS ARE - AND WHERE THE POINTER IS. There used to be two
   different marks here, a faint one for hover and this one for the keyboard,
   which meant the pointer could be resting on the fourth result while the
   first was still the one Enter would open. public/app.js now moves this one
   with the pointer, so there is a single answer to "which of these am I about
   to open" however somebody is pointing at it. */
.search-result.is-active { background: var(--accent); color: var(--accent-ink); }
.search-result.is-active .muted-sm { color: var(--accent-ink); opacity: .85; }
.search-result-title { display: block; font-weight: 600; }
.search-all { font-weight: 600; color: var(--accent); }
.search-all.is-active { color: var(--accent-ink); }
.search-more, .search-empty {
  margin: 2px 0 4px; padding: 2px 8px 4px;
  font-size: 12px; color: var(--muted);
}

/* The results page uses the same two lines per row as the dropdown. */
.search-list { list-style: none; margin: 0; padding: 0; }
.search-list li { padding: 9px 0; border-top: 1px solid var(--line); }
.search-list li:first-child { border-top: none; }
/* The stage of a gig that turned up in a search, and the control that moves
   it. On its own line under the name, because the line above it is already a
   date, a client and a venue. */
.search-list .status-pick { display: block; margin-top: 4px; }

/* ---------- Sortable table headers ---------- */
/* Built by public/app.js out of a plain <th>. Without JavaScript the heading
   stays ordinary text - not a button that does nothing. */
/* A heading that sorts is still a heading, so it is drawn exactly like one -
   see the note on `th` above. */
.sort-link {
  display: inline-flex; align-items: center; gap: 5px;
  border: none; background: none; padding: 0; margin: 0;
  font-family: inherit; cursor: pointer;
  color: var(--muted); text-transform: none;
  letter-spacing: normal; font-size: 13px; font-weight: 500;
}
.sort-link:hover { color: var(--ink); text-decoration: none; }
.sort-link.is-sorted { color: var(--accent); }
.sort-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
/* Reserve the arrow's width so a heading doesn't shift when it gains one. */
.sort-arrow { font-size: 9px; line-height: 1; min-width: 8px; }

/* ---------- The line between past and upcoming ---------- */
/* The bar IS the line now, so there is no rule behind it to draw. */
.divider-row td { padding: 6px 0; border-bottom: none; background: none; }
/* "Today", on the line between what is coming and what has gone. A bar in the
   accent rather than a pill on a rule: it is the one thing on a list of a
   hundred rows that says where you are in time, and a bar is read before a
   badge is. */
.divider-label {
  display: block; margin: 8px 0;
  padding: 8px 12px; border-radius: var(--radius-control);
  background: var(--accent); color: var(--accent-ink);
  font-size: 13px; font-weight: 600;
  text-transform: none; letter-spacing: normal;
}

/* ---------- BIG ENOUGH FOR A FINGER ----------

   A handful of controls were drawn to the size of the words on them, which is
   fine for a mouse pointer and too small for a thumb: the stage badges that
   change a gig's stage, the headings that sort a table, "Mark as not
   received", and the role dropdown in Settings. On a touch screen they are
   given a thumb's worth of height; on a desk nothing about them changes. The
   words stay the size they were - it is the target that grows, not the type. */
@media (pointer: coarse) {
  .status-pick > summary { min-height: 36px; }
  .status-switcher button, .status-panel button { min-height: 36px; padding-inline: 12px; }
  .sort-link { min-height: 32px; }
  .link-danger { min-height: 36px; }
  .person-role select { min-height: var(--control-h); }
}

/* ---------- THE GIG LIST ON A PHONE: ONE CARD PER GIG ----------

   Five columns do not fit 360 pixels, and a table that scrolls sideways is a
   table read one column at a time. So below 640 pixels the gig list's table
   is drawn as cards - the same elements, laid out differently - and every row
   reads top to bottom:

     the gig and its venue           its stage
     the date and the countdown      its fee
     the client

   THE HEADINGS BECOME THE SORT. The row of column names turns into a row of
   "Sort by" buttons - the very buttons public/app.js made out of them - so
   sorting is the same press doing the same thing, and the arrow still says
   which way. Without JavaScript the headings are only words, so that row is
   not drawn at all rather than offering buttons that do nothing.

   Everything that works on the rows - the stage menu, the Today line, a row
   held on screen after it changed, the highlight when one does - works here
   untouched, because they are the same rows. See views/gigs/index.ejs. */

/* ---------- Pop-up gig lists ---------- */
.gig-dialog {
  width: min(920px, calc(100vw - 32px));
  max-height: min(80vh, 760px);
  padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: var(--ink);
  box-shadow: 0 8px 24px var(--shadow);
  overflow: hidden;
}

/* ============================================================
   A POP-UP OPENS AND SHUTS LIKE EVERYTHING ELSE
   ============================================================

   Every menu and fold in this app grew an open and a close - see THINGS OPEN
   AND SHUT RATHER THAN JUMPING further down this file - and the pop-ups were
   left behind, so the one thing on the screen that covers the whole window was
   also the one thing that appeared between two frames with no warning. It read as the page being
   replaced rather than as something opening on top of it.

   ONE RULE, ON <dialog> ITSELF, so this is true of the two lists on the
   dashboard and of whatever pops up next, without either being named here.

   THE SAME RESTRAINT AS THE REST: a fade, and six pixels of rise. Not a zoom,
   not a bounce. The backdrop fades with it, which is the half that makes it
   read as one thing arriving rather than as a panel landing on a grey sheet
   that was already there.

   HOW IT SHUTS WITHOUT A LINE OF JAVASCRIPT, which is the only reason this is
   possible at all. A dialog that closes goes display: none immediately, so
   there is nothing left to animate - unless display and overlay are allowed
   to hold their old values until the transition finishes, which is what
   transition-behavior: allow-discrete does. @starting-style is the other half:
   it is where a dialog comes FROM on the way in, which an element that was
   display: none a moment ago otherwise has no answer to.

   A browser too old for either ignores all of it and opens instantly, which is
   what shipped until now. */
dialog {
  opacity: 0;
  transform: translateY(6px) scale(.985);
  transition:
    opacity var(--beat) ease-out,
    transform var(--beat) var(--ease),
    overlay var(--beat),
    display var(--beat);
  transition-behavior: allow-discrete;
}
dialog[open] { opacity: 1; transform: none; }
@starting-style {
  dialog[open] { opacity: 0; transform: translateY(6px) scale(.985); }
}

/* THE GREY SHEET BEHIND IT, and note that the colour is on the OPEN state
   rather than on the element. A ::backdrop only exists while the dialog is
   open, so it is tempting to write the colour once - but then there is no
   second value to transition from, and the sheet snaps in at full strength
   under a panel that is still fading. Transparent by default, coloured while
   open, and told where it comes from by @starting-style: three lines that are
   the same shape as the three above them, for the same reason. */
dialog::backdrop {
  background: transparent;
  transition: background-color var(--beat) ease, overlay var(--beat), display var(--beat);
  transition-behavior: allow-discrete;
}
dialog[open]::backdrop { background: var(--backdrop); }
@starting-style {
  dialog[open]::backdrop { background: transparent; }
}

/* Asked for less movement: it is open, or it is shut. */
@media (prefers-reduced-motion: reduce) {
  dialog, dialog::backdrop { transition: none; }
  dialog { transform: none; }
}
.dialog-head {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 16px 24px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--panel);
}
.dialog-head h2 { margin: 0; }
.dialog-body { overflow: auto; max-height: calc(80vh - 118px); padding: 0 24px; }
.dialog-foot {
  margin: 0; padding: 12px 24px 16px; border-top: 1px solid var(--line);
}

/* ---------- Dashboard stat heading ---------- */
.stats-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 16px; margin: 18px 0 10px;
}
.stats-head h2 { margin: 0; }

/* ---------- Phone numbers ---------- */
/*
   Plain text until public/app.js says it can be copied, so it never looks
   clickable when clicking it would do nothing.

   NO UNDERLINE, of either kind. A dotted one is the "hover me for a
   definition" gesture and this is not a definition; a solid one is a link
   and this does not go anywhere. What it does is copy, so what it shows is
   a tooltip that says Copy - and then a tick once it has.
*/
.phone { white-space: nowrap; }
.phone[data-copy-ready] { cursor: pointer; border-radius: 3px; }
.phone[data-copy-ready]:hover { color: var(--accent); }

/* The bubble's own space, beside the number and always there whether or not
   anything is in it. Reserving it is what stops the table twitching every
   time a tooltip appears. */
.copy-hint {
  position: relative; display: inline-block;
  width: 48px; height: 1em; vertical-align: -0.15em;
}
.copy-bubble {
  position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
  white-space: nowrap; pointer-events: none;
  padding: 1px 7px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--input); color: var(--muted);
  font-size: 11px; font-weight: 600; letter-spacing: .03em;
  opacity: 0; transition: opacity var(--blink) ease;
}
/* Half a second of hovering before it appears, so it doesn't flash at every
   mouse that happens to cross the number on its way somewhere else. Moving
   away hides it at once. Arriving by keyboard shows it straight away: there
   is no such thing as tabbing past something by accident. */
.phone[data-copy-ready]:hover + .copy-hint .copy-bubble { opacity: 1; transition-delay: .5s; }
.phone[data-copy-ready]:focus-visible + .copy-hint .copy-bubble { opacity: 1; transition-delay: 0s; }
/* Copied. The tooltip becomes a tick in the same place - no waiting, and no
   second thing appearing anywhere else - and takes itself away after a
   couple of seconds. Same weight of selector as the hover rules above, and
   after them, so it wins while the mouse is still sitting on the number. */
.phone[data-copy-ready] + .copy-hint.is-flash .copy-bubble {
  opacity: 1; transition-delay: 0s;
  background: var(--notice-bg); border-color: var(--notice-line); color: var(--notice-ink);
}

/* Present for screen readers, invisible on screen. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.error {
  background: var(--error-bg); border: 1px solid var(--error-line); color: var(--error-ink);
  padding: 10px 14px; border-radius: 8px; max-width: 640px;
}
.error p { margin: 4px 0; }

/* ============================================================
   WHAT IS WRONG, SAID BESIDE THE THING THAT IS WRONG
   ============================================================

   THE COMPLAINT: "every form shows errors on the field itself, with a red
   outline plus a short message just above the field. No error lists at the top
   of forms."

   WHAT WAS THERE was the box above - every problem with the form, in a list,
   at the top. On a short form that is fine; on the gig form, which is fourteen
   fields in two cards, it meant reading "I couldn't read that as a date" and
   then hunting for which of the date-shaped boxes it meant.

   THE MESSAGE SITS BETWEEN THE LABEL'S WORDS AND THE BOX, which is where
   somebody reading down a form meets it before they reach the thing it is
   about - and where it cannot be scrolled away from that box the way a list at
   the top could be.

   THE RED BAR IS NOT GONE. It is now used only for the kind of problem that
   has no field to sit on: a pair of times that cannot both be right is wrong
   about neither box on its own. See src/form-errors.js.

   THE OUTLINE IS KEYED OFF aria-invalid RATHER THAN A CLASS, which means a
   field in trouble is drawn as one by saying so to a screen reader - one
   attribute, and no template has to remember a second thing. ============ */
.field-error {
  display: block;
  color: var(--danger);
  font-size: 13px; font-weight: 500; line-height: 1.35;
}
/* The label is a column of its own words, so the message needs no margin of
   its own - it takes the gap the label already puts between its parts. */
.form label > .field-error { margin: -2px 0 0; }

/* TWO PIXELS, NOT ONE, and in the alarm colour: a field in trouble has to be
   findable by scrolling past it, and a one-pixel border in a different colour
   is not. It survives focus, deliberately - the thing is still wrong while
   somebody is fixing it, and a box that looked fine the moment it was touched
   would be a box that stopped saying so. */
.form [aria-invalid="true"],
input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--danger); border-width: 2px;
}
.form [aria-invalid="true"]:focus,
input[aria-invalid="true"]:focus,
select[aria-invalid="true"]:focus,
textarea[aria-invalid="true"]:focus {
  border-color: var(--danger);
}

.notice {
  background: var(--notice-bg); border: 1px solid var(--notice-line); color: var(--notice-ink);
  padding: 10px 14px; border-radius: 8px; max-width: 640px;
}

/* ============================================================
   "THAT WORKED.", IN WHICHEVER OF THREE WAYS FITS.

   The tiering lives in src/flash.js and the essay at the top
   of it says why. This is the drawing of it, and there are
   two things drawn:

     .flash-said     - tier two. A bar at the foot of the
                       window saying what happened, with a
                       small tick or cross beside the words. It
                       is what an action gets when its RESULT
                       IS NOT ON SCREEN: an invite, a sign-in
                       link, a save on a page being left
                       behind.
     [data-settled]  - tier one. The row that just changed,
                       highlighting and settling. No floating
                       anything: the row IS the confirmation.

   WHY IT IS A BAR AT THE FOOT AND NOT A DISC IN THE
   MIDDLE ANY MORE. It was a 96px disc floating over the centre
   of the window, which is the loudest thing this app ever drew
   and was drawn for the smallest of its events - and for a
   success it carried NO WORDS at all, so "that worked" and
   "which of the two things I just did worked" were the same
   mark. A bar at the foot of the window is quieter, says what
   happened in words, and does not sit over the thing you were
   looking at.

   EVERY LINE BELOW IS DOING ONE OF FIVE JOBS:

     position: fixed    - it is not in the layout, so it cannot
                          move the page by a pixel, and it is
                          at the foot of the WINDOW whatever the
                          scroll position is.
     pointer-events     - none, on the layer and on the bar.
                          A click aimed at what is under it
                          reaches what is under it. There is
                          nothing to dismiss and nothing to hit.
     the animation      - it rises in, holds, and fades. All
                          CSS, no JavaScript, which is the same
                          standard everything else here is held
                          to, and it ends at opacity 0 and
                          visibility hidden so nothing lingers.
     the colours        - variables, so both themes are right
                          with one copy of everything. A success
                          is the ink colour inverted, the way a
                          toast is drawn everywhere; a FAILURE
                          keeps the alarm colours, because the
                          two must never be mistaken for each
                          other at a glance.
     reduced motion     - at the bottom. Nothing rises and
                          nothing fades: two states with
                          nothing in between.
   ============================================================ */

.flash-mark {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: 0 16px 24px;
  /* THE WHOLE LAYER IS UNTOUCHABLE. Not decoration - it is over the window at
     the exact moment somebody is likely to click something, so a layer that
     swallowed one press would be worse than no confirmation. */
  pointer-events: none;
}

/* The bar itself. */
.flash-said {
  margin: 0; max-width: min(calc(100vw - 32px), 460px);
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  border: 0; border-radius: 8px;
  background: var(--ink); color: var(--ink-contrast);
  box-shadow: 0 8px 24px var(--shadow);
  font-size: 14px; line-height: 20px; text-align: left;
  pointer-events: none;
}
/* A failure is loud and stays longer, and it is the one case where the words
   are the whole point: a symbol can say that something went wrong and can
   never say what. */
.is-problem .flash-said {
  background: var(--error-bg); color: var(--error-ink);
  border: 1px solid var(--error-line);
  font-size: 16px;
}

/* The tick, or the cross. Sixteen pixels beside the words rather than a disc
   over the page - it is there so the two kinds are told apart before they are
   read, which is all a mark can do. */
.flash-sign { flex: 0 0 auto; width: 16px; height: 16px; display: block; }
.flash-sign path { fill: none; stroke: currentColor; stroke-width: 2.4;
                   stroke-linecap: round; stroke-linejoin: round;
                   /* Long enough to cover either path outright. What is
                      animated is the offset going to zero, and a dash longer
                      than the line is one unbroken line. */
                   stroke-dasharray: 40; stroke-dashoffset: 40; }

/* Rise, hold, fade, gone. Brief for a success, which is a glance; long for a
   failure, which is a read. */
@keyframes flash-in-out {
  0%   { opacity: 0; transform: translateY(8px); }
  8%   { opacity: 1; transform: none; }
  70%  { opacity: 1; transform: none; }
  100% { opacity: 0; visibility: hidden; transform: none; }
}

/* And the mark drawn onto it, once the bar has arrived. */
@keyframes flash-stroke-on {
  to { stroke-dashoffset: 0; }
}

.flash-mark[data-flash="done"] .flash-said { animation: flash-in-out var(--hold) ease-out forwards; }
.flash-mark[data-flash="problem"] .flash-said { animation: flash-in-out 6s ease-out forwards; }
.flash-mark[data-flash="done"] { animation: flash-in-out var(--hold) ease-out forwards; }
.flash-mark[data-flash="problem"] { animation: flash-in-out 6s ease-out forwards; }
.flash-mark .flash-sign path { animation: flash-stroke-on var(--swing) ease-out var(--beat) forwards; }
/* ---------- "DELETED · UNDO" ----------

   THE ONE BAR THAT CAN BE PRESSED. Everything above says the bar is
   untouchable, and for every other message that is right: there is nothing
   on it to hit. After a delete there is - the word Undo - so on THIS version
   only, the bar itself takes the pointer. The layer around it still does
   not, so a press anywhere else on the window still reaches the page.

   IT STAYS LONGER, AND IT WAITS FOR YOU. A glance is enough to read "Gig
   saved"; reading "Gig deleted", realising it was the wrong gig and getting a
   pointer to the button is not a glance. So it holds for --undo-hold rather
   than --hold, and the countdown stops while the pointer is over the bar or
   the keyboard is on the button - a button that fades out from under a hand
   already moving towards it is worse than no button.

   No JavaScript in any of it: the hold is the same keyframes on a longer
   clock, and the waiting is animation-play-state. */
.flash-mark[data-flash="undo"],
.flash-mark[data-flash="undo"] .flash-said { animation: flash-in-out var(--undo-hold) ease-out forwards; }
.flash-mark[data-flash="undo"] .flash-said { pointer-events: auto; }
.flash-mark[data-flash="undo"]:has(.flash-said:hover),
.flash-mark[data-flash="undo"]:has(.flash-said:hover) .flash-said,
.flash-mark[data-flash="undo"]:focus-within,
.flash-mark[data-flash="undo"]:focus-within .flash-said { animation-play-state: paused; }
.flash-dot { opacity: .55; }
.flash-undo { margin: 0; display: flex; }
/* Words, underlined when the pointer is on them - a ghost button in the
   bar's own colours, because the bar is the ink colour inverted and none of
   the app's four button styles is drawn for that ground. */
.flash-undo-button {
  margin: -6px -8px; padding: 6px 8px;
  border: 0; border-radius: var(--radius-control); background: none;
  color: inherit; font: inherit; font-weight: 700; cursor: pointer;
}
.flash-undo-button:hover { text-decoration: underline; }
.flash-undo-button:focus-visible { outline: 2px solid currentColor; outline-offset: 0; }

/* The second stroke of the cross follows the first rather than crossing it at
   the same moment, so what is drawn reads as a cross being made. */
.flash-mark .flash-sign path.is-second { animation-delay: calc(var(--beat) + var(--blink)); }

@media (prefers-reduced-motion: reduce) {
  @keyframes flash-in-out {
    0%   { opacity: 1; }
    70%  { opacity: 1; }
    100% { opacity: 0; visibility: hidden; }
  }
  .flash-mark .flash-sign path { animation: none; stroke-dashoffset: 0; }
}

/* ============================================================
   TIER ONE: THE ROW SAYS SO ITSELF.

   No floating anything. The row Joel just acted on brightens
   and settles back, and the parts of it that changed - a
   "retired" badge arriving, a button's label becoming its
   opposite - fade in rather than snapping into place.

   THIS IS THE CONFIRMATION, not decoration on top of one.
   These actions used to change instantly and silently, which
   is precisely why they did not register as having happened:
   the page came back looking almost the same and there was
   nothing to catch the eye. Motion is what says "this, here,
   just now".

   The server puts data-settled on exactly one element per page
   load - see changedHere() in src/flash.js - so this is a
   thing that happens once, to one row, and never during
   ordinary reading.
   ============================================================ */

/* THERE IS NO 100% KEYFRAME, AND THAT IS THE WHOLE TRICK. A rule that ended
   at a colour would have to name one, and the rows this is put on do not
   agree about what theirs is: a question in a list has no background at all,
   the card around it is --panel, and a line in the details grid is different
   again. CSS fills in the missing final keyframe with the ELEMENT'S OWN
   value, whatever that happens to be - so the highlight fades back into the
   row rather than into a guess about it, and there is no fill mode leaving a
   card permanently transparent afterwards. */
@keyframes settle-row {
  0%   { background-color: var(--settle); }
  35%  { background-color: var(--settle); }
}

[data-settled] {
  animation: settle-row var(--linger) ease-out;
  /* So the highlight has an edge to fill rather than bleeding into the row
     above and below. */
  border-radius: var(--radius);
}

/* The bits of the row whose WORDS changed. A short crossfade, so the eye is
   drawn to the label that is different rather than being asked to notice that
   it always was. */
@keyframes settle-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

[data-settled] .settles { animation: settle-in var(--swing) ease-out var(--blink) both; }

/* AND THE LINKS ON THAT ROW GO WITH IT. The highlight is a wash of the
   accent, so an accent-coloured link sitting on it is one colour on a paler
   version of itself - which in light mode is not readable for three of the
   six accents, measured. For as long as the wash is there the links are drawn
   in --on-soft, which is the shade the app writes on that wash everywhere
   else, and they fade back to the ordinary link colour with it. Same trick as
   above: no 100% keyframe, so the end is the link's own colour. */
@keyframes settle-link {
  0%   { color: var(--on-soft); }
  35%  { color: var(--on-soft); }
}
[data-settled] a,
[data-settled] .lnk { animation: settle-link var(--linger) ease-out; }

/* ============================================================
   AND NONE OF IT FOR SOMEBODY WHO ASKED FOR LESS MOVEMENT.

   Both tiers. The bar is there and then it is not, with no
   rise and no drawing; the row highlights and settles in
   one step rather than over a second. The information is
   identical - what is removed is the movement, which is what
   was asked for and all that was asked for.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  /* The row still marks itself - it is the only confirmation these actions
     get, so taking it away entirely would leave nothing at all. What goes is
     the fade: it holds, then it is done. */
  @keyframes settle-row {
    0%   { background-color: var(--settle); }
    99%  { background-color: var(--settle); }
  }
  [data-settled] .settles { animation: none; }
  @keyframes settle-link {
    0%   { color: var(--on-soft); }
    99%  { color: var(--on-soft); }
  }
  /* A note is marked with a ring rather than a wash - see AND THE NOTE THAT
     HAS JUST CHANGED MARKS ITSELF - and it holds and is done, like the rest. */
  @keyframes settle-note {
    0%   { box-shadow: inset 0 0 0 2px var(--accent); }
    99%  { box-shadow: inset 0 0 0 2px var(--accent); }
  }
}

/* ============================================================
   THINGS OPEN AND SHUT RATHER THAN JUMPING

   Every fold and every menu in this app is a <details>, and
   until now all of them appeared and disappeared between one
   frame and the next. That does not read as opening - it reads
   as the page changing shape while you look away, and it is
   why "did I press that?" was a question worth asking.

   ONE RULE, ON THE ELEMENT ITSELF, so this is true of the
   preferences menu, a status badge, the filters, the Manage
   menu, the folded history on a gig, a client's past events,
   and of whatever folds next - without any of them being
   listed here, and without a line of JavaScript.

   AND IT IS THE ONLY WAY THE SHUTTING COULD BE ANIMATED AT
   ALL. A <details> that has been closed has no contents left
   to move, so doing this in script means taking over every
   click on every summary and closing it by hand afterwards -
   three ways of shutting one, all of which have to be found.
   The browser already knows; ::details-content is where it
   says so.

   WHAT IT LOOKS LIKE ON EACH OF THE TWO KINDS, from one rule:

     A FOLD IN THE PAGE grows and shrinks. The thing below it
     moves with it rather than being teleported down the page.
     interpolate-size is what lets a height run to `auto`
     rather than to a number nobody can know in advance.

     A MENU THAT FLOATS fades. Its panel is out of the flow -
     its height is nobody's business but its own - so what the
     height rule does there is nothing at all, and what is left
     is the fade. Which is exactly right: a menu that grew out
     of its own button would be a menu drawing attention to
     itself. The panel is not clipped by the overflow below,
     either: it hangs off the <details>, which is OUTSIDE this
     box rather than inside it.

   THE SAME LENGTH AS THE CONFIRMATIONS ABOVE, and no longer:
   this is meant to say what happened, not to be watched. A
   browser too old for ::details-content ignores all of it and
   opens instantly, which is what shipped until now.
   ============================================================ */

:root { interpolate-size: allow-keywords; }

details::details-content {
  block-size: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    block-size var(--swing) var(--ease),
    opacity var(--beat) ease-out,
    content-visibility var(--swing);
  /* content-visibility has no in-between values, so it is told to hold its
     old one until the end - without this the contents are gone on the first
     frame of closing and there is nothing left to animate. */
  transition-behavior: allow-discrete;
}
details[open]::details-content { block-size: auto; opacity: 1; }
/* ...BUT ON THE WAY OPEN, THE CONTENTS ARE THERE AT ONCE. The hold above is
   for closing. Opening, it held "hidden" for a whole frame after the fold was
   opened, and a menu that public/app.js lifts into the top layer the moment
   its fold opens (see EVERY PANEL THAT FLOATS) has no size and no place while
   what holds it is still hidden - so a press in that frame went through it to
   the page. The opening transition leaves content-visibility out; the fade
   and the height still run, from the rule above. */
details[open]::details-content {
  transition:
    block-size var(--swing) var(--ease),
    opacity var(--beat) ease-out;
}

/* ============================================================
   A MENU DROPS IN. THE ACCOUNT MENU RISES.
   ============================================================

   The rule above fades a floating panel, which is most of the job. The other
   six pixels are this: a panel that appears six pixels above where it settles
   reads as coming OUT OF the button that was pressed, and one that appears six
   pixels below its resting place reads as coming out of a row at the foot of
   the window. Fade alone reads as a panel that was already there.

   WHY THE PANELS ARE NAMED HERE when nothing else in this app names them.
   ::details-content cannot carry the transform: it would become the containing
   block for the absolutely-positioned panel inside it, and public/app.js
   measures that panel against the WINDOW to decide which side of its button to
   open on - so the transform would quietly move every menu in the app a few
   pixels off its mark. The animation has to go on the panel itself, and CSS
   cannot ask "is this child the one that floats". So it is a list, and a short
   one, and a panel added later gets the fade above either way.

   One-shot animations rather than transitions: the panel only exists while the
   fold is open, so there is nothing to animate on the way out - the fade above
   does the leaving. */
@keyframes menu-drop {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
@keyframes menu-rise {
  from { opacity: 0; transform: translateY(6px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
details[open] > .pref-panel,
details[open] > .filters-panel,
details[open] > .status-panel,
details[open] > .info-panel,
details[open] > .more-panel,
details[open] > .type-panel { animation: menu-drop var(--beat) ease-out; transform-origin: top; }
/* The account menu comes out of a row sitting on the floor of the window, so
   it goes the other way. */
details[open].pref-menu-up > .pref-panel {
  animation: menu-rise var(--beat) ease-out; transform-origin: bottom;
}

/* ============================================================
   THE PAGE ITSELF ARRIVES
   ============================================================

   A gentle fade and six pixels of rise on <main>, once, as the page loads.
   Not decoration: this app is server-rendered, so going from one screen to
   another is a whole new document, and a new document that simply replaces the
   old one between two frames is the thing that makes a server-rendered app
   feel like a slideshow. Six pixels and a fifth of a second is the difference
   between "the page was replaced" and "the page arrived".

   ON <main> AND NOT ON <body>, which matters: the frame - the left menu, the
   banners - must not fade with it, or every click on a menu row would make the
   menu itself blink. The frame stays put and the contents change, which is
   what a frame is for. */
@keyframes page-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
main { animation: page-in var(--beat) ease-out; }

/* ============================================================
   SOMETHING ARRIVES IN THE MIDDLE OF A PAGE
   ============================================================

   An editor opening under a note, a confirmation appearing inside a card, a
   row added to a list. Four pixels and a fade: enough to say that the page
   has gained something, not enough to be worth watching. The same keyframes
   the prototype uses for the same job. */
@keyframes reveal {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   ...AND SOMETHING LEAVES
   ============================================================

   A note deleted, a person removed. Both of those used to be a page that came
   back with one fewer row in it, which is the same screen twice with no
   account of what happened in between - and when the row was off the top or
   the bottom of what Joel could see, nothing happened at all as far as he was
   concerned.

   So the row goes first and the page comes back after. public/app.js puts
   data-going on the row it is about to remove, waits exactly as long as this
   takes, and only then reads the page again - see A BUTTON THAT ACTS ON THE
   PAGE IT IS ALREADY ON in that file. It is one --beat, which is the shortest
   thing anybody can see leave; a delete that made Joel wait would be a worse
   delete than the instant one it replaced.

   AND IT NEEDS NO JAVASCRIPT TO WORK, only to be seen: with scripting off the
   form posts, the page comes back, and the row is simply gone - exactly as it
   always was. */
[data-going] {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--beat) ease, transform var(--beat) var(--ease);
  pointer-events: none;
}

/* ============================================================
   THE WHOLE PAGE CHANGING SHADE, AND WHY IT DOES NOT FADE
   ============================================================

   Dark to light, light to dark, one accent to another. Every colour in this
   app comes from a variable at the top of this file, so switching either of
   those is one attribute changing on <html>, and the whole screen is on the
   other side of it in one frame. THAT IS DELIBERATE, AND IT IS THE SECOND
   ANSWER TO THIS QUESTION.

   WHAT WAS HERE BEFORE: a transition on background-color, color, border,
   fill and stroke for every element on the page, switched on for a quarter of
   a second while the attribute changed. On paper that is a crossfade. In
   front of somebody it is a flash - and Joel reported it as exactly that:
   "text visibly flashes during the change".

   IT IS ARITHMETIC RATHER THAN A BUG, which is why it was not worth a third
   attempt. The page is #f7f7f8 with #18181b written on it, and it is going to
   #131418 with #ececee written on it. Fade both and the ground walks DOWN
   while the ink walks UP, so halfway across they are the same grey:

     0%   ground 247,247,248   ink  24, 24, 27   contrast 16.6:1
     50%  ground 133,134,136   ink 130,130,133   contrast  1.1:1
     100% ground  19, 20, 24   ink 236,236,238   contrast 15.6:1

   Every word on the page disappears at the halfway mark and comes back. That
   is the flash, it is in the middle of the fade rather than at either end of
   it, and no easing curve moves it: a line from dark-on-light to light-on-dark
   has to cross itself somewhere.

   AND NO OTHER KIND OF FADE ESCAPES IT. A crossfade of two SNAPSHOTS - the
   browser's own view transitions, which is the modern way to do this - works
   out to the same sum, because the text is in the same place in both pictures
   and the dissolve adds one to the other. The only ways round it are a fade
   that pauses on a blank screen, or one that swaps the text at the halfway
   mark while the backgrounds keep fading, and both of those are worse than
   what is here now: a page that changes in one frame, with nothing out of
   step with anything else, because there is no moment in between to be out of
   step in.

   WHAT IS STILL TRUE, AND IS THE PART WORTH KEEPING: the attribute is written
   by public/app.js on the page already in front of somebody, so there is NO
   PAGE LOAD at all - the menu stays open, the scroll stays put, and the
   choice is saved in the background. With JavaScript off the form posts and
   the page comes back in the new colours. Both arrive in one frame, which is
   now the same answer rather than two.

   THE ONE THING THAT DOES MOVE is the sliding highlight on the switch being
   pressed - a position rather than a colour, so it has nothing to be out of
   step with. It keeps its own transition, up at .seg-slide. */

/* AND FOR THE ONE FRAME IT TAKES, NOTHING ANYWHERE TRANSITIONS A COLOUR.

   A handful of controls in this app ease their own colours under the pointer:
   a row in the left menu, the account row, a button, a segment, an accent
   dot. Those are 120ms transitions on `color` and `background-color`, and
   they do not care WHY the colour changed - so the lit menu row, the one with
   the pointer resting on it, was still easing towards its new ink a tenth of
   a second after the rest of the page had arrived. One row out of step with
   the page around it is the "mismatched moment" this was asked to remove, so
   it is removed: public/app.js puts this attribute on for the frame the
   attribute changes in and takes it off again afterwards.

   WHY IT BEATS THOSE RULES WITHOUT !important. Every one of them is a single
   class - .side-item, .btn, .seg-face - and this is an attribute plus an
   element, which weighs more. The one selector in the file that weighs more
   than this is html[data-sidebar="shut"] .side-tip, and what that transitions
   is opacity rather than a colour, so there is nothing for it to be out of
   step about.

   THE SLIDING HIGHLIGHT IS NAMED AGAIN, at a weight that beats the line
   above it. It is moving at that exact moment because it is the switch being
   pressed; it is a position rather than a colour; and it is the thing being
   looked at. */
html[data-swapping] *,
html[data-swapping] *::before,
html[data-swapping] *::after { transition: none; }
html[data-swapping] .seg-slide { transition: left var(--swing) var(--ease); }

@media (prefers-reduced-motion: reduce) {
  main { animation: none; }
  /* The left menu changes shape in one step: it is wide, or it is narrow;
     it is in, or it is out. */
  .sidebar, .side-edge, .side-edge-button svg,
  body.with-sidebar, .side-text, .side-search, .side-search-shut,
  .side-brand-short, .side-group, .side-group::before,
  .acct-name, .acct-chevron { transition: none; }
  /* A row that is going is gone. (The page changing shade is already one
     step for everybody - see THE WHOLE PAGE CHANGING SHADE above - so there
     is nothing here to switch off.) */
  [data-going] { transition: none; }
  details[open] > .pref-panel,
  details[open] > .filters-panel,
  details[open] > .status-panel,
  details[open] > .info-panel,
  details[open] > .more-panel,
  details[open] > .type-panel,
  details[open].pref-menu-up > .pref-panel { animation: none; }
}

/* ============================================================
   AND A MENU AND WHAT IT COVERS ARE ONE THING
   ============================================================

   THE COMPLAINT, IN TWO PLACES AT ONCE. Open a status menu on the gig list and
   the menu fades in - while the badges of the rows UNDERNEATH it are drawn on
   top of it, for the length of the fade, and then snap away. The filters panel
   did the same to the words behind it. One cause, two symptoms.

   WHAT IS ACTUALLY HAPPENING, because it is not obvious and it is not a bug in
   the fade. An element with an opacity between 0 and 1 becomes a STACKING
   CONTEXT: everything inside it is painted as one sealed unit, and a z-index
   in there stops meaning anything to the page outside. The panel of an open
   menu lives inside ::details-content and carries a z-index of 25 so that it
   sits over the rows below it. While the fade runs, that 25 is sealed inside
   the fading box and counts for nothing - so the next row down, which is
   position: relative and therefore painted in the same layer, goes over the
   top of it. The instant opacity reaches exactly 1 the stacking context stops
   existing, the 25 means something again, and the menu jumps in front. The
   "snap" is the seal breaking.

   SO THE FIX IS NOT TO THE FADE - IT IS TO PUT THE WHOLE MENU IN ONE LAYER.
   An open <details> is lifted a layer above its neighbours, so the fade
   happens INSIDE something already in front rather than fighting its way
   there. A menu and the rows it covers stop being two things being ordered
   against each other frame by frame.

   z-index NEEDS A POSITIONED ELEMENT, which is exactly and only the folds that
   have a floating panel hanging off them - .status-pick, .filter-menu,
   .nav-menu, .pref-menu, .type-pick are all position: relative, because that
   is what their panel is positioned against. On an ordinary fold in the page
   this line does nothing at all, which is right: there is nothing over
   anything to order.

   IT IS auto WHEN SHUT AND NOT A LOW NUMBER, which matters: a number - even
   zero - would make every one of these a stacking context permanently, all at
   the same level, and the later one in the page would go over the earlier one
   exactly as before. auto means no layer of its own at all, so the open one is
   the only thing lifted.

   AND IT STAYS UP UNTIL THE CLOSE HAS FINISHED. [open] goes the moment
   something is shut, while the contents are still fading out, so dropping the
   layer with the attribute would put the same bug on the way out. The
   transition on the closed state is what holds it: z-index cannot be
   half-way between a number and auto, so with allow-discrete it holds its old
   value for half the duration and then flips - one --beat of staying up, by which
   time there is nothing left to see. Opening is the other way round: the open
   state turns the transition off, so the lift is immediate and the panel is in
   front before the first frame of the fade. */
details { z-index: auto; transition: z-index calc(var(--swing) * 2); transition-behavior: allow-discrete; }
details[open] { z-index: 2; transition: none; }

/* Asked for less movement: it is open, or it is shut. */
@media (prefers-reduced-motion: reduce) {
  details::details-content { transition: none; }
}

/* The one button that lets a client into Soundcheck, and the line that says
   what it will do. Wraps under the button on a phone rather than squeezing
   the sentence into a column three words wide. */
.invite-form {
  display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap;
  margin-top: 14px;
}

/* ---------- Details list ---------- */
/* THE SECOND COLUMN IS minmax(0, 1fr) AND NOT 1fr, which is not a detail. A
   grid track defaults to a minimum of min-content, so `1fr` refuses to shrink
   below the widest unbreakable thing in it - and on a phone that pushed the
   whole page sideways, giving every gig a horizontal scrollbar. minmax(0, ...)
   is what lets the text wrap instead. The label column shrinks a little on the
   way down for the same reason. (This was already true before the inquiry date
   moved onto this list; the new row made it easier to notice.) */
.details {
  display: grid; grid-template-columns: minmax(96px, 150px) minmax(0, 1fr);
  gap: 8px 16px; margin: 0;
}
.details dt { font-size: 13px; color: var(--muted); }
/* A long email address is one unbreakable word, and it ran straight out of the
   card on a phone. It breaks where it has to rather than where it likes. */
.details dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
/* ON A PHONE THE LABEL GOES ABOVE ITS VALUE. Side by side, the label column
   took a third of 340 pixels, and a value with a box in it - her email, her
   phone - was left 140 pixels to be typed into. */

.deposit-state .deposit-form {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px;
}
/* An editable line inside the details list - the inquiry date, beside the
   deposit, which is the same shape of thing: a fact that arrives at a
   different moment from the booking. How wide the box is lives with the rest
   of the date sizing, up beside --field-date. */
.inline-date form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* min-width: 0 because a flex item will not shrink below its own min-content
   otherwise, and a text input's min-content is however many characters the
   browser feels a text input should be - about twenty. On a phone that made
   the box wider than the column it was in, and the page scrolled sideways. */
.inline-date form > * { min-width: 0; }
.inline-date input, .deposit-state input[type="date"] {
  padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; background: var(--input); color: var(--ink);
}

/* ---------- Notes ---------- */
.note-form { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin-bottom: 16px; }
.note-form textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 8px; font: inherit; resize: vertical;
  background: var(--input); color: var(--ink);
}

/* ============================================================
   A NOTE IS A BOX, AND IT IS THE BOX THAT SAYS WHERE IT ENDS
   ============================================================

   WHAT WAS HERE, AND WHY A LINE WAS NOT ENOUGH. Notes were separated by a
   hairline and fourteen pixels of air. That is plenty when a note is one
   sentence and useless when it is forty: a long note, its date, a line, and
   then another long note is a page of text with rules in it, and "where does
   this one stop" has to be worked out by reading rather than seen. Joel
   reported exactly that - separation unclear when a note is long.

   SO EACH NOTE IS ITS OWN QUIET SURFACE. The same --input wash the segmented
   control, the formatting strip and every field in the app sit on, with the
   card's own 12px corner - so it is the shape this app already uses for "a
   thing inside a thing" rather than a fourth idea. The shading is what does
   the separating, which is why there is no border and no rule between them:
   one of those at a time is a boundary, two is a diagram.

   THE DATE AND THE TWO ACTIONS ARE INSIDE IT, at its foot, which is the other
   half of the same point. On the flat list they were a line of grey type
   floating between two notes and could as easily have belonged to the one
   below. Inside the box there is nothing to wonder about.

   `>` EVERYWHERE, AND THAT IS AN OLD FIX THAT MUST NOT BE LOST. These rules
   say "a note", not "anything inside one". The rule here once said
   `.note-list li`, which is every list item anywhere inside the list - and a
   note may have a bulleted list in it, so every bullet was being drawn as
   though it were a note. The bullets inside a note are ordinary bullets,
   drawn by the rules every other piece of typed text uses.

   THE GAP IS THE LIST'S, NOT THE NOTE'S. A margin on the note would be a
   margin on the first and last ones too, so the list carries it as a gap and
   the ends of the list sit tight against what is above and below them. */
.note-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.note-list > li {
  position: relative;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--input);
}
/* WHILE ONE IS BEING EDITED IT IS A FORM RATHER THAN A NOTE, so it is not
   drawn as one. The editor that opens in its place is itself an --input box -
   see .rich-box - and an --input field on an --input surface is a field with
   no edges at all. Taking the surface away for as long as the form is open is
   the smaller change of the two: nothing has to be told that this one field,
   in this one place, is a different colour from every other field in the app.

   It reads on the `hidden` attribute, which is the one thing public/app.js
   changes to open and close the editor - so there is no second piece of state
   here that could come to disagree with it. See EDITING A NOTE WHERE IT IS in
   that file. */
.note-list > li:has(> .note-edit:not([hidden])) {
  padding: 0; background: none;
}
/* ---------- AND THE NOTE THAT HAS JUST CHANGED MARKS ITSELF ----------

   THE WASH NO LONGER WORKS HERE, and that is arithmetic rather than taste.
   [data-settled] brightens a row with --settle, which is the soft wash of
   the accent, and that was drawn straight onto the card. A note is its own
   --input surface now, and the wash is within a tenth of it: measured across
   all twelve theme-and-accent pairs, the best is 1.13:1 and six of them are
   below 1.05:1. A confirmation nobody can see is not a confirmation, and
   test/contrast.test.js now holds this to a number.

   SO THE NOTE IS MARKED THE WAY THE STATUS SWITCHER IS - the other place in
   this app where the wash was wrong for the shape it landed on. The wash
   goes, and something that reads on any background takes its place: a ring
   of the accent inside the box's own corner, held for the same --linger and
   fading on the same curve. It is the same idea - the thing that changed says
   so itself, and nothing floats over the page - said in the one language this
   shape leaves available.

   NO 100% KEYFRAME, the same trick as settle-row: the end is the element's
   own box-shadow, which is none, so there is nothing left behind afterwards.

   AND THE LINKS ON IT DO NOT CHANGE COLOUR EITHER. [data-settled] draws them
   in --on-soft for as long as the wash is there, because an accent link on a
   paler version of itself is not readable. There is no wash here, so there is
   nothing for them to be rescued from. */
.note-list > li[data-settled] {
  animation: settle-note var(--linger) ease-out;
}
@keyframes settle-note {
  0%   { box-shadow: inset 0 0 0 2px var(--accent); }
  35%  { box-shadow: inset 0 0 0 2px var(--accent); }
}
.note-list > li[data-settled] a,
.note-list > li[data-settled] .lnk { animation: none; }

/* The foot of the box: the date on the left, what can be done to it on the
   right. Held off the note above it so that a note ending in a sentence does
   not read as having one more line. */
.note-meta {
  display: flex; gap: 12px; align-items: center;
  margin-top: 10px;
  font-size: 12px; color: var(--muted);
}
.note-meta form { display: inline; }
/* Edit and Delete sit together at the right-hand end of the line that carries
   the date, so the date reads as the note's and the two actions read as a
   pair rather than as two more facts about it. */
.note-actions { display: flex; gap: 12px; align-items: center; margin-left: auto; }
/* WHAT THE CLIENT WROTE, ON JOEL'S PAGE. The same list the notes card draws,
   with a line of the accent down its left edge: it is the one card on a gig
   whose words are not his, and it should not be possible to read it as one of
   his own at a glance. */
.client-notes { border-left: 3px solid var(--accent); }
.client-notes-says { margin: -4px 0 12px; }
/* When it was written and - when it was somebody else - by whom. One line
   that wraps as a line, so the name never ends up under the date on its own. */
.note-when { display: inline-flex; flex-wrap: wrap; gap: 0 6px; min-width: 0; }
.note-by { color: var(--muted); }

/* ---------- EDITING A NOTE WHERE IT IS ----------
   The form is in the page from the start and hidden, so public/app.js only
   has to swap which of the two is on screen. With no JavaScript it stays
   hidden and Edit is an ordinary link to a page with the same box on it. */
.note-edit { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.note-edit .rich-field { width: 100%; }
.note-edit-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* It opens in place, so it says so rather than appearing between two frames. */
.note-list > li > .note-edit { animation: reveal var(--beat) ease-out; }
@media (prefers-reduced-motion: reduce) {
  .note-list > li > .note-edit { animation: none; }
}

/* THERE IS NO SITE FOOTER ANY MORE - see views/partials/footer.ejs. What was
   in it was the database's path, on every page of a working business, and it
   has moved to Settings where somebody goes to ask for it.

   A FILE PATH IS ONE LONG WORD WITH NO SPACES IN IT, and a browser will not
   break a word unless it is told it may. On a server these are long -
   /var/data/dj-crm.sqlite and the folder the backups sit in - and one of them
   was enough on its own to push a phone sideways, which is the exact thing
   five other fixes in this file exist to stop. "anywhere" rather than
   "break-word" because a path has no sensible break point and mid-word is the
   only place left. Still needed: the backups page and Settings both print
   paths in a <code> inside a card. */
.card code { overflow-wrap: anywhere; }

/* ============================================================
   REPORTING PAGE
   Every colour below is one of the variables at the top of this
   file, which is what makes the charts right in both themes
   without a second copy of anything. There are no new palette
   entries here on purpose: a chart that invented its own blue
   would be the one thing on the page that stopped matching when
   the theme changed.
   ============================================================ */

/* Which range the whole page is showing, said in words. Loud enough that a
   screenshot of this page can't be mistaken for a different range. */
.range-statement {
  margin: 0 0 20px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--panel);
  font-size: 14px;
}

/* WHAT EVERY MONEY FIGURE ON THE REPORTING PAGE ACTUALLY IS.
   A standing condition of the page rather than a warning about today, so it
   is drawn at the weight of a footnote - quiet, no colour, no icon - and sits
   directly under the figures it is about. Loud enough to be read once,
   quiet enough not to be shouting on every visit. */
.money-caveat {
  margin: 0 0 18px;
  padding: 10px 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  font-size: 13px; color: var(--muted);
}
.money-caveat strong { color: var(--ink); font-weight: 600; }

/* A heading inside a card, under the card's own <h2>. The third level of the
   scale, so it matches a real <h3> rather than being a fourth thing. */
.sub-heading {
  margin: 24px 0 10px;
  font-size: 15px; font-weight: 600; line-height: 22px;
  text-transform: none; letter-spacing: normal;
  color: var(--ink);
}
.card > .sub-heading:first-of-type { margin-top: 18px; }

.table-caption {
  caption-side: top; text-align: left;
  padding: 0 0 10px;
  font-size: 12px; color: var(--muted);
}

/* ---------- A TABLE THAT WILL NOT FIT, AND THE PAGE THAT MUST NOT MOVE ----------

   Eight columns of dates, names and money do not fit in 375 pixels, and no
   amount of shrinking makes them: every column says something, and a gig list
   with the fee cut off is a gig list nobody can use.

   So the table is allowed to be as wide as it needs to be, and this is the box
   it does that INSIDE. Without it, the widest table on a page pushes the whole
   document sideways - the heading, the top bar, the buttons, everything - and
   the only way back to the left edge is a scrollbar at the very bottom of the
   page, underneath the thing you were trying to read. With it, the page stays
   exactly 375 wide and one card scrolls under your thumb, which is a gesture
   that needs no explaining on a phone.

   EVERY TABLE IN THIS APP THAT CAN OUTGROW A PHONE IS IN ONE OF THESE. The
   dashboard, the gig list, the client list, a client's own page and the
   reports all wrap theirs; test/appearance.test.js walks the templates and
   fails if a new one turns up that doesn't.

   position: relative IS NOT DECORATION AND MUST NOT BE REMOVED. Without it
   the wrapper does not fully work, in a way that takes an afternoon to find:
   an element inside the table that is position:absolute - and app.js puts one
   in every sortable column heading, the hidden line that tells a screen reader
   which way the sort is pointing - has its position worked out against the
   PAGE rather than against this box. Something positioned against the page is
   not clipped by this box's overflow, so it went on pushing the document
   sideways exactly as before, while every element in the layout measured a
   perfectly innocent 375 pixels wide. This line makes the wrapper the thing
   those are positioned against, which is what puts them inside the scroll it
   is creating. It is why the venues table looked fixed and the gig list did
   not: the venues table has no sortable headings in it. */
.table-wrap { position: relative; overflow-x: auto; }

/* ---------- Earned and expected, told apart ----------
   The two are never one figure on this page, and where they sit side by side
   the tile itself carries the same solid-versus-hatched distinction the charts
   use. The bar down the left is not the only difference - each tile's own
   label says which it is - it just makes the pair scannable. */
.stat-earned  { border-left: 3px solid var(--accent); }
.stat-expected {
  border-left: 3px solid var(--accent);
  border-left-style: dashed;
}

/* ---------- Charts ---------- */
.chart-frame { margin: 4px 0 12px; }
/* Scaled to the width it is given, keeping its own proportions - so the text
   and the hairlines inside never stretch. */
.chart { display: block; width: 100%; height: auto; }

/* ON A PHONE THE CHART SCROLLS, exactly as the tables beside it do.
   A chart is drawn 960 units wide. Squeezed into the 311 pixels a phone
   actually has, everything in it shrinks with it: the month labels come out
   about three pixels tall, which is not small type - it is a grey smudge, and
   the bars are three pixels wide, which is not a bar. So below this width the
   drawing keeps a size it can be read at and the FRAME scrolls sideways, the
   same answer .table-wrap gives for the same problem, and the page itself
   still does not move. The numbers are also written out underneath every
   chart on the page, for anybody who would rather not swipe at all. */

.chart-gridline { stroke: var(--line); stroke-width: 1; }
.chart-baseline { stroke: var(--muted); stroke-width: 1; }
.chart-axis { fill: var(--muted); font-size: 10px;
              font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; }
.chart-axis-year { font-weight: 700; }

/* EARNED is solid. Expected is not given a fill here on purpose: it is filled
   with one of the hatch patterns defined in views/partials/chart.ejs, and a
   fill in this file would override that pattern, because a CSS rule always
   beats an attribute on the element. Only the outline is set here. */
.ch-current-earned { fill: var(--accent); }
.ch-prior-earned   { fill: var(--muted); }
.ch-current-expected { stroke: var(--accent); stroke-width: .75; }
.ch-prior-expected   { stroke: var(--muted);  stroke-width: .75; }

/* The stripes themselves, inside the patterns. */
.ch-hatch-bg      { fill: var(--panel); }
.ch-hatch-current { stroke: var(--accent); }
.ch-hatch-prior   { stroke: var(--muted); }

/* ---------- Chart legend ----------
   Colour is never the only thing separating two series on this page - this
   period is the left bar and a year earlier the right one, earned is solid and
   expected is hatched - but the legend still has to say which is which in
   words, because a swatch alone explains nothing. */
.chart-legend {
  list-style: none; margin: 0 0 10px; padding: 0;
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  font-size: 12px; color: var(--muted);
}
.chart-legend li { display: flex; align-items: center; gap: 7px; }
.swatch {
  width: 14px; height: 14px; border-radius: 3px; flex: none;
  border: 1px solid transparent;
}
.sw-current-earned { background: var(--accent); }
.sw-prior-earned   { background: var(--muted); }
/* The same 45-degree stripes as the pattern in the chart, in CSS, so the key
   and the thing it is keying look alike. */
.sw-current-expected {
  border-color: var(--accent);
  background: repeating-linear-gradient(
    45deg, var(--accent) 0 3px, var(--panel) 3px 6px);
}
.sw-prior-expected {
  border-color: var(--muted);
  background: repeating-linear-gradient(
    45deg, var(--muted) 0 3px, var(--panel) 3px 6px);
}

/* ---------- The stacked charts: one band per kind of work ----------
   A band's colour is a token and nothing else; the stripes on a hatched band
   are drawn in that same token, inside a <pattern> whose id belongs to that
   band alone - one shared pattern would come out one colour for all of them
   and undo the whole point of hatching. See buildStackedChart in
   src/charts.js.

   NO FILL IS SET ON A HATCHED RECT, deliberately. It is filled with a pattern
   through an attribute on the element, and a fill in this file would override
   that pattern, because a CSS rule always beats an attribute. Only the solid
   ones are filled here; the hatched ones colour their stripes instead. */
.ch-t1 { fill: var(--tone-1); }
.ch-t2 { fill: var(--tone-2); }
.ch-t3 { fill: var(--tone-3); }
.ch-t4 { fill: var(--tone-4); }
.ch-t5 { fill: var(--tone-5); }
.ch-t6 { fill: var(--tone-6); }
.ch-tblank { fill: var(--tone-blank); }
.ch-t1-stripe { stroke: var(--tone-1); }
.ch-t2-stripe { stroke: var(--tone-2); }
.ch-t3-stripe { stroke: var(--tone-3); }
.ch-t4-stripe { stroke: var(--tone-4); }
.ch-t5-stripe { stroke: var(--tone-5); }
.ch-t6-stripe { stroke: var(--tone-6); }
.ch-tblank-stripe { stroke: var(--tone-blank); }
/* A hairline of the card's own colour between the bands, so two neighbouring
   slices in one stack never read as one taller slice. */
.ch-slice { stroke: var(--panel); stroke-width: 1; }

/* The key for those bands. Wraps onto as many lines as it needs - there are
   seven kinds of gig and there may be more, and a key that scrolled sideways
   would be a key you have to work at. */
.chart-legend-types { margin: 8px 0 0; }
.sw-t1 { background: var(--tone-1); }
.sw-t2 { background: var(--tone-2); }
.sw-t3 { background: var(--tone-3); }
.sw-t4 { background: var(--tone-4); }
.sw-t5 { background: var(--tone-5); }
.sw-t6 { background: var(--tone-6); }
.sw-tblank { background: var(--tone-blank); }
/* The same stripes the bars carry, in CSS, so the key and the thing it is
   keying look alike. currentColor is not available here - the swatch has no
   text - so the stripe is cut out of the band's own colour with the card
   behind it, which is exactly what the SVG pattern does. */
.sw-up, .sw-down {
  background-image: repeating-linear-gradient(
    var(--stripe-angle, 45deg),
    var(--panel) 0 2px, transparent 2px 5px);
}
.sw-down { --stripe-angle: -45deg; }

/* ---------- The chart's numbers, as a table ----------
   Closed by default so it doesn't crowd the page, and a real <details>, so it
   opens with no JavaScript and its contents are in the page for a screen
   reader whether or not anybody opens it. */
/* ============================================================
   AN EXPANDER OPENS AND SHUTS SMOOTHLY
   ============================================================

   THE COMPLAINT: "every expand/collapse section animates open
   and closed smoothly." The MENUS never snapped - a filter
   panel, the account menu, a status badge and an explanation
   all float over the page and fade in, see A MENU DROPS IN -
   but the folds that are IN the page and push it about were the
   ones where the snap is most felt, because everything below
   them jumps.

   THE BOX IS BUILT BY public/app.js, which gathers everything
   that is not the summary into it and moves its height. There
   is nothing here but the belt and braces: a box left mid-move
   by a tab that stopped being drawn is still an ordinary box.
   Why it is script and not interpolate-size is written up where
   it happens - a <details> hides its own contents the instant
   `open` comes off, and the stylesheet answers to that are
   Chrome-only today.
   ============================================================ */
.fold-inside { display: block; }

.chart-data { margin-top: 14px; }
.chart-data > summary {
  cursor: pointer; font-size: 12px; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: .05em;
  padding: 6px 0;
}
.chart-data > summary:hover { color: var(--ink); }
.chart-data[open] > summary { margin-bottom: 6px; }
.chart-data table { font-size: 13px; }

/* ---------- Average fee, with a bar beside the number ----------
   Beside, never instead of. The figure is the answer; the bar only saves
   comparing twenty of them by eye, so it is aria-hidden and carries no
   information the number doesn't already have. */
.col-avg { text-align: right; white-space: nowrap; }
th.col-avg { text-align: right; }
.avg-value { display: block; }
.avg-bar {
  display: block; width: 100%; max-width: 90px; height: 4px; margin: 4px 0 0 auto;
  background: var(--input); border-radius: 999px; overflow: hidden;
}
.avg-bar-fill { display: block; height: 100%; background: var(--accent); }

/* ---------- THE BARS GROW INTO PLACE ----------

   Every chart on Reports grows up from its baseline as the page arrives,
   and the average-fee bars beside the tables grow out from the left - the
   motion the redesign prototype drew (docs/redesign/soundcheck-prototype.html)
   and the brand book asks for: "progress bars fill from empty on load".

   THE WHOLE SET OF BARS GROWS AS ONE, from the bottom of the box they make
   together - which is the baseline every bar stands on - so a stacked month
   rises as a stack, not as slices each growing from their own floor.

   WHEN THE FILTERS OR THE PERIOD CHANGE the answer is new markup put in the
   page (see NARROWING THE GIG LIST in public/app.js), so it grows again. The
   figures above count up beside it, in the script - THE FIGURES COUNT UP TO
   WHAT THEY ARE. Nothing moves under reduced motion. */
.chart .chart-bars {
  transform-box: fill-box; transform-origin: 50% 100%;
  animation: sc-grow var(--draw) var(--ease) both;
}
.avg-bar-fill { transform-origin: 0 50%; animation: sc-fill var(--draw) var(--ease) both; }
@media (prefers-reduced-motion: reduce) {
  .chart .chart-bars, .avg-bar-fill { animation: none; }
}

.col-excluded { font-size: 12px; white-space: nowrap; }

/* "Highest average fee" - the one row a revenue ranking would otherwise
   bury. */
.tag {
  display: inline-block; margin-left: 6px; padding: 1px 8px;
  border-radius: 999px; border: 1px solid var(--accent);
  color: var(--accent); background: transparent;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}

/* A month with nothing booked in it. Shaded, not hidden: an empty month is the
   thing the pipeline section exists to show you early.

   --code-bg rather than --input, which would be invisible here: in the light
   theme a field and a card are both plain white, so tinting the row with
   --input tinted it with the colour it was already sitting on. */
.row-thin td { background: var(--code-bg); }

/* The year-on-year sentence above the revenue chart. */
.compare-line { margin: 0 0 14px; font-size: 14px; }

/* ============================================================
   SIGNING IN, AND SOUNDCHECK
   The client's side of the app.

   EVERY COLOUR BELOW IS ONE OF THE VARIABLES AT THE TOP OF THIS
   FILE. There is not a single new hex value here, which is what
   makes the portal correct in dark and light without a second
   copy of anything - and it is why the contrast test already
   covers these pages: they are drawn from pairs it already
   measures.

   What makes this read as the client's area rather than Joel's
   is not colour. It is space: wider margins, fewer things per
   screen, and lists instead of tables. Joel's side is a tool
   he uses fifty times a day; this is a page somebody opens
   twice a month and wants to feel calm about.
   ============================================================ */

/* ---------- The sign-in page ---------- */
/* Narrower than the app's normal column, and pushed down the screen. A single
   short form centred in a wide page looks abandoned. */
.signin { max-width: 420px; margin: 6vh auto 0; }
/* THE MARK, above the wordmark: a filled accent circle with a hole knocked
   out of it in the page's own colour, so the hole really is the page showing
   through rather than a second circle that nearly matches. */
.signin-mark { display: block; width: 48px; height: 48px; margin: 0 auto 12px; }
.signin-mark-face { fill: var(--accent); }
.signin-mark-hole { fill: var(--bg); }
.signin-brand {
  margin: 0 0 6px;
  font-size: 30px; line-height: 36px; font-weight: 700; letter-spacing: -.02em;
  text-align: center;
}
.signin-sub { margin: 0 0 22px; color: var(--muted); text-align: center; }
.signin-form { max-width: none; }
.signin .error { max-width: none; margin-bottom: 16px; }
.signin .card p:last-child { margin-bottom: 0; }

/* TWO WAYS IN, SIDE BY SIDE. The password button is the filled one and comes
   first; the link button is an ordinary one beside it. They wrap onto separate
   full-width lines on a narrow screen rather than shrinking into two stubs -
   which is the shape a phone wants anyway, one decision per line. */
.signin-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.signin-actions .btn { flex: 1 1 auto; justify-content: center; }

/* "Forgotten your password?" and the sentence under it. Below the buttons,
   because it is what you read when the buttons have not worked. */
.signin-help {
  display: flex; flex-direction: column; gap: 4px;
  margin: 14px 0 0;
}

/* ---------- "On this computer" - the box under the check-your-email page ----------
   Only ever drawn on a machine with no mail service (mailIsUnconfigured() in
   src/config.js), where it carries the sign-in link itself. It has to be the
   thing the eye lands on: the page above it is a sentence about an email that
   is never coming, and this is the part that actually gets somebody in.

   MARKED AS SOMETHING OTHER THAN THE APP, with the notice colours and a small
   flag across the top, so it never reads as a message a client would get. */
.dev-inbox {
  border-color: var(--notice-line);
  border-left-width: 3px;
}
.dev-inbox-flag {
  margin: 0 0 10px;
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--notice-ink);
}
.dev-inbox p { margin: 0 0 10px; }
/* The button is the whole width of the box, because it is the only thing on
   the page anybody is looking for. */
.dev-inbox-go { margin: 14px 0; }
.dev-inbox-go .btn { width: 100%; justify-content: center; }

/* Settings is a short page of plain cards; nothing on it wants the full width
   of a gig table. */
.settings-card { max-width: 640px; }

/* A FULL FILE PATH IS ONE LONG UNBREAKABLE WORD, and on a phone it is the
   thing that would push the whole page sideways. It wraps anywhere rather
   than making the page scroll. */
.settings-path { overflow-wrap: anywhere; word-break: break-all; }

/* ---------- People and roles ----------
   A LIST, not a table, for the same reason the client's event list is one:
   there will be one or two of these for years, and a table of two rows with
   four column headings over it is a filing cabinet drawn around a postcard.
   Each person is a block that wraps onto as many lines as the screen needs -
   which is one thing per line on a phone, and no sideways scroll anywhere. */
.people-list { list-style: none; margin: 0; padding: 0; }
.person {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 14px 0; border-top: 1px solid var(--line);
}
.person:first-child { border-top: 0; padding-top: 0; }
.person-who {
  display: flex; flex-direction: column; gap: 2px;
  flex: 1 1 240px; min-width: 0;
}
/* The role picker and its button read as one control, so they sit together
   and neither of them stretches. */
.person-role { display: flex; gap: 6px; align-items: center; margin: 0; }
.person-role select { width: auto; min-width: 120px; }
.person-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.person-actions form { margin: 0; }
/* The sentence explaining why a row's controls are switched off. It takes the
   whole width under the row, because it is about the row rather than about any
   one control in it. */
.person-why { flex: 1 1 100%; margin: 0; }
.person-role-choice { border: 0; padding: 0; margin: 0 0 4px; }
.person-role-choice legend {
  padding: 0 0 6px; font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
}
/* One role per line, with what it means beside it. This used to borrow the
   preferences menu's .pref-choice, which is now a segmented control - and
   what belongs here is the other shape: two long answers that need a sentence
   each, on a page somebody has gone to on purpose. */
/* .form label FURTHER UP THIS FILE SETS A COLUMN, and it is a class and an
   element where this was a class alone - so it won, and the dot sat on a line
   of its own above the words it belongs to. Said with the form in front of it,
   which is where this label actually lives. */
.form .person-role-option,
.person-role-option {
  display: flex; flex-direction: row; align-items: flex-start; gap: 9px;
  padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 14px;
}
.person-role-option:hover { background: var(--input); }
.person-role-option input {
  width: auto; flex: 0 0 auto; margin: 3px 0 0; accent-color: var(--accent);
}
.person-role-option > span { display: flex; flex-direction: column; gap: 1px; }
/* The role is the label and the line under it is the explanation, so only one
   of the two is in the heavier weight the form's labels are drawn in. */
.person-role-option .muted-sm { margin-top: 1px; font-weight: 400; }

/* REMOVING SOMEBODY IS NOT A RED BUTTON SHOUTING FOR ATTENTION. It is an
   ordinary button that turns the app's alarm colour when you are actually
   pointing at it - the same treatment "Delete this gig" gets. */
/* ---------- THE CLIENT'S BAR ----------
   One row across the top: the name of the app, and the account row at the far
   end. There is nothing else in it, which is the point - this is a page about
   one event, not a back office.

   Joel's side has no bar at all now, so this is the only thing in the app
   that is still a header, and it is only ever drawn for a client or for
   somebody who has not signed in yet. */
.site-header {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 24px;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand {
  font-size: 19px; font-weight: 700; letter-spacing: -.02em; color: var(--ink);
}
.brand:hover { text-decoration: none; color: var(--accent); }
.header-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
/* The account row in a bar is as wide as its own contents, not as wide as the
   bar - which is what it is in the column down the left. */
.site-header .acct-row { max-width: 220px; }
.site-header .acct-name { flex: 0 1 auto; }

/* ---------- A client's list of events ----------
   A list, deliberately, where Joel's side of the app uses a table. A table is
   right for fifty gigs you are scanning down; two events belonging to one
   person are not a dataset, and drawing them in ruled rows with column
   headings makes somebody's wedding look like a spreadsheet entry. */
.event-list { list-style: none; margin: 0; padding: 0; }
.event {
  display: flex; flex-wrap: wrap; gap: 4px 28px;
  padding: 14px 0; border-top: 1px solid var(--line);
}
.event:first-child { border-top: none; padding-top: 4px; }
/* The date column is fixed-width so several events line up down the page,
   and allowed to shrink on a phone rather than forcing a sideways scroll. */
.event-when { flex: 0 1 190px; min-width: 150px; }
.event-what { flex: 1 1 220px; }
.event strong { display: block; font-weight: 600; }

.past-events { margin-top: 16px; }
.past-events > summary {
  cursor: pointer; padding: 6px 0;
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
}
.past-events > summary:hover { color: var(--ink); }
.past-events[open] > summary { margin-bottom: 4px; }

/* ---------- "This part is coming" ----------
   The notice colours rather than the error ones: nothing is wrong here, and
   an empty card with no explanation is what would look like something being
   broken. */
.coming-soon {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--notice-line); border-radius: 8px;
  background: var(--notice-bg); color: var(--notice-ink);
}

/* ---------- "That's somebody you already have" ----------
   Neither an error nor a confirmation, and it should look like neither. Red
   would tell Joel he did something wrong, and he didn't - he typed the person
   he meant. Green is the app's "that worked", and nothing has been saved.

   So it borrows the reporting page's .range-statement treatment instead: a
   plain panel with an accent rule down the side, which is what this app
   already uses to say "here is a fact about what you are looking at". */
.match-notice {
  margin: 0 0 16px;
  padding: 10px 14px;
  max-width: 640px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--panel);
}

/* ============================================================
   "you are not really this client"
   Drawn by views/partials/header.ejs and views/view-as/index.ejs,
   for an admin who is looking at Soundcheck through one of their
   clients' eyes. IT IS ON THE LIVE SITE NOW, which is why it
   matters more than it used to: the form on the other side of it
   is somebody's real planning, not test data on a laptop.

   EVERY COLOUR HERE IS ONE OF THE VARIABLES AT THE TOP OF THIS
   FILE, so it is right in dark and in light with no second copy
   of anything - and the one pair it depends on, --error-ink on
   --error-bg, is already measured in test/contrast.test.js.
   ============================================================ */

/* ---------- The banner ----------
   It has one job: to be impossible to miss and impossible to mistake for
   part of Soundcheck. Three things do that at once, and no ordinary portal
   content does any of them:

     - the app's ERROR colours, which the client's side never otherwise uses;
     - capital letters on the flag, which nothing else on that side uses;
     - it STICKS to the top of the window, so scrolling down a long page of
       somebody else's details never leaves it behind.

   Sticky rather than fixed: fixed would sit on top of the first line of the
   page underneath it, and this belongs in the flow above the header. */
.view-as-banner {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px;
  margin: 0; padding: 10px 24px;
  background: var(--error-bg);
  border-bottom: 3px solid var(--error-line);
  color: var(--error-ink);
  font-size: 14px; line-height: 1.4;
}
.view-as-flag {
  flex: 0 0 auto;
  padding: 2px 8px; border-radius: 5px;
  border: 1px solid var(--error-line);
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .09em;
}
.view-as-said { flex: 1 1 260px; }
.view-as-banner form { flex: 0 0 auto; margin: 0; }
/* Shorter than a normal .btn - this is a bar, not a toolbar - and drawn in
   the banner's own ink so it reads as part of the warning rather than as a
   button that happened to land in it. */
.view-as-back {
  min-height: 30px; padding: 0 12px;
  background: transparent;
  border-color: var(--error-ink); color: var(--error-ink);
  font-weight: 600;
}
.view-as-back:hover { background: var(--error-ink); color: var(--error-bg); border-color: var(--error-ink); }

/* ---------- The list of people to be ----------
   The warning at the top of it says what is on the other side of the button:
   somebody's real Soundcheck. It borrows the banner's colours, because it is
   the same fact said a moment earlier. */
.view-as-warning {
  margin: 0 0 20px; padding: 10px 14px; max-width: 720px;
  border: 1px solid var(--error-line); border-radius: var(--radius);
  background: var(--error-bg); color: var(--error-ink);
  font-size: 14px;
}
.view-as-warning code {
  background: var(--code-bg); color: var(--ink);
  padding: 1px 5px; border-radius: 4px; font-size: 12px;
}

.view-as-list { list-style: none; margin: 0; padding: 0; }
.view-as-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.view-as-row:first-child { border-top: none; padding-top: 2px; }
.view-as-who { flex: 1 1 260px; }
.view-as-who strong { display: block; font-weight: 600; }
.view-as-row form { margin: 0; }
.view-as-current { color: var(--muted); font-size: 13px; }

/* ============================================================
   THE PLANNING FORM
   Drawn by views/partials/plan-form.ejs, on three pages: the
   client's form in Soundcheck, Joel's copy on the gig page, and
   the preview in the question editor.

   EVERY COLOUR HERE IS ONE OF THE VARIABLES AT THE TOP OF THIS
   FILE. Not one new hex value, which is what keeps these pages
   right in dark and light without a second copy of anything -
   and what puts them inside test/contrast.test.js, which already
   measures the pairs they are built from.

   THE PHONE IS THE PRIMARY DEVICE. Somebody is filling this in
   at eleven at night, in bed, on a small screen. So: one column
   everywhere, nothing that scrolls sideways, boxes at least as
   tall as a fingertip, and 16px type in every field - anything
   smaller makes iOS zoom the page on focus, which is how you
   lose your place in a long form.
   ============================================================ */

.plan-form { display: block; max-width: none; }

.plan-section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px 16px; flex-wrap: wrap;
}
/* The section heading is a heading here rather than the app's small muted
   label: on this page it is the thing that tells you where you are in a very
   long form, and it has to be findable while scrolling past at speed. */
.plan-section > .plan-section-head h2 {
  margin: 0 0 4px;
  font-size: 17px; text-transform: none; letter-spacing: 0;
  color: var(--ink); font-weight: 700;
}
/* Answered out of asked. A count, deliberately, and never a warning: a blank
   is a perfectly good answer to any of these, so nothing here goes red or
   nags, and it is drawn in the quietest ink on the page. */
.plan-progress { margin: 0; font-size: 12px; color: var(--muted); white-space: nowrap; }

.plan-intro {
  margin: 0 0 14px; padding-left: 12px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

/* "I don't ask this any more, but what you said is still here." */
.plan-retired-note {
  margin: 0 0 14px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--muted); font-size: 13px;
}

.plan-question { padding: 14px 0; border-top: 1px solid var(--line); }
.plan-question:first-of-type { border-top: none; }
.plan-question.is-retired { opacity: .92; }

.plan-field { display: flex; flex-direction: column; gap: 6px; }
.plan-label { font-size: 15px; font-weight: 600; color: var(--ink); }
.plan-helper {
  display: block; font-size: 13px; font-weight: 400; color: var(--muted);
  margin: 0 0 2px;
}

/* A retired question is still perfectly readable - somebody has to be able to
   change their answer to it - so this is a quiet label rather than a strike
   through or a grey-out. */
.plan-retired-flag {
  display: inline-block; margin-left: 6px; padding: 1px 7px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg); color: var(--muted);
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  vertical-align: 1px;
}

.plan-question input[type="text"],
.plan-question textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--input); color: var(--ink);
  /* 16px, not 15px: anything smaller makes iOS zoom the page when the box is
     focused, and a page that jumps every time you tap a field is a page
     nobody finishes. */
  font: 16px/1.5 inherit; font-family: inherit;
  min-height: var(--control-h);
}
.plan-question textarea { resize: vertical; }

/* ---------- Pick one ---------- */
.plan-choice { border: none; margin: 0; padding: 0; min-width: 0; }
.plan-choice > legend { padding: 0; }

.plan-option {
  display: flex; align-items: center; gap: 10px;
  /* Tall enough to hit with a thumb without aiming. */
  min-height: 40px; padding: 4px 0;
  cursor: pointer;
}
.plan-option input[type="radio"] { width: 18px; height: 18px; margin: 0; flex: 0 0 auto; }
.plan-option > span { font-size: 15px; }
/* The way back out of a radio group. Quieter than the real choices, because
   it is not one of them - it is how you take an answer back. */
.plan-option-blank > span { color: var(--muted); font-size: 13px; }

.plan-other { margin-top: 4px; }

/* ---------- Save, and the line that says it saved ---------- */
.plan-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 20px;
}
/* Written by public/app.js, and empty unless a save has actually FAILED -
   success is said beside the answer instead, by .plan-saved below. */
.plan-status { font-size: 13px; color: var(--muted); }
.plan-status.is-problem { color: var(--danger); }

/* ---------- The quiet "Saved", beside the answer ---------- */

/* THE THING YOU NOTICE ONCE AND THEN STOP NOTICING.

   Absolutely positioned, so it costs no room and takes none: it can appear
   and go again without a single pixel of the page moving. That is the whole
   requirement - anything that reflows the paragraph somebody is reading is
   worse than saying nothing.

   It fades rather than blinking out, and it never animates in: arriving
   quietly and leaving quietly is what makes it possible to ignore. */
.plan-question { position: relative; }
.plan-saved {
  position: absolute; top: 2px; right: 0;
  font-size: 12px; color: var(--muted);
  opacity: 0; transition: opacity var(--swing) ease;
  pointer-events: none;
}
.plan-saved.is-shown { opacity: 1; }
.plan-saved.is-shown::before { content: "✓ "; }

/* Somebody who has asked for less movement gets none: it is simply there or
   not there. */
@media (prefers-reduced-motion: reduce) {
  .plan-saved { transition: none; }
}

/* What the page says after a plain form post - the no-JavaScript path. */
.plan-said {
  margin: 0 0 20px; padding: 10px 14px;
  border: 1px solid var(--notice-line); border-radius: var(--radius);
  background: var(--notice-bg); color: var(--notice-ink);
}

.plan-preamble p { margin: 0 0 10px; }
.plan-preamble p:last-child { margin-bottom: 0; }
.plan-count { color: var(--muted); }
.plan-sent {
  padding: 10px 14px;
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius); background: var(--bg);
}

.plan-send p { margin: 0 0 12px; }
.plan-send h2 { margin-top: 0; }

/* ---------- "THIS ANSWER CHANGED", ON JOEL'S COPY OF A FORM ----------

   A line under an answer the client has changed since they sent the form.
   Two kinds, told apart by more than colour - the words differ too:

     .is-unsent   changed, and not sent to him yet. The amber a gig that is
                  still only an inquiry wears: not settled.
     .is-new      one of the answers their last update changed. The accent's
                  own soft wash: this is what to read.

   Both pairs of colours are ones the app already draws text on and that
   test/contrast.test.js already measures, in both themes. */
.plan-moved {
  margin: 8px 0 0; padding: 6px 10px;
  border-radius: var(--radius-control);
  font-size: 13px; line-height: 1.4;
}
.plan-moved.is-unsent { background: var(--inquiry-bg); color: var(--inquiry-ink); }
.plan-moved.is-new { background: var(--soft); color: var(--on-soft); }
.plan-moved q { font-style: normal; }
/* The same fact in the one-line summary over the form. */
.plan-unsent-note { color: var(--inquiry-ink); font-weight: 600; }
.plan-flag { margin-top: 14px; }
.plan-flag > summary {
  cursor: pointer; font-size: 13px; color: var(--muted); padding: 4px 0;
}
.plan-flag > summary:hover { color: var(--ink); }
.plan-flag form { margin-top: 8px; display: flex; flex-direction: column; gap: 10px; }
.plan-flag textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--input); color: var(--ink);
  font: 16px/1.5 inherit; font-family: inherit;
}
.plan-flag .btn { align-self: flex-start; }

/* The way in to the form, on each event in the client's list. */
.event-plan { flex: 0 0 auto; display: flex; flex-direction: column; gap: 4px; }
/* On an event's own page it is a card's content rather than the end of a row,
   so it keeps its own width instead of stretching across the card. */
.card > .event-plan { align-items: flex-start; }

/* ON A PHONE IT TAKES THE WHOLE WIDTH, which is the one place in this
   stylesheet that asks how wide the window is. Everything else here wraps on
   its own and looks right at any size; this does too, and looking right is
   not the standard for the single thing a client came to press. A button
   sitting at its natural width under a wrapped event reads as a footnote to
   the line above it. The rest of the page is unchanged - this rule only ever
   touches the one button. */

/* ---------- What has changed ---------- */
.plan-history { list-style: none; margin: 0; padding: 0; }
.plan-history li {
  display: flex; flex-wrap: wrap; gap: 2px 16px;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.plan-history li:first-child { border-top: none; padding-top: 2px; }
.plan-history-when { flex: 0 1 170px; color: var(--muted); font-size: 13px; }
.plan-history-what { flex: 1 1 240px; }
.plan-history-who { flex: 1 1 100%; color: var(--muted); font-size: 12px; }

/* ---------- EVERY CHANGE TO THIS RECORD ----------
   The one list on a gig and on a client - answers, status, details and venue
   together. Laid out like the client's own list of her changes above, because
   they are the same kind of reading.

   EACH LINE LEADS WITH WHAT KIND OF CHANGE IT WAS, in the ordinary ink and
   weight of a label, then what it was about, then from and to on a line of
   their own - so running an eye down the left edge of the list is enough to
   find "the status changes" or "the answers".

   Each line WRAPS rather than shrinking on a narrow screen: the time, then
   what changed, then who did it, stacking on a phone instead of squeezing
   into three columns too thin to read. */
.change-list { list-style: none; margin: 0; padding: 0; }
.change {
  display: flex; flex-wrap: wrap; gap: 2px 14px;
  padding: 8px 0; border-top: 1px solid var(--line);
}
.change-list:first-of-type .change:first-child { border-top: none; padding-top: 2px; }
.change-when {
  flex: 0 1 170px; color: var(--muted); font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.change-what { flex: 1 1 240px; min-width: 0; font-size: 14px; }
.change-kind { font-weight: 700; }
.change-kind + .change-field::before { content: " \00b7  "; color: var(--muted); font-weight: 400; }
.change-values { display: block; overflow-wrap: anywhere; }
.change-nothing { color: var(--muted); font-style: normal; }
.change-who { flex: 1 1 100%; color: var(--muted); font-size: 12px; }

/* THE TWO ENDS OF A CORRECTION. Marked rather than left to be inferred: a
   change and the undo of it would otherwise read as two people disagreeing.
   The accent edge is the same one the held row on the gig list uses - "this
   line is connected to another one" in both places. */
.change.is-correction { border-left: 3px solid var(--accent); padding-left: 10px; }
.change-correction, .change-corrected {
  display: block; font-size: 12px; color: var(--muted);
}
.change-fold > summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 8px 0; }
.change-fold > summary:hover { color: var(--ink); }
.change-note { margin: 10px 0 0; }

/* The planning form's own heading on Joel's gig page, which is a second h1 on
   a page that already has one. Sized down so it reads as a divider between
   two halves of the page rather than as a second title. */
.plan-heading { font-size: 19px; }

/* ON OR OFF, beside the questionnaire's heading on a gig. A small pill in the
   shape of the "no longer asked" label, so it reads as a state rather than a
   button: On in the accent, Off quiet - off is the exception, and the card
   under it is what says so in words. */
.q-state {
  display: inline-block; margin-left: 8px; padding: 1px 9px; vertical-align: middle;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}
.q-state.is-on { border-color: var(--accent); color: var(--accent); }
.q-state.is-off { background: var(--bg); color: var(--muted); }
.q-off p { margin: 0 0 6px; }
.q-off p:last-child { margin-bottom: 0; }

/* ============================================================
   "NEEDS A LOOK", ON THE DASHBOARD
   ============================================================

   Everything anybody is still disputing, across every client
   and every gig, in the alarm colours, above the year's
   figures. The figures are what happened; this is what has not.

   IT BORROWS THE DISPUTED CARD'S OWN COLOURS rather than
   inventing a second alarm shape, because it is the same fact
   said in a second place: a flag on the dashboard and a flag on
   the gig it belongs to must look like one thing, or Joel has
   two kinds of urgent to learn. See .gig-flags.has-open.
   ============================================================ */
/* THE SAME THREE PROPERTIES THE DISPUTED CARD ON A GIG CARRIES, written out
   rather than borrowed, because the two are not the same element and a shared
   class would mean one of them owning the other's shape. A flag on the
   dashboard and the same flag on the gig it belongs to have to look like one
   thing, or Joel has two kinds of urgent to learn - and a one-pixel border in
   a pale alarm colour was not it: in light mode it reads as an ordinary card.
   See .gig-flags.has-open. */
.needs-a-look {
  border-color: var(--error-line);
  border-left: 4px solid var(--danger);
  background: var(--error-bg);
}
.needs-a-look h2 { color: var(--error-ink); }
.needs-a-look .look-meta { color: var(--error-ink); }
.look-list { list-style: none; margin: 0; padding: 0; }
.look {
  display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap;
  padding: 12px 0; border-top: 1px solid var(--error-line);
}
.look:first-child { border-top: 0; padding-top: 0; }
.look-said { flex: 1 1 280px; min-width: 0; }
.look-said p { margin: 0; }
.look-who { font-size: 13px; color: var(--danger); }
/* Their own words, so they are drawn as a quotation and not as the app's own
   voice - the same treatment they get on the record they were said on. */
.look-quote { font-weight: 600; overflow-wrap: break-word; }
.look-meta { font-size: 13px; color: var(--muted); }
/* The button does not shrink: "Open" is the one thing on the row that has to
   stay pressable however long somebody's sentence was. */
.look > .btn { flex: 0 0 auto; }

/* ============================================================
   THE QUESTIONNAIRE AS A CARD, ON THE GIG
   ============================================================

   The whole form used to be here. What is here now is four
   things: a switch, a sentence, a bar and two buttons. See the
   long note in views/gigs/show.ejs.
   ============================================================ */
.q-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.q-card-head h2 { margin: 0; }
.q-card-line { margin: 0; }

/* ---------- THE SWITCH ----------

   A REAL CHECKBOX, DRAWN AS THE SLIDER EVERY PHONE HAS. The box itself is
   moved off screen rather than hidden, so the keyboard still reaches it, Space
   still works it, and a screen reader still says "on" and "off" - which is the
   whole reason it is not a button with a word painted on it.

   THE RING GOES ON THE TRACK, because the box it would have gone on is one
   clipped pixel somewhere else. :has() on the label, which is how a parent is
   drawn from the state of the thing inside it.

   44px OF TRACK AND A 20px KNOB, which is the shape a phone has taught
   everybody to read. The knob travels; nothing else moves. */
.q-switch-form { display: flex; align-items: center; gap: 10px; margin: 0; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch > input {
  position: absolute; width: 1px; height: 1px; margin: 0; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.switch-face {
  position: relative; flex: 0 0 auto;
  width: 44px; height: 26px; border-radius: 999px;
  background: var(--input); border: 1px solid var(--line);
  transition: background-color var(--beat) ease, border-color var(--beat) ease;
}
.switch-face::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 999px;
  background: var(--panel); box-shadow: 0 1px 3px var(--shadow);
  transition: transform var(--beat) var(--ease);
}
.switch > input:checked + .switch-face {
  background: var(--accent); border-color: var(--accent);
}
.switch > input:checked + .switch-face::after { transform: translateX(18px); }
.switch:hover .switch-face { border-color: var(--muted); }
.switch:has(> input:focus-visible) .switch-face {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
html[data-input="mouse"] .switch:has(> input:focus-visible) .switch-face { outline: none; }
.switch-words { font-size: 13px; color: var(--muted); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  .switch-face, .switch-face::after { transition: none; }
}

/* ---------- HOW FAR THROUGH, DRAWN ----------
   The sentence above the bar says the numbers; this says the shape of them,
   which is what the eye reads first. The accent, because it is a measure of
   the thing the page is about rather than a warning or a success. */
.q-bar {
  height: 6px; border-radius: 999px;
  background: var(--input); overflow: hidden;
}
.q-bar > span {
  display: block; height: 100%; border-radius: 999px;
  background: var(--accent);
  transition: width var(--swing) var(--ease);
}
@media (prefers-reduced-motion: reduce) { .q-bar > span { transition: none; } }

/* ---------- THE WAY BACK, BY NAME ----------
   Above the title on a page somebody arrived at from one particular record,
   carrying that record's own name - which is the difference between "back" and
   "back to the thing I was looking at". */
.back-link { margin: 0 0 4px; font-size: 13px; }
.back-link a { color: var(--muted); }
.back-link a:hover { color: var(--accent); }

/* ---------- ANSWERED, OR STILL BLANK ----------
   AN ANSWERED QUESTION CARRIES A RULE DOWN ITS LEFT EDGE, in the accent, on
   Joel's copy and on the client's own. It was Joel's alone: the worry was
   that marking a client's form was nagging. But what was marked there would
   have been the BLANKS, and this marks the opposite - what they have done -
   which is the same thing the count at the top of their page already says in
   numbers. So the two now agree: every question with the rule is one of the
   "12 of 48 answered", on both sides, and the client sees on their form what
   Joel sees on his.

   On the client's side the rule is purple whatever accent Joel has picked,
   because everything on their side is - see accentFor in src/accents.js.

   WHAT STAYS JOEL'S ALONE is the other half: a blank question's label dropping
   to the muted ink. That one IS about what is missing, and telling somebody
   which of their answers are missing every time they open the page is the
   nagging the first version of this note was written against.

   It follows what is on the page rather than what was on it when it loaded:
   public/app.js rewrites data-answered as an answer is typed, so the mark
   appears the moment the answer does. */
.plan-form [data-plan-question][data-answered="yes"] {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
}
.plan-form[data-plan-mode="owner"] [data-answered="no"] .plan-label { color: var(--muted); }

/* ============================================================
   PICKING A TIME, AND PICKING A DATE
   The start and end boxes on the gig form, and the date and
   time answers on the planning form. Underneath each one is a
   plain text box that still takes a typed value; everything
   here is the panel public/app.js hangs beside it, and none of
   it exists until app.js builds it.
   ============================================================ */

.timebox, .datebox { position: relative; display: flex; align-items: stretch; }
.timebox > input, .datebox > input { flex: 1 1 auto; min-width: 0; }

/* THERE IS NO LITTLE ARROW ON THE END OF A TIME BOX, and its absence is the
   point rather than a tidy-up. A chevron at the right-hand edge that was the
   only thing which opened the list taught people that the box had one
   clickable spot in it - so most of them never opened the list at all. The
   whole field opens it now, and an affordance for something the whole field
   already does is a second thing to explain. The padding that used to keep
   text clear of the chevron went with it.

   A DATE BOX HAS A CALENDAR IN IT, AND THAT IS NOT THE SAME DECISION. The
   reasoning above is about a CHEVRON, which is a drawing that means "there is
   more of this here" and nothing more - and the fault it describes is that it
   was the only way in. A calendar is different in both halves: it says what
   KIND of thing the box is, which "Jun 12, 2026" in grey placeholder text
   only says to somebody who reads it, and the whole field still opens the
   month, so nothing has been taken away from anybody. Joel reported the
   silence - "date boxes give no hint that they open a calendar" - and this is
   the hint. A time box is left alone: the two are not the same complaint, and
   a clock face on a box that already says "6pm" would be the chevron again.

   ---------- THE CALENDAR ----------

   Inside the box rather than beside it, so the pair reads as one control; at
   the right-hand end, where every date control anybody has used puts it; in
   the muted ink, so it is a sign rather than a button, and in the full ink
   while the pointer is on it so that it is plainly pressable.

   THE TEXT IS KEPT CLEAR OF IT by padding on the input rather than by making
   the box wider, because the width of a date box is a decision already made
   - see --field-date - and "Wednesday, September 30, 2026" typed out in full
   is the longest thing that ever goes in one.

   AND THE BROWSER'S OWN CALENDAR COMES OFF THE TWO NATIVE BOXES. Only when
   ours is there: .datebox-native is put on by public/app.js, so with no
   script there is no class, the rule does not match, and the browser's own
   mark is exactly where it has always been.

   ---------- AND A TIME BOX HAS A CLOCK IN IT NOW ----------

   The paragraph above used to end "a time box is left alone: a clock face on
   a box that already says 6pm would be the chevron again". That was right
   about the CHEVRON and wrong about the clock, for the same reason the
   calendar was right: the mark says what kind of thing the box is, which grey
   placeholder text only says to somebody who reads it, and the whole field
   still opens the panel so nothing has been taken away. The two boxes sit
   side by side on the gig form - Date, Start time, End time - and one with a
   mark in it beside two without read as two different kinds of field.

   It is the same shape, the same size and the same place as the calendar, so
   the pair of them are plainly the same idea. */
.datebox-open, .timebox-open {
  position: absolute; right: 1px; top: 1px; bottom: 1px;
  width: 34px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 0 var(--radius-control) var(--radius-control) 0;
  background: none; color: var(--muted); cursor: pointer;
  transition: color var(--blink) ease;
}
.datebox-open svg, .timebox-open svg { width: 16px; height: 16px; }
.datebox-open:hover, .timebox-open:hover { color: var(--ink); }
/* THE CARET MUST NOT RUN UNDER IT. 34px for the icon and a little air.

   NAMED THREE TIMES, AND THAT IS NOT A MISTAKE. Two places in this file give
   a date box its padding with a heavier selector than `.datebox > input` -
   the planning form's answers, and the deposit's little inline form - so a
   single rule here would quietly lose to them and the date would be typed
   underneath the calendar in exactly those two places. It was, and it was
   measured. They are written out rather than fixed with !important, because
   what is being said is "these three, and here is where they are". */
.datebox > input,
.plan-question .datebox > input,
.deposit-state .datebox > input,
.timebox > input,
.plan-question .timebox > input { padding-right: 38px; }
.datebox-native input[type="date"]::-webkit-calendar-picker-indicator {
  display: none;
}
/* Safari on a Mac draws a stepper on a date control as well, which is one
   more thing in the corner ours is in. */
.datebox-native input[type="date"]::-webkit-inner-spin-button { display: none; }


/* ---------- THE PANEL BOTH CONTROLS HANG IN ----------
   One shape for the time picker and the month, because they are the same idea
   and appear on the same form, and two panels that looked different would
   read as two different kinds of thing. */
.timepick, .datebox-panel {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 40;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 10px 30px var(--shadow);
}
.timepick[hidden], .datebox-panel[hidden] { display: none; }
/* THE TWO PANELS THAT ARE NOT A <details>. Every menu in the app opens with a
   short fade, and these were the ones left snapping into place, because they
   are unhidden by script rather than by a fold being opened. Same keyframes,
   same length - see A MENU DROPS IN further up this file. They are only ever
   opened by pressing the box or the little mark in it, so there is nothing
   here that could get in the way of typing. */
.timepick:not([hidden]), .datebox-panel:not([hidden]) {
  animation: menu-drop var(--beat) ease-out; transform-origin: top;
}
@media (prefers-reduced-motion: reduce) {
  .timepick:not([hidden]), .datebox-panel:not([hidden]) { animation: none; }
}

/* ---------- EVERY QUARTER HOUR, IN ONE COLUMN ----------

   IT WAS A GRID - an hour, a minute and AM/PM as three blocks of squares -
   and Joel said what that was: "ugly and hard to use". A time is one
   decision and the grid made it three.

   SO IT IS A LIST, the way a calendar's time dropdown is. As wide as the box
   it hangs from, about eight rows tall, and it scrolls. Nothing in it but
   times: no heading, no Clear, no Done. Which rows are in it, and which one
   it opens on, is public/app.js's doing; what is here is the drawing.

   overscroll-behavior IS THE LINE THAT MATTERS ON A PHONE. Without it, a
   flick that reaches midnight or 11:45 carries on into the page, and the
   form slides away under the list somebody is trying to read. */
.timepick {
  min-width: 100%; width: max-content;
  max-height: 264px; overflow-y: auto; overscroll-behavior: contain;
  padding: 4px;
  /* Its own scrolling box, so a row's place in it is measured from its top. */
  -webkit-overflow-scrolling: touch;
}
/* WHEN THERE IS NO ROOM UNDERNEATH - the last field of a form, near the foot
   of the window - it opens above the box instead. Decided by the script each
   time it opens; see faceTheRoom. */
.timebox.opens-up > .timepick {
  top: auto; bottom: calc(100% + 4px); transform-origin: bottom;
}
.tp-row {
  display: flex; align-items: center;
  min-height: 32px; padding: 0 10px;
  border-radius: 6px;
  color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums;
  white-space: nowrap; cursor: pointer;
  user-select: none; -webkit-user-select: none;
}
/* THE ROW THE ARROW KEYS OR THE POINTER ARE ON - the same wash a menu row
   takes, and the one Enter would pick. One highlight for both, moved by
   whichever was used last, so there are never two lit rows. */
.tp-row.is-active { background: var(--focus-field); }
/* AND THE TIME THAT IS ALREADY IN THE BOX, in the accent - a different thing
   from where the highlight is, and still findable after it has moved on. */
.tp-row[aria-selected="true"] { color: var(--accent); font-weight: 600; }

/* ---------- A LONG LIST YOU CAN SEARCH ----------

   "Pick one from a long list" on a questionnaire. The same box-and-list the
   time picker is - .timebox and .timepick, above - with a chevron where the
   clock is and rows that are whatever the question's choices are. So what is
   here is only what differs.

   AS WIDE AS THE ANSWER BOXES AROUND IT, where a time box is narrow: these
   rows are sentences, not "6:15 PM". And a long choice wraps onto a second
   line rather than running out of the side of the list. */
.plan-question .listbox { max-width: none; }
.listbox > .listbox-input { flex: 1 1 auto; min-width: 0; padding-right: 38px; }
.listpick { width: 100%; }
.listpick .tp-row { white-space: normal; padding-top: 6px; padding-bottom: 6px; line-height: 1.3; }
/* "Not answered" - the way back to no answer - is quieter than an answer. */
.listpick .tp-blank { color: var(--muted); }
/* What the list says when the letters typed are in none of the choices. Not
   a row to pick: no pointer, no highlight. */
.listpick .tp-none { color: var(--muted); cursor: default; }
/* THEIR OWN WORDS, UNDER THE LIST. With no script this box is simply there.
   With script it is hidden until "Something else" is what is picked - the
   script sets `hidden`, and this is the gap between the list and the box. */
.plan-other-for-list { margin-top: 8px; }

/* WHAT THIS LIST DOES ON A PHONE is in the one @media at the foot of this
   file, with everything else that happens at 700px: taller rows. */

/* ---------- A MONTH AT A TIME ---------- */

/* The calendar hanging under a date box. It is deliberately the same shape as
   the time list - same offset, same panel, same shadow - because they are the
   same idea and appear on the same form, and two panels that looked different
   would read as two different kinds of thing. */
.datebox-panel { padding: 10px; width: max-content; }

.datebox-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 8px;
}
.datebox-month { font-size: 14px; font-weight: 600; }
.datebox-step {
  width: 30px; height: 30px; padding: 0; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--input); color: var(--ink); font: inherit; cursor: pointer;
}
.datebox-step:hover { border-color: var(--focus-line); }

.datebox-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
}
.datebox-dayname {
  font-size: 11px; color: var(--muted); text-align: center; padding: 2px 0;
}
.datebox-day {
  /* A thumb's worth of target, for the same reason the time rows are. */
  min-width: 34px; min-height: 34px; padding: 0;
  border: 1px solid transparent; border-radius: 8px;
  background: none; color: var(--ink); font: inherit; font-size: 14px;
  cursor: pointer;
}
.datebox-day:hover { background: var(--focus-field); }
.datebox-day.is-empty { visibility: hidden; cursor: default; }
.datebox-day.is-today { border-color: var(--line); font-weight: 600; }
.datebox-day.is-on {
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
}

/* ============================================================
   THE QUESTION EDITOR
   Joel's, and only ever Joel's. Same rule as everything above:
   not one colour here that is not already a variable.
   ============================================================ */

/* ---------- ONE QUESTIONNAIRE: THE FORM, AND A RAIL BESIDE IT ----------

   The form on the left and everything that acts on the WHOLE questionnaire on
   the right, out of the way of editing: Preview at the top, Remove all
   questions at the very bottom. On a phone the rail comes apart - Preview
   above the form, Remove all after it - by naming the two ends as areas. */
.qe-page {
  display: grid; gap: 0 28px;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "main top" "main foot";
  grid-template-rows: auto 1fr;
}
.qe-main { grid-area: main; min-width: 0; }
/* The rail's two ends are placed straight into the grid, so each can sit at
   its own end of the column. */
.qe-rail { display: contents; }
.qe-rail-top { grid-area: top; padding-top: 2px; }
.qe-rail-foot { grid-area: foot; align-self: end; padding-bottom: 32px; }

/* The heading carries the info mark on its own line, at the heading's size. */
.qe-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }

/* ---------- THE INFO MARK ----------

   A round "i" that opens a small panel - the same <details> with a floating
   panel that every menu here is, so app.js places it, shuts it on Escape or a
   click elsewhere, and it works with JavaScript off. Quiet until it is wanted:
   muted ink, lifting to the accent on hover or while open. */
/* ============================================================
   AN EXPLANATION, ONE PRESS AWAY
   ============================================================

   THE COMPLAINT: "ⓘ notes open on tap and on keyboard, not
   only on hover." A title attribute waits a second, is drawn
   in the system's font wherever the pointer happens to be, and
   never appears at all on a touch screen or for somebody using
   the Tab key - so a note written in one is a note most of the
   people it was written for will never read.

   SO IT IS A <details> WHOSE PANEL FLOATS, which is how every
   menu in this app is built: mouse, finger and keyboard, Escape
   to shut, placed so no edge cuts it off, and working with
   JavaScript off. See views/partials/info-note.ejs.
   ============================================================ */
.info-tip { position: relative; display: inline-flex; font-size: 14px; font-weight: 400; }
.info-tip > summary {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  color: var(--muted);
}
.info-tip > summary::-webkit-details-marker { display: none; }
.info-tip > summary:hover,
.info-tip[open] > summary { color: var(--accent); background: var(--input); }
.info-icon { width: 18px; height: 18px; }
.info-panel {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 25;
  width: max-content; max-width: min(380px, 88vw);
  padding: 12px 14px;
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px var(--shadow);
  color: var(--ink); line-height: 1.5;
}
.info-panel p { margin: 0 0 8px; }
.info-panel p:last-child { margin-bottom: 0; }
/* A MARK NEAR THE RIGHT-HAND EDGE hangs its panel off the other side, so a
   note in the last column of a table is not a note half off the screen. The
   placement in public/app.js would pull it back anyway; this means it does not
   have to. */
.info-tip-right > .info-panel { left: auto; right: 0; }
/* The mark sits on the line it explains rather than above it. 28px of circle
   beside 20px of text would push a table row taller on its own. */
td > .info-tip > summary, .tag + .info-tip > summary { width: 22px; height: 22px; }
td > .info-tip .info-icon, .tag + .info-tip .info-icon { width: 15px; height: 15px; }

/* ---------- A SMALL CONFIRMATION ----------

   The dashboard's pop-up lists' frame, at the size of a question: a heading,
   a line or two, and two buttons. The padding is on the inside so that a
   click on the dialog element itself can only be a click on the backdrop,
   which is what shuts it - see public/app.js. */
/* ONE SHAPE FOR EVERYTHING THAT ASKS FIRST: 400px, a 12px corner, 24px of
   room inside. Anything added later that stops and asks a question uses this
   rather than inventing a fifth size. */
.confirm-dialog {
  width: min(400px, calc(100vw - 32px));
  padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: var(--ink);
  box-shadow: 0 8px 24px var(--shadow);
}
/* Opened by the address rather than by a button - the no-JavaScript way - it
   is not modal, so it is pinned in the middle of the window by hand. */
.confirm-dialog[open]:not(:modal) { position: fixed; inset: 0; margin: auto; height: fit-content; z-index: 50; }
.confirm-body { padding: 24px; }
.confirm-body h2 { margin: 0 0 10px; }
.confirm-body p { margin: 0 0 4px; }
.confirm-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.qe-rule {
  margin: 0 0 20px; padding: 10px 14px; max-width: 720px;
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius); background: var(--panel);
}

/* ---------- THE SIX QUESTIONNAIRES ----------

   One row per kind of event, in one card, and the whole row is the link -
   half a row being clickable is the thing people find by accident. The row
   carries its own padding and the card gives up its own, so the hover fills
   the row edge to edge instead of stopping short of it. Three columns that
   line up down the list, because "how big is it" and "is anybody using it"
   are read by running an eye down them. On a phone the two counts drop under
   the name rather than squeezing it. */
.qe-sheets { padding: 0; max-width: 900px; overflow: hidden; }
.qe-sheet-list { list-style: none; margin: 0; padding: 0; }
.qe-sheet-list > li + li { border-top: 1px solid var(--line); }
/* The link fills the row; Edit - and Bring back on a retired one - sit at its
   end, outside it, because a button inside a link is two things pretending to
   be one. */
.qe-sheet-row { display: flex; align-items: center; }
.qe-sheet-row > .qe-sheet { flex: 1 1 auto; min-width: 0; }
.qe-sheet-actions { flex: 0 0 auto; display: flex; gap: 6px; padding-right: 14px; }
.qe-sheet-actions form { margin: 0; }
.qe-sheets.is-retired { border-style: dashed; }
.qe-sheets.is-retired .qe-sheet-name { color: var(--muted); }
/* ---------- A LIST JOEL KEEPS: EVENT TYPES, INQUIRY CHANNELS ----------
   The same card and the same row the questionnaires list uses, with one
   difference: the row is not a link. There is nowhere for an inquiry channel
   to lead, and an event type's questionnaire is a button of its own at the
   end of the row - so nothing here lights under the pointer as if it could be
   pressed. See views/manage/choices.ejs. */
.choice-main {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: baseline; gap: 4px 20px; flex-wrap: wrap;
  padding: 14px 18px;
}
.choice-main .qe-sheet-name { flex: 0 1 260px; min-width: 0; }
.qe-types-pointer { margin: 10px 2px 30px; max-width: 900px; }
/* Two classes, to beat .qe-add's own margin further down this file. */
.qe-add.qe-add-type { margin: -6px 0 30px; }
.qe-retired-head { margin: 0 0 4px; }
.qe-retired-note { margin: 0 0 10px; }
.qe-sheet {
  display: grid; align-items: center; gap: 4px 20px;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  padding: 14px 18px;
  color: var(--ink); text-decoration: none;
}
.qe-sheet:hover { background: var(--input); text-decoration: none; }
.qe-sheet:focus-visible { outline-offset: -3px; }
.qe-sheet-name { font-size: 16px; font-weight: 700; }
.qe-sheet-go { width: 8px; height: 12px; color: var(--muted); }
.qe-sheet:hover .qe-sheet-go { color: var(--accent); }

/* THE STRIP OF OTHER FORMS. The same control the preview already uses, one
   step quieter: it is a way back and forth between six things you are editing
   rather than a filter on what you are reading. */
.qe-switch { margin-bottom: 18px; }

/* "THIS IS ONLY A PRACTICE COPY", right above the preview's form. The same
   shape as the rule boxes on the editor's pages so it reads as part of the
   editor, one step louder - a full accent border rather than a stripe - and
   in ordinary ink, because it is the one sentence on the page that has to be
   read before anybody starts typing. */
.preview-note {
  margin: 0 0 16px; padding: 12px 16px; max-width: 720px;
  border: 1px solid var(--accent); border-left-width: 4px;
  border-radius: var(--radius); background: var(--panel); color: var(--ink);
}

/* ---------- THE LIBRARY ----------

   A list of wordings with one button each. It reads like the question list it
   feeds, on purpose - what a row here becomes is a row there - and the button
   is the loud one on the row because pressing it is the only thing this page
   is for. */
.qe-library-search {
  display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px; max-width: 720px;
}
.qe-library-search label { flex: 1 1 240px; display: flex; flex-direction: column; gap: 5px; }
.qe-library-search label > span { font-size: 13px; font-weight: 600; }
.qe-library-search input {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; background: var(--input); color: var(--ink); width: 100%;
}
/* Typed into, the list follows - so the button is only there without
   JavaScript, the same as Apply on the gig filters. */
.qe-library-search[data-auto-submit] .qe-library-go { display: none; }
/* Typed into, the list follows - so the button is only there without
   JavaScript, the same as Apply on the gig filters. */
.qe-library-search[data-auto-submit] .qe-library-go { display: none; }
.qe-library { list-style: none; margin: 0; padding: 0; }
.qe-library-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px 20px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.qe-library-row form { margin: 0; flex: 0 0 auto; }

.qe-section.is-retired { border-style: dashed; }

.qe-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px 20px; flex-wrap: wrap;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.qe-what { flex: 1 1 260px; min-width: 0; }
.qe-title {
  margin: 0 0 4px; font-size: 17px; font-weight: 700;
  text-transform: none; letter-spacing: 0; color: var(--ink);
}
.qe-intro { margin-top: 4px; }
.qe-helper { margin-top: 2px; }

/* Every button that acts on one section or one question, in one row that
   wraps onto its own line on a phone rather than squeezing the words beside
   it into a column two characters wide. */
/* flex: 0 1 auto, not 0 0 auto - the middle number is "may shrink", and
   without it this row took its full content width whatever the room, so its
   own flex-wrap never got a chance to do anything and a phone got nineteen
   pixels of sideways scroll. It still never shrinks when there IS room. */
.qe-actions {
  flex: 0 1 auto; min-width: 0;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.qe-actions form { margin: 0; }
/* The two groups wrap INSIDE themselves as well as beside each other. Six
   controls on one row - two arrows, Edit, Retire and sometimes Delete - is more
   than a phone has room for, and the pair that could not break was pushing the
   whole page nineteen pixels sideways. */
.qe-move, .qe-state { display: flex; gap: 6px; flex-wrap: wrap; }
/* Square, so the two arrows read as one control rather than as two buttons
   that happen to be next to each other. */
.qe-arrow { width: var(--control-h); padding: 0; font-size: 15px; }
.qe-arrow[disabled] { opacity: .4; cursor: default; }
.qe-arrow[disabled]:hover { border-color: var(--line); }

.qe-list { list-style: none; margin: 0; padding: 0; }

/* ============================================================
   EVERYTHING IS EDITED WHERE IT IS
   ============================================================

   Six pages collapsed into one. The pages are still there and
   still work with no JavaScript; what this draws is the slot
   their form is lifted into. See the long note in
   public/app.js.

   THE ROW'S OWN VIEW GOES WHILE THE EDITOR IS THERE, rather
   than the two sitting one above the other - a question drawn
   twice, once as words and once as a box with the same words
   in it, reads as two questions.
   ============================================================ */
.qe-editing { padding: 4px 0; }
.qe-editing[hidden] { display: none; }
[data-qe-row][data-editing] > .qe-view { display: none; }
/* A QUESTION ROW IS A FLEX ROW - the words on the left and the buttons on the
   right - so the slot has to be told to take the whole of what is left of it,
   or the editor is drawn in the column the buttons were in. The grip stays
   where it is, which is what keeps the row recognisable as the row. */
.qe-question > .qe-view,
.qe-library-row > .qe-view { flex: 1 1 260px; min-width: 0; }
.qe-question > .qe-editing,
.qe-library-row > .qe-editing { flex: 1 1 100%; min-width: 0; }
/* The view part is the flex row the row used to be: the words on the left, the
   buttons on the right. */
.qe-question > .qe-view,
.qe-library-row > .qe-view {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px 20px; flex-wrap: wrap;
}
/* THE FORM IS ALREADY A CARD on the page it came from, and it is now inside
   one - so it loses the card and keeps the room. An accent edge down the left
   says which row is being edited, which is the only thing the prototype's
   inline editor draws that the page's own form does not. */
.qe-editing > form,
.qe-editing > .detail-edit-photo {
  margin: 0; padding: 0 0 0 14px;
  border: 0; border-left: 3px solid var(--accent); border-radius: 0;
  background: none; box-shadow: none;
  max-width: none;
}
/* IT SLIDES IN, over the app's own short length, because the row it replaced
   was there a moment ago and a form that simply appears where a line of text
   was reads as the page jumping. */
@keyframes qe-reveal {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
.qe-editing:not([hidden]) > form,
.qe-editing:not([hidden]) > .detail-edit-photo { animation: qe-reveal var(--beat) ease-out; }
@media (prefers-reduced-motion: reduce) {
  .qe-editing:not([hidden]) > form,
  .qe-editing:not([hidden]) > .detail-edit-photo { animation: none; }
}
.qe-question {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px 20px; flex-wrap: wrap;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.qe-question.is-retired .qe-what > strong { color: var(--muted); }
.qe-flag {
  display: inline-block; margin-left: 6px; padding: 1px 7px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg); color: var(--muted);
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  vertical-align: 1px;
}
/* ---------- ADDING ONE, AT THE BOTTOM OF WHAT IT ADDS TO ----------

   Both of these used to be buttons ABOVE the thing they add to - "+ Section"
   in the top corner, "+ Question in this section" over that section's
   questions - and both were wrong in the same way. A new one appears at the
   END of the list, so a control at the top sends you looking in the wrong
   place, and a filled button competing with sixty questions is the loudest
   thing on a page about reading them.

   So: below, small, and quiet. A plus and one word, in the muted ink, which
   lifts to the accent when the mouse is on it. It is still a whole line and a
   comfortable tap target - quiet is not the same as fiddly. */
/* "+ Question" sits INSIDE a section card, under the questions it adds to.
   "+ Section" sits under the whole list and adds to that.

   THEY LOOKED THE SAME AND SAT FOUR PIXELS APART, which is how "Add section"
   went missing: after the last card there were two identical quiet links
   stacked on top of each other, and the outer one read as one more control
   belonging to the card above it. It has room of its own now, and a rule
   above it that says the list has ended - so it is plainly the thing you do
   after all the sections rather than something you do to the last one. Still
   small and still secondary: adding a section is rare, and reading the
   questions is what this page is for. */
.qe-add {
  margin: 14px 0 0;
  /* TWO WAYS TO ADD A QUESTION SIT HERE - write one, or copy one out of the
     library - and they are side by side because they end in the same thing.
     They wrap onto separate lines on a phone rather than being squeezed. */
  display: flex; align-items: center; gap: 4px 22px; flex-wrap: wrap;
}
.qe-add-section {
  margin: 26px 0 32px; padding-top: 20px;
  border-top: 1px solid var(--line);
}

.qe-add-link {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 34px; padding: 4px 2px;
  color: var(--muted); font-size: 14px; text-decoration: none;
}
.qe-add-link:hover { color: var(--accent); text-decoration: none; }
.qe-add-plus {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border: 1px solid var(--line); border-radius: 6px;
  font-size: 14px; line-height: 1;
}
.qe-add-link:hover .qe-add-plus { border-color: var(--accent); }

/* ---------- DRAGGING A ROW SOMEWHERE ELSE ----------

   An ADDITION to the arrow buttons and never a replacement - the arrows are
   the keyboard's way and the no-JavaScript way. Everything below is built by
   public/app.js, so with JavaScript off there is no handle and nothing that
   looks like one.

   BY FINGER AS WELL AS BY MOUSE, which is what touch-action: none on the grip
   buys: without it the phone takes a drag that starts on the grip and scrolls
   the page with it, and the row never moves. It is on the grip alone, so
   every other inch of the page scrolls exactly as it always did.

   TWO STATES AND TWO RULES. The row being carried LIFTS and nothing else
   changes; a thin line says where it will land, and only once it is being
   taken somewhere else. */

.drag-grip {
  flex: 0 0 auto; align-self: flex-start;
  width: 26px; min-height: 30px; margin-right: 2px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 15px; line-height: 1;
  cursor: grab;
  /* HOLDING IT PICKS THE ROW UP, AND DOES NOTHING ELSE. Without the -webkit-
     forms Safari went on treating a held finger here as the start of a text
     selection, with the magnifier and the copy bubble - see HOLD_MS in
     public/app.js, where a finger now has to rest here a moment before the
     row lifts. */
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  /* The page does not scroll from here - this is where a drag starts. */
  touch-action: none;
}
/* And nothing anywhere is selected while the grip is held, so a drag that
   wanders over a question's words carries the row rather than painting the
   words blue. Put on and taken off by public/app.js. */
html.is-holding-grip, html.is-holding-grip * {
  -webkit-user-select: none; user-select: none;
}
.drag-grip:active { cursor: grabbing; }
.drag-grip:hover { color: var(--ink); }

/* PICKED UP, AND THAT IS ALL THAT HAPPENS.

   The row rises off the page: a shadow under it and a shade larger, so it
   reads as held rather than as selected. It stays exactly where it is in the
   list, so no other row moves by a pixel and nothing reflows under the
   pointer.

   WHAT THIS REPLACED, written down so it does not come back. Picking a row up
   used to tilt it, shrink it, fade it to 55%, dim every other row in the list
   AND open a dashed gap underneath it - all before it had been dragged
   anywhere. The gap was the worst of it: it drew an answer to "where will
   this land" at the one moment the answer was "where it already is", and it
   pushed the page about under the thing being aimed at.

   The lift transitions IN. It does not transition out, because a dropped row
   is being animated to its new home by app.js at that moment and a second
   transition on the same transform would fight it - see flip() there. */
[data-drag-item] {
  transition: box-shadow var(--blink) ease;
}
[data-drag-item].is-dragging {
  transform: scale(1.015);
  box-shadow: 0 16px 36px var(--shadow);
  cursor: grabbing;
  /* Above its neighbours while it is over them, so a lifted row is never
     drawn underneath the row it is passing. */
  position: relative; z-index: 3;
  /* AND OPAQUE WHILE IT IS UP THERE. A question is a plain <li> and takes its
     white from the card behind it, so a lifted one had the row it was passing
     over showing straight through its own words - two questions in the same
     inch of page, both half readable. A section is already a card and this
     changes nothing for it. */
  background: var(--panel); border-radius: var(--radius);
}

/* WHERE IT WILL LAND. A thin line in the gap between two rows, the width of
   the list, and it exists only while the row is somewhere other than where it
   started - carry it back and the line goes, because there is nothing to say.

   PINNED TO THE WINDOW rather than put into the list, which is the whole
   reason it can be shown without anything moving: a line that took up room
   between two rows would push them apart to make space for itself, which is
   the old gap in a thinner coat. app.js sets left, width and top.

   IT SLIDES BETWEEN PLACES rather than jumping, which is what makes a slow
   drag down a list read as one continuous thing. */
.drag-line {
  position: fixed; z-index: 60; height: 2px;
  margin-top: -1px; border-radius: 2px;
  background: var(--accent);
  pointer-events: none;
  transition: top var(--blink) ease;
}
.drag-line::before {
  /* A dot on the leading end, the way a caret has one. It says which side the
     line belongs to and stops a two pixel rule reading as a border. */
  content: ''; position: absolute; left: -3px; top: -3px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}

/* ASKED FOR LESS MOVEMENT: the lift still happens, because it is a state
   rather than a journey, and everything that travels is switched off. app.js
   skips the settle for the same reason - see `stillness` there. */
@media (prefers-reduced-motion: reduce) {
  [data-drag-item] { transition: none; }
  .drag-line { transition: none; }
}

/* WHERE THE GRIP SITS.

   A question row is already a flex row, so its grip is simply the first thing
   in it and the layout absorbs it.

   A section is a card, so its grip goes in the card's own left padding, and
   the card is given a little more of it to make room. Both rules are written
   with :has(), so they apply ONLY when app.js has actually put a grip there -
   with JavaScript off there is no handle and no gap where one would have
   been. A browser without :has() gets the handle sitting slightly over the
   heading, which is untidy rather than broken. */
.qe-section { position: relative; }
.qe-section:has(> .drag-grip) { padding-left: 42px; }
.qe-section > .drag-grip { position: absolute; top: 16px; left: 8px; }

/* ---------- The question editor's own form ---------- */

/* The question itself is the thing this page is about, so it is the biggest
   thing on it. Everything else is a setting. */
.qe-form { max-width: 660px; }
/* An event type's page: the card under the name is as wide as the name's. */
.qe-type-state { max-width: 660px; }
.qe-type-state form { margin: 0; }
/* The description's formatting box sits in the form like any other field:
   its name above it at the same small weight, the same gap underneath. */
.qe-form .rich-field { display: flex; flex-direction: column; gap: 5px; }
.qe-form .rich-field .rich-box { margin-top: 0; min-height: 60px; }
/* ...BY BEING FIRST, NOT BY BEING BIGGER. It used to be drawn at 17px with
   extra padding, which made it the one text box in the app that was not the
   size of every other text box - and the page read as a different kind of
   form from the ones round it. It is an ordinary box now; being at the top
   and holding the words of the question is what makes it the main thing. */

/* Enter in a text box saves, rather than pressing whichever submit button
   happens to come first. See the note in views/questions/question.ejs. */
.qe-enter-saves {
  position: absolute; width: 1px; height: 1px; padding: 0; border: 0;
  opacity: 0; pointer-events: none;
}

/* Answer type, and the options that belong to some of the types. */
/* NO BOX ROUND IT. This and "Which events" were the only two groups in any
   form in the app drawn inside a border of their own; everywhere else a form
   is fields one under another, each with its name above it. So is this now. */
.qe-answer { display: flex; flex-direction: column; gap: 14px; }

/* "Answer type" above its menu, the way every other field's name sits above
   its box - the Question and the Hint directly over it included. */
.qe-type { display: flex; flex-direction: column; align-items: stretch; gap: 5px; }
.qe-type-name { font-size: 13px; font-weight: 600; }

/* THE ANSWER TYPE IS A MENU LIKE EVERY OTHER MENU HERE, not the browser's
   own dropdown - which drew dark on a light page and matched nothing. The
   button is drawn like the Filters button, the panel floats like the Filters
   panel and is placed by the same code, and the choices are the preferences
   menu's arrangement: a real radio moved off screen, and the label round it
   is what shows. See the note in views/questions/question.ejs. */
.type-pick { position: relative; min-width: 0; max-width: 360px; }
.type-pick > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  min-height: var(--control-h); padding: 0 10px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--input); color: var(--ink);
  /* 16px, for the same reason the Filters button is: anything smaller and a
     phone zooms the page when it is tapped. */
  font-size: 16px; line-height: 1.5;
}
.type-pick > summary::-webkit-details-marker { display: none; }
.type-pick > summary:hover,
.type-pick[open] > summary { border-color: var(--accent); }
.type-face { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; }
.type-face .type-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.type-icon { flex: 0 0 auto; width: 16px; height: 16px; color: var(--muted); }

.type-panel {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 25;
  min-width: 100%; width: max-content; max-width: min(360px, 92vw);
  max-height: min(70vh, 440px); overflow-y: auto; overscroll-behavior: contain;
  margin: 0; padding: 6px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px var(--shadow);
}
/* Two classes, so these beat ".form label" and ".form label > span" - the
   rules that stack a field's name over its box and make that name small and
   bold. A choice in a menu is neither: it reads like a choice in the Filters
   menu, full size and ordinary weight, and only the chosen one is heavier. */
.type-pick .type-option { display: block; cursor: pointer; }
/* Off screen, not display:none, which would take it out of the tab order
   and out of the arrow-key group along with it - the same as .seg-item. */
.type-option input {
  position: absolute; width: 1px; height: 1px; margin: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.type-option > .type-option-face {
  display: flex; align-items: center; gap: 10px;
  font-weight: 400;
  /* A thumb's worth of height on a phone. */
  min-height: 38px; padding: 6px 10px; border-radius: 7px;
  font-size: 15px; color: var(--ink);
}
.type-option:hover .type-option-face { background: var(--input); }
/* THE CHOSEN ONE IS FILLED, the same as the chosen segment in the
   preferences menu, so "which one is it now" is answered before it is read. */
.type-option input:checked + .type-option-face {
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
}
.type-option input:checked + .type-option-face .type-icon { color: inherit; }
.type-option input:focus-visible + .type-option-face {
  outline: 2px solid var(--accent); outline-offset: -2px;
}
html[data-input="mouse"] .type-option input:focus-visible + .type-option-face { outline: none; }

/* THE OPTIONS SIMPLY ARE NOT THERE FOR A TYPE THAT HAS NONE.

   Not disabled, not greyed out with a note saying when they apply - gone. The
   test is the SELECTED OPTION inside the dropdown, which :has() re-evaluates
   as the dropdown changes, so this follows the control live with no
   JavaScript at all. Same trick as .referral above.

   A browser without :has() shows them all the time, which is untidy rather
   than broken - and the server ignores options on a type that has none, so
   nothing can be stored by the difference. */
.qe-answer:not(:has(
  input[name="input_type"][value="choice"]:checked,
  input[name="input_type"][value="checkboxes"]:checked,
  input[name="input_type"][value="dropdown"]:checked
)) .qe-choices { display: none; }

.qe-choices { display: flex; flex-direction: column; gap: 8px; }
.qe-choices-head { font-size: 13px; font-weight: 600; }

.qe-choice-list { list-style: none; margin: 0; padding: 0; display: flex;
  flex-direction: column; gap: 6px; counter-reset: qe-choice; }

/* One row per choice: what it will look like, the words, and the three
   things you can do to it. */
.qe-choice { display: flex; align-items: center; gap: 6px; }
.qe-choice > input { flex: 1 1 auto; min-width: 0; }

/* The mark in front of the box is drawn as the control the choice will
   actually become, so the row looks like the thing it makes: a ring for a
   pick-one, a square for a tick, a number for a dropdown. Drawn in CSS from
   the type currently selected, so it follows the dropdown live. */
.qe-choice-mark {
  flex: 0 0 auto; width: 16px; height: 16px; border: 2px solid var(--muted);
  border-radius: 50%; counter-increment: qe-choice;
}
.qe-answer:has(input[name="input_type"][value="checkboxes"]:checked) .qe-choice-mark { border-radius: 4px; }
.qe-answer:has(input[name="input_type"][value="dropdown"]:checked) .qe-choice-mark {
  border: none; width: auto; min-width: 16px; color: var(--muted);
  font-size: 13px; text-align: right;
}
.qe-answer:has(input[name="input_type"][value="dropdown"]:checked) .qe-choice-mark::before {
  content: counter(qe-choice) ".";
}

.qe-choice-drop { color: var(--muted); font-size: 18px; line-height: 1; }
.qe-choice-drop:hover { color: var(--danger); border-color: var(--danger-line); }
.qe-choice-add { align-self: flex-start; }

/* ---------- "SOMETHING ELSE": THE WRITE-IN ----------

   Google Forms' "add Other", in this app's own shapes. Off: a quiet "or add
   Something else" beside Add option, in the muted ink the other add links
   use. On: one more row at the end of the choices, drawn like them - the ring
   or the square in front, a cross at the end - but with no box to type in,
   because what goes there is the client's to write.

   One checkbox is behind both, moved off screen like the answer type's
   radios. :has() reads it, as it reads the answer type; a browser without
   :has() shows both, which is untidy rather than broken. */
.qe-choice-more { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
.qe-write-in-box {
  position: absolute; width: 1px; height: 1px; margin: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.qe-write-in-row { min-height: var(--control-h); }
.qe-write-in-words {
  flex: 1 1 auto; min-width: 0;
  padding: 0 10px; min-height: var(--control-h);
  display: flex; align-items: center; gap: 8px;
  border: 1px dashed var(--line); border-radius: 8px; color: var(--ink);
}
.qe-write-in-words em { color: var(--muted); font-style: normal; font-size: 13px; }
.qe-write-in-row .qe-choice-drop { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
/* Two classes, so these beat ".form label" and ".form label > span", which
   stack a field's name over its box - the same reason as .type-option above.
   This is one line of words, not a field. */
.qe-choices .qe-write-in-add {
  display: inline; cursor: pointer; color: var(--muted); font-size: 14px;
  padding: 4px 2px; border-radius: 6px;
}
.qe-choices .qe-write-in-add > span { font-size: inherit; color: var(--accent); font-weight: 600; }
.qe-write-in-add:hover span { text-decoration: underline; }
/* The three answered from a list - pick one, pick several, and the long list -
   and nothing else. See WRITE_IN_TYPES in src/plan-questions.js. */
.qe-answer:not(:has(
  input[name="input_type"][value="choice"]:checked,
  input[name="input_type"][value="checkboxes"]:checked,
  input[name="input_type"][value="dropdown"]:checked
)) :is(.qe-write-in-row, .qe-write-in-add) { display: none; }
.qe-choices:has(.qe-write-in-box:checked) .qe-write-in-add { display: none; }
.qe-choices:not(:has(.qe-write-in-box:checked)) .qe-write-in-row { display: none; }
/* AND IT ARRIVES RATHER THAN BEING THERE. Turning the write-in on swaps one
   line for another, which between two frames reads as the page changing shape
   while you look away. One --beat, the same as everything else that appears.
   There is no answering fade on the way out: the row it replaces is taken
   away with display, and there is nothing left to animate. */
.qe-choices:has(.qe-write-in-box:checked) .qe-write-in-row {
  animation: reveal var(--beat) ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .qe-choices:has(.qe-write-in-box:checked) .qe-write-in-row { animation: none; }
}
/* The keyboard is on the hidden box, so the ring goes on whichever of the two
   is showing - the way the answer type's hidden radios light their label. */
.qe-choices:has(.qe-write-in-box:focus-visible) :is(.qe-write-in-add, .qe-write-in-row .qe-choice-drop) {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
html[data-input="mouse"] .qe-choices:has(.qe-write-in-box:focus-visible)
  :is(.qe-write-in-add, .qe-write-in-row .qe-choice-drop) { outline: none; }

/* ---------- Which events ---------- */

/* No border, for the same reason as the answer type above: the legend is a
   field's name like any other, above what it names, at the same size and
   weight and the same 5px away. */
.qe-applies { border: 0; padding: 0; margin: 0; min-width: 0; }
.qe-applies > legend { padding: 0 0 5px; font-size: 13px; font-weight: 600; }
/* THE CHOICES READ AT ORDINARY WEIGHT, the way choices do everywhere else -
   the client's own tick boxes and radios in Soundcheck, the filters, a
   person's role in Settings. They were bold, which is how a single on/off
   tick reads on the gig form, and a column of six bold words is a column of
   six headings. The name of the group is the one thing in bold. */
.qe-applies .check-row > span { font-weight: 400; }
/* Each radio and its words are one thing, left aligned, on one line - which
   is what the width fix on .form input[type="radio"] above buys. The rows are
   given a little height so they are a thumb's worth of target on a phone. */
.qe-applies .check-row { min-height: 32px; }
.qe-applies-list {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 4px 14px; margin-top: 6px; padding-left: 26px;
}
/* Nothing is being decided by this list while "every kind of event" is
   chosen, so it says so quietly. It stays entirely usable: ticking one is
   how somebody chooses "only these", and app.js moves the radio for them. */
.qe-applies:has(input[value="all"]:checked) .qe-applies-list { opacity: .55; }

/* The drawing in front of an answer type in the question list, matching the
   one in the editor's menu. Sized to the small grey line it sits in. */
.qe-type-mark { display: inline-block; margin-right: 4px; vertical-align: -2px; }
.qe-type-mark .type-icon { display: block; width: 14px; height: 14px; }

/* Where a row lands when the page has just reloaded onto it - see the note
   on the id in views/questions/index.ejs. Enough room above it that it is
   clearly inside the page rather than jammed against the top of the window. */
[data-qe-row] { scroll-margin-top: 90px; }
/* It is focused so the KEYBOARD lands there too, and it is not a control, so
   it gets no ring of its own. What marks it is that it is the thing you are
   looking at. */
[data-qe-row]:focus { outline: none; }

/* ============================================================
   ON PAPER
   The printable planning sheet at /gigs/N/plan/print, which Joel
   works the night off. See views/gigs/plan-print.ejs.

   There is no library and nothing is generated: it is an
   ordinary page, and the browser's own Print turns it into
   paper. This is the whole of what makes it fit to print.
   ============================================================ */

.plan-print { max-width: 720px; margin: 0 auto; padding: 24px; }
.plan-print-head { margin-bottom: 24px; }
.plan-print-head h1 { margin-bottom: 6px; }
.plan-print-head p { margin: 2px 0; color: var(--muted); }
.plan-print-state { font-size: 13px; }
.plan-print-section { margin-bottom: 22px; }
.plan-print-section h2 {
  margin: 0 0 8px; padding-bottom: 4px;
  font-size: 13px; color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.plan-print-section dl { margin: 0; }
.plan-print-section dt { font-weight: 600; margin-top: 10px; }
.plan-print-section dd {
  margin: 2px 0 0;
  /* Pasted song lists arrive with their line breaks, and they mean something -
     one song per line is how they were written and how they get read out. */
  white-space: pre-wrap;
}
.plan-print-empty { color: var(--muted); }

/* THE ROW OF THINGS TO PRESS, ON SCREEN ONLY. It is hidden on paper by the
   print rules at the foot of this file, which is where it has always been
   hidden - what changed is that it is a row of controls now rather than one
   link. See the note in views/gigs/plan-print.ejs for why it stopped being
   "Back to the gig".

   The gap and the wrap are all it needs: the buttons are the app's own, and
   only ever two of the three are drawn at once. */
.plan-print-back {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 16px;
}
/* What somebody with no JavaScript is told instead, in the same grey as the
   rest of the heading block. */
.plan-print-howto { font-size: 13px; color: var(--muted); }
.plan-print-howto kbd {
  font: inherit; font-weight: 700;
  background: var(--code-bg); color: var(--ink);
  padding: 0 5px; border-radius: 4px;
}


/* ============================================================
   ONE BREAKPOINT, AT 700 PIXELS
   ============================================================

   THERE WERE FIVE - 760, 640, 560, 480 and 420 - each one added on the day
   something looked wrong at that width, which meant nobody could say what
   the app was supposed to do on a phone. Five answers is no answer.

   There is one now, and it is the one place where the question "is this a
   phone?" is asked. Everything that has to be different on a phone is
   different here, in a list short enough to read:

     - the left menu becomes a drawer behind a 56px bar;
     - a table of gigs becomes one card per gig;
     - the two-column details list becomes one column;
     - a chart scrolls sideways inside its own frame rather than
       squashing;
     - buttons grow from 36px to 44px, which is a thumb rather than a
       pointer;
     - the page's own margins come in from 24px to 16px.

   Everything that was at 760, 640, 560, 480 or 420 is in this one block, at
   this one width. The things that were at 480 and 420 now happen at 700
   instead, which is earlier - and all four of them are "stop trying to fit
   two things side by side", which no 700px screen wants either.
   ============================================================ */
@media (max-width: 700px) {
  /* USERS, ON A PHONE: the name and address take the first line with the
     picture, and what they are and what can be done wrap under it. */
  .user-row { flex-wrap: wrap; padding: 12px 14px; }
  /* As wide as the row less the picture, which is what pushes the role and
     the buttons onto a line of their own rather than squeezing the name. */
  .user-who { flex: 1 1 calc(100% - 44px); }
  .user-role { flex: 1 1 auto; padding-left: 44px; }
  .user-actions { margin-left: auto; }
  .tab { min-height: 44px; }
  .referrer-merge select { min-width: 0; flex: 1 1 auto; }
  .photo-control { align-items: flex-start; }

  /* ---------- THE MENU BECOMES A DRAWER ----------
     The page stops making room for it, the bar at the top appears, and the
     menu itself slides off the left-hand edge until the checkbox is on. The
     collapsed-to-icons state means nothing here, so it is undone: a drawer
     you have deliberately opened shows its words. */
  body.with-sidebar,
  html[data-sidebar="shut"] body.with-sidebar { padding-left: 0; }
  .mini-top {
    display: flex; align-items: center; gap: 8px;
    position: sticky; top: 0; z-index: 20;
    height: 56px; padding: 0 12px;
    background: var(--panel); border-bottom: 1px solid var(--line);
  }
  .burger {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; margin-left: -8px;
    border-radius: var(--radius-control);
    color: var(--ink); cursor: pointer;
  }
  .burger svg { width: 22px; height: 22px; }
  /* The switch is off screen, so the ring it would have drawn is drawn here
     instead - otherwise somebody on a keyboard has no idea where they are. */
  .drawer-switch:focus-visible ~ .mini-top .burger {
    outline: 2px solid var(--accent); outline-offset: -2px;
  }
  html[data-input="mouse"] .drawer-switch:focus-visible ~ .mini-top .burger { outline: none; }
  .mini-brand {
    font-size: 19px; font-weight: 700; letter-spacing: -.02em; color: var(--ink);
  }
  .mini-brand:hover { text-decoration: none; }
  .mini-new { min-height: 36px; padding: 0 12px; }

  /* 288 rather than the 264 it was, for the account menu that opens out of
     its foot - see THE ACCOUNT MENU FITS INSIDE THE DRAWER further down this
     block. It is still 87px narrower than the narrowest iPhone. */
  .sidebar,
  html[data-sidebar="shut"] .sidebar {
    width: 288px; padding: 16px 12px;
    transform: translateX(-100%);
  }
  .drawer-switch:checked ~ .sidebar { transform: none; box-shadow: 0 8px 24px var(--shadow); }
  /* TAP ANYWHERE ELSE TO CLOSE IT. A <label> over the whole window, which is
     how that works with no script at all. */
  .drawer-sheet { position: fixed; inset: 0; z-index: 29; background: var(--backdrop); }
  .drawer-switch:checked ~ .drawer-sheet { display: block; }

  /* ============================================================
     THE PAGE BEHIND THE DRAWER STAYS WHERE IT IS
     ============================================================

     THE COMPLAINT: open the menu on a phone and drag, and the gig list behind
     the dark sheet scrolls away underneath it. The drawer is then open over a
     page that is no longer the page it was opened from, and closing it lands
     somewhere nobody asked to be.

     AND THE WORST OF IT HAPPENED BEFORE ANY DRAGGING AT ALL - see the note on
     input.drawer-switch further up this file. Pressing the burger handed the
     focus to a checkbox sitting at the top of the document, and the browser
     scrolled it into view, so the page was already back at the top. That one
     is fixed where it is caused; these two are the dragging itself.

       touch-action: none on the sheet, because a drag that starts on the dark
       sheet is a drag the browser hands to the page underneath it. The sheet
       is also made a scroll container of its own with nothing in it, so a
       mouse wheel over it has somewhere to land that is not the page: that is
       what overflow and overscroll-behavior are doing on that line.

       overscroll-behavior: contain on the drawer, so a long menu scrolled to
       its end does not pass the rest of the gesture on to the document.

     WHAT IS DELIBERATELY NOT HERE IS overflow: hidden ON THE DOCUMENT, which
     is the usual way to do this and is wrong here. Making the page
     unscrollable makes a browser clamp where it is scrolled TO, so the page
     jumps to the top the moment the drawer opens and is still there when it
     closes - the exact fault this is meant to fix, arriving a second earlier.
     Nothing below moves the page at all, so there is no position to save and
     none to put back wrongly, and it holds with JavaScript switched off
     because the checkbox is the state. */
  .drawer-sheet { touch-action: none; overflow: hidden; overscroll-behavior: contain; }
  .sidebar { overscroll-behavior: contain; }
  /* Icons-only is a laptop idea. In a drawer every word comes back - which
     means putting the words back INTO the page as well as back on screen, and
     taking away the chip that stood in for them. */
  html[data-sidebar="shut"] .side-text,
  html[data-sidebar="shut"] .acct-name,
  html[data-sidebar="shut"] .acct-chevron { max-width: 180px; opacity: 1; }
  html[data-sidebar="shut"] .side-tip { display: none; }
  html[data-sidebar="shut"] .sidebar { overflow-y: auto; overflow-x: hidden; }
  html[data-sidebar="shut"] .side-group { color: var(--muted); }
  html[data-sidebar="shut"] .side-group::before { opacity: 0; }
  /* MANAGE IS AN ORDINARY FOLD IN A DRAWER, whatever the cookie says about
     icons - a drawer is never icons only. Every line here puts back what
     MANAGE, WHEN THE MENU IS ICONS took away further up this file, and they
     are in the same order so the two can be read against each other. */
  html[data-sidebar="shut"] .side-chevron { opacity: 1; width: 14px; }
  html[data-sidebar="shut"] .side-manage-toggle .side-icon {
    width: 0; opacity: 0; margin-right: -12px;
  }
  html[data-sidebar="shut"] .side-manage-toggle:hover { background: none; }
  html[data-sidebar="shut"] .side-manage.holds-here .side-manage-toggle {
    background: none; color: var(--muted); font-weight: 500;
  }
  html[data-sidebar="shut"] .side-manage-items,
  html[data-sidebar="shut"] .side-manage-items.is-pinned {
    display: grid; position: static; padding-left: 0;
    visibility: visible; opacity: 1; pointer-events: auto; transform: none;
    transition: grid-template-rows var(--swing) var(--ease);
  }
  html[data-sidebar="shut"] .side-manage-inner {
    visibility: hidden; overflow: hidden;
    transition: visibility 0s linear var(--swing);
    min-width: 0; margin-left: 24px; padding: 0;
    border: 0; border-radius: 0;
    background: none; box-shadow: none;
  }
  html[data-sidebar="shut"] .side-manage[data-open="yes"] .side-manage-inner {
    visibility: visible; transition-delay: 0s;
  }
  html[data-sidebar="shut"] .side-fly-title { display: none; }
  html[data-sidebar="shut"] .side-search { opacity: 1; pointer-events: auto; }
  html[data-sidebar="shut"] .side-search .site-search { visibility: visible; }
  html[data-sidebar="shut"] .side-nav { display: flex; }
  html[data-sidebar="shut"] .side-search-shut { opacity: 0; pointer-events: none; }
  html[data-sidebar="shut"] .side-brand-short { opacity: 0; }
  /* A drawer is open or it is not there; "icons only" means nothing in it, so
     the button that shrinks the menu is not drawn. */
  .side-edge { display: none; }

  /* ============================================================
     THE ACCOUNT MENU FITS INSIDE THE DRAWER
     ============================================================

     THE COMPLAINT: open the drawer on an iPhone, open the account row, and
     the menu was cut off down its right-hand side - the sixth accent dot and
     the right edge of every segment gone.

     WHAT WAS WRONG, measured: the drawer is 264px wide and --acct-menu-w is
     264px, so the panel started 12px in from the drawer's edge and ended 12px
     past it. The drawer clips what overflows it, so those 12px were simply
     not drawn. It was only ever right by accident at the other width: the
     rule that made it fit was written for the SHUT menu, and a drawer is not
     shut - it is the open one at a narrower width - so a browser with the
     cookie set to "open" got the laptop's fixed 264px inside a 264px drawer.

     SO IT IS AS WIDE AS THE DRAWER, in both shapes of the cookie, which is
     what "left and right rather than a width" means. --acct-menu-w is a
     laptop number and has no business at this width: there, the panel hangs
     off a 232px column into the room beside it, and here there is no room
     beside it to hang into.

     AND THE DRAWER IS A LITTLE WIDER THAN IT WAS, which is the other half.
     At 264px the panel's three Appearance choices had about 72px each, and
     "System" beside its own icon needs 75 - so it dropped under the icon and
     left a notch in a row of three, which is the exact fault --acct-menu-w
     was introduced to fix on the laptop. 24px more drawer is 8px more for
     each of the three and the row holds; it is still 87px short of the
     narrowest iPhone, so the dark sheet behind it is as obviously there as it
     was. */
  .pref-menu-up > .pref-panel,
  html[data-sidebar="shut"] .pref-menu-up > .pref-panel {
    left: 0; right: 0; width: auto;
  }

  /* ---------- A THUMB, NOT A POINTER ---------- */
  .btn { min-height: 44px; }
  main { padding: 24px 16px 60px; }
  .card { padding: 16px; }
  .site-header { padding: 10px 16px; }
  .stale-banner, .view-as-banner { padding-left: 16px; padding-right: 16px; }

  .gig-cards, .gig-cards > thead, .gig-cards > tbody, .gig-cards tr, .gig-cards td { display: block; }
  .gig-cards > thead > tr {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px;
    padding: 0 0 8px; border-bottom: 1px solid var(--line);
  }
  .gig-cards > thead > tr::before {
    content: "Sort by"; font-size: 11px; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: .05em;
  }
  .gig-cards > thead:not(:has(.sort-link)) { display: none; }
  .gig-cards th, .gig-cards th.col-money { padding: 0; border: 0; text-align: left; }
  /* A thumb's worth of height, where on a desk they are a line of small type. */
  .gig-cards .sort-link { min-height: 36px; }

  .gig-cards > tbody > tr:not(.divider-row) {
    display: grid; gap: 4px 14px; align-items: start;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "gig status" "date fee" "client client";
    padding: 12px 0; border-bottom: 1px solid var(--line);
  }
  .gig-cards > tbody > tr:last-child { border-bottom: none; }
  .gig-cards td { padding: 0; border: 0; }
  .gig-cards .col-gig { grid-area: gig; min-width: 0; }
  .gig-cards .col-date { grid-area: date; white-space: normal; }
  .gig-cards .col-client { grid-area: client; }
  .gig-cards .col-status { grid-area: status; justify-self: end; text-align: right; }
  .gig-cards .col-money { grid-area: fee; justify-self: end; }
  /* A name on its own could be anybody's; the cell says whose it is. */
  .gig-cards .col-client::before {
    content: attr(data-label) " "; font-size: 12px; color: var(--muted);
  }
  /* The row kept on screen after it changed is marked down its side, as it is
     on the table - on the card now, rather than on its first cell. */
  .gig-cards tr.is-held > td:first-child { box-shadow: none; }
  .gig-cards tr.is-held { box-shadow: inset 3px 0 0 var(--accent); padding-left: 10px; }
  .details { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .details dd + dt { margin-top: 10px; }
  .chart-frame { overflow-x: auto; overscroll-behavior-x: contain; }
  .chart { min-width: 820px; }
  .signin-actions .btn { flex: 1 1 100%; }

  /* ---------- A FINGER, NOT A POINTER ----------

     THE TIME LIST, WITH ROWS A THUMB CAN HIT. 44px is Apple's own number for
     something a finger has to press, and five and a half of them is the
     height: the half row is what says there is more underneath. 16px type,
     because that is the size the rest of a phone's form is set in. */
  .timepick { max-height: 246px; }
  .tp-row { min-height: 44px; padding: 0 14px; font-size: 16px; }

  .event-plan { flex: 1 1 100%; }
  .event-plan .btn-lead { width: 100%; text-align: center; justify-content: center; }
  .qe-page {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "top" "main" "foot";
    grid-template-rows: auto;
  }
  .qe-rail-top { padding: 0 0 12px; }
  .qe-rail-foot { align-self: start; }
  .qe-sheet-row { flex-wrap: wrap; }
  .qe-sheet-actions { padding: 0 18px 12px; }
  .qe-sheet { grid-template-columns: minmax(0, 1fr) auto; }
  .qe-sheet-name { grid-column: 1; }
  .qe-sheet-size, .qe-sheet-use { grid-column: 1; }
  .qe-sheet-go { grid-column: 2; grid-row: 1 / span 3; }

  /* ---------- THE INVOICE SCREENS, ON A PHONE ----------
     EVERY SELECTOR HERE STARTS :root, AND THAT IS THE FIX FOR A SILENT
     FAILURE. These rules sit in the one breakpoint, which is earlier in the
     file than THE SOUNDCHECK LOOK at its foot - so each desktop rule there,
     the same weight and later, won on a phone too: the invoice list stayed
     five columns at 375px and the editors' rows never wrapped. :root makes
     each of these one step heavier than the rule it answers, without a
     second breakpoint (there is one, by rule - see test/the-frame.test.js). */
  :root .sc { padding: 8px 0 96px; }
  :root .sc .btn, :root .sc-dialog .btn { height: 40px; min-height: 40px; }
  :root .sc .btn.more-button { min-width: 40px; }
  :root .sc .sums { gap: 24px; }
  :root .sc .search, :root .sc .sw2 { width: 100%; }
  :root .sc .bar { flex-direction: column-reverse; align-items: stretch; }
  :root .sc .thead { display: none; }
  :root .sc .lrow { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; padding: 14px 4px; }
  :root .sc .lrow .c-num { display: none; }
  :root .sc .lrow .c-st { grid-row: 2; }
  :root .sc .lrow .c-due { grid-row: 2; }
  :root .sc .only-n { display: inline; }
  /* AN EDITOR'S ROW, ON A PHONE: its name across the top with the cross
     beside it, and the boxes under it - placed, not left to flow, because a
     box that flows into the cross's 32px column is a box nobody can read.
     Items: description, then quantity and price, then the amount. */
  :root .sc .irow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 32px; row-gap: 6px; padding: 10px 0; border-top: 1px solid var(--sc-hair); }
  :root .sc [data-item-rows] > .irow:first-child { border-top: 0; }
  :root .sc .irow.h { display: none; }
  :root .sc .irow .cdesc { grid-column: 1 / 3; grid-row: 1; }
  :root .sc .irow > .x { grid-column: 3; grid-row: 1; }
  :root .sc .irow > [name="quantity"] { grid-column: 1; grid-row: 2; }
  :root .sc .irow > .c-price { grid-column: 2; grid-row: 2; }
  :root .sc .irow [data-item-amount] { grid-column: 1 / 3; grid-row: 3; text-align: left; font-size: 12.5px; color: var(--muted); }
  /* Schedule: the payment's name, then its amount - the $ / % switch, the
     box, what a percent comes to - on a line of its own (or "Rest of
     total"), then its due date. */
  :root .sc .srow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 32px; row-gap: 6px; padding: 10px 0; border-top: 1px solid var(--sc-hair); }
  :root .sc [data-schedule-rows] > .srow:first-child { border-top: 0; }
  :root .sc .srow > :nth-child(1) { grid-column: 1 / 3; grid-row: 1; }
  :root .sc .srow > :nth-child(2) { grid-column: 1 / 4; grid-row: 2; }
  :root .sc .srow > :nth-child(3) { grid-column: 1 / 4; grid-row: 3; }
  :root .sc .srow > :nth-child(4) { grid-column: 3; grid-row: 1; }
  :root .sc .srow .rest { text-align: left; }
  /* Payers: the name, then the email, then the share. */
  :root .sc .yrow { grid-template-columns: minmax(0, 1fr) 32px; row-gap: 6px; padding: 10px 0; border-top: 1px solid var(--sc-hair); }
  :root .sc [data-payer-rows] > .yrow:first-child { border-top: 0; }
  :root .sc .yrow > [name="name"] { grid-column: 1; grid-row: 1; }
  :root .sc .yrow > .x, :root .sc .yrow > span:last-child { grid-column: 2; grid-row: 1; }
  :root .sc .yrow > .ymail, :root .sc .yrow > .c-share { grid-column: 1 / 3; }
  /* A plan's payment, on a phone: the name across the top with the cross
     beside it, then the amount, then when it is due, each a line of its own. */
  :root .sc .prow { grid-template-columns: minmax(0, 1fr) 32px; padding: 10px 0; border-top: 1px solid var(--sc-hair); }
  :root .sc .prow:first-child { border-top: 0; }
  :root .sc .prow.h { display: none; }
  :root .sc .prow .plabel { grid-column: 1; grid-row: 1; }
  :root .sc .prow > .x, :root .sc .prow > .x-slot { grid-column: 2; grid-row: 1; }
  :root .sc .prow .pamount, :root .sc .prow .pdue { grid-column: 1 / 3; }
  :root .sc .prow .rest { padding: 4px 2px; }
  :root .sheet { padding: 28px 20px; }
  :root .sc-client .ctop { padding: 0 16px; }
  :root .sc-client .vbanner { padding: 8px 16px; }
  :root .sc-client .cwrap { padding: 20px 16px 96px; }
}

@media print {
  /* Ink is expensive and a dark page on paper is unreadable. Whatever theme
     the screen is in, paper is black on white. */
  .plan-print {
    background: #fff; color: #000;
    max-width: none; margin: 0; padding: 0;
  }
  /* Nothing you can press is any use once it is printed, and neither is a
     confirmation about something that happened before the page was opened. */
  .plan-print-back, .flash-mark { display: none; }
  .plan-print-head { border-bottom: 1px solid #999; padding-bottom: 8px; }
  .plan-print-head p, .plan-print-section h2, .plan-print-empty { color: #000; }
  .plan-print-section h2 { border-bottom: 1px solid #999; }
  /* A question and its answer belong on the same page as each other, and a
     section heading at the foot of a page with nothing under it is a page
     turned for no reason. */
  .plan-print-section { break-inside: avoid; page-break-inside: avoid; }
  .plan-print-section dt { break-after: avoid; page-break-after: avoid; }
  a { color: #000; text-decoration: none; }

  /* ---------- THE CLIENT'S INVOICE, ON PAPER ----------
     Black on white, nothing that is not the document: no bar, no banner,
     no Print button, no card shadow. See views/invoices/client.ejs. */
  .sc-client { background: #fff !important; color: #000 !important; }
  .sc-client .ctop, .sc-client .vbanner, .sc-client .crumb, .sc-client .btn, .sc-client .pay-soon { display: none !important; }
  .sc-client .cwrap { padding: 0; max-width: none; }
  .sheet { border: 0; box-shadow: none; padding: 0; background: #fff; color: #000; animation: none; }
  .sc-client .muted, .sc-client .sm, .sc-client .cents, .sc-client .ink2, .sc-client .ok, .sc-client .bad { color: #000 !important; }
  .sc-client .slab { color: #999 !important; }
  .sc-client .sc-line { border-top-color: #999; }
  .sc-client .sc-line.total, .sheet .due-row { border-top-color: #000; }
  .sc-client .st { box-shadow: inset 0 0 0 1px #000; background: none !important; color: #000 !important; }
  body { background: #fff !important; }
}

/* ============================================================
   A LITTLE FORMATTING, ANYWHERE SOMEBODY TYPES MORE THAN A LINE
   Bold, italic, underline, bullets, numbers, a link. Built by
   public/app.js on top of a plain textarea, so with JavaScript
   off none of this exists and the textarea is the control.

   THE NAMES SAY `rich` RATHER THAN `plan` BECAUSE IT IS NOT
   THE PLANNING FORM'S ANY MORE. The same control upgrades the
   notes boxes on the client page and the gig page. One
   control, one set of rules, one place to fix it.
   ============================================================ */

/* ---------- THE TOOLBAR, RESTYLED AND NOTHING ELSE ----------
   The six buttons do exactly what they did. What changed is that they were
   six bordered boxes floating above the box they act on - six of the loudest
   shapes a small control has, over one quiet field - and they are now a strip
   along the top of that field, inside the same border, which is how every
   editor anybody has used draws them.

   The strip and the field are ONE box. .rich-bar carries the top corners and
   the hairline under itself; the field below it has no border of its own; and
   the pair of them lift together when the keyboard is in the field, which is
   the same focus treatment every other box in this app gets. */
/* ---------- THE STRIP IS DRAWN ABOVE A BOX THAT COMES FIRST ----------

   The editable area is the FIRST of the two in the document and the toolbar
   is the second, so that the Tab key meets the box before the buttons - see
   the long note where the wrapper is built in public/app.js. The eye wants
   the opposite order, and this is the one line that gives it one: a column
   with the strip pulled to the top of it.

   A wrapper of its own rather than `order` on whatever the pair happen to be
   inside, because that is three different elements on three different forms,
   and two of them are not flex containers. */
.rich-wrap { display: flex; flex-direction: column; }
.rich-bar { order: -1; }

.rich-bar {
  display: flex; gap: 2px; flex-wrap: wrap;
  margin: 6px 0 0; padding: 4px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius-control) var(--radius-control) 0 0;
  background: var(--input);
}
.rich-tool {
  /* position for the chip below, which hangs outside the button */
  position: relative;
  width: 30px; height: 28px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 4px;
  background: none; color: var(--muted);
  font: inherit; font-size: 14px; line-height: 1; cursor: pointer;
}
/* 18px RATHER THAN 16. Two of these eight buttons are told apart by nothing
   but the direction of an arrowhead, and at 16px that arrowhead was two and a
   half pixels of ink - see the note on Indent and Outdent in public/app.js.
   Two more pixels is about a quarter more of every drawing on the strip, and
   28px of button still has room for it. */
.rich-tool svg { width: 18px; height: 18px; }
.rich-tool:hover { background: var(--panel); color: var(--ink); }

/* ---------- WHAT EACH BUTTON IS CALLED, ON HOVER AND ON FOCUS ----------
   The same chip the left menu uses for a row with no room for its word, and
   here for the same reason: the browser's own title tooltip waits a second,
   is drawn in the system's font, and never appears at all for somebody using
   the keyboard. See the note in public/app.js.

   It hangs BELOW the button rather than above, because the strip is at the
   top of the field and a chip above it would be over whatever card the field
   is in. */
.rich-tip {
  position: absolute; left: 50%; top: calc(100% + 6px); z-index: 40;
  transform: translateX(-50%) translateY(-3px);
  padding: 4px 8px; border-radius: var(--radius-control);
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  box-shadow: 0 4px 14px var(--shadow);
  font-size: 12px; font-weight: 500; line-height: 1.2;
  white-space: nowrap; pointer-events: none;
  opacity: 0;
  transition: opacity var(--blink) ease, transform var(--blink) var(--ease);
}
.rich-tool:hover > .rich-tip,
.rich-tool:focus-visible > .rich-tip {
  opacity: 1; transform: translateX(-50%);
}
@media (prefers-reduced-motion: reduce) {
  .rich-tip { transition: none; transform: translateX(-50%); }
}
/* THE SECOND LINE OF THE CHIP: how the keyboard gets to these buttons at all,
   now that the Tab key never stops on one. Quieter than the name above it,
   because it is the same sentence on all eight. */
.rich-tip-how {
  display: block; margin-top: 2px;
  color: var(--muted); font-weight: 400; font-size: 11px;
}

/* The editable area itself, drawn to look exactly like the textarea it stands
   in for - same border, same background, same 16px type that stops iOS
   zooming the page when a field is tapped. Somebody typing into this should
   not be able to tell it is not an ordinary box. */
.rich-box {
  width: 100%; margin-top: 0; padding: 10px 12px;
  /* The strip above it carries the top of the box, so this has three sides
     and the bottom two corners - see .rich-bar. */
  border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 var(--radius-control) var(--radius-control);
  background: var(--input); color: var(--ink);
  font: 16px/1.5 inherit; font-family: inherit;
  /* Roughly the four rows the textarea starts at, and it grows on its own
     from there - which is what a pasted list of forty songs needs. */
  min-height: 96px;
  overflow-wrap: break-word;
}
/* THE STRIP AND THE FIELD LIFT TOGETHER. They are one box as far as anybody
   looking at them is concerned, so a focus that lit only the bottom two thirds
   of it would read as a drawing error. */
.rich-box:focus {
  outline: none;
  border-color: var(--focus-line); background: var(--focus-field);
}
/* Written the other way round from how it used to be, because the two
   elements swapped places in the document - see .rich-wrap above. */
.rich-box:focus + .rich-bar {
  border-color: var(--focus-line); background: var(--focus-field);
}
/* The notes box is a shorter thing than a planning answer - it sits under a
   heading on a page of other things rather than being the whole of what the
   page is for. */
.rich-field .rich-box { min-height: 72px; }
.rich-field { width: 100%; }

/* What the few allowed tags look like, wherever they are drawn: in the box
   being typed into, in a note already written, in a printed answer, and on
   Joel's copy of the form. One list, so a note and an answer never look like
   two different things. */
.rich-box p, .note-body p, .plan-print-answer p { margin: 0 0 8px; }
.rich-box p:last-child, .note-body p:last-child,
.plan-print-answer p:last-child { margin-bottom: 0; }
.rich-box ul, .rich-box ol, .note-body ul, .note-body ol,
.plan-print-answer ul, .plan-print-answer ol { margin: 0 0 8px; padding-left: 22px; }
/* A LIST INSIDE A LIST ITEM IS PART OF THAT ITEM, not the next thing after it,
   so it does not get the gap that separates one list from the paragraph
   below. Without this a three-level list grows a widening space under each
   nested branch and stops reading as one list. */
.rich-box li > ul, .rich-box li > ol,
.note-body li > ul, .note-body li > ol,
.plan-print-answer li > ul, .plan-print-answer li > ol { margin-bottom: 0; }

/* ---------- AS DEEP AS HE WANTS TO GO ----------

   Tab used to stop at three levels. It does not any more, and the only thing
   that had to follow it here is the BULLET SHAPE: a browser gives a disc, then
   a circle, then a square, and then squares for ever. Three shapes for as many
   levels as somebody types is fine - they go round again, the way the numbers
   in a numbered list do - but "square, square, square" reads as the indenting
   having quietly stopped working.

   So the cycle is written out. There is no arithmetic in CSS, so this is nine
   levels of it written down; past nine it repeats the browser's own answer,
   which is a repeat and is exactly what a repeat is meant to look like. Nine
   levels of bullets in a note about a wedding is already further than anybody
   is going.

   THE FIRST THREE ARE WRITTEN OUT TOO, and that is not belt and braces. A
   browser decides a bullet's shape by how many lists it is inside ALTOGETHER,
   not by how many of them are part of this answer - and a note is drawn inside
   the <ul> that holds the list of notes. So the same three-level list came out
   disc, circle, square in the box being typed into and circle, square, square
   once saved, which is the sort of difference nobody can explain and everybody
   notices. Said outright, it is the same list wherever it is drawn.

   The INDENT itself needs nothing: every list carries its own padding-left, so
   level twelve is level eleven plus the same step again, for ever, on its own. */
.rich-box ul, .note-body ul, .plan-print-answer ul { list-style-type: disc; }
.rich-box ul ul, .note-body ul ul, .plan-print-answer ul ul { list-style-type: circle; }
.rich-box ul ul ul, .note-body ul ul ul,
.plan-print-answer ul ul ul { list-style-type: square; }

.rich-box ul ul ul ul, .note-body ul ul ul ul, .plan-print-answer ul ul ul ul,
.rich-box ul ul ul ul ul ul ul,
.note-body ul ul ul ul ul ul ul,
.plan-print-answer ul ul ul ul ul ul ul { list-style-type: disc; }

.rich-box ul ul ul ul ul, .note-body ul ul ul ul ul, .plan-print-answer ul ul ul ul ul,
.rich-box ul ul ul ul ul ul ul ul,
.note-body ul ul ul ul ul ul ul ul,
.plan-print-answer ul ul ul ul ul ul ul ul { list-style-type: circle; }

.rich-box ul ul ul ul ul ul, .note-body ul ul ul ul ul ul,
.plan-print-answer ul ul ul ul ul ul,
.rich-box ul ul ul ul ul ul ul ul ul,
.note-body ul ul ul ul ul ul ul ul ul,
.plan-print-answer ul ul ul ul ul ul ul ul ul { list-style-type: square; }
.rich-box a, .note-body a, .plan-print-answer a { color: var(--accent); }

/* WHAT TAB MAKES when the caret is not in a list. The browser's editing mode
   produces a blockquote for "indent" and hangs a style on it; the style is
   dropped on the way into the database along with every other attribute, so
   the indent is THIS rule and not that one - which is why it looks the same
   in the box, on Joel's copy and on the printed page. No quotation marks and
   no bar down the side: it is an indent, not a quotation. */
.rich-box blockquote, .note-body blockquote, .plan-print-answer blockquote {
  margin: 0 0 8px 26px; padding: 0; border: 0;
}
.rich-box blockquote:last-child, .note-body blockquote:last-child { margin-bottom: 0; }
.note-body { margin: 0; }

/* A QUESTION'S DESCRIPTION, drawn with its formatting under the question - on
   the client's form, on Joel's copy, in the editor and in the library. The same
   few tags as a note, a step tighter, because it is the quiet line under a
   question rather than something to read on its own. The description takes
   its colour and size from whatever it sits in, so it stays the quiet line. */
.rich-text { margin: 0; }
.rich-text p { margin: 0 0 4px; }
.rich-text p:last-child { margin-bottom: 0; }
.rich-text ul, .rich-text ol { margin: 0 0 4px; padding-left: 20px; }
.rich-text ul { list-style-type: disc; }
.rich-text ul ul { list-style-type: circle; }
.rich-text ul ul ul { list-style-type: square; }
.rich-text li > ul, .rich-text li > ol { margin-bottom: 0; }
.rich-text blockquote { margin: 0 0 4px 22px; padding: 0; border: 0; }
.rich-text a { color: var(--accent); }

/* ============================================================
   "SHE SAYS THIS ISN'T RIGHT."
   On Joel's gig page, at the top, in the alarm colours until he
   marks it handled. See the note in views/gigs/show.ejs.
   ============================================================ */

.gig-flags.has-open {
  border-color: var(--error-line);
  border-left: 4px solid var(--danger);
  background: var(--error-bg);
}
.gig-flags.has-open h2 { color: var(--error-ink); }

.flag-list { list-style: none; margin: 0; padding: 0; }
.flag {
  padding: 12px 0; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
}
.flag:first-child { border-top: none; padding-top: 4px; }
.flag-said { margin: 0; white-space: pre-wrap; }
.flag-meta { margin: 0; font-size: 13px; color: var(--muted); }
.gig-flags.has-open .flag:not(.is-handled) .flag-meta { color: var(--error-ink); }
/* A flag he has dealt with is still here - what she said and the fact he saw
   it are both worth keeping - and it is visibly done rather than gone. */
.flag.is-handled { opacity: .7; }
.flag-handled { font-weight: 600; }

/* The client's own copy, beside the details she is disputing, so she can see
   that it went somewhere and does not send it again. */
.plan-flag-list { list-style: none; margin: 14px 0 0; padding: 0; }
.plan-flag-said {
  padding: 10px 12px; margin-bottom: 8px;
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius); background: var(--bg);
}
.plan-flag-said p { margin: 0; }
.plan-flag-said.is-handled { border-left-color: var(--notice-line); }

/* ---------- A CLIENT PUTTING THEIR OWN DETAILS RIGHT ----------
   One box and a button, on the line the fact is printed on. The same shape as
   the deposit date on Joel's gig page, and for the same reason: a fact that is
   usually right and occasionally needs correcting is corrected where it is
   shown rather than on a form somewhere else. */
.detail-form {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin: 6px 0 0; max-width: none;
}
.detail-form input {
  flex: 1 1 200px; min-width: 0;
  min-height: var(--control-h); padding: 0 10px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--input); color: var(--ink);
  /* 16px, so tapping it does not zoom the page on a phone. */
  font: 16px/1.5 inherit; font-family: inherit;
}
.detail-form .btn { flex: 0 0 auto; }
/* EACH DETAIL SHOWN ONCE, WITH ITS EDIT BESIDE IT, and opened in place as the
   box above with Save and Cancel. The box, the address's lines and the error
   are the same shapes as everywhere else; this only lays them out on the
   row. The problem and the hint take the whole width, over and under the box. */
.detail-view { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.detail-view .mailing-address { flex: 0 1 auto; }
.detail-edit { min-height: 0; padding-top: 2px; padding-bottom: 2px; }
.detail-form .field-error, .detail-form .muted-sm { flex: 1 1 100%; }
.detail-form .form-actions { margin-top: 0; }
.detail-form textarea {
  flex: 1 1 100%; min-width: 0; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--input); color: var(--ink);
  font: 16px/1.5 inherit; font-family: inherit; resize: vertical;
}
.detail-edit-photo .photo-control { margin-bottom: 8px; }

/* AN ADDRESS THAT IS WAITING TO BE PROVED. Marked, because the old one going
   on working would otherwise read as the change having silently failed. Not
   the alarm colours - nothing is wrong, something is simply half done. */
.detail-pending {
  margin: 8px 0 0; padding: 8px 10px;
  border: 1px solid var(--notice-line); border-radius: 8px;
  background: var(--notice-bg); color: var(--notice-ink);
  font-size: 13px;
}

/* Three lines of an address, printed as they were typed. */
.mailing-address { margin: 0; white-space: pre-wrap; }

/* ============================================================
   WHEN A CLIENT HAS ACTUALLY BEEN IN
   ============================================================ */

.access-heading {
  margin: 18px 0 6px; font-size: 13px; font-weight: 500;
  text-transform: none; letter-spacing: normal; color: var(--muted);
}
.signin-list {
  list-style: none; margin: 0; padding: 0;
  font-variant-numeric: tabular-nums;
}
.signin-list li {
  padding: 5px 0; border-top: 1px solid var(--line); font-size: 14px;
}
.signin-list li:first-child { border-top: none; }
/* The most recent one is the one he is looking for. */
.signin-list li:first-child { font-weight: 600; }

/* ============================================================
   THE SOUNDCHECK LOOK - THE INVOICE SCREENS, AND THE SHELL THEY SIT IN
   ============================================================

   The tokens in docs/invoicing/design/tokens.json, as variables, and the
   components the approved prototype draws with them: one elevated card per
   screen, flat sections under hairlines, tinted status pills with words,
   compact buttons, a timeline, editors that open in place, menus, dialogs.

   SCOPED TO .sc, which the new screens put on their column, so that the rest
   of the app keeps its shapes until it is re-skinned in its own step. What
   is shared with the old screens - the palette's bg, surface, muted and the
   six accents, and the typeface - was moved to the tokens' values at the top
   of this file, because the frame is on every page and a frame in two
   palettes would be two apps.

   THE TOKENS ARE --sc-*, dark first, light under the same two rules the rest
   of the palette uses. Where tokens.json and the prototype differed, the
   tokens won - the light pill text here is the deeper of the two. */
/* ---------- THE SIDEBAR, IN THE NEW LOOK ----------
   The same markup and the same widths; what changes is the colour and the
   weight. The menu is the page's own colour with a line down its edge, rows
   are quiet until they are the page you are on, and the lit row is the
   accent on its soft wash. */
.sidebar { background: var(--sc-sidebar); border-right-color: var(--sc-line); }
.side-brand { letter-spacing: -.02em; }
.side-group { color: var(--sc-dim); }
.mini-top { background: var(--sc-sidebar); border-bottom-color: var(--sc-line); }

/* ---------- THE COLUMN ---------- */
.sc {
  max-width: 760px; margin: 0 auto; padding: 20px 0 88px;
  display: flex; flex-direction: column;
  font-size: 14px; line-height: 21px;
  animation: sc-pagein var(--swing) cubic-bezier(.2, .8, .2, 1);
}
.sc.sc-wide { max-width: 1000px; }
/* Inside an old-look page - the card on a gig - there is no column, only
   the card. */
.sc.sc-inline { max-width: none; margin: 0 0 20px; padding: 0; display: block; animation: none; }
.sc h1 { margin: 0; font-size: 21px; line-height: 28px; font-weight: 600; letter-spacing: -.02em; }
.sc h1 .num { font-weight: 500; color: var(--sc-ink-2); }
.sc h2 { margin: 0; font-size: 16px; line-height: 22px; font-weight: 600; }
.sc .muted { color: var(--sc-muted); }
.sc .dimc { color: var(--sc-dim); }
.sc .ink2 { color: var(--sc-ink-2); }
.sc .sm { font-size: 12.5px; line-height: 17px; }
.sc .ok { color: var(--sc-success); }
.sc .bad { color: var(--danger); }
.sc .col { display: flex; flex-direction: column; min-width: 0; }
.sc .row2 { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sc .r { text-align: right; }
.sc .amt { text-align: right; white-space: nowrap; }
.sc .slab { font-size: 12px; font-weight: 500; letter-spacing: .02em; color: var(--sc-muted); }
.sc .cents { color: var(--sc-dim); }
.sc .big { font-size: 32px; line-height: 38px; font-weight: 600; letter-spacing: -.01em; }
.sc .mid { font-size: 26px; line-height: 32px; font-weight: 600; letter-spacing: -.01em; }
.sc a { color: var(--accent); text-decoration: none; }
.sc a:hover { color: var(--accent-hover); text-decoration: none; }
.sc .lnk { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-align: left; }
.sc .lnk:hover { color: var(--accent-hover); }
.sc .lnk.quiet { color: inherit; }
.sc .lnk.quiet:hover { color: var(--ink); }
.sc .ebtn { background: none; border: 0; padding: 0; color: var(--accent); font-size: 12.5px; font-weight: 500; cursor: pointer; }
.sc .ebtn:hover { color: var(--accent-hover); }
.sc .title-row { align-items: flex-start; margin-bottom: 24px; flex-wrap: nowrap; }
.sc .title-row > .sc-menu { flex: none; }
.sc .title-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sc .title-line.small { gap: 10px; }
.sc .btn-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sc .btn-row.tight { gap: 2px; }

/* The back button that names where you came from. */
.sc .crumb {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  height: 28px; padding: 0 10px 0 6px; margin: 0 0 14px -6px;
  border-radius: var(--radius-control); border: 0; background: none;
  font-size: 13px; font-weight: 500; color: var(--sc-muted); cursor: pointer;
  transition: background var(--blink), color var(--blink);
}
.sc .crumb:hover { background: var(--sc-surface); color: var(--ink); }
.sc .crumb svg { transition: transform var(--blink); }
.sc .crumb:hover svg { transform: translateX(-2px); }
.sc .crumb.static { cursor: default; }
.sc .crumb.static:hover { background: none; color: var(--muted); }

/* ---------- FOUR BUTTONS, 32px ---------- */
.sc .btn {
  min-height: 32px; height: 32px; padding: 0 12px; gap: 6px;
  border-radius: var(--radius-control);
  background: var(--sc-raised); color: var(--ink);
  border: 1px solid var(--sc-line-strong);
  box-shadow: inset 0 1px 0 var(--sc-inset), var(--sc-shadow-card);
  font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: filter var(--blink), transform var(--blink), background var(--blink), color var(--blink), border-color var(--blink);
}
.sc .btn:hover { filter: none; border-color: var(--sc-dim); }
.sc .btn:active { transform: scale(.97); }
.sc .btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: inset 0 1px 0 var(--sc-inset-p); }
.sc .btn-primary:hover { filter: brightness(1.07); border-color: transparent; }
.sc .btn-ghost { background: none; color: var(--sc-muted); border-color: transparent; box-shadow: none; }
.sc .btn-ghost:hover { color: var(--ink); background: var(--sc-surface); border-color: transparent; }
.sc .btn-danger { background: none; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); box-shadow: none; }
.sc .btn-danger:hover { background: var(--danger); color: var(--bg); border-color: var(--danger); }
.sc .btn[disabled] { opacity: .4; cursor: default; transform: none; }
.sc .btn.more-button { min-width: 32px; padding: 0 8px; font-size: 11px; letter-spacing: .5px; }
.sc .x {
  width: 32px; height: 36px; border: 0; background: none; color: var(--sc-dim);
  border-radius: var(--radius-control); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; flex: none;
  transition: color var(--blink), background var(--blink);
}
.sc .x:hover { color: var(--danger); background: var(--sc-surface); }

/* ---------- STATUS PILLS ---------- */
.st {
  display: inline-flex; align-items: center; height: 22px; padding: 0 10px;
  border-radius: 999px; font-size: 12px; line-height: 22px; font-weight: 500; white-space: nowrap;
  transition: background var(--swing), color var(--swing);
}
.k-draft   { color: var(--sc-draft-ink);   background: var(--sc-draft-bg); }
.k-sent    { color: var(--sc-sent-ink);    background: var(--sc-sent-bg); }
.k-partly  { color: var(--sc-partly-ink);  background: var(--sc-partly-bg); }
.k-overdue { color: var(--sc-overdue-ink); background: var(--sc-overdue-bg); font-weight: 600; }
.k-paid    { color: var(--sc-paid-ink);    background: var(--sc-paid-bg); }
.k-void    { color: var(--sc-void-ink); background: transparent; box-shadow: inset 0 0 0 1px var(--sc-line-strong); text-decoration: line-through; }

/* ---------- THE ONE ELEVATED CARD ---------- */
.sc-hero {
  background: var(--sc-surface); border: 1px solid var(--sc-line-strong); border-radius: 10px;
  padding: 24px; display: flex; flex-direction: column; gap: 18px;
  box-shadow: inset 0 1px 0 var(--sc-inset), var(--sc-shadow-card);
}
.sc .gig-invoice { margin-bottom: 20px; }
.sc-meter { height: 4px; border-radius: 999px; background: var(--sc-meter); overflow: hidden; }
.sc-meter > div {
  height: 100%; background: var(--accent); border-radius: 999px; transform-origin: left;
  animation: sc-fill var(--draw) cubic-bezier(.2, .8, .2, 1) var(--beat) both; transition: width var(--draw) cubic-bezier(.2, .8, .2, 1);
}
.sc-banner {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-radius: 8px; margin-bottom: 16px;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--ink);
  animation: sc-slide var(--beat) ease-out;
}
.sc-banner.gray { background: var(--sc-surface); border: 1px solid var(--sc-line); }

/* ---------- FLAT SECTIONS ---------- */
.sc-sec {
  border-top: 1px solid var(--sc-line); margin-top: 32px; padding-top: 24px;
  display: flex; flex-direction: column; gap: 14px;
  animation: sc-pagein var(--swing) cubic-bezier(.2, .8, .2, 1) both;
}
.sc-sec.first { border-top: 0; margin-top: 36px; padding-top: 0; }
/* Each section a beat apart: a fraction of --blink, so a change to the
   named length moves the whole stagger with it. */
.sc-sec.d1 { animation-delay: calc(var(--blink) * .4); } .sc-sec.d2 { animation-delay: calc(var(--blink) * .8); } .sc-sec.d3 { animation-delay: calc(var(--blink) * 1.2); }
.sc-sec.d4 { animation-delay: calc(var(--blink) * 1.6); } .sc-sec.d5 { animation-delay: calc(var(--blink) * 2); }
.sc .shead { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sc .split-controls { display: flex; align-items: center; gap: 14px; }
.sc-line { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-top: 1px solid var(--sc-hair); }
.sc-line:first-child { border-top: 0; }
.sc-line.total { border-top: 1px solid var(--sc-line-strong); padding-top: 12px; font-weight: 600; }
.sc .pay-amt { font-weight: 500; }
.sc .pay-row { align-items: flex-start; }
.sc .hist { display: flex; justify-content: space-between; gap: 16px; }
.sc .hist-list { gap: 10px; }
.sc .empty { padding: 40px 8px; color: var(--sc-muted); border-top: 1px solid var(--sc-hair); margin: 0; }
/* The section that just changed brightens for a moment, like every other
   row in the app that changes under your eye - the same mark, in the
   section label rather than across a card. */
.sc .slab[data-settled] { animation: sc-settle var(--linger) ease-out; border-radius: 4px; }

/* ---------- THE TIMELINE ---------- */
.sc .tl { display: flex; gap: 14px; }
.sc .tlr { display: flex; flex-direction: column; align-items: center; width: 14px; flex: none; }
.sc .tlb { gap: 2px; min-width: 0; padding-bottom: 20px; flex: 1; }
.sc .tl:last-child .tlb { padding-bottom: 4px; }
.sc .tl-label { font-weight: 500; }
.sc .tld { width: 9px; height: 9px; border-radius: 999px; margin-top: 6px; flex: none; transition: background var(--swing), border-color var(--swing); }
.sc .tld.paid { background: var(--accent); }
.sc .tld.due, .sc .tld.zero { background: var(--bg); border: 1.5px solid var(--sc-dim); }
.sc .tld.over { background: var(--bg); border: 1.5px solid var(--danger); }
.sc .tls { flex: 1; width: 1px; background: var(--sc-line-strong); margin-top: 5px; transform-origin: top; animation: sc-grow var(--draw) ease-out var(--swing) both; }

/* ---------- FIELDS, SWITCHES, SEGMENTS ---------- */
.sc label.f, .sc div.f { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--sc-ink-2); flex: 1; min-width: 120px; }
.sc .in {
  height: 36px; width: 100%; background: var(--sc-field); border: 1px solid var(--sc-line-strong);
  border-radius: var(--radius-control); color: var(--ink); padding: 0 10px; font-size: 14px; font-family: inherit;
  outline: none; transition: border-color var(--blink), box-shadow var(--blink); font-variant-numeric: tabular-nums;
}
.sc .in:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.sc .in.rt { text-align: right; }
.sc .in.bad { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.sc .in[readonly] { color: var(--sc-muted); }
.sc .in[disabled] { opacity: .6; }
.sc textarea.in { height: auto; min-height: 80px; padding: 8px 10px; resize: vertical; line-height: 20px; }
.sc select.in { padding-right: 28px; }
.sc .ferr { color: var(--danger); font-size: 12px; line-height: 16px; font-weight: 500; }
.sc .opt { color: var(--sc-dim); font-weight: 400; }
.sc .frow { display: flex; gap: 12px; flex-wrap: wrap; }
.sc .seg { display: inline-flex; flex-wrap: wrap; background: var(--sc-surface); border: 1px solid var(--sc-line); border-radius: 7px; padding: 2px; gap: 2px; align-self: flex-start; }
.sc .segc { position: relative; display: inline-flex; }
.sc .segc input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.sc .segc span { height: 28px; padding: 0 11px; border-radius: 5px; color: var(--sc-muted); font-size: 12.5px; font-weight: 500; display: inline-flex; align-items: center; transition: background var(--blink), color var(--blink); }
.sc .segc input:checked + span { background: var(--sc-raised); color: var(--ink); box-shadow: 0 0 0 1px var(--sc-line-strong), var(--sc-shadow-card); }
.sc .segc input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
/* The card fee box is there only while Card is the method. */
.sc label.f.fee-field { display: none; animation: sc-slide var(--beat) ease-out; }
.sc form:has([name="method"][value="card"]:checked) label.f.fee-field { display: flex; }
.sc .sw-label { display: inline-flex; cursor: pointer; }
.sc .sw { width: 34px; height: 20px; border-radius: 999px; position: relative; flex: none; background: var(--sc-line-strong); transition: background var(--beat); display: inline-block; }
.sc .sw span { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 999px; background: var(--sc-muted); transition: left var(--beat) cubic-bezier(.2, .8, .2, 1), background var(--beat); }
.sc .sw-input:checked + .sw { background: var(--accent); }
.sc .sw-input:checked + .sw span { left: 16px; background: var(--accent-ink); }
.sc .sw-input:focus-visible + .sw { outline: 2px solid var(--accent); outline-offset: 2px; }
.sc .sw-input:disabled + .sw { opacity: .5; }
.sc .split-form { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.sc .reveal { animation: sc-slide var(--beat) ease-out; }

/* ---------- EDITORS ---------- */
.sc .qe-editing { padding: 0; }
/* The question editor's lifted form carries an accent stripe down its left
   edge; an invoice's editor is a bordered box instead, per the brand book. */
.sc .qe-editing > form, .sc .qe-editing:not([hidden]) > form {
  border-left: 1px solid var(--sc-line-strong); padding: 14px; box-shadow: none; animation: sc-slide var(--beat) ease-out;
}
.sc-editor {
  display: flex; flex-direction: column; gap: 2px; padding: 14px;
  border: 1px solid var(--sc-line-strong); border-radius: 10px; background: var(--sc-surface);
  animation: sc-slide var(--beat) ease-out; margin: 0;
}
.sc-editor.loose { gap: 12px; margin: 8px 0; }
.sc .irow { display: grid; grid-template-columns: minmax(0, 1fr) 70px 136px 96px 32px; gap: 8px; align-items: center; padding: 6px 0; }
.sc .irow.h { font-size: 12px; color: var(--sc-dim); font-weight: 500; padding: 0 0 2px; }
.sc .srow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px) 150px 32px; gap: 8px; align-items: end; padding: 6px 0; }
.sc .srow .rest { text-align: right; }
/* A BOX AND ITS OWN ERROR, the line just above it ("Needs a date") - the
   rule in the design system's Words. The boxes in a row line up along their
   bottoms, so a row with a message over one box still reads as one row. */
.sc .sfield { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
/* A SCHEDULE ROW'S AMOUNT: the $ / % switch, the box, and - in % - what it
   comes to ("$700.00"), on one line under the box's own error. The figure is
   only there in %; in $ the box takes its room. */
.sc .samount .amt-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sc .samount .affix { flex: 1; }
.sc .kind-seg { flex: none; flex-wrap: nowrap; }
.sc .kind-seg .segc span { padding: 0 9px; }
.sc .samount .worked { flex: none; min-width: 64px; text-align: right; color: var(--sc-muted); font-variant-numeric: tabular-nums; }
.sc .samount:not(:has(input[value="percent"]:checked)) .worked { display: none; }

/* ============================================================
   $ AND % INSIDE THE BOX
   ============================================================
   Every money box in the app has a fixed "$" inside it, before the number,
   and every percent box a fixed "%" after it - drawn here, never typed and
   never posted, so what is saved is the number alone. An empty one says
   "Dollar amount" or "Percent".

   THE BOX IS WRAPPED, <span class="affix">, because an <input> can have no
   ::before of its own. A box that is either - a schedule row with its $ / %
   switch, a payment plan's amount with its select - shows whichever is
   chosen, by :has(), so with no script too. */
.affix { position: relative; display: block; min-width: 0; }
.affix > .in { width: 100%; }
.affix::before, .affix::after {
  position: absolute; top: 0; bottom: 0; display: flex; align-items: center;
  color: var(--sc-muted); font-size: 14px; pointer-events: none; font-variant-numeric: tabular-nums;
}
.affix::before { content: "$"; left: 10px; }
:root .affix > .in { padding-left: 22px; }
:is(.samount:has(input[value="percent"]:checked), .pamount:has(option[value="percent"]:checked)) .affix::before { content: none; }
:is(.samount:has(input[value="percent"]:checked), .pamount:has(option[value="percent"]:checked)) .affix::after { content: "%"; right: 10px; }
:root :is(.samount:has(input[value="percent"]:checked), .pamount:has(option[value="percent"]:checked)) .affix > .in { padding-left: 10px; padding-right: 26px; }
.sc .yrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 136px 32px; gap: 8px; align-items: center; padding: 6px 0; }
.sc .edfoot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 10px; margin-top: 6px; border-top: 1px solid var(--sc-line); }
.sc .edactions { display: flex; gap: 8px; align-items: center; margin: 0; }
.sc .edactions.end { justify-content: flex-end; }
.sc .edactions [data-items-total] { margin-right: 6px; }
.sc [data-item-row].leaving, .sc [data-schedule-row].leaving, .sc [data-payer-row].leaving { opacity: 0; transition: opacity var(--beat); }
.sc [data-item-row].arriving, .sc [data-schedule-row].arriving, .sc [data-payer-row].arriving { animation: sc-slide var(--beat) ease-out; }

/* ---------- MENUS ---------- */
.sc .sc-menu > summary.lnk { list-style: none; display: inline; }
.sc .sc-menu > summary::-webkit-details-marker { display: none; }
.sc .sc-menu .more-panel {
  top: calc(100% + 6px); min-width: 190px; padding: 5px; gap: 1px;
  background: var(--sc-surface); border: 1px solid var(--sc-line-strong); border-radius: 8px;
  box-shadow: var(--sc-shadow-pop); animation: sc-drop var(--beat) ease-out; transform-origin: top right;
}
.sc .sc-menu .more-panel.left { left: 0; right: auto; transform-origin: top left; }
.sc .sc-menu .more-panel.wide { min-width: 270px; }
.sc .sc-menu .more-panel.narrow { min-width: 140px; }
.sc .more-item { min-height: 32px; padding: 0 10px; border-radius: 5px; font-size: 13px; justify-content: space-between; gap: 16px; }
.sc .more-item:hover { background: var(--sc-raised); }
:root[data-theme="light"] .sc .more-item:hover { background: var(--bg); }
.sc .more-item-danger { color: var(--danger); }
.sc .more-item-danger:hover { background: var(--sc-overdue-bg); color: var(--danger); }
.sc .mlab { padding: 6px 10px 4px; font-size: 11.5px; color: var(--sc-dim); font-weight: 500; }
.sc .hr { height: 1px; background: var(--sc-line); margin: 4px 0; }

/* ---------- DIALOGS ---------- */
.sc-dialog {
  width: min(440px, calc(100vw - 32px)); padding: 0;
  border: 1px solid var(--sc-line-strong); border-radius: 12px;
  background: var(--sc-surface); color: var(--ink); box-shadow: var(--sc-shadow-pop);
  font-size: 14px; line-height: 21px;
}
.sc-dialog::backdrop { background: var(--sc-scrim); animation: sc-fade var(--beat) ease-out; }
.sc-dialog[open] { animation: sc-pop var(--beat) cubic-bezier(.2, .8, .2, 1); }
.sc-dialog[open]:not(:modal) { position: fixed; inset: 0; margin: auto; height: fit-content; z-index: 50; }
.sc-dialog-body { padding: 22px; display: flex; flex-direction: column; gap: 16px; margin: 0; }
.sc-dialog-body h2 { margin: 0; font-size: 16px; font-weight: 600; }
.sc-dialog .dlg-actions { justify-content: flex-end; gap: 8px; margin: 0; }
/* The dialog is a .sc column of its own, for the buttons and fields in it. */
.sc-dialog label.f, .sc-dialog div.f { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--sc-ink-2); flex: 1; min-width: 120px; }
.sc-dialog .in { height: 36px; width: 100%; background: var(--sc-field); border: 1px solid var(--sc-line-strong); border-radius: var(--radius-control); color: var(--ink); padding: 0 10px; font-size: 14px; font-family: inherit; outline: none; transition: border-color var(--blink), box-shadow var(--blink); font-variant-numeric: tabular-nums; }
.sc-dialog .in:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.sc-dialog .in.bad { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.sc-dialog .in[readonly] { color: var(--sc-muted); }
.sc-dialog textarea.in { height: auto; min-height: 80px; padding: 8px 10px; resize: vertical; line-height: 20px; }
.sc-dialog select.in { padding-right: 28px; }
.sc-dialog .ferr { color: var(--danger); font-size: 12px; line-height: 16px; font-weight: 500; }
.sc-dialog .opt { color: var(--sc-dim); font-weight: 400; }
.sc-dialog .frow { display: flex; gap: 12px; flex-wrap: wrap; }
.sc-dialog .seg { display: inline-flex; flex-wrap: wrap; background: var(--bg); border: 1px solid var(--sc-line); border-radius: 7px; padding: 2px; gap: 2px; align-self: flex-start; }
.sc-dialog .segc { position: relative; display: inline-flex; }
.sc-dialog .segc input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.sc-dialog .segc span { height: 28px; padding: 0 11px; border-radius: 5px; color: var(--sc-muted); font-size: 12.5px; font-weight: 500; display: inline-flex; align-items: center; transition: background var(--blink), color var(--blink); }
.sc-dialog .segc input:checked + span { background: var(--sc-raised); color: var(--ink); box-shadow: 0 0 0 1px var(--sc-line-strong), var(--sc-shadow-card); }
.sc-dialog .segc input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.sc-dialog label.f.fee-field { display: none; }
.sc-dialog form:has([name="method"][value="card"]:checked) label.f.fee-field { display: flex; animation: sc-slide var(--beat) ease-out; }
.sc-dialog .btn { min-height: 32px; height: 32px; padding: 0 12px; border-radius: var(--radius-control); background: var(--sc-raised); color: var(--ink); border: 1px solid var(--sc-line-strong); box-shadow: inset 0 1px 0 var(--sc-inset), var(--sc-shadow-card); font-size: 13px; font-weight: 500; }
.sc-dialog .btn:hover { filter: none; border-color: var(--sc-dim); }
.sc-dialog .btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.sc-dialog .btn-primary:hover { filter: brightness(1.07); }
.sc-dialog .btn-ghost { background: none; color: var(--sc-muted); border-color: transparent; box-shadow: none; }
.sc-dialog .btn-ghost:hover { color: var(--ink); background: var(--bg); }
/* The app's confirm dialog, on a new-look page, takes the new surface. */
body:has(main > .sc) .confirm-dialog { background: var(--sc-surface); border-color: var(--sc-line-strong); box-shadow: var(--sc-shadow-pop); }

/* ---------- THE TOAST, WITH UNDO ---------- */
.sc-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--sc-toast-bg); color: var(--sc-toast-ink);
  border-radius: 8px; padding: 9px 14px; display: flex; gap: 14px; align-items: center;
  z-index: 60; box-shadow: var(--sc-shadow-pop); font-size: 13px; white-space: nowrap;
  animation: sc-toast var(--beat) cubic-bezier(.2, .8, .2, 1);
}
.sc-toast.leaving { opacity: 0; transition: opacity var(--beat); }

/* ---------- THE LIST ---------- */
.sc .sums { display: flex; gap: 40px; flex-wrap: wrap; margin: 24px 0 32px; }
.sc .sum { display: flex; flex-direction: column; gap: 4px; animation: sc-pagein var(--swing) cubic-bezier(.2, .8, .2, 1) both; }
.sc .sum:nth-child(2) { animation-delay: calc(var(--blink) * .4); } .sc .sum:nth-child(3) { animation-delay: calc(var(--blink) * .8); }
.sc .bar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--sc-line); }
.sc .sc-tabs { display: flex; gap: 22px; }
.sc .sc-tab {
  background: none; border: 0; border-bottom: 2px solid transparent; padding: 0 0 10px; margin-bottom: -1px;
  color: var(--sc-muted); font-size: 13px; font-weight: 500; cursor: pointer; display: inline-flex; gap: 7px; align-items: center;
  transition: color var(--blink), border-color var(--beat);
}
.sc .sc-tab:hover { color: var(--ink); }
.sc .sc-tab.on { color: var(--ink); border-bottom-color: var(--accent); }
.sc .cnt { color: var(--sc-dim); font-weight: 450; }
.sc .sw2 { position: relative; margin: 0; display: flex; gap: 8px; }
.sc .sw2 > svg { position: absolute; left: 10px; top: 9px; color: var(--sc-dim); pointer-events: none; }
.sc .search {
  height: 32px; width: 220px; margin-bottom: 8px; border: 1px solid var(--sc-line-strong); border-radius: var(--radius-control);
  background: var(--sc-field); color: var(--ink); padding: 0 10px 0 32px; font-size: 13px; font-family: inherit; outline: none; transition: border-color var(--blink);
}
.sc .search:focus { border-color: var(--accent); }
.sc .thead, .sc .lrow { display: grid; grid-template-columns: 90px minmax(0, 1fr) 120px 110px 150px; gap: 16px; align-items: center; }
.sc .thead { padding: 12px 8px 8px; font-size: 12px; font-weight: 500; color: var(--sc-dim); }
.sc .lrows { list-style: none; margin: 0; padding: 0; }
.sc .lrow {
  width: 100%; padding: 13px 8px; border-top: 1px solid var(--sc-hair); background: none; color: var(--ink);
  font: inherit; text-align: left; cursor: pointer; transition: background var(--blink), transform var(--blink);
}
.sc .lrow:hover { background: var(--sc-surface); transform: translateX(2px); color: var(--ink); }
.sc .lrow.a { animation: sc-row var(--swing) cubic-bezier(.2, .8, .2, 1) both; }
.sc .lrow .c-num { font-size: 13px; }
.sc .lname { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc .lbal { font-weight: 500; }
.sc .only-n { display: none; }

/* ---------- LINE ITEMS ---------- */
.sc .lib-list { gap: 0; }
.sc .librow { display: flex; align-items: center; gap: 16px; padding: 13px 0; border-top: 1px solid var(--sc-hair); flex-wrap: wrap; animation: sc-row var(--swing) cubic-bezier(.2, .8, .2, 1) both; }
.sc .librow:first-child { border-top: 0; }
.sc .librow-view { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; width: 100%; }
.sc .librow > .qe-editing { width: 100%; }
.sc .librow[data-settled] { animation: sc-settle var(--linger) ease-out; }
.sc .fold > summary { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; list-style: none; }
.sc .fold > summary::-webkit-details-marker { display: none; }
.sc .chev { transition: transform var(--beat); }
.sc .fold[open] .chev { transform: rotate(180deg); }
.sc .fold > .col { margin-top: 8px; }

/* ---------- A MENU SITS ABOVE EVERYTHING ---------- */
/* "+ Add item" WAS SEE-THROUGH: the Payments section showed through it. The
   menu was never transparent - it is the surface colour with the pop shadow -
   but every section, row and card on these pages eases in, and an element
   with an animation on it is a layer of its own. A menu inside one is painted
   inside THAT layer, so the next section down, a later layer, was painted on
   top of it whatever z-index the menu had. So whatever holds an open menu is
   lifted above its neighbours while the menu is open, and only then. */
.sc :is(.sc-sec, .librow, .sc-hero, .title-row, .sc-editor, [data-qe-row], .qe-editing, .lrow, .edfoot):has(details[open]) {
  position: relative; z-index: 40;
}
.sc .sc-menu .more-panel { z-index: 50; background: var(--sc-surface); box-shadow: var(--sc-shadow-pop); }

/* ---------- WHILE A SECTION IS BEING EDITED, ITS EDIT LINK GOES ---------- */
/* The server never draws it on a section it draws as a form; this is the same
   for a form lifted into the page by script (editHere in public/app.js), which
   marks the section data-editing while it is open. Cancel, Done and Escape
   take the mark away, and the link is back. The same for Add item and Add
   plan while their editor is open at the top of the page. */
.sc [data-qe-row][data-editing] .ebtn { display: none; }
.sc .row2:has(+ :is(#new-item, #new-plan)[data-editing]) .btn-primary { display: none; }

/* ---------- A DUE DATE THAT HAS ALREADY PASSED ---------- */
.sc .passed, .sc-dialog .passed {
  display: flex; flex-direction: column; gap: 2px; padding-top: 8px;
  color: var(--danger); font-size: 12.5px; line-height: 17px; font-weight: 500;
}
.sc-dialog .passed { padding-top: 0; }

/* ---------- "DEFAULT", AND THE PLAN MENU ---------- */
.sc .tag {
  display: inline-block; margin-left: 6px; padding: 0 7px; border: 0; border-radius: 999px;
  font-size: 11.5px; line-height: 18px; font-weight: 500; vertical-align: 1px;
  color: var(--sc-ink-2); background: var(--sc-draft-bg); white-space: nowrap;
}
.sc .edlinks { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.sc .plan-menu .more-panel { width: min(340px, calc(100vw - 32px)); }
.sc .plan-item { min-height: 44px; padding: 7px 10px; align-items: flex-start; text-align: left; color: var(--ink); white-space: normal; height: auto; }
.sc .plan-item .col { gap: 2px; }
.sc .plan-item .sm { line-height: 16px; }

/* ---------- THE PLAN EDITOR ---------- */
/* One row per payment: its name, its amount (a box and % or $), when it is
   due (a number and a rule), and the cross. The last row's amount is the
   words "Rest of total". */
.sc .prow { display: grid; grid-template-columns: minmax(110px, 1fr) 176px minmax(240px, 290px) 32px; gap: 8px; align-items: center; padding: 5px 0; }
.sc .prow select.in { padding: 0 22px 0 8px; font-size: 13px; }
.sc .prow.h { font-size: 12px; color: var(--sc-dim); font-weight: 500; padding: 0 0 2px; }
.sc .prow .pamount, .sc .prow .pdue { display: flex; gap: 6px; align-items: center; min-width: 0; }
.sc .prow .pamount .affix { flex: 1; min-width: 0; }
.sc .prow .pamount select { flex: none; width: 60px; padding-right: 4px; }
.sc .prow .pdue .due-n { flex: none; width: 58px; }
.sc .prow .pdue select { flex: 1; min-width: 0; }
.sc .prow .rest { padding-left: 2px; }
/* "When sent" counts nothing, so the number box steps aside - by the
   stylesheet, so it does with no script too. */
.sc .prow:has(.due-rule option[value="sent"]:checked) .due-n { display: none; }
.sc .prow.arriving { animation: sc-slide var(--beat) ease-out; }
.sc [data-plan-row].leaving { opacity: 0; transition: opacity var(--beat); }

/* ---------- THE CLIENT'S INVOICE ---------- */
body:has(> .sc-client) { background: var(--bg); }
.sc-client { max-width: none; padding: 0; margin: 0; }
.sc-client .vbanner { background: var(--soft); color: var(--on-soft); padding: 8px 28px; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; font-weight: 500; flex-wrap: wrap; }
.sc-client .vbanner .btn { height: 28px; min-height: 28px; }
.sc-client .ctop { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 28px; height: 56px; border-bottom: 1px solid var(--sc-line); }
.sc-client .cmark { font-weight: 600; font-size: 15px; letter-spacing: -.02em; }
.sc-client .cwrap { max-width: 688px; margin: 0 auto; padding: 32px 24px 112px; display: flex; flex-direction: column; gap: 18px; }
.sc-client .cwrap > .row2 .crumb { margin: 0 0 0 -6px; }
.sheet {
  background: var(--sc-surface); border: 1px solid var(--sc-line-strong); border-radius: 10px;
  padding: 52px 56px; display: flex; flex-direction: column; gap: 36px;
  box-shadow: inset 0 1px 0 var(--sc-inset), var(--sc-shadow-card); animation: sc-pagein var(--swing) cubic-bezier(.2, .8, .2, 1) both;
}
.sheet .letterhead { font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.sheet .blocks { display: flex; gap: 48px; flex-wrap: wrap; }
.sheet .block { gap: 4px; min-width: 160px; }
.sheet .due-row { border-top: 1px solid var(--sc-line-strong); padding-top: 28px; }
.sheet .btn.pay { height: 38px; min-height: 38px; padding: 0 18px; }
.sc-client .received { gap: 4px; text-align: center; }
.sc-client .pay-soon { text-align: center; margin: 0; }
.sc-client .pay-soon:target { display: block !important; }

/* ---------- MOTION ---------- */
@keyframes sc-pagein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes sc-row { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes sc-slide { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes sc-drop { from { opacity: 0; transform: translateY(-4px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes sc-pop { from { opacity: 0; transform: translateY(6px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes sc-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sc-toast { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes sc-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes sc-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes sc-settle { from { background: var(--settle); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) {
  .sc, .sc *, .sc-dialog, .sc-dialog::backdrop, .sc-toast, .st, .sheet { animation: none !important; transition: none !important; }
}

/* ============================================================
   EVERY PANEL THAT FLOATS
   ============================================================
   The ••• menus, "+ Add item", "Use a plan", a status badge's list, the
   filters, the preferences menu, a search-or-add picker, the search answers,
   the time list (and the long-list picker built on it), the date picker's
   calendar, an info note, the answer-type menu. (Not Manage's flyout - see
   just below.)

   THE DATE PICKER'S CALENDAR WAS SEE-THROUGH: in an invoice's Schedule
   editor the Items section below it - its Edit link, its $2,800.00, a divider
   - was drawn straight across the days. Not because the calendar had no
   background, but because the next section, an animated layer of its own,
   was painted on top of it. So every open panel is lifted into the browser's
   TOP LAYER by public/app.js (see A MENU OPENS WHERE THERE IS ROOM FOR IT),
   where nothing on the page can be drawn over it - and this is the one rule
   for what they all look like there: the solid surface, the pop shadow.

   Written here at the foot so it is the last word on all of them, and kept
   to background and shadow - borders, corners and sizes stay each panel's
   own. test/invoice-schedule-fixes.test.js reads this list against every
   panel in the file, so a new kind of panel has to be added to it. */
:is(.more-panel, .status-panel, .filters-panel, .pref-panel, .picker-panel,
    .site-search-panel, .timepick, .datebox-panel, .info-panel, .type-panel) {
  background: var(--sc-surface);
  box-shadow: var(--sc-shadow-pop);
}
/* MANAGE'S PAGES ARE NOT ON THE LIST. They float only when the menu is
   icons, and that flyout has its solid panel and shadow of its own, in MANAGE,
   WHEN THE MENU IS ICONS. In the wide menu the same element is the open fold,
   on the menu's own background: it was on the list above for a round, and
   the fold came out as a gray box with a shadow. */
/* (The calendar inside the filters is part of that panel, in its flow, and
   keeps its own field colour and no shadow - .filters-panel .datebox-panel,
   two classes, further up.) */

/* IN THE TOP LAYER the browser gives a panel defaults of its own - a margin
   that centres it in the window, an inset of nought on every side, its own
   border, padding, colours and a scrollbar. Each panel's own rules win over
   those wherever they say something; this says the rest, at no weight at
   all, so it never wins over anything a panel does say. data-lifted is put
   on by the script while the panel is up there, and only then. */
:where([data-lifted]) {
  margin: 0; inset: auto; border: 0; padding: 0;
  overflow: visible; color: inherit;
}
