/*!***************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[3]!./design/tokens.css ***!
  \***************************************************************************************************************************************************************************************************************************************************************/
/* =============================================================================
   The token contract.
   Every token a component may use is declared HERE, once, with a safe fallback.
   A theme file may only REDEFINE these names — it may not invent new ones and it
   may not contain selectors, positioning, z-index or !important.
   The fallback set below is deliberately drab: if you can read a screen and it
   looks like this, a theme failed to load.
   ============================================================================= */
:root {
  /* -- surfaces ------------------------------------------------------------ */
  --ground:            #EEEEEE;   /* app chrome behind content */
  --surface:           #FFFFFF;   /* rows, panels, the reading ground */
  --surface-raised:    #FFFFFF;   /* menus, dialogs — genuinely lifted only */
  --surface-sunken:    #E8E8E8;   /* wells, empty states */

  /* -- content ------------------------------------------------------------- */
  --on-ground:         #1A1A1A;
  --on-surface:        #1A1A1A;   /* ticket titles, field values */
  --muted:             #5A5A5A;   /* secondary text, field labels */
  --faint:             #8A8A8A;   /* ids, timestamps, placeholders */

  /* -- lines --------------------------------------------------------------- */
  --border:            #D6D6D6;   /* row rules, field underlines */
  --border-strong:     #B0B0B0;   /* inputs, focused containers */

  /* -- accent: exactly one hue ---------------------------------------------- */
  --primary:           #3A3A3A;
  --primary-hover:     #202020;
  --on-primary:        #FFFFFF;

  /* -- semantic state: separate from the accent, never reused as one -------- */
  --danger:            #A02015;  --on-danger:  #FFFFFF;
  --warning:           #7A5A00;  --on-warning: #FFFFFF;
  --success:           #1E6B45;  --on-success: #FFFFFF;

  /* -- focus: never inherited from --primary, must clear both grounds ------- */
  --focus:             #0B57D0;

  /* -- shape --------------------------------------------------------------- */
  --radius:            2px;
  --radius-lg:         3px;
  --border-width:      1px;

  /* -- density ------------------------------------------------------------- */
  --space-unit:        4px;
  --row-height:        36px;
  --tap-min:           44px;      /* accessibility floor; a theme may raise it */

  /* -- type ---------------------------------------------------------------- */
  --font-display:      ui-sans-serif, system-ui, sans-serif;
  --font-body:         ui-sans-serif, system-ui, sans-serif;
  --font-mono:         ui-monospace, monospace;
  --display-weight:    600;
  --display-tracking:  -0.02em;
  --display-transform: none;
  --body-size:         15px;
  --body-leading:      1.55;

  /* -- motion -------------------------------------------------------------- */
  --motion-fast:       120ms;
  --motion-base:       200ms;
}

/* A user's accessibility preference outranks every theme. Themes cannot undo this. */
@media (prefers-reduced-motion: reduce) {
  :root { --motion-fast: 0ms; --motion-base: 0ms; }
}

/*!*******************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[3]!./design/designs/harbour-office.css ***!
  \*******************************************************************************************************************************************************************************************************************************************************************************/
/* =============================================================================
   Harbour Office — a DESIGN. Calm and near-monochrome, one signature hue.
   Light-first, with a dark ground for the same room after dark.

   It says nothing about row heights or tap targets: those are the UX profile's
   (design/profiles/). That separation is what lets a field worker in a
   bright warehouse use this design without inheriting a planner's density.
   ============================================================================= */

