/* Yacht Refit Asia — M/Y ALBATROS · corporate black / white / gold */
:root {
  --navy: #070809;
  --navy-2: #111315;
  --navy-3: #1b1e21;
  --gold: #d49a24;
  --gold-light: #f4bd45;
  --gold-dim: rgba(244, 189, 69, 0.15);
  --sand: #f1eee7;
  --cream: #ffffff;
  --white: #ffffff;
  --muted: #a4a6a8;
  --text: #f5f5f3;
  --text-dim: #c0c1bf;
  --done: #3dba7a;
  --progress: #f0b429;
  --upcoming: #6b849c;
  --danger: #e85d5d;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --mono: "SF Mono", "Cascadia Code", "Consolas", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--navy);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(244, 189, 69, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(27, 30, 33, 0.72), transparent);
}

a { color: var(--gold-light); text-decoration: none; }
a:hover { text-decoration: underline; }
.site-link { color: var(--gold-light); font-weight: 650; }
.site-link:hover { color: var(--gold-light); text-decoration: underline; }

.app-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(7, 8, 9, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(244, 189, 69, 0.28);
  padding: 0.75rem 1.25rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.brand-logo-link { display: block; flex-shrink: 0; }
.brand-logo-link:hover { text-decoration: none; }
.brand-mark {
  width: 84px; height: auto; aspect-ratio: 1810 / 647;
  object-fit: contain; object-position: center; background: transparent;
  display: block; flex-shrink: 0;
}
.brand h1 {
  margin: 0; font-size: 1rem; font-weight: 650; letter-spacing: 0.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand .sub { font-size: 0.75rem; color: var(--muted); margin: 0; }
.brand-site-link { display: inline-block; margin-top: 0.12rem; font-size: 0.72rem; }

.nav {
  display: flex; gap: 0.25rem; flex-wrap: wrap; margin-left: auto;
}
.nav button {
  appearance: none; border: none; cursor: pointer;
  background: transparent; color: var(--text-dim);
  padding: 0.45rem 0.75rem; border-radius: 8px;
  font-size: 0.8125rem; font-weight: 550; font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.nav button:hover { background: var(--gold-dim); color: var(--text); }
.nav button.active {
  background: var(--gold); color: var(--navy); font-weight: 650;
}
.nav button.nav-refresh { white-space: nowrap; }
.nav button.nav-refresh .nav-refresh-icon { display: inline-block; }
.nav button.nav-refresh.is-busy { opacity: 0.8; cursor: progress; background: var(--gold-dim); color: var(--text); }
.nav button.nav-refresh.is-busy .nav-refresh-icon { animation: navRefreshSpin 0.9s linear infinite; }
@keyframes navRefreshSpin { to { transform: rotate(360deg); } }

main { max-width: 1120px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.view { display: none; animation: fadeIn 0.25s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.hero {
  display: grid; gap: 1.25rem;
  grid-template-columns: 1fr;
  margin-bottom: 1.5rem;
}
@media (min-width: 800px) {
  .hero { grid-template-columns: 1.4fr 1fr; align-items: stretch; }
}

.card {
  background: var(--navy-2);
  border: 1px solid rgba(138, 160, 181, 0.15);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
}
.card h2 {
  margin: 0 0 0.75rem; font-size: 1.05rem; font-weight: 650;
  color: var(--sand); letter-spacing: 0.01em;
}
.card h3 { margin: 1rem 0 0.5rem; font-size: 0.9rem; color: var(--gold-light); }

.eyebrow {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--gold-light); font-weight: 650; margin: 0 0 0.35rem;
}
.yacht-name { font-size: 1.75rem; font-weight: 700; margin: 0 0 0.25rem; letter-spacing: 0.02em; }
.vessel-history { margin: -0.1rem 0 0.45rem; font-size: 0.8rem; color: var(--muted); }

.project-title { color: var(--text-dim); margin: 0 0 1rem; font-size: 0.95rem; }

.meta-row {
  display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem;
  font-size: 0.85rem; color: var(--text-dim);
}
.meta-row strong { color: var(--text); font-weight: 600; }

.pct-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem;
  margin: 1rem 0;
}
@media (max-width: 520px) { .pct-grid { grid-template-columns: 1fr; } }
.pct-tile {
  background: var(--navy-3); border-radius: 10px; padding: 0.85rem;
  text-align: center; border: 1px solid rgba(244, 189, 69, 0.12);
}
.pct-tile .num {
  font-size: 1.75rem; font-weight: 700; color: var(--gold-light);
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.pct-tile .num.num-notstarted { color: var(--muted); }
.pct-tile .lbl { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 0.25rem; }

.progress-bar {
  height: 8px; background: rgba(0,0,0,0.35); border-radius: 999px; overflow: hidden; margin-top: 0.5rem;
}
.progress-bar > span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transition: width 0.6s ease;
}

.locks { display: grid; gap: 0.65rem; }
.lock {
  display: grid; grid-template-columns: auto 1fr; gap: 0.75rem; align-items: start;
  padding: 0.75rem; background: rgba(0,0,0,0.2); border-radius: 10px;
  border-left: 3px solid var(--gold);
}
.lock .icon {
  width: 28px; height: 28px; border-radius: 8px; background: var(--gold-dim);
  display: grid; place-items: center; font-size: 0.85rem; color: var(--gold-light);
}
.lock strong { display: block; font-size: 0.875rem; }
.lock p { margin: 0.15rem 0 0; font-size: 0.8rem; color: var(--text-dim); }

.highlights { display: grid; gap: 0.5rem; margin-top: 0.5rem; }
.hl {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 0.65rem 0.75rem; border-radius: 8px; background: rgba(0,0,0,0.18);
}
.badge {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 0.2rem 0.45rem; border-radius: 4px; white-space: nowrap; flex-shrink: 0;
}
.badge.done { background: rgba(61, 186, 122, 0.2); color: var(--done); }
.badge.in-progress { background: rgba(240, 180, 41, 0.2); color: var(--progress); }
.badge.upcoming { background: rgba(107, 132, 156, 0.25); color: var(--muted); }
.badge.not-started { background: rgba(107, 132, 156, 0.25); color: var(--muted); }
.badge.docs-ready { background: rgba(244, 189, 69, 0.2); color: var(--gold-light); }
.hl .txt strong { display: block; font-size: 0.85rem; }
.hl .txt span { font-size: 0.78rem; color: var(--text-dim); }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1rem;
}
.section-head h2 { margin: 0; font-size: 1.35rem; color: var(--sand); }
.section-head p { margin: 0; color: var(--muted); font-size: 0.85rem; }

.filters {
  display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem;
}
.filters button, .chip {
  appearance: none; border: 1px solid rgba(138, 160, 181, 0.25);
  background: transparent; color: var(--text-dim);
  padding: 0.35rem 0.7rem; border-radius: 999px; font-size: 0.75rem;
  cursor: pointer; font-family: inherit; font-weight: 550;
}
.filters button.active, .chip.active {
  background: var(--gold-dim); border-color: var(--gold); color: var(--gold-light);
}


/* List search (Documents / Gallery / Financials) — full-width, high-contrast */
.list-toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.85rem;
  margin-bottom: 1.15rem;
}
.list-toolbar .filters {
  margin-bottom: 0;
  flex: none;
}
.view-search {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  width: 100%;
  max-width: none;
  flex: none;
  min-width: 0;
}
.view-search-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-light);
}
.view-search input[type="search"] {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 0.9rem 1.15rem;
  border-radius: 10px;
  border: 2px solid var(--gold);
  background: var(--navy-3);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  outline: none;
  box-shadow: 0 0 0 3px var(--gold-dim);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.view-search input[type="search"]::placeholder {
  color: var(--text-dim);
  opacity: 1;
}
.view-search input[type="search"]:focus {
  border-color: var(--gold-light);
  background: #22262a;
  box-shadow: 0 0 0 4px rgba(244, 189, 69, 0.28);
}
.view-search input[type="search"]::-webkit-search-cancel-button {
  cursor: pointer;
  filter: invert(0.85);
}
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1.75rem 0.75rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
@media (max-width: 600px) {
  .list-toolbar { gap: 0.75rem; }
  .view-search input[type="search"] {
    padding: 0.95rem 1rem;
    font-size: 1.05rem;
  }
}

.wbs-block { margin-bottom: 1.25rem; }
.wbs-block > .head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.75rem 1rem; background: var(--navy-3); border-radius: 10px 10px 0 0;
  border: 1px solid rgba(138, 160, 181, 0.12); border-bottom: none;
}
.wbs-block > .head h3 { margin: 0; font-size: 0.95rem; color: var(--sand); }
.task-list {
  list-style: none; margin: 0; padding: 0;
  border: 1px solid rgba(138, 160, 181, 0.12); border-radius: 0 0 10px 10px;
  overflow: hidden; background: var(--navy-2);
}
.task {
  display: grid; grid-template-columns: 4.5rem 1fr auto; gap: 0.5rem 0.75rem;
  padding: 0.7rem 1rem; border-bottom: 1px solid rgba(138, 160, 181, 0.08);
  align-items: center; font-size: 0.85rem;
}
.task:last-child { border-bottom: none; }
.task.current {
  background: linear-gradient(90deg, rgba(240, 180, 41, 0.12), transparent);
  box-shadow: inset 3px 0 0 var(--progress);
}
.task .wbs-id { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.task .name { font-weight: 550; }
.task .note { display: block; font-size: 0.75rem; color: var(--text-dim); font-weight: 400; margin-top: 0.15rem; }
.task .dates { font-size: 0.72rem; color: var(--muted); white-space: nowrap; }
.task .right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem; }
@media (max-width: 600px) {
  .task { grid-template-columns: 3.2rem 1fr; }
  .task .right { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; width: 100%; }
}

