/* Manager Drag and the join page.
 *
 * Touch source of truth: the native Applicator Drag shell, NOT web/site/style.css
 * (that is the old web client). Tokens: native/crates/drag-ui/src/theme.rs
 * (Theme::for_mode Night / Day; rgba alphas are theme.rs's u8 / 255).
 * Surfaces: native/crates/drag-ui/src/widgets.rs, cited per rule below.
 * INTERFACE.md U1: one glass/pill family, 9 px backdrop blur with the Safari
 * prefix, 20 px/600 pill type; sheets and dialogs are solid.
 * Pages follow prefers-color-scheme (native: Night default, Day in glare).
 * Desktop Manager styling is in desktop.css (INTERFACE.md U1).
 * No inline styles anywhere: the Worker's CSP is style-src 'self'. */

@font-face {
  font-family: "Plex Mono";
  src: url("/fonts/ibm-plex-mono-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

/* theme.rs ThemeMode::Night */
:root {
  color-scheme: dark;
  --ground: #141517; --panel: #202123; --panel-2: #2b2c2f; --panel-3: #35363a;
  --ink: #f5f5f7; --ink-dim: #a1a1a8; --rule: #36373b; --rule-2: #48494e;
  --accent: #0a94ff; --accent-ink: #fff;
  --selection: #152e43;
  --selection-glass: rgba(21, 46, 67, .78);          /* selected_glass: selection at alpha 199 */
  --good: #59d87c; --warn: #ffb340; --bad: #ff6961;
  --destructive: rgb(196, 61, 53);                    /* shell.rs destructive_confirm_btn */
  --glass: rgba(48, 49, 53, .36);                     /* 0x303135 a92 */
  --glass-soft: rgba(35, 36, 39, .29);                /* 0x232427 a74 */
  --glass-edge: rgba(255, 255, 255, .16);             /* a41 */
  --glass-edge-strong: rgba(255, 255, 255, .24);      /* a61 */
  --glass-shadow: rgba(0, 0, 0, .36);                 /* a92 */
  --glass-shadow-low: rgba(0, 0, 0, .24);             /* a61 */
  --high-shadow: rgba(0, 0, 0, .46);                  /* high_shadow_colors: a117 at night */
  --high-shadow-low: rgba(0, 0, 0, .30);              /* a77 */
  --lift-shadow: rgba(0, 0, 0, .36);
  --lift-shadow-low: rgba(0, 0, 0, .24);
  /* Map-like ground behind the glass: native draws the field map there. */
  --m-field: #282c2f; --m-lattice: rgba(102, 110, 115, .16); --m-pass: rgba(89, 216, 124, .03);
}
/* theme.rs ThemeMode::Day */
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --ground: #e4e7eb; --panel: #f5f5f7; --panel-2: #fff; --panel-3: #e5e5e9;
    --ink: #16171b; --ink-dim: #62636b; --rule: #d5d6dc; --rule-2: #bfc1c8;
    --accent: #0073e6; --accent-ink: #fff;
    --selection: #e1efff;
    --selection-glass: rgba(225, 239, 255, .78);
    --good: #187535; --warn: #975700; --bad: #ba2525;
    --glass: rgba(255, 255, 255, .36);
    --glass-soft: rgba(245, 247, 250, .31);
    --glass-edge: rgba(255, 255, 255, .82);           /* a209 */
    --glass-edge-strong: rgba(255, 255, 255, .95);    /* a242 */
    --glass-shadow: rgba(40, 50, 65, .18);            /* 0x283241 a46: blue-grey */
    --glass-shadow-low: rgba(40, 50, 65, 0);          /* day omits the low layer */
    --high-shadow: rgba(40, 50, 65, .24);             /* a61 */
    --high-shadow-low: rgba(40, 50, 65, 0);
    --lift-shadow: rgba(40, 50, 65, .22);             /* a56 */
    --lift-shadow-low: rgba(40, 50, 65, .14);         /* a36 */
    --m-field: #f9fafb; --m-lattice: rgba(127, 137, 144, .13); --m-pass: rgba(48, 191, 72, .035);
  }
}