[data-design="harbour-office"] {
  --ground:             #F7F8F8;
  --surface:            #FFFFFF;
  --surface-raised:     #FFFFFF;
  --surface-sunken:     #F1F4F4;

  --on-ground:          #101A1C;
  --on-surface:         #101A1C;
  --muted:              #5C6B6B;
  --faint:              #8B9A9D;

  --border:             #DDE3E3;
  --border-strong:      #B9C4C4;

  --primary:            #17565B;
  --primary-hover:      #0F3E42;
  --on-primary:         #FFFFFF;

  --danger:             #A6321F;
  --on-danger:          #FFFFFF;
  --warning:            #8A6100;
  --on-warning:         #FFFFFF;
  --success:            #1F6B4A;
  --on-success:         #FFFFFF;

  --focus:              #0B57D0;

  --radius:             2px;
  --radius-lg:          3px;
  --border-width:       1px;

  --font-display:       "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --font-body:          "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono:          "IBM Plex Mono", ui-monospace, monospace;
  --display-weight:     600;
  --display-tracking:   -0.02em;
  --display-transform:  none;
}

/* Dark ground. Guarded so an explicit light choice beats a dark OS setting. */
@media (prefers-color-scheme: dark) {
  [data-design="harbour-office"]:not([data-ground="light"]) {
    --ground:             #0E1416;
    --surface:            #151E20;
    --surface-raised:     #1B2528;
    --surface-sunken:     #0A0F11;

    --on-ground:          #E7EDEE;
    --on-surface:         #E7EDEE;
    --muted:              #93A3A6;
    --faint:              #6E7E81;

    --border:             #253133;
    --border-strong:      #3A4A4D;

    --primary:            #4FA8A2;
    --primary-hover:      #6FC0BA;
    --on-primary:         #06201F;

    --danger:             #E8735E;
    --on-danger:          #2A0B06;
    --warning:            #E0A63C;
    --on-warning:         #251900;
    --success:            #4CB587;
    --on-success:         #042315;

    --focus:              #7FB0FF;
  }
}

/* Explicit dark choice wins in the other direction. */
[data-design="harbour-office"][data-ground="dark"] {
  --ground:             #0E1416;
  --surface:            #151E20;
  --surface-raised:     #1B2528;
  --surface-sunken:     #0A0F11;

  --on-ground:          #E7EDEE;
  --on-surface:         #E7EDEE;
  --muted:              #93A3A6;
  --faint:              #6E7E81;

  --border:             #253133;
  --border-strong:      #3A4A4D;

  --primary:            #4FA8A2;
  --primary-hover:      #6FC0BA;
  --on-primary:         #06201F;

  --danger:             #E8735E;
  --on-danger:          #2A0B06;
  --warning:            #E0A63C;
  --on-warning:         #251900;
  --success:            #4CB587;
  --on-success:         #042315;

  --focus:              #7FB0FF;
}

/*!*************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[3]!./design/designs/dry-dock.css ***!
  \*************************************************************************************************************************************************************************************************************************************************************************/
/* =============================================================================
   Dry Dock — a DESIGN. High contrast and hi-vis, built to be read in glare.

   Dark-first, with a DAYLIGHT ground: not "light mode" but a second operating
   condition, because dark grounds lose in direct sun — the display adds light,
   the sun adds more, and reflection flattens the difference. Daylight is chosen
   by a person on deck, so it deliberately does NOT follow prefers-color-scheme.

   Ergonomics are not here. Dry Dock is frequently paired with the Field profile,
   but the pairing is a choice, not a property of the design.
   ============================================================================= */

[data-design="dry-dock"] {
  --ground:             #15191C;
  --surface:            #1E2429;
  --surface-raised:     #262E34;
  --surface-sunken:     #0E1214;

  --on-ground:          #F2F4F5;
  --on-surface:         #F2F4F5;
  --muted:              #9AA5AC;
  --faint:              #8B989E;

  --border:             #2E373D;
  --border-strong:      #47535A;

  --primary:            #F26522;
  --primary-hover:      #FF7C3D;
  --on-primary:         #15191C;

  --danger:             #E23B2E;
  --on-danger:          #FFFFFF;
  --warning:            #F5A623;
  --on-warning:         #15191C;
  --success:            #2FA36B;
  --on-success:         #0E1214;

  --focus:              #7FB0FF;

  --radius:             3px;
  --radius-lg:          4px;
  --border-width:       1px;

  --font-display:       "Archivo", ui-sans-serif, system-ui, sans-serif;
  --font-body:          "Barlow", ui-sans-serif, system-ui, sans-serif;
  --font-mono:          "IBM Plex Mono", ui-monospace, monospace;
  --display-weight:     900;
  --display-tracking:   -0.015em;
  --display-transform:  uppercase;
}