.timeline { position: relative; padding-left: 1.25rem; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 0.25rem; bottom: 0.25rem;
  width: 2px; background: linear-gradient(var(--gold), var(--navy-3));
}
.tl-period { margin-bottom: 1.5rem; }
.tl-period h3 {
  margin: 0 0 0.75rem; font-size: 0.85rem; color: var(--gold-light);
  position: relative; padding-left: 0.25rem;
}
.tl-period h3::before {
  content: ""; position: absolute; left: -1.15rem; top: 0.35rem;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim);
}
.tl-item {
  position: relative; margin-bottom: 0.55rem; padding: 0.65rem 0.85rem;
  background: var(--navy-2); border-radius: 8px;
  border: 1px solid rgba(138, 160, 181, 0.1);
}
.tl-item.milestone { border-color: rgba(244, 189, 69, 0.35); }
.tl-item.today { border-color: var(--progress); background: rgba(240, 180, 41, 0.08); }
.tl-item .when { font-size: 0.72rem; color: var(--muted); font-family: var(--mono); }
.tl-item .yacht-tag {
  display: inline-block; font-size: 0.65rem; font-weight: 700;
  padding: 0.1rem 0.4rem; border-radius: 3px; margin-left: 0.4rem;
  background: var(--gold-dim); color: var(--gold-light);
}
.tl-item .yacht-tag.yersin { background: rgba(168, 184, 200, 0.15); color: var(--sand); }
.tl-item .event { margin: 0.2rem 0 0; font-size: 0.875rem; }

.doc-grid {
  display: grid; gap: 0.65rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.doc-card {
  background: var(--navy-2); border: 1px solid rgba(138, 160, 181, 0.12);
  border-radius: 10px; padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem;
  transition: border-color 0.15s, transform 0.15s;
}
.doc-card:hover { border-color: rgba(244, 189, 69, 0.35); transform: translateY(-1px); }
.doc-card .cat { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold-light); font-weight: 650; }
.doc-card h4 { margin: 0; font-size: 0.9rem; font-weight: 600; line-height: 1.35; }
.doc-card .meta { font-size: 0.75rem; color: var(--muted); }
.doc-card .note { font-size: 0.75rem; color: var(--progress); margin: 0; }
.doc-card .actions { margin-top: auto; padding-top: 0.5rem; }
.btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.4rem 0.75rem; border-radius: 6px; font-size: 0.8rem; font-weight: 600;
  background: var(--gold); color: var(--navy); border: none; cursor: pointer;
  font-family: inherit; text-decoration: none;
}
.btn:hover { background: var(--gold-light); text-decoration: none; color: var(--navy); }
.btn.ghost {
  background: transparent; color: var(--text-dim);
  border: 1px solid rgba(138, 160, 181, 0.3);
}
.btn.ghost:hover { border-color: var(--gold); color: var(--gold-light); }
.btn:disabled, .btn.disabled {
  opacity: 0.55; cursor: not-allowed; pointer-events: none;
}

