* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: #f4f5f7;
  color: #1a1a1a;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
#app {
  flex: 1 0 auto;
}
body.splash-active {
  overflow: hidden;
}
body.splash-active .topbar,
body.splash-active #app {
  opacity: 0;
  pointer-events: none;
}
.topbar,
#app {
  transition: opacity 1.1s ease;
}

/* Cloud host: don't show reports workspace until signed in */
body.auth-required #app {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}
body.auth-required .topbar-report-actions,
body.auth-required #main-nav,
body.auth-required #btn-back {
  display: none !important;
}

/* Splash screen */
.splash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  background: #0c0c0c;
  color: #fff;
  opacity: 1;
  transition: opacity 1.1s ease;
  overflow: hidden;
}
.splash::before {
  content: "";
  position: absolute;
  inset: -20%;
  background-color: #101010;
  background-image:
    repeating-linear-gradient(
      90deg,
      #101010 0 28px,
      #0b4d99 28px 32px,
      #f2f2f2 32px 33px,
      #1a6b32 33px 62px,
      #f2f2f2 62px 63px,
      #101010 63px 96px,
      #0b4d99 96px 100px,
      #f2f2f2 100px 101px,
      #1a6b32 101px 130px,
      #f2f2f2 130px 131px,
      #101010 131px 160px
    ),
    repeating-linear-gradient(
      0deg,
      #101010 0 28px,
      #0b4d99 28px 32px,
      #f2f2f2 32px 33px,
      #1a6b32 33px 62px,
      #f2f2f2 62px 63px,
      #101010 63px 96px,
      #0b4d99 96px 100px,
      #f2f2f2 100px 101px,
      #1a6b32 101px 130px,
      #f2f2f2 130px 131px,
      #101010 131px 160px
    );
  background-blend-mode: multiply;
  transform: rotate(-8deg) scale(1.15);
}
.splash::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.55) 68%, rgba(0, 0, 0, 0.78) 100%);
  pointer-events: none;
}
.splash.splash-out {
  opacity: 0;
  pointer-events: none;
}
.splash-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  min-height: 0;
}
.splash-footer {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.25rem 1rem 1.75rem;
  text-align: center;
  user-select: none;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
}
.splash-footer-logo {
  display: block;
  height: auto;
  max-width: 140px;
  opacity: 0.9;
}
.splash-footer-copy {
  margin: 0;
  font-size: 11px;
  line-height: 1.25;
  color: #362c8d;
}
.splash-footer-copy .app-version {
  font-weight: 600;
}
.splash-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.5rem 3rem;
  animation: splash-rise 0.7s ease-out both;
  background: rgba(8, 12, 18, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  backdrop-filter: blur(4px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  transition: opacity 1.1s ease, transform 1.1s ease;
}
.splash.splash-out .splash-inner {
  opacity: 0;
  transform: scale(0.96) translateY(8px);
}
.splash-mascot-wrap {
  position: relative;
  width: 240px;
  height: 240px;
  margin-bottom: 1.25rem;
}
.splash-mascot {
  width: 100%;
  height: 100%;
  border-radius: 28px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  animation: splash-mascot-float 2.8s ease-in-out infinite;
}
.splash-title {
  margin: 0;
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 800;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  animation: splash-title-glow 1.15s ease-in-out infinite;
}
.splash-tagline {
  margin: 0.65rem 0 0;
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #dbeafe;
}
@keyframes splash-rise {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes splash-mascot-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes splash-title-glow {
  0%, 72%, 100% { opacity: 1; text-shadow: 0 0 0 transparent; }
  76%, 82% { opacity: 0.78; text-shadow: 0 0 20px rgba(74, 222, 128, 0.55); }
}

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1rem;
  background: #1e293b;
  color: #fff;
}
.brand { font-weight: 700; letter-spacing: 0.05em; display: flex; align-items: center; gap: 0.45rem; }
.brand-icon { border-radius: 6px; }
.topbar-actions { margin-left: auto; display: flex; gap: 0.5rem; align-items: center; }
.topbar-report-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-right: 0.35rem;
  padding-right: 0.65rem;
  border-right: 1px solid #475569;
}
.topbar-autosave {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: #cbd5e1;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.topbar-autosave input {
  accent-color: #2563eb;
  cursor: pointer;
}
.save-status {
  font-size: 0.78rem;
  color: #94a3b8;
  min-width: 4.5rem;
  text-align: right;
}
.save-status.saving { color: #fbbf24; }
.save-status.saved { color: #86efac; }
.save-status.error { color: #fca5a5; }
.collab-lock-banner {
  font-size: 0.78rem;
  color: #fde68a;
  background: rgba(120, 53, 15, 0.45);
  border: 1px solid rgba(251, 191, 36, 0.45);
  border-radius: 6px;
  padding: 0.2rem 0.55rem;
  max-width: 22rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.collab-lock-banner.is-mine {
  color: #bbf7d0;
  background: rgba(20, 83, 45, 0.35);
  border-color: rgba(74, 222, 128, 0.4);
}
.collab-lock-banner[data-locked="1"] {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.45);
  border-color: rgba(248, 113, 113, 0.5);
}
#btn-editing-freeze {
  flex-shrink: 0;
}
#btn-editing-freeze svg {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
}
#btn-editing-freeze.is-locked {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(127, 29, 29, 0.35);
}
/* Admin freeze: members cannot edit capture, gallery, or triage */
body.editing-frozen-readonly #view-capture .capture-main,
body.editing-frozen-readonly #view-capture .capture-properties,
body.editing-frozen-readonly #view-images,
body.editing-frozen-readonly #view-triage,
body.editing-frozen-readonly #view-final {
  pointer-events: none;
  opacity: 0.72;
  filter: grayscale(0.12);
}
body.editing-frozen-readonly #view-capture .report-explorer,
body.editing-frozen-readonly #view-capture .report-explorer button,
body.editing-frozen-readonly #view-capture .report-explorer input,
body.editing-frozen-readonly #view-capture .tabs,
body.editing-frozen-readonly #view-capture .tabs button {
  pointer-events: auto;
  opacity: 1;
  filter: none;
}
/* Findings module readonly while another user holds findings:{pageId} */
#view-capture.collab-readonly .capture-main,
#view-capture.collab-readonly .capture-properties,
body.collab-findings-readonly #view-capture input,
body.collab-findings-readonly #view-capture textarea,
body.collab-findings-readonly #view-capture select,
body.collab-findings-readonly #view-capture button:not(.tab):not(.explorer-leaf):not(.btn-back),
body.collab-findings-readonly #view-capture .findings-table,
body.collab-findings-readonly #view-capture [contenteditable="true"] {
  pointer-events: none;
}
body.collab-findings-readonly #view-capture .capture-main,
body.collab-findings-readonly #view-capture .capture-properties {
  opacity: 0.72;
  filter: grayscale(0.15);
}
/* Keep visit explorer navigable so users can switch or open Gallery */
body.collab-findings-readonly #view-capture .report-explorer,
body.collab-findings-readonly #view-capture .report-explorer button,
body.collab-findings-readonly #view-capture .report-explorer input {
  pointer-events: auto;
  opacity: 1;
  filter: none;
}
.export-progress-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(1px);
}
.export-progress-overlay.hidden {
  display: none !important;
}
.export-progress-card {
  min-width: min(22rem, calc(100vw - 2rem));
  max-width: 28rem;
  padding: 1.25rem 1.5rem 1.1rem;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.export-progress-message {
  margin: 0;
  font-size: 0.95rem;
  color: #334155;
  font-weight: 500;
  text-align: center;
}
.export-progress-track {
  width: 100%;
  height: 5px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.export-progress-fill {
  height: 100%;
  width: 0;
  background: #2563eb;
  border-radius: 999px;
  transition: width 0.25s ease;
}
.topbar-cloud-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
  flex-shrink: 0;
}
.topbar-cloud-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}
.topbar-cloud-btn:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}
.topbar-cloud-btn .cloud-icon {
  width: 1.15rem;
  height: 1.15rem;
}
.topbar-cloud-btn.is-connected .cloud-icon {
  color: #4ade80;
}
.topbar-cloud-btn.is-partial .cloud-icon {
  color: #fbbf24;
}
.topbar-cloud-btn.is-disconnected .cloud-icon {
  color: #f87171;
}
.topbar-menu-wrap {
  position: relative;
}
.topbar-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 12rem;
  background: #fff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  padding: 0.35rem 0;
  z-index: 200;
}
.topbar-menu-divider {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 0.35rem 0;
}
.topbar-menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 2rem;
  text-align: left;
  background: none;
  border: none;
  padding: 0 0.85rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.2;
  color: #1e293b;
  cursor: pointer;
  box-sizing: border-box;
}
.topbar-menu-item:hover {
  background: #f1f5f9;
}
#main-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
#main-nav .tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  background: transparent;
  border: 1px solid transparent;
  color: #cbd5e1;
  padding: 0 0.85rem;
  border-radius: 7px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  box-sizing: border-box;
}
#main-nav .tab:hover {
  color: #fff;
  background: rgba(51, 65, 85, 0.55);
}
#main-nav .tab.active { background: #334155; color: #fff; border-color: #334155; }
.topbar .btn {
  min-height: 2rem;
  padding: 0 0.85rem;
  font-size: 0.85rem;
  line-height: 1.2;
  border-radius: 7px;
  box-sizing: border-box;
}
.topbar #btn-settings {
  min-width: 2rem;
  padding: 0 0.55rem;
}
.view-readonly {
  position: relative;
  pointer-events: none;
  user-select: none;
}
.view-readonly .final-report-toolbar,
.view-readonly .under-development-panel {
  pointer-events: none;
}
.under-development-panel {
  max-width: 720px;
  margin: 2rem auto;
  padding: 2rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.under-development-panel h1 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
}
.under-development-dialog {
  max-width: 360px;
  text-align: center;
}
.under-development-message {
  margin: 0.5rem 0 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #334155;
}
.under-development-dialog .btn-row {
  justify-content: center;
  margin-top: 1.25rem;
}
.view { padding: 1rem; max-width: 1600px; margin: 0 auto; }

