/* Mighty Dig: the permit service's own pages (the site page, sign-in, admin, your account, the standalone app).
   The panel's own look: the same colour tokens, sizes and controls (packages/panel/src/styles.ts). Mobile first.
   (c) Mighty Spatial Pty Ltd. Proprietary. */

:root {
  --md-accent: #12653f;
  --md-accent-dark: #0e4b38;
  --md-accent-strong: #0e4b38;
  --md-accent-soft: #e7f1eb;
  --md-accent-ink: #ffffff;
  --md-ink: #0b1a14;
  --md-ink-2: #46564e;
  --md-muted: #66756d;
  --md-surface: #ffffff;
  --md-surface-2: #f6f8f7;
  --md-line: #e3e8e5;
  --md-line-2: #cfd8d3;
  --md-warn: #a8670b;
  --md-warn-ink: #6d4407;
  --md-warn-wash: #fff6e2;
  --md-warn-line: #f0c46b;
  --md-good: #157a3c;
  --md-good-wash: #e6f4ea;
  --md-crit: #b42f27;
  --md-crit-wash: #fdecea;
  --md-info-wash: #eef4fb;
  --md-info-line: #c7d9ef;
  --md-radius: 10px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--md-surface-2);
  color: var(--md-ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-wrap: anywhere;
}
a { color: var(--md-accent-strong); }
h1 { font-size: 20px; line-height: 1.25; margin: 0 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 16px; margin: 0 0 8px; }
p { margin: 6px 0 12px; }
small, .sub { color: var(--md-ink-2); }
.sub { font-size: 13.5px; }
.tnum { font-variant-numeric: tabular-nums; }

/* The bar along the top: the mark and where you are. */
.bar {
  display: flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 8px 16px;
  background: var(--md-surface); border-bottom: 1px solid var(--md-line);
  position: sticky; top: 0; z-index: 5;
}
.bar .mark { display: inline-flex; align-items: center; gap: 8px; color: var(--md-ink); text-decoration: none; font-weight: 750; letter-spacing: -0.01em; flex: 0 0 auto; white-space: nowrap; }
.bar .mark svg { width: 26px; height: 26px; color: var(--md-accent); flex: 0 0 auto; }
.bar .where { color: var(--md-ink-2); font-size: 13.5px; min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .end { margin-left: auto; display: flex; gap: 8px; align-items: center; font-size: 13.5px; flex: 0 0 auto; white-space: nowrap; }
/* The user guide's "?" (/guide/), at the end of the bar on the Console's pages and the app. */
.bar .help { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--md-line-2); color: var(--md-ink-2); font-weight: 700; text-decoration: none; }
.bar .help:hover { border-color: var(--md-accent-strong); color: var(--md-accent-strong); }
/* The foot of the Console's pages: the privacy policy and the user guide. */
footer.legal { text-align: center; font-size: 12.5px; color: var(--md-muted); padding: 4px 16px 28px; }
footer.legal a { color: var(--md-ink-2); }
.privacy-note { margin-top: 12px; }

.wrap { max-width: 560px; margin: 0 auto; padding: 14px 16px 40px; display: grid; gap: 12px; }
.wrap > * { min-width: 0; }
.wrap.wide { max-width: 1080px; }

.card { background: var(--md-surface); border: 1px solid var(--md-line); border-radius: var(--md-radius); padding: 14px; min-width: 0; }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.lbl { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--md-ink-2); margin: 0 0 6px; }
.ref { font-weight: 700; font-size: 13px; color: var(--md-ink-2); font-variant-numeric: tabular-nums; }

dl.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 10px 0 0; font-size: 14px; }
dl.kv dt { color: var(--md-ink-2); }
dl.kv dd { margin: 0; min-width: 0; }