/* .gallery-filters margin is handled by .list-toolbar */
.photo-grid {
  display: grid; gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.photo-card {
  position: relative; border-radius: 10px; overflow: hidden;
  background: var(--navy-3); aspect-ratio: 4/3; cursor: pointer;
  border: 1px solid rgba(138, 160, 181, 0.1);
}
.photo-card img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.3s;
}
.photo-card:hover img { transform: scale(1.04); }
.photo-card .cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 1.5rem 0.5rem 0.45rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  font-size: 0.7rem; color: var(--cream);
}
.photo-card .cap strong { display: block; font-size: 0.75rem; }
.photo-card .cap .cap-date { display: block; font-size: 0.68rem; opacity: 0.75; margin-top: 0.1rem; }

.lightbox {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(5, 8, 10, 0.94); align-items: center; justify-content: center;
  padding: 1rem; flex-direction: column; gap: 0.75rem;
}
.lightbox.open { display: flex; }
/* Closed lightbox must not paint over PDF iframe (iOS/WebKit compositor leak) */
.lightbox:not(.open) {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
  z-index: -1 !important;
}
.lightbox:not(.open) *,
.lightbox:not(.open) .lb-cap,
.lightbox:not(.open) img {
  visibility: hidden !important;
  pointer-events: none !important;
}
.lightbox img {
  max-width: min(96vw, 1000px); max-height: 78vh;
  border-radius: 8px; box-shadow: var(--shadow);
}
.lightbox .lb-cap { color: var(--sand); font-size: 0.9rem; text-align: center; max-width: 90vw; }
.lightbox .lb-close,
.doc-viewer .dv-close {
  position: absolute;
  top: max(0.75rem, env(safe-area-inset-top, 0px));
  right: max(0.75rem, env(safe-area-inset-right, 0px));
  z-index: 5;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
  min-width: 48px; min-height: 48px;
  padding: 0.55rem 0.9rem;
  background: #0a0a0a;
  border: 2px solid var(--gold);
  color: var(--cream);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1;
  box-shadow: 0 4px 18px rgba(0,0,0,0.55);
  -webkit-tap-highlight-color: transparent;
}
.lightbox .lb-close:hover,
.doc-viewer .dv-close:hover {
  background: var(--gold);
  color: var(--navy);
  text-decoration: none;
}
.lightbox .lb-close:focus-visible,
.doc-viewer .dv-close:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}
.lb-close-x, .dv-close-x {
  font-size: 1.55rem; font-weight: 700; line-height: 1;
}
.dv-close-label { letter-spacing: 0.02em; }

/* In-app document / PDF viewer — edge-to-edge in remaining viewport under chrome */
.doc-viewer {
  display: none;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  z-index: 240;
  background: #0a0a0a;
  flex-direction: column;
  isolation: isolate;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  box-sizing: border-box;
  overflow: hidden;
}
.doc-viewer.open { display: flex; }
.doc-viewer:not(.open) {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
.doc-viewer .dv-toolbar {
  position: relative;
  flex: 0 0 auto;
  z-index: 2;
  display: flex; align-items: center; gap: 0.5rem;
  flex-wrap: nowrap;
  padding: max(0.55rem, env(safe-area-inset-top, 0px)) 3.25rem 0.55rem max(0.75rem, env(safe-area-inset-left, 0px));
  background: rgba(10, 10, 10, 0.98);
  border-bottom: 1px solid rgba(244, 189, 69, 0.35);
  min-height: 52px;
  box-sizing: border-box;
}
.doc-viewer .dv-title {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--sand);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-viewer .dv-external {
  flex: 0 0 auto;
  font-size: 0.85rem;
  padding: 0.5rem 0.9rem;
  white-space: nowrap;
}
.doc-viewer .dv-body {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  z-index: 1;
  background: #050607;
  padding: 0;
  margin: 0;
}
/* Frame + image fill the body edge-to-edge (full width + remaining height under chrome) */
.doc-viewer .dv-frame,
.doc-viewer .dv-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  min-width: 0;
  min-height: 0;
  margin: 0;
  border: 0;
  box-sizing: border-box;
  overflow: hidden;
  z-index: 1;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}
.doc-viewer .dv-frame {
  background: #111;
  display: block;
}
.doc-viewer .dv-image {
  object-fit: contain;
  object-position: center center;
  background: #050607;
  display: block;
}
/* Author display:block/absolute must not defeat [hidden] — otherwise empty img sits over PDF */
.doc-viewer .dv-image[hidden],
.doc-viewer .dv-frame[hidden],
.doc-viewer .dv-fallback[hidden] {
  display: none !important;
}
.doc-viewer .dv-fallback {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-dim);
  gap: 0.85rem;
  box-sizing: border-box;
}
.doc-viewer .dv-fallback p {
  max-width: 28rem;
  margin: 0;
}
body.viewer-open {
  overflow: hidden;
  height: 100%;
  height: 100dvh;
  overscroll-behavior: none;
}
html:has(body.viewer-open) {
  overflow: hidden;
  height: 100%;
  height: 100dvh;
}

@media (max-width: 640px) {
  .lightbox .lb-close {
    min-width: 52px; min-height: 52px;
    padding: 0.6rem 0.95rem;
    font-size: 1rem;
  }
  .doc-viewer .dv-close {
    min-width: 40px; width: 40px;
    min-height: 40px; height: 40px;
    padding: 0;
    font-size: 0;
  }
  .doc-viewer .dv-toolbar {
    padding-right: 3.25rem;
    flex-wrap: nowrap; /* keep Download on one row so body keeps height */
    gap: 0.35rem;
  }
  .doc-viewer .dv-external {
    order: unset;
    width: auto;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    font-size: 0.82rem;
    padding: 0.48rem 0.8rem;
  }
  .doc-viewer .dv-title { font-size: 0.8rem; }
}

.yacht-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.yacht-card.primary { border-color: rgba(244, 189, 69, 0.4); }
.yacht-card ul { margin: 0.5rem 0; padding-left: 1.1rem; color: var(--text-dim); font-size: 0.85rem; }
.yacht-card li { margin-bottom: 0.35rem; }
.role-pill {
  display: inline-block; font-size: 0.7rem; font-weight: 650;
  padding: 0.2rem 0.55rem; border-radius: 999px;
  background: var(--gold-dim); color: var(--gold-light); margin-bottom: 0.5rem;
}

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li {
  counter-increment: step; position: relative;
  padding: 0.85rem 0.85rem 0.85rem 3.25rem;
  margin-bottom: 0.5rem; background: rgba(0,0,0,0.18); border-radius: 10px;
}
.steps li::before {
  content: counter(step); position: absolute; left: 0.85rem; top: 0.85rem;
  width: 1.75rem; height: 1.75rem; border-radius: 50%;
  background: var(--gold); color: var(--navy); font-weight: 700;
  font-size: 0.85rem; display: grid; place-items: center;
}
.steps strong { display: block; margin-bottom: 0.15rem; }
.steps span { font-size: 0.85rem; color: var(--text-dim); }

