/* CODD visual system. Layout/data components remain in styles.css.
   This layer owns their shared visual tokens, states and responsive behavior.
   Contract: ../DESIGN.md. */
:root {
  --text-soft: #596270;
  --text-faint: #626d7b;
  --action: #0666ce;
  --line: rgba(35, 48, 68, .09);
  --line-strong: rgba(35, 48, 68, .17);
  --shadow: 0 2px 4px rgba(30, 45, 65, .025), 0 8px 24px rgba(30, 45, 65, .045);
  --shadow-float: 0 12px 40px rgba(30, 45, 65, .13), 0 1px 3px rgba(30, 45, 65, .06);
  --ease: cubic-bezier(.22, .61, .36, 1);
  --glass: rgba(250, 252, 255, .78);
  --focus: 0 0 0 3px rgba(10, 120, 240, .17);
}
body { overflow-x: visible; font-size: 14px; line-height: 1.5; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible,
summary:focus-visible { outline: 2px solid var(--action); outline-offset: 3px; }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
button:disabled { cursor: not-allowed; }
input, textarea, .pretty-select-button { border-radius: 11px; font-size: 14px; }
input:focus, textarea:focus { box-shadow: var(--focus); }
input[type=checkbox] { accent-color: var(--action); }
.app-shell { grid-template-columns: 232px minmax(0, 1fr); }
.view, .view > *, .card-body, .field, .field-inline { min-width: 0; }
.view { animation: none; }
.content { width: min(1320px, 100%); padding: 32px clamp(24px, 3.2vw, 48px) 72px; }

/* Navigation is the glass layer; reading surfaces stay quiet and opaque. */
.sidebar { height: 100dvh; padding: 24px 12px 16px; gap: 12px;
  background: linear-gradient(165deg, rgba(255,255,255,.86), rgba(245,248,253,.74));
  backdrop-filter: blur(20px) saturate(135%); box-shadow: inset -1px 0 rgba(255,255,255,.65); }
.brand { padding: 0 12px 12px; gap: 11px; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px;
  box-shadow: 0 4px 12px rgba(10,120,240,.18), inset 0 1px 0 rgba(255,255,255,.3); }
.brand strong { font-size: 14px; }
.brand span { font-size: 11px; }
.nav-list { gap: 3px; overflow-y: auto; min-height: 0; scrollbar-width: thin; }
.nav-item { min-height: 40px; border-radius: 11px; font-size: 13px; gap: 8px;
  transition: background 160ms var(--ease), color 160ms var(--ease); }
.nav-item.active { background: rgba(255,255,255,.95); box-shadow: 0 2px 8px rgba(30,45,65,.06), inset 0 0 0 1px rgba(255,255,255,.8); }
.nav-item:active { transform: none; }
.nav-icon { display: grid; place-items: center; }
.ui-icon { width: 20px; height: 20px; fill: none; stroke: currentColor;
  stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.nav-count { font-size: 11px; min-width: 20px; text-align: right; }
.nav-separator { margin: 6px 12px; flex-shrink: 0; }
.sidebar-footer { flex-shrink: 0; padding: 12px 4px 0; border-top: 1px solid var(--line); }
.sidebar-footer .quiet-button { background: transparent; font-size: 12px; font-weight: 500; justify-content: flex-start; text-align: left; }
.sidebar-footer .quiet-button:hover { background: rgba(255,255,255,.8); }
.sidebar-footer .text-button { text-align: left; font-size: 12px; padding-left: 16px; }
.sidebar-toggle { width: 36px; height: 36px; flex-shrink: 0; display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.95); border-radius: 11px; color: var(--text-soft);
  background: rgba(255,255,255,.65); box-shadow: 0 2px 8px rgba(30,45,65,.045);
  cursor: pointer; transition: background 160ms var(--ease), color 160ms var(--ease); }
.sidebar-toggle:hover { background: rgba(255,255,255,.95); color: var(--action); }
.sidebar-toggle:active { transform: scale(.97); }
.sidebar-toggle .sidebar-chevron { transform-origin: 14.5px 12px; transition: transform 280ms var(--ease); }
.sidebar-collapsed .sidebar-toggle .sidebar-chevron { transform: rotate(180deg); }
@media (min-width: 781px) {
  .app-shell { transition: grid-template-columns 280ms var(--ease); }
  .sidebar { width: 232px; min-width: 0; transform: translateX(0); opacity: 1;
    transition: transform 280ms var(--ease), opacity 180ms ease, visibility 0s; }
  .sidebar-collapsed .app-shell { grid-template-columns: 0px minmax(0, 1fr); }
  .sidebar-collapsed .sidebar { transform: translateX(-100%); opacity: 0; visibility: hidden;
    pointer-events: none; transition: transform 280ms var(--ease), opacity 180ms ease, visibility 0s 280ms; }
}
@media (max-width: 780px) { .sidebar-toggle { display: none; } }
.topbar { height: 76px; padding: 0 clamp(24px, 3.2vw, 48px); gap: 20px;
  background: rgba(247,249,252,.82); backdrop-filter: blur(20px) saturate(135%);
  box-shadow: 0 1px 0 rgba(255,255,255,.7); }
.topbar-title { flex: 1 1 180px; }
.topbar h1 { font-size: 18px; font-weight: 650; letter-spacing: -.025em; }
.topbar p { font-size: 12px; margin-top: 3px; max-width: 340px; }
.topbar-actions { gap: 16px; min-width: 0; flex: 0 1 auto; }
.project-switcher { min-width: 0; width: clamp(180px, 23vw, 310px); padding: 8px 12px;
  border-radius: 13px; background: rgba(255,255,255,.75); border: 1px solid rgba(255,255,255,.95); box-shadow: 0 2px 8px rgba(30,45,65,.045); }
.project-switcher-copy { min-width: 0; }
.project-switcher-copy strong { max-width: none; font-size: 12px; margin-top: 1px; }
.project-switcher-copy small { font-size: 10px; color: var(--text-soft); }
.project-switcher-copy > span { color: var(--text-soft); font-size: 10px; }
.project-switcher:hover { background: white; box-shadow: 0 4px 14px rgba(30,45,65,.08); }
.project-file-badge { color: #b13d33; }
.save-state { font-size: 11px; gap: 6px; }
.save-state i { width: 5px; height: 5px; }
.save-state.save-error { color: #ac303a; }.save-state.save-error i { background: #ac303a; }
.account-menu { position: relative; display: block; }
.account-badge { min-width: 0; min-height: 44px; display: flex; align-items: center;
  gap: 9px; padding: 5px 8px; border: 1px solid transparent; background: transparent;
  cursor: pointer; border-radius: 12px; list-style: none; }
.account-badge::-webkit-details-marker { display: none; }
.account-menu[open] .account-badge, .account-badge:hover { background: rgba(255,255,255,.9); border-color: var(--line); }
.account-avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: #e5edf7; color: #45617f; font-size: 10px; font-weight: 700; flex-shrink: 0; }
.account-copy { display: grid; gap: 2px; max-width: 130px; }
.account-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.account-copy small { color: var(--text-soft); font-size: 10px; }
.account-chevron { font-size: 14px; color: var(--text-soft); }
.account-actions { position: absolute; top: calc(100% + 8px); right: 0; min-width: 180px; padding: 6px;
  border: 1px solid rgba(255,255,255,.95); border-radius: 15px; box-shadow: var(--shadow-float);
  background: var(--glass); backdrop-filter: blur(20px); display: grid; gap: 2px; }
.account-actions .text-button { text-align: left; min-height: 40px; color: var(--text); padding: 0 12px; font-size: 13px; }
.account-actions .text-button:hover { background: rgba(10,120,240,.08); }

/* Shared controls: one clear action, neutral secondary actions. */
.primary-button, .secondary-button, .quiet-button { min-height: 40px; padding: 0 14px; border-radius: 11px; font-size: 13px; font-weight: 600; }
.primary-button { background: var(--action); box-shadow: 0 2px 4px rgba(10,80,170,.1), inset 0 1px 0 rgba(255,255,255,.15); }
.primary-button:hover { background: #075fbf; box-shadow: 0 4px 12px rgba(10,80,170,.16); }
.secondary-button { background: rgba(255,255,255,.88); border: 1px solid var(--line-strong); box-shadow: 0 1px 2px rgba(30,45,65,.025); }
.secondary-button:hover { background: white; border-color: rgba(35,48,68,.27); }
.quiet-button { background: rgba(35,48,68,.055); }
.quiet-button:hover { background: rgba(35,48,68,.09); }
.text-button { font-size: 13px; color: var(--action); }
.primary-button:active, .secondary-button:active, .quiet-button:active, .text-button:active, .icon-button:active { transform: scale(.985); }
.icon-button { width: 36px; height: 36px; font-size: 17px; background: transparent; border: 1px solid transparent; }
.icon-button:hover { border-color: var(--line); background: var(--surface-muted); }
.danger-icon:hover { color: #ac303a; background: #feedef; border-color: #f3d4d7; }
.pretty-select-button { font-size: 14px; padding: 9px 34px 9px 12px; }
.pretty-select-button:focus-visible, .pretty-select-button.open { box-shadow: var(--focus); }
.pretty-select-menu { background: rgba(252,253,255,.97); border-color: rgba(255,255,255,.9); border-radius: 16px; box-shadow: var(--shadow-float); }
.pretty-select-option { font-size: 13px; font-weight: 400; min-height: 38px; }
.pretty-select-option.selected { font-weight: 600; color: #075fbf; }
.pretty-select-option:focus-visible { outline-offset: -2px; background: var(--blue-soft); }
.pretty-select-group { color: var(--text-soft); font-size: 11px; letter-spacing: .02em; font-weight: 600; }
.segmented, .segmented-control { background: rgba(35,48,68,.05); border: 1px solid rgba(35,48,68,.035); border-radius: 12px; padding: 3px; }
.segmented button, .segmented-control button { border-radius: 9px; font-weight: 550; min-height: 34px; }
.segmented-control button.active, .segmented button.active { box-shadow: 0 1px 5px rgba(30,45,65,.08); }

/* Status is content-sized everywhere, with a dot, label and disclosure. */
.project-status-select { --status-ink: #2563a6; --status-wash: #edf4fd;
  width: max-content; min-width: 0; max-width: 100%; align-self: start; position: relative; }
.project-status-select.green { --status-ink: #217645; --status-wash: #edf7f0; }
.project-status-select.orange { --status-ink: #925910; --status-wash: #fcf3e6; }
.project-status-select.neutral { --status-ink: #596270; --status-wash: #eef0f3; }
.project-status-select:is(.blue, .green, .orange, .neutral) .pretty-select-button { width: auto; min-height: 32px; padding: 5px 28px 5px 12px;
  gap: 7px; border: 1px solid rgba(35,48,68,.06); border-radius: 999px;
  font-size: 12px; line-height: 20px; font-weight: 550;
  background: var(--status-wash); color: var(--status-ink); box-shadow: inset 0 1px 0 rgba(255,255,255,.6); }
.project-status-select .pretty-select-button::before { content: ''; width: 5px; height: 5px; flex-shrink: 0;
  border-radius: 50%; background: currentColor; }
.project-status-select .pretty-select-chevron { width: 5px; height: 5px; right: 12px; color: currentColor; opacity: .65; border-width: 1.2px; }
.project-status-select .pretty-select-button:hover { filter: brightness(.985); }
.status-pill { padding: 4px 8px; font-size: 11px; line-height: 18px; font-weight: 550; }
.status-pill.blue { color: #2563a6; }.status-pill.green { color: #217645; }
.status-pill.orange { color: #925910; }.status-pill.red { color: #ac303a; }
.status-pill.purple { color: #6543bd; }
.status-pill.neutral { color: var(--text-soft); background: var(--surface-muted); }

/* Headers and working surfaces. */
.section-heading { align-items: center; gap: 16px; margin-bottom: 24px; }
.section-heading > div:first-child, .projects-hero > div:first-child { min-width: 0; }
.section-heading h2, .projects-hero h2 { font-size: 27px; line-height: 1.22; letter-spacing: -.035em; font-weight: 650; overflow-wrap: anywhere; }
.section-heading p { font-size: 13px; margin-top: 7px; line-height: 1.5; }
.section-actions { gap: 8px; }
.card { border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 18px; }
.card-header { padding: 18px 22px; }
.card-header h3 { font-size: 15px; font-weight: 650; }
.card-header p { font-size: 12px; line-height: 1.5; }
.card-body { padding: 22px; }
.stats-grid { gap: 0; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.82); margin: 20px 0 24px; }
.stat-card { padding: 16px 22px; border-radius: 0; background: transparent; box-shadow: none; min-width: 0; }
.stat-card + .stat-card { border-left: 1px solid var(--line); }
.stat-card strong { font-size: 24px; line-height: 1.2; font-weight: 600; margin-top: 7px; }
.stat-card small { font-size: 11px; line-height: 1.4; margin-top: 6px; }
.overview-grid { grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); gap: 16px; }
.overview-grid .card + .card { margin-top: 0; }
.overview-grid .card-header { align-items: flex-start; }
.progress-shell { min-width: 110px; max-width: 180px; gap: 8px; }
.progress-track { height: 4px; }.progress-shell span { min-width: 28px; font-size: 11px; }
.next-step-number { width: 32px; height: 32px; border-radius: 10px; font-size: 12px; background: #edf3fb; color: #2563a6; }
.next-step strong { font-size: 14px; font-weight: 600; }
.next-step { padding: 0; gap: 13px; }
.next-step p { line-height: 1.5; font-size: 12px; }
.source-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 0 2px; }
.source-file { min-width: 0; display: flex; align-items: center; gap: 9px; color: var(--text-soft); font-size: 12px; }
.source-file > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-file-type { font-size: 9px; font-weight: 700; color: #217645; background: #e8f4ec; border: 1px solid #d9eade; padding: 4px 5px; border-radius: 5px; }
.source-toolbar .quiet-button, .source-toolbar .secondary-button { min-height: 34px; font-size: 12px; }
.hero { min-height: 240px; padding: 32px; grid-template-columns: minmax(0,1.4fr) minmax(240px,.8fr); gap: 24px;
  border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 18px; }
.hero::after { display: none; }
.hero h2 { font-size: 28px; line-height: 1.2; letter-spacing: -.035em; }
.hero p { font-size: 14px; line-height: 1.6; margin: 12px 0 20px; }
.hero .eyebrow { font-size: 11px; margin: 0 0 10px; letter-spacing: .04em; }
.upload-card { min-height: 176px; padding: 22px; background: #f3f7fc; border: 1px dashed #aebfd4; border-radius: 15px; }
.upload-card:hover, .upload-card.dragging { transform: none; background: #eaf2fc; border-color: var(--action); }
.upload-symbol { width: 42px; height: 42px; border-radius: 13px; background: white; color: var(--action); box-shadow: 0 2px 8px rgba(30,45,65,.05); font-size: 23px; }
.upload-card strong { font-size: 14px; }.upload-card span { font-size: 12px; line-height: 1.5; }
.logic-card { border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.empty-state { padding: 40px 24px; }.empty-state p { font-size: 13px; }
.empty-state-symbol { width: 44px; height: 44px; border-radius: 14px; color: var(--text-soft); font-size: 22px; }

/* Project browsing: address first, status and actions on one compact line. */
.projects-hero { padding: 0; align-items: center; margin-bottom: 28px; }
.projects-hero h2 { margin: 0 0 8px; }
.projects-hero p:not(.eyebrow) { font-size: 13px; }
.projects-toolbar { margin: 0 0 16px; }
.project-search { width: min(360px,45%); border-radius: 11px; }
.project-search input { padding: 8px 0; box-shadow: none; font-size: 13px; }
.project-card { padding: 18px 20px; gap: 20px; min-height: 100px; border-color: var(--line); border-radius: 16px; background: rgba(255,255,255,.93); box-shadow: 0 2px 6px rgba(30,45,65,.025); }
.project-card:hover { transform: none; background: white; border-color: #c4d4e8; box-shadow: 0 4px 14px rgba(30,45,65,.06); }
.project-card.current { border-color: #c1d6ee; box-shadow: inset 2px 0 0 #0a78f0, 0 2px 6px rgba(30,45,65,.025); }
.project-card-title { flex-wrap: wrap; gap: 6px 8px; }
.project-card-title h3 { max-width: 100%; font-size: 14px; font-weight: 600; white-space: normal; overflow: visible; line-height: 1.45; }
.project-so { font-size: 10px; padding: 2px 6px; font-weight: 600; border-radius: 5px; }
.project-card-title .status-pill { padding: 1px 6px; font-size: 10px; }
.project-card-meta { font-size: 11px; gap: 4px 12px; margin-top: 9px; }
.project-card-meta b { font-weight: 500; color: var(--text-soft); }
.project-card-meta .project-updated { display: none; }
.project-card-side { grid-template-columns: auto 32px 32px; gap: 4px 4px; }
.project-card-side .project-status-select { grid-column: 1; grid-row: 1; }
.project-card-side small { grid-column: 1; grid-row: 2; font-size: 10px; padding-right: 7px; }
.project-card-side .danger-icon { grid-column: 2; grid-row: 1 / 3; }
.project-card-side .project-open-arrow { grid-column: 3; grid-row: 1 / 3; }
.project-card-side .icon-button { width: 32px; height: 32px; font-size: 16px; }

/* Forms and files: clear groups, visible long positions, quiet upload actions. */
.form-grid { gap: 18px 20px; }
.field label, .field-inline label { color: var(--text-soft); font-weight: 550; font-size: 12px; }
.form-section-title { margin: 8px 0 0; padding: 22px 0 0; border-top: 1px solid var(--line); font-size: 15px; font-weight: 650; }
.form-section-title:first-child { border: 0; padding: 0; margin: 0; }
.subsection-title { margin: 28px 0 16px; border-top: 1px solid var(--line); padding-top: 24px; font-size: 15px; }
.field textarea { min-height: 64px; line-height: 1.5; }
.field:has(.project-status-select) { align-content: start; }
.project-file-empty, .project-file-card, .start-file-card { background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 14px; gap: 12px; margin-bottom: 8px; }
.project-file-empty { border-style: dashed; }
.project-file-empty strong, .project-file-copy strong, .start-file-copy strong { font-size: 13px; font-weight: 600; }
.project-file-empty small, .project-file-copy small, .start-file-copy span { color: var(--text-soft); font-size: 12px; line-height: 1.5; }
.project-file-copy small, .start-file-copy span { white-space: normal; overflow-wrap: anywhere; }
.project-file-badge, .start-file-icon { width: 38px; height: 44px; border-radius: 9px; font-size: 10px; box-shadow: none; }
.project-file-actions { gap: 6px; }
.project-file-actions a { display: inline-flex; align-items: center; text-decoration: none; }
.start-file-card .primary-button { background: white; color: var(--action); border: 1px solid var(--line-strong); box-shadow: none; }
.bundle-editor-grid { gap: 18px 20px; }
.bundle-mode-tabs { gap: 6px; }.bundle-mode-tabs button { border-radius: 10px; }
.bundle-detection-note, .bundle-edit-preview, .controller-help { font-size: 12px; line-height: 1.5; border-radius: 11px; }
.controller-help span { color: var(--text-soft); font-size: 12px; }

/* Tables scroll locally; grid children may shrink below their intrinsic width. */
.table-wrap, .ui-table-scroll { position: relative; min-width: 0; max-width: 100%; overflow: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.ui-table-scroll { width: 100%; border-radius: 8px; }
.ui-scroll-hint { font-size: 11px; color: var(--text-soft); padding-bottom: 12px; }
.table-wrap:focus-visible, .ui-table-scroll:focus-visible { outline-offset: -2px; }
.data-table { font-size: 13px; }
.data-table th { font-size: 11px; font-weight: 600; line-height: 1.4; padding-bottom: 12px; }
.data-table td { padding-top: 12px; padding-bottom: 12px; line-height: 1.5; }
.data-table tbody tr:hover { background: rgba(242,246,251,.65); }
.data-table .muted-row { opacity: 1; color: var(--text-soft); background: #f8fafc; }
.demolition-table tr:not(.selected-row) { opacity: 1; }
.data-table td input, .data-table td .pretty-select-button { font-size: 12px; }
.cell-note { font-size: 11px; line-height: 1.45; }
.route-card { grid-template-columns: minmax(0,.85fr) minmax(0,1.5fr) minmax(120px,.45fr); gap: 16px;
  border-color: var(--line); box-shadow: 0 2px 6px rgba(30,45,65,.025); border-radius: 14px; }
.route-card:hover { transform: none; box-shadow: 0 4px 12px rgba(30,45,65,.05); }
.route-points { min-width: 0; grid-template-columns: minmax(0,1fr) 32px minmax(0,1fr); }
.route-depth { min-width: 0; }
.route-points input { min-width: 0; }
.route-depth-copy strong { font-size: 12px; }
.history-grid { grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr); }
.history-grid .card + .card { margin-top: 0; }
.diameter-card { padding: 20px; border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 16px; }
.diameter-card strong { font-size: 25px; font-weight: 600; }
.check-list { gap: 0; }
.check-row { padding: 10px 0; border-radius: 0; background: transparent; border-bottom: 1px solid var(--line); }
.check-row:last-child { border: 0; }
.check-row strong { font-size: 13px; font-weight: 600; }.check-row span { font-size: 12px; line-height: 1.5; margin-top: 2px; }
.check-icon { width: 26px; height: 26px; font-size: 12px; }
.check-row.ok .check-icon { color: #217645; }.check-row.wait .check-icon { color: #925910; }
.switch { position: relative; min-width: 44px; min-height: 36px; align-items: center; justify-content: center; }
.switch input { width: 1px; height: 1px; min-height: 0; padding: 0; margin: 0; }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--action); outline-offset: 3px; }
.select-check input { width: 1px; height: 1px; min-height: 0; padding: 0; }
.select-check input:focus-visible + span { outline: 2px solid var(--action); outline-offset: 3px; }
.tech-storage { background: #fff4f3; border: 1px solid #f1d9d7; border-radius: 13px; }
.tech-storage.ok { background: #f1f8f4; border-color: #d9eade; }

/* Floating windows: single glass skin, focus inside, background scroll locked. */
.project-create-overlay { position: fixed; inset: 0; z-index: 140; display: grid; place-items: center; padding: 24px;
  background: rgba(26,38,55,.24); backdrop-filter: blur(6px); }
.project-create-overlay .new-project-card { width: min(760px,100%); max-height: calc(100dvh - 48px); overflow: auto; margin: 0;
  background: rgba(253,254,255,.97); border: 1px solid rgba(255,255,255,.9); border-radius: 24px; box-shadow: var(--shadow-float); }
.new-project-card .card-header { padding: 22px 24px 18px; }
.new-project-card .card-header h3 { font-size: 23px; letter-spacing: -.03em; }
.new-project-card .card-body { padding: 22px 24px 24px; }
.new-project-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.new-project-grid .wide { grid-column: 1 / -1; }
.new-project-files { margin-top: 22px; }
.form-actions { padding-top: 18px; margin-top: 20px; border-top: 1px solid var(--line); }
.ui-overlay-open { overflow: hidden; }
body:has(dialog[open]) { overflow: hidden; }
.modal-layer, .command-palette { background: rgba(26,38,55,.24); backdrop-filter: blur(6px); }
.modal-card, .command-card, .password-dialog, .sections-dialog { border: 1px solid rgba(255,255,255,.9); background: rgba(253,254,255,.97); box-shadow: var(--shadow-float); border-radius: 24px; color: var(--text); }
.password-dialog { --password-accent: var(--action); padding: 28px; }
.password-dialog::backdrop, .sections-dialog::backdrop { background: rgba(26,38,55,.24); backdrop-filter: blur(6px); }
.password-dialog h2 { font-size: 23px; }.password-description, .password-field { color: var(--text-soft); }
.password-field input:focus { outline: none; box-shadow: var(--focus); border-color: var(--blue); }
.password-dialog button:focus-visible { outline-color: var(--action); }
.sections-dialog { width: min(560px,calc(100vw - 24px)); max-height: calc(100dvh - 40px); margin: auto; padding: 20px; overflow: auto; }
.sections-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.sections-heading h2 { margin: 0; font-size: 22px; letter-spacing: -.025em; }
.sections-heading .eyebrow { font-size: 10px; margin: 0 0 5px; }
.sections-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.sections-list .nav-item { min-height: 48px; grid-template-columns: 24px minmax(0,1fr); }
.sections-list .nav-count, .sections-list .nav-dot, .sections-list .nav-separator { display: none; }
.auth-screen { background: radial-gradient(ellipse at 25% 10%,#e8eff9 0,transparent 55%),var(--bg); padding: 24px; }
.auth-card { border: 1px solid rgba(255,255,255,.9); border-radius: 24px; background: rgba(255,255,255,.9); box-shadow: var(--shadow-float); padding: 32px; }
.auth-card input { font-size: 16px; }.auth-card > p { color: var(--text-soft); }
.auth-card input, .password-field input { font-weight: 400; }
.user-row { border-radius: 13px; background: #f8fafc; }
.user-row small, .muted-note { color: var(--text-soft); }
.toast { border: 1px solid rgba(255,255,255,.8); background: rgba(253,254,255,.96); color: var(--text); box-shadow: var(--shadow-float); border-radius: 13px; font-size: 13px; }
.toast.error { background: #fff3f2; border-color: #f1d4d2; color: #ac303a; }
.loading-overlay { z-index: 10050; background: rgba(242,244,247,.65); backdrop-filter: blur(4px); }

@media (max-width: 1180px) and (min-width: 781px) {
  .app-shell { grid-template-columns: 210px minmax(0,1fr); }
  .sidebar { width: 210px; }
  .topbar { padding: 0 24px; gap: 12px; }.topbar-actions { gap: 8px; }
  .account-copy { display: none; }.account-badge { padding: 5px; }
  .save-state { font-size: 0; }.save-state i { width: 6px; height: 6px; }
  .route-card { grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr); }
  .route-depth { grid-column: 1 / -1; justify-content: flex-end; padding: 0; }
  .overview-grid { grid-template-columns: 1fr; }
  .stat-card { padding: 16px; }
  .project-card { align-items: flex-start; gap: 12px; }
  .project-card-side { grid-template-columns: auto 28px; }
  .project-card-side .project-open-arrow { grid-column: 2; }.project-card-side .danger-icon { grid-column: 2; grid-row: 3; }
}
@media (max-width: 780px) {
  body { padding-bottom: 0; }
  .app-shell { display: block; }
  .topbar { height: 68px; padding: 0 14px; gap: 10px; }
  .topbar-title { flex: 0 0 auto; gap: 0; }
  .topbar-title > div { display: none; }.topbar-title .mobile-brand { width: 36px; height: 36px; border-radius: 11px; background: var(--action); }
  .topbar-actions { flex: 1; gap: 8px; justify-content: flex-end; }
  .project-switcher { flex: 1; width: auto; min-width: 0; min-height: 44px; padding: 6px 10px; box-shadow: none; }
  .project-switcher-copy strong { font-size: 11px; }.project-switcher-copy small { display: none; }
  .project-switcher-copy > span { font-size: 9px; }
  .account-copy, .account-chevron { display: none; }
  .account-badge { width: 44px; height: 44px; justify-content: center; padding: 0; }
  .account-avatar { width: 32px; height: 32px; font-size: 10px; }
  .account-actions { min-width: 176px; }
  .save-state.save-error { position: absolute; display: flex; left: 14px; right: 14px; top: 70px;
    padding: 8px 12px; border-radius: 11px; background: #fff3f2; border: 1px solid #f1d4d2; font-size: 12px; box-shadow: var(--shadow); }
  .no-active-project .topbar-title > div { display: block; margin-left: 10px; }
  .content { padding: 24px 16px calc(110px + env(safe-area-inset-bottom)); }
  .mobile-nav { height: 66px; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); padding: 5px;
    border-radius: 23px; background: rgba(252,253,255,.84); border: 1px solid rgba(255,255,255,.95);
    box-shadow: 0 6px 26px rgba(30,45,65,.12), inset 0 1px rgba(255,255,255,.9); backdrop-filter: blur(20px) saturate(140%);
    grid-template-columns: repeat(5,minmax(0,1fr)); }
  .no-active-project .mobile-nav { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .mobile-nav button { min-height: 44px; border-radius: 17px; gap: 4px; cursor: pointer; }
  .mobile-nav button small { font-size: 10px; }.mobile-nav .ui-icon { width: 20px; height: 20px; }
  .mobile-nav button.active { background: rgba(10,120,240,.075); color: var(--action); }
  .section-heading { gap: 12px; margin-bottom: 20px; }.section-heading h2, .projects-hero h2 { font-size: 24px; }
  [data-view=overview] > .section-heading { flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
  [data-view=overview] > .section-heading > div:first-child { flex: 1 1 240px; }
  [data-view=overview] > .section-heading .project-status-select { flex: 0 0 auto; }
  .section-heading p { font-size: 12px; }.section-actions { width: auto; }
  .projects-hero { gap: 16px; margin-bottom: 22px; align-items: flex-start; }
  .projects-hero p:not(.eyebrow) { font-size: 12px; }
  .projects-toolbar { gap: 12px; }.project-search { width: 100%; min-height: 44px; }
  .project-search input { font-size: 16px; }
  .segmented-control { align-self: flex-start; }.segmented-control button, .segmented button { min-height: 40px; }
  .project-card { padding: 16px; display: grid; gap: 14px; }
  .project-card-title h3 { flex: 1 0 100%; font-size: 14px; }
  .project-card-meta { display: flex; gap: 4px 12px; font-size: 11px; margin-top: 8px; }
  .project-card-meta .project-updated { display: inline; }
  .project-card-side { display: flex; width: 100%; gap: 2px; justify-items: normal; align-items: center; }
  .project-card-side small { display: none; }
  .project-card-side .icon-button { width: 36px; height: 44px; flex-shrink: 0; }
  .project-card-side .danger-icon { margin-left: auto; }
  .project-card-side .project-open-arrow { display: grid; margin-left: auto; }
  .project-card-side .danger-icon + .project-open-arrow { margin-left: 0; }
  .project-status-select { padding: 6px 0; }
  .project-status-select:is(.blue, .green, .orange, .neutral) .pretty-select-button { min-height: 32px; padding: 4px 25px 4px 10px; font-size: 11px; }
  .project-status-select .pretty-select-button::after { content: ''; position: absolute; inset: -6px 0; }
  .primary-button, .secondary-button, .quiet-button, .text-button, .icon-button { min-height: 44px; }
  .icon-button { width: 44px; height: 44px; }
  .card-header, .card-body { padding: 18px; }
  .card-header { flex-wrap: wrap; }.card-header .section-actions { width: 100%; }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); margin: 18px 0 20px; border-radius: 14px; }
  .stat-card { padding: 16px; }.stat-card strong { font-size: 22px; }
  .stat-card + .stat-card { border-left: 0; }.stat-card:nth-child(even) { border-left: 1px solid var(--line); }
  .stat-card:nth-child(n+3) { border-top: 1px solid var(--line); }
  .overview-grid, .history-grid { grid-template-columns: 1fr; }
  .source-toolbar { flex-wrap: wrap; gap: 10px; }
  .source-toolbar .section-actions { width: 100%; }.source-toolbar .quiet-button, .source-toolbar .secondary-button { min-height: 44px; }
  .hero { padding: 22px; grid-template-columns: 1fr; min-height: 0; }
  .hero h2 { font-size: 25px; }.hero p { font-size: 13px; }
  .upload-card { min-height: 148px; }.upload-card span { overflow-wrap: anywhere; }
  .form-grid, .bundle-editor-grid { grid-template-columns: 1fr; gap: 16px; }
  .form-grid .wide { grid-column: 1 / -1; }
  input, textarea, .pretty-select-button, .bundle-editor-grid input, .auth-card input { font-size: 16px; }
  .pretty-select-option { min-height: 44px; }
  .project-file-empty, .project-file-card, .start-file-card { padding: 14px; }
  .project-file-empty > div { flex-basis: 100%; }.project-file-empty .secondary-button { width: 100%; }
  .project-file-copy small { white-space: normal; }
  .project-file-actions { margin: 0; width: 100%; }
  .start-file-copy { flex-basis: calc(100% - 60px); }
  .start-file-card .primary-button, .start-file-card .quiet-button { margin-left: 0; }
  .route-card { grid-template-columns: minmax(0,1fr); gap: 14px; }
  .route-points { grid-template-columns: minmax(0,1fr) 36px minmax(0,1fr); gap: 6px; }
  .route-points .icon-button { width: 36px; }.route-depth { grid-column: auto; padding: 0; justify-content: space-between; }
  .toolbar .search-field { min-width: 0; }.toolbar .segmented { width: 100%; }
  .data-table { min-width: 680px; }.data-table input, .data-table .pretty-select-button { font-size: 16px; }
  .equipment-table { min-width: 830px; }.controller-direction-table { min-width: 860px; }
  .road-control, .switch { min-height: 44px; }
  .select-check { width: 44px; height: 44px; display: grid; place-items: center; }
  .selection-footer, .mapping-footer { flex-wrap: wrap; gap: 12px; }
  .project-create-overlay { padding: 12px; }
  .project-create-overlay .new-project-card { max-height: calc(100dvh - 24px); border-radius: 20px; }
  .new-project-card .card-header, .new-project-card .card-body { padding: 18px; }
  .new-project-grid { grid-template-columns: 1fr; }.new-project-grid .wide { grid-column: auto; }
  .new-project-card .form-actions { position: sticky; bottom: -18px; margin-bottom: -18px; padding: 14px 0 18px; background: rgba(253,254,255,.98); }
  .sections-list { grid-template-columns: 1fr; }
  .sections-dialog { padding: 18px; max-height: calc(100dvh - 24px); }
  .sections-list .nav-item { font-size: 14px; }
  .auth-card { padding: 26px; }.auth-screen { padding: 16px; }
  .toast-region { bottom: calc(90px + env(safe-area-inset-bottom)); }
}
@media (max-width: 374px) {
  .content { padding-inline: 12px; }.project-card { padding: 14px; }
  .project-card-side small { display: none; }.project-card-side .danger-icon { margin-left: auto; }
}
@supports not (backdrop-filter: blur(1px)) {
  .sidebar, .topbar, .mobile-nav, .account-actions, .pretty-select-menu { background: #f8fafc; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