/* Buttons: the panel's main button, a quiet one, and a row of them. */
button, .btn { font: inherit; cursor: pointer; }
.main, .ghost, .danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 16px; border-radius: 9px; font-weight: 650; font-size: 15px; line-height: 1.2;
  text-decoration: none; text-align: center;
}
.main { border: 0; background: var(--md-accent); color: var(--md-accent-ink); }
.main:hover:not(:disabled) { background: var(--md-accent-dark); }
.ghost { border: 1px solid var(--md-line-2); background: var(--md-surface); color: var(--md-ink); }
.ghost:hover:not(:disabled) { border-color: var(--md-accent-strong); }
.danger { border: 1px solid #f1b4ae; background: var(--md-surface); color: var(--md-crit); }
.danger:hover:not(:disabled) { background: var(--md-crit-wash); }
.main:disabled, .ghost:disabled, .danger:disabled { opacity: 0.55; cursor: default; }
.wide-btn { width: 100%; }
.field + .wide-btn, form > .main.wide-btn, .tick + .wide-btn { margin-top: 14px; }
details { margin-top: 14px; }
details > summary { cursor: pointer; color: var(--md-accent-strong); font-weight: 600; font-size: 14px; padding: 4px 0; }
details[open] > summary { margin-bottom: 2px; }
#crew-done > :last-child, #mine > :last-child { margin-bottom: 0; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row > .main, .row > .ghost, .row > .danger { flex: 1 1 160px; }
.small-btn { min-height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 8px; }

/* Fields */
.field { display: grid; gap: 5px; margin: 10px 0 0; }
.field > label, .field > .l { font-weight: 650; font-size: 14px; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="search"], input:not([type]), select, textarea {
  width: 100%; min-height: 44px; padding: 10px 11px; border: 1px solid var(--md-line-2); border-radius: 8px;
  background: var(--md-surface); color: var(--md-ink); font: inherit;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--md-accent-soft); outline-offset: 1px; border-color: var(--md-accent-strong);
}
.tick { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--md-line-2); border-radius: 9px; background: var(--md-surface); margin-top: 10px; cursor: pointer; }
.tick input { width: 22px; height: 22px; margin: 0; accent-color: var(--md-accent); flex: 0 0 auto; }
.tick span { min-width: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.checks label { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--md-line-2); border-radius: 99px; padding: 5px 12px; font-size: 13.5px; background: var(--md-surface); cursor: pointer; }
.checks input { accent-color: var(--md-accent); margin: 0; }