:root {
  /* glass() and drop_shadow(): CSS 34px/10px blur = Skia sigma 17/5, offsets 14/3. */
  --shadow-glass: 0 14px 34px var(--glass-shadow), 0 3px 10px var(--glass-shadow-low);
  /* solid_high() / soft_glass(): sigma 24/8, offsets 20/5. */
  --shadow-high: 0 20px 48px var(--high-shadow), 0 5px 16px var(--high-shadow-low);
  /* segmented_lift(): sigma 6/2, offsets 6/2. */
  --shadow-lift: 0 6px 12px var(--lift-shadow), 0 2px 4px var(--lift-shadow-low);
  /* selected_glass(): one black a51 shadow, sigma 14, offset 12. */
  --shadow-selected: 0 12px 28px rgba(0, 0, 0, .2);
  --blur: blur(9px) saturate(145%);                   /* GLASS_BLUR_SIGMA = 9, set_saturation(1.45) */
  --pill: 9999px;                                     /* native radius r.h / 2 */
  --tap: 64px;                                        /* U1: >= 56; rail pills are 68 */
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  position: relative; margin: 0; min-height: 100vh; color: var(--ink);
  font: 500 18px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
  background-color: var(--ground);
}
/* A quiet field map for the glass to show: two lattice directions, faint
   application passes and a few field-coloured patches. One layer over the
   whole document (not background-attachment: fixed, which iOS Safari
   ignores), so it scrolls under the sticky glass like the map does. */
body::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    repeating-linear-gradient(118deg, var(--m-lattice) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(28deg, var(--m-lattice) 0 1px, transparent 1px 92px),
    repeating-linear-gradient(118deg, var(--m-pass) 0 18px, transparent 18px 46px),
    radial-gradient(ellipse 60% 45% at 12% 18%, var(--m-field), transparent 70%),
    radial-gradient(ellipse 55% 50% at 88% 70%, var(--m-field), transparent 70%),
    radial-gradient(ellipse 45% 35% at 40% 95%, var(--m-field), transparent 70%);
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.03em; }
h1 { font-size: 32px; line-height: 1.15; }
h2 { font-size: 24px; line-height: 1.2; }
h3 { font-size: 19px; letter-spacing: -.02em; }
p { margin: 0; }
.dim { color: var(--ink-dim); }
.small { font-size: 15px; font-weight: 400; }
.eyebrow { font-size: 14px; font-weight: 600; color: var(--ink-dim); letter-spacing: .025em; }