/* DAYLIGHT ground.
   This is the worked example for semantic tokens: --primary is #F26522 above,
   which measures 5.6:1 on the dark ground but only 3.1:1 on white — a failure.
   Here it resolves to #B23F0E (5.8:1). A design shipping a literal
   --brand-orange would have been broken the moment the ground changed. */
[data-design="dry-dock"][data-ground="daylight"] {
  --ground:             #FFFFFF;
  --surface:            #FFFFFF;
  --surface-raised:     #FFFFFF;
  --surface-sunken:     #F0F2F3;

  --on-ground:          #0E1214;
  --on-surface:         #0E1214;
  --muted:              #4B565B;
  --faint:              #6B767B;

  --border:             #C9D0D3;
  --border-strong:      #8A9499;

  --primary:            #B23F0E;
  --primary-hover:      #8E3109;
  --on-primary:         #FFFFFF;

  --danger:             #B3271C;
  --on-danger:          #FFFFFF;
  --warning:            #7A5300;
  --on-warning:         #FFFFFF;
  --success:            #1F7A4D;
  --on-success:         #FFFFFF;

  --focus:              #0B57D0;
}

/*!************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[3]!./design/profiles/office.css ***!
  \************************************************************************************************************************************************************************************************************************************************************************/
/* =============================================================================
   Office — planner and coordinator at a desk, mouse and keyboard.
   Processing many items at once, so density is the point: more rows visible
   beats a comfortable row. Tap targets stay at the 44px accessibility floor
   because a pointer is precise, not because a finger is not used.
   ============================================================================= */
[data-ux="office"] {
  --space-unit:   4px;
  --row-height:   36px;
  --tap-min:      44px;
  --body-size:    15px;
  --body-leading: 1.55;
}

/*!***********************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[3]!./design/profiles/field.css ***!
  \***********************************************************************************************************************************************************************************************************************************************************************/
/* =============================================================================
   Field — a worker on site, one task at a time, photo-first.
   The glove is the input device, so 44px is not enough: 56px is the floor here.
   Body text is larger because it is read at arm's length in poor light, and
   leading is tighter because the blocks are short, not paragraphs.
   ============================================================================= */
[data-ux="field"] {
  --space-unit:   4px;
  --row-height:   64px;
  --tap-min:      56px;
  --body-size:    17px;
  --body-leading: 1.4;
}

/*!****************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[3]!./design/profiles/inspection.css ***!
  \****************************************************************************************************************************************************************************************************************************************************************************/
/* =============================================================================
   Inspection — a queue and a decision, on a tablet or at a desk.
   Between Office and Field on purpose: the queue rows are scanned like a list,
   but the accept/reject controls are pressed with a gloved hand on a walk-round.
   ============================================================================= */
[data-ux="inspection"] {
  --space-unit:   4px;
  --row-height:   56px;
  --tap-min:      48px;
  --body-size:    16px;
  --body-leading: 1.45;
}

/*!***************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[3]!./design/profiles/executive.css ***!
  \***************************************************************************************************************************************************************************************************************************************************************************/
/* =============================================================================
   Executive — a manager scanning for exceptions, editing almost nothing.
   Rows are slightly taller than Office because they are read rather than worked
   through, and there are far fewer of them; controls stay at the 44px floor
   since there is little to press.
   ============================================================================= */
