/*
 * UI consistency layer
 *
 * This file is intentionally loaded after the legacy feature styles.  It owns
 * the shared visual contract only: typography, controls, cards, page rhythm,
 * empty states and responsive density.  Feature layout and behavior remain in
 * their existing modules.
 */

:root {
  --ui-font-caption: 12px;
  --ui-font-body: 14px;
  --ui-font-card-title: 16px;
  --ui-font-page-title: 22px;
  --ui-line-body: 1.55;
  --ui-control-height: 40px;
  --ui-card-radius: 10px;
  --ui-card-padding-x: 18px;
  --ui-card-header-height: 60px;
  --ui-section-gap: 16px;
  --ui-page-gap: 20px;
  --ui-border: var(--neutral-200, #e5e7eb);
  --ui-surface-muted: var(--neutral-50, #f8fafc);
}

@media (max-width: 980px) {
  .knowledge-list-layout, .knowledge-document-layout { grid-template-columns: 1fr; }
  .knowledge-summary, .knowledge-outline { position: static; }
  .knowledge-summary { display: none; }
}

@media (max-width: 680px) {
  .knowledge-list-row { grid-template-columns: 4px 40px minmax(0, 1fr); gap: 10px; min-height: 0; padding: 13px 12px 13px 0; }
  .knowledge-row-icon { width: 38px; height: 38px; border-radius: 8px; font-size: 10px; }
  .knowledge-list-row time, .knowledge-row-open { grid-column: 3; }
  .knowledge-list-row time { margin-top: -4px; }
  .knowledge-row-open { margin-top: -8px; }
  .knowledge-search > div { gap: 7px; }
  .knowledge-search .primary-action { padding: 0 12px; }
  .knowledge-document { padding: 20px; }
  .knowledge-drawer { width: min(100vw - 18px, 410px); }
  .knowledge-finder-drawer { left: 0; }
  .knowledge-overlay-backdrop { left: 0; }
}

/* Knowledge creation: an intentionally quiet, Notion-like document canvas. */
.knowledge-editor-page { max-width: 1180px; }
.notion-editor { position: relative; display: grid; max-width: 960px; gap: 18px; margin: 0 auto; padding: 12px clamp(12px, 4vw, 54px) 40px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.knowledge-editor-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 34px; color: var(--neutral-500); font-size: 11px; letter-spacing: .09em; }
.knowledge-editor-topbar > span { color: var(--primary-700); font-weight: 800; }.knowledge-editor-topbar > div { display: flex; align-items: center; gap: 10px; }.knowledge-editor-topbar small { letter-spacing: 0; }
.knowledge-title-input { width: 100%; min-height: 68px; padding: 0; border: 0; border-radius: 0; outline: 0; color: var(--neutral-950); background: transparent; box-shadow: none; font-size: clamp(30px, 4vw, 42px); font-weight: 800; letter-spacing: -.04em; }.knowledge-title-input:focus { border: 0; box-shadow: none; }.knowledge-title-input::placeholder { color: var(--neutral-300); }
.knowledge-properties { color: var(--neutral-500); font-size: 14px; }.knowledge-properties summary { width: fit-content; cursor: pointer; list-style: none; }.knowledge-properties summary::-webkit-details-marker { display: none; }.knowledge-properties[open] summary { margin-bottom: 12px; color: var(--primary-700); }.knowledge-editor-metadata { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 14px; border: 1px solid var(--ui-border); border-radius: 10px; background: var(--ui-surface-muted); }.knowledge-editor-metadata label { display: grid; gap: 7px; color: var(--neutral-700); font-size: 12px; font-weight: 700; }
.knowledge-block-canvas { min-height: 460px; padding: 22px 0 50px; outline: 0; color: var(--neutral-800); font-size: 16px; line-height: 1.78; }.knowledge-block-canvas > * { margin: 0 0 10px; }.knowledge-block-canvas > [data-knowledge-placeholder]::before { content: "Enter 키를 눌러 빈 페이지에 입력을 시작하거나 /로 블록을 추가하세요."; color: var(--neutral-400); pointer-events: none; }.knowledge-block-canvas h2 { margin-top: 30px; color: var(--neutral-950); font-size: 25px; }.knowledge-block-canvas h3 { margin-top: 24px; color: var(--neutral-950); font-size: 20px; }.knowledge-block-canvas h4 { margin-top: 20px; color: var(--neutral-950); font-size: 17px; }.knowledge-block-canvas pre { padding: 16px; overflow: auto; border-radius: 9px; color: #dbeafe; background: #0f172a; font: 13px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; }.knowledge-block-canvas hr { border: 0; border-top: 1px solid var(--ui-border); margin: 24px 0; }.knowledge-list-block { padding-left: 25px; }.knowledge-list-block li { padding-left: 2px; }.knowledge-block-canvas blockquote { margin: 18px 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--primary-400); color: var(--neutral-600); }.knowledge-toggle-block { padding: 10px 12px; border: 1px solid var(--ui-border); border-radius: 8px; background: var(--ui-surface-muted); }.knowledge-toggle-block summary { cursor: pointer; font-weight: 700; }.knowledge-toggle-block [data-toggle-content] { padding: 10px 0 0 22px; color: var(--neutral-600); outline: 0; }.knowledge-table-block { width: min(100%, 760px); border-collapse: collapse; }.knowledge-table-block th, .knowledge-table-block td { min-width: 130px; padding: 8px 10px; border: 1px solid var(--ui-border); text-align: left; outline: 0; }.knowledge-table-block th { background: var(--ui-surface-muted); }.knowledge-check-block { display: flex; align-items: flex-start; gap: 9px; }.knowledge-check-block input { margin-top: 8px; }.knowledge-check-block span { min-width: 0; flex: 1; outline: 0; }.knowledge-editor-image { width: min(100%, 700px); margin: 18px 0; }.knowledge-editor-image img { display: block; width: 100%; max-height: 560px; border-radius: 8px; object-fit: contain; background: var(--neutral-100); }.knowledge-editor-image figcaption { margin-top: 6px; color: var(--neutral-500); font-size: 12px; }
.knowledge-block-canvas [data-knowledge-placeholder]:empty::before { content: attr(data-knowledge-placeholder); color: var(--neutral-400); pointer-events: none; }.knowledge-block-canvas pre [data-knowledge-placeholder]:empty::before { color: #94a3b8; }.knowledge-block-canvas [data-knowledge-placeholder]:empty { min-width: 1px; }.notion-editor.is-block-dragging .knowledge-block-toolbar { pointer-events: none; }
.knowledge-link-preview { display: grid; gap: 3px; width: min(100%, 720px); padding: 14px 16px; border: 1px solid var(--ui-border); border-radius: 10px; background: var(--ui-surface-muted); }.knowledge-link-preview:hover { border-color: var(--primary-300); background: var(--primary-50); }.knowledge-link-preview strong, .knowledge-link-preview [data-knowledge-link-description] { outline: 0; }.knowledge-link-preview strong { color: var(--neutral-900); }.knowledge-link-preview [data-knowledge-link-description] { color: var(--neutral-600); font-size: 13px; }.knowledge-link-preview a { width: fit-content; margin-top: 3px; color: var(--primary-700); font-size: 12px; font-weight: 700; }.knowledge-link-domain { color: var(--neutral-500); font-size: 11px; font-weight: 700; }a.knowledge-link-preview { color: inherit; text-decoration: none; }a.knowledge-link-preview em { margin-top: 3px; color: var(--primary-700); font-size: 12px; font-style: normal; font-weight: 700; }
.knowledge-notion-import { width: min(100%, 900px); min-height: 32px; outline: 0; }.knowledge-notion-import > :first-child { margin-top: 0; }.knowledge-notion-import > :last-child { margin-bottom: 0; }.knowledge-notion-import h1 { font-size: 32px; }.knowledge-notion-import h2 { font-size: 26px; }.knowledge-notion-import h3 { font-size: 21px; }.knowledge-notion-import img { max-width: 100%; height: auto; border-radius: 8px; }.knowledge-notion-import table { max-width: 100%; border-collapse: collapse; }.knowledge-notion-import td, .knowledge-notion-import th { padding: 7px 10px; border: 1px solid var(--ui-border); }.knowledge-notion-import blockquote { padding-left: 14px; border-left: 3px solid var(--primary-400); color: var(--neutral-600); }.knowledge-notion-import details { padding: 8px 10px; border: 1px solid var(--ui-border); border-radius: 8px; }.knowledge-notion-import summary { cursor: pointer; font-weight: 700; }
.knowledge-slash-menu { position: absolute; z-index: 8; display: grid; width: min(330px, calc(100% - 24px)); max-height: 390px; gap: 6px; padding: 8px; overflow: hidden; border: 1px solid var(--ui-border); border-radius: 10px; background: #fff; box-shadow: 0 14px 32px rgb(15 23 42 / 18%); }.knowledge-slash-menu input { width: 100%; height: 34px; padding: 0 9px; border: 0; border-radius: 6px; outline: 0; background: var(--ui-surface-muted); font-size: 13px; }.knowledge-command-options { display: grid; max-height: 320px; overflow: auto; }.knowledge-slash-menu button { display: grid; grid-template-columns: 1fr; gap: 1px; padding: 9px 11px; border: 0; border-radius: 6px; color: var(--neutral-800); background: transparent; text-align: left; cursor: pointer; }.knowledge-slash-menu button:hover, .knowledge-slash-menu button.is-command-selected { background: var(--primary-50, #eff6ff); color: var(--primary-800); }.knowledge-slash-menu button b { font-size: 13px; }.knowledge-slash-menu small { color: var(--neutral-500); font-size: 11px; }.knowledge-block-toolbar { position: absolute; z-index: 9; display: flex; gap: 2px; }.knowledge-block-toolbar button { display: grid; width: 26px; height: 26px; place-items: center; border: 0; border-radius: 5px; color: var(--neutral-500); background: transparent; font-size: 19px; line-height: 1; cursor: pointer; }.knowledge-block-toolbar [data-knowledge-block-action="menu"] { cursor: grab; font-size: 18px; letter-spacing: -3px; }.knowledge-block-toolbar [data-knowledge-block-action="menu"]:active { cursor: grabbing; }.knowledge-block-toolbar button:hover { color: var(--neutral-800); background: var(--ui-surface-muted); }.knowledge-block-context { position: absolute; z-index: 10; display: grid; min-width: 150px; gap: 2px; padding: 6px; border: 1px solid var(--ui-border); border-radius: 9px; background: #fff; box-shadow: 0 14px 32px rgb(15 23 42 / 18%); }.knowledge-block-context button { padding: 8px 10px; border: 0; border-radius: 6px; color: var(--neutral-700); background: transparent; text-align: left; font-size: 13px; cursor: pointer; }.knowledge-block-context button:hover { background: var(--ui-surface-muted); }.knowledge-block-context [data-knowledge-block-action="delete"] { color: #dc2626; }.knowledge-block-canvas [data-knowledge-block] { border-radius: 4px; }.knowledge-block-canvas [data-knowledge-block][draggable="true"] { cursor: text; }.knowledge-block-canvas .knowledge-drag-over { outline: 2px solid var(--primary-300); outline-offset: 3px; }.knowledge-block-canvas .knowledge-block-dragging { opacity: .45; }.knowledge-editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; border-top: 1px solid var(--ui-border); color: var(--neutral-500); font-size: 12px; }.knowledge-editor-footer > div { display: flex; gap: 8px; }.knowledge-editor-footer b { display: inline-grid; width: 18px; height: 18px; place-items: center; border: 1px solid var(--ui-border); border-radius: 4px; color: var(--neutral-700); }
@media (max-width: 680px) {
  .knowledge-editor-metadata { grid-template-columns: 1fr; }
  .notion-editor { padding: 6px 2px 28px; }.knowledge-block-canvas { min-height: 380px; font-size: 15px; }.knowledge-editor-footer { align-items: flex-start; flex-direction: column; }.knowledge-editor-footer > div { width: 100%; }.knowledge-editor-footer .primary-action { flex: 1; }
}

.ui-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  vertical-align: middle;
}

.primary-nav .ui-icon,
.secondary-nav .ui-icon { width: 19px; height: 19px; }
.metric-icon .ui-icon { width: 22px; height: 22px; }

html,
body { font-size: var(--ui-font-body); color: var(--neutral-950, #111827); }

body,
button,
input,
select,
textarea { line-height: var(--ui-line-body); }

/* Page rhythm */
#main-content { padding: 20px 28px 28px; }
.ops-page { display: grid; gap: var(--ui-section-gap); }
.ops-page > * { min-width: 0; }
.ops-page-header { align-items: flex-end; margin: 0; }
.ops-page-header > div > span,
.topbar-page-identity > span { font-size: var(--ui-font-caption); }
.ops-page-header h1,
.topbar-page-identity h1,
.topbar .site-context-title h1 { font-size: var(--ui-font-page-title); }
.ops-page-header p { margin-bottom: 0; font-size: var(--ui-font-body); }

/* Shared controls */
.primary-action,
.outline-action,
button.primary,
.button {
  min-height: var(--ui-control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.topbar-page-actions .primary-action,
.topbar-page-actions .outline-action { min-height: var(--ui-control-height); }

input,
select,
textarea {
  border-color: var(--neutral-300, #d1d5db);
  border-radius: 7px;
  color: var(--neutral-950, #111827);
  font-size: var(--ui-font-body);
}

input,
select { min-height: var(--ui-control-height); }
textarea { line-height: 1.6; }

/* Shared section card */
.ops-panel,
.ops-section,
.detail-card,
.search-result-group,
.global-search-results,
.site-folder-group,
.site-library-results.list,
.site-library-heading,
.site-library-stats,
.site-library-toolbar,
.knowledge-groups > section,
.field-quick-form,
.field-quick-guide > section,
.field-incident-link {
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-card-radius);
  background: #fff;
  box-shadow: none;
}

.detail-card + .detail-card { margin-top: 0; }

.ops-panel > header,
.ops-section > header,
.detail-card > header,
.search-result-group > header,
.global-search-results > header {
  min-height: var(--ui-card-header-height);
  padding: 12px var(--ui-card-padding-x);
}

.ops-panel h2,
.ops-section h2,
.detail-card h2,
.search-result-group h2,
.global-search-results h2,
.knowledge-groups h2 {
  font-size: var(--ui-font-card-title);
  line-height: 1.35;
}

.ops-panel header p,
.ops-section header p,
.detail-card header p,
.global-search-results header p,
.site-library-heading p {
  color: var(--neutral-600, #4b5563);
  font-size: var(--ui-font-caption);
  line-height: 1.5;
}

.ops-panel header a,
.ops-section header a,
.detail-card header a,
.detail-card > header > span,
.site-artifact-list small,
.inventory-files small,
.inventory-file-meta small { font-size: var(--ui-font-caption); }

.empty-state {
  min-height: 112px;
  place-content: center;
  gap: 7px;
  padding: 24px 18px;
  color: var(--neutral-500, #6b7280);
  font-size: 13px;
  line-height: 1.55;
}
.empty-state strong { color: var(--neutral-700, #374151); font-size: 14px; }

/* Site context stays fixed without looking like another card below the top bar. */
.site-context-header {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, rgb(255 255 255 / 96%) 0%, rgb(247 250 255 / 72%) 68%, rgb(255 255 255 / 0%) 100%);
  box-shadow: none;
}
.site-context-header .site-tabs {
  min-height: 48px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: linear-gradient(90deg, rgb(37 99 235 / 5%), rgb(255 255 255 / 0%) 26%, rgb(37 99 235 / 3%) 74%, rgb(255 255 255 / 0%));
  box-shadow: inset 0 -1px rgb(148 163 184 / 24%);
}
.site-context-header .site-tabs a {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  font-size: 14px;
  border-bottom: 0;
  background: transparent;
}
.site-context-header .site-tabs a.active {
  border-bottom: 0;
  background: linear-gradient(180deg, rgb(255 255 255 / 0%), rgb(37 99 235 / 9%));
  box-shadow: inset 0 -3px var(--primary-600, #2563eb);
}

.site-detail-page .detail-columns,
.site-detail-page .site-file-layout,
.site-detail-page .worklog-layout,
.site-detail-page .operations-layout {
  gap: var(--ui-section-gap);
  align-items: stretch;
}

.site-detail-page .operations-layout {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  grid-template-rows: none;
}
.site-detail-page .operations-layout > .detail-card,
.site-detail-page .detail-columns > .detail-card,
.site-detail-page .site-file-layout > .detail-card,
.site-detail-page .worklog-layout > .detail-card { min-width: 0; height: 100%; }
.site-detail-page .operations-layout > .detail-card { height: auto; }
.site-detail-page .operations-layout .inventory-preview-card { grid-column: 1; }
.site-detail-page .operations-layout .quick-note-card pre { min-height: 96px; }

.site-detail-page .detail-card > header { min-height: var(--ui-card-header-height); }
.site-detail-page .detail-card > header h2 { font-size: var(--ui-font-card-title); }
.site-detail-page .detail-card > header p { font-size: var(--ui-font-caption); }

.quick-log-title,
.quick-log-body,
.quick-log-actions label { font-size: 13px; }
.quick-log-title small,
.quick-log-actions > span,
.worklog-history time,
.worklog-history em,
.worklog-history small { font-size: var(--ui-font-caption); }
.quick-log-title input,
.quick-log-card textarea { font-size: var(--ui-font-body); }
.quick-log-actions .outline-action,
.quick-log-actions .primary-action,
.record-actions .outline-action { min-height: var(--ui-control-height); font-size: 13px; }
.worklog-history a { min-height: 64px; }
.worklog-history strong { font-size: var(--ui-font-body); }
.worklog-history .worklog-type { font-size: var(--ui-font-caption); }

.operation-links > a { min-height: 58px; font-size: var(--ui-font-body); }
.operation-links > a b,
.operation-links > p,
.inventory-files > a > b,
.inventory-files strong { font-size: 13px; }
.responsive-table th,
.responsive-table td { font-size: 13px; line-height: 1.45; }
.inventory-summary {
  display: grid;
  grid-template-columns: 92px minmax(180px, 1fr) minmax(220px, auto);
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 9px var(--ui-card-padding-x);
}
.inventory-summary strong {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  min-width: 72px;
  font-size: 20px;
  line-height: 1;
}
.inventory-summary span { font-size: 13px; line-height: 1.4; }
.inventory-summary small { margin-left: 0; font-size: var(--ui-font-caption); line-height: 1.4; text-align: right; }
.inventory-empty { min-height: 104px; padding: 20px 16px; }

/* Inspection and delivery pages share the same card/list density. */
.site-artifact-list > a { min-height: 66px; }
.site-artifact-list > a > span,
.site-artifact-list > a > b { font-size: var(--ui-font-caption); }
.site-artifact-list strong { font-size: var(--ui-font-body); }
.delivery-history-card { min-height: 220px; }
.delivery-history-card h3 { font-size: 18px; }
.delivery-history-card p,
.delivery-history-card dt,
.delivery-history-card dd { font-size: 13px; }

/* Site library is a file browser first: keep context compact and give the list the viewport. */
.site-library-workspace { gap: 10px; }
.site-library-heading {
  min-height: 70px;
  padding: 12px 16px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(90deg, rgb(239 246 255 / 78%), rgb(255 255 255 / 0%) 72%);
}
.site-library-heading > div:first-child > span { font-size: var(--ui-font-caption); }
.site-library-heading h2 { margin: 0; font-size: 19px; white-space: nowrap; }
.site-library-title-line { display: flex; align-items: baseline; gap: 16px; margin-top: 3px; }
.site-library-title-line p { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0; color: var(--neutral-500); font-size: 11px; }
.site-library-title-line p b { color: var(--neutral-700); font-weight: 700; }
.site-library-title-line p i { color: var(--neutral-300); font-style: normal; }
.site-library-heading > div:last-child a { min-height: 38px; }
.site-library-stats span,
.site-library-toolbar label,
.site-library-toolbar > span,
.site-file-row small,
.site-file-path small,
.site-file-row > b,
.site-folder-group > header span,
.site-folder-group > header b { font-size: var(--ui-font-caption); }
.site-library-stats {
  gap: 12px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.site-library-stats > div {
  min-height: 76px;
  padding: 13px 16px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-card-radius);
  background: #fff;
}
.site-library-stats > div:last-child { border-right: 1px solid var(--ui-border); }
.site-library-stats strong { display: inline-flex; align-items: baseline; gap: 2px; font-size: 20px; line-height: 1; }
.site-library-stats strong small { color: inherit; font-size: 12px; font-weight: 600; }
.site-library-stats .site-storage-structure { align-content: center; }
.site-storage-structure code { color: var(--neutral-800); font: 700 14px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
.site-library-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-card-radius);
  background: #fff;
}
.site-library-types { flex: 1 1 580px; min-width: 280px; padding: 0; }
.site-library-types a { min-height: 34px; padding: 0 10px; font-size: 12px; }
.site-library-types small { font-size: var(--ui-font-caption); }
.site-library-toolbar { flex: 1 1 360px; min-width: 280px; padding: 0; border: 0; border-radius: 0; }
.site-library-toolbar form { align-items: center; }
.site-library-toolbar label { gap: 0; }
.site-library-toolbar label > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.site-library-toolbar input { min-height: 36px; font-size: var(--ui-font-body); }
.site-library-toolbar .outline-action { min-height: 36px; }
.site-library-toolbar nav a { min-height: 32px; display: inline-flex; align-items: center; font-size: 12px; }
.site-library-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.site-library-actions a { min-height: 36px; padding-right: 13px; padding-left: 13px; white-space: nowrap; }
.site-library-results.list {
  height: calc(100vh - 360px);
  min-height: 260px;
  max-height: 680px;
  align-content: start;
  overflow: auto;
}
.site-file-list-head {
  display: grid;
  grid-template-columns: 100px minmax(220px, 1.4fr) minmax(180px, 1fr) 110px 12px;
  align-items: center;
  gap: 12px;
  min-height: 34px;
  padding: 0 var(--ui-card-padding-x);
  border-bottom: 1px solid var(--ui-border);
  background: var(--neutral-50);
  color: var(--neutral-500);
  font-size: 10px;
  font-weight: 700;
}
.site-folder-group > header { min-height: 58px; padding: 10px var(--ui-card-padding-x); }
.site-folder-group > header h3 { font-size: 15px; }
.site-file-row { min-height: 56px; padding: 7px var(--ui-card-padding-x); }
.site-file-row strong { font-size: 13px; }
.site-file-path { display: grid; min-width: 0; gap: 2px; }
.site-file-path code { overflow: hidden; color: var(--neutral-600); font: 12px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }

/* Global search */
.global-search-focus { max-width: none; padding: 18px; border-radius: var(--ui-card-radius); background: var(--primary-50, #eff6ff); }
.global-search-focus form > label { font-size: 13px; }
.global-search-focus input[type="search"] { min-height: var(--ui-control-height); font-size: var(--ui-font-body); }
.global-search-focus > p,
.global-search-results header p,
.global-result-kind,
.global-result-row small,
.global-result-row > b { font-size: var(--ui-font-caption); }
.global-search-tabs a { font-size: var(--ui-font-caption); }
.global-result-row { min-height: 66px; }
.global-result-row strong { font-size: var(--ui-font-body); }

/* Knowledge workspace */
.content-list-toolbar { gap: 12px; }
.toolbar-search-label { font-size: 13px; }
.toolbar-search-label input { min-height: var(--ui-control-height); font-size: var(--ui-font-body); }
.knowledge-lifecycle { gap: 10px; }
.knowledge-lifecycle span { min-height: 44px; padding: 10px 12px; font-size: 12px; }
.knowledge-lifecycle b { flex: 0 0 22px; width: 22px; height: 22px; }
.knowledge-groups { gap: var(--ui-section-gap); }
.knowledge-groups > section > header { min-height: 56px; padding: 12px var(--ui-card-padding-x); }
.knowledge-groups header span { font-size: var(--ui-font-caption); }
.knowledge-groups article,
.knowledge-link { min-height: 94px; padding: 15px var(--ui-card-padding-x); }
.knowledge-groups article b,
.knowledge-link b { font-size: var(--ui-font-caption); }
.knowledge-groups article h3,
.knowledge-link h3 { margin: 7px 0; font-size: 14px; }
.knowledge-groups article span,
.knowledge-link span { font-size: var(--ui-font-caption); line-height: 1.45; }
.knowledge-import-body > pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.knowledge-import-body > pre + .knowledge-inline-image,
.knowledge-inline-image + pre { margin-top: 18px; }
.knowledge-inline-image { max-width: 880px; margin: 0; }
.knowledge-inline-image a { display: block; width: fit-content; max-width: 100%; }
.knowledge-inline-image img { display: block; max-width: min(100%, 720px); max-height: 520px; border: 1px solid var(--neutral-200); border-radius: 8px; object-fit: contain; background: var(--neutral-100); }
.knowledge-inline-image figcaption { margin-top: 6px; color: var(--neutral-600); font-size: var(--ui-font-caption); }

/* Notion import: preserve original flow; use metadata only for discovery. */
.knowledge-list-page { max-width: 1420px; }
.knowledge-search { display: grid; gap: 6px; padding: 11px 0 14px; border: 0; border-bottom: 1px solid var(--ui-border); background: transparent; }
.knowledge-search > label, .knowledge-filter-row > b { font-size: 13px; font-weight: 700; }
.knowledge-search > div { display: flex; gap: 8px; max-width: 980px; }
.knowledge-search input { flex: 1; min-width: 0; background: #fff; }
.knowledge-category-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--ui-border); }
.knowledge-category-tabs a { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 14px; color: var(--neutral-600); font-weight: 700; white-space: nowrap; border-bottom: 2px solid transparent; }
.knowledge-category-tabs a.active { color: var(--primary-700); border-color: var(--primary-600); }
.knowledge-category-tabs b { font-size: 12px; }
.knowledge-filter-row { display: grid; gap: 7px; padding-bottom: 2px; }
.knowledge-filter-row > div { display: flex; flex-wrap: nowrap; gap: 7px; overflow-x: auto; padding-bottom: 2px; }
.knowledge-filter-row a { padding: 6px 11px; border: 1px solid var(--ui-border); border-radius: 999px; color: var(--neutral-700); font-size: 12px; background: #fff; }
.knowledge-filter-row a.active { color: #fff; background: var(--primary-600); border-color: var(--primary-600); }
.knowledge-list-layout { display: grid; grid-template-columns: minmax(0, 1fr) 218px; gap: 16px; align-items: start; }
.knowledge-list-main { display: grid; min-width: 0; gap: 14px; }
.knowledge-results, .knowledge-summary { overflow: hidden; border: 1px solid var(--ui-border); border-radius: var(--ui-card-radius); background: #fff; }
.knowledge-list-row { display: grid; grid-template-columns: 4px 54px minmax(0, 1fr) 92px 76px; align-items: center; min-height: 100px; gap: 14px; padding: 12px 15px 12px 0; color: inherit; border-bottom: 1px solid var(--ui-border); }
.knowledge-list-row:last-child { border-bottom: 0; }
.knowledge-list-row:hover { background: var(--ui-surface-muted); }
.knowledge-row-mark { align-self: stretch; background: #64748b; border-radius: 0 3px 3px 0; }
.knowledge-list-row.incident .knowledge-row-mark { background: #ef4444; }.knowledge-list-row.operations .knowledge-row-mark { background: #2563eb; }.knowledge-list-row.inspection .knowledge-row-mark { background: #059669; }.knowledge-list-row.asset .knowledge-row-mark { background: #d97706; }
.knowledge-row-icon { display: grid; place-items: center; width: 46px; height: 46px; overflow: hidden; border: 1px solid var(--ui-border); border-radius: 10px; color: #fff; background: #fff; font-size: 12px; font-weight: 800; letter-spacing: -.4px; }.knowledge-row-icon img { display: block; width: 28px; height: 28px; object-fit: contain; }.knowledge-row-icon.nutanix { border-color: #b6d389; }.knowledge-row-icon.proxmox { border-color: #f4bb88; }.knowledge-row-icon.openstack { border-color: #f3a7b1; }.knowledge-row-icon.linux { border-color: #b3bbc7; }.knowledge-row-icon.vmware { border-color: #a6c6f1; }.knowledge-row-icon.windows { background: #1676d2; }.knowledge-row-icon.network { background: #7c3aed; }.knowledge-row-icon.storage { background: #0f766e; }.knowledge-row-icon.incident { background: #ef4444; }.knowledge-row-icon.operations { background: #2563eb; }.knowledge-row-icon.inspection { background: #059669; }.knowledge-row-icon.asset { background: #d97706; }
.knowledge-row-content { min-width: 0; }.knowledge-row-content > strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.knowledge-row-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }.knowledge-row-tags > * { padding: 2px 7px; border-radius: 999px; font-size: 11px; font-style: normal; background: #eff6ff; color: #1d4ed8; }.knowledge-row-tags em { background: #fef3c7; color: #92400e; }
.knowledge-row-content p { display: -webkit-box; margin: 6px 0 0; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 1; color: var(--neutral-600); font-size: 12px; line-height: 1.45; }
.knowledge-list-row time { color: var(--neutral-500); font-size: 11px; white-space: nowrap; }.knowledge-row-open { color: var(--primary-700); font-size: 12px; white-space: nowrap; }
.knowledge-summary { position: sticky; top: 18px; padding: 15px; }.knowledge-summary h2 { margin: 0; font-size: 15px; }.knowledge-summary > p { margin: 7px 0 14px; color: var(--neutral-600); font-size: 12px; }.knowledge-summary > p b { color: var(--neutral-950); font-size: 19px; }
.knowledge-summary h3 { margin: 14px 0 8px; padding-top: 13px; border-top: 1px solid var(--ui-border); font-size: 12px; }.knowledge-summary ul, .knowledge-summary ol { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }.knowledge-summary li { display: flex; justify-content: space-between; gap: 8px; color: var(--neutral-600); font-size: 12px; }.knowledge-summary ol li { display: grid; gap: 2px; }.knowledge-summary a { overflow: hidden; color: var(--neutral-800); text-overflow: ellipsis; white-space: nowrap; }.knowledge-summary time { color: var(--neutral-500); font-size: 11px; }
.knowledge-detail-page { max-width: 1420px; }.knowledge-detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }.knowledge-detail-meta span { padding: 4px 9px; border-radius: 999px; color: #1d4ed8; background: #eff6ff; font-size: 12px; font-weight: 700; }.knowledge-detail-meta small { margin-left: 5px; color: var(--neutral-500); font-size: 12px; }
.knowledge-document-layout { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }.knowledge-document { width: min(100%, 1060px); min-width: 0; margin: 0 auto; padding: 28px clamp(20px, 4vw, 54px) 46px; border: 1px solid var(--ui-border); border-radius: var(--ui-card-radius); background: #fff; }.knowledge-document-source { margin-bottom: 25px; color: var(--neutral-500); font-size: 12px; }
.knowledge-document h2, .knowledge-document h3, .knowledge-document h4 { margin: 30px 0 12px; scroll-margin-top: 20px; }.knowledge-document h2:first-of-type { margin-top: 0; }.knowledge-document p, .knowledge-document li { max-width: 920px; line-height: 1.8; }.knowledge-document ul, .knowledge-document ol { padding-left: 24px; }.knowledge-document blockquote { margin: 18px 0; padding: 10px 15px; border-left: 3px solid var(--primary-500); color: var(--neutral-700); background: var(--ui-surface-muted); }.knowledge-document hr { margin: 25px 0; border: 0; border-top: 1px solid var(--ui-border); }
.knowledge-code { max-width: 960px; margin: 14px 0; padding: 15px; overflow: auto; border-radius: 8px; background: #111827; color: #e5e7eb; font-size: 13px; line-height: 1.55; }.knowledge-table-wrap { max-width: 100%; margin: 18px 0; overflow-x: auto; border: 1px solid var(--ui-border); border-radius: 8px; }.knowledge-table-wrap table { width: 100%; border-collapse: collapse; font-size: 13px; }.knowledge-table-wrap th, .knowledge-table-wrap td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--ui-border); }.knowledge-table-wrap th { background: var(--ui-surface-muted); }.knowledge-table-wrap tr:last-child td { border-bottom: 0; }
.knowledge-overlay-backdrop { position: fixed; z-index: 70; inset: 0 0 0 232px; border: 0; background: rgb(15 23 42 / 28%); }.knowledge-drawer { position: fixed; z-index: 71; top: 0; bottom: 0; display: flex; width: min(410px, calc(100vw - 260px)); flex-direction: column; overflow: hidden; background: #fff; box-shadow: 0 18px 46px rgb(15 23 42 / 24%); transition: transform .24s ease, visibility .24s ease; visibility: hidden; }.knowledge-drawer.is-open { visibility: visible; transform: translateX(0); }.knowledge-finder-drawer { left: 232px; transform: translateX(-104%); }.knowledge-info-drawer { right: 0; transform: translateX(104%); }.app-shell.sidebar-collapsed .knowledge-overlay-backdrop { left: 72px; }.app-shell.sidebar-collapsed .knowledge-finder-drawer { left: 72px; width: min(410px, calc(100vw - 100px)); }.knowledge-drawer > header { display: flex; align-items: center; justify-content: space-between; padding: 22px 20px 18px; border-bottom: 1px solid var(--ui-border); }.knowledge-drawer > header span { display: block; color: var(--primary-700); font-size: 10px; font-weight: 800; letter-spacing: .11em; }.knowledge-drawer > header h2 { margin: 5px 0 0; font-size: 20px; }.knowledge-drawer-close { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--ui-border); border-radius: 8px; color: var(--neutral-700); background: #fff; font-size: 25px; line-height: 1; cursor: pointer; }.knowledge-finder-search { display: grid; gap: 7px; padding: 18px 20px 12px; color: var(--neutral-800); font-size: 12px; font-weight: 700; }.knowledge-finder-search input { width: 100%; background: #fff; }.knowledge-finder-filters { display: flex; gap: 7px; overflow-x: auto; padding: 0 20px 13px; border-bottom: 1px solid var(--ui-border); }.knowledge-finder-filters button { flex: 0 0 auto; padding: 6px 10px; border: 1px solid var(--ui-border); border-radius: 999px; color: var(--neutral-700); background: #fff; font-size: 12px; cursor: pointer; }.knowledge-finder-filters button.active { border-color: var(--primary-600); color: #fff; background: var(--primary-600); }.knowledge-finder-count { margin: 14px 20px 8px; color: var(--neutral-500); font-size: 12px; }.knowledge-finder-results { overflow-y: auto; padding: 0 12px 24px; }.knowledge-finder-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 13px 8px; border-bottom: 1px solid var(--ui-border); color: inherit; text-decoration: none; }.knowledge-finder-item:hover { background: var(--ui-surface-muted); }.knowledge-finder-item div { min-width: 0; }.knowledge-finder-item strong, .knowledge-finder-item span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.knowledge-finder-item strong { font-size: 14px; }.knowledge-finder-item span { margin-top: 5px; color: var(--neutral-500); font-size: 11px; }.knowledge-finder-item em { max-width: 105px; overflow: hidden; color: var(--primary-700); font-size: 11px; font-style: normal; text-align: right; text-overflow: ellipsis; white-space: nowrap; }.knowledge-finder-empty { padding: 28px 8px; color: var(--neutral-500); text-align: center; }.knowledge-info-section { padding: 18px 20px; border-bottom: 1px solid var(--ui-border); }.knowledge-info-section h3 { margin: 0 0 12px; font-size: 13px; }.knowledge-info-section p { margin: 0; color: var(--neutral-500); font-size: 13px; }.knowledge-outline { display: grid; gap: 8px; }.knowledge-outline a { color: var(--primary-700); font-size: 13px; line-height: 1.35; }.knowledge-outline .level-2 { padding-left: 10px; color: var(--neutral-700); }.knowledge-outline .level-3 { padding-left: 20px; color: var(--neutral-600); }.knowledge-info-tags { display: flex; flex-wrap: wrap; gap: 6px; }.knowledge-info-tags span { padding: 4px 8px; border-radius: 999px; color: var(--primary-700); background: #eff6ff; font-size: 12px; }.knowledge-info-section dl { display: grid; gap: 9px; margin: 0; }.knowledge-info-section dl div { display: flex; justify-content: space-between; gap: 12px; }.knowledge-info-section dt { color: var(--neutral-500); font-size: 12px; }.knowledge-info-section dd { margin: 0; color: var(--neutral-800); font-size: 12px; text-align: right; }

/* Field capture keeps its task emphasis but follows the same product surface. */
.field-quick-page { max-width: none; }
.field-quick-layout { gap: var(--ui-section-gap); }
.field-quick-form { border-radius: var(--ui-card-radius); }
.field-quick-form > header { padding: 20px 22px; background: var(--primary-700, #0f56b3); }
.field-quick-form > header span,
.field-quick-form > header p { font-size: var(--ui-font-caption); }
.field-quick-form > header h2 { font-size: 20px; }
.field-quick-step { padding: 20px 22px; }
.field-quick-step h3 { font-size: var(--ui-font-card-title); }
.field-quick-step > div:last-child > p,
.field-quick-form label,
.field-capture-dropzone span,
.field-gps-row span { font-size: var(--ui-font-caption); }
.field-quick-form select,
.field-quick-form input,
.field-quick-form textarea { font-size: var(--ui-font-body); }
.field-quick-form label small { font-size: var(--ui-font-caption); }
.field-capture-dropzone strong { font-size: var(--ui-font-body); }
.field-gps-row button { min-height: var(--ui-control-height); font-size: 13px; }
.field-quick-actions a,
.field-quick-actions button { min-height: var(--ui-control-height); }
.field-quick-guide > section:first-child { border-top: 1px solid var(--ui-border); }
.field-quick-guide > section:first-child > span,
.field-quick-guide section > header a,
.field-quick-guide section > div small,
.field-incident-link span { font-size: var(--ui-font-caption); }
.field-quick-guide h2 { font-size: var(--ui-font-card-title); }
.field-quick-guide ul { font-size: 13px; }
.field-quick-guide section > div strong,
.field-incident-link strong { font-size: 13px; }

/* Central dashboard: keep the discovery emphasis, use the same supporting-card scale. */
.dashboard-focus,
.dashboard-lower-grid { gap: var(--ui-section-gap); }
.dashboard-find-site { border-radius: var(--ui-card-radius); box-shadow: none; }
.dashboard-site-result small,
.dashboard-site-result em,
.dashboard-site-result > b,
.dashboard-today > header small,
.dashboard-today-list .work-type,
.dashboard-today-list small,
.dashboard-today-list > a > b,
.dashboard-signal-row span,
.dashboard-signal-row small,
.dashboard-recent-sites header p,
.dashboard-recent-evidence header p,
.dashboard-recent-sites header a,
.dashboard-recent-evidence header a,
.dashboard-recent-sites small,
.dashboard-recent-sites b,
.dashboard-delivery-visual b,
.dashboard-delivery-visual small,
.dashboard-delivery-visual em,
.dashboard-recent-evidence dt,
.dashboard-recent-evidence dd { font-size: var(--ui-font-caption); }
.dashboard-site-result strong,
.dashboard-today-list strong,
.dashboard-recent-sites strong { font-size: var(--ui-font-body); }
.dashboard-today,
.dashboard-recent-sites,
.dashboard-recent-evidence,
.dashboard-signal-row a { border-radius: var(--ui-card-radius); box-shadow: none; }
.dashboard-recent-sites h2,
.dashboard-recent-evidence h2 { font-size: var(--ui-font-card-title); }
.dashboard-signal-row a { min-height: 88px; }

/* Site directory */
.site-directory-tabs a { font-size: var(--ui-font-caption); }
.site-directory-grid { gap: var(--ui-section-gap); padding: 0; }
.site-directory-card {
  min-width: 0;
  min-height: 270px;
  padding: 17px;
  border-color: var(--ui-border);
  border-radius: var(--ui-card-radius);
  background: #fff;
}
.site-directory-card header span,
.site-directory-card .location-line,
.site-directory-card dt,
.site-directory-card dd,
.site-directory-card footer { font-size: var(--ui-font-caption); }
.site-directory-card h2 { font-size: var(--ui-font-card-title); }
.site-directory-card dl div { padding: 7px 0; }
.site-directory-card dd { margin-top: 4px; line-height: 1.45; }
.site-directory-card footer { min-height: 42px; align-items: center; }
.site-directory-card .readiness-score { font-size: var(--ui-font-caption); }

/* Company-wide artifact library */
.library-principle { padding: 13px 16px; border-radius: 8px; font-size: var(--ui-font-caption); line-height: 1.5; }
.artifact-metrics { gap: var(--ui-section-gap); }
.artifact-metrics > div { padding: 16px; border-color: var(--ui-border); border-radius: var(--ui-card-radius); }
.artifact-metrics span { font-size: var(--ui-font-caption); }
.artifact-tabs a { min-height: var(--ui-control-height); display: inline-flex; align-items: center; padding: 0 12px; border-radius: 7px; font-size: 13px; }
.artifact-view-toggle a { min-height: 32px; display: inline-flex; align-items: center; font-size: var(--ui-font-caption); }
.artifact-list,
.artifact-folder { border-color: var(--ui-border); border-radius: var(--ui-card-radius); }
.artifact-list > header { min-height: 44px; padding: 10px 14px; font-size: var(--ui-font-caption); }
.artifact-row { min-height: 66px; padding: 10px 14px; }
.artifact-row .file-kind,
.artifact-row > div small,
.artifact-row > div em,
.artifact-row .artifact-version b,
.artifact-row .artifact-version span,
.artifact-row > div:nth-child(4) > span { font-size: var(--ui-font-caption); }
.artifact-row > div strong { font-size: var(--ui-font-body); }
.artifact-folder > header { min-height: 58px; padding: 11px var(--ui-card-padding-x); }
.artifact-folder > header span,
.artifact-folder > header > b,
.artifact-folder > div > a small { font-size: var(--ui-font-caption); }
.artifact-folder > header h2 { font-size: 15px; }
.artifact-folder > div > a { min-height: 62px; padding: 9px var(--ui-card-padding-x); }
.library-collections .detail-card > p { padding: 16px var(--ui-card-padding-x); font-size: 13px; }

/* Account administration and personal settings */
.admin-user-metrics { gap: var(--ui-section-gap); }
.admin-user-metrics article { min-height: 92px; padding: 16px 18px; border-radius: var(--ui-card-radius); }
.admin-user-metrics span,
.admin-invite-card > form label,
.admin-users-page .table-actions span,
.admin-users-page table td small { font-size: var(--ui-font-caption); }
.security-notice { align-items: center; padding: 13px 16px; border-radius: 8px; font-size: 13px; line-height: 1.5; }
.security-notice a { margin-left: auto; white-space: nowrap; }
.form-card { border-radius: var(--ui-card-radius); }
.form-card form label { font-size: 13px; }
.form-card form label small { font-size: var(--ui-font-caption); }
.status-pill { font-size: var(--ui-font-caption); }

@media (max-width: 1100px) {
  .knowledge-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .global-result-row { grid-template-columns: 90px minmax(0, 1fr) 110px 48px; }
  .site-directory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  :root { --ui-control-height: 44px; --ui-card-header-height: 56px; --ui-section-gap: 12px; }
  #main-content { padding: 14px 16px 22px; }
  .ops-page-header h1,
  .topbar-page-identity h1,
  .topbar .site-context-title h1 { font-size: 20px; }
  .primary-action,
  .outline-action,
  button.primary,
  .button { height: auto; min-height: 44px; white-space: normal; }
  .admin-invite-card > form button.primary-action { height: auto; min-height: 44px; }
  .site-context-header .site-tabs { min-height: 46px; }
  .site-context-header .site-tabs a { min-height: 46px; padding: 0 14px; font-size: 13px; }
  .site-detail-page .operations-layout > .detail-card,
  .site-detail-page .detail-columns > .detail-card,
  .site-detail-page .site-file-layout > .detail-card,
  .site-detail-page .worklog-layout > .detail-card { height: auto; }
  .worklog-history a { grid-template-columns: 76px minmax(0, 1fr); gap: 6px 10px; }
  .worklog-history .worklog-type { grid-column: 1; }
  .worklog-history a > div { grid-column: 2; grid-row: 1 / span 2; }
  .worklog-history em { display: none; }
  .global-result-row { grid-template-columns: 72px minmax(0, 1fr) 36px; gap: 8px; padding: 10px 12px; }
  .global-result-row > span:nth-child(3) { display: none; }
  .knowledge-lifecycle { grid-template-columns: repeat(5, minmax(132px, 1fr)); overflow-x: auto; padding-bottom: 3px; }
  .knowledge-groups { grid-template-columns: 1fr; }
  .field-quick-form > header,
  .field-quick-step { padding-right: 16px; padding-left: 16px; }
  .field-quick-page { margin: 0; }
  .field-quick-form {
    padding-bottom: 72px;
    border-right: 1px solid var(--ui-border);
    border-left: 1px solid var(--ui-border);
    border-radius: var(--ui-card-radius);
  }
  .field-quick-actions a,
  .field-quick-actions button { min-height: 44px; }
  .site-library-controls { display: grid; gap: 8px; padding: 8px; }
  .site-library-types { width: 100%; }
  .site-library-toolbar { width: 100%; min-width: 0; }
  .site-library-toolbar form { flex-wrap: nowrap; }
  .site-library-toolbar form button { width: auto; }
  .site-library-toolbar > span { display: none; }
  .site-library-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .site-library-actions a { justify-content: center; }
  .site-file-list-head { display: none; }
  .site-library-results.list { min-height: calc(100vh - 360px); }
  .site-directory-grid { grid-template-columns: 1fr; }
  .site-directory-card { min-height: 0; }
  .inventory-summary { grid-template-columns: 72px minmax(0, 1fr); }
  .inventory-summary { min-height: 72px; }
  .inventory-summary small { grid-column: 1 / -1; text-align: left; }
  .site-library-stats { grid-template-columns: 1fr; }
  .site-library-stats > div { min-height: 68px; }
  .site-file-row .site-file-path { grid-column: 2; }
  .site-file-row > i { grid-column: 3; grid-row: 1 / span 3; }
  .library-principle,
  .security-notice { align-items: flex-start; flex-direction: column; }
.security-notice a { margin-left: 0; }
  .artifact-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.map-provider-settings { margin-top: 14px; }
.map-provider-settings > header { align-items: center; }
.map-provider-settings form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 16px; }
.map-provider-option { min-width: 0; display: flex; align-items: flex-start; gap: 10px; padding: 14px; border: 1px solid var(--ui-border); border-radius: 10px; background: #fff; cursor: pointer; }
.map-provider-option:has(input:checked) { border-color: #0d6adf; background: #f4f8ff; box-shadow: inset 0 0 0 1px #0d6adf; }
.map-provider-option.disabled { opacity: .55; cursor: not-allowed; }
.map-provider-option input { margin-top: 3px; }
.map-provider-option span,
.map-provider-option strong,
.map-provider-option small { display: block; }
.map-provider-option strong { font-size: 13px; }
.map-provider-option small { margin-top: 5px; color: #667085; font-size: 11px; line-height: 1.5; }
.map-provider-settings .form-actions { grid-column: 1 / -1; justify-content: flex-end; }
@media (max-width: 720px) {
  .map-provider-settings form { grid-template-columns: 1fr; }
  .map-provider-settings .form-actions { grid-column: 1; }
}

/* GPS field-photo map */
.photo-map-page { gap: 12px; }
.photo-map-page > .ops-page-header { min-height: 64px; }
.photo-map-workspace {
  min-height: 680px;
  height: calc(100vh - 174px);
  display: grid;
  grid-template-columns: 276px minmax(420px, 1fr) 366px;
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 28px rgb(16 43 68 / 7%);
  overflow: hidden;
}
.photo-map-site-rail { min-width: 0; display: flex; flex-direction: column; border-right: 1px solid var(--ui-border); background: #fff; }
.photo-map-site-rail > header { min-height: 82px; padding: 16px; border-bottom: 1px solid var(--ui-border); }
.photo-map-site-rail > header div { display: flex; align-items: center; justify-content: space-between; }
.photo-map-site-rail > header strong { font-size: 16px; }
.photo-map-site-rail > header span { color: #075fc8; font-size: 12px; font-weight: 800; }
.photo-map-site-rail > header small { display: block; margin-top: 5px; color: #667085; font-size: 11px; }
.photo-map-site-rail nav { flex: 1; overflow: auto; }
.photo-map-site-item { min-height: 78px; display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 13px 14px; border-bottom: 1px solid #edf1f5; color: #17202d; text-decoration: none; }
.photo-map-site-item:hover { background: #f7faff; }
.photo-map-site-item.active { background: #edf5ff; box-shadow: inset 3px 0 #0d6adf; }
.photo-map-site-dot { width: 9px; height: 9px; border-radius: 50%; background: #0d6adf; box-shadow: 0 0 0 4px rgb(13 106 223 / 10%); }
.photo-map-site-item.active .photo-map-site-dot { background: #f26b38; box-shadow: 0 0 0 4px rgb(242 107 56 / 12%); }
.photo-map-site-copy { min-width: 0; }
.photo-map-site-copy strong,
.photo-map-site-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-map-site-copy strong { font-size: 13px; }
.photo-map-site-copy small { margin-top: 5px; color: #667085; font-size: 10px; }
.photo-map-site-meta { text-align: right; }
.photo-map-site-meta b,
.photo-map-site-meta small { display: block; }
.photo-map-locate-action { margin-top: 7px; padding: 4px 6px; border: 1px solid #9cc4ef; border-radius: 5px; background: #fff; color: #075fc8; font: inherit; font-size: 10px; font-weight: 700; text-decoration: none; white-space: nowrap; cursor: pointer; }
.photo-map-locate-action:hover { background: #edf5ff; }
.photo-map-locate-action:disabled { opacity: .65; cursor: wait; }
.photo-map-unlocated-item { min-height: 96px; }
.photo-map-site-meta b { color: #075fc8; font-size: 12px; }
.photo-map-site-meta small { margin-top: 4px; color: #98a2b3; font-size: 9px; }
.photo-map-unlocated-link { min-height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; border-top: 1px solid #f0d6ae; background: #fffaf1; color: #935f08; font-size: 11px; text-decoration: none; }
.photo-map-list-empty { padding: 28px 18px; color: #667085; font-size: 12px; text-align: center; }
.photo-map-canvas { position: relative; min-width: 0; min-height: 680px; overflow: hidden; background: #eaf3f8; }
.photo-map-provider-canvas { position: absolute; z-index: 1; inset: 0; opacity: 0; transition: opacity .18s ease; background: #eaf3f8; }
.photo-map-canvas.interactive-map-ready .photo-map-provider-canvas { opacity: 1; }
.photo-map-canvas.interactive-map-ready > .photo-map-basemap,
.photo-map-canvas.interactive-map-ready > .photo-map-marker,
.photo-map-canvas.interactive-map-ready > .photo-map-disclaimer { display: none; }
.photo-map-provider-canvas .leaflet-control-attribution { font-size: 9px; }
.offline-photo-marker-wrap { background: transparent; border: 0; }
.offline-photo-marker { display: grid; justify-items: center; color: #173b62; }
.offline-photo-marker > i { min-width: 36px; height: 36px; display: grid; place-items: center; padding: 0 7px; border: 3px solid #fff; border-radius: 50% 50% 50% 8px; background: #0d6adf; box-shadow: 0 8px 18px rgb(17 78 145 / 30%); color: #fff; font-size: 12px; font-style: normal; font-weight: 800; transform: rotate(-45deg); }
.offline-photo-marker > i > em { color: inherit; font: inherit; font-style: normal; transform: rotate(45deg); }
.offline-photo-marker > b { max-width: 126px; margin-top: 5px; padding: 4px 7px; border: 1px solid rgb(186 201 216 / 75%); border-radius: 6px; background: rgb(255 255 255 / 95%); box-shadow: 0 3px 10px rgb(32 69 104 / 14%); color: #173b62; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.offline-photo-marker.selected > i { background: #f26b38; }
.offline-photo-marker.selected > b { border-color: #70aaf0; color: #075fc8; }
.photo-map-basemap { position: absolute; inset: 0; width: 100%; height: 100%; }
.photo-map-land { fill: url(#mapLand); }
.photo-map-coast { fill: none; stroke: #b5c9ba; stroke-width: 2.5; }
.photo-map-road-major path { fill: none; stroke: #fff; stroke-width: 7; stroke-linecap: round; filter: drop-shadow(0 1px 0 #d9caba); }
.photo-map-road-minor path { fill: none; stroke: #fff; stroke-width: 3.5; stroke-linecap: round; opacity: .9; }
.photo-map-water path { fill: none; stroke: #b8d8e8; stroke-width: 3; stroke-linecap: round; }
.photo-map-city-labels text { fill: #7d8f83; font-size: 13px; font-weight: 700; letter-spacing: .05em; }
.photo-map-map-tools { position: absolute; z-index: 3; top: 14px; left: 14px; display: flex; gap: 6px; padding: 7px 9px; border: 1px solid rgb(255 255 255 / 75%); border-radius: 8px; background: rgb(255 255 255 / 90%); box-shadow: 0 5px 16px rgb(35 64 80 / 12%); }
.photo-map-map-tools span { display: flex; align-items: center; gap: 5px; color: #475467; font-size: 10px; }
.photo-map-map-tools i { width: 7px; height: 7px; border-radius: 50%; background: #0d6adf; }
.photo-map-map-tools i.delivery { background: #f26b38; }
.photo-map-marker { position: absolute; z-index: 4; display: grid; justify-items: center; transform: translate(-50%, -50%); color: #173b62; text-decoration: none; }
.photo-map-marker-count { position: relative; min-width: 38px; height: 38px; display: grid; place-items: center; padding: 0 8px; border: 3px solid #fff; border-radius: 50% 50% 50% 8px; background: #0d6adf; box-shadow: 0 8px 18px rgb(17 78 145 / 30%); color: #fff; font-size: 12px; font-weight: 800; transform: rotate(-45deg); }
.photo-map-marker-count > b { color: inherit; font: inherit; transform: rotate(45deg); }
.photo-map-marker-label { max-width: 148px; margin-top: 7px; padding: 5px 8px; border: 1px solid rgb(186 201 216 / 75%); border-radius: 6px; background: rgb(255 255 255 / 94%); box-shadow: 0 3px 10px rgb(32 69 104 / 14%); color: #173b62; font-size: 11px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-map-marker:hover .photo-map-marker-count,
.photo-map-marker.selected .photo-map-marker-count { background: #f26b38; transform: rotate(-45deg) scale(1.12); }
.photo-map-marker.selected .photo-map-marker-label { border-color: #70aaf0; color: #075fc8; }
.photo-map-disclaimer { position: absolute; z-index: 2; left: 14px; bottom: 12px; padding: 6px 8px; border-radius: 5px; background: rgb(255 255 255 / 86%); color: #667085; font-size: 9px; }
.photo-map-provider-status { position: absolute; z-index: 3; right: 14px; bottom: 12px; padding: 6px 8px; border: 1px solid rgb(208 217 227 / 80%); border-radius: 5px; background: rgb(255 255 255 / 90%); color: #667085; font-size: 9px; }
.google-photo-marker { position: absolute; display: grid; justify-items: center; transform: translate(-50%, -100%); color: #173b62; text-decoration: none; cursor: pointer; }
.google-photo-marker > span { min-width: 38px; height: 38px; display: grid; place-items: center; padding: 0 8px; border: 3px solid #fff; border-radius: 50% 50% 50% 8px; background: #0d6adf; box-shadow: 0 8px 18px rgb(17 78 145 / 32%); color: #fff; font-size: 12px; font-weight: 800; transform: rotate(-45deg); }
.google-photo-marker > span > i { color: inherit; font: inherit; font-style: normal; transform: rotate(45deg); }
.google-photo-marker > b { max-width: 148px; margin-top: 7px; padding: 5px 8px; border: 1px solid rgb(186 201 216 / 75%); border-radius: 6px; background: rgb(255 255 255 / 96%); box-shadow: 0 3px 10px rgb(32 69 104 / 14%); color: #173b62; font-size: 11px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.google-photo-marker.selected > span { background: #f26b38; transform: rotate(-45deg) scale(1.12); }
.google-photo-marker.selected > b { border-color: #70aaf0; color: #075fc8; }
.photo-map-empty { position: absolute; z-index: 3; inset: 0; display: grid; place-content: center; gap: 8px; text-align: center; }
.photo-map-empty a { color: #075fc8; text-decoration: none; }
.photo-map-detail-panel { min-width: 0; display: flex; flex-direction: column; border-left: 1px solid var(--ui-border); background: #fff; }
.photo-map-detail-panel > header { min-height: 116px; padding: 18px; border-bottom: 1px solid var(--ui-border); }
.photo-map-detail-panel > header span { color: #075fc8; font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.photo-map-detail-panel > header h2 { margin: 6px 0 5px; font-size: 20px; line-height: 1.25; }
.photo-map-detail-panel > header p { margin: 0; color: #667085; font-size: 11px; }
.photo-map-facts { display: grid; grid-template-columns: 110px minmax(0, 1fr); margin: 0; border-bottom: 1px solid var(--ui-border); }
.photo-map-facts > div { min-width: 0; padding: 12px 18px; border-right: 1px solid var(--ui-border); }
.photo-map-facts > div:last-child { border-right: 0; }
.photo-map-facts dt { color: #667085; font-size: 9px; }
.photo-map-facts dd { margin: 4px 0 0; font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.photo-map-contact { margin: 0; border-bottom: 1px solid var(--ui-border); }
.photo-map-contact > div { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; padding: 9px 18px; border-bottom: 1px solid #edf1f5; }
.photo-map-contact > div:last-child { border-bottom: 0; }
.photo-map-contact dt { color: #667085; font-size: 10px; }
.photo-map-contact dd { margin: 0; font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.photo-map-contact a { color: #075fc8; text-decoration: none; }
.photo-map-detail-panel > footer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: center; gap: 7px; padding: 12px 14px; border-top: 1px solid var(--ui-border); }
.photo-map-navigation { position: relative; min-width: 0; }
.photo-map-navigation > summary { width: 100%; height: 44px; display: flex; align-items: center; justify-content: center; padding: 0 8px; border-radius: 7px; background: #0d6adf; color: #fff; font-size: 11px; font-weight: 800; line-height: 1; white-space: nowrap; cursor: pointer; list-style: none; box-sizing: border-box; }
.photo-map-navigation > summary::-webkit-details-marker { display: none; }
.photo-map-navigation[open] > summary { border-radius: 7px 7px 0 0; }
.photo-map-navigation > div { position: absolute; z-index: 20; left: 0; bottom: calc(100% + 6px); width: 238px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid #b8d3f5; border-radius: 7px; background: #fff; box-shadow: 0 10px 28px rgb(26 61 99 / 18%); overflow: hidden; }
.photo-map-navigation > div a { min-height: 38px; display: flex; align-items: center; justify-content: center; border-right: 1px solid #dbe7f5; border-bottom: 1px solid #dbe7f5; color: #174a82; font-size: 11px; font-weight: 750; text-decoration: none; }
.photo-map-navigation > div a:nth-child(2n) { border-right: 0; }
.photo-map-navigation > div a:nth-last-child(-n+2) { border-bottom: 0; }
.photo-map-navigation > div a:hover { background: #f2f7fd; }
.photo-map-navigation > small { display: none; }
.photo-map-detail-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.photo-map-detail-actions > a { display: inline-flex; align-items: center; width: 100%; height: 44px; min-height: 44px; justify-content: center; padding: 0 8px; font-size: 11px; line-height: 1; white-space: nowrap; box-sizing: border-box; }
.photo-map-albums { flex: 1 1 0; min-height: 0; overflow: auto; }
.photo-map-albums-title { min-height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid #edf1f5; }
.photo-map-albums-title strong { font-size: 13px; }
.photo-map-albums-title span { color: #667085; font-size: 10px; }
.photo-map-album { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 12px; padding: 14px 18px; border-bottom: 1px solid #edf1f5; color: #17202d; text-decoration: none; }
.photo-map-album:hover { background: #f7faff; }
.photo-map-album-preview { position: relative; width: 78px; height: 58px; display: grid; place-items: center; border-radius: 7px; background: linear-gradient(145deg, #dfeaf5, #c8d9e9); overflow: hidden; }
.photo-map-album-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-map-album-preview > b { position: absolute; right: 5px; bottom: 5px; padding: 3px 5px; border-radius: 4px; background: rgb(16 36 58 / 78%); color: #fff; font-size: 9px; }
.photo-map-album-placeholder { color: #6487a8; font-size: 24px; }
.photo-map-album-copy { min-width: 0; align-self: center; }
.photo-map-album-copy strong,
.photo-map-album-copy small { display: block; overflow: hidden; text-overflow: ellipsis; }
.photo-map-album-copy strong { max-height: 38px; font-size: 12px; line-height: 1.45; }
.photo-map-album-copy small { margin-top: 5px; color: #667085; font-size: 9px; white-space: nowrap; }
.photo-map-date-folder { border-bottom: 1px solid #edf1f5; }
.photo-map-date-folder-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 76px; padding: 9px 14px; color: #17202d; text-decoration: none; }
.photo-map-date-folder-row:hover, .photo-map-date-folder.expanded .photo-map-date-folder-row { background: #f7faff; }
.photo-map-date-previews { display: grid; grid-template-columns: repeat(3, 1fr); width: 112px; height: 52px; overflow: hidden; border: 1px solid #d8e1eb; border-radius: 6px; background: #edf2f7; }
.photo-map-date-previews img { width: 100%; height: 52px; border-left: 1px solid #fff; object-fit: cover; }
.photo-map-date-previews img:first-child { border-left: 0; }
.photo-map-date-copy { display: grid; gap: 4px; min-width: 0; }
.photo-map-date-copy strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.photo-map-date-copy small { color: #667085; font-size: 10px; }
.photo-map-date-toggle { color: #075fc8; font-size: 10px; font-weight: 800; white-space: nowrap; }
.photo-map-date-toggle i { display: inline-block; margin-left: 3px; font-size: 16px; font-style: normal; vertical-align: -1px; }
.photo-map-date-folder.expanded .photo-map-date-toggle i { transform: rotate(90deg); }
.photo-map-date-items { display: grid; gap: 0; padding: 0 0 6px; background: #fbfcfe; }
.photo-map-date-items .photo-map-album { grid-template-columns: 64px minmax(0, 1fr); gap: 10px; padding: 9px 14px 9px 24px; }
.photo-map-date-items .photo-map-album-preview { width: 64px; height: 48px; }
.photo-map-detail-empty { flex: 1; display: grid; place-content: center; gap: 6px; padding: 24px; color: #667085; text-align: center; }
.photo-map-detail-empty strong { color: #344054; }
.photo-map-detail-empty span { font-size: 11px; }

@media (max-width: 1200px) {
  .photo-map-workspace { grid-template-columns: 230px minmax(360px, 1fr) 320px; }
}

@media (max-width: 900px) {
  .photo-map-workspace { height: auto; min-height: 0; grid-template-columns: 220px minmax(0, 1fr); }
  .photo-map-canvas { min-height: 560px; }
  .photo-map-detail-panel { grid-column: 1 / -1; min-height: 300px; border-top: 1px solid var(--ui-border); border-left: 0; }
  .photo-map-albums { max-height: 280px; }
}

@media (max-width: 760px) {
  .photo-map-page > .ops-page-header { min-height: 74px; }
  .photo-map-workspace { display: flex; flex-direction: column; border-radius: 9px; }
  .photo-map-site-rail { order: 2; max-height: 250px; border-top: 1px solid var(--ui-border); border-right: 0; }
  .photo-map-site-rail > header { display: none; }
  .photo-map-site-item { min-height: 66px; }
  .photo-map-canvas { order: 1; min-height: 410px; }
  .photo-map-detail-panel { order: 3; min-height: 320px; }
  .photo-map-marker-label { max-width: 100px; font-size: 9px; }
  .photo-map-map-tools { top: 10px; left: 10px; }
  .photo-map-disclaimer { left: 10px; bottom: 8px; }
  .photo-map-detail-panel > footer { position: sticky; bottom: 0; background: #fff; }
  .photo-map-date-folder-row { grid-template-columns: 96px minmax(0, 1fr) auto; }
  .photo-map-date-previews { width: 96px; }
  .photo-map-date-toggle { font-size: 0; }
  .photo-map-date-toggle i { margin: 0; font-size: 20px; }
}

/* Content-height cards: do not stretch short operational content to the
   height of a neighbouring form or file list. */
.site-detail-page .worklog-layout,
.site-detail-page .site-file-layout,
.inspection-top-grid {
  align-items: start;
}

.site-detail-page .worklog-layout > .detail-card,
.site-detail-page .site-file-layout > .detail-card,
.inspection-top-grid .quick-note-card,
.inspection-top-grid .inspection-result-card {
  height: auto;
}

.inspection-top-grid .quick-note-card pre {
  min-height: 0;
}

/* A delivery inside the photo tab is a compact linked record, not a second
   oversized dashboard card. */
.site-detail-page .delivery-history-card {
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) minmax(154px, .42fr);
  gap: 18px;
  padding: 14px 18px;
  background: var(--ui-surface-muted);
}

.site-detail-page .delivery-history-card h3 {
  margin: 5px 0;
  font-size: 15px;
}

.site-detail-page .delivery-history-card p,
.site-detail-page .delivery-history-card dt,
.site-detail-page .delivery-history-card dd {
  font-size: 12px;
}

.site-detail-page .delivery-history-card dl div {
  min-height: 28px;
  padding: 2px 0;
}

/* Account lookup is a toolbar.  The visible label and grouped notice make the
   search purpose clear before a user starts typing. */
.operations-search-row {
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(220px, 1fr);
  align-items: center;
  gap: 18px;
  margin: 16px 18px;
  padding: 12px 14px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: var(--ui-surface-muted);
}

.operations-search-row label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.operations-search-row label::before {
  content: "계정 검색";
  color: var(--neutral-700, #374151);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.operations-search-row input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 7px;
  background: #fff;
}

.operations-search-row small {
  color: var(--neutral-600, #4b5563);
  font-size: 12px;
  line-height: 1.45;
  text-align: right;
}

@media (max-width: 760px) {
  .operations-search-row { grid-template-columns: 1fr; margin: 12px 14px; gap: 8px; }
  .operations-search-row small { text-align: left; }
  .site-detail-page .delivery-history-card { grid-template-columns: 1fr; gap: 10px; }
}

/* Lists stay lists: record rows must not look like a stack of cards inside a
   second card. */
.worklog-history {
  border-top: 1px solid var(--ui-border);
}

.worklog-history > a,
.worklog-history > .worklog-record-details {
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--ui-border);
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.worklog-history > a:hover,
.worklog-history > .worklog-record-details:hover {
  background: var(--ui-surface-muted);
}

/* Inspection is a document followed by an upload task, not two cards forced
   to share a height. */
.inspection-top-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.inspection-top-grid .quick-note-card {
  border-color: transparent;
  border-radius: 0;
  background: var(--ui-surface-muted);
}

.inspection-top-grid .quick-note-card > header {
  min-height: 0;
  padding-bottom: 8px;
  border-bottom: 0;
}

.inspection-top-grid .quick-note-card pre {
  padding: 0 18px 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.inspection-result-card {
  max-width: none;
}

/* Delivery history is one linked record.  Do not turn its metadata into a
   second dashboard inside the photo tab. */
.site-detail-page .delivery-history-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  min-height: 0;
  padding: 14px 16px;
  border: 0;
  border-top: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
}

.site-detail-page .delivery-history-card > div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  column-gap: 12px;
  align-items: center;
}

.site-detail-page .delivery-history-card > div > b {
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--primary);
  font-size: 12px;
}

.site-detail-page .delivery-history-card h3 {
  margin: 0;
  font-size: 15px;
}

.site-detail-page .delivery-history-card p {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-detail-page .delivery-history-card dl { display: none; }

.site-detail-page .delivery-history-card::after {
  content: "›";
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

/* Keep the contact list card in place regardless of whether contacts exist.
   A site should not change its two-column structure after the first contact
   is registered. */
.site-detail-page .contacts-layout {
  align-items: start;
}

.site-detail-page .contacts-layout > .detail-card:has(.site-contact-list > .empty-state) {
  border-color: var(--ui-border);
  background: #fff;
}

.site-detail-page .contacts-layout > .detail-card:has(.site-contact-list > .empty-state) > header {
  min-height: var(--ui-card-header-height);
  padding: 12px 18px;
  border-bottom: 1px solid var(--ui-border);
}

.site-detail-page .contacts-layout .site-contact-list > .empty-state {
  min-height: 0;
  padding: 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

/* The Leaflet canvas replaces the temporary illustration in every state,
   including an empty GPS list. */
.photo-map-canvas.interactive-map-ready > .photo-map-empty {
  display: none;
}

/* Keep the established two-column operational layouts.  Only the contents
   are refined; the user's working layout must not move. */
.site-detail-page .worklog-layout,
.site-detail-page .site-file-layout,
.inspection-top-grid {
  align-items: stretch;
}

.site-detail-page .worklog-layout > .detail-card,
.site-detail-page .site-file-layout > .detail-card,
.inspection-top-grid .quick-note-card,
.inspection-top-grid .inspection-result-card {
  height: 100%;
}

.inspection-top-grid {
  grid-template-columns: minmax(0, 1fr) minmax(360px, .95fr);
  gap: 16px;
  height: 478px;
}

.inspection-workspace {
  min-height: calc(100vh - 285px);
  grid-template-rows: 478px minmax(0, 1fr);
}

.inspection-files-card {
  display: flex;
  min-height: 0;
  flex-direction: column;
}

.inspection-files-card .site-artifact-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.inspection-top-grid .quick-note-card {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border-color: var(--ui-border);
  border-radius: 10px;
  background: #fff;
}

/* The inspection memo and result cards form one horizontal pair.  Their
   header borders must share the same baseline; do not let the memo actions
   introduce a different vertical padding. */
.inspection-top-grid > .quick-note-card > header,
.inspection-top-grid > .inspection-result-card > header {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--ui-border);
}

.inspection-top-grid .quick-note-card > header > div:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inspection-top-grid .quick-note-card pre {
  min-height: 184px;
  margin: 0;
  padding: 14px 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.inspection-top-grid .quick-note-card .note-content {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 14px 18px;
  overflow: auto;
  color: var(--neutral-800, #1f2937);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.quick-note-card .note-inline-image {
  width: min(100%, 620px);
  margin: 14px 0;
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: #fff;
}

.quick-note-card .note-inline-image img { display: block; width: 100%; max-height: 360px; object-fit: contain; background: var(--ui-surface-muted); }
.quick-note-card .note-inline-image figcaption { padding: 7px 9px; color: var(--neutral-500, #667085); font-family: inherit; font-size: 11px; }
.quick-note-card .note-image-missing { display: inline-block; margin: 8px 0; color: #b42318; }
.note-editor-tools { display: flex; align-items: center; gap: 10px; margin: -2px 0 14px; }
.note-editor-tools small { color: var(--neutral-500, #667085); font-size: 11px; }

/* The overview's preparation tile previews the inspection commands. */
.site-briefing-body dl > .briefing-inspection-note dd {
  display: -webkit-box;
  overflow: hidden;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.site-briefing-body .briefing-inspection-note small a {
  color: var(--primary-700, #075fc8);
  font-weight: 700;
  text-decoration: none;
}

/* The account lookup remains a compact toolbar.  Use the actual label once,
   rather than adding a second pseudo-label. */
.operations-search-row {
  grid-template-columns: minmax(360px, 520px) minmax(220px, 1fr);
  min-height: 72px;
  margin: 16px 18px;
  padding: 12px 14px;
}

.operations-search-row label {
  grid-template-columns: auto minmax(0, 1fr);
}

.operations-search-row label::before { content: none; }

.operations-search-row .sr-only {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  clip-path: none;
  margin: 0;
  color: var(--neutral-700, #374151);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .inspection-top-grid { grid-template-columns: minmax(0, 1fr); }
  .inspection-top-grid { height: auto; }
  .inspection-workspace { min-height: 0; grid-template-rows: auto; }
  .inspection-top-grid > .quick-note-card > header,
  .inspection-top-grid > .inspection-result-card > header {
    height: auto;
    min-height: var(--ui-card-header-height);
  }
  .inspection-top-grid .quick-note-card,
  .inspection-top-grid .inspection-result-card,
  .site-detail-page .worklog-layout > .detail-card,
  .site-detail-page .site-file-layout > .detail-card { height: auto; }
  .operations-search-row { grid-template-columns: 1fr; min-height: 0; }
  .inspection-top-grid .quick-note-card .note-content { max-height: 360px; }
  .note-editor-tools { align-items: flex-start; flex-direction: column; }
}

/* When the quick-entry form sets the row height, let the linked-history rows
   share the remaining space instead of leaving an empty lower half. */
@media (min-width: 761px) {
  .site-detail-page .worklog-layout > .detail-card:has(.worklog-history) {
    display: flex;
    flex-direction: column;
  }

  .site-detail-page .worklog-layout > .detail-card:has(.worklog-history) .worklog-history {
    display: flex;
    flex: 1;
    flex-direction: column;
  }

  .site-detail-page .worklog-layout > .detail-card:has(.worklog-history) .worklog-history > a,
  .site-detail-page .worklog-layout > .detail-card:has(.worklog-history) .worklog-history > .worklog-record-details {
    flex: 1 1 0;
  }
}

@media (min-width: 761px) {
  .site-detail-page .worklog-layout {
    min-height: calc(100vh - 255px);
  }

  .site-detail-page .site-file-layout {
    min-height: calc(100vh - 255px);
  }

  /* Site-internal tabs are the work surface.  Keep their paired panels aligned
     to the available viewport, without stretching the global site directory. */
  .site-detail-page .contacts-layout {
    min-height: calc(100vh - 255px);
    align-items: stretch;
  }

  .site-detail-page .contacts-layout > .detail-card {
    display: flex;
    height: 100%;
    flex-direction: column;
  }

  .site-detail-page .contacts-layout > .detail-card:has(.site-contact-list) {
    border-color: var(--ui-border);
    background: #fff;
  }

  .site-detail-page .contacts-layout > .detail-card:has(.site-contact-list) > header {
    min-height: var(--ui-card-header-height);
    padding: 16px 18px;
    border-bottom: 1px solid var(--ui-border);
  }

  .site-detail-page .contacts-layout .site-contact-list {
    display: flex;
    flex: 1;
    flex-direction: column;
  }

  .site-detail-page .contacts-layout .site-contact-list > .empty-state {
    display: grid;
    flex: 1;
    place-content: center;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
}

/* Contact rows are an operational list, not nested cards.  Keep each person
   on one readable line and reveal an optional memo only when it exists. */
.site-detail-page .contacts-layout .site-contact-list {
  padding: 0 18px;
}

.site-detail-page .contacts-layout .site-contact-row {
  grid-template-columns: minmax(180px, 1fr) minmax(170px, .8fr) auto;
  gap: 14px;
  padding: 14px 0;
}

.site-contact-identity > div { display: flex; align-items: center; gap: 6px; }
.site-contact-identity strong { color: var(--neutral-950, #111827); }
.site-contact-identity small { margin-top: 4px; }
.site-contact-phone a { color: var(--primary-700, #075fc8); font-weight: 700; text-decoration: none; }
.site-contact-phone { color: var(--neutral-500, #667085); font-size: 13px; }
.site-contact-actions { justify-content: flex-end; white-space: nowrap; }
.site-contact-actions a { color: var(--primary-700, #075fc8); text-decoration: none; }
.site-contact-note { grid-column: 1 / -1; margin: -3px 0 0; padding-top: 10px; border-top: 1px solid var(--neutral-100, #f1f5f9); color: var(--neutral-600, #475467); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.site-contact-note span { margin-right: 8px; color: var(--neutral-500, #667085); font-size: 11px; font-weight: 700; }

@media (max-width: 720px) {
  .site-detail-page .contacts-layout .site-contact-row { grid-template-columns: 1fr; gap: 8px; }
  .site-contact-actions { justify-content: flex-start; }
}

/* The overview is a quick visual check: three current field photos per row,
   with the complete history available by scrolling inside the photo panel. */
.site-overview-evidence > .compact-panel:has(.photo-grid) {
  display: flex;
  min-height: 0;
  flex-direction: column;
}

.site-overview-evidence .photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 108px;
  align-content: start;
  flex: 1;
  gap: 8px;
  max-height: 240px;
  padding: 0 14px 14px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.site-overview-evidence .photo-card {
  height: auto;
  min-width: 0;
  border: 1px solid var(--neutral-200, #e5e7eb);
  border-radius: 6px;
}

.site-overview-evidence .photo-card span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .site-overview-evidence .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 124px;
  }
}

/* Long values must stay in their card.  Text wraps; wide tabular data and
   code-like content keep their own scroll area instead of widening the page. */
.detail-card,
.site-directory-card,
.site-file-row,
.site-artifact-list > a { min-width: 0; }

.detail-card :is(p, small, strong, span, dd, td, th, code),
.site-file-row :is(p, small, strong, span),
.site-artifact-list > a :is(p, small, strong, span) {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.detail-card pre,
.detail-card .responsive-table {
  max-width: 100%;
  overflow: auto;
}

@media (max-width: 760px) {
  .site-library-results.list {
    height: auto;
    max-height: none;
    min-height: calc(100vh - 360px);
  }
}

/* Unified SVG actions: preserve the existing controls and replace only text glyphs. */
.primary-action > .ui-icon,
.outline-action > .ui-icon,
[data-field-gps] > .ui-icon {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  vertical-align: -3px;
}

.location-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.location-line .ui-icon {
  width: 14px;
  height: 14px;
  color: var(--blue, #146ad8);
}

.site-favorite-button .ui-icon {
  width: 17px;
  height: 17px;
}

.site-favorite-button.favorite-active .ui-icon { fill: currentColor; }
.activity-dot .ui-icon { width: 15px; height: 15px; }
.document-icon .ui-icon { width: 19px; height: 19px; }

/* The collapsed rail is icon-only.  Do not allow the active label to wrap vertically. */
.sidebar-collapsed .primary-nav a,
.sidebar-collapsed .secondary-nav a,
.sidebar-collapsed .sidebar-logout {
  width: 48px;
  min-width: 48px;
  justify-content: center;
  gap: 0;
  padding: 9px 0;
  font-size: 0;
  overflow: hidden;
}

.sidebar-collapsed .primary-nav a > span:first-child,
.sidebar-collapsed .secondary-nav a > span:first-child,
.sidebar-collapsed .sidebar-logout > span:first-child {
  display: grid;
  width: 20px;
  min-width: 20px;
  place-items: center;
}

.sidebar-collapsed .primary-nav .ui-icon,
.sidebar-collapsed .secondary-nav .ui-icon,
.sidebar-collapsed .sidebar-logout .ui-icon { width: 19px; height: 19px; }

.sidebar-collapsed .collapse-menu {
  padding: 0;
  text-align: center;
  font-size: 22px;
}

.note-editor-live-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: var(--ui-surface-muted);
}

.note-editor-live-preview::before {
  content: "본문 이미지 미리보기";
  grid-column: 1 / -1;
  color: var(--neutral-600, #4b5563);
  font-size: 12px;
  font-weight: 700;
}

.note-editor-live-preview figure { min-width: 0; margin: 0; }
.note-editor-live-preview img { display: block; width: 100%; height: 120px; object-fit: cover; border: 1px solid var(--ui-border); border-radius: 6px; }
.note-editor-live-preview figcaption { margin-top: 5px; overflow: hidden; color: var(--neutral-600, #4b5563); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.field-new-site-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #bcd7fb;
  border-radius: 8px;
  background: #f4f8ff;
}

.field-new-site-fields .full { grid-column: 1 / -1; }

.field-selected-previews {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.field-selected-previews figure { min-width: 0; margin: 0; }
.field-selected-previews img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--ui-border); border-radius: 7px; }
.field-selected-previews figcaption { margin-top: 4px; overflow: hidden; color: var(--neutral-600, #4b5563); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 760px) {
  .field-new-site-fields { grid-template-columns: 1fr; }
  .field-new-site-fields .full { grid-column: auto; }
}
/* Unified dashboard: show the latest linked delivery photo without losing status legibility. */
.dashboard-delivery-visual.has-thumbnail {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #103b79;
}

.dashboard-delivery-visual.has-thumbnail::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgb(3 31 75 / 92%) 0%, rgb(4 55 118 / 70%) 58%, rgb(4 55 118 / 38%) 100%);
}

.dashboard-delivery-visual.has-thumbnail img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dashboard-delivery-visual.has-thumbnail > span,
.dashboard-delivery-visual.has-thumbnail > em {
  position: relative;
  z-index: 1;
}

.dashboard-delivery-visual.has-thumbnail > span {
  max-width: calc(100% - 96px);
}

/* Delivery workspace: photo-first gallery with only the operational essentials. */
.delivery-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.delivery-gallery-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dce2e9;
  border-radius: 10px;
  background: #f4f7fb;
}

.delivery-gallery-media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  color: #fff;
  text-decoration: none;
  background: #e7eef7;
}

.delivery-gallery-card { position: relative; cursor: pointer; }

.delivery-gallery-card img,
.delivery-gallery-empty {
  width: 100%;
  height: 100%;
}

.delivery-gallery-card img {
  display: block;
  object-fit: cover;
}

.delivery-gallery-empty {
  display: grid;
  place-items: center;
  color: #7e8c9e;
  background: linear-gradient(135deg, #edf2f8, #dfe8f3);
}

.delivery-gallery-card.no-photo .delivery-gallery-media,
.delivery-gallery-card.no-photo .delivery-gallery-empty {
  color: rgb(255 255 255 / 86%);
  background: linear-gradient(135deg, #123d76 0%, #1769b6 50%, #69a5d2 100%);
}

.delivery-gallery-empty .ui-icon {
  width: 34px;
  height: 34px;
}

.delivery-gallery-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
  background: linear-gradient(180deg, rgb(8 25 51 / 45%) 0%, transparent 42%, rgb(4 21 48 / 88%) 100%);
}


.delivery-gallery-top,
.delivery-gallery-caption {
  display: flex;
  align-items: center;
  gap: 7px;
}

.delivery-gallery-top { justify-content: space-between; }
.delivery-gallery-tags { display: inline-flex; align-items: center; gap: 6px; }
.delivery-gallery-caption { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; min-height: 53px; }
.delivery-gallery-caption strong { grid-column: 1 / -1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; font-size: 16px; line-height: 1.25; text-shadow: 0 1px 3px rgb(0 0 0 / 72%); }
.delivery-gallery-caption small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: rgb(255 255 255 / 92%); font-size: 11px; text-shadow: 0 1px 2px rgb(0 0 0 / 68%); }
.delivery-gallery-caption em { overflow: hidden; white-space: nowrap; font-size: 10px; font-style: normal; color: rgb(255 255 255 / 88%); text-shadow: 0 1px 2px rgb(0 0 0 / 68%); }

.delivery-gallery-tag,
.delivery-gallery-gps {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 999px;
  font-size: 10px;
}

.delivery-gallery-tag { padding: 0 9px; background: rgb(255 255 255 / 92%); color: #135cb7; }
.delivery-gallery-tag.one-off { background: #fff2d9; color: #9a5500; }
.delivery-gallery-tag.per-call { background: #ffe5e8; color: #b42332; }
.delivery-gallery-tag.delivery { background: #dcf6e9; color: #107a4a; }
.delivery-gallery-site-link { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border-radius: 999px; background: rgb(12 38 77 / 76%); color: #fff; font-size: 10px; font-weight: 700; text-decoration: none; }
.delivery-gallery-gps { width: 24px; background: rgb(26 38 57 / 72%); color: #d7e2f1; }
.delivery-gallery-gps.is-confirmed { background: #1f9a68; color: #fff; }
.delivery-gallery-gps .ui-icon { width: 13px; height: 13px; }

@media (max-width: 640px) {
  .delivery-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .delivery-gallery-overlay { padding: 9px; }
  .delivery-gallery-caption strong { font-size: 13px; }
}

/* Keep delivery-only work view focused on the photo gallery. */
.ops-page[data-work-type="delivery"] .work-flow-reference,
.ops-page[data-work-type="delivery"] .work-flow-reference + .ops-section { display: none; }

.ops-page:has(.segmented-tabs a[href="#/work?type=delivery"].active) .work-flow-reference,
.ops-page:has(.segmented-tabs a[href="#/work?type=delivery"].active) .work-flow-reference + .ops-section { display: none; }

.delivery-photo-modal { width: min(100%, 1080px); max-height: calc(100dvh - 40px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.delivery-photo-modal header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.delivery-photo-modal header p { margin: 0; color: #66758a; font-size: 12px; }
.delivery-photo-modal-close { width: 34px; height: 34px; border: 1px solid #d8e0ea; border-radius: 7px; background: #fff; color: #334155; font-size: 22px; line-height: 1; }
.delivery-photo-stage { position: relative; display: grid; min-height: 280px; place-items: center; padding: 12px 58px; overflow: hidden; background: #0f172a; }
.delivery-photo-image-viewport { display: grid; width: 100%; height: min(66vh, 680px); place-items: center; overflow: auto; cursor: zoom-in; user-select: none; }
.delivery-photo-image-viewport.is-pannable { place-items: start; cursor: grab; }
.delivery-photo-image-viewport.is-panning { cursor: grabbing; scroll-behavior: auto; }
.delivery-photo-stage img { max-width: 100%; max-height: min(66vh, 680px); object-fit: contain; transform-origin: center; transition: transform .16s ease; }
.delivery-photo-zoom-tools { position: absolute; z-index: 2; top: 12px; right: 14px; display: inline-flex; overflow: hidden; border: 1px solid rgb(255 255 255 / 28%); border-radius: 7px; background: rgb(15 23 42 / 76%); }
.delivery-photo-zoom-tools button { min-width: 34px; height: 32px; border: 0; border-left: 1px solid rgb(255 255 255 / 18%); background: transparent; color: #fff; font-size: 15px; }
.delivery-photo-zoom-tools button:first-child { border-left: 0; }
.delivery-photo-zoom-tools [data-delivery-photo-zoom-reset] { min-width: 48px; font-size: 11px; }
.delivery-photo-nav { position: absolute; z-index: 3; top: 50%; width: 38px; height: 38px; display: grid; place-items: center; padding: 0; transform: translateY(-50%); border: 0; border-radius: 50%; background: rgb(255 255 255 / 88%); color: #172033; }
.delivery-photo-nav::before { width: 9px; height: 9px; content: ""; border-top: 2px solid currentcolor; border-right: 2px solid currentcolor; }
.delivery-photo-nav.prev::before { margin-left: 4px; transform: rotate(-135deg); }
.delivery-photo-nav.next::before { margin-right: 4px; transform: rotate(45deg); }
.delivery-photo-nav.prev { left: 12px; }
.delivery-photo-nav.next { right: 12px; }
.delivery-photo-nav:disabled { opacity: .35; }
.delivery-photo-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 12px 18px; background: #f7f9fc; }
.delivery-photo-thumb { flex: 0 0 72px; width: 72px; height: 52px; padding: 0; overflow: hidden; border: 2px solid transparent; border-radius: 6px; background: #dbe4ef; }
.delivery-photo-thumb.active { border-color: #1769d6; }
.delivery-photo-thumb img { width: 100%; height: 100%; object-fit: cover; }

.site-artifact-list a > .site-artifact-thumbnail {
  width: 52px;
  height: 40px;
  min-width: 52px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--neutral-200);
  border-radius: 5px;
  background: var(--neutral-100);
}
.site-artifact-thumbnail img { display: block; width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 640px) {
  .app-modal-backdrop[data-delivery-photo-modal] { display: block; padding: 0; background: #0f172a; }
  .delivery-photo-modal { width: 100vw; height: 100dvh; max-width: none; max-height: none; border: 0; border-radius: 0; grid-template-rows: auto minmax(0, 1fr) auto; background: #0f172a; }
  .delivery-photo-modal header { min-height: 58px; padding: max(9px, env(safe-area-inset-top)) 12px 9px; border: 0; background: #0f172a; color: #fff; }
  .delivery-photo-modal header h2 { max-width: calc(100vw - 72px); overflow: hidden; color: #fff; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
  .delivery-photo-modal header p { color: #9fb0c8; }
  .delivery-photo-modal-close { border-color: rgb(255 255 255 / 28%); background: rgb(255 255 255 / 10%); color: #fff; }
  .delivery-photo-stage { min-height: 0; padding: 0; }
  .delivery-photo-image-viewport { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; overflow: auto; touch-action: pan-x pan-y; }
  .delivery-photo-stage img { flex: 0 0 auto; width: 100%; height: auto; max-width: none; max-height: none; }
  .delivery-photo-nav { z-index: 3; width: 42px; height: 42px; box-shadow: 0 2px 12px rgb(15 23 42 / 28%); }
  .delivery-photo-nav.prev { left: 8px; }
  .delivery-photo-nav.next { right: 8px; }
  .delivery-photo-zoom-tools { top: 8px; right: 8px; }
  .delivery-photo-thumbs { padding: 8px 12px max(8px, env(safe-area-inset-bottom)); background: #111c31; }
  .artifact-image-modal { grid-template-rows: auto minmax(0, 1fr); }
  .artifact-image-modal .delivery-photo-stage { height: auto; }
}

/* Site delivery photos: browse a busy album one work date at a time. */
.site-photo-date-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 18px 0;
  border-bottom: 1px solid var(--neutral-100);
}

.site-photo-date-tabs a {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--neutral-200);
  border-radius: 7px 7px 0 0;
  color: var(--neutral-600);
  font-size: 12px;
  text-decoration: none;
}

.site-photo-date-tabs a.active {
  border-color: var(--primary-600);
  background: var(--primary-50);
  color: var(--primary-700);
}

.site-photo-date-tabs span { font-size: 11px; opacity: .8; }

.site-photo-date-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 18px 18px;
}

.site-photo-date-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--neutral-200);
  border-radius: 7px;
  background: #fff;
  color: var(--neutral-800);
  text-decoration: none;
}

.site-photo-date-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--neutral-100);
}

.site-photo-date-card span {
  display: block;
  overflow: hidden;
  padding: 7px 8px;
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (max-width: 640px) {
  .site-photo-date-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px; }
}

/* Date folders in the site photo tab. The row is the album; its photos expand below. */
.site-photo-folders { padding: 0; }
.site-photo-folder { border-bottom: 1px solid var(--neutral-100); }
.site-photo-folder:last-child { border-bottom: 0; }

.site-photo-folder-row {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 86px;
  padding: 12px 18px;
  color: var(--neutral-900);
  text-decoration: none;
}

.site-photo-folder-row:hover,
.site-photo-folder.expanded .site-photo-folder-row { background: var(--primary-50); }

.site-photo-folder-previews {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 128px;
  height: 60px;
  overflow: hidden;
  border: 1px solid var(--neutral-200);
  border-radius: 6px;
  background: var(--neutral-100);
}

.site-photo-folder-previews img {
  width: 100%;
  height: 60px;
  border-left: 1px solid #fff;
  object-fit: cover;
}
.site-photo-folder-previews img:first-child { border-left: 0; }

.site-photo-folder-date { display: grid; gap: 4px; }
.site-photo-folder-date strong { font-size: 15px; }
.site-photo-folder-date small { color: var(--neutral-500); font-size: 12px; }
.site-photo-folder-open { color: var(--primary-700); font-size: 12px; font-weight: 700; }
.site-photo-folder-open i { display: inline-block; margin-left: 5px; font-size: 18px; font-style: normal; vertical-align: -1px; }
.site-photo-folder.expanded .site-photo-folder-open i { transform: rotate(90deg); }

.site-photo-folder-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 18px 18px 160px;
}

@media (max-width: 640px) {
  .site-photo-folder-row { grid-template-columns: 92px minmax(0, 1fr) auto; gap: 10px; padding: 10px 12px; }
  .site-photo-folder-previews { width: 92px; height: 52px; }
  .site-photo-folder-previews img { height: 52px; }
  .site-photo-folder-open { font-size: 0; }
  .site-photo-folder-open i { margin: 0; font-size: 20px; }
  .site-photo-folder-items { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 12px 12px; }
}

/* Compact global search: the result list scrolls, leaving the page footer visible. */
.global-search-focus {
  max-width: none;
  padding: 10px 12px;
  border: 1px solid var(--neutral-200);
  border-radius: var(--ui-card-radius);
  background: #fff;
}
.global-search-focus form { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; }
.global-search-focus form > label { margin: 0; color: var(--neutral-700); font-size: 12px; font-weight: 750; white-space: nowrap; }
.global-search-focus form > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.global-search-focus input[type="search"] { min-height: 38px; }
.global-search-focus .primary-action { min-height: 38px; }
.global-search-tabs { margin: 0; }
.global-search-results { min-height: 0; overflow: auto; }
.global-result-row { min-height: 60px; }
.global-result-kind.has-thumbnail { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.global-result-kind.has-thumbnail img { width: 46px; height: 38px; flex: 0 0 46px; border: 1px solid var(--neutral-200); border-radius: 5px; object-fit: cover; background: var(--neutral-100); }
.global-result-kind.has-thumbnail em { overflow: hidden; color: inherit; font-size: inherit; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }

@media (min-width: 761px) {
  #main-content:has(.global-search-page) { display: flex; flex: 1 1 auto; min-height: 0; overflow: hidden; }
  .global-search-page { width: 100%; height: calc(100vh - 158px); grid-template-rows: auto auto auto minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .global-search-focus form { grid-template-columns: 1fr; gap: 7px; }
  .global-search-focus form > div { grid-template-columns: minmax(0, 1fr) auto; }
  .global-search-focus .primary-action { width: auto; }
  .global-result-kind.has-thumbnail em { display: none; }
}

@media (max-width: 980px) {
  .knowledge-list-layout, .knowledge-document-layout { grid-template-columns: 1fr; }
  .knowledge-summary, .knowledge-outline { position: static; }
  .knowledge-summary { display: none; }
}

@media (max-width: 680px) {
  .knowledge-list-row { grid-template-columns: 4px 40px minmax(0, 1fr); gap: 10px; min-height: 0; padding: 13px 12px 13px 0; }
  .knowledge-row-icon { width: 38px; height: 38px; border-radius: 8px; font-size: 10px; }
  .knowledge-list-row time, .knowledge-row-open { grid-column: 3; }
  .knowledge-list-row time { margin-top: -4px; }
  .knowledge-row-open { margin-top: -8px; }
  .knowledge-search > div { gap: 7px; }
  .knowledge-search .primary-action { padding: 0 12px; }
  .knowledge-document { padding: 20px; }
  .knowledge-drawer { width: min(100vw - 18px, 410px); }
  .knowledge-finder-drawer { left: 0; }
  .knowledge-overlay-backdrop { left: 0; }
}