/* ---------- brand (native title: the blue mark with its floating shadow) ---------- */
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-mark { width: 48px; height: 48px; flex: none; display: grid; place-items: center; background: var(--accent); border-radius: 14px; color: #fff; box-shadow: var(--shadow-glass); }
.brand-mark svg { width: 30px; height: 30px; }
.brand-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand-text b { font-size: 22px; font-weight: 650; letter-spacing: -.035em; white-space: nowrap; }
.brand-text span { color: var(--ink-dim); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- pills: button_sized() ---------- */
/* Surface::Solid: panel2, glass_edge hairline, solid_raised() shadows. The
   sheet buttons, which sit on a solid surface and take no backdrop blur (U1). */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--tap); padding: 0 26px; border-radius: var(--pill);
  border: 1px solid var(--glass-edge); background: var(--panel-2); color: var(--ink);
  box-shadow: var(--shadow-glass);
  font-size: 20px; font-weight: 600; line-height: 1.2; text-align: center; text-decoration: none;
}
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:active:not(:disabled) { filter: brightness(1.12); }
/* Surface::Accent: solid accent, accent_ink, glass_edge_strong, drop_shadow(). */
.btn.primary { background: var(--accent); border-color: var(--glass-edge-strong); color: var(--accent-ink); }
/* shell.rs destructive_btn: Solid surface, label in t.bad. */
.btn.danger { color: var(--bad); }
/* shell.rs destructive_confirm_btn: rgb(196,61,53) solid_raised, white label. */
.btn.danger.solid { background: var(--destructive); border-color: var(--glass-edge); color: #fff; }
/* Surface::Glass, for a pill that floats over content. */
.btn.glass { background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.btn.quiet { background: transparent; border-color: transparent; box-shadow: none; color: var(--accent); }
.btn.quiet:hover:not(:disabled) { border-color: var(--glass-edge); }
.btn.big { min-height: 72px; font-size: 21px; padding: 0 32px; }
.btn.wide { width: 100%; }
/* button_sized at 17 px (horizontal padding 10 at <= 17 px). */
.btn.compact { min-height: 52px; font-size: 17px; padding: 0 20px; }
.btn .spin { width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn .spin { animation-duration: 3s; } }

/* ---------- inputs: the library search pill, soft_glass() ---------- */
label.field { display: flex; flex-direction: column; gap: 8px; }
label.field > span:not(.input-row) { font-size: 15px; font-weight: 600; color: var(--ink-dim); padding-left: 8px; }
.input {
  width: 100%; min-height: var(--tap); padding: 0 24px; border-radius: var(--pill);
  border: 1px solid var(--glass-edge); background: var(--glass-soft); color: var(--ink);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--shadow-high);
  font-size: 19px; font-weight: 500;
}
.input::placeholder { color: var(--ink-dim); font-weight: 400; }
/* Focused search: an accent ring 5.5 px outside the pill (shell.rs). */
.input:focus { outline: 3px solid var(--accent); outline-offset: 4px; }
.input-row { display: flex; gap: 10px; align-items: stretch; }
.input-row .input { flex: 1; min-width: 0; }
.hint { font-size: 15px; font-weight: 400; color: var(--ink-dim); }

/* ---------- segmented: segmented_track() + segmented_lift() ---------- */
.segmented {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 5px;
  border-radius: var(--pill); background: var(--panel); border: 1px solid var(--rule); box-shadow: var(--shadow-glass);
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 56px; padding: 0 12px; border-radius: var(--pill); border: 1px solid transparent; cursor: pointer;
  font-size: 18px; font-weight: 600; color: var(--ink-dim); line-height: 1.15;
}
.segmented label:hover { color: var(--ink); }
.segmented input:checked + label { background: var(--panel-2); border-color: var(--glass-edge-strong); color: var(--accent); box-shadow: var(--shadow-lift); }
.segmented input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Messages stay in the reading flow, without a box or decorative stripe. */
.note { padding: 0; background: transparent; font-size: 15px; font-weight: 400; color: var(--ink-dim); }
.note.bad { color: var(--bad); }
.note.good { color: var(--good); }

/* ---------- sheets: solid_high(panel, glass_edge, 28) ---------- */
.card {
  position: relative; background: var(--panel); border: 1px solid var(--glass-edge);
  border-radius: 28px; padding: 28px; box-shadow: var(--shadow-high);
}
.stack { display: flex; flex-direction: column; gap: 18px; }
.stack.tight { gap: 10px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }

/* ---------- single-sheet pages: sign-in, setup, join ---------- */
.solo { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 40px 16px; gap: 28px; }
.solo > .brand { width: 100%; max-width: 520px; }
.solo > .card { width: 100%; max-width: 520px; }
.solo h1 { margin-bottom: 6px; }
.or { display: flex; align-items: center; gap: 14px; color: var(--ink-dim); font-size: 15px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.foot { max-width: 520px; text-align: center; color: var(--ink-dim); font-size: 14px; font-weight: 400; }

/* Setup choices: a pill per method (Solid surface), selected_glass when ticked. */
.choice {
  position: relative; display: grid; grid-template-columns: 26px 1fr; gap: 2px 14px; align-items: start;
  padding: 16px 30px; border-radius: var(--pill); border: 1px solid var(--glass-edge); background: var(--panel-2);
  box-shadow: var(--shadow-glass); cursor: pointer;
}
.choice input { width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--accent); grid-row: 1 / 3; }
.choice b { font-size: 20px; font-weight: 600; }
.choice span { font-size: 15px; font-weight: 400; color: var(--ink-dim); grid-column: 2; }
.choice:has(input:checked) { background: var(--selection-glass); border: 2px solid var(--accent); padding: 15px 29px; box-shadow: var(--shadow-selected); }
.subform { padding: 4px 0 0; }

/* The link box: the invite or join link in a mono face, selectable. An inner
   block on the sheet (panel2, radius 22, as the sheet's own groups). */
.link-box {
  width: 100%; padding: 18px 22px; border-radius: 22px; background: var(--panel-2); border: 1px solid var(--rule);
  font: 400 16px/1.45 "Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink);
  overflow-wrap: anywhere; word-break: break-all; user-select: all;
}
ol.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 14px; }
ol.steps li { counter-increment: step; display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: center; font-size: 18px; }
ol.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--selection-glass); border: 2px solid var(--accent); color: var(--accent); font-weight: 700; font-size: 17px;
}
.kbd { font-weight: 650; }