.portal-footer {
  flex-shrink: 0;
  margin-top: auto;
  border-top: 1px solid #e2e8f0;
  background: rgba(248, 250, 252, 0.9);
  padding: 1.5rem 1rem;
  text-align: center;
  user-select: none;
}
.portal-footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.portal-footer-logo {
  display: block;
  height: auto;
  max-width: 140px;
  opacity: 0.9;
}
.settings-users-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.settings-users-table th,
.settings-users-table td {
  border-bottom: 1px solid #e2e8f0;
  padding: 0.35rem 0.5rem;
  text-align: left;
}
.settings-user-edit-input {
  width: 100%;
  min-width: 10rem;
  margin: 0;
  padding: 0.3rem 0.45rem;
  font: inherit;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-sizing: border-box;
}
.settings-users-table tr.is-editing td {
  vertical-align: middle;
}
.settings-user-add {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 24rem;
}
.settings-user-add h4 {
  margin: 0.5rem 0 0;
}
.settings-user-admin,
.settings-user-admin-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
}
.settings-user-admin-toggle input[disabled] {
  cursor: not-allowed;
}

.portal-footer-copy {
  margin: 0;
  font-size: 11px;
  line-height: 1.25;
  color: #362c8d;
}
.portal-footer-copy .app-version {
  font-weight: 600;
}
.settings-app-version {
  margin: 0.35rem 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: 0.02em;
}

