:root {
  --bg: #f3efe6;
  --surface: #fffdf8;
  --surface-2: #e8e2d7;
  --ink: #13283a;
  --muted: #5d6a73;
  --nav: #102536;
  --nav-2: #1d3a4f;
  --accent: #c9471a;
  --accent-hover: #a9340d;
  --line: #d0c9bd;
  --success: #14724f;
  --danger: #b32927;
  --warning: #875100;
  --info: #12608e;
  --focus: #1473ad;
  --shadow: 0 18px 48px rgb(19 40 58 / 12%);
  --r-sm: 7px;
  --r: 12px;
  --r-lg: 20px;
  --text-xs: .75rem;
  --text-sm: .875rem;
  --text-md: 1rem;
  --text-lg: 1.3rem;
  --text-xl: 1.85rem;
  --text-2xl: clamp(2.2rem, 5vw, 4.3rem);
  --dur: 180ms;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); }
button, input, textarea, select { font: inherit; }
button, label[for], select { cursor: pointer; }
a { color: inherit; }
img, video { max-width: 100%; }
h1, h2, h3, p { overflow-wrap: anywhere; }
address { font-style: normal; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip { position: fixed; left: 12px; top: -70px; z-index: 200; background: var(--nav); color: white; padding: 11px 15px; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 18px 22px; background: var(--nav); color: #f8f4eb; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 850; font-size: 1.18rem; letter-spacing: -.03em; }
.brand img { width: 36px; height: 36px; }
.nav { display: grid; gap: 4px; margin-top: 36px; }
.nav a, .nav button { position: relative; border: 0; text-decoration: none; background: transparent; color: #d3dde4; min-height: 46px; padding: 11px 12px; border-radius: var(--r-sm); display: flex; align-items: center; gap: 11px; text-align: left; }
.nav a:hover, .nav button:hover, .nav a[aria-current="page"] { background: var(--nav-2); color: white; }
.nav a span:first-child, .nav button span:first-child { width: 18px; text-align: center; }
.nav-more { display: none !important; }
.nav-badge { min-width: 20px; height: 20px; margin-left: auto; padding: 0 5px; border-radius: 999px; background: var(--accent); color: white; display: grid; place-content: center; font-size: .65rem; font-weight: 900; line-height: 1; }
.profile { margin-top: auto; padding-top: 18px; border-top: 1px solid #355064; display: grid; gap: 3px; }
.profile span { color: #bdcad3; font-size: var(--text-sm); text-transform: capitalize; }
.profile .quiet { color: #fff; justify-self: start; margin-top: 8px; }
.content { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; min-height: 76px; padding: 14px clamp(18px, 4vw, 50px); border-bottom: 1px solid var(--line); background: rgb(243 239 230 / 94%); backdrop-filter: blur(12px); display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.topbar h1 { margin: 1px 0 0; font-size: 1.18rem; }
.top-kicker { margin: 0; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.top-actions { display: flex; align-items: center; gap: 14px; }
#global-search { display: flex; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); overflow: hidden; }
#global-search input { width: min(27vw, 330px); border: 0; background: transparent; padding: 9px 5px 9px 12px; color: var(--ink); }
.icon-btn { border: 0; background: transparent; width: 42px; color: var(--ink); font-size: 1.15rem; }
.sync-badge { border: 0; border-radius: 999px; padding: 7px 10px; background: #dcefe5; color: #0f6041; font-size: var(--text-xs); font-weight: 800; white-space: nowrap; }
.sync-badge:disabled { cursor: default; opacity: 1; }
.sync-badge[data-state="offline"] { background: #f1dfc4; color: #704100; }
.sync-badge[data-state="pending"] { background: #e7e2ba; color: #5f5100; }
.install-compact { border: 1px solid var(--line); border-radius: var(--r-sm); background: transparent; color: var(--ink); min-height: 36px; padding: 6px 10px; font-weight: 750; }
main { max-width: 1460px; margin: auto; padding: clamp(24px, 4vw, 50px); }

.btn { min-height: 44px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); padding: 10px 15px; font-weight: 760; display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none; transition: transform var(--dur) var(--ease), background var(--dur); }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: white; }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn.small { min-height: 36px; padding: 7px 11px; font-size: var(--text-sm); }
.btn.full { width: 100%; }
.quiet { border: 0; background: transparent; color: var(--muted); padding: 6px 0; text-decoration: underline; text-underline-offset: 3px; }
.quiet.danger, .danger { color: var(--danger); }
.button-row, .capture-actions, .modal-actions, .inspector-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.modal-actions { justify-content: flex-end; margin-top: 22px; }

.eyebrow { margin: 0 0 7px; color: var(--accent); font-size: var(--text-xs); font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 28px; padding: 9px 0 34px; }
.hero h2, .page-heading h2, .project-heading h2 { margin: 0 0 10px; letter-spacing: -.055em; line-height: .98; }
.hero h2 { font-size: var(--text-2xl); }
.hero p:not(.eyebrow), .page-heading p:not(.eyebrow), .project-heading p { margin: 0; color: var(--muted); }
.page-heading { margin-bottom: 28px; }
.page-heading h2, .project-heading h2 { font-size: clamp(2rem, 4vw, 3rem); }
.split { display: flex; justify-content: space-between; align-items: end; gap: 24px; }
.filter-row { display: flex; gap: 6px; overflow-x: auto; padding: 0 0 17px; }
.filter { border: 1px solid var(--line); background: transparent; color: var(--muted); padding: 7px 12px; border-radius: 999px; font-weight: 700; white-space: nowrap; }
.filter.active { background: var(--nav); color: white; border-color: var(--nav); }

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 15px; }
.project-card { min-height: 220px; display: flex; flex-direction: column; padding: 19px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); text-decoration: none; transition: transform var(--dur) var(--ease), box-shadow var(--dur); }
.project-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.project-card-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.project-card-top time, .project-card p, .project-card address { color: var(--muted); font-size: var(--text-sm); }
.project-card h3 { margin: 28px 0 9px; font-size: var(--text-lg); }
.project-card p, .project-card address { margin: 2px 0; }
.open-label { margin-top: auto; padding-top: 18px; font-weight: 750; color: var(--accent); }
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); font-weight: 850; text-transform: capitalize; }
.status-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.status-dot.completed::before { background: var(--info); }
.status-dot.archived::before { background: var(--muted); }

.empty { min-height: 250px; padding: 48px 24px; border: 1px dashed #9f978a; border-radius: var(--r-lg); background: rgb(255 255 255 / 28%); color: var(--muted); text-align: center; display: grid; place-content: center; }
.empty > span { font-size: 2rem; }
.empty h3 { color: var(--ink); margin: 8px 0 3px; }
.empty p { margin: 0; }
.empty.compact { min-height: 120px; padding: 24px; }

.back-link { display: inline-block; margin-bottom: 24px; color: var(--muted); text-decoration: none; }
.project-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
.project-overline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.label-chip { padding: 4px 8px; border-left: 4px solid var(--label); background: var(--surface-2); font-size: var(--text-xs); font-weight: 750; }
.workspace-tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.workspace-tabs button { border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); min-height: 48px; padding: 10px 15px; font-weight: 750; white-space: nowrap; }
.workspace-tabs button.active { color: var(--ink); border-bottom-color: var(--accent); }
.tab-panel { padding-top: 25px; }
.capture-panel { display: flex; justify-content: space-between; align-items: center; gap: 22px; padding: 22px; border-radius: var(--r); background: var(--nav); color: white; }
.capture-panel h3 { margin: 0 0 5px; font-size: var(--text-lg); }
.capture-panel p:not(.eyebrow) { margin: 0; color: #d3dde4; }
.capture-panel .eyebrow { color: #ff9a75; }
.queue-banner { margin-top: 13px; padding: 12px 14px; border: 1px solid #d5bc78; background: #fff5d9; color: #5f4708; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-radius: var(--r-sm); }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin: 27px 0 14px; }
.section-heading h3 { margin: 0; font-size: var(--text-lg); }
.section-heading span { color: var(--muted); font-size: var(--text-sm); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.shot { min-width: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.media-open { width: 100%; display: block; position: relative; padding: 0; border: 0; background: var(--surface-2); }
.media-open img, .media-open video { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.play { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: 44px; height: 44px; border-radius: 50%; display: grid; place-content: center; background: rgb(16 37 54 / 82%); color: white; padding-left: 3px; }
.shot-info { display: flex; align-items: start; justify-content: space-between; gap: 10px; padding: 12px; }
.shot-info strong { display: block; }
.shot-info small, .file-row small, .person small, .task small { display: block; margin-top: 4px; color: var(--muted); font-size: var(--text-xs); }
.favorite { border: 0; background: transparent; color: #7e858b; font-size: 1.25rem; }
.favorite.active { color: #a86400; }
.media-badges { min-height: 32px; padding: 0 12px 10px; display: flex; flex-wrap: wrap; gap: 5px; }
.media-badges span { font-size: .68rem; background: var(--surface-2); padding: 3px 6px; border-radius: 4px; }

.two-column { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.card { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 20px; }
.card h3 { margin: 0 0 16px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.template-card ol { margin: 13px 0 0; padding-left: 20px; color: var(--muted); }
.task-list, .file-list, .conversation ol, .comments ol, .activity-list { list-style: none; padding: 0; margin: 0; }
.task-layout { grid-template-columns: minmax(0, 1fr) minmax(330px, 390px); }
.task-list { display: grid; gap: 10px; }
.task { min-width: 0; min-height: 92px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 14px; align-items: start; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.task-check, .task-status-readonly { width: 42px; height: 42px; display: grid; place-content: center; flex: 0 0 auto; border: 2px solid #65717b; border-radius: 50%; background: transparent; color: transparent; font-weight: 900; }
.task-check:hover { border-color: var(--success); }
.task.done .task-check, .task.done .task-status-readonly { background: var(--success); border-color: var(--success); color: white; }
.task-status-readonly { color: var(--muted); }
.task-copy { min-width: 0; }
.task-copy > strong { display: block; margin: 2px 0 8px; font-size: 1.03rem; }
.task.done .task-copy > strong { color: var(--muted); text-decoration: line-through; }
.task-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 12px; }
.task-assignees { display: flex; flex-wrap: wrap; gap: 5px; }
.task-assignees > span { min-height: 28px; display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 4px; border-radius: 999px; background: var(--surface-2); color: var(--ink); font-size: var(--text-xs); font-weight: 750; }
.task-assignees i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-content: center; background: var(--nav); color: white; font-size: .62rem; font-style: normal; }
.task-unassigned { color: var(--muted); font-size: var(--text-xs); }
.task-legacy { flex-basis: 100%; margin: 0 !important; }
.task-due { padding: 4px 7px; border-radius: 4px; background: color-mix(in srgb, var(--info) 10%, transparent); color: var(--info); font-size: var(--text-xs); font-weight: 800; }
.task-due.overdue { background: color-mix(in srgb, var(--danger) 11%, transparent); color: var(--danger); }
.task-media-references { display: flex; gap: 7px; margin-top: 12px; padding-top: 10px; overflow-x: auto; border-top: 1px solid var(--line); }
.task-media-references button { width: 92px; min-width: 92px; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); color: var(--ink); text-align: left; }
.task-media-references img, .task-media-references button > span { width: 100%; aspect-ratio: 16/10; display: grid; place-content: center; object-fit: cover; background: var(--nav); color: white; }
.task-media-references small { display: block; margin: 0; padding: 5px 6px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.task-actions { display: flex; flex-direction: column; align-items: end; gap: 3px; }
.task-create-card { position: sticky; top: 100px; }
.task-create-card > h3 { margin-bottom: 4px; }
.task-online-note { margin: 10px 0 0; padding: 9px 11px; border: 1px solid #d5bc78; border-radius: var(--r-sm); background: #fff5d9; color: #5f4708; font-size: var(--text-xs); }
.task-picker { min-width: 0; margin: 17px 0; padding: 0; border: 0; }
.task-picker legend { padding: 0; font-size: var(--text-sm); font-weight: 800; }
.task-picker legend small { color: var(--muted); font-weight: 600; }
.task-picker > .helper { margin: 5px 0 9px; }
.task-assignee-options, .task-media-options { max-height: 220px; overflow: auto; display: grid; gap: 7px; padding: 3px; }
.task-assignee-options label, .task-media-options label { position: relative; min-width: 0; }
.task-assignee-options input, .task-media-options input { position: absolute; opacity: 0; pointer-events: none; }
.task-person-option, .task-media-option { min-width: 0; min-height: 48px; display: flex; align-items: center; gap: 9px; padding: 7px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.task-person-option > i { width: 32px; height: 32px; flex: 0 0 auto; border-radius: 50%; display: grid; place-content: center; background: var(--nav); color: white; font-size: var(--text-xs); font-style: normal; font-weight: 900; }
.task-person-option > span, .task-media-option > span { min-width: 0; display: grid; }
.task-person-option strong, .task-media-option > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-person-option small { margin: 2px 0 0; color: var(--muted); text-transform: capitalize; }
.task-assignee-options input:focus-visible + .task-person-option, .task-media-options input:focus-visible + .task-media-option { outline: 3px solid var(--focus); outline-offset: 2px; }
.task-assignee-options input:checked + .task-person-option, .task-media-options input:checked + .task-media-option { border-color: var(--success); box-shadow: inset 4px 0 var(--success); background: color-mix(in srgb, var(--success) 7%, var(--surface)); }
.task-media-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.task-media-option { align-items: stretch; flex-direction: column; gap: 5px; }
.task-media-option img, .task-media-option > i { width: 100%; aspect-ratio: 16/10; display: grid; place-content: center; object-fit: cover; border-radius: 4px; background: var(--nav); color: white; font-style: normal; }
.task-media-option > span { padding: 0 2px 2px; color: var(--muted); font-size: var(--text-xs); }
.task-picker-empty { margin: 9px 0 0; padding: 11px; border: 1px dashed var(--line); border-radius: var(--r-sm); color: var(--muted); font-size: var(--text-sm); }
.task-legacy-field { margin: 17px 0; padding: 11px 12px; border: 1px dashed var(--line); border-radius: var(--r-sm); }
.task-legacy-field summary { font-size: var(--text-sm); font-weight: 800; }
.task-legacy-field .field { margin-bottom: 0; }
.dialog.task-dialog { width: min(780px, 100%); }
.task-dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; padding-right: 28px; }
.task-dialog-heading h2 { margin: 0 0 6px; font-size: var(--text-xl); }
.task-dialog-heading p:not(.eyebrow) { margin: 0 0 12px; color: var(--muted); }
.task-state { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; background: #fff0ce; color: #754600; font-size: .68rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.task-state.done { background: #dcefe5; color: #0f6041; }
.task-dialog .task-assignee-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.task-dialog .task-media-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.task-legacy-notice { margin-top: 16px; padding: 12px; border-left: 3px solid var(--line); background: var(--surface-2); display: grid; gap: 3px; }
.task-legacy-notice span, .task-legacy-notice small { color: var(--muted); }
.conversation { max-width: 850px; }
.message { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: start; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.message p { margin: 0 0 7px; white-space: pre-wrap; }
.message time { color: var(--muted); font-size: var(--text-xs); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--nav); color: white; display: grid; place-content: center; }
.composer { display: grid; gap: 9px; margin-top: 18px; }
.composer button { justify-self: end; }
.file-row { min-height: 68px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 13px; align-items: center; border-bottom: 1px solid var(--line); padding: 12px 3px; }
.file-icon { width: 40px; height: 40px; display: grid; place-content: center; background: var(--surface-2); border-radius: var(--r-sm); font-weight: 850; font-size: var(--text-xs); }
.file-icon.pdf { background: #f6dfd8; color: var(--danger); }

.activity-list { max-width: 1000px; border-top: 1px solid var(--line); }
.activity-item { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 14px; align-items: center; padding: 15px 3px; border-bottom: 1px solid var(--line); }
.activity-item p { margin: 3px 0 0; color: var(--muted); font-size: var(--text-sm); }
.activity-item time { color: var(--muted); font-size: var(--text-xs); text-align: right; }
.activity-icon { width: 36px; height: 36px; border-radius: 50%; display: grid; place-content: center; background: var(--surface-2); }

.inbox-summary { width: max-content; margin-bottom: 15px; padding: 9px 13px; border-radius: 999px; background: var(--surface-2); display: flex; align-items: baseline; gap: 6px; color: var(--muted); font-size: var(--text-sm); }
.inbox-summary strong { color: var(--ink); font-size: 1.1rem; }
.notification-list { max-width: 1000px; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.notification-item { border-bottom: 1px solid var(--line); }
.notification-item > a { min-height: 92px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 7px; text-decoration: none; }
.notification-item > a:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.notification-item.unread > a { box-shadow: inset 4px 0 var(--accent); background: color-mix(in srgb, var(--surface) 72%, transparent); padding-left: 14px; }
.notification-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--nav); color: white; display: grid; place-content: center; font-weight: 900; }
.notification-item.unread .notification-icon { background: var(--accent); }
.notification-copy { min-width: 0; display: grid; gap: 4px; }
.notification-copy > span:not(.notification-title) { overflow: hidden; color: var(--muted); font-size: var(--text-sm); text-overflow: ellipsis; white-space: nowrap; }
.notification-copy small { color: var(--muted); font-size: var(--text-xs); }
.notification-title { display: flex; align-items: center; gap: 8px; }
.notification-title i { padding: 2px 5px; border-radius: 4px; background: #f6dfd8; color: var(--danger); font-size: .62rem; font-style: normal; font-weight: 900; text-transform: uppercase; }
.notification-arrow { color: var(--accent); font-weight: 900; }

.directory-search { max-width: 720px; margin: -4px 0 22px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.directory-search input { min-height: 44px; border: 1px solid #a9a296; border-radius: var(--r-sm); background: var(--surface); color: var(--ink); padding: 10px 12px; }
.customer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.customer-card { min-width: 0; min-height: 112px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); text-decoration: none; transition: transform var(--dur) var(--ease), box-shadow var(--dur); }
.customer-card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgb(19 40 58 / 9%); }
.customer-card.inactive { opacity: .7; }
.customer-monogram { width: 46px; height: 46px; border-radius: 13px; display: grid; place-content: center; background: var(--nav); color: white; font-size: var(--text-sm); font-weight: 900; }
.customer-monogram.large { width: 72px; height: 72px; border-radius: 20px; font-size: var(--text-lg); }
.customer-card-title { display: flex; align-items: center; gap: 8px; }
.customer-card h3 { margin: 0; }
.customer-card-title span { padding: 3px 5px; border-radius: 4px; background: var(--surface-2); color: var(--muted); font-size: .62rem; font-weight: 800; text-transform: uppercase; }
.customer-card p { margin: 5px 0; overflow: hidden; color: var(--muted); font-size: var(--text-sm); text-overflow: ellipsis; white-space: nowrap; }
.customer-card small { color: var(--muted); }
.customer-profile { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 28px; }
.customer-profile-head { display: flex; align-items: center; gap: 18px; }
.customer-profile h2 { margin: 0 0 6px; font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.045em; }
.customer-profile p:not(.eyebrow) { margin: 0; color: var(--muted); }
.customer-detail-grid { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr); gap: 18px; }
.customer-contact dl { margin: 0; }
.customer-contact dl div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.customer-contact dt { color: var(--muted); font-size: var(--text-xs); font-weight: 800; text-transform: uppercase; }
.customer-contact dd { margin: 5px 0 0; }
.customer-notes p { margin: 0; color: var(--muted); white-space: pre-wrap; }
.directory-linked { padding: 4px 7px; border-radius: 4px; background: #dcefe5; color: #0f6041; font-size: .64rem; font-weight: 850; text-transform: uppercase; }
.project-heading p a { color: inherit; font-weight: 800; text-underline-offset: 3px; }

.map-filters { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(160px, 220px) auto; align-items: end; gap: 10px; margin-bottom: 14px; }
.map-filters .field { margin: 0; }
.map-summary { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; }
.map-summary > div { min-width: 130px; padding: 10px 13px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); display: grid; }
.map-summary strong { font-size: 1.18rem; }
.map-summary span { color: var(--muted); font-size: var(--text-xs); }
.coordinate-map { position: relative; min-height: 440px; overflow: hidden; border: 1px solid #8194a0; border-radius: var(--r-lg); background: linear-gradient(145deg, #dce7e8, #eef0e6 58%, #d9e2d1); box-shadow: inset 0 0 80px rgb(16 37 54 / 8%); }
.map-grid { position: absolute; inset: 0; opacity: .38; background-image: linear-gradient(rgb(16 37 54 / 13%) 1px, transparent 1px),linear-gradient(90deg, rgb(16 37 54 / 13%) 1px, transparent 1px); background-size: 12.5% 12.5%; }
.map-north { position: absolute; right: 14px; top: 12px; z-index: 1; color: #253f4e; font-size: var(--text-xs); font-weight: 900; letter-spacing: .08em; }
.map-caption { position: absolute; left: 13px; bottom: 10px; z-index: 1; padding: 5px 8px; border-radius: 5px; background: rgb(255 253 248 / 85%); color: #314957; font-weight: 700; }
.map-marker { position: absolute; left: var(--x); top: var(--y); z-index: 2; transform: translate(-50%, -50%); text-decoration: none; }
.map-marker > span { width: 34px; height: 34px; border: 3px solid white; border-radius: 50%; display: grid; place-content: center; background: var(--accent); color: white; box-shadow: 0 4px 13px rgb(7 25 38 / 35%); font-size: .72rem; font-weight: 900; }
.map-marker.completed > span { background: var(--info); }
.map-marker.archived > span { background: var(--muted); }
.map-marker strong { position: absolute; left: 50%; bottom: 42px; width: max-content; max-width: 220px; transform: translateX(-50%); opacity: 0; pointer-events: none; padding: 6px 8px; border-radius: 5px; background: var(--nav); color: white; font-size: var(--text-xs); transition: opacity var(--dur); }
.map-marker:hover strong, .map-marker:focus-visible strong { opacity: 1; }
.empty-map { display: grid; place-content: center; color: #425b66; font-weight: 800; }
.map-project-list { max-width: 1000px; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.map-project-row { min-height: 84px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.map-index { width: 30px; height: 30px; border-radius: 50%; display: grid; place-content: center; background: var(--nav); color: white; font-size: var(--text-xs); font-weight: 850; }
.map-project-row p { margin: 4px 0; color: var(--muted); font-size: var(--text-sm); }
.map-project-row small { color: var(--muted); }

.project-location-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(310px, 370px); gap: 24px; align-items: start; }
.project-location-layout .coordinate-map { min-height: 330px; }
.location-readout { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.location-readout > div { min-width: 0; padding: 11px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); display: grid; gap: 3px; }
.location-readout span { color: var(--muted); font-size: var(--text-xs); }
.location-readout strong { overflow: hidden; font-size: var(--text-sm); text-overflow: ellipsis; }
.location-controls { position: sticky; top: 100px; }
.coordinate-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.or-divider { margin: 17px 0 4px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: var(--text-xs); }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.location-remove { margin-top: 13px; }

.mention-composer { position: relative; }
.mention-suggestions { position: absolute; inset: auto 0 calc(100% + 6px) 0; z-index: 12; max-height: 270px; overflow: auto; padding: 5px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.comments .mention-suggestions { inset: calc(100% + 6px) 0 auto 0; }
.mention-suggestions[hidden] { display: none; }
.mention-suggestions button { width: 100%; min-height: 52px; padding: 7px 8px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; text-align: left; }
.mention-suggestions button:hover, .mention-suggestions button[aria-selected="true"] { background: var(--surface-2); }
.mention-suggestions button > span:nth-child(2) { min-width: 0; display: grid; }
.mention-suggestions small { overflow: hidden; color: var(--muted); font-size: .7rem; text-overflow: ellipsis; }
.mention-suggestions i { color: var(--muted); font-size: .65rem; font-style: normal; text-transform: capitalize; }
.mention-avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-content: center; background: var(--nav); color: white; font-size: var(--text-xs); font-weight: 900; }
.composer-foot, .comment-submit { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.composer-foot small, .comment-submit small { color: var(--muted); font-size: var(--text-xs); }
.mobile-menu nav { display: grid; gap: 5px; margin: 18px 0; }
.mobile-menu nav a { min-height: 48px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); display: flex; align-items: center; gap: 10px; text-decoration: none; }
.mobile-menu > .btn { margin-top: 8px; }
.mobile-menu > .quiet { margin-top: 18px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-size: var(--text-xs); letter-spacing: .07em; text-transform: uppercase; }
.person { display: flex; align-items: center; gap: 11px; }
.person > span { width: 38px; height: 38px; border-radius: 50%; display: grid; place-content: center; background: var(--nav); color: white; font-weight: 800; }
.role-badge { text-transform: capitalize; font-size: var(--text-sm); font-weight: 750; }

.field { display: grid; gap: 7px; margin: 14px 0; }
.field label, fieldset legend { font-size: var(--text-sm); font-weight: 760; }
.field input, .field textarea, .field select, select, .composer textarea, .comments textarea { width: 100%; min-height: 43px; border: 1px solid #a9a296; border-radius: var(--r-sm); background: white; color: #13283a; padding: 10px 11px; }
.field textarea, .composer textarea, .comments textarea { min-height: 96px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
.check input { width: 19px; height: 19px; }
.inline { display: grid; grid-template-columns: 1fr 52px; gap: 8px; }
.helper { color: var(--muted); font-size: var(--text-sm); }
.form-error { min-height: 20px; color: var(--danger); font-size: var(--text-sm); }

.auth { max-width: none; min-height: 100vh; padding: 0; display: grid; grid-template-columns: 1.08fr .92fr; }
.auth.single { grid-template-columns: 1fr; }
.auth-art { min-height: 100vh; padding: clamp(30px, 7vw, 88px); background: var(--nav); color: #fff9ed; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art::after { content: ""; position: absolute; right: -11vw; bottom: 15vh; width: 38vw; height: 8px; background: var(--accent); transform: rotate(-38deg); box-shadow: 0 22px 0 #fff9ed, 0 44px 0 var(--accent); opacity: .9; }
.auth-art h1 { position: relative; z-index: 1; margin: 0; max-width: 700px; font-size: clamp(3.5rem, 8vw, 7.6rem); line-height: .84; letter-spacing: -.075em; }
.auth-art p:not(.eyebrow) { position: relative; z-index: 1; max-width: 520px; color: #d9e3e9; font-size: var(--text-lg); }
.auth-art .eyebrow { color: #ff9a75; }
.auth-foot { font-size: var(--text-sm) !important; }
.auth-form { min-height: 100vh; padding: 28px; display: grid; place-items: center; }
.panel { width: min(460px, 100%); padding: clamp(24px, 4vw, 42px); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.panel.narrow { margin: 12vh auto; }
.panel h1, .panel h2 { margin: 0 0 20px; font-size: var(--text-xl); }
.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; margin-bottom: 23px; border-radius: var(--r-sm); background: var(--surface-2); }
.segmented button { border: 0; border-radius: 5px; padding: 9px; background: transparent; color: var(--ink); }
.segmented button.active { background: var(--surface); box-shadow: 0 2px 8px rgb(19 40 58 / 10%); }

.modal { position: fixed; inset: 0; z-index: 100; padding: 20px; background: rgb(8 23 34 / 78%); display: grid; place-items: center; }
.dialog { width: min(570px, 100%); max-height: min(90vh, 920px); overflow: auto; position: relative; padding: clamp(23px, 4vw, 38px); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.dialog.wide { width: min(1180px, 100%); padding: 0; overflow: hidden; }
.modal-close { position: absolute; right: 11px; top: 9px; z-index: 3; width: 40px; height: 40px; border: 0; background: var(--surface); color: var(--ink); font-size: 1.6rem; border-radius: 50%; }
.media-select { max-height: 210px; overflow: auto; margin-top: 15px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.media-select label { display: flex; align-items: center; gap: 9px; padding: 6px; }
.media-select input { width: 18px; height: 18px; }
.existing-shares { padding-top: 20px; margin-top: 20px; border-top: 1px solid var(--line); }
.share-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; }
.share-row small { display: block; color: var(--muted); }
.search-results { display: grid; gap: 5px; }
.search-results h3 { margin: 14px 0 4px; }
.search-results a, .search-results > div { padding: 10px; border: 1px solid var(--line); border-radius: var(--r-sm); text-decoration: none; }
.search-results small { display: block; color: var(--muted); }
.install-guide { display: grid; gap: 12px; }
.install-guide section { padding: 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); }
.install-guide section p { margin: 5px 0 0; }

.template-section + .template-section { margin-top: 34px; }
.template-card { min-height: 230px; }
.template-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: var(--text-xs); }
.template-kind { padding: 4px 7px; border-radius: 4px; background: #dcefe5; color: #0f6041; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.template-kind.quiet-kind { background: var(--surface-2); color: var(--muted); }
.structured-template-card { border-top: 4px solid var(--success); }
.template-card ol { list-style-position: outside; }
.template-card li { margin: 7px 0; }
.template-card li span, .template-card li small { display: block; }
.template-card li small { margin-top: 2px; color: var(--muted); font-size: var(--text-xs); }

.checklist-layout { grid-template-columns: minmax(0, 1fr) minmax(300px, 370px); }
.checklist-create-card { position: sticky; top: 100px; }
.checklist-create-card > h3 { margin-bottom: 4px; }
.checklist-list { display: grid; gap: 11px; }
.checklist-card { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; transition: transform var(--dur) var(--ease), box-shadow var(--dur); }
.checklist-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgb(19 40 58 / 9%); }
.checklist-card.is-complete { border-left: 4px solid var(--success); }
.checklist-card > button { width: 100%; padding: 17px 18px; border: 0; background: transparent; color: var(--ink); text-align: left; }
.checklist-card h4 { margin: 13px 0 3px; font-size: 1.08rem; }
.checklist-card p { margin: 0; color: var(--muted); font-size: var(--text-sm); }
.checklist-card .open-label { display: block; padding-top: 13px; font-size: var(--text-sm); }
.checklist-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.checklist-card-top time { color: var(--muted); font-size: var(--text-xs); }
.checklist-state { display: inline-flex; align-items: center; gap: 6px; width: max-content; padding: 5px 8px; border-radius: 999px; background: #fff0ce; color: #754600; font-size: .68rem; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; }
.checklist-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.checklist-state.completed { background: #dcefe5; color: #0f6041; }
.checklist-progress { margin-top: 15px; }
.checklist-progress-label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; color: var(--muted); font-size: var(--text-xs); }
.checklist-progress-label strong { color: var(--ink); }
.progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
.progress-track > span { display: block; width: var(--progress); height: 100%; border-radius: inherit; background: var(--success); transition: width 320ms var(--ease); }

.dialog.builder { width: min(1040px, 100%); padding: clamp(24px, 4vw, 42px); }
.builder-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 340px); gap: 32px; align-items: end; margin-bottom: 26px; padding-right: 30px; }
.builder-heading h2 { margin: 0 0 6px; font-size: var(--text-xl); }
.builder-heading p:not(.eyebrow) { margin: 0; color: var(--muted); }
.template-name-field { margin: 0; }
.template-builder { display: grid; gap: 18px; margin-bottom: 14px; }
.template-builder-section { padding: 18px; border: 1px solid var(--line); border-radius: var(--r); background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
.template-section-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 13px; }
.template-section-head .field { flex: 1; margin: 0; }
.template-section-head .quiet:disabled, .template-field-number .quiet:disabled { visibility: hidden; }
.template-fields { display: grid; gap: 11px; margin-bottom: 12px; }
.template-field-editor { padding: 16px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.template-field-number { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; color: var(--muted); font-size: var(--text-xs); font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.check-row { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.condition-editor { margin-top: 11px; padding: 11px 13px; border: 1px dashed var(--line); border-radius: var(--r-sm); }
.condition-editor summary { font-size: var(--text-sm); font-weight: 800; }
.condition-editor .helper { margin: 8px 0 0; }
.sticky-actions { position: sticky; bottom: -1px; z-index: 2; padding: 15px 0 2px; background: linear-gradient(transparent, var(--surface) 18%); }

.checklist-detail-header { display: flex; align-items: start; justify-content: space-between; gap: 24px; padding-right: 34px; }
.checklist-detail-header h2 { margin: 0; font-size: var(--text-xl); }
.checklist-detail-header p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); }
.checklist-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.checklist-detail > .checklist-progress { padding: 17px 0 24px; border-bottom: 1px solid var(--line); }
.checklist-sections { display: grid; gap: 30px; margin-top: 28px; }
.checklist-section-heading { padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.checklist-section-heading h3 { margin: 0; font-size: var(--text-lg); }
.checklist-field { padding: 18px 2px; border-bottom: 1px solid var(--line); }
.checklist-field.inactive { opacity: .62; }
.checklist-field-heading { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; }
.field-index { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-content: center; color: var(--muted); font-size: .7rem; font-weight: 850; }
.checklist-field.answered .field-index { border-color: var(--success); background: var(--success); color: white; }
.checklist-field h4 { margin: 3px 0 4px; font-size: 1.05rem; }
.checklist-field-heading p { margin: 0; color: var(--muted); font-size: var(--text-sm); white-space: pre-wrap; }
.field-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.field-badges span { padding: 3px 6px; border-radius: 4px; background: var(--surface-2); color: var(--muted); font-size: .66rem; font-weight: 800; }
.field-assignee { display: block; margin-top: 7px; color: var(--muted); }
.checklist-field-form { margin: 14px 0 0 46px; }
.response-control { margin: 0; }
.choice-row, .choice-grid, .rating-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-row label, .choice-grid label, .rating-row label { position: relative; }
.choice-row input, .choice-grid input, .rating-row input { position: absolute; opacity: 0; pointer-events: none; }
.choice-row span, .choice-grid span, .rating-row span { min-height: 43px; display: grid; place-content: center; padding: 8px 15px; border: 1px solid #a9a296; border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font-weight: 760; }
.choice-row input:focus-visible + span, .choice-grid input:focus-visible + span, .rating-row input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice-row input:checked + span, .choice-grid input:checked + span, .rating-row input:checked + span { border-color: var(--nav); background: var(--nav); color: white; }
.yes-no span { min-width: 94px; }
.rating-row { display: grid; grid-template-columns: repeat(5, minmax(52px, 1fr)); }
.rating-row label span { min-height: 58px; font-size: 1.1rem; }
.rating-row small { min-height: 12px; display: block; font-size: .55rem; font-weight: 550; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); }
.choice-grid span { justify-content: start; }
.evidence-picker { margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.evidence-picker summary { font-size: var(--text-sm); font-weight: 800; }
.evidence-picker summary span { float: right; color: var(--muted); font-weight: 600; }
.evidence-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 8px; margin-top: 11px; }
.evidence-grid label { position: relative; min-width: 0; }
.evidence-grid input { position: absolute; opacity: 0; }
.evidence-tile { min-width: 0; display: block; overflow: hidden; border: 2px solid transparent; border-radius: var(--r-sm); background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.evidence-tile img, .evidence-video { width: 100%; aspect-ratio: 4/3; display: grid; place-content: center; object-fit: cover; background: var(--nav); color: white; }
.evidence-tile small { display: block; overflow: hidden; padding: 6px; color: var(--muted); font-size: .63rem; text-overflow: ellipsis; white-space: nowrap; }
.evidence-grid input:focus-visible + .evidence-tile { outline: 3px solid var(--focus); outline-offset: 2px; }
.evidence-grid input:checked + .evidence-tile { border-color: var(--success); box-shadow: 0 0 0 1px var(--success); }
.evidence-grid input:checked + .evidence-tile::after { content: "Selected"; position: absolute; inset: 6px 6px auto auto; padding: 3px 5px; border-radius: 4px; background: var(--success); color: white; font-size: .58rem; font-weight: 850; }
.evidence-empty { margin-top: 14px; padding: 12px; border: 1px solid #d5bc78; border-radius: var(--r-sm); background: #fff5d9; color: #5f4708; }
.evidence-empty p { margin: 3px 0 0; font-size: var(--text-sm); }
.field-save-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; }
.field-save-row > span { color: var(--muted); font-size: var(--text-xs); }
.response-readout { margin: 13px 0 0 46px; display: grid; gap: 4px; padding: 12px; border-left: 3px solid var(--line); background: var(--surface-2); }
.response-readout span, .response-readout small { color: var(--muted); font-size: var(--text-xs); }
.checklist-loading { min-height: 260px; display: grid; align-content: center; }
.checklist-loading h2 { margin: 0 0 22px; }
.loading-bar { height: 5px; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
.loading-bar::after { content: ""; width: 35%; height: 100%; display: block; border-radius: inherit; background: var(--accent); animation: checklist-load 1.1s infinite alternate var(--ease); }
@keyframes checklist-load { to { transform: translateX(185%); } }

/* Project Pages — a paper-like composition surface inside the field workspace. */
.tab-count { display: inline-grid; min-width: 20px; height: 20px; margin-left: 3px; padding: 0 5px; place-content: center; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .65rem; }
.pages-workspace { max-width: 1180px; }
.pages-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.pages-heading h3 { margin: 0 0 7px; font-size: var(--text-xl); letter-spacing: -.035em; }
.pages-heading p:not(.eyebrow) { max-width: 680px; margin: 0; color: var(--muted); }
.online-only-note { display: flex; align-items: start; gap: 11px; margin: 14px 0 20px; padding: 13px 15px; border: 1px solid #c9a95a; border-left: 4px solid #a66b00; border-radius: var(--r-sm); background: #fff7dd; color: #62420a; }
.online-only-note > span { width: 25px; height: 25px; flex: 0 0 auto; display: grid; place-content: center; border-radius: 50%; background: #ffe9aa; font-weight: 900; }
.online-only-note strong { display: block; font-size: var(--text-sm); }
.online-only-note p { margin: 2px 0 0; font-size: var(--text-xs); }
.online-only-note.compact { margin: 12px 0 18px; }
.page-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 13px; }
.page-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: 0 5px 16px rgb(19 40 58 / 5%); transition: transform var(--dur) var(--ease), box-shadow var(--dur); }
.page-card:hover { transform: translateY(-2px); box-shadow: 0 13px 30px rgb(19 40 58 / 11%); }
.page-card > button { width: 100%; min-height: 205px; display: grid; grid-template-columns: 45px minmax(0, 1fr); padding: 0; border: 0; background: transparent; color: var(--ink); text-align: left; }
.page-card-accent { height: 100%; display: grid; place-content: start center; padding-top: 18px; background: var(--accent); color: white; font-size: .72rem; font-weight: 950; letter-spacing: .08em; }
.page-card-main { min-width: 0; display: flex; flex-direction: column; padding: 17px 18px 16px; }
.page-card-meta, .page-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: var(--text-xs); }
.page-share-state { padding: 4px 7px; border-radius: 999px; background: var(--surface-2); font-weight: 800; }
.page-share-state.active { background: #dcefe5; color: #0f6041; }
.page-card h4 { margin: 28px 0 7px; font-size: 1.18rem; letter-spacing: -.025em; }
.page-card-main > p { margin: 0; color: var(--muted); font-size: var(--text-xs); }
.page-card-foot { margin-top: auto; padding-top: 22px; border-top: 1px solid var(--line); }
.page-card-foot strong { color: var(--accent); }

.page-dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; padding-right: 28px; }
.page-dialog-heading h2 { margin: 0 0 6px; font-size: var(--text-xl); }
.page-dialog-heading p:not(.eyebrow) { margin: 0 0 16px; color: var(--muted); }
.online-pill { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; background: #fff0ce; color: #754600; font-size: .68rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.page-start-options { display: grid; gap: 8px; margin: 20px 0 4px; padding: 0; border: 0; }
.page-start-options legend { margin-bottom: 8px; }
.page-start-options label { position: relative; }
.page-start-options input { position: absolute; opacity: 0; }
.page-start-options label > span { min-height: 68px; display: grid; align-content: center; gap: 3px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.page-start-options small { color: var(--muted); }
.page-start-options input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.page-start-options input:checked + span { border-color: var(--accent); box-shadow: inset 4px 0 var(--accent); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }

.dialog.page-builder { width: min(1260px, 100%); max-height: 94vh; padding: clamp(22px, 3vw, 36px); }
.page-editor-shell { min-width: 0; }
.page-editor-header { min-width: 0; display: flex; align-items: start; justify-content: space-between; gap: 20px; padding-right: 34px; }
.page-editor-header h2 { margin: 0 0 5px; font-size: var(--text-xl); }
.page-editor-header p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: var(--text-sm); }
.page-editor-actions { display: flex; align-items: center; justify-content: end; gap: 8px; flex-wrap: wrap; }
.page-mode-switch { min-width: 168px; margin: 0; }
.page-mode-switch button { padding: 7px 10px; }
.page-history-actions { display: flex; gap: 5px; }
.page-conflict { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 14px 0 18px; padding: 14px; border: 1px solid #d6908a; border-left: 5px solid var(--danger); border-radius: var(--r-sm); background: #fff0ed; color: #6f2421; }
.page-conflict p { margin: 3px 0 0; font-size: var(--text-sm); }
.page-conflict > div:last-child { display: flex; gap: 7px; flex-wrap: wrap; }
.page-export-result { display: flex; align-items: center; gap: 11px; margin: 12px 0; padding: 11px 13px; border: 1px solid color-mix(in srgb, var(--success) 45%, var(--line)); border-radius: var(--r-sm); background: color-mix(in srgb, var(--success) 8%, var(--surface)); }
.page-export-result > span { width: 28px; height: 28px; display: grid; place-content: center; border-radius: 50%; background: var(--success); color: white; }
.page-export-result div { display: grid; gap: 2px; }
.page-export-result a { color: var(--success); font-size: var(--text-sm); font-weight: 750; }
.page-cover-editor, .page-block-builder, .page-settings-grid { margin-top: 18px; padding: 19px; border: 1px solid var(--line); border-radius: var(--r); background: color-mix(in srgb, var(--surface-2) 35%, var(--surface)); }
.page-panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.page-panel-heading h3 { margin: 0; font-size: var(--text-lg); }
.page-panel-heading > span { color: var(--muted); font-size: var(--text-xs); }
.page-photo-fieldset { min-width: 0; margin: 17px 0 0; padding: 0; border: 0; }
.page-photo-fieldset legend { margin-bottom: 9px; }
.page-media-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(115px, 1fr)); gap: 8px; max-height: 310px; overflow: auto; padding: 3px; }
.page-media-choice { position: relative; min-width: 0; }
.page-media-choice input { position: absolute; opacity: 0; }
.page-media-choice > span { min-width: 0; min-height: 102px; display: block; overflow: hidden; border: 2px solid transparent; border-radius: var(--r-sm); background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.page-media-choice img { width: 100%; aspect-ratio: 4/3; display: block; object-fit: cover; }
.page-media-choice small { display: block; overflow: hidden; padding: 6px; color: var(--muted); font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
.page-media-choice.no-photo > span { height: 100%; display: grid; place-content: center; padding: 12px; color: var(--muted); text-align: center; }
.page-media-choice input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.page-media-choice input:checked + span { border-color: var(--success); box-shadow: 0 0 0 1px var(--success); }
.page-media-choice input:checked + span::after { content: "Selected"; position: absolute; inset: 6px 6px auto auto; padding: 3px 5px; border-radius: 4px; background: var(--success); color: white; font-size: .58rem; font-weight: 850; }
.page-block-builder { display: grid; gap: 12px; }
.page-block-editor { min-width: 0; padding: 16px; border: 1px solid var(--line); border-left: 5px solid var(--nav-2); border-radius: var(--r-sm); background: var(--surface); }
.page-block-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: var(--muted); font-size: var(--text-xs); font-weight: 850; letter-spacing: .055em; text-transform: uppercase; }
.page-block-toolbar > div { display: flex; gap: 3px; }
.icon-action { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 1rem; }
.icon-action:hover:not(:disabled) { border-color: var(--ink); }
.icon-action:disabled { opacity: .35; cursor: not-allowed; }
.page-checklist-items { display: grid; gap: 7px; margin: 10px 0; }
.page-checklist-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.page-checklist-item label:first-child { width: 38px; height: 42px; display: grid; place-content: center; }
.page-checklist-item input[type="checkbox"] { width: 19px; height: 19px; }
.page-checklist-item > input { width: 100%; min-height: 42px; padding: 9px 10px; border: 1px solid #a9a296; border-radius: var(--r-sm); background: var(--surface); color: var(--ink); }
.page-caption-toggle { align-self: end; min-height: 43px; }
.page-photo-settings { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.page-add-block { display: grid; grid-template-columns: auto minmax(190px, 280px) auto; align-items: center; gap: 9px; margin-top: 4px; padding-top: 14px; border-top: 1px dashed var(--line); }
.page-add-block label { font-size: var(--text-sm); font-weight: 760; }
.page-settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 20px; }
.page-settings-grid > div + .page-share-panel { padding-left: 20px; border-left: 1px solid var(--line); }
.page-settings-readout { padding: 13px; border-left: 4px solid var(--nav-2); background: var(--surface); }
.page-settings-readout p { margin: 4px 0 0; color: var(--muted); font-size: var(--text-sm); }
.page-restrict-toggle { font-weight: 780; }
.page-access-list { display: grid; gap: 6px; max-height: 310px; margin: 13px 0; overflow: auto; }
.page-access-row { display: grid; grid-template-columns: minmax(0, 1fr) 125px; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.page-access-row .person > span { width: 32px; height: 32px; font-size: var(--text-xs); }
.page-access-row select { min-height: 38px; padding: 7px; }
.page-access-fixed { justify-self: end; padding: 5px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: var(--text-xs); font-weight: 800; }
.page-share-panel { min-width: 0; }
.page-share-panel form { margin-bottom: 13px; }
.page-share-list { display: grid; gap: 6px; }
.page-share-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.page-share-row small { display: block; margin-top: 3px; color: var(--muted); font-size: var(--text-xs); }
.page-share-row > div:last-child { display: flex; gap: 10px; }
.page-share-row.revoked { opacity: .58; }
.page-save-bar { position: sticky; z-index: 4; bottom: -36px; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 22px; padding: 17px 0 5px; background: linear-gradient(transparent, var(--surface) 16%); }
.page-save-bar > div:first-child { display: grid; gap: 2px; }
.page-save-bar small { color: var(--muted); }
.page-save-bar > div:last-child { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-view-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 960px; margin: 18px auto; }
.page-view-panels details { padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); }
.page-view-panels summary { font-weight: 800; }
.page-view-panels details > *:not(summary) { margin-top: 14px; }

.page-document { width: min(900px, 100%); margin: 24px auto; overflow: hidden; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); box-shadow: 0 22px 55px rgb(19 40 58 / 13%); }
.page-document-title { padding: clamp(34px, 7vw, 72px) clamp(28px, 8vw, 86px) 30px; border-bottom: 5px solid var(--accent); }
.page-document-title h1, .page-document-cover h1 { margin: 0 0 10px; font-size: clamp(2.3rem, 6vw, 4.8rem); line-height: .95; letter-spacing: -.06em; }
.page-document-title.align-center, .page-document-cover.align-center > div { text-align: center; }
.page-document-title > p:not(.eyebrow), .page-document-cover > div > p:not(.eyebrow) { margin: 0; color: var(--muted); }
.page-document-cover { position: relative; min-height: 430px; display: grid; align-items: end; overflow: hidden; padding: clamp(30px, 7vw, 70px); background: var(--nav); color: white; }
.page-document-cover > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.page-document-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(5 18 28 / 10%), rgb(5 18 28 / 89%)); }
.page-document-cover > div { position: relative; z-index: 1; }
.page-document-cover .eyebrow { color: #ff9a75; }
.page-document-cover > div > p:not(.eyebrow) { color: #dbe5eb; }
.page-toc { margin: 36px clamp(28px, 8vw, 86px) 0; padding: 18px 20px; border-left: 5px solid var(--accent); background: var(--surface-2); }
.page-toc > strong { font-size: var(--text-xs); letter-spacing: .07em; text-transform: uppercase; }
.page-toc ol { display: grid; gap: 4px; margin: 10px 0 0; padding-left: 22px; }
.page-toc li.level-3 { margin-left: 15px; }
.page-toc a { color: var(--ink); text-underline-offset: 3px; }
.page-document-body { padding: clamp(35px, 7vw, 76px) clamp(28px, 8vw, 86px); }
.page-doc-heading { margin: 1.8em 0 .55em; line-height: 1.08; letter-spacing: -.035em; scroll-margin-top: 35px; }
.page-doc-heading:first-child { margin-top: 0; }
.page-document-body h1 { font-size: 2.2rem; }
.page-document-body h2 { font-size: 1.7rem; }
.page-document-body h3 { font-size: 1.25rem; }
.page-doc-paragraph { margin: 0 0 1.25em; line-height: 1.75; white-space: pre-wrap; }
.page-doc-list { margin: 0 0 1.45em; padding-left: 1.5em; line-height: 1.7; }
.page-doc-checklist { margin: 0 0 1.5em; padding: 17px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.page-doc-checklist h3 { margin: 0 0 12px; }
.page-doc-checklist ul { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.page-doc-checklist li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; }
.page-doc-checklist li.checked { color: var(--muted); text-decoration: line-through; }
.page-doc-link a { display: inline-flex; gap: 6px; color: var(--info); font-weight: 780; text-underline-offset: 4px; }
.page-doc-table { margin: 0 0 1.6em; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
.page-doc-table th { background: var(--surface-2); color: var(--ink); }
.page-doc-table tr:last-child td { border-bottom: 0; }
.page-doc-photo-grid { display: grid; grid-template-columns: repeat(var(--page-columns, 3), minmax(0, 1fr)); gap: 9px; margin: 1.7em 0; }
.page-doc-photo-grid.columns-1 { --page-columns: 1; }
.page-doc-photo-grid.columns-2 { --page-columns: 2; }
.page-doc-photo-grid.columns-3 { --page-columns: 3; }
.page-doc-photo-grid.columns-4 { --page-columns: 4; }
.page-doc-photo-grid.layout-stack { --page-columns: 1; }
.page-doc-photo-grid.size-small { max-width: 620px; }
.page-doc-photo-grid.size-large { width: calc(100% + 48px); margin-left: -24px; }
.page-doc-photo-grid figure { min-width: 0; margin: 0; overflow: hidden; border-radius: var(--r-sm); background: var(--surface-2); }
.page-doc-photo-grid figure { position: relative; }
.page-doc-photo-grid img { width: 100%; aspect-ratio: 4/3; display: block; object-fit: cover; }
.page-doc-photo-grid.aspect-original img { aspect-ratio: auto; max-height: 620px; object-fit: contain; }
.page-doc-photo-grid.aspect-square img { aspect-ratio: 1; }
.page-doc-photo-grid.aspect-landscape img { aspect-ratio: 16/9; }
.page-doc-photo-grid figcaption { padding: 8px; color: var(--muted); font-size: var(--text-xs); }
.page-doc-photo-grid figcaption time { display: block; margin-top: 3px; font-size: .65rem; }
.page-photo-tags { display: block; margin-top: 4px; color: var(--info); font-size: .66rem; }
.page-photo-number { position: absolute; z-index: 1; top: 7px; left: 7px; min-width: 24px; height: 24px; padding: 0 6px; display: grid; place-content: center; border-radius: 999px; background: rgb(8 23 34 / 82%); color: white; font-size: .68rem; font-weight: 900; }
.page-block-empty { grid-column: 1 / -1; color: var(--muted); font-style: italic; }
.public-page-document { width: min(1060px, calc(100% - 24px)); padding-top: 28px; }
.public-page-document .page-document { margin-top: 38px; }

.media-dialog { min-height: 640px; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(310px, .8fr); }
.media-stage { min-width: 0; padding: 50px 26px 24px; background: #07131c; color: white; display: grid; align-content: center; }
.annotatable { position: relative; display: grid; place-items: center; }
.annotatable img, .annotatable video { max-height: 73vh; width: 100%; object-fit: contain; display: block; }
#annotation-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.canvas-help { margin: 10px 0 0; color: #c7d2da; font-size: var(--text-xs); text-align: center; }
.media-inspector { max-height: 90vh; overflow: auto; padding: 36px 25px 25px; background: var(--surface); }
.media-inspector h2 { margin: 0 0 5px; font-size: var(--text-xl); }
.media-stat { display: flex; gap: 13px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: var(--text-xs); }
.comments { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.comments h3 { margin: 0 0 10px; }
.comments li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.comments li p { margin: 0 0 5px; }
.comments time { color: var(--muted); font-size: var(--text-xs); }
.comments form { display: grid; gap: 8px; margin-top: 12px; }
.comments form button { justify-self: end; }

.public-page { max-width: 1240px; min-height: 100vh; }
.public-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 25px; border-bottom: 1px solid var(--line); color: var(--muted); }
.public-header .brand { color: var(--ink); }
.public-hero { padding: 55px 0 32px; }
.public-hero h1 { margin: 0 0 10px; font-size: var(--text-2xl); letter-spacing: -.055em; }
.public-hero p { color: var(--muted); }
.public-gallery { columns: 3 270px; column-gap: 14px; }
.public-gallery figure { break-inside: avoid; margin: 0 0 14px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.public-gallery img, .public-gallery video { width: 100%; display: block; }
.public-gallery figcaption { padding: 12px; font-weight: 720; }
.public-gallery small { display: block; margin-top: 4px; color: var(--muted); font-weight: 400; }
.public-page footer { padding: 40px 0 0; color: var(--muted); text-align: center; }

#toast { position: fixed; right: 20px; bottom: 20px; z-index: 210; max-width: min(390px, calc(100vw - 40px)); padding: 13px 16px; border-radius: var(--r-sm); background: var(--nav); color: white; box-shadow: var(--shadow); opacity: 0; transform: translateY(80px); pointer-events: none; transition: var(--dur) var(--ease); }
#toast.show { opacity: 1; transform: none; }
#toast[data-type="error"] { background: var(--danger); }
#toast[data-type="warning"] { background: #6d4500; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: auto 0 0 0; z-index: 50; height: calc(66px + env(safe-area-inset-bottom)); padding: 7px 8px env(safe-area-inset-bottom); display: block; border-top: 1px solid #355064; }
  .sidebar > .brand, .profile { display: none; }
  .nav { margin: 0; grid-template-columns: repeat(5, 1fr); gap: 2px; }
  .nav .nav-secondary { display: none; }
  .nav-more { display: flex !important; }
  .nav a, .nav button { min-width: 0; min-height: 51px; padding: 5px 2px; flex-direction: column; justify-content: center; gap: 2px; text-align: center; font-size: .68rem; line-height: 1.1; }
  .nav a span:first-child, .nav button span:first-child { width: auto; font-size: 1rem; }
  .nav-badge { position: absolute; right: calc(50% - 24px); top: 2px; min-width: 18px; height: 18px; margin: 0; }
  .content { padding-bottom: calc(75px + env(safe-area-inset-bottom)); }
  .two-column, .checklist-layout { grid-template-columns: 1fr; }
  .task-create-card { position: static; }
  .project-location-layout { grid-template-columns: 1fr; }
  .checklist-create-card { position: static; }
  .location-controls { position: static; }
  .builder-heading { grid-template-columns: 1fr; gap: 14px; }
  .page-settings-grid { grid-template-columns: 1fr; }
  .page-settings-grid > div + .page-share-panel { padding: 20px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .page-view-panels { grid-template-columns: 1fr; }
  .media-dialog { grid-template-columns: 1fr; overflow: auto; max-height: 90vh; }
  .media-stage { min-height: 48vh; }
  .media-inspector { max-height: none; }
}

@media (max-width: 700px) {
  .topbar { padding: 11px 14px; min-height: 64px; }
  .topbar > div:first-child { display: none; }
  .top-actions { width: 100%; gap: 8px; }
  #global-search { flex: 1; }
  #global-search input { width: 100%; min-width: 0; }
  .sync-badge { max-width: 132px; overflow: hidden; text-overflow: ellipsis; }
  .install-compact { display: none; }
  main { padding: 22px 14px; }
  .hero, .project-heading { grid-template-columns: 1fr; display: grid; align-items: start; }
  .hero .btn { width: 100%; }
  .split, .capture-panel { align-items: stretch; flex-direction: column; }
  .capture-actions .btn { flex: 1; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .shot-info { padding: 9px; }
  .shot-info small { display: none; }
  .media-badges { padding: 0 9px 8px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-form { padding: 14px; }
  .panel { padding: 24px 19px; }
  .activity-item { grid-template-columns: auto minmax(0,1fr); }
  .activity-item time { grid-column: 2; text-align: left; }
  .notification-item > a { grid-template-columns: auto minmax(0, 1fr); }
  .notification-arrow { display: none; }
  .notification-copy > span:not(.notification-title) { white-space: normal; }
  .customer-grid { grid-template-columns: 1fr; }
  .customer-profile { align-items: stretch; flex-direction: column; }
  .customer-profile-head { align-items: flex-start; }
  .customer-profile > .btn { width: 100%; }
  .customer-detail-grid { grid-template-columns: 1fr; }
  .map-filters { grid-template-columns: 1fr; }
  .coordinate-map { min-height: 340px; border-radius: var(--r); }
  .map-project-row { grid-template-columns: auto minmax(0, 1fr); }
  .map-project-row > .quiet { grid-column: 2; justify-self: start; }
  .location-readout { grid-template-columns: 1fr; }
  .coordinate-fields { grid-template-columns: 1fr; gap: 0; }
  .dialog { padding: 27px 18px 20px; }
  .dialog.wide { padding: 0; }
  .dialog.builder { padding: 28px 15px 20px; }
  .modal:has(.dialog.page-builder) { padding: 0; }
  .dialog.page-builder { width: 100%; height: 100%; max-height: 100vh; padding: 24px 14px 16px; border-radius: 0; }
  .pages-heading, .page-editor-header, .page-dialog-heading, .page-conflict, .page-save-bar { align-items: stretch; flex-direction: column; }
  .pages-heading .btn { width: 100%; }
  .page-card-grid { grid-template-columns: 1fr; }
  .page-editor-header { display: flex; padding-right: 34px; }
  .page-editor-actions { justify-content: start; }
  .page-mode-switch { min-width: 150px; }
  .page-conflict > div:last-child .btn { flex: 1; }
  .page-cover-editor, .page-block-builder, .page-settings-grid { padding: 13px; }
  .page-add-block { grid-template-columns: 1fr; }
  .page-photo-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-add-block .btn { width: 100%; }
  .page-access-row { grid-template-columns: 1fr; }
  .page-save-bar { position: static; display: flex; padding-top: 18px; background: none; }
  .page-save-bar > div:last-child { align-items: stretch; flex-direction: column; }
  .page-save-bar .btn { width: 100%; }
  .page-document { margin: 16px auto; }
  .page-document-cover { min-height: 330px; }
  .page-doc-photo-grid.columns-3, .page-doc-photo-grid.columns-4 { --page-columns: 2; }
  .page-doc-photo-grid.size-large { width: 100%; margin-left: 0; }
  .public-page-document { width: 100%; padding: 18px 12px; }
  .task { grid-template-columns: auto minmax(0, 1fr); }
  .task-actions { grid-column: 2; flex-direction: row; align-items: center; }
  .task-dialog-heading { align-items: stretch; flex-direction: column; }
  .task-state { align-self: start; }
  .task-dialog .task-media-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .builder-heading { padding-right: 28px; }
  .template-builder-section, .template-field-editor { padding: 13px; }
  .field-grid { grid-template-columns: 1fr; gap: 0; }
  .template-section-head, .checklist-detail-header { align-items: stretch; flex-direction: column; }
  .checklist-detail-header { display: flex; padding-right: 30px; }
  .checklist-detail-header .btn { align-self: start; }
  .checklist-field-form, .response-readout { margin-left: 0; }
  .rating-row { grid-template-columns: repeat(5, minmax(45px, 1fr)); }
  .field-save-row { align-items: stretch; flex-direction: column; }
  .field-save-row .btn { width: 100%; }
  .composer-foot, .comment-submit { align-items: stretch; flex-direction: column; }
  .composer-foot .btn, .comment-submit .btn { width: 100%; }
  .media-stage { padding: 48px 10px 15px; }
  .media-inspector { padding: 25px 18px; }
  .public-header > span { display: none; }
}

@media (max-width: 380px) {
  .gallery { grid-template-columns: 1fr; }
  .task-media-options, .task-dialog .task-assignee-options, .task-dialog .task-media-options { grid-template-columns: 1fr; }
  .nav a, .nav button { font-size: .62rem; }
  .sync-badge { max-width: 103px; }
}

@media (prefers-color-scheme: dark) {
  :root { --bg:#0d1922; --surface:#152733; --surface-2:#213642; --ink:#f3f0e9; --muted:#b6c2ca; --line:#3c505c; --nav:#08131b; --nav-2:#193246; --accent:#ef7045; --accent-hover:#d95427; --focus:#62b8eb; --shadow:0 18px 48px rgb(0 0 0 / 45%); color-scheme:dark; }
  .topbar { background: rgb(13 25 34 / 94%); }
  .field input, .field textarea, .field select, select, .composer textarea, .comments textarea { background:#0f202b; color:#f3f0e9; border-color:#566b78; }
  .queue-banner { background:#3b310e; border-color:#756522; color:#fff0b4; }
  .task-online-note { background:#3b310e; border-color:#756522; color:#fff0b4; }
  .filter.active { background:#e9eef1; color:#0c1b25; }
  .panel { background:var(--surface); }
  .segmented button { color:var(--ink); }
  .public-header .brand { color:var(--ink); }
  .file-icon.pdf { background:#502c28; color:#ffb5a4; }
  .favorite.active { color:#ffc36a; }
  .template-kind, .checklist-state.completed { background:#193e32; color:#9de1c4; }
  .directory-linked { background:#193e32; color:#9de1c4; }
  .checklist-state { background:#493a18; color:#ffd98e; }
  .evidence-empty { background:#3b310e; border-color:#756522; color:#fff0b4; }
  .directory-search input { background:#0f202b; color:#f3f0e9; border-color:#566b78; }
  .notification-title i { background:#502c28; color:#ffb5a4; }
  .task-state { background:#493a18; color:#ffd98e; }
  .task-state.done { background:#193e32; color:#9de1c4; }
  .online-only-note { background:#3b310e; border-color:#756522; color:#fff0b4; }
  .online-only-note > span { background:#5a4812; }
  .online-pill { background:#493a18; color:#ffd98e; }
  .page-share-state.active { background:#193e32; color:#9de1c4; }
  .page-conflict { background:#442321; border-color:#8e4540; color:#ffc3bc; }
  .page-checklist-item > input { background:#0f202b; color:#f3f0e9; border-color:#566b78; }
  .page-card, .page-block-editor, .page-document, .page-media-choice > span, .page-access-row { box-shadow:none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