/* ---------- dashboard ---------- */
/* The bar is translucent so the page shows through as it scrolls under; its
   controls are the map's floating glass pills. */
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 18px;
  padding: 12px 24px; min-height: 92px;
  background: color-mix(in srgb, var(--ground) 62%, transparent);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--glass-edge);
}
.tabs { display: flex; gap: 10px; margin-left: auto; }
/* Surface::Glass pills; the current one is Surface::Selected (selected_glass). */
.tabs a {
  display: flex; align-items: center; justify-content: center; min-height: var(--tap); padding: 0 24px;
  border-radius: var(--pill); border: 1px solid var(--glass-edge); background: var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow-glass);
  color: var(--ink); font-size: 20px; font-weight: 600; text-decoration: none; white-space: nowrap; text-align: center;
}
.tabs a:hover { border-color: var(--accent); }
.tabs a[aria-current="page"] {
  background: var(--selection-glass); border: 2px solid var(--accent); padding: 0 23px;
  color: var(--accent); box-shadow: var(--shadow-selected);
}
main.dash { max-width: 1120px; margin: 0 auto; padding: 32px 24px 64px; }
.view { display: flex; flex-direction: column; gap: 28px; }
.view-head { display: flex; flex-direction: column; gap: 6px; padding: 0 4px; }
.view-head p { color: var(--ink-dim); font-size: 17px; font-weight: 400; }
.view-action { align-self: flex-start; margin-top: 8px; }
.workspace-toolbar { display: flex; flex-direction: column; gap: 16px; }
.card.people-workspace { padding: 0; border: 0; background: transparent; box-shadow: none; }
.invite-activity { display: flex; flex-direction: column; gap: 4px; }
/* Native dialog supplies focus containment, Escape and focus restoration. */
.invite-dialog { width: min(480px, calc(100% - 32px)); max-height: calc(100dvh - 32px); margin: auto; color: var(--ink); overflow-y: auto; }
.invite-dialog:not([open]) { display: none; }
.invite-dialog::backdrop { background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
body:has(.invite-dialog[open]) { overflow: hidden; }
.settings-workspace { display: flex; flex-direction: column; gap: 24px; }
.settings-section { display: flex; flex-direction: column; gap: 24px; }
.settings-heading { display: flex; flex-direction: column; gap: 8px; }
.settings-content { min-width: 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 28px; align-items: start; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 4px; }
.count { color: var(--ink-dim); font-size: 15px; font-weight: 500; }

/* Invite result */
.result { display: flex; flex-direction: column; gap: 16px; }
.result .copy-row { display: flex; gap: 10px; }
.result .copy-row .btn { flex: 1; }

/* Lists: rows are inner blocks on the sheet (panel2, radius 22; shell.rs). */
.list { display: flex; flex-direction: column; gap: 10px; }
.item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; align-items: center;
  padding: 16px 18px 16px 22px; border-radius: 22px; background: var(--panel-2); border: 1px solid var(--rule);
}
.item.revoked, .item.expired { background: transparent; }
.item.revoked .item-main, .item.expired .item-main { opacity: .72; }
.item-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.item-title { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 18px; font-weight: 600; }
.item-title .name { overflow-wrap: anywhere; }
.item-meta { font-size: 15px; font-weight: 400; color: var(--ink-dim); overflow-wrap: anywhere; }
.item-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.item .confirm, .item .inline-form { grid-column: 1 / -1; }
.pill { display: inline-flex; align-items: center; min-height: 26px; padding: 0 11px; border-radius: var(--pill); font-size: 13px; font-weight: 700; letter-spacing: .02em; background: var(--panel-3); color: var(--ink-dim); }
.pill.pending { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.pill.used { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.pill.revoked { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.empty { padding: 22px; border-radius: 22px; border: 1.5px dashed var(--rule-2); color: var(--ink-dim); font-size: 16px; font-weight: 400; text-align: center; }

/* Inline confirm and inline forms inside a row or sheet */
.confirm { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: 22px; background: color-mix(in srgb, var(--bad) 10%, var(--panel)); }
.confirm p { font-size: 16px; }
.inline-form { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: 22px; background: var(--panel-3); }

/* People and devices */
.group { display: flex; flex-direction: column; gap: 14px; }
#people > .group.card > .account { padding: 0; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; background: transparent; box-shadow: none; }
#people > .group.card > .account:last-child { padding-bottom: 0; border-bottom: 0; }
.account { display: block; min-width: 0; }
.account-summary { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 12px 4px; border-radius: 8px; cursor: pointer; list-style: none; }
.account-summary::-webkit-details-marker { display: none; }
.account-summary .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; font-weight: 650; }
.account-summary .pill { flex: none; }
.account-summary::after { content: ""; flex: none; width: 7px; height: 7px; margin: 0 5px 0 auto; border-right: 1.5px solid var(--ink-dim); border-bottom: 1.5px solid var(--ink-dim); transform: rotate(-45deg); }
.account[open] > .account-summary::after { transform: rotate(45deg); }
.account-summary:focus-visible { outline-offset: -2px; }
.account-content { padding: 0 4px 18px; }
.account-head { display: flex; gap: 12px 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.account.revoked { opacity: .75; }
.devices { display: flex; flex-direction: column; gap: 8px; }

/* Your sign-in */
.reauth { border: 1px solid var(--rule); }
/* Scrolled-to cards clear the sticky header. */
.card, .item { scroll-margin-top: 120px; }

/* Toast: widgets::toast, the shared glass pill at 20 px/600, min height 68. */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 20;
  max-width: min(560px, calc(100% - 32px)); min-height: 68px; display: flex; align-items: center; padding: 18px 28px;
  border-radius: 34px; border: 1px solid var(--glass-edge); background: var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow-glass);
  color: var(--ink); font-size: 20px; font-weight: 600; text-align: center;
}

/* ---------- narrow screens: phones (16 px gutters, no sideways scroll) ---------- */
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  body { font-size: 17px; }
  h1 { font-size: 28px; }
  h2 { font-size: 22px; }
  .top { flex-wrap: wrap; padding: 10px 16px 12px; gap: 10px; min-height: 0; }
  .brand-mark { width: 42px; height: 42px; border-radius: 12px; }
  .brand-mark svg { width: 26px; height: 26px; }
  .brand-text b { font-size: 20px; }
  .tabs { margin-left: 0; width: 100%; gap: 6px; }
  .tabs a { flex: 1; min-height: 56px; padding: 0 8px; font-size: 15px; white-space: normal; line-height: 1.15; }
  .tabs a[aria-current="page"] { padding: 0 7px; }
  main.dash { padding: 22px 16px 56px; }
  .card { padding: 22px 16px; border-radius: 26px; }            /* compact_sheet radius 26 */
  .account { padding: 18px 14px; }
  .solo { padding: 24px 16px; gap: 20px; }
  .item { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; }
  .item-actions { justify-content: flex-start; }
  .segmented label { font-size: 16px; min-height: 52px; padding: 0 4px; }
  .result .copy-row { flex-direction: column; }
  .choice { padding: 14px 24px; }
  .choice:has(input:checked) { padding: 13px 23px; }
  .btn.big { min-height: 68px; }
  .toast { bottom: 24px; font-size: 18px; }
}