.current-user-label {
  margin-right: 0.5rem;
  font-size: 0.85rem;
}

.error-text {
  color: #b42318;
}

.corporate-logo-report {
  display: flex;
  justify-content: center;
  padding: 0.35rem 0 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 0.75rem;
}
.corporate-logo-report-img {
  display: block;
  max-width: 160px;
  max-height: 56px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.corporate-logo-settings-preview {
  display: flex;
  justify-content: center;
  padding: 0.75rem;
  margin: 0.5rem 0 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}
.corporate-logo-settings-preview img {
  max-width: 180px;
  max-height: 64px;
  object-fit: contain;
}
.hidden { display: none !important; }
.panel {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
:root {
  --panel-collapsed-width: 2.25rem;
  --visit-properties-width: 300px;
  --final-sidebar-width: 280px;
}
.layout {
  display: grid;
  grid-template-columns: var(--final-sidebar-width) 1fr;
  gap: 1rem;
  transition: grid-template-columns 0.2s ease;
}
.layout.collapsed-final-sidebar { --final-sidebar-width: var(--panel-collapsed-width); }
.capture-workspace {
  min-height: calc(100vh - 5rem);
}
.workspace-main {
  display: grid;
  grid-template-columns: var(--visit-properties-width) 1fr;
  gap: 1rem;
  min-height: 0;
  align-items: stretch;
  transition: grid-template-columns 0.2s ease;
}
.workspace-main.collapsed-visit-properties { --visit-properties-width: var(--panel-collapsed-width); }
.workspace-entry {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
  height: calc(100vh - 5rem);
}
.report-summary-sticky {
  flex-shrink: 0;
  margin-bottom: 0.75rem;
}
.report-summary-foldable.capture-foldable {
  margin-bottom: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.report-summary-foldable .capture-foldable-title {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.85rem;
  color: #64748b;
}
.report-summary-foldable .capture-foldable-body {
  padding: 0 1rem 1rem;
}
.report-summary-foldable textarea {
  width: 100%;
  min-height: 4.5rem;
  max-height: 12rem;
  resize: vertical;
  font: inherit;
  padding: 0.5rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-sizing: border-box;
  line-height: 1.45;
}
.report-summary-foldable textarea:focus {
  outline: 2px solid #93c5fd;
  border-color: #93c5fd;
}
.properties-panel {
  background: #fff;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  align-self: start;
  position: sticky;
  top: 0;
  max-height: calc(100vh - 5rem);
  overflow-y: auto;
}
.properties-panel h3 {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}
.properties-panel .section { margin-bottom: 1.25rem; }

/* Report explorer tree (sidebar) */
.report-explorer {
  margin-bottom: 1rem;
}
.explorer-tree {
  font-size: 0.88rem;
  user-select: none;
}
.explorer-node.explorer-root {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  min-height: 2rem;
  border-radius: 4px;
}
.explorer-toggle {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 3px;
}
.explorer-toggle:hover {
  background: #f1f5f9;
  color: #334155;
}
.explorer-icon {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.explorer-icon-folder::before {
  content: "";
  width: 0.9rem;
  height: 0.7rem;
  background: #fbbf24;
  border: 1px solid #d97706;
  border-radius: 2px 2px 1px 1px;
  box-shadow: inset 0 -0.15rem 0 #f59e0b;
  position: relative;
}
.explorer-icon-visit::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #94a3b8;
  border: 1px solid #64748b;
}
.explorer-icon-team {
  width: 1.05rem;
  height: 0.85rem;
}
.explorer-icon-team svg {
  display: block;
  width: 100%;
  height: 100%;
}
.explorer-team-block {
  margin-bottom: 0.65rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #e2e8f0;
}
.explorer-team-leaf {
  cursor: default;
  margin-bottom: 0.2rem;
}
.explorer-team-leaf:hover {
  background: transparent;
}
.explorer-team-members {
  margin: 0 0 0 1.75rem;
}
.explorer-team-member-leaf {
  cursor: default;
  padding-right: 0.2rem;
}
.explorer-team-member-leaf:hover {
  background: #f8fafc;
}
.explorer-team-member-leaf.explorer-leaf-filter-active {
  background: #eff6ff;
}
.explorer-team-member-leaf.explorer-leaf-filter-active .explorer-leaf-label {
  color: #1d4ed8;
  font-weight: 600;
}
.explorer-icon-member::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #cbd5e1;
  border: 1px solid #94a3b8;
}
.explorer-leaf-filter-active .explorer-icon-member::before {
  background: #93c5fd;
  border-color: #3b82f6;
}
.explorer-leaf.explorer-leaf-filtered-out {
  opacity: 0.45;
}
.explorer-leaf.explorer-leaf-filtered-out .explorer-leaf-label {
  font-style: italic;
}
.explorer-edit-team {
  flex-shrink: 0;
  margin-left: 0.15rem;
}
.explorer-add-visit {
  margin: 0.35rem 0 0 1.75rem;
}
.explorer-root-title {
  flex: 1;
  min-width: 0;
  border: 1px solid transparent;
  background: transparent;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.3rem 0.35rem;
  border-radius: 4px;
  color: #0f172a;
}
.explorer-root-title:hover {
  border-color: #e2e8f0;
  background: #f8fafc;
}
.explorer-root-title:focus {
  outline: none;
  border-color: #93c5fd;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(147, 197, 253, 0.35);
}
.explorer-children {
  margin: 0.15rem 0 0 0.55rem;
  padding-left: 0.65rem;
  border-left: 1px solid #e2e8f0;
}
.explorer-leaves {
  list-style: none;
  margin: 0;
  padding: 0;
}
.explorer-leaf {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.45rem;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 0.15rem;
  border: 1px solid transparent;
  color: #334155;
}
.explorer-leaf:hover {
  background: #f1f5f9;
}
.explorer-leaf.active {
  background: #dbeafe;
  border-color: #93c5fd;
  font-weight: 600;
  color: #1e3a8a;
}
.explorer-leaf.active .explorer-icon-visit::before {
  background: #3b82f6;
  border-color: #2563eb;
}
.explorer-leaf-label {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 0;
}
.explorer-leaf-marquee {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.explorer-leaf-marquee-inner {
  display: inline-block;
  white-space: nowrap;
}
.explorer-leaf-marquee-inner.is-scrolling {
  animation: explorer-visit-marquee var(--marquee-duration, 3s) ease-in-out infinite alternate;
}
@keyframes explorer-visit-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-1 * var(--scroll-distance, 0px))); }
}
.explorer-leaf-date {
  flex-shrink: 0;
  font-weight: 500;
  color: #334155;
}
.explorer-leaf-sep {
  flex-shrink: 0;
  color: #94a3b8;
}
.explorer-leaf-site {
  color: #64748b;
}
.explorer-leaf-count {
  flex-shrink: 0;
  color: #64748b;
  font-size: 0.92em;
}
.explorer-visit-delete {
  flex-shrink: 0;
  opacity: 0;
  margin-left: auto;
}
.explorer-leaf:hover .explorer-visit-delete,
.explorer-leaf.active .explorer-visit-delete,
.explorer-visit-delete:focus-visible {
  opacity: 1;
}
.explorer-empty {
  padding: 0.35rem 0.45rem;
  font-size: 0.82rem;
  list-style: none;
}