[data-ux="executive"] {
  --space-unit:   4px;
  --row-height:   40px;
  --tap-min:      44px;
  --body-size:    15px;
  --body-leading: 1.55;
}

/*!*************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[3]!./app/globals.css ***!
  \*************************************************************************************************************************************************************************************************************************************************************/
/* The token contract first, then the two independent axes:
     designs/  what it looks like   (data-design + data-ground)
     profiles/ what it is shaped for (data-ux)
   Nothing below may use a literal colour, size or family — only tokens. A rule
   that reaches for a number instead of a token is how the two axes get welded
   back together. */

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--ground);
  color: var(--on-ground);
  font-family: var(--font-body);
  font-size: var(--body-size);
  line-height: var(--body-leading);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  text-transform: var(--display-transform);
  text-wrap: balance;
  margin: 0;
}

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.shell { max-width: 1000px; margin: 0 auto; padding: calc(var(--space-unit) * 8) calc(var(--space-unit) * 6); }

.bar {
  display: flex; align-items: center; gap: calc(var(--space-unit) * 3);
  flex-wrap: wrap; margin-bottom: calc(var(--space-unit) * 6);
  padding-bottom: calc(var(--space-unit) * 4);
  border-bottom: var(--border-width) solid var(--border);
}
.bar h1 { font-size: 22px; flex: 1 1 auto; }

.meta {
  font-family: var(--font-mono); font-size: 12px; color: var(--faint);
  letter-spacing: .06em; text-transform: uppercase;
}

/* -- the dev-only switcher: two axes, offered separately -------------------- */
.switch { display: flex; gap: calc(var(--space-unit)); flex-wrap: wrap; align-items: center; }
.switch-axis {
  font-family: var(--font-mono); font-size: 11px; color: var(--faint);
  letter-spacing: .06em; text-transform: uppercase; margin-left: calc(var(--space-unit) * 2);
}
.switch-axis:first-child { margin-left: 0; }
.switch button {
  min-height: var(--tap-min); padding: 0 calc(var(--space-unit) * 4);
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  color: var(--on-surface); background: var(--surface);
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius); cursor: pointer;
  transition: background var(--motion-fast) ease;
}
.switch button:hover { background: var(--surface-sunken); }
.switch button[aria-pressed='true'] {
  background: var(--primary); color: var(--on-primary); border-color: var(--primary);
}