/* ---------- FieldOps view (fieldops.js) ---------- */
/* Skipped import: the warn tone of the other pills' pattern. */
.pill.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
/* A row's own message spans the row, like its confirm. */
.item > .note { grid-column: 1 / -1; }
.item-main .note.small { margin-top: 6px; font-size: 15px; }
/* Growers > farm > fields trail: compact Solid pills (button_sized at 17 px),
   the current level plain text. */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.crumb {
  min-height: 52px; padding: 0 18px; border-radius: var(--pill); border: 1px solid var(--glass-edge);
  background: var(--panel-2); color: var(--accent); font-size: 17px; font-weight: 600; overflow-wrap: anywhere; text-align: left;
}
.crumb:hover { border-color: var(--accent); }
.crumb.current { display: inline-flex; align-items: center; border-color: transparent; background: transparent; color: var(--ink); padding: 0 4px; }
.crumb-sep { color: var(--ink-dim); font-size: 18px; }

/* ---------- Grids view (grids.js) ---------- */
/* The open field's row, and the current version in its history: the
   selected_glass accent edge the tabs use, inside the row's own radius. */
.item.selected { border: 2px solid var(--accent); padding: 15px 17px 15px 21px; }
.item-main .gv { margin-top: 8px; }
/* The lattice drawing: an inner block like the link box (panel3, radius 16),
   the outline in the field tint and the block lines in the accent. Strokes
   stay at screen width whatever the field's size in metres. */