.deck-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.75rem 0 1rem; }
.footer {
  text-align: center; padding: 1.5rem; color: var(--muted); font-size: 0.75rem;
  border-top: 1px solid rgba(138, 160, 181, 0.1); margin-top: 2rem;
}
.notice {
  font-size: 0.78rem; color: var(--muted); padding: 0.65rem 0.85rem;
  background: rgba(0,0,0,0.2); border-radius: 8px; margin-bottom: 1rem;
  border-left: 3px solid var(--gold);
}

@media (max-width: 700px) {
  .app-header { padding: 0.65rem 0.85rem; }
  .nav { width: 100%; margin-left: 0; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 0.15rem; }
  .nav button { flex-shrink: 0; font-size: 0.75rem; padding: 0.4rem 0.6rem; }
  .yacht-name { font-size: 1.4rem; }
  main { padding: 1rem 0.85rem 2.5rem; }
}

/* ── Auth gate / session ───────────────────────────────── */
body.app-locked .app-shell { display: none !important; }
body.app-authed .auth-gate { display: none !important; }

.auth-gate {
  position: fixed; inset: 0; z-index: 300;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: 1.25rem;
  overflow-y: auto;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(244, 189, 69, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(27, 30, 33, 0.78), transparent),
    #070809;
}
.auth-gate[hidden] { display: none !important; }