.final-report-summary {
  margin: 0.75rem 0 1.5rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-left: 3px solid #cbd5e1;
  color: #334155;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}
.workspace-content {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.capture-visit-header {
  flex-shrink: 0;
}
.capture-visit-header.hidden {
  display: none;
}
.capture-visit-sticky {
  background: #fff;
  border-radius: 8px;
  padding: 0.85rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.capture-visit-sticky .workspace-header {
  margin-bottom: 0;
}
.visit-scope-field {
  position: relative;
  z-index: 2;
  scroll-margin-top: 0.75rem;
  flex-shrink: 0;
}
.visit-scope-field label {
  display: block;
  margin-bottom: 0.35rem;
}
.content {
  background: #fff;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  min-height: 400px;
}
.content.workspace-content {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.btn,
button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover,
button.btn:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}
.btn:active,
button.btn:active {
  background: #1e40af;
  border-color: #1e40af;
}
.btn:focus-visible,
button.btn:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}
.btn:disabled,
button.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn.primary {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}
.btn.primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}
.btn.small {
  min-height: 2rem;
  padding: 0 0.85rem;
  font-size: 0.85rem;
  line-height: 1.2;
  border-radius: 7px;
  box-sizing: border-box;
}
.btn.ghost {
  background: #475569;
  color: #fff;
  border-color: #475569;
}
.btn.ghost:hover {
  background: #334155;
  border-color: #334155;
  color: #fff;
}
.btn.danger {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}
.btn.danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}
.btn-icon-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  color: #64748b;
  border-radius: 4px;
  cursor: pointer;
  line-height: 1;
  box-shadow: none;
  font: inherit;
}
.btn-icon-delete:hover {
  background: #f1f5f9;
  color: #475569;
}
.btn-icon-delete:active {
  background: #e2e8f0;
  color: #334155;
}
.btn-icon-delete:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 1px;
}
.btn-icon-delete svg {
  width: 1.3rem;
  height: 1.3rem;
  flex-shrink: 0;
  pointer-events: none;
}
.btn-icon-delete-compact {
  min-width: 1.65rem;
  width: 1.65rem;
  height: 1.65rem;
}
.btn-icon-delete-compact svg {
  width: 1.1rem;
  height: 1.1rem;
}
.btn-icon-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.65rem;
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  margin: 0 0 0 auto;
  border: none;
  background: transparent;
  color: #94a3b8;
  border-radius: 4px;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}