.gv { width: 100%; max-width: 360px; border-radius: 16px; background: var(--panel-3); overflow: hidden; }
.gv svg { display: block; width: 100%; height: 200px; }
.gv-field { fill: color-mix(in srgb, var(--good) 12%, transparent); fill-rule: evenodd; stroke: var(--ink-dim); stroke-width: 1.5px; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.gv-clip { clip-rule: evenodd; }
.gv-lines line { stroke: var(--accent); stroke-width: 1.25px; vector-effect: non-scaling-stroke; }
@media (max-width: 760px) {
  .item.selected { padding: 13px 15px; }
  .gv svg { height: 170px; }
}

/* ---------- join page: Hose Reel Drag steps (join.html) ---------- */
/* The phone steps are two lists split by the download button; the second
   continues the count (ol.steps resets its own counter, so start= alone is
   ignored). */
ol.steps[start="2"] { counter-reset: step 1; }

/* Manager additions retain usable touch targets below the desktop breakpoint. */
.nav-icon, .nav-section, .sidebar-footer, .grid-detail-placeholder { display: none; }
.skip-link { position: fixed; left: 16px; top: -100px; z-index: 30; padding: 12px; background: var(--panel); }
.skip-link:focus { top: 16px; }
.search-field { position: relative; display: block; }
.search-field svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-dim); z-index: 1; pointer-events: none; }
.search-field .input { padding-left: 46px; }
.access-details summary { cursor: pointer; font-weight: 600; }
.access-details p { margin-top: 12px; }

/* Wrap navigation before it can shrink the mark under a neighboring tab. */
.manager-shell .top { flex-wrap: wrap; }
.manager-shell .top .brand { flex-shrink: 0; }