/* Notices, as in the panel */
.note { font-size: 14px; color: var(--md-warn-ink); background: var(--md-warn-wash); border: 1px solid var(--md-warn-line); padding: 9px 12px; border-radius: 8px; }
.okline { font-size: 14px; color: var(--md-good); background: var(--md-good-wash); border: 1px solid #b7dfc4; padding: 9px 12px; border-radius: 8px; }
.crit { font-size: 14px; color: var(--md-crit); background: var(--md-crit-wash); border: 1px solid #f1b4ae; padding: 9px 12px; border-radius: 8px; }
.info { font-size: 14px; color: var(--md-ink); background: var(--md-info-wash); border: 1px solid var(--md-info-line); padding: 9px 12px; border-radius: 8px; }
.err { color: var(--md-crit); min-height: 1.4em; margin: 8px 0 0; font-size: 14px; }
.err:empty { min-height: 0; margin: 0; }
.err .main, .err .ghost { margin-top: 6px; }
.err > .note { display: block; }
.problems { margin: 6px 0 0; padding-left: 20px; }

/* The permit's state, as the panel shows it */
.state { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--md-surface-2); border: 1px solid var(--md-line-2); color: var(--md-ink); white-space: nowrap; vertical-align: middle; }
.state.st-submitted, .state.st-reviewed, .state.st-approved { background: var(--md-info-wash); border-color: var(--md-info-line); }
.state.st-returned, .state.st-amended, .state.st-extended, .state.st-transferred { background: var(--md-warn-wash); border-color: var(--md-warn-line); color: var(--md-warn-ink); }
.state.st-issued, .state.st-accepted, .state.st-active { background: var(--md-good-wash); border-color: #b7dfc4; color: var(--md-good); }
.state.st-suspended, .state.st-cancelled, .state.st-expired { background: var(--md-crit-wash); border-color: #f1b4ae; color: var(--md-crit); }
.state.st-work-complete, .state.st-closed, .state.st-handed-back, .state.st-draft { background: var(--md-surface-2); color: var(--md-ink-2); }
.pill { display: inline-block; font-size: 11.5px; font-weight: 650; padding: 1px 8px; border-radius: 6px; background: var(--md-surface-2); border: 1px solid var(--md-line-2); white-space: nowrap; }
.pill.ok { background: var(--md-good-wash); border-color: #b7dfc4; color: var(--md-good); }
.pill.warn { background: var(--md-warn-wash); border-color: var(--md-warn-line); color: var(--md-warn-ink); }
.pill.bad { background: var(--md-crit-wash); border-color: #f1b4ae; color: var(--md-crit); }

/* The small map of the area */
.smap { margin: 0; }
.smap svg { display: block; width: 100%; height: auto; border-radius: var(--md-radius); background: #dfe6e2; }
.smap .area { fill: rgba(18, 101, 63, 0.2); stroke: #ffd24a; stroke-width: 3; stroke-linejoin: round; }
.smap .line { fill: none; stroke: #ffd24a; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.smap .spot { fill: rgba(18, 101, 63, 0.35); stroke: #ffd24a; stroke-width: 3; }
.smap figcaption { font-size: 11.5px; color: var(--md-muted); margin-top: 4px; }

ol.conds { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
ol.conds li { padding-left: 2px; }

.foot { font-size: 12.5px; color: var(--md-muted); text-align: center; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.04em; }

/* The site page (contract 5.13): what anyone at the site may see, then the crew's briefing, the notice about their
   details and the sign-on. */
.site-ref { font-size: 22px; margin-bottom: 2px; }
.site-type { margin: 0 0 10px; }
.site-ended { margin: 12px 0 0; }
#crew-view { display: grid; gap: 12px; }
.site-conds-h { margin: 14px 0 6px; }
.site-notice { margin: 12px 0 0; padding: 10px 12px; border: 1px solid var(--md-info-line); border-radius: 9px; background: var(--md-info-wash); font-size: 14px; }
.site-notice > .lbl { margin-bottom: 4px; }
.site-notice > p:last-child { margin-bottom: 0; }
.site-copy, .site-forget { margin-top: 14px; }
#brief-h:focus { outline: none; }

/* A project's sign-in (contract 2.12): what is on, the portal's steps, the groups that give roles, shared logins. */
.si-row { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; margin-top: 12px; }
.si-row > div { min-width: 0; }
.si-row > .small-btn { flex: 0 0 auto; }
.si-steps { margin: 8px 0 0; padding-left: 22px; display: grid; gap: 8px; font-size: 14px; }
.si-copy { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.si-copy .code { font-size: 12.5px; padding: 4px 8px; border-radius: 6px; background: var(--md-surface-2); border: 1px solid var(--md-line-2); overflow-wrap: anywhere; }
.si-groups { display: grid; gap: 8px; margin-top: 10px; }
.si-group .checks { margin-top: 8px; }
.si-seen { margin-top: 14px; }
#si-people .item { padding-top: 10px; border-top: 1px solid var(--md-line); }
.or-line { margin: 14px 0 0; }
.first-passkey > p { margin: 0 0 10px; }

/* Admin: tabs, lists that are rows on a wide screen and cards on a phone */
.tabs { display: flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--md-line); overflow-x: auto; }
.tabs button { flex: 1 0 auto; min-height: 40px; padding: 0 14px; border: 0; border-radius: 8px; background: none; color: var(--md-ink-2); font-weight: 650; font-size: 14px; white-space: nowrap; }
.tabs button[aria-selected="true"] { background: var(--md-surface); color: var(--md-ink); box-shadow: 0 1px 2px rgba(11, 26, 20, 0.12); }
@media (max-width: 440px) { .tabs button { flex: 1 1 auto; padding: 0 8px; font-size: 13.5px; } }
#admin-ui { display: grid; gap: 12px; }
[role="tabpanel"] { display: grid; gap: 10px; min-width: 0; }
[role="tabpanel"] > div:empty { display: none; }
#invite { max-width: 680px; }
.list { display: grid; gap: 8px; }
.item { background: var(--md-surface); border: 1px solid var(--md-line); border-radius: var(--md-radius); padding: 12px 14px; display: grid; gap: 6px; min-width: 0; }
.item .top { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.item .nm { font-weight: 700; }
.item .meta { font-size: 13px; color: var(--md-ink-2); }
.item .acts { display: flex; flex-wrap: wrap; gap: 6px; }
.item.editing { border-color: var(--md-accent-strong); box-shadow: inset 0 0 0 1px var(--md-accent-strong); }
.choice { display: inline-flex; gap: 4px; padding: 3px; border-radius: 9px; background: var(--md-surface-2); border: 1px solid var(--md-line); }
.choice button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 7px; background: none; font-weight: 650; font-size: 13.5px; color: var(--md-ink-2); }
.choice button[aria-pressed="true"].yes { background: var(--md-good-wash); color: var(--md-good); box-shadow: inset 0 0 0 1px #b7dfc4; }
.choice button[aria-pressed="true"].no { background: var(--md-crit-wash); color: var(--md-crit); box-shadow: inset 0 0 0 1px #f1b4ae; }
.choice button:disabled { opacity: 0.4; cursor: default; }
.item .pills { display: flex; flex-wrap: wrap; gap: 4px; }
.item .edit { display: grid; gap: 4px; padding-top: 4px; border-top: 1px solid var(--md-line); margin-top: 4px; }
.item .edit .row { margin-top: 8px; }
.item .edit small { color: var(--md-ink-2); font-size: 12.5px; }
.item.chosen { border-color: var(--md-line-2); }
/* A card with its actions: under the words on a phone, beside them on a wider screen. */
.split { grid-template-columns: minmax(0, 1fr); align-items: center; }
.split > .who { display: grid; gap: 5px; min-width: 0; }
@media (min-width: 640px) {
  .split { grid-template-columns: minmax(0, 1fr) auto; column-gap: 14px; }
  .split > .acts { justify-content: flex-end; }
  .split > .edit { grid-column: 1 / -1; }
}
.review-foot { display: grid; gap: 8px; }
.review-foot .main { justify-self: start; }
.codes-box { display: grid; gap: 6px; margin-top: 10px; }
.codes-box p { margin: 0; }
.codes-box .ghost { justify-self: start; }
ol.codes { margin: 2px 0 4px; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 12px; counter-reset: code; }
ol.codes li { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14.5px; letter-spacing: 0.04em; color: var(--md-ink); background: var(--md-surface); border: 1px solid var(--md-warn-line); border-radius: 6px; padding: 4px 8px; }
.audit { font-size: 13.5px; }
.audit .item { gap: 2px; padding: 9px 12px; }
.audit .act { font-weight: 650; }
.audit .what { color: var(--md-ink-2); }
.audit .item > .act-cell { order: -1; }
.audit .item > .ip:empty { display: none; }
@media (min-width: 760px) {
  .audit .item { grid-template-columns: 172px minmax(0, 1.2fr) minmax(0, 1fr) 110px; column-gap: 14px; align-items: baseline; }
  .audit .item > .act-cell { order: 0; }
  .audit .item > .ip { text-align: right; }
  .audit .item > .ip:empty { display: block; }
}
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar > select, .toolbar > input { flex: 1 1 180px; width: auto; }
.toolbar > select { max-width: 380px; }
.empty { text-align: center; color: var(--md-ink-2); padding: 24px 12px; }
.spin { display: inline-block; width: 14px; height: 14px; border-radius: 99px; border: 2px solid var(--md-line-2); border-top-color: var(--md-accent-strong); animation: spin 0.8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } }

/* The sign sheet: the main button pinned at the bottom, never moving while the sheet is read */
.sheet-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--md-surface); border-top: 1px solid var(--md-line); box-shadow: 0 -2px 8px rgba(11, 26, 20, 0.06); padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); }
.sheet-foot .in { max-width: 560px; margin: 0 auto; display: grid; gap: 6px; }
.sheet-foot .dev-sign { min-height: 38px; font-size: 13.5px; border-style: dashed; border-color: var(--md-warn); }
body.has-sheet-foot main { padding-bottom: 150px; }
/* On a wider screen the main button sits in the card, under what it acts on (common.ts, dockMain). */
.card > .in.docked { display: grid; gap: 6px; margin: 4px 0 10px; }
.sheet-head h1 { margin-bottom: 4px; }
.sheet-title { font-size: 18px; margin: 2px 0 8px; }
/* Each part of the permit card (conditions in force, what signing writes) starts with the same space above it */
.lbl.part { margin-top: 14px; }
ul.declare { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.tick.proposal small, .choose small { display: block; color: var(--md-ink-2); font-size: 12.5px; }
.send-back { margin-top: 10px; display: grid; gap: 8px; }
.card > .ghost.wide-btn { margin-top: 12px; }
.field > small { color: var(--md-ink-2); font-size: 12.5px; }

/* Connect an app: the projects to choose from */
.choose { display: grid; gap: 6px; }
.choose .tick { margin-top: 0; }

/* The Console: signing up, and the new project wizard (one check-and-fill screen, the main button pinned at the foot) */
.su-more { margin-top: 12px; }
.src { display: block; color: var(--md-ink-2); font-size: 12.5px; }
.wrap.wiz { max-width: 760px; }
.wiz-intro h1 { margin-bottom: 2px; }
.wiz-intro p { margin: 0; }
.wiz-sec { padding: 0; }
.wiz-sec > .head { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 10px 14px; border: 0; background: none; color: inherit; text-align: left; border-radius: var(--md-radius); }
.wiz-sec > .head h2 { margin: 0; flex: 0 0 auto; }
.wiz-sec > .head .pill { flex: 0 0 auto; }
.wiz-sec > .head .sum { flex: 1 1 auto; min-width: 0; color: var(--md-ink-2); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.wiz-sec.open > .head .sum { display: none; }
.wiz-sec > .head:hover h2 { color: var(--md-accent-strong); }
.wiz-sec > .body { padding: 0 14px 14px; }
.wiz-sec > .body > div > :first-child { margin-top: 0; }
.wiz-map { height: 360px; margin-top: 10px; border: 1px solid var(--md-line); border-radius: var(--md-radius); cursor: crosshair; }
@media (max-width: 600px) { .wiz-map { height: 280px; } }
.hint { margin: 8px 0; }
.where-said p { margin: 8px 0 0; }
.row.search { flex-wrap: nowrap; }
.row.search > input { flex: 1 1 auto; }
.row.search > .ghost { flex: 0 0 auto; }
.list.found { margin-top: 8px; }
.list.found:empty { display: none; }
button.item.pick { font: inherit; text-align: left; color: inherit; cursor: pointer; width: 100%; }
button.item.pick:hover { border-color: var(--md-accent-strong); }
button.item.pick small { color: var(--md-ink-2); font-size: 12.5px; }
.field.radius { max-width: 260px; }
.when-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; align-items: start; }
.when-grid > .field { margin-top: 0; }
.when-grid .wide { grid-column: 1 / -1; }
@media (max-width: 640px) { .when-grid { grid-template-columns: minmax(0, 1fr); } }
.tiles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 8px; }
.tiles-grid .tick { margin-top: 0; }
.type-tile span { display: grid; gap: 3px; }
.type-tile small { font-size: 12.5px; color: var(--md-ink-2); }
.type-tile .pill { justify-self: start; }
.tick.on { border-color: var(--md-accent-strong); background: var(--md-accent-soft); }
.person .top { justify-content: space-between; align-items: center; }
.person.needs { border-color: var(--md-warn-line); }
.add-row { margin-top: 8px; }
input[type="number"], input[type="time"] { width: 100%; min-height: 44px; padding: 10px 11px; border: 1px solid var(--md-line-2); border-radius: 8px; background: var(--md-surface); color: var(--md-ink); font: inherit; }
input[type="file"] { font: inherit; max-width: 100%; }
textarea { resize: vertical; }

/* The Console: a project's rules */
.ru-state p { margin: 6px 0 0; }
.ru-state .row { margin-top: 8px; }
.ru-change-list { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; }
.ru-changes .note, .ru-changes .okline, .ru-changes .crit { margin-top: 10px; }
.ru-types { display: grid; gap: 12px; }
.ru-role-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 4px 10px; align-items: start; padding: 6px 0; border-top: 1px solid var(--md-line); }
.ru-role-row:first-child { border-top: 0; }
.ru-step { font-weight: 650; font-size: 14px; padding-top: 6px; }
@media (max-width: 600px) { .ru-role-row { grid-template-columns: minmax(0, 1fr); } .ru-step { padding-top: 0; } }
.ru-items { display: grid; gap: 6px; margin-top: 12px; }
.ru-items .l { font-weight: 650; font-size: 14px; }
.ru-item { flex-wrap: nowrap; }
.ru-item > input { flex: 1 1 auto; }
.ru-item > .ghost { flex: 0 0 auto; }
.ru-items > .ghost { justify-self: start; }
.ru-remove { margin-top: 14px; }
.ru-types .tick small { display: block; color: var(--md-ink-2); font-size: 12.5px; }
.ru-remove > .danger { flex: 0 0 auto; }
.ru-rec { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--md-line); }
.ru-rec > .l, .ru-rec-list > .l { font-weight: 650; font-size: 14px; }
.ru-rec > .note { margin-top: 8px; }
.ru-rec-list { display: grid; gap: 8px; margin-top: 14px; }
.ru-rec-list > small { color: var(--md-ink-2); font-size: 12.5px; }
.ru-rec-list > .ghost { justify-self: start; }
.ru-rec-rule { padding: 10px 12px; border: 1px solid var(--md-line-2); border-radius: 9px; background: var(--md-surface); }
.ru-rec-rule .tick { margin-top: 0; }
.ru-rec-rule > .row { justify-content: flex-end; margin-top: 8px; }
.ru-rec-rule > .row > .ghost { flex: 0 0 auto; }
.ru-rec-dur { flex-wrap: wrap; }
.ru-rec-dur > input { flex: 0 0 64px; min-width: 0; }
.ru-rec-dur > select { flex: 1 1 8.5em; min-width: 8.5em; }
.ru-week { display: flex; flex-wrap: wrap; gap: 6px; }
.ru-day { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--md-line-2); border-radius: 9px; background: var(--md-surface); font-size: 14px; cursor: pointer; }
.ru-day input { width: 18px; height: 18px; margin: 0; accent-color: var(--md-accent); }
.ru-near { display: grid; gap: 6px; }
.ru-near > .l { font-weight: 650; font-size: 14px; }
.ru-near > small { color: var(--md-ink-2); font-size: 12.5px; }
.ru-near > .ghost { justify-self: start; }
.ru-near-entry { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 12px; align-items: start; padding: 8px 10px; border: 1px dashed var(--md-line-2); border-radius: 9px; }
.ru-near-entry > .field { margin-top: 0; }
.ru-near-words { grid-column: 1 / -1; display: flex; gap: 12px; align-items: flex-end; }
.ru-near-words > .field { flex: 1 1 auto; margin-top: 0; }
.ru-near-words > .ghost { flex: 0 0 auto; }

/* Your account: how Mighty Dig tells you */
.nt-item { text-decoration: none; color: inherit; }
.nt-item.unread { border-color: var(--md-accent-strong); box-shadow: inset 3px 0 0 var(--md-accent); }
.nt-item .meta { font-size: 12.5px; color: var(--md-ink-2); }
.nt-acts { margin-top: 8px; }
#nt-settings .tick small { display: block; color: var(--md-ink-2); font-size: 12.5px; }

/* Sign-in pages: one column, the development list set apart */
.dev { margin-top: 4px; padding: 12px; border: 1px dashed var(--md-warn); border-radius: 9px; background: var(--md-warn-wash); }
.dev .people { display: grid; gap: 6px; margin-top: 8px; }
.dev button { min-height: 40px; border: 1px solid var(--md-warn-line); background: var(--md-surface); border-radius: 8px; text-align: left; padding: 6px 10px; }
.dev button small { display: block; }

/* The standalone app: the map fills the screen, the panel beside it (below it on a phone) */
body.app { height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; overflow: hidden; }
.app-main { display: grid; grid-template-columns: minmax(0, 1fr) 420px; min-height: 0; }
.app-map { position: relative; min-height: 0; overflow: hidden; background: #c9d4ce; touch-action: none; }
.app-map:focus-visible { outline: 3px solid var(--md-accent-soft); outline-offset: -3px; }
.app-map .tiles { position: absolute; inset: 0; transform-origin: 0 0; }
.app-map .tile { position: absolute; left: 0; top: 0; width: 256px; height: 256px; max-width: none; user-select: none; -webkit-user-drag: none; }
.app-map .tile.missing { visibility: hidden; }
.app-map svg.over { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; transform-origin: 0 0; }
.app-map .shape { fill: rgba(18, 101, 63, 0.22); stroke: #ffd24a; stroke-width: 3; stroke-linejoin: round; }
.app-map .shape.found { fill: rgba(255, 210, 74, 0.25); }
.app-map .shape.clash { fill: rgba(180, 47, 39, 0.18); stroke: #b42f27; stroke-dasharray: 6 4; }
.app-map .shape.line { fill: none; stroke-width: 5; stroke-linecap: round; }
.app-map .shape.spot { fill: rgba(18, 101, 63, 0.35); }
/* The asset owners' plan services: thin blue dashes, as on the permit PDF, under the dig. */
.app-map .shape.plan { fill: none; stroke: #2a78d6; stroke-width: 1.6; stroke-dasharray: 5 3; }
.app-map .shape.line.plan { stroke-width: 1.6; }
.app-map .shape.spot.plan { fill: #2a78d6; stroke: none; }
/* Drawing on the app's map: a crosshair pointer, each corner a handle, and from the keyboard the middle where Space puts one. */
.app-map.drawing { cursor: crosshair; }
.app-map .corner { fill: #ffffff; stroke: #12653f; stroke-width: 2.5; }
.app-map .aim { display: none; position: absolute; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; pointer-events: none; }
.app-map .aim::before, .app-map .aim::after { content: ''; position: absolute; background: #0b1a14; box-shadow: 0 0 0 1px #ffffff; }
.app-map .aim::before { left: 13px; top: 0; width: 2px; height: 28px; }
.app-map .aim::after { left: 0; top: 13px; width: 28px; height: 2px; }
.app-map.drawing:focus-visible .aim { display: block; }
.app-map .zoom { position: absolute; right: 10px; top: 10px; display: grid; gap: 4px; }
.app-map .zoom button { width: 40px; height: 40px; border: 1px solid var(--md-line-2); border-radius: 8px; background: var(--md-surface); color: var(--md-ink); font-size: 20px; line-height: 1; box-shadow: 0 1px 2px rgba(11, 26, 20, 0.12); }
.app-map .credit { position: absolute; right: 6px; bottom: 4px; max-width: calc(100% - 12px); font-size: 11px; background: rgba(255, 255, 255, 0.8); padding: 1px 6px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-side { border-left: 1px solid var(--md-line); background: var(--md-surface); min-height: 0; overflow: auto; }
.app-side mighty-dig { display: block; height: 100%; }
@media (max-width: 820px) {
  .app-main { grid-template-columns: minmax(0, 1fr); grid-template-rows: 38dvh minmax(0, 1fr); }
  .app-side { border-left: 0; border-top: 1px solid var(--md-line); }
}
/* The standalone app's gate (sign in, choose a project): its own height, at the top. */
body.app #app-gate { align-self: start; overflow: auto; }
/* The Console's home and settings pages (console/src/home.ts, org.ts, project.ts): a name with its pills on one line,
   small links that do not stretch, a field with its button beside it, and a little room after a list. */
.cs-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-bottom: 8px; }
.cs-head > h1, .cs-head > h2 { margin: 0; }
.cs-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cs-links > .small-btn { flex: 0 0 auto; }
.cs-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cs-inline > input { flex: 1 1 220px; width: auto; min-width: 0; }
.cs-inline > .small-btn { flex: 0 0 auto; }
.cs-form { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--md-line); }
.cs-form > h3 { margin: 0; }
#me-name-confirm { margin-bottom: 16px; }