/* -- ticket list ----------------------------------------------------------- */
.rows { border-top: var(--border-width) solid var(--border); }
.row {
  display: grid; grid-template-columns: auto 1fr auto auto;
  grid-gap: calc(var(--space-unit) * 4);
  gap: calc(var(--space-unit) * 4); align-items: center;
  min-height: var(--row-height);
  padding: calc(var(--space-unit) * 2) calc(var(--space-unit) * 3);
  border-bottom: var(--border-width) solid var(--border);
  background: var(--surface);
}
.row:hover { background: var(--surface-sunken); }
.row-id {
  font-family: var(--font-mono); font-size: 12.5px; color: var(--faint);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.row-title { color: var(--on-surface); font-weight: 500; }
.row-loc { color: var(--muted); font-weight: 400; }
.row-due {
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

/* State carries a glyph AND a word as well as a colour — colour alone fails in
   glare, through a scratched screen, and for colour vision deficiency. */
.pill {
  display: inline-flex; align-items: center; gap: calc(var(--space-unit) * 1.5);
  font-family: var(--font-display); font-weight: 600; font-size: 12px;
  letter-spacing: .04em; padding: calc(var(--space-unit)) calc(var(--space-unit) * 2.5);
  border-radius: var(--radius); white-space: nowrap;
}
.pill-glyph { font-family: var(--font-mono); }
.pill-progress { background: var(--primary); color: var(--on-primary); }
.pill-waiting  { background: var(--warning); color: var(--on-warning); }
.pill-overdue  { background: var(--danger);  color: var(--on-danger); }

/* -- custom fields, rendered at runtime from each project's definitions ----- */
.fields {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  grid-gap: 0 calc(var(--space-unit) * 6);
  gap: 0 calc(var(--space-unit) * 6);
  margin-top: calc(var(--space-unit) * 8);
  border-top: var(--border-width) solid var(--border);
  padding-top: calc(var(--space-unit) * 4);
}
.field { padding: calc(var(--space-unit) * 2) 0; border-bottom: var(--border-width) solid var(--border); }
.field dt { font-family: var(--font-mono); font-size: 11px; color: var(--faint); letter-spacing: .06em; text-transform: uppercase; }
.field dd { margin: calc(var(--space-unit) * 0.5) 0 0; color: var(--on-surface); font-weight: 500; }

.note { color: var(--muted); font-size: 13.5px; max-width: 66ch; margin-top: calc(var(--space-unit) * 3); }

/* =============================================================================
   Sign-in.
   The one unbranded screen: nothing here comes from a client profile, because
   nothing about a client is served before sign-in. Two columns where there is
   room, one where there is not — the second column is the form, so it is the one
   that survives the collapse.
   ============================================================================= */
.auth {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  min-height: 100vh;
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { min-height: 0; }
}

.auth-side {
  display: flex; flex-direction: column; justify-content: space-between;
  gap: calc(var(--space-unit) * 10);
  padding: calc(var(--space-unit) * 14) calc(var(--space-unit) * 12);
  background: var(--surface-sunken);
  border-right: var(--border-width) solid var(--border);
}
@media (max-width: 900px) {
  .auth-side {
    border-right: none;
    border-bottom: var(--border-width) solid var(--border);
    padding: calc(var(--space-unit) * 8) calc(var(--space-unit) * 6);
    gap: calc(var(--space-unit) * 5);
  }
}

.auth-brand { display: flex; align-items: center; gap: calc(var(--space-unit) * 3.5); }
.auth-mark { flex: none; }
.auth-wordmark {
  font-family: var(--font-display); font-size: 19px;
  font-weight: var(--display-weight); letter-spacing: var(--display-tracking);
  text-transform: var(--display-transform); color: var(--on-ground);
}

.auth-pitch { display: flex; flex-direction: column; gap: calc(var(--space-unit) * 4); }
.auth-pitch h2 { font-size: 34px; line-height: 1.12; max-width: 16ch; }
.auth-pitch p { margin: 0; color: var(--muted); max-width: 44ch; }

.auth-help {
  margin: 0; padding-top: calc(var(--space-unit) * 5);
  border-top: var(--border-width) solid var(--border);
  color: var(--faint); font-size: 13px; max-width: 46ch;
}

.auth-panel {
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  padding: calc(var(--space-unit) * 12) calc(var(--space-unit) * 6);
}

.auth-form { display: flex; flex-direction: column; gap: calc(var(--space-unit) * 6); width: min(380px, 100%); }
.auth-heading { display: flex; flex-direction: column; gap: calc(var(--space-unit) * 1.5); }
.auth-heading h1 { font-size: 24px; }
.auth-sub { margin: 0; color: var(--muted); font-size: 14px; }

.auth-field { display: flex; flex-direction: column; gap: calc(var(--space-unit) * 1.5); }
.auth-field label { font-size: 13px; color: var(--muted); }
.auth-field input, .auth-field select {
  min-height: var(--tap-min);
  padding: 0 calc(var(--space-unit) * 3);
  font-family: var(--font-body); font-size: var(--body-size);
  color: var(--on-surface); background: var(--surface);
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius);
}
.auth-field input:focus-visible, .auth-field select:focus-visible { border-color: var(--focus); }

.auth-submit {
  min-height: var(--tap-min);
  font-family: var(--font-display); font-size: var(--body-size); font-weight: 600;
  letter-spacing: var(--display-tracking); text-transform: var(--display-transform);
  color: var(--on-primary); background: var(--primary);
  border: var(--border-width) solid var(--primary); border-radius: var(--radius);
  cursor: pointer; transition: background var(--motion-fast) ease;
}
.auth-submit:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.auth-submit:disabled { opacity: .6; cursor: progress; }

/* A refusal must read as one without relying on colour: it is bordered, it is
   announced, and it says what to do. */
.auth-error {
  margin: 0; padding: calc(var(--space-unit) * 3);
  color: var(--on-danger); background: var(--danger);
  border-radius: var(--radius); font-size: 14px;
}

.auth-note { margin: 0; font-size: 13px; color: var(--faint); }

/* =============================================================================
   The signed-in shell: brand bar, system chooser, projects, contacts.
   Everything client-specific lives behind sign-in, so it all starts here.
   ============================================================================= */
.top {
  display: flex; align-items: center; justify-content: space-between;
  gap: calc(var(--space-unit) * 4);
  min-height: calc(var(--row-height) + var(--space-unit) * 5);
  padding: calc(var(--space-unit) * 2) calc(var(--space-unit) * 7);
  background: var(--surface);
  border-bottom: var(--border-width) solid var(--border);
  flex-wrap: wrap;
}
.top-brand { display: flex; align-items: center; gap: calc(var(--space-unit) * 3); min-width: 0; }
/* An administrator supplies the logo, so it is never trusted to size itself. */
.top-logo { max-height: 28px; width: auto; flex: none; }
.top-mark { flex: none; }
.top-name {
  font-family: var(--font-display); font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking); text-transform: var(--display-transform);
  color: var(--on-surface); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.top-system {
  font-family: var(--font-mono); font-size: 12px; color: var(--faint);
  padding-left: calc(var(--space-unit) * 3);
  border-left: var(--border-width) solid var(--border);
}
.top-user { display: flex; align-items: center; gap: calc(var(--space-unit) * 4); }

/* -- your own name, and everything behind it ------------------------------- */
.user { position: relative; }

.user-trigger {
  display: inline-flex; align-items: center; gap: calc(var(--space-unit) * 1.5);
  min-height: var(--tap-min); padding: 0 calc(var(--space-unit) * 3);
  font-family: var(--font-body); font-size: 14px;
  color: var(--on-surface); background: none;
  border: var(--border-width) solid transparent; border-radius: var(--radius);
  cursor: pointer;
}
.user-trigger:hover { background: var(--surface-sunken); }
.user-trigger[aria-expanded='true'] {
  background: var(--surface-sunken); border-color: var(--border);
}
.user-caret { color: var(--faint); font-size: 11px; }

.user-menu {
  position: absolute; top: calc(100% + var(--space-unit)); right: 0; z-index: 20;
  display: flex; flex-direction: column;
  min-width: 240px; padding: calc(var(--space-unit)) 0;
  /* The one place a raised surface is genuinely raised. */
  background: var(--surface-raised);
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 20px rgb(0 0 0 / 12%);
}

.user-item {
  display: flex; align-items: center;
  min-height: var(--tap-min); padding: 0 calc(var(--space-unit) * 4);
  width: 100%;
  font-family: var(--font-body); font-size: var(--body-size); text-align: left;
  color: var(--on-surface); background: none; border: none; border-radius: 0;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.user-item:hover { background: var(--surface-sunken); }
/* The menu is keyboard-driven, so the focused item has to be obvious inside it. */
.user-item:focus-visible { outline-offset: -2px; }

.user-rule {
  height: 0; margin: calc(var(--space-unit)) 0;
  border: none; border-top: var(--border-width) solid var(--border);
}
/* The form is only a wrapper for the server action; it must not break the row. */
.user-menu form { display: contents; }

.linklike {
  min-height: var(--tap-min); padding: 0 calc(var(--space-unit) * 2);
  font-family: var(--font-body); font-size: 14px;
  color: var(--primary); background: none; border: none; border-radius: var(--radius);
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.linklike:hover { color: var(--primary-hover); }

.chooser { margin-bottom: calc(var(--space-unit) * 12); }
.chooser h1 { font-size: 28px; margin-bottom: calc(var(--space-unit) * 2); }
.lede { margin: 0 0 calc(var(--space-unit) * 7); color: var(--muted); max-width: 62ch; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); grid-gap: calc(var(--space-unit) * 5); gap: calc(var(--space-unit) * 5); }
.card {
  display: flex; flex-direction: column; gap: calc(var(--space-unit) * 2);
  padding: calc(var(--space-unit) * 6);
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-lg);
}
/* Where you are is said in words as well as by the edge — a border alone is not
   a state anyone can read out loud. */
.card-active { border-color: var(--primary); }
.card-name {
  font-family: var(--font-display); font-size: 17px; font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking); text-transform: var(--display-transform);
  color: var(--on-surface);
}
.card-state { color: var(--faint); font-size: 13px; margin-bottom: calc(var(--space-unit) * 3); }