.auth-gate-card {
  width: 100%; max-width: 460px;
  background: #0b0c0d;
  border: 1px solid rgba(244, 189, 69, 0.36);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem 1.35rem;
  margin-block: auto;
  box-shadow: var(--shadow);
}
.auth-gate-brand {
  margin-bottom: 1.35rem;
}
.auth-gate-logo-wrap {
  width: 100%;
  padding: 0.7rem 0.45rem 0.55rem;
  margin-bottom: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  border: 1px solid rgba(244, 189, 69, 0.22);
  border-radius: 10px;
}
.auth-gate-logo {
  display: block; width: 100%; max-width: 400px; height: auto;
  aspect-ratio: 1810 / 1096; object-fit: contain; object-position: center;
  border-radius: 0; margin: 0;
  filter: drop-shadow(0 5px 16px rgba(0, 0, 0, 0.28));
}
.auth-gate-heading {
  padding: 0 0.1rem;
}
.auth-gate-brand h1 {
  margin: 0; font-size: 1.25rem; font-weight: 700; letter-spacing: 0.02em;
}
.auth-gate-sub {
  margin: 0.25rem 0 0; font-size: 0.82rem; color: var(--text-dim);
}
.auth-form { display: flex; flex-direction: column; gap: 0.35rem; }
.auth-label {
  font-size: 0.75rem; font-weight: 650; color: var(--sand);
  letter-spacing: 0.04em; text-transform: uppercase; margin-top: 0.55rem;
}
.auth-label .optional {
  text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted);
}
.auth-form input[type="email"],
.auth-form input[type="text"] {
  appearance: none;
  width: 100%;
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(138, 160, 181, 0.3);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-form input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}
.auth-error {
  margin: 0.5rem 0 0;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: rgba(232, 93, 93, 0.15);
  border: 1px solid rgba(232, 93, 93, 0.4);
  color: #ffb4b4;
  font-size: 0.82rem;
}
.auth-error[hidden] { display: none !important; }
.auth-field-error {
  margin: 0.2rem 0 0; font-size: 0.8rem; color: #ffb4b4; font-weight: 550;
}
.auth-field-error[hidden] { display: none !important; }
.auth-form input[aria-invalid="true"] { border-color: rgba(232, 93, 93, 0.7); }
.auth-submit {
  margin-top: 1rem;
  width: 100%;
  justify-content: center;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
}
.auth-gate-note {
  margin: 1.1rem 0 0;
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
}
.auth-gate-note strong { color: #efb51f; font-weight: 650; }
.auth-gate-note .site-link { display: inline-block; margin-top: 0.35rem; }

.auth-gate-terms {
  width: 100%; max-width: 460px;
  margin: 1rem auto 0;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(244, 189, 69, 0.14);
  text-align: left;
  color: var(--muted);
  opacity: 0.9;
}
.auth-gate-terms-title {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.auth-gate-terms p {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.5;
}

.auth-user-bar {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  margin-left: 0.25rem;
  font-size: 0.78rem; color: var(--text-dim);
}
.auth-user-bar[hidden] { display: none !important; }
.auth-user-info { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.auth-email { color: var(--sand); font-weight: 550; }
.auth-display-name { color: var(--text-dim); }
/* admin badge class removed — single Admin button only (#auth-admin-open) */
.auth-user-bar .btn {
  padding: 0.3rem 0.6rem; font-size: 0.72rem;
}
.auth-signout-btn {
  background: #0a0a0a !important;
  color: #f5f5f5 !important;
  border: 1px solid var(--gold) !important;
  font-weight: 650;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.auth-signout-btn:hover {
  background: var(--gold) !important;
  color: var(--navy) !important;
  border-color: var(--gold-light) !important;
}
.auth-signout-btn:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

/* Admin allowlist panel */
.admin-panel {
  position: fixed; inset: 0; z-index: 250;
  background: rgba(5, 15, 25, 0.75);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.admin-panel[hidden] { display: none !important; }
.admin-panel-card {
  width: 100%; max-width: 440px;
  background: var(--navy-2);
  border: 1px solid rgba(244, 189, 69, 0.3);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
  max-height: 90vh; overflow: auto;
  position: relative;
}
.admin-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; margin-bottom: 0.5rem;
}
.admin-panel-head h2 {
  margin: 0; font-size: 1.05rem; color: var(--sand);
}
.admin-panel .admin-close {
  position: static; width: 36px; height: 36px; flex-shrink: 0;
}
.admin-hint {
  font-size: 0.8rem; color: var(--text-dim); margin: 0 0 0.85rem;
}
.admin-site-link { margin-bottom: 0.85rem; }
.admin-hint code, .admin-check code, .admin-note code {
  font-family: var(--mono); font-size: 0.78em; color: var(--gold-light);
}
.admin-check {
  display: flex; align-items: flex-start; gap: 0.55rem;
  font-size: 0.85rem; color: var(--text);
  margin-bottom: 1rem; cursor: pointer;
}
.admin-check input { margin-top: 0.2rem; accent-color: var(--gold); }
.admin-panel-card h3 {
  margin: 0 0 0.5rem; font-size: 0.85rem; color: var(--gold-light);
}
.admin-extras {
  list-style: none; margin: 0 0 0.85rem; padding: 0;
  border: 1px solid rgba(138, 160, 181, 0.15);
  border-radius: 8px; overflow: hidden; background: rgba(0,0,0,0.18);
}
.admin-extras li {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem; padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(138, 160, 181, 0.08);
  font-size: 0.85rem;
}
.admin-extras li:last-child { border-bottom: none; }
.admin-extras .admin-empty {
  color: var(--muted); font-size: 0.8rem; justify-content: center;
}
.admin-add-form {
  display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.75rem;
}
.admin-add-form input {
  flex: 1; min-width: 160px;
  appearance: none; padding: 0.5rem 0.7rem; border-radius: 8px;
  border: 1px solid rgba(138, 160, 181, 0.3);
  background: rgba(0, 0, 0, 0.28); color: var(--text);
  font-family: inherit; font-size: 0.85rem; outline: none;
}
.admin-add-form input:focus {
  border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim);
}
.admin-note {
  margin: 0; font-size: 0.75rem; color: var(--muted);
}

/* Request-access confirmation panel */
.auth-request-panel {
  margin-top: 0.25rem;
}
.auth-request-panel[hidden] { display: none !important; }
.auth-request-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 650;
  color: var(--sand);
}
.auth-request-email-line {
  margin: 0 0 0.25rem;
  font-size: 0.88rem;
  color: var(--text-dim);
}
.auth-request-email-line strong { color: var(--gold-light); }
.auth-request-name {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.auth-success {
  margin: 0.5rem 0 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: rgba(61, 186, 122, 0.12);
  border: 1px solid rgba(61, 186, 122, 0.4);
  color: #9ee0b8;
  font-size: 0.82rem;
}
.auth-success[hidden] { display: none !important; }
.auth-request-actions {
  display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem;
}
.auth-request-actions .btn { flex: 1; min-width: 120px; justify-content: center; }

/* Single Admin button only — no gold ADMIN badge / approvals banner */
.auth-admin-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 0.35rem;
}

/* Pending list in admin panel */
.admin-pending {
  list-style: none; margin: 0 0 1rem; padding: 0;
  border: 1px solid rgba(240, 180, 41, 0.28);
  border-radius: 8px; overflow: hidden; background: rgba(0,0,0,0.18);
}
.admin-pending li {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 0.75rem; flex-wrap: wrap;
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid rgba(138, 160, 181, 0.08);
}
.admin-pending li:last-child { border-bottom: none; }
.admin-pending .admin-empty {
  color: var(--muted); font-size: 0.8rem; justify-content: center;
}
.admin-pending-meta {
  display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; flex: 1;
}
.admin-pending-email { font-size: 0.88rem; font-weight: 600; color: var(--sand); word-break: break-all; }
.admin-pending-name { font-size: 0.78rem; color: var(--text-dim); }
.admin-pending-when { font-size: 0.72rem; color: var(--muted); }
.admin-pending-actions {
  display: flex; gap: 0.4rem; flex-shrink: 0; align-items: center;
}
.admin-pending-actions .btn {
  padding: 0.35rem 0.65rem; font-size: 0.75rem;
}
.admin-approve {
  background: var(--done) !important;
  color: var(--navy) !important;
}
.admin-pending-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.2rem; height: 1.2rem; padding: 0 0.3rem;
  margin-left: 0.35rem; border-radius: 999px;
  background: rgba(240, 180, 41, 0.25); color: var(--progress);
  font-size: 0.7rem; font-weight: 700; vertical-align: middle;
}

@media (max-width: 700px) {
  .auth-user-bar {
    width: 100%; margin-left: 0;
    justify-content: space-between;
    padding-top: 0.15rem;
    border-top: 1px solid rgba(244, 189, 69, 0.18);
  }
  .auth-signout-btn {
    padding: 0.45rem 0.85rem !important;
    font-size: 0.78rem !important;
    min-height: 2.25rem;
  }
  .auth-gate-card { padding: 1.35rem 1.1rem 1.15rem; }
  .auth-gate-logo-wrap { padding-inline: 0.25rem; }
}

/* ── Password-locked Financials area ───────────────────── */
.finance-lock-wrap {
  min-height: 52vh;
  display: grid;
  place-items: center;
}
.finance-lock-card {
  width: 100%;
  max-width: 500px;
  text-align: center;
  border-color: rgba(244, 189, 69, 0.3);
}
.finance-lock-icon {
  width: 3.25rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
  margin: 0 auto 0.8rem;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1px solid rgba(244, 189, 69, 0.35);
  font-size: 1.35rem;
}
.finance-lock-card h2 { margin-bottom: 0.35rem; }
.finance-intro {
  margin: 0 0 1rem;
  color: var(--text-dim);
  font-size: 0.88rem;
}
.finance-form { display: flex; flex-direction: column; gap: 0.35rem; text-align: left; }
.finance-form input {
  appearance: none;
  width: 100%;
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(138, 160, 181, 0.3);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
}
.finance-form input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}
.finance-error {
  margin: 0.5rem 0 0;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: rgba(232, 93, 93, 0.15);
  border: 1px solid rgba(232, 93, 93, 0.4);
  color: #ffb4b4;
  font-size: 0.82rem;
}
.finance-error[hidden] { display: none !important; }
.finance-submit {
  margin-top: 0.75rem;
  justify-content: center;
  width: 100%;
}
.finance-empty { grid-column: 1 / -1; margin: 0; }
.finance-doc-grid { margin-top: 0.25rem; }

/* ── Financials: Documents / Add document modes ─────────── */
.finance-mode-tabs {
  display: inline-flex;
  gap: 0;
  margin: 0 0 1rem;
  padding: 0.2rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(244, 189, 69, 0.28);
}
.finance-mode-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  padding: 0.45rem 0.95rem;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.finance-mode-tab:hover {
  color: var(--sand);
  background: var(--gold-dim);
}
.finance-mode-tab.is-active {
  background: var(--gold);
  color: var(--navy);
}
.finance-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.finance-doc-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  justify-content: space-between;
}
.finance-device-badge {
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--navy);
  background: var(--gold-light);
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  white-space: nowrap;
}
.doc-card.finance-user-doc {
  border-color: rgba(244, 189, 69, 0.28);
}
.doc-card .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.finance-add-card {
  max-width: 560px;
  border-color: rgba(244, 189, 69, 0.28);
}
.finance-add-form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: left;
}
.finance-add-form input[type="text"],
.finance-add-form input[type="date"],
.finance-add-form input[type="file"],
.finance-add-form select,
.finance-add-form textarea {
  appearance: none;
  width: 100%;
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(138, 160, 181, 0.3);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
}
.finance-add-form textarea {
  resize: vertical;
  min-height: 4.5rem;
  line-height: 1.45;
}
.finance-add-form select {
  cursor: pointer;
}
.finance-add-form input:focus,
.finance-add-form select:focus,
.finance-add-form textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}
.finance-add-form input[type="file"] {
  padding: 0.5rem 0.65rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.finance-add-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}