.btn-icon-filter:hover {
  background: #f1f5f9;
  color: #64748b;
}
.btn-icon-filter.active {
  background: #dbeafe;
  color: #2563eb;
}
.btn-icon-filter.active:hover {
  background: #bfdbfe;
  color: #1d4ed8;
}
.btn-icon-filter:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 1px;
}
.btn-icon-filter svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  pointer-events: none;
}
.btn-icon-fullscreen {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  flex-shrink: 0;
  cursor: pointer;
}
.btn-icon-fullscreen:hover {
  background: #f1f5f9;
  color: #1e293b;
}
.btn-icon-fullscreen.is-active {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}
.btn-icon-fullscreen:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
.btn-icon-fullscreen svg {
  width: 1rem;
  height: 1rem;
  display: block;
  pointer-events: none;
}
.btn-icon-square {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  margin: 0;
  border-radius: 7px;
  cursor: pointer;
  line-height: 1;
  box-sizing: border-box;
  flex-shrink: 0;
  font: inherit;
  box-shadow: none;
}
.btn-icon-square:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 1px;
}
.btn-icon-plus {
  background: #2563eb;
  color: #fff;
  border: 1px solid #2563eb;
  font-size: 1.05rem;
  font-weight: 600;
}
.btn-icon-plus:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}
.btn-icon-plus:active {
  background: #1e40af;
  border-color: #1e40af;
}
.btn-icon-pencil {
  background: transparent;
  color: #64748b;
  border: none;
}
.btn-icon-pencil:hover {
  background: #f1f5f9;
  color: #475569;
}
.btn-icon-pencil:active {
  background: #e2e8f0;
  color: #334155;
}
.btn-icon-pencil svg {
  width: 1rem;
  height: 1rem;
  pointer-events: none;
}
.btn-icon-people,
.btn-icon-lock {
  background: #fff;
  color: #475569;
  border: 1px solid #cbd5e1;
}
.btn-icon-people:hover,
.btn-icon-lock:hover {
  background: #f8fafc;
  color: #1e293b;
  border-color: #94a3b8;
}
.btn-icon-people.is-active,
.btn-icon-people[aria-pressed="true"] {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}
.btn-icon-people svg,
.btn-icon-lock svg {
  width: 1.05rem;
  height: 1.05rem;
  pointer-events: none;
}
.topbar .btn-icon-lock {
  background: transparent;
  color: #cbd5e1;
  border: 1px solid #475569;
}
.topbar .btn-icon-lock:hover {
  background: rgba(148, 163, 184, 0.15);
  color: #f8fafc;
  border-color: #64748b;
}
.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.field-label-row label {
  margin: 0;
}
select.btn {
  background: #fff;
  color: #1a1a1a;
  border: 1px solid #cbd5e1;
  font-weight: 500;
}
select.btn:hover {
  background: #fff;
  border-color: #93c5fd;
  color: #1a1a1a;
}
.row, .toolbar-row, .btn-row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.75rem; }
input, select, textarea {
  font: inherit;
  padding: 0.4rem 0.55rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
}
input[type=text], textarea { width: 100%; }
textarea { min-height: 120px; resize: vertical; }
.muted { color: #64748b; }
.report-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.report-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}
.report-list li.report-list-empty {
  cursor: default;
  border: none;
  padding: 0;
}
.report-list li.report-list-loading {
  cursor: default;
  border: none;
  padding: 1.75rem 0;
  justify-content: center;
}
.report-list-loading-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #64748b;
  font-size: 0.92rem;
}
.report-list-open {
  flex: 1;
  min-width: 0;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  border-radius: 4px;
}
.report-list-open:hover {
  color: #1e40af;
}
.report-list-delete {
  flex-shrink: 0;
}
.visit-date-picker {
  width: 100%;
}
#date-list { list-style: none; padding: 0; margin: 0 0 0.5rem; }
#date-list li {
  padding: 0.45rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 0.25rem;
  border: 1px solid transparent;
}
#date-list li:hover { background: #f1f5f9; }
#date-list li.active { background: #dbeafe; border-color: #93c5fd; font-weight: 600; }
.page-tabs { display: flex; flex-direction: column; gap: 0.35rem; }
.page-tabs .btn { text-align: left; width: 100%; }
.properties-actions { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #e2e8f0; }
.properties-actions .btn { width: 100%; }
.visit-scope-field .md-editor {
  margin-top: 0;
}
.scope-text-preview {
  font-size: 0.92rem;
  line-height: 1.45;
  color: #334155;
  cursor: text;
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  border: 1px solid #e2e8f0;
  background: #fafafa;
  min-height: 4.5rem;
  white-space: pre-line;
  word-break: break-word;
}
.scope-text-preview.empty {
  color: #94a3b8;
  font-style: italic;
}
.scope-text-preview:hover,
.scope-text-preview:focus {
  background: #f1f5f9;
  outline: none;
}
.scope-text-preview:focus-visible {
  box-shadow: 0 0 0 2px #93c5fd;
}
.visit-scope-field .scope-editor-host .md-editor .md-split {
  grid-template-columns: 1fr;
  min-height: 5.5rem;
}
.visit-scope-field .scope-editor-host .md-editor .md-preview {
  display: none;
}
.visit-scope-field .scope-editor-host .md-editor .md-input {
  min-height: 4.5rem;
  line-height: 1.45;
  padding: 0.5rem 0.65rem;
  resize: vertical;
}
.capture-foldable.is-fullscreen .visit-scope-field .scope-editor-host .md-editor .md-split {
  min-height: 0;
  flex: 1 1 auto;
}
.visit-scope-field textarea {
  min-height: 4.5rem;
  line-height: 1.45;
  padding: 0.5rem 0.65rem;
}
.findings-field {
  margin-bottom: 1rem;
}
.workspace-header { margin-bottom: 1.25rem; }
.workspace-header h2 { margin: 0 0 0.25rem; }
.workspace-header p { margin: 0; }

/* Collapsible side panels */
.collapsible-panel {
  position: relative;
  min-width: 0;
}
.collapsible-panel .panel-collapse-body {
  min-width: 0;
}
.collapsible-panel:not(.collapsed) .panel-collapse-body {
  padding-right: 1.85rem;
}
.collapsible-panel.collapsed {
  padding: 1rem 0.15rem;
  overflow: visible;
}
#capture-properties.collapsed {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.collapsible-panel.collapsed .panel-collapse-body {
  display: none;
}
#capture-properties.collapsed .panel-collapse-toggle {
  position: relative;
  top: auto;
  right: auto;
  left: auto;
  transform: none;
  flex-shrink: 0;
}
#capture-properties.collapsed::after {
  content: attr(data-panel-label);
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  flex: 1;
  margin-top: 0.75rem;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  pointer-events: none;
  overflow: hidden;
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: 0.68rem;
  font-weight: 500;
  color: #64748b;
  max-width: none;
  max-height: none;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.panel-collapse-toggle {
  position: absolute;
  top: 0.5rem;
  right: 0.25rem;
  z-index: 3;
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.panel-collapse-toggle:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}
.collapsible-panel.collapsed .panel-collapse-toggle {
  right: auto;
  left: 50%;
  transform: translateX(-50%);
}
#capture-properties.collapsed .panel-collapse-toggle {
  left: auto;
  transform: none;
}
.collapsible-panel:not(#capture-properties).collapsed::after {
  content: attr(data-panel-label);
  position: absolute;
  top: 2.75rem;
  left: 50%;
  transform: translateX(-50%);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  pointer-events: none;
  max-height: calc(100vh - 8rem);
  overflow: hidden;
}
.collapsible-panel:not(.collapsed) .panel-collapse-toggle::before {
  content: "‹";
}
.collapsible-panel.collapsed .panel-collapse-toggle::before {
  content: "›";
}

