:root {
  color-scheme: light;
  font-family: "Trebuchet MS", "Avenir Next", Avenir, sans-serif;
  color: #14323e;
  background: #f3f2ea;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --ink: #14323e;
  --muted: #62797b;
  --green: #236f62;
  --green-dark: #185449;
  --sand: #fbf8ef;
  --line: #d7d9ce;
  --orange: #b9764d;
  --error: #9a3c35;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }

.site-header {
  min-height: 84px;
  padding: 18px clamp(20px, 5vw, 72px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 248, 239, .92);
  backdrop-filter: blur(12px);
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 800; letter-spacing: .15em; }
.brand svg { width: 42px; height: 42px; }
.private-label { color: var(--muted); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; }
.site-nav { display: flex; flex: 1 1 auto; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.site-nav a { padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: #ded5c3; color: var(--ink); font-size: .9rem; font-weight: 800; line-height: 1; text-decoration: none; white-space: nowrap; }
.site-nav a:hover { background: #cfc2aa; }
.site-nav a.active, .site-nav a.active:hover { border-color: var(--green); background: var(--green); color: white; }
.site-user { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .86rem; white-space: nowrap; }
.site-user form { margin: 0; }
.header-sign-out { padding: 9px 14px; font-size: .86rem; }

.page { width: min(1760px, calc(100% - 32px)); margin: 42px auto 70px; }
.auth-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 32px; align-items: start; }
.hero, .panel, .role-card { border: 1px solid var(--line); background: var(--sand); border-radius: 24px; }
.hero { padding: clamp(32px, 6vw, 72px); min-height: 530px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; width: 330px; height: 330px; border-radius: 50%; right: -90px; bottom: -100px; background: #b9d2cb; opacity: .55; }
.eyebrow { color: var(--orange); font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3 { font-family: Georgia, "Iowan Old Style", serif; font-weight: 500; }
h1 { max-width: 680px; margin: 28px 0 20px; font-size: clamp(3rem, 7vw, 6rem); letter-spacing: -.05em; line-height: 1; }
.hero-copy { max-width: 650px; color: var(--muted); font-size: 1.12rem; line-height: 1.75; }
.panel { padding: 28px; }
.panel h2 { margin-top: 0; font-size: 2rem; }
.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 7px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; padding: 13px 14px; border: 1px solid #bfc8c1; border-radius: 12px; background: white; color: var(--ink); }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid #78a99a55; border-color: var(--green); }
.button, button { border: 0; border-radius: 999px; padding: 12px 20px; background: var(--green); color: white; font-weight: 800; cursor: pointer; text-decoration: none; }
.button:hover, button:hover { background: var(--green-dark); }
.muted { color: var(--muted); }
.flash { margin-bottom: 20px; padding: 14px 17px; border-radius: 14px; background: #dfece6; border: 1px solid #b9d3c7; }
.flash.error { background: #f4e0dd; border-color: #dfb1ab; color: var(--error); }
.errors { margin: 0 0 20px; padding: 14px 18px 14px 38px; border-radius: 14px; background: #f4e0dd; border: 1px solid #dfb1ab; color: var(--error); }
.role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 28px; }
.role-card { padding: 22px; }
.role-card h3 { margin: 0 0 8px; font-size: 1.3rem; }
.role-card p { margin: 0; color: var(--muted); line-height: 1.55; }
.dashboard-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 28px; }
.dashboard-head h1 { margin: 0; font-size: clamp(2.7rem, 6vw, 5rem); }
.workspace-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.workspace-card { min-height: 230px; }
.card-link { display: block; color: inherit; text-decoration: none; transition: transform .15s ease, border-color .15s ease; }
.card-link:hover { transform: translateY(-2px); border-color: #9eb9ae; }
.workspace-card .tag, .settings-card .tag { display: inline-block; color: var(--orange); font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.workspace-card h2 { margin: 18px 0 12px; }
.role-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.role-badge { padding: 7px 11px; border-radius: 999px; background: #e2ebe4; color: #315d55; font-size: .8rem; font-weight: 700; }
.text-link { display: inline-block; margin-top: 18px; color: var(--green); font-weight: 800; }
.section-head, .panel-head, .button-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-head { margin-bottom: 28px; }
.section-head h1 { margin: 5px 0 0; font-size: clamp(2.6rem, 6vw, 5rem); }
.panel-head h2 { margin: 4px 0 0; }
.button-row { justify-content: flex-start; flex-wrap: wrap; }
.button.secondary { background: #ded5c3; color: var(--ink); }
.button.secondary:hover { background: #cfc2aa; }
.button.small { padding: 8px 14px; font-size: .86rem; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--sand); }
.stat strong { display: block; font: 500 2.3rem Georgia, serif; }
.stat span { color: var(--muted); }
.section-block { margin-top: 22px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; }
td small { display: block; margin-top: 4px; color: var(--muted); }
td.actions { text-align: right; }
.equipment-actions { width: 180px; min-width: 180px; }
.table-action-stack { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.table-action-stack .button { display: block; text-align: center; white-space: nowrap; }
.equipment-location-link { display: inline-block; text-align: center; }
.status { display: inline-block; padding: 6px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800; }
.status.active { color: #285f50; background: #dcebe3; }
.status.inactive { color: #6f6659; background: #e8e2d7; }
.status.locked { color: var(--error); background: #f4e0dd; }
.form-panel { max-width: 900px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.form-panel.wide { max-width: none; }
fieldset { margin: 6px 0 24px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; }
legend { padding: 0 8px; font-weight: 800; }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.choice, .setting { display: flex; align-items: flex-start; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: white; cursor: pointer; }
.choice input, .setting input { margin-top: 3px; }
.choice small, .setting small { display: block; margin-top: 4px; color: var(--muted); line-height: 1.4; }
.setting-list { display: grid; gap: 12px; margin: 0 0 22px; }
.fleet-stats { grid-template-columns: repeat(5, 1fr); }
.stat-link { color: inherit; text-decoration: none; }
.stat-link:hover, .stat-link.selected { border-color: var(--green); background: #eef4ed; }
.filter-bar { display: grid; grid-template-columns: minmax(240px, 2fr) minmax(180px, 1fr) auto; gap: 16px; align-items: end; }
.filter-bar .field { margin: 0; }
.vessel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 22px; }
.vessel-card { min-height: 270px; }
.vessel-card h2 { margin: 25px 0 10px; font-size: 2rem; }
.vessel-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.fleet-number { color: var(--muted); font-size: .8rem; font-weight: 800; letter-spacing: .08em; }
.status.available { color: #285f50; background: #dcebe3; }
.status.in_use { color: #315b7a; background: #dfeaf2; }
.status.maintenance { color: #80572f; background: #f1e4cf; }
.status.out_of_service { color: var(--error); background: #f4e0dd; }
.status.retired { color: #625f5b; background: #e4e1dc; }
.compact-details, .detail-grid { margin: 25px 0 0; }
.compact-details div { margin-top: 13px; }
dt { color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
dd { margin: 4px 0 0; }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 60px 28px; }
.detail-hero { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr); gap: 35px; }
.detail-hero h2 { margin: 22px 0 8px; }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.prose { line-height: 1.7; }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.timeline span { display: block; margin-top: 4px; color: var(--muted); font-size: .86rem; }
.intro-copy { max-width: 820px; color: var(--muted); font-size: 1.06rem; line-height: 1.7; }
.form-actions { margin-top: 22px; }
.inline-search { display: grid; grid-template-columns: minmax(240px, 1fr) auto auto; gap: 12px; align-items: end; margin: 20px 0; }
.inline-search .field { margin: 0; }
.callout { padding: 22px; border: 1px solid #d6c69f; border-radius: 16px; background: #faf0d8; }
.status.equipment-installed { color: #285f50; background: #dcebe3; }
.status.equipment-spare { color: #315b7a; background: #dfeaf2; }
.status.equipment-service_due { color: #80572f; background: #f1e4cf; }
.status.equipment-removed { color: #625f5b; background: #e4e1dc; }
.spec-list { margin: 10px 0 0; display: grid; gap: 7px; }
.spec-list div { display: grid; grid-template-columns: minmax(90px, .7fr) minmax(120px, 1.3fr); gap: 10px; }
details summary { margin-top: 9px; color: var(--green); cursor: pointer; font-weight: 800; }
.inline-create { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.inline-create summary { margin: 0; }
.inline-create form { margin-top: 18px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 24px; }
.settings-card { min-height: 230px; }
.settings-card h2 { margin: 18px 0 10px; }
.settings-card > strong { display: block; font: 500 2.6rem Georgia, serif; color: var(--green); }
.settings-card p { color: var(--muted); line-height: 1.6; }
.wizard-progress { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 22px; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--sand); }
.wizard-progress span { padding: 13px 20px; text-align: center; font-weight: 800; }
.wizard-progress .complete { color: var(--green); }
.wizard-progress .active { color: white; background: var(--green); }
.discovery-progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 22px; }
.discovery-progress span { padding: 11px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--sand); color: var(--muted); text-align: center; font-size: .84rem; font-weight: 800; }
.discovery-progress span.active { border-color: var(--green); background: #e2ebe4; color: var(--green); }
.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.category-card { display: flex; flex-direction: column; min-height: 155px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; color: inherit; text-decoration: none; background: white; }
.category-card:hover, .category-card.selected { border-color: var(--green); background: #eef4ed; }
.category-card strong { font: 500 1.25rem Georgia, serif; }
.category-card span { margin-top: 8px; color: var(--muted); line-height: 1.45; }
.category-card small { margin-top: auto; padding-top: 14px; color: var(--green); font-weight: 800; }
.wizard-filter { display: grid; grid-template-columns: minmax(260px, 1fr) auto; gap: 14px; align-items: end; }
.wizard-filter .field { margin: 0; }
.count-badge { padding: 8px 12px; border-radius: 999px; background: #e2ebe4; color: var(--green); font-weight: 800; }
.document-stats { margin-top: 22px; }
.status.document-ready { color: #285f50; background: #dcebe3; }
.status.document-queued { color: #315b7a; background: #dfeaf2; }
.status.document-processing { color: #80572f; background: #f1e4cf; }
.status.document-failed { color: var(--error); background: #f4e0dd; }
.document-search { display: grid; grid-template-columns: minmax(280px, 1fr) auto; gap: 14px; align-items: end; }
.document-search .field { margin: 0; }
.search-results { display: grid; gap: 16px; margin-top: 20px; }
.search-result { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.search-result h2 { margin: 4px 0 8px; }
.search-excerpt { margin-bottom: 0; line-height: 1.65; }
mark { padding: 1px 3px; border-radius: 4px; background: #ffe59a; color: inherit; }
.page-index { display: grid; gap: 12px; margin-top: 18px; }
.page-index article { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 18px; align-items: start; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.page-index article > div { display: flex; align-items: center; gap: 8px; }
.page-index article p { margin: 0; color: var(--muted); line-height: 1.5; }
.page-index article a { color: var(--green); font-weight: 800; white-space: nowrap; }
.status.extraction-text { color: #285f50; background: #dcebe3; }
.status.extraction-ocr { color: #315b7a; background: #dfeaf2; }
.status.extraction-blank { color: #6f6659; background: #e8e2d7; }
.pdf-viewer { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #d8d3c9; box-shadow: 0 18px 48px rgba(35, 44, 38, .12); }
.pdf-viewer-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 24px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--sand); }
.pdf-toolbar-group { display: flex; align-items: center; gap: 9px; }
.pdf-toolbar-group label { margin: 0; }
.pdf-toolbar-group input { width: 76px; padding: 10px 11px; }
.pdf-toolbar-group button { padding: 10px 14px; }
.pdf-search-control { flex: 1; min-width: 300px; }
.pdf-search-control input { flex: 1; min-width: 180px; width: auto; }
.pdf-viewer-status { margin: 0; padding: 9px 18px; color: #3f4d45; background: #f7f2e8; }
.pdf-viewer-status.error { color: var(--error); }
.pdf-page-scroll { overflow: auto; max-height: calc(100vh - 280px); min-height: 520px; padding: 26px; }
.pdf-page-surface { position: relative; margin: 0 auto; background: white; box-shadow: 0 5px 22px rgba(0, 0, 0, .24); }
.pdf-page-surface canvas { display: block; }
.pdf-highlight-layer { position: absolute; inset: 0; pointer-events: none; }
.pdf-highlight-layer span { position: absolute; box-sizing: border-box; border: 1px solid rgba(173, 105, 0, .75); border-radius: 2px; background: rgba(255, 216, 57, .58); mix-blend-mode: multiply; }
.source-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.source-choice { display: flex; flex-direction: column; gap: 8px; min-height: 135px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; color: inherit; text-decoration: none; background: white; }
.source-choice:hover, .source-choice.featured:hover { border-color: var(--green); transform: translateY(-1px); }
.source-choice.featured { border-color: #a9c8bc; background: #edf5f0; }
.source-choice strong { font: 500 1.35rem Georgia, serif; }
.source-choice span { color: var(--muted); line-height: 1.5; }
.button-column { display: flex; flex-direction: column; gap: 10px; min-width: 230px; }
.source-selection-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 24px; }
.source-selection-card h2 { margin: 6px 0 10px; }
.source-links { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.source-links a, td small a { color: var(--green); font-weight: 800; }
.capture-panel { max-width: 1100px; }
.capture-destination { display: flex; align-items: baseline; gap: 12px; margin-bottom: 22px; padding: 16px 18px; border: 1px solid #b9d3c7; border-radius: 14px; background: #edf5f0; }
.capture-destination span { color: var(--muted); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.capture-destination strong { font: 500 1.45rem Georgia, serif; color: var(--green); }
.capture-destination small { color: var(--muted); }
.equipment-resource-layout { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr); gap: 22px; align-items: start; }
.equipment-resource-layout > .panel { margin-top: 0; }
.selected-equipment-card { margin: 18px 0; padding: 18px; border: 1px solid #b9d3c7; border-radius: 15px; background: #edf5f0; }
.selected-equipment-card h3 { margin: 5px 0 8px; font: 500 1.55rem Georgia, serif; }
.selected-equipment-card p:last-child { margin-bottom: 0; }
.equipment-resource-board { position: sticky; top: 92px; }
.resource-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 20px; }
.resource-group { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.resource-group h3 { margin: 0 0 12px; }
.resource-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.resource-list li { padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.resource-list li > a { display: flex; flex-direction: column; gap: 5px; color: inherit; text-decoration: none; }
.resource-list li > a:hover strong { color: var(--green); }
.resource-list span { color: var(--muted); font-size: .82rem; }
.resource-list .status { display: inline-block; margin-top: 8px; color: inherit; }
.resource-add-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: center; max-width: 1040px; margin: 22px auto 0; }
.resource-add-panel h2 { margin: 3px 0 8px; }
.resource-add-panel p:last-child { margin-bottom: 0; }
.resource-add-panel .resource-actions { justify-content: center; margin: 0; }
.equipment-profile-hero { display: grid; grid-template-columns: minmax(300px, .85fr) minmax(0, 1.15fr); gap: 28px; align-items: start; }
.equipment-profile-hero > .resource-actions { grid-column: 1 / -1; margin: 0; }
.detail-grid.compact { margin: 0; }
.equipment-profile-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(340px, .65fr); gap: 22px; align-items: start; }
.equipment-profile-layout > div { min-width: 0; }
.equipment-profile-layout .panel { margin-top: 0; }
.profile-spec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 18px 0 0; }
.profile-spec-grid > div, .mini-detail-grid > div { padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.profile-spec-grid dt, .mini-detail-grid dt { color: var(--muted); font-size: .76rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.profile-spec-grid dd, .mini-detail-grid dd { margin: 5px 0 0; }
.profile-note { margin-top: 18px; padding: 16px; border-radius: 14px; background: var(--sand); }
.profile-note p { margin-bottom: 0; line-height: 1.6; }
.profile-resource-list li > p { margin: 10px 0 0; color: var(--muted); line-height: 1.5; }
.equipment-installations { position: sticky; top: 92px; }
.installation-list { display: grid; gap: 14px; }
.installation-list article { padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.installation-list article h3 { margin: 0; }
.installation-list article h3 a { color: inherit; text-decoration: none; }
.installation-list article h3 a:hover { color: var(--green); }
.installation-list article > p { color: var(--muted); line-height: 1.5; }
.mini-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.knowledge-target-list { display: grid; gap: 16px; margin-top: 18px; }
.knowledge-target-card { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: white; scroll-margin-top: 110px; }
.knowledge-target-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.knowledge-target-head h3 { margin: 0 0 7px; font-size: 1.35rem; }
.knowledge-target-head p { margin: 0; color: var(--muted); line-height: 1.5; }
.knowledge-target-card .resource-list { margin-top: 14px; }
.knowledge-target-card .resource-actions { margin-bottom: 0; }
.maintenance-list, .maintenance-history { display: grid; gap: 16px; margin-top: 18px; }
.inset-panel { border-radius: 16px; background: white; }
.maintenance-record { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.maintenance-record-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.maintenance-record-head h3 { margin: 4px 0 0; font-size: 1.35rem; }
.maintenance-record-head > strong { white-space: nowrap; }
.maintenance-meta { margin-top: 18px; }
.maintenance-notes { margin-top: 16px; }
.maintenance-notes > strong { color: var(--muted); font-size: .76rem; letter-spacing: .06em; text-transform: uppercase; }
.maintenance-notes p { margin: 6px 0 0; line-height: 1.6; }
.maintenance-source { margin: 16px 0 0; }
.maintenance-source a { color: var(--green); font-weight: 800; }
.record-stamp { margin: 16px 0 0; font-size: .82rem; }

.boat-location-picker { margin: 24px 0; padding: 24px; border: 1px solid #b9d3c7; border-radius: 20px; background: #edf5f0; scroll-margin-top: 110px; }
.boat-location-picker h2 { margin: 4px 0 7px; }
.boat-location-picker .panel-head p:last-child { margin-bottom: 0; }
.boat-location-layout { display: grid; grid-template-columns: minmax(300px, .82fr) minmax(340px, 1.18fr); gap: 30px; align-items: center; margin-top: 22px; }
.equipment-location-sections { display: grid; gap: 14px; align-self: start; }
.equipment-location-section { margin: 0; padding: 14px; border: 1px solid #b9d3c7; border-radius: 14px; background: rgba(255,255,255,.72); }
.equipment-location-section legend { padding: 0 7px; color: var(--ink); font-weight: 800; }
.equipment-location-zone-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 9px; }
.equipment-location-zone { display: flex; min-height: 64px; flex-direction: column; align-items: flex-start; justify-content: center; padding: 10px 13px; border: 1px solid #86a99f; border-radius: 11px; background: white; color: var(--ink); text-align: left; }
.equipment-location-zone strong { font-size: .95rem; }
.equipment-location-zone small { margin-top: 4px; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.equipment-location-zone:hover, .equipment-location-zone[aria-pressed="true"] { border-color: var(--green); background: var(--green); color: white; }
.equipment-location-zone:hover small, .equipment-location-zone[aria-pressed="true"] small { color: white; }
.equipment-zone-board { display: grid; grid-template-columns: repeat(2, minmax(190px, 1fr)); gap: 14px; align-items: start; }
.equipment-zone-board.layout-catamaran, .equipment-zone-board.layout-trimaran { grid-template-columns: repeat(4, minmax(165px, 1fr)); }
.equipment-zone-board.layout-custom { grid-template-columns: repeat(3, minmax(165px, 1fr)); }
.equipment-zone-board .boat-plan-wrap { max-width: none; }
.equipment-zone-board .boat-plan-wrap > h3 { min-height: 2.3em; margin: 0 0 5px; text-align: center; font-size: 1rem; }
.boat-plan-wrap { max-width: 430px; margin: 0 auto; width: 100%; }
.boat-direction { display: flex; flex-direction: column; align-items: center; color: var(--green); text-transform: uppercase; letter-spacing: .1em; font-size: .75rem; }
.boat-direction span { font-size: 1.8rem; line-height: 1; }
.boat-plan { position: relative; width: 100%; aspect-ratio: .7; min-height: 520px; overflow: hidden; border: 3px solid #668d83; border-radius: 50% 50% 28% 28% / 16% 16% 10% 10%; background: linear-gradient(90deg, #e0ede8 0 49.6%, #cde0da 50.4% 100%); box-shadow: inset 0 0 0 9px #f8fbf8, 0 16px 35px rgba(20, 50, 62, .12); }
.boat-plan::before { content: ""; position: absolute; inset: 8% 12% 7%; border: 1px solid #9ab8af; border-radius: 48% 48% 22% 22% / 15% 15% 9% 9%; pointer-events: none; }
.boat-centerline { position: absolute; top: 5%; bottom: 5%; left: 50%; border-left: 1px dashed #7e9d95; pointer-events: none; }
.boat-zone { position: absolute; z-index: 1; left: 50%; width: 76%; padding: 6px 8px 8px; transform: translateX(-50%); border: 1px solid #86a99f; border-radius: 14px; background: rgba(255, 255, 255, .92); box-shadow: 0 4px 12px rgba(20, 50, 62, .08); text-align: center; }
.boat-zone > span { display: block; margin-bottom: 5px; color: var(--ink); font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.boat-zone-sides { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; }
.boat-zone-sides button { padding: 6px 5px; border: 1px solid #b9d3c7; border-radius: 8px; background: #f8fbf8; color: var(--ink); font-size: .7rem; }
.boat-zone-sides button:hover, .boat-zone-sides button[aria-pressed="true"], .location-choice[aria-pressed="true"] { border-color: var(--green); background: var(--green); color: white; }
.zone-bow { top: 3%; }
.zone-head { top: 16%; }
.zone-salon { top: 29%; }
.zone-midships { top: 42%; }
.zone-engine { top: 55%; }
.zone-cockpit { top: 68%; }
.zone-stern { top: 81%; }
.boat-side-labels { display: flex; justify-content: space-between; padding: 8px 10%; color: var(--muted); font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.location-choices fieldset { background: var(--sand); }
.location-choice-row { display: flex; flex-wrap: wrap; gap: 9px; }
.location-choice { padding: 10px 15px; border: 1px solid var(--line); background: white; color: var(--ink); }
.location-preview { display: flex; flex-direction: column; gap: 5px; margin: 20px 0; padding: 16px 18px; border: 1px solid #b9d3c7; border-radius: 14px; background: white; }
.location-preview span { color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.location-preview strong { color: var(--green); font: 500 1.3rem Georgia, serif; }
.location-fine-tune { margin-top: 18px; padding-top: 4px; border-top: 1px solid #b9d3c7; }
.location-fine-tune .form-grid { margin-top: 16px; }
.location-fine-tune .field { margin-bottom: 0; }

.vessel-layout-board { display: grid; grid-template-columns: repeat(var(--layout-columns, 2), minmax(220px, 1fr)); gap: 18px; margin-top: 24px; }
.vessel-layout-board.layout-monohull { grid-template-columns: 1fr; }
.vessel-layout-board.layout-catamaran { --layout-columns: 4; }
.vessel-layout-board.layout-trimaran { --layout-columns: 4; }
.vessel-layout-board.layout-custom { --layout-columns: 3; }
.layout-hull-section { width: min(100%, 960px); min-width: 0; margin-inline: auto; }
.layout-hull-section h3 { margin: 0 0 10px; text-align: center; font-size: 1.05rem; }
.layout-drag-help { max-width: 760px; margin: 8px 0 0; color: var(--muted); }
.layout-save-state { display: inline-block; margin: 10px 0 0; padding: 5px 10px; border-radius: 999px; background: #e0ede8; color: var(--green); font-size: .76rem; font-weight: 800; }
.layout-has-changes .layout-save-state { background: #fff0c9; color: #7b4d00; }
.layout-zone-canvas { position: relative; min-height: 640px; overflow: hidden; border: 3px solid #668d83; border-radius: 48% 48% 25% 25% / 11% 11% 8% 8%; background: linear-gradient(90deg, #e0ede8 0 33.2%, #d7e7e1 33.2% 66.5%, #cde0da 66.5% 100%); box-shadow: inset 0 0 0 8px #f8fbf8; }
.layout-zone-canvas::before { content: "Bow ↑"; position: absolute; top: 10px; left: 50%; transform: translateX(-50%); color: var(--green); font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.layout-zone-canvas::after { content: "Stern ↓"; position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); color: var(--green); font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.layout-lane-labels { position: absolute; z-index: 1; top: 30px; left: 8%; right: 8%; display: grid; grid-template-columns: repeat(3, 1fr); color: #47766b; font-size: .62rem; font-weight: 900; letter-spacing: .08em; text-align: center; text-transform: uppercase; pointer-events: none; }
.layout-lane-guides { position: absolute; z-index: 1; inset: 48px 0 34px; background: linear-gradient(90deg, transparent 33.1%, rgba(79,130,116,.24) 33.2%, transparent 33.5%, transparent 66.4%, rgba(79,130,116,.24) 66.5%, transparent 66.8%); pointer-events: none; }
.layout-zone-card { position: absolute; z-index: 2; top: var(--zone-y); left: var(--zone-x); display: grid; grid-template-columns: 28px minmax(0, 1fr) 28px; align-items: center; box-sizing: border-box; width: var(--zone-width, 20%); min-width: 108px; height: var(--zone-height, 9%); min-height: 52px; overflow: hidden; padding: 4px; transform: translate(-50%, -50%); border: 2px solid #4f8274; border-radius: 11px; background: rgba(255,255,255,.97); color: var(--ink); box-shadow: 0 4px 12px rgba(20,50,62,.14); cursor: grab; text-align: left; touch-action: none; user-select: none; }
.layout-zone-card:hover { background: white; color: var(--ink); border-color: var(--green); }
.layout-zone-card.dragging { z-index: 20; opacity: .82; cursor: grabbing; box-shadow: 0 9px 24px rgba(20,50,62,.28); }
.layout-zone-card.resizing { z-index: 20; box-shadow: 0 9px 24px rgba(20,50,62,.28); }
.layout-zone-card-new { z-index: 19; animation: new-layout-piece 1.4s ease-out 2; }
@keyframes new-layout-piece { 0%, 100% { box-shadow: 0 4px 12px rgba(20,50,62,.14); } 50% { box-shadow: 0 0 0 6px rgba(213,151,62,.35), 0 8px 22px rgba(20,50,62,.24); } }
.layout-card-control { display: grid; place-items: center; width: 27px; height: 34px; padding: 0; border: 0; border-radius: 8px; background: #e0ede8; color: var(--green); font-size: 1.1rem; font-weight: 900; cursor: pointer; touch-action: manipulation; }
.layout-card-control:hover { background: var(--green); color: white; }
.layout-card-control.remove { background: #f7e4df; color: #8e3f31; }
.layout-card-control.remove:hover { background: #a44939; color: white; }
.layout-resize-handle { position: absolute; right: 1px; bottom: 1px; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 6px 0 8px 0; background: repeating-linear-gradient(135deg, transparent 0 4px, #4f8274 4px 6px); cursor: nwse-resize; opacity: .7; touch-action: none; }
.layout-resize-handle:hover, .layout-resize-handle:focus-visible { background: repeating-linear-gradient(135deg, transparent 0 4px, var(--green) 4px 7px); opacity: 1; }
.layout-card-label { min-width: 0; padding: 2px 5px; text-align: center; pointer-events: none; }
.layout-zone-card strong, .layout-zone-card small { display: block; overflow-wrap: normal; word-break: normal; }
.layout-zone-card strong { font-size: .82rem; line-height: 1.05; }
.layout-zone-card small { margin-top: 3px; color: var(--green); font-size: .59rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.layout-context-menu { position: fixed; z-index: 1000; width: 180px; padding: 7px; border: 1px solid #86a99f; border-radius: 12px; background: white; box-shadow: 0 12px 32px rgba(20,50,62,.28); }
.layout-context-menu[hidden] { display: none; }
.layout-context-menu button { width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); text-align: left; }
.layout-context-menu button:hover { background: #e0ede8; color: var(--green); }
.layout-context-menu button.remove { color: #8e3f31; }
.layout-context-menu button.remove:hover { background: #f7e4df; color: #8e3f31; }
.layout-zone-list { display: grid; gap: 12px; margin-top: 20px; }
.layout-zone-row { display: grid; grid-template-columns: minmax(180px, 1.25fr) minmax(150px, 1fr) minmax(150px, 1fr) auto; gap: 12px; align-items: end; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.layout-zone-row .field { margin: 0; }
.layout-zone-actions { display: flex; min-height: 48px; align-items: center; justify-content: flex-end; }
.button.delete { background: #a44939; color: white; }
.button.delete:hover { background: #7f3025; color: white; }
.compact-setting { align-items: center; min-height: 48px; }

.library-research-panel { scroll-margin-top: 110px; border-color: #9ebfb5; background: linear-gradient(135deg, #f9f5eb 0%, #edf5f0 100%); }
.library-research-panel form { margin-top: 20px; }
.library-research-panel .button-row .field-help { max-width: 680px; margin: 0; }
.equipment-research-summary { display: grid; grid-template-columns: minmax(300px, .8fr) minmax(360px, 1.2fr); gap: 34px; align-items: center; }
.equipment-research-image { min-width: 0; }
.equipment-research-image > img { display: block; width: 100%; max-height: 390px; object-fit: contain; border: 1px solid var(--line); border-radius: 16px; background: white; }
.equipment-research-image > p { margin: 9px 0 0; color: var(--muted); font-size: .8rem; }
.equipment-image-placeholder { display: grid; min-height: 280px; place-content: center; gap: 8px; padding: 25px; border: 2px dashed #9ebfb5; border-radius: 16px; background: #edf5f0; color: var(--muted); text-align: center; }
.equipment-image-placeholder strong { color: var(--ink); font: 500 1.5rem Georgia, serif; }
.research-progress { display: inline-flex; gap: 8px; align-items: baseline; margin-top: 15px; padding: 10px 14px; border-radius: 999px; background: #e0ede8; color: var(--green); }
.research-progress strong { font-size: 1.15rem; }
.research-checklist { display: grid; gap: 14px; }
.research-step { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 18px; padding: 22px; }
.research-step.next { border: 2px solid var(--green); box-shadow: 0 8px 24px rgba(0,127,109,.1); }
.research-step.complete { background: linear-gradient(90deg, #f1f7f3, var(--sand)); }
.research-step-number { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: #e7dcc7; color: var(--ink); font-size: 1.15rem; font-weight: 900; }
.research-step.complete .research-step-number, .research-step.next .research-step-number { background: var(--green); color: white; }
.research-step-body > p { margin: 5px 0 12px; color: var(--muted); }
.research-source-list { display: grid; gap: 9px; margin: 13px 0; }
.research-source-list > div { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.research-source-list a:not(.research-source-image) { display: grid; gap: 3px; min-width: 0; }
.research-source-list small { color: var(--muted); overflow-wrap: anywhere; }
.research-source-image { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; align-items: center; min-width: 0; }
.research-source-image img { width: 72px; height: 58px; object-fit: contain; border-radius: 7px; background: #f5f2e9; }
.research-source-image span { overflow-wrap: anywhere; }

.safety-stats { grid-template-columns: repeat(5, 1fr); }
.safety-vessel-facts { grid-template-columns: repeat(4, 1fr); }
.safety-vessel-facts > div { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.safety-vessel-facts span { display: block; margin-bottom: 4px; color: var(--muted); font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.safety-vessel-facts strong { font-size: 1.05rem; }
.safety-profile > summary { display: flex; gap: 12px; align-items: baseline; cursor: pointer; font: 500 1.65rem Georgia, serif; }
.safety-profile > form { margin-top: 24px; }
.safety-profile-grid { grid-template-columns: repeat(3, 1fr); margin: 20px 0; }
.safety-requirement-list { display: grid; gap: 16px; margin-top: 22px; }
.safety-requirement { padding: 20px; border: 1px solid var(--line); border-left: 6px solid #9aa8a3; border-radius: 16px; background: white; }
.safety-requirement.compliant { border-left-color: #2f7a63; }
.safety-requirement.due_soon { border-left-color: #bd842f; }
.safety-requirement.expired, .safety-requirement.missing { border-left-color: var(--error); }
.safety-requirement.needs_information { border-left-color: #6e7590; }
.safety-requirement.not_applicable { opacity: .72; }
.safety-requirement-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
.safety-requirement-head h3 { margin: 4px 0 0; font-size: 1.35rem; }
.status.safety-compliant { color: #285f50; background: #dcebe3; }
.status.safety-due_soon { color: #80572f; background: #f1e4cf; }
.status.safety-expired, .status.safety-missing { color: var(--error); background: #f4e0dd; }
.status.safety-needs_information { color: #4d5268; background: #e5e7ef; }
.status.safety-not_applicable { color: #625f5b; background: #e4e1dc; }
.safety-count { padding: 10px 12px; border-radius: 10px; background: var(--sand); color: var(--muted); }
.safety-linked-list { display: grid; gap: 8px; margin: 14px 0; }
.safety-linked-list > div { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(150px, auto) auto; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.safety-linked-list small, .safety-dates small { display: block; margin-top: 3px; color: var(--muted); }
.safety-dates { color: var(--ink); font-size: .86rem; }
.safety-item-actions { display: flex; gap: 6px; align-items: center; }
.safety-item-actions form { margin: 0; }
.safety-requirement-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; }
.safety-requirement-actions > a:not(.button) { color: var(--green); font-weight: 800; }

@media (max-width: 850px) {
  .site-header { padding: 14px 20px; flex-wrap: wrap; }
  .site-nav { order: 3; flex-basis: 100%; justify-content: flex-start; }
  .site-user { margin-left: auto; }
  .auth-grid, .workspace-grid, .settings-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-grid, .form-grid.three, .choice-grid, .safety-profile-grid, .safety-vessel-facts, .filter-bar, .inline-search, .detail-hero, .detail-grid, .two-column, .category-grid, .wizard-filter, .document-search, .search-result, .page-index article, .equipment-resource-layout, .equipment-profile-hero, .equipment-profile-layout, .profile-spec-grid, .resource-add-panel, .boat-location-layout, .equipment-research-summary { grid-template-columns: 1fr; }
  .fleet-stats { grid-template-columns: 1fr 1fr; }
  .vessel-grid { grid-template-columns: 1fr; }
  .section-head, .panel-head, .maintenance-record-head { align-items: flex-start; flex-direction: column; }
  .role-grid { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .private-label { display: none; }
  .pdf-viewer-toolbar { align-items: stretch; }
  .pdf-toolbar-group, .pdf-search-control { min-width: 100%; }
  .pdf-page-scroll { min-height: 420px; padding: 12px; }
  .source-choice-grid, .source-selection-card { grid-template-columns: 1fr; }
  .discovery-progress { grid-template-columns: 1fr 1fr; }
  .equipment-resource-board { position: static; }
  .equipment-installations { position: static; }
  .mini-detail-grid { grid-template-columns: 1fr; }
  .button-column { min-width: 0; }
  .boat-plan { min-height: 470px; }
  .equipment-zone-board, .equipment-zone-board.layout-catamaran, .equipment-zone-board.layout-trimaran, .equipment-zone-board.layout-custom { grid-template-columns: 1fr; }
  .vessel-layout-board, .vessel-layout-board.layout-monohull, .vessel-layout-board.layout-catamaran, .vessel-layout-board.layout-trimaran, .vessel-layout-board.layout-custom { grid-template-columns: 1fr; }
  .layout-zone-canvas { min-height: 560px; }
  .layout-zone-row { grid-template-columns: 1fr; }
  .research-step { grid-template-columns: 1fr; }
  .safety-stats { grid-template-columns: 1fr 1fr; }
  .safety-linked-list > div { grid-template-columns: 1fr; }
  .safety-requirement-head, .safety-requirement-actions { align-items: flex-start; flex-direction: column; }
}