.finance-add-notice {
  max-width: 640px;
}

.finance-folder-extra {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.15rem 0 0.25rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px dashed rgba(244, 189, 69, 0.35);
  background: rgba(244, 189, 69, 0.06);
}
.finance-folder-extra[hidden] { display: none !important; }
.finance-field-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.35;
}
.finance-folder-meta {
  font-size: 0.78rem;
  color: var(--muted);
  word-break: break-all;
}
.finance-add-form optgroup {
  color: var(--gold);
  font-weight: 650;
}
.photo-device-badge {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--navy);
  background: var(--gold-light);
  border-radius: 999px;
  padding: 0.12rem 0.4rem;
  vertical-align: middle;
}
.photo-card.photo-user {
  outline: 1px solid rgba(244, 189, 69, 0.35);
}

@media (max-width: 700px) {
  .finance-mode-tabs { width: 100%; }
  .finance-mode-tab { flex: 1; text-align: center; }
  .finance-head-actions { width: 100%; }
  .finance-head-actions .btn { flex: 1; justify-content: center; }
}


/* Document / PDF / Word viewer: discreet × close only — no labeled Return chrome */
.doc-viewer .dv-close {
  min-width: 40px;
  width: 40px;
  min-height: 40px;
  height: 40px;
  padding: 0;
  font-size: 0;
  background: rgba(10, 10, 10, 0.85) !important;
  color: var(--cream) !important;
  border: 1px solid rgba(244, 189, 69, 0.8) !important;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.45);
}
.doc-viewer .dv-close:hover {
  background: rgba(244, 189, 69, 0.92) !important;
  color: var(--navy) !important;
}
.doc-viewer .dv-close-label {
  display: none !important;
}
.doc-viewer .dv-close-x {
  display: block;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
}
.doc-viewer .dv-footer,
.doc-viewer .dv-return-bar,
.doc-viewer .dv-fallback-return {
  display: none !important;
}
.doc-viewer .dv-toolbar {
  padding-right: 3.25rem;
  flex-wrap: nowrap;
}
/* Download = primary action in viewer chrome (solid gold, dark text) */
.doc-viewer .dv-external,
.doc-viewer .btn.dv-external,
.doc-viewer .btn.ghost.dv-external {
  flex: 0 0 auto;
  background: var(--gold) !important;
  color: var(--navy) !important;
  border: 2px solid var(--gold-light) !important;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
  -webkit-tap-highlight-color: transparent;
}
.doc-viewer .dv-external:hover,
.doc-viewer .btn.dv-external:hover,
.doc-viewer .btn.ghost.dv-external:hover {
  background: var(--gold-light) !important;
  color: var(--navy) !important;
  text-decoration: none;
}
@media (max-width: 640px) {
  .doc-viewer .dv-close {
    min-width: 40px;
    width: 40px;
    min-height: 40px;
    height: 40px;
    padding: 0;
  }
  .doc-viewer .dv-toolbar {
    padding-right: 3.25rem;
    flex-wrap: nowrap;
  }
  .doc-viewer .dv-external,
  .doc-viewer .btn.dv-external {
    max-width: none;
    font-size: 0.82rem;
    padding: 0.48rem 0.8rem;
  }
}


/* Photo lightbox: compact × close control. */
.lightbox {
  justify-content: flex-start;
  padding: 0;
  gap: 0;
}
.lightbox .lb-body {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 4.5rem 0.75rem 0.75rem;
  box-sizing: border-box;
}
.lightbox img {
  max-width: min(96vw, 1000px);
  max-height: min(70vh, calc(100dvh - 4.5rem));
}
.lightbox .lb-close {
  min-width: 40px;
  width: 40px;
  min-height: 40px;
  height: 40px;
  padding: 0;
  font-size: 0;
  background: rgba(10, 10, 10, 0.85) !important;
  color: var(--cream) !important;
  border: 1px solid rgba(244, 189, 69, 0.8) !important;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.45);
}
.lightbox .lb-close:hover {
  background: rgba(244, 189, 69, 0.92) !important;
  color: var(--navy) !important;
}
.lightbox .lb-close-x {
  display: block;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
}


/* Documents filter chips — collapse long row on mobile */
.doc-filters-more {
  align-self: flex-start;
  margin-top: -0.35rem;
  margin-bottom: 0.5rem;
  font-size: 0.78rem;
  padding: 0.3rem 0.75rem;
}
@media (max-width: 700px) {
  #doc-filters.doc-filters[data-collapsed="1"] {
    max-height: 2.55rem;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  }
  #doc-filters.doc-filters.is-expanded,
  #doc-filters.doc-filters[data-collapsed="0"] {
    max-height: none;
    overflow: visible;
    mask-image: none;
    -webkit-mask-image: none;
  }
}
.photo-card img.img-broken,
.lightbox img.img-broken,
.doc-viewer .dv-image.img-broken {
  object-fit: contain;
  background: #1a1f26;
}


/* Shore D mapped/test images: keep annotated drawings edge-to-edge with only a small × dismiss control. */
.doc-viewer.shore-d-image .dv-toolbar {
  position: absolute;
  inset: 0;
  height: 0;
  min-height: 0;
  padding: 0;
  background: transparent;
  border: 0;
  pointer-events: none;
}
.doc-viewer.shore-d-image .dv-title,
.doc-viewer.shore-d-image .dv-external,
.doc-viewer.shore-d-image .dv-footer {
  display: none !important;
}
.doc-viewer.shore-d-image .dv-close {
  min-width: 40px;
  width: 40px;
  min-height: 40px;
  height: 40px;
  padding: 0;
  font-size: 0;
  background: rgba(10, 10, 10, 0.72) !important;
  border: 1px solid rgba(244, 189, 69, 0.8) !important;
  color: var(--cream) !important;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}
.doc-viewer.shore-d-image .dv-close:hover {
  background: rgba(244, 189, 69, 0.92) !important;
  color: var(--navy) !important;
}
.doc-viewer.shore-d-image .dv-close-label,
.doc-viewer.shore-d-image .dv-return-bar {
  display: none !important;
}
.doc-viewer.shore-d-image .dv-close-x {
  display: block;
  font-size: 1.45rem;
}