table.attendees.compact { font-size: 0.82rem; }
table.attendees.compact input { padding: 0.25rem; font-size: 0.82rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.25rem; font-size: 0.9rem; }
table.attendees { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.attendees th, table.attendees td { border: 1px solid #e2e8f0; padding: 0.35rem; }
.md-editor { border: 1px solid #e2e8f0; border-radius: 6px; overflow: hidden; }
.md-toolbar { display: flex; gap: 0.25rem; padding: 0.35rem; background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.md-toolbar button { font-size: 0.8rem; padding: 0.2rem 0.45rem; }
.md-split { display: grid; grid-template-columns: 1fr 1fr; min-height: 160px; }
.md-split textarea { border: none; border-radius: 0; }
.md-preview { padding: 0.6rem; overflow: auto; font-size: 0.92rem; background: #fafafa; }
.md-preview h1,.md-preview h2,.md-preview h3 { margin: 0.5rem 0; }
.visual-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; }
.visual-grid-scroll {
  overflow: auto;
  max-height: max(220px, calc(100vh - var(--visual-grid-offset, 360px)));
  -webkit-overflow-scrolling: touch;
  margin-top: 0.35rem;
}

/* Foldable capture sections (findings, visual record) */
.capture-foldable {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  margin-bottom: 0;
  overflow: hidden;
  flex-shrink: 0;
}
.capture-foldable.is-expanded {
  flex: 1 1 auto;
  min-height: 12rem;
  display: flex;
  flex-direction: column;
}
.capture-foldable--compact {
  flex-shrink: 0;
}
.capture-foldable--compact.is-expanded {
  flex: 0 0 auto;
  min-height: 0;
}
.capture-foldable--compact.is-expanded .capture-foldable-body {
  flex: 0 0 auto;
  overflow: visible;
}
.capture-foldable-divider {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 1rem 0;
}
.kindle-attachments-panel .kindle-panel,
.kindle-attachments-panel .attachments-panel {
  min-width: 0;
}
.capture-foldable-header-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: #f8fafc;
}
.capture-foldable-header-wrap:hover {
  background: #f1f5f9;
}
.capture-foldable-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.85rem;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}
.capture-foldable-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
  padding-right: 0.65rem;
}
.capture-foldable-actions button {
  cursor: pointer;
}
.capture-foldable.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 500;
  margin: 0;
  border-radius: 0;
  border: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
  box-shadow: 0 0 0 1px #e2e8f0;
}
.capture-foldable.is-fullscreen .capture-foldable-header-wrap {
  cursor: default;
  flex-shrink: 0;
}
.capture-foldable.is-fullscreen .capture-foldable-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
body.capture-fullscreen-active {
  overflow: hidden;
}
.capture-foldable-header:hover {
  background: transparent;
}
.capture-foldable.is-expanded .capture-foldable-header-wrap {
  border-bottom: 1px solid #e2e8f0;
}
.capture-foldable.is-expanded .capture-foldable-header {
  border-bottom: none;
}
.capture-foldable-chevron {
  color: #64748b;
  font-size: 0.8rem;
  width: 0.9rem;
  flex-shrink: 0;
  line-height: 1;
}
.capture-foldable-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
  min-width: 0;
}
.capture-foldable-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #0f172a;
}
.capture-foldable-subtitle {
  font-size: 0.8rem;
  font-weight: 400;
}
.capture-foldable-body {
  padding: 0.75rem 0.85rem 1rem;
  min-height: 0;
}
.capture-foldable.is-expanded .capture-foldable-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.capture-foldable.is-expanded .capture-foldable-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.capture-foldable.is-expanded .findings-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.capture-foldable.is-expanded .findings-table-sticky-head {
  flex-shrink: 0;
}
.capture-foldable.is-expanded .findings-table-scroll,
.capture-foldable.is-fullscreen .findings-table-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}
.capture-foldable.is-expanded .visual-grid-scroll,
.capture-foldable.is-fullscreen .visual-grid-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}
.capture-foldable.is-expanded .visual-grid-scroll:has(.visual-card),
.capture-foldable.is-fullscreen .visual-grid-scroll:has(.visual-card) {
  min-height: min(52vh, 520px);
}
.capture-foldable.is-fullscreen .visual-grid-scroll:has(.visual-card) {
  min-height: 0;
}
.capture-foldable.is-fullscreen .visit-scope-field {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.capture-foldable.is-fullscreen .visit-scope-field .scope-text-preview {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.capture-foldable.is-fullscreen .visit-scope-field .scope-editor-host {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.capture-foldable.is-fullscreen .visit-scope-field .scope-editor-host .md-editor {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.capture-foldable.is-fullscreen .visit-scope-field .scope-editor-host .md-editor .md-split {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}
.capture-foldable.is-fullscreen .report-summary-foldable textarea {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  resize: none;
}
.capture-foldable.is-fullscreen .kindle-attachments-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.capture-foldable.is-expanded .visual-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.capture-foldable .visual-toolbar {
  flex-shrink: 0;
}
#capture-content > .field {
  flex-shrink: 0;
}
.visual-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.65rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}
.visual-toolbar-left,
.visual-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.visual-toolbar-actions {
  margin-left: auto;
}
.visual-select-label { font-size: 0.85rem; cursor: pointer; user-select: none; }
.visual-move-folder {
  font-size: 0.82rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  max-width: 10rem;
}
.visual-move-folder:disabled { opacity: 0.5; cursor: not-allowed; }
.visual-folder-bar {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.visual-folder-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex: 1 1 auto;
  align-items: center;
}
.visual-folder-chip-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.visual-folder-chip-wrap.is-active {
  padding: 0.2rem 0.35rem;
  background: #f1f5f9;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}
.visual-folder-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.55rem;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  font-size: 0.8rem;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
}
.visual-folder-chip:hover { background: #f8fafc; border-color: #94a3b8; }
.visual-folder-chip.is-active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
.visual-folder-chip-count {
  font-size: 0.72rem;
  opacity: 0.85;
  min-width: 1rem;
  text-align: center;
}
.visual-folder-rename {
  font-size: 0.8rem;
  padding: 0.2rem 0.4rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  width: 8rem;
}
.visual-folder-add { flex-shrink: 0; }
.visual-folder-delete { flex-shrink: 0; }
.visual-folder-badge {
  margin-left: auto;
  font-size: 0.68rem;
  padding: 0.1rem 0.35rem;
  background: #e2e8f0;
  border-radius: 4px;
  color: #475569;
  max-width: 6rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.visual-card {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.5rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow: hidden;
}
.visual-card.selected { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,.15); }
.visual-card-top { display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0; flex-shrink: 0; }
.visual-card .meta-hint { font-size: 0.75rem; opacity: 0.7; }
.visual-upload-row { margin-top: 0.75rem; }
.visual-upload-row p { margin: 0.35rem 0 0; font-size: 0.82rem; }
.visual-empty-hint {
  margin: 0.65rem 0 0;
  font-size: 0.85rem;
}
.visual-field-inner {
  position: relative;
}
.visual-field-inner.is-uploading-blocking .visual-grid-scroll {
  opacity: 0.45;
  pointer-events: none;
}
.visual-upload-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: rgba(255, 255, 255, 0.82);
  border-radius: 8px;
  min-height: 8rem;
}
.visual-upload-message {
  margin: 0;
  font-size: 0.9rem;
  color: #334155;
  font-weight: 500;
}
.visual-upload-spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid #cbd5e1;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: visual-upload-spin 0.75s linear infinite;
}
@keyframes visual-upload-spin {
  to { transform: rotate(360deg); }
}
.visual-upload-btn:disabled {
  opacity: 0.75;
  cursor: wait;
}
.visual-upload-progress {
  flex: 1 1 100%;
  min-width: 12rem;
  margin-top: 0.35rem;
}
.visual-upload-progress-track {
  height: 4px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.visual-upload-progress-fill {
  height: 100%;
  width: 0;
  background: #2563eb;
  border-radius: 999px;
  transition: width 0.2s ease;
}
.visual-upload-progress-message {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: #64748b;
}
.visual-card-pending {
  position: relative;
  border-style: dashed;
  border-color: #93c5fd;
  background: #f8fafc;
}
.visual-card-pending-thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  color: #64748b;
  padding: 0.35rem;
  text-align: center;
}
.visual-card-pending-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.visual-card-pending-badge {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}
.visual-card-pending-badge .visual-upload-spinner {
  width: 1rem;
  height: 1rem;
  border-width: 2px;
}
.visual-field-inner .visual-grid-scroll:not(:has(.visual-card)) {
  display: none;
}
  display: none;
}
.visual-card img,
.visual-card video {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}
.visual-card input[type="text"],
.visual-card input[type="date"] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.visual-card input[type="date"] {
  font-size: 0.78rem;
  padding: 0.35rem 0.4rem;
}
.visual-card .btn {
  width: 100%;
  box-sizing: border-box;
}
.attachment-item { border: 1px solid #e2e8f0; border-radius: 6px; padding: 0.5rem; margin-bottom: 0.5rem; }
.block-list .block-item {
  padding: 0.4rem 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  margin-bottom: 0.35rem;
  cursor: pointer;
  font-size: 0.85rem;
}
.block-item.active { background: #dbeafe; }
.block-item .type { color: #64748b; font-size: 0.75rem; }
.preview-pane {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 1rem;
  background: #fafafa;
  min-height: 200px;
}
.preview-pane h1 { font-size: 1.4rem; }
.preview-pane h2 { font-size: 1.15rem; }
.preview-pane h3 { font-size: 1rem; }
.preview-pane .final-findings-category { margin-bottom: 1.5rem; }
.preview-pane .final-findings-category > h2 {
  margin: 1.25rem 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid #cbd5e1;
  color: #1e40af;
}
.preview-pane .final-observation { margin-bottom: 1.75rem; }
.preview-pane .final-observation-severity {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
}
.preview-pane .final-observation-severity-label { line-height: 1.2; }
.preview-pane .final-observation-id {
  font-size: 0.68rem;
  font-weight: 400;
  color: #94a3b8;
  font-family: Consolas, "Segoe UI Mono", monospace;
  letter-spacing: 0.02em;
  margin-bottom: 0.35rem;
}
.preview-pane .final-observation-text { margin-bottom: 0.5rem; }
.preview-pane .final-observation-text p:last-child { margin-bottom: 0; }
.preview-pane .final-observation-rule {
  border: none;
  border-top: 1px solid #cbd5e1;
  margin: 0.75rem 0 1rem;
}
.preview-pane .final-observation-images {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: flex-start;
}
.preview-pane .final-observation-figure {
  margin: 0;
  flex: 0 1 calc(33.333% - 0.6rem);
  min-width: min(220px, 100%);
  max-width: 100%;
}
.preview-pane .final-observation-figure img {
  display: block;
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  background: #fff;
}
.preview-pane .final-observation-figure figcaption {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: #64748b;
}
.preview-pane table.attendees {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.preview-pane table.attendees th,
.preview-pane table.attendees td {
  border: 1px solid #e2e8f0;
  padding: 0.35rem 0.5rem;
  text-align: left;
}
.preview-pane table.attendees th { background: #f1f5f9; }
.final-report-auto {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}
.final-report-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
}
.final-report-preview {
  min-height: calc(100vh - 7rem);
  padding: 1.5rem;
}
.preview-pane .final-visit {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}
.preview-pane .final-visit:last-child {
  border-bottom: none;
  margin-bottom: 0;
}
.preview-pane .final-visit > h2 {
  margin: 0 0 1rem;
  color: #0f172a;
}
.attendees-field .attendees-summary {
  margin: 0.2rem 0 0.5rem;
  font-size: 0.82rem;
  line-height: 1.35;
}
.attendees-dialog {
  max-width: min(640px, 94vw);
  width: min(640px, 94vw);
}
.attendees-dialog h2 {
  margin: 0 0 0.25rem;
}
.attendees-dialog-table-host {
  margin: 0.75rem 0 1rem;
  max-height: min(60vh, 420px);
  overflow: auto;
}
.attendees-dialog-table-host table.attendees {
  width: 100%;
}
.attendees-dialog-table-host table.attendees input {
  width: 100%;
  min-width: 0;
  font-size: 0.88rem;
  padding: 0.3rem 0.4rem;
}
.attendees-dialog-toolbar {
  margin-top: 0.5rem;
}
.attendees-from-team {
  margin-bottom: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #e2e8f0;
}
.attendees-from-team label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.35rem;
}
.attendees-from-team-row {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}
.attendees-team-select {
  flex: 1;
  min-width: 0;
  font-size: 0.88rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
}

dialog { border: none; border-radius: 8px; padding: 1.5rem; max-width: 480px; }
dialog::backdrop { background: rgba(0,0,0,.4); }
.settings-dialog { max-width: 640px; width: min(640px, 92vw); }
.settings-section { margin-bottom: 1.25rem; padding-bottom: 1rem; border-bottom: 1px solid #e2e8f0; }
.settings-page {
  max-width: 720px;
}
.settings-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.settings-page-header h1 {
  margin: 0;
}
.settings-loading-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.9rem;
}
.settings-loading-spinner {
  width: 0.95rem;
  height: 0.95rem;
  border: 2px solid #cbd5e1;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: visual-upload-spin 0.75s linear infinite;
  flex-shrink: 0;
}
.topbar #btn-settings.active {
  background: #e2e8f0;
  color: #1e293b;
}
.topbar #btn-settings.is-loading,
.topbar #btn-settings:disabled {
  opacity: 0.7;
  cursor: wait;
}
.settings-section:last-of-type { border-bottom: none; }
.settings-section h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.export-options-dialog fieldset {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
}
.export-order-fieldset legend {
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  padding: 0 0.35rem;
}
.export-order-option {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.45rem 0;
  font-size: 0.9rem;
  line-height: 1.35;
  cursor: pointer;
}
.export-order-option input { margin-top: 0.2rem; accent-color: #2563eb; }
.export-order-hint { font-size: 0.82rem; margin: 0 0 1rem; }
.export-visit-fieldset { margin-top: 0.75rem; }
.export-visit-filters-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.export-visit-hint { font-size: 0.8rem; flex: 1; min-width: 0; }
.export-visit-filter-actions { display: flex; gap: 0.35rem; flex-shrink: 0; }
.export-visit-filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.export-visit-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  font-size: 0.82rem;
  cursor: pointer;
  background: #fff;
}
.export-visit-chip:has(input:checked) {
  border-color: #93c5fd;
  background: #eff6ff;
}
.export-visit-chip input { accent-color: #2563eb; }
.export-visual-option { margin: 0.75rem 0 0.5rem; }
.settings-path-row { display: flex; gap: 0.5rem; margin: 0.35rem 0 0.5rem; }
.settings-path-row input { flex: 1; min-width: 0; font-family: Consolas, "Segoe UI Mono", monospace; font-size: 0.85rem; }
.settings-path-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.settings-google-oauth-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0.75rem 0 1rem;
}
.settings-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.9rem;
  color: #334155;
}
.settings-field input {
  font: inherit;
  padding: 0.45rem 0.6rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
}
#settings-google-redirect-uri {
  display: inline-block;
  margin-top: 0.2rem;
  word-break: break-all;
  font-size: 0.82rem;
}
.settings-hint { margin: 0.5rem 0 0; font-size: 0.82rem; }
.report-actions { flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.reports-location { margin: 0.75rem 0 0.5rem; font-size: 0.82rem; word-break: break-all; }
.org-switcher {
  min-width: 14rem;
  max-width: min(28rem, 42vw);
  width: auto;
  font-size: 0.82rem;
  padding: 0.25rem 1.75rem 0.25rem 0.55rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  flex-shrink: 1;
}
.settings-invites-codes {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
}
.settings-invites-codes li {
  margin-bottom: 0.35rem;
  font-size: 0.88rem;
}
.settings-users-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.settings-invites-codes code {
  font-family: Consolas, "Segoe UI Mono", monospace;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.cloud-status {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.cloud-status-row {
  display: grid;
  grid-template-columns: 6.75rem 7.5rem auto;
  align-items: center;
  column-gap: 0.65rem;
}
.cloud-status-label {
  font-weight: 500;
  color: #334155;
}
.cloud-status-state {
  font-size: 0.9rem;
}
.cloud-status-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
hr { border: none; border-top: 1px solid #e2e8f0; margin: 1rem 0; }