.button-primary, .button-secondary {
  min-height: var(--tap-min); padding: 0 calc(var(--space-unit) * 4);
  font-family: var(--font-display); font-size: var(--body-size); font-weight: 600;
  letter-spacing: var(--display-tracking); text-transform: var(--display-transform);
  border-radius: var(--radius); cursor: pointer;
  transition: background var(--motion-fast) ease;
}
.button-primary {
  color: var(--on-primary); background: var(--primary);
  border: var(--border-width) solid var(--primary);
}
.button-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.button-secondary {
  color: var(--primary); background: var(--surface);
  border: var(--border-width) solid var(--primary);
}
.button-secondary:disabled { color: var(--muted); border-color: var(--border); cursor: default; }

.project-list { list-style: none; margin: 0; padding: 0; border-top: var(--border-width) solid var(--border); }
.project {
  display: flex; align-items: baseline; gap: calc(var(--space-unit) * 4);
  flex-wrap: wrap;
  min-height: var(--row-height);
  padding: calc(var(--space-unit) * 2) calc(var(--space-unit) * 3);
  border-bottom: var(--border-width) solid var(--border);
  background: var(--surface);
}
.project-name { color: var(--on-surface); font-weight: 500; }
.project-desc { color: var(--muted); font-size: 13.5px; }