button.pct-tile-link { font: inherit; color: inherit; cursor: pointer; width: 100%; transition: border-color 0.15s, transform 0.15s; }
button.pct-tile-link:hover, button.pct-tile-link:focus-visible { border-color: rgba(244, 189, 69, 0.55); transform: translateY(-1px); }
.hd-sec { margin: 1.25rem 0 0.6rem; font-size: 0.95rem; color: var(--sand); }

/* Financials — index by subject */
.finance-subject-index {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(244, 189, 69, 0.28);
  border-radius: var(--radius);
  padding: 0.85rem 1rem 1rem;
  margin-bottom: 1.25rem;
  scroll-margin-top: 5rem;
}
.finance-subject-index-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.5rem; margin-bottom: 0.65rem;
}
.finance-subject-index h3 { margin: 0; font-size: 1rem; color: var(--sand); }
.finance-subject-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.finance-subject-chip {
  display: inline-flex; align-items: center; gap: 0.45rem;
  min-height: 2.4rem; padding: 0.4rem 0.8rem; font-size: 0.82rem; text-align: left;
}
.finance-subject-all { min-height: 2.2rem; padding: 0.35rem 0.85rem; font-size: 0.8rem; }
.finance-subject-count, .finance-subject-heading-count {
  font-size: 0.7rem; font-weight: 700; line-height: 1;
  color: var(--navy); background: var(--gold-light);
  border-radius: 999px; padding: 0.18rem 0.5rem; min-width: 1.4rem; text-align: center;
}
.finance-subject-chip.active .finance-subject-count { background: var(--gold); }
.finance-subject-group { margin-bottom: 1.5rem; scroll-margin-top: 5rem; }
.finance-subject-heading {
  display: flex; align-items: center; gap: 0.5rem;
  margin: 0 0 0.6rem; padding-bottom: 0.4rem; font-size: 1.05rem; color: var(--gold-light);
  border-bottom: 1px solid rgba(244, 189, 69, 0.28);
}
@media (max-width: 700px) {
  .finance-subject-chip { flex: 1 1 calc(50% - 0.45rem); justify-content: space-between; }
  .finance-subject-index { padding: 0.75rem; }
}