/* Field directory and field history. Farms keep their client identity. */
.fields-workspace { min-width: 0; border: 1px solid var(--rule); border-radius: 20px; background: var(--panel); overflow: hidden; }
.fields-toolbar { display: flex; align-items: center; gap: 16px; padding: 20px; flex-wrap: wrap; }
.fields-toolbar .search-field { flex: 1 1 240px; min-width: 0; }
.fields-toolbar .segmented { width: 240px; }
.fields-directory { overflow-y: auto; padding: 12px 20px; border-block: 1px solid var(--rule); max-height: 300px; }
.directory-button { display: flex; gap: 12px; justify-content: space-between; align-items: center; width: 100%; min-height: 52px; padding: 12px; text-align: left; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: inherit; cursor: pointer; }
.directory-button > span:first-child { overflow-wrap: anywhere; }
.directory-button:hover { background: var(--panel-2); }
.directory-button[aria-pressed="true"] { background: var(--selection-glass); color: var(--accent); }
.client-group { margin-top: 20px; }
.client-group h3 { padding: 0 12px 8px; font-size: 14px; color: var(--ink-dim); overflow-wrap: anywhere; }
.fields-content { min-width: 0; min-height: 0; padding: 20px; scrollbar-width: thin; }
.fields-content > .note:not([hidden]) { margin-bottom: 20px; }
#field-list-client:empty { display: none; }
.field-row { display: grid; width: 100%; min-height: 76px; grid-template-columns: minmax(0, 1fr) auto 12px; align-items: center; gap: 12px; padding: 16px 4px; border: 0; border-bottom: 1px solid var(--rule); background: transparent; color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.field-row:hover { background: var(--panel-2); }
.field-row-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.field-acreage { color: var(--ink-dim); font-size: 12px; text-align: right; }
.field-row-arrow { color: var(--ink-dim); }
#field-back { align-self: flex-start; }
#gh-title, #gh-sub { overflow-wrap: anywhere; }
.field-overview { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 20px; }
.field-overview .gv { width: 100%; max-width: none; }
.field-overview .gv svg { height: 180px; }
.field-area { font-size: 24px; }
.field-history-heading { padding-top: 16px; }
.field-history-section { border-top: 1px solid var(--rule); }
.field-history-section > summary { min-height: 56px; padding: 16px 0; font-weight: 600; cursor: pointer; }
.history-body { padding: 4px 0 20px; }
.field-event { border-bottom: 1px solid var(--rule); padding: 16px 0; overflow-wrap: anywhere; }
.field-event p { margin-top: 4px; }

/* Skip-to-workspace focuses this container; an outline around the entire
   page would run behind the fixed sidebar. Controls keep their focus rings. */
main.dash:focus-visible { outline: none; }

#field-detail { scroll-margin-top: 180px; }

/* Needs attention (fieldops.js): failed and skipped imports, above the field list. */
.attention-group { display: flex; flex-direction: column; gap: 8px; }
.attention-group h3 { margin: 0; padding: 0 4px; font-size: 16px; font-weight: 700; }
.attention-group[data-group="failed"] h3 { color: var(--bad); }
.attention-group[data-group="skipped"] h3 { color: var(--warn); }
.attention-list { display: flex; flex-direction: column; gap: 6px; }
.attention-entry {
  display: flex; flex-direction: column; gap: 3px; width: 100%; padding: 10px 14px; text-align: left;
  font: inherit; color: var(--ink); background: var(--panel-2); border: 1px solid var(--glass-edge);
  border-radius: 14px; cursor: pointer;
}
.attention-entry:hover { border-color: var(--accent); }
.attention-entry:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.attention-entry .name { font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.item.flash { outline: 3px solid var(--warn); outline-offset: -3px; }
/* Count on the FieldOps sidebar entry. */
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px;
  position: absolute; top: -6px; right: -6px; border-radius: 10px; box-shadow: 0 0 0 2px var(--ground); font-size: 12px; font-weight: 700; line-height: 1;
  background: var(--warn); color: var(--ground);
}
.tabs a { position: relative; }
.nav-badge[hidden] { display: none; }