.empty {
  margin: 0; padding: calc(var(--space-unit) * 6);
  color: var(--muted); background: var(--surface-sunken);
  border-radius: var(--radius); max-width: 66ch;
}

.contacts { margin-top: calc(var(--space-unit) * 12); padding-top: calc(var(--space-unit) * 6); border-top: var(--border-width) solid var(--border); }
.contacts h2 { font-size: 15px; margin-bottom: calc(var(--space-unit) * 4); }
.contact-list { display: flex; flex-wrap: wrap; gap: calc(var(--space-unit) * 8); margin: 0; }
.contact { display: flex; flex-direction: column; gap: calc(var(--space-unit) * 0.5); }
.contact dt { font-family: var(--font-mono); font-size: 11px; color: var(--faint); letter-spacing: .06em; text-transform: uppercase; }
.contact dd { margin: 0; }
.contact a { color: var(--primary); }
.contact-emergency dt { color: var(--danger); }
.contact-emergency a { color: var(--danger); }

.user-external { margin-left: auto; padding-left: calc(var(--space-unit) * 3); color: var(--faint); font-size: 12px; }

/* -- my account ------------------------------------------------------------ */
.account-form {
  display: flex; flex-direction: column; gap: calc(var(--space-unit) * 5);
  max-width: 380px;
}
.account-saved {
  margin: 0; padding: calc(var(--space-unit) * 3);
  color: var(--on-success); background: var(--success);
  border-radius: var(--radius); font-size: 14px;
}