/* ── Professional sign-in (matches Paint Inspector) ── */
.auth-gate { padding: 0; align-items: stretch; justify-content: stretch; background: #05090f; }
.ag-shell { display: flex; flex-shrink: 0; width: 100%; min-height: 100%; }
.ag-brand {
  flex: 0 0 42%; display: flex; flex-direction: column; justify-content: space-between;
  padding: 3rem; color: #fff;
  background: linear-gradient(160deg, rgba(244,189,69,0.10), transparent 45%), linear-gradient(180deg, #0c1421, #05090f);
  border-right: 1px solid rgba(244,189,69,0.35);
}
.ag-logo { height: 96px; width: auto; max-width: 380px; object-fit: contain; align-self: flex-start; }
.ag-eyebrow { margin: 0 0 0.6rem; font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; color: #f4bd45; font-weight: 600; }
.ag-brand h1 { margin: 0 0 1rem; font-size: 2.4rem; line-height: 1.1; font-weight: 650; letter-spacing: -0.01em; }
.ag-tagline { margin: 0; max-width: 24rem; font-size: 0.98rem; line-height: 1.55; color: #9fb0c2; }
.ag-est { margin: 0; font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: #9fb0c2; }
.ag-panel { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2.5rem 1.5rem; background: #070b12; }
.ag-card { width: 100%; max-width: 400px; padding: 2rem 1.9rem 1.6rem; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; box-shadow: 0 18px 50px rgba(0,0,0,0.35); }
.ag-title { margin: 0 0 0.3rem; font-size: 1.45rem; font-weight: 650; color: #fff; }
.ag-sub { margin: 0 0 1.2rem; font-size: 0.85rem; color: #9fb0c2; line-height: 1.45; }
.ag-card .auth-label { font-size: 0.7rem; letter-spacing: 0.08em; color: #9fb0c2; }
.ag-card .auth-submit { margin-top: 1.1rem; padding: 0.8rem 1rem; font-weight: 650; letter-spacing: 0.03em; }
.ag-consent { margin: 1rem 0 0; font-size: 0.72rem; line-height: 1.45; color: #9fb0c2; text-align: center; }
.ag-terms { width: 100%; max-width: 400px; margin: 1.1rem 0 0; font-size: 0.72rem; line-height: 1.5; color: #9fb0c2; }
.ag-terms-title { margin: 0; text-align: center; color: #f4bd45; font-size: 0.75rem; font-weight: 400; letter-spacing: 0.04em; padding: 0.3rem; }
.ag-terms-text { margin: 0.6rem 0 0; text-align: left; }
.ag-foot { max-width: 400px; margin: 1rem 0 0; font-size: 0.68rem; line-height: 1.5; color: #9fb0c2; text-align: center; }
@media (max-width: 899px) {
  .ag-shell { flex-direction: column; }
  .ag-brand { flex: 0 0 auto; padding: 1.75rem 1.5rem 1.5rem; gap: 1rem; border-right: none; border-bottom: 1px solid rgba(244,189,69,0.35); }
  .ag-logo { height: 64px; }
  .ag-brand h1 { font-size: 1.6rem; margin-bottom: 0.5rem; }
  .ag-tagline { font-size: 0.85rem; }
  .ag-est { display: none; }
  .ag-panel { justify-content: flex-start; padding: 1.5rem 1.15rem calc(1.5rem + env(safe-area-inset-bottom, 0px)); }
}
/* Desktop / wide (>= 900px): pixel copy of the Paint Inspector sign-in
   (root font 15px there, so rem values are converted to px here) */
@media (min-width: 900px) {
  .auth-gate {
    background: radial-gradient(ellipse at 30% 20%, rgba(255,193,7,0.06), transparent 50%), #141C2B;
    font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
    line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-y: auto;
  }
  .ag-shell { min-height: 100%; }
  .ag-brand {
    flex: 0 0 52%; position: relative; overflow: hidden; background: #011a49;
    padding: 45px 45px 33.75px; border-right: 1px solid rgba(255,193,7,0.35); color: #fff;
  }
  .ag-brand::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: url("../img/gate-hero-v2.jpg?_ship=vnm558t") 70% center / cover no-repeat;
  }
  .ag-brand::after {
    content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background: linear-gradient(90deg, rgba(1,26,73,0.55) 0%, rgba(1,26,73,0) 55%);
  }
  .ag-brand > * { position: relative; z-index: 1; }
  .ag-logo { height: 96px; width: auto; max-width: 380px; object-fit: contain; align-self: flex-start; }
  .ag-brand-copy { margin: 0; }
  .ag-eyebrow { margin: 0 0 9px; font-size: 10.8px; letter-spacing: 0.22em; text-transform: uppercase; color: #FFC107; font-weight: 600; line-height: 1.5; }
  .ag-brand h1 { margin: 0 0 15px; font-size: 36px; line-height: 1.1; font-weight: 650; letter-spacing: -0.01em; color: #fff; text-shadow: none; }
  .ag-tagline { margin: 0; max-width: 360px; font-size: 14.7px; line-height: 1.55; color: #8B9BB0; text-shadow: none; }
  .ag-est { margin: 0; font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: #8B9BB0; line-height: 1.5; }
  .ag-panel { flex: 1; background: #141C2B; padding: 37.5px 22.5px; }
  .ag-card {
    width: 100%; max-width: 400px; padding: 30px 28.5px 24px;
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px; box-shadow: 0 18px 50px rgba(0,0,0,0.35);
  }
  .ag-title {
    margin: 0 0 4.5px; font-size: 21.75px; font-weight: 650; color: #fff; line-height: 1.5;
    padding-bottom: 5.25px; border-bottom: 1px solid rgba(255,255,255,0.14); letter-spacing: 0.01em;
  }
  .ag-sub { margin: 0 0 21px; font-size: 12.75px; color: #8B9BB0; line-height: 1.45; }
  .ag-card .auth-form { gap: 0; }
  .ag-card .auth-label {
    display: block; margin: 0 0 4.5px; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
    color: #8B9BB0; font-weight: 550; line-height: 1.5;
  }
  .ag-card .auth-label span { color: #FFC107; }
  .ag-card .auth-field-error + .auth-label { margin-top: 14.25px; }
  .ag-card .auth-form input[type="text"],
  .ag-card .auth-form input[type="email"] {
    width: 100%; padding: 6.75px 9.75px; margin: 0 0 10.5px; font-size: 13.5px; line-height: normal;
    background: #141C2B; border: 1px solid rgba(255,255,255,0.14); color: #F5F7FA; border-radius: 4px;
  }
  .ag-card .auth-form input:focus { border-color: #FFC107; box-shadow: 0 0 0 2px rgba(255,193,7,0.12); }
  .ag-card .auth-form input[aria-invalid="true"] { border-color: rgba(232,93,93,0.7); }
  .ag-card .auth-submit {
    width: 100%; margin-top: 20.25px; padding: 12px 15px; font-size: 12.3px; font-weight: 650; letter-spacing: 0.03em;
    background: #FFC107; color: #1B263B; border: 1px solid #FFC107; border-radius: 4px; justify-content: center; line-height: 1.5;
  }
  .ag-card .auth-submit:hover { background: #E6AC00; border-color: #E6AC00; color: #1B263B; }
  .ag-consent { margin: 15px 0 0; font-size: 10.8px; line-height: 1.45; color: #8B9BB0; text-align: center; }
  .ag-terms { width: 100%; max-width: 400px; margin: 16.5px 0 0; padding: 0; border: none; font-size: 10.8px; line-height: 1.5; color: #8B9BB0; }
  .ag-terms-title { margin: 0; text-align: center; color: #FFC107; font-size: 11.25px; font-weight: 400; letter-spacing: 0.04em; padding: 4.5px; line-height: 1.5; }
  .ag-terms-text { margin: 9px 0 0; text-align: left; }
  .ag-foot { max-width: 400px; margin: 15px 0 0; font-size: 10.2px; line-height: 1.5; color: #8B9BB0; opacity: 0.8; text-align: center; }
}


/* Photo viewer navigation: prev/next arrows, counter, swipe surface (shared lightbox). */
.lightbox { touch-action: pan-y pinch-zoom; }
.lightbox .lb-body img { -webkit-user-drag: none; user-select: none; will-change: transform; }
.lightbox .lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 84px;
  padding: 0 0 0.25rem;
  background: rgba(10, 10, 10, 0.45);
  color: var(--cream);
  border: 1px solid rgba(244, 189, 69, 0.55);
  border-radius: 14px;
  font-family: inherit;
  font-size: 3rem; line-height: 1; font-weight: 300;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.lightbox .lb-nav[hidden] { display: none; }
.lightbox .lb-prev { left: max(0.5rem, env(safe-area-inset-left, 0px)); }
.lightbox .lb-next { right: max(0.5rem, env(safe-area-inset-right, 0px)); }
.lightbox .lb-nav:hover:not(:disabled) { background: rgba(244, 189, 69, 0.85); color: var(--navy); }
.lightbox .lb-nav:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 2px; }
.lightbox .lb-nav:disabled { opacity: 0.2; cursor: default; }
.lightbox .lb-count {
  position: absolute;
  top: max(0.75rem, env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  min-height: 40px;
  display: inline-flex; align-items: center;
  padding: 0 0.9rem;
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.6);
  color: var(--cream);
  font-size: 0.95rem; font-weight: 600;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.lightbox .lb-count[hidden] { display: none; }
.lightbox .lb-count.lb-count-days {
  flex-direction: column; justify-content: center; gap: 0.05rem;
  padding: 0.3rem 0.9rem; border-radius: 16px; text-align: center; white-space: nowrap;
  max-width: calc(100vw - 8rem);
}
.lightbox .lb-count-days .lb-count-sub { font-size: 0.72rem; font-weight: 500; opacity: 0.85; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.lightbox.lb-large img {
  max-width: 100vw;
  max-height: calc(100dvh - 7.5rem);
}
@media (max-width: 640px) {
  .lightbox .lb-nav { width: 44px; height: 72px; font-size: 2.6rem; }
}

/* Weekly Photo Pages (Daily work, from 20261006c): one tall report page per week.
   Viewer shows the page full-width and scrolls vertically; pinch to zoom. Grid card shows the page header. */
.photo-card.photo-weekly img { object-position: center top; }
.lightbox.lb-page .lb-body {
  justify-content: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 4.25rem 0 1rem;
}
.lightbox.lb-page img {
  flex: 0 0 auto;
  width: min(100%, 1100px);
  max-width: 100%;
  height: auto;
  max-height: none;
  border-radius: 0;
}
.lightbox.lb-page .lb-cap { flex: 0 0 auto; padding: 0 0.75rem 0.5rem; }
