:root {
  --paper: #f2eee4;
  --ink: #1b1b18;
  --red: #a3342a;
  --blue: #243f6b;
  --line: #c7c0b2;
  --muted: #6b675f;
  --verified: #2d664a;
  --pending: #966015;
}

* { box-sizing: border-box; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(255,255,255,.25), rgba(255,255,255,.25)),
    repeating-linear-gradient(90deg, transparent, transparent 89px, rgba(0,0,0,.025) 90px),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.masthead {
  padding: 24px clamp(22px, 6vw, 92px) 28px;
  border-bottom: 1px solid var(--ink);
}

.brand-row { display: flex; align-items: center; gap: clamp(24px, 5vw, 72px); }
.brand-lockup { flex: 0 0 auto; width: clamp(92px, 10vw, 126px); text-align: center; }
.client-logo { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; mix-blend-mode: multiply; }
.powered-by { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 5px; white-space: nowrap; }
.powered-by span { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.powered-by img { display: block; width: 58px; height: 34px; object-fit: contain; }
h1, h2 { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; margin: 0; }
.product-title { flex: 1; min-width: 0; }
.product-title-main { display: block; font-size: clamp(48px, 7.4vw, 100px); line-height: .82; letter-spacing: -.055em; }
.product-title-main em { color: var(--red); font-weight: 400; }
.product-title-context { display: flex; align-items: center; gap: 9px; max-width: 650px; margin-top: 17px; font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: clamp(10px, 1.15vw, 14px); line-height: 1; letter-spacing: .19em; text-transform: uppercase; white-space: nowrap; }
.product-title-context::before { content: ''; width: clamp(30px, 4vw, 58px); height: 1px; margin-right: 3px; background: var(--red); }
.product-title-context::after { content: ''; flex: 1; height: 1px; margin-left: 8px; background: var(--line); }
.product-title-context span { color: var(--muted); }
.product-title-context strong { font-weight: 600; color: var(--ink); }
.product-subtitle { display: block; max-width: 720px; margin-top: 16px; color: var(--muted); font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: clamp(11px, 1.25vw, 15px); font-weight: 400; line-height: 1.45; letter-spacing: .015em; }

main { padding: 0 clamp(22px, 6vw, 92px) 80px; }
.workspace-actions { display: flex; justify-content: space-between; align-items: center; min-height: 64px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.workspace-actions:has(.change-mode-button[hidden]) { justify-content: flex-end; }
.change-mode-button { border: 0; background: transparent; color: var(--red); padding: 8px 0; font-size: 12px; text-decoration: underline; text-underline-offset: 4px; }
.mode-chooser { padding: clamp(42px, 7vw, 88px) 0 64px; }
.mode-heading { max-width: 920px; margin-bottom: 28px; }
.mode-heading > span { color: var(--red); font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.mode-heading h2 { margin-top: 8px; font-size: clamp(36px, 5vw, 58px); line-height: 1; }
.mode-heading p { max-width: 580px; margin: 13px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.landing-search-form { margin-top: 26px; }
.landing-search-form > label { display: block; margin-bottom: 9px; color: var(--red); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.landing-search-status { max-width: none !important; margin-top: 10px !important; font-size: 12px !important; }
.search-cancel { border-color: var(--red) !important; background: transparent !important; color: var(--red) !important; }
.search-cancel:hover, .search-cancel:focus-visible { background: rgba(163,52,42,.08) !important; }
.search-row:has(.search-cancel:not([hidden])) { grid-template-columns: 1fr auto auto; }
.archive-search-progress { display: grid; gap: 8px; max-width: 920px; margin-top: 16px; padding: 15px 17px; border: 1px solid rgba(36,63,107,.34); background: rgba(255,255,255,.38); }
.archive-search-progress[hidden] { display: none; }
.archive-search-progress-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; }
.archive-search-source { color: var(--ink); font-family: Georgia, serif; font-size: 16px; font-weight: 400; }
.archive-search-progress-value { flex: none; color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.archive-search-progress-track { position: relative; height: 11px; overflow: hidden; border: 1px solid rgba(36,63,107,.28); border-radius: 999px; background: rgba(255,255,255,.72); }
.archive-search-progress-bar { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--blue), #4e6f9e); transition: width .3s ease; }
.archive-search-progress.complete .archive-search-progress-bar { background: linear-gradient(90deg, var(--blue), var(--verified)); }
.archive-search-progress.error { border-color: rgba(163,52,42,.55); }
.archive-search-progress.error .archive-search-progress-bar { background: var(--red); }
.archive-search-progress.cancelled { border-color: rgba(163,52,42,.4); }
.archive-search-progress.cancelled .archive-search-progress-bar { background: var(--red); }
.archive-search-progress-detail { color: var(--muted); font-size: 11px; line-height: 1.4; }
.archive-search-eta { width: fit-content; padding: 5px 9px; border-left: 3px solid var(--blue); background: rgba(36,63,107,.07); color: var(--blue); font-size: 11px; font-weight: 700; line-height: 1.35; }
.archive-search-progress-catalog { max-width: none; margin: 18px 0 0; }
.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mode-card { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto 1fr auto; gap: 8px 18px; min-height: 270px; padding: 24px; border: 1px solid var(--ink); background: rgba(255,255,255,.26); color: var(--ink); text-align: left; }
.mode-card:hover, .mode-card:focus-visible { border-color: var(--red); background: rgba(163,52,42,.06); outline: 0; }
.mode-card:disabled { cursor: not-allowed; opacity: .58; }
.mode-card:disabled:hover { border-color: var(--ink); background: rgba(255,255,255,.26); }
.mode-number { grid-row: 1 / span 4; color: var(--red); font-family: Georgia, serif; font-size: 18px; }
.mode-card strong { align-self: end; font-family: Georgia, serif; font-size: clamp(26px, 3vw, 38px); line-height: 1; font-weight: 400; }
.mode-card small { max-width: 430px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.mode-card-summary { display: grid; gap: 5px; align-content: start; min-width: 0; }
.mode-summary-total { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 4px; color: var(--blue); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.mode-summary-total b { color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mode-summary-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 5px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.3; }
.mode-summary-row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.mode-source-label { display: grid; gap: 3px; }
.mode-source-label small { max-width: 520px; color: var(--red); font-size: 10px; line-height: 1.35; }
.mode-suggestion-item { display: grid; gap: 2px; padding: 7px 0; border-top: 1px solid var(--line); }
.mode-suggestion-item b { color: var(--blue); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.mode-suggestion-item span { color: var(--ink); font-family: Georgia, serif; font-size: 15px; line-height: 1.2; }
.mode-suggestion-item small { font-size: 10px; }
.mode-suggestion-item.unavailable b, .mode-suggestion-item.unavailable small { color: var(--red); }
.mode-action { align-self: end; color: var(--red); font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.mode-card-visual { border-color: var(--red); }
.home-favorite-folders { margin-top: 34px; padding-top: 25px; border-top: 1px solid var(--line); }
.home-favorite-folders-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
.home-favorite-folders-heading span { color: var(--red); font-size: 9px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.home-favorite-folders-heading h3 { margin: 5px 0 0; font-family: Georgia, serif; font-size: 27px; font-weight: 400; }
.home-favorite-folders-heading button { border: 0; background: transparent; color: var(--red); text-decoration: underline; text-underline-offset: 4px; }
.home-favorite-folders-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.home-favorite-folders-grid .favorite-folder-card { min-height: 165px; padding: 17px; }
.home-favorite-folders-grid .favorite-folder-symbol { width: 54px; height: 36px; margin: 23px 0 16px; }
.home-favorite-folders-grid .favorite-folder-card strong { font-size: 22px; }
.home-favorite-folders-empty { grid-column: 1 / -1; margin: 0; padding: 18px; border: 1px dashed var(--line); color: var(--muted); font-size: 12px; }
.search-panel { padding: 38px 0 32px; border-bottom: 1px solid var(--line); }
.search-panel[hidden], .visual-workspace[hidden], .results-section[hidden], .mode-chooser[hidden] { display: none; }
.search-panel form > label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .13em; margin-bottom: 10px; }
.search-row { display: grid; grid-template-columns: 1fr auto; border: 1px solid var(--ink); background: #faf8f2; }
.search-row input { border: 0; background: transparent; padding: 18px 20px; min-width: 0; outline: 0; font-size: clamp(17px, 2vw, 23px); }
.search-row button { border: 0; border-left: 1px solid var(--ink); background: var(--ink); color: white; padding: 0 34px; text-transform: uppercase; letter-spacing: .08em; }

.search-shortcuts { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 12px; }
.favorites-button { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--red); background: transparent; color: var(--red); border-radius: 99px; padding: 8px 14px; font-size: 12px; white-space: nowrap; }
.favorites-button span { font-size: 15px; line-height: 1; }
.favorites-button:hover, .favorites-button.active { background: var(--red); color: white; }
.search-options { margin-top: 24px; padding: 15px 0 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.search-options-heading { display: block; margin-bottom: 12px; color: var(--red); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.search-options-content { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)); gap: 20px; align-items: end; }
.search-filter-control { display: grid; gap: 6px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.search-filter-control select { width: 100%; min-width: 0; border: 0; border-bottom: 1px solid var(--ink); padding: 8px 24px 8px 0; background: transparent; color: var(--ink); }
.search-filter-control select:disabled { color: var(--muted); border-color: var(--line); }
.search-filter-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 14px; }
.search-filter-actions span { color: var(--muted); font-size: 10px; }
.search-filter-actions button { border: 1px solid var(--ink); background: var(--ink); color: white; padding: 10px 18px; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.search-filter-actions button:disabled { border-color: var(--line); background: transparent; color: var(--muted); cursor: default; }
.search-filter-actions button:not(:disabled):hover { background: var(--red); border-color: var(--red); }
.geography-filter-note { margin: 12px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.explore-entry { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 18px; padding: 14px 16px; border-left: 3px solid var(--red); background: rgba(163,52,42,.055); }
.explore-entry > div { display: grid; gap: 3px; }
.explore-entry strong { font-family: Georgia, serif; font-size: 17px; font-weight: 400; }
.explore-entry span { color: var(--muted); font-size: 11px; line-height: 1.4; }
.explore-entry button { flex: 0 0 auto; border: 1px solid var(--red); background: transparent; color: var(--red); padding: 9px 13px; font-size: 11px; }
.explore-entry button:hover, .explore-entry button.active { background: var(--red); color: white; }

.filters { display: flex; gap: 28px; flex-wrap: wrap; align-items: end; margin-top: 28px; }
.filters label { display: grid; gap: 7px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.filters select { min-width: 210px; border: 0; border-bottom: 1px solid var(--ink); padding: 8px 24px 8px 0; background: transparent; }
.visual-search-toggle { align-self: center; text-transform: none !important; letter-spacing: 0 !important; }
.visual-toggle-control { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 650; }
.visual-toggle-control input { width: 17px; height: 17px; margin: 0; accent-color: var(--red); }
.visual-search-toggle small { margin-left: 26px; color: var(--muted); font-size: 10px; }
.active-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 16px; color: var(--pending); }
.active-filters strong { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; margin-right: 3px; }
.active-filters .intent-chip { border-color: var(--pending); }
.active-filters button { border: 0; background: transparent; color: var(--red); padding: 4px 6px; text-decoration: underline; text-underline-offset: 3px; font-size: 11px; }
.intent-panel { margin-top: 30px; border: 1px solid var(--line); background: rgba(36,63,107,.035); }
.intent-panel > summary { cursor: pointer; padding: 12px 14px; color: var(--blue); font-size: 11px; font-weight: 700; }
.intent-panel > .intent-body { padding: 4px 14px 14px; }
.intent-heading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.intent-heading strong { font-family: Georgia, serif; font-size: 19px; font-weight: 400; }
.intent-heading span, .intent-panel small { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.intent-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.intent-grid > div, .intent-synonyms { display: flex; align-items: center; align-content: flex-start; flex-wrap: wrap; gap: 6px; }
.intent-grid small, .intent-synonyms small { flex-basis: 100%; margin-bottom: 2px; }
.intent-chip { border: 1px solid var(--line); background: var(--paper); padding: 4px 7px; font-size: 11px; }
.intent-synonyms { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }

.visual-workspace { padding: 18px 0 28px; border-bottom: 1px solid var(--line); }
.guided-icar { margin-top: 0; border: 1px solid var(--red); background: rgba(163,52,42,.055); }
.guided-icar[hidden] { display: none; }
.guided-intro { display: grid; grid-template-columns: 1fr auto; gap: 22px; align-items: center; padding: 20px; }
.guided-kicker { display: block; margin-bottom: 7px; color: var(--red); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.guided-intro h3, .guided-registers h3 { margin: 0 0 7px; font-family: Georgia, serif; font-size: 23px; font-weight: 400; }
.guided-intro p { max-width: 760px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.guided-primary, .guided-secondary, .guided-register { border: 1px solid var(--ink); background: var(--ink); color: white; padding: 10px 15px; font-size: 11px; letter-spacing: .05em; }
.guided-primary:hover, .guided-register:hover { background: var(--red); border-color: var(--red); }
.guided-secondary { background: transparent; color: var(--ink); }
.guided-secondary:hover { color: var(--red); border-color: var(--red); }
.guided-registers { padding: 20px; border-top: 1px solid rgba(163,52,42,.3); }
.guided-registers-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.guided-registers-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.register-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.register-card { display: grid; grid-template-rows: 148px auto; min-width: 0; border: 1px solid var(--line); background: rgba(255,255,255,.25); }
.register-card img { width: 100%; height: 148px; object-fit: contain; background: #ded8cb; border-bottom: 1px solid var(--line); }
.register-card-body { display: grid; align-content: start; gap: 8px; padding: 13px; }
.register-card h4 { min-height: 55px; margin: 0; font-family: Georgia, serif; font-size: 17px; line-height: 1.18; font-weight: 400; }
.register-meta { color: var(--muted); font-size: 11px; line-height: 1.4; }
.guided-register { margin-top: 3px; }
.guided-trail { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: 11px; }
.guided-trail strong { color: var(--ink); }
.guided-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; margin: 0 20px 20px; border: 1px solid var(--line); background: var(--line); }
.guided-steps > div { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 11px 12px; background: rgba(255,255,255,.46); color: var(--muted); }
.guided-steps b { display: grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px; border: 1px solid currentColor; border-radius: 50%; font-size: 10px; }
.guided-steps span { display: grid; gap: 2px; min-width: 0; }
.guided-steps strong { color: inherit; font-size: 11px; }
.guided-steps small { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.guided-steps .current { background: var(--paper); color: var(--red); box-shadow: inset 0 -3px 0 var(--red); }
.guided-steps .done { color: var(--verified); }
.guided-steps .done b { border-color: var(--verified); background: var(--verified); color: white; }
.guided-steps.iccd-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.guided-steps.iccd-location-steps { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.guided-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 10px; padding: 0 20px 20px; }
.guided-toolbar input { width: 100%; border: 1px solid var(--line); background: #faf8f2; padding: 11px 12px; outline: 0; }
.guided-toolbar input:focus { border-color: var(--red); }
.guided-toolbar button { border: 1px solid var(--ink); background: transparent; padding: 9px 13px; font-size: 11px; }
.tome-view-switch { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 14px; }
.tome-view-switch button { border: 1px solid var(--line); background: transparent; color: var(--muted); padding: 8px 12px; font-size: 10px; }
.tome-view-switch button.active { border-color: var(--blue); background: var(--blue); color: white; }
.tome-view-switch button:disabled { cursor: not-allowed; opacity: .45; }
.guided-projects, .guided-nodes { padding: 20px; border-top: 1px solid rgba(163,52,42,.3); }
.guided-list-heading { display: flex; justify-content: space-between; gap: 18px; align-items: baseline; margin-bottom: 14px; }
.guided-list-heading h3 { margin: 0; font-family: Georgia, serif; font-size: 23px; font-weight: 400; }
.guided-list-heading span { color: var(--muted); font-size: 11px; }
.guided-inline-back { border: 0; background: transparent; color: var(--red); padding: 4px 0; font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
.project-grid, .node-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.project-card, .node-card { display: grid; align-content: start; gap: 7px; min-height: 130px; padding: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.24); text-align: left; }
.project-card:hover, .node-card:hover { border-color: var(--red); background: rgba(163,52,42,.05); }
.project-card h4, .node-card h4 { margin: 0; font-family: Georgia, serif; font-size: 17px; line-height: 1.2; font-weight: 400; }
.project-card span, .node-card span { color: var(--muted); font-size: 10px; line-height: 1.4; }
.project-card small, .node-card small { color: var(--red); font-size: 9px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.archive-card { min-height: 112px; }
.project-suggestions { margin: 0 0 28px; padding: 18px; border: 1px solid var(--blue); background: rgba(36,63,107,.055); }
.project-suggestions .guided-list-heading { align-items: end; }
.project-suggestions .guided-list-heading h3 { margin-top: 4px; }
.suggestion-explanation { max-width: 880px; margin: -3px 0 15px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.project-suggestion-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.project-suggestion-card { display: grid; align-content: start; gap: 7px; min-height: 155px; padding: 15px; border: 1px solid var(--blue); background: rgba(255,255,255,.45); color: var(--ink); text-align: left; }
.project-suggestion-card:hover { background: rgba(36,63,107,.09); }
.project-suggestion-card small { color: var(--blue); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.project-suggestion-card h4 { margin: 0; font-family: Georgia, serif; font-size: 19px; line-height: 1.15; font-weight: 400; }
.project-suggestion-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.project-suggestion-card span { align-self: end; margin-top: 3px; color: var(--red); font-size: 10px; font-weight: 700; }
.guided-empty.compact { padding: 14px; border-left: 3px solid var(--blue); background: rgba(255,255,255,.35); font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 11px; line-height: 1.5; }
.iccd-region-control { display: grid; grid-template-columns: auto minmax(220px, 420px) 1fr; gap: 12px; align-items: center; margin: 0 0 20px; padding: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.35); }
.iccd-region-control label { color: var(--red); font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.iccd-region-control select { width: 100%; border: 1px solid var(--line); background: #faf8f2; padding: 11px 34px 11px 12px; }
.iccd-region-control span { color: var(--muted); font-size: 11px; line-height: 1.4; }
.iccd-area-block { margin: 0 0 18px; padding: 18px; border: 1px solid var(--blue); background: rgba(36,63,107,.045); }
.iccd-area-block .guided-toolbar { padding: 0; }
.iccd-choice-grid { margin-top: 12px; }
.iccd-choice { min-height: 105px; }
.iccd-visual-start { margin-top: 18px; }
.collection-theme { margin-bottom: 14px; padding: 16px; border: 1px solid var(--red); background: rgba(255,255,255,.42); }
.collection-theme h4 { margin: 0 0 6px; font-family: Georgia, serif; font-size: 20px; font-weight: 400; }
.collection-theme p { max-width: 820px; margin: 0 0 12px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.collection-theme label { display: block; margin-bottom: 6px; color: var(--ink); font-size: 9px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.collection-theme input { width: min(620px, 100%); border: 1px solid var(--line); background: #faf8f2; padding: 11px 12px; outline: 0; }
.collection-theme input:focus { border-color: var(--red); }
.manifest-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; margin-bottom: 14px; padding: 15px; border: 1px solid var(--blue); background: rgba(36,63,107,.055); }
.manifest-box h4 { margin: 3px 0 5px; font-family: Georgia, serif; font-size: 19px; font-weight: 400; }
.manifest-box p { margin: 0; color: var(--muted); font-size: 11px; }
.manifest-box button { border: 1px solid var(--blue); background: var(--blue); color: white; padding: 10px 14px; font-size: 11px; }
.tome-visual-search { margin: 14px 0 22px; padding: 18px; border: 2px solid var(--red); background: rgba(255,255,255,.42); }
.tome-visual-search h4 { margin: 0 0 7px; font-family: Georgia, serif; font-size: 22px; font-weight: 400; }
.tome-visual-search > p { max-width: 820px; margin: 0 0 15px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.tome-visual-search .guided-toolbar { grid-template-columns: auto minmax(220px, 1fr) auto; align-items: center; padding: 0; }
.tome-visual-search label { color: var(--ink); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.tome-visual-search button { border-color: var(--red); background: var(--red); color: white; }
.visual-disclaimer { display: block; margin-top: 10px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.guided-empty { padding: 24px 0; color: var(--muted); font-family: Georgia, serif; font-size: 18px; }
.guided-warning { display: grid; gap: 8px; padding: 16px; border-left: 3px solid var(--pending); background: rgba(150,96,21,.08); font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 12px; }
.guided-warning strong { color: var(--ink); }
.guided-warning span { line-height: 1.45; }
.guided-warning button { width: max-content; border: 1px solid var(--pending); background: transparent; color: var(--pending); padding: 8px 11px; font-size: 10px; }
.guided-pagination { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 14px; }
.guided-pagination button { border: 1px solid var(--line); background: transparent; padding: 7px 10px; }
.guided-pagination span { color: var(--muted); font-size: 11px; }

.visual-site-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.visual-site-card { display: grid; align-content: start; gap: 8px; min-height: 145px; padding: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.3); color: var(--ink); text-align: left; }
.visual-site-card:not(:disabled):hover { border-color: var(--red); background: rgba(163,52,42,.05); }
.visual-site-card strong { font-family: Georgia, serif; font-size: 21px; font-weight: 400; }
.visual-site-card small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.visual-site-card span { align-self: end; color: var(--red); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.visual-site-card:disabled { cursor: default; opacity: .58; }
.visual-site-card:disabled span { color: var(--muted); }
.visual-site-card.unavailable { border-color: rgba(163,52,42,.45); background: rgba(163,52,42,.035); }
.visual-site-card.unavailable small, .visual-site-card.unavailable span { color: var(--red); }
.project-scope-search { margin-bottom: 18px; padding: 18px; border: 2px solid var(--red); background: rgba(255,255,255,.45); }
.project-scope-search h4 { margin: 0 0 7px; font-family: Georgia, serif; font-size: 23px; font-weight: 400; }
.project-scope-search p { max-width: 850px; margin: 0 0 14px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.project-scope-search .guided-toolbar { grid-template-columns: minmax(220px, 1fr) auto; padding: 0; }
.project-scope-search button { border-color: var(--red); background: var(--red); color: white; }
.visual-concept-results { margin-top: 18px; padding-top: 18px; border-top: 1px solid rgba(173,51,39,.35); }
.visual-concept-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.visual-concept-heading h5 { margin: 4px 0 0; font-family: Georgia, serif; font-size: 25px; font-weight: 400; }
.visual-concept-heading > strong { color: var(--muted); font-size: 11px; font-weight: 500; text-align: right; }
.visual-concept-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); gap: 18px; }
.visual-concept-grid .card { min-width: 0; background: var(--paper); color: var(--ink); text-align: left; }
.project-scope-search .visual-concept-grid .card-actions button { border-color: var(--ink); background: transparent; color: var(--ink); }
.project-scope-search .visual-concept-grid .card-actions .favorite.active { border-color: var(--red); background: var(--red); color: white; }
.visual-concept-empty { border: 1px dashed rgba(173,51,39,.45); padding: 15px; color: var(--muted); font-size: 12px; }
.continuing-search-banner { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0 0 18px; padding: 14px 16px; border: 1px solid var(--blue); background: rgba(32,68,112,.07); }
.continuing-search-banner div { display: grid; gap: 4px; }
.continuing-search-banner strong { font-family: Georgia, serif; font-size: 18px; font-weight: 400; }
.continuing-search-banner small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.continuing-search-banner button { flex: none; border: 1px solid var(--blue); background: var(--blue); color: white; }
.tome-visual-search.continuing-search { border-color: var(--blue); background: rgba(32,68,112,.05); }
.tome-visual-search.continuing-search .tome-view-switch button { border-color: var(--blue); background: transparent; color: var(--blue); }
.tome-visual-search.continuing-search .tome-view-switch button.active { background: var(--blue); color: white; }
.visible-level-search { margin: 0 0 18px; padding: 17px 18px; border: 1px solid var(--blue); background: rgba(36,63,107,.055); }
.visible-level-search h4 { margin: 5px 0 7px; font-family: Georgia, serif; font-size: 21px; font-weight: 400; }
.visible-level-search p { max-width: 850px; margin: 0 0 13px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.visible-level-search .guided-toolbar { grid-template-columns: minmax(220px, 1fr) auto; padding: 0; }
.visible-level-search button { border-color: var(--blue); background: var(--blue); color: white; }
.scope-separator { display: flex; align-items: center; gap: 12px; margin: 4px 0 15px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.scope-separator::before, .scope-separator::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.results-section { padding-top: 36px; }
.results-heading { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 22px; }
.results-heading h2 { font-size: 34px; }
#result-count { color: var(--muted); font-size: 13px; }
.visual-search-panel { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: -8px 0 22px; padding: 17px 18px; border: 1px solid var(--blue); background: linear-gradient(115deg, rgba(255,255,255,.36), rgba(36,63,107,.075)); box-shadow: 0 10px 28px rgba(36,63,107,.07); }
.visual-search-panel[hidden] { display: none; }
.visual-progress-copy { display: grid; flex: 1; gap: 8px; min-width: 0; }
.visual-progress-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.visual-search-panel strong { font-family: Georgia, serif; font-size: 17px; font-weight: 400; }
.visual-search-panel span { color: var(--muted); font-size: 11px; line-height: 1.4; }
#visual-progress-value { color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.visual-progress-track { position: relative; height: 12px; overflow: hidden; border: 1px solid rgba(36,63,107,.32); border-radius: 999px; background: rgba(255,255,255,.7); }
.visual-progress-bar { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--blue), #4e6f9e); transition: width .28s ease; }
.visual-progress-bar::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 25%, rgba(255,255,255,.42) 48%, transparent 72%); transform: translateX(-110%); animation: visual-progress-shimmer 1.7s ease-in-out infinite; }
.visual-progress-track.indeterminate .visual-progress-bar { width: 38% !important; animation: visual-progress-slide 1.35s ease-in-out infinite; }
.visual-progress-track.complete .visual-progress-bar { background: linear-gradient(90deg, var(--blue), var(--verified)); }
.visual-progress-track.complete .visual-progress-bar::after { display: none; }
.visual-search-panel button { border: 1px solid var(--blue); background: transparent; color: var(--blue); padding: 8px 12px; font-size: 11px; white-space: nowrap; }
.visual-search-panel button:hover { background: var(--blue); color: white; }
@keyframes visual-progress-slide { from { left: -38%; } to { left: 100%; } }
@keyframes visual-progress-shimmer { 0%, 35% { transform: translateX(-110%); } 85%, 100% { transform: translateX(110%); } }
@media (prefers-reduced-motion: reduce) {
  .visual-progress-track.indeterminate .visual-progress-bar { left: 0; animation: none; }
  .visual-progress-bar::after { display: none; }
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 28px 18px; }
.source-group { display: contents; }
.source-divider { grid-column: 1 / -1; display: grid; grid-template-columns: auto auto minmax(40px, 1fr) auto; align-items: center; gap: 11px; width: 100%; margin: 20px 0 -10px; padding: 0; border: 0; background: transparent; color: var(--ink); text-align: left; }
.grid > .source-divider:first-child, .source-group:first-child .source-divider { margin-top: 0; }
.source-divider.collapsible { cursor: pointer; }
.source-divider.collapsible:hover strong, .source-divider.collapsible:focus-visible strong { color: var(--red); }
.source-divider.collapsed { margin-bottom: 0; }
.source-divider-kicker { color: var(--red); font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.source-divider-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; min-width: 0; }
.source-divider strong { font-family: Georgia, serif; font-size: clamp(20px, 2vw, 28px); font-weight: 400; line-height: 1; }
.source-divider-count { flex: 0 0 auto; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.source-divider-error { flex-basis: 100%; color: var(--red); font-size: 10px; font-weight: 400; line-height: 1.4; text-transform: none; }
.source-divider i { height: 1px; background: linear-gradient(90deg, var(--ink), rgba(27,27,24,.12)); }
.source-divider-action { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.source-group-load-more { grid-column: 1 / -1; }
.card { border-top: 1px solid var(--ink); padding-top: 10px; position: relative; cursor: pointer; }
.image-wrap { aspect-ratio: 4 / 5; overflow: hidden; background: #ddd6c8; position: relative; border: 1px solid #d8d0c1; display: flex; align-items: center; justify-content: center; }
.image-wrap.loading::before { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.48) 46%, transparent 62%); transform: translateX(-100%); animation: image-loading 1.25s ease-in-out infinite; }
.image-wrap.loading::after, .detail-image-frame.loading::after { content: attr(data-loading-label); position: absolute; z-index: 2; left: 50%; bottom: 18px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); padding: 7px 10px; background: rgba(250,248,242,.9); color: var(--blue); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-align: center; }
.image-wrap.unavailable::after { content: 'Anteprima non disponibile'; max-width: 150px; color: var(--muted); font-family: Georgia, serif; font-size: 15px; line-height: 1.2; text-align: center; }
.image-wrap.loading img, .detail-image-frame.loading img { opacity: .18; }
.image-wrap img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; display: block; filter: saturate(.82) contrast(1.02); }
.card:hover .image-wrap img { transform: scale(1.015); transition: transform .25s ease; }
.card-body { padding-top: 12px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.badge { font-size: 9px; letter-spacing: .09em; text-transform: uppercase; border: 1px solid currentColor; padding: 4px 6px; }
.badge.type { color: var(--blue); }
.badge.source { color: var(--ink); background: rgba(27,27,24,.055); }
.badge.page { color: var(--red); }
.card h3 { font-family: Georgia, serif; font-size: 21px; line-height: 1.1; margin: 0 0 8px; font-weight: 400; }
.meta { color: var(--muted); font-size: 12px; line-height: 1.45; min-height: 34px; }
.why-result { margin-top: 11px; padding: 10px 11px; border-left: 3px solid var(--blue); background: rgba(36,63,107,.055); }
.why-result strong { display: block; margin-bottom: 5px; color: var(--blue); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.why-result ul { margin: 0; padding-left: 16px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.why-result li + li { margin-top: 3px; }
.card-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 13px; border-top: 1px solid var(--line); padding-top: 10px; }
.card-actions button { border: 0; padding: 0; background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.action-links { display: flex; gap: 12px; align-items: center; font-size: 12px; }
.source-link { color: var(--red); text-underline-offset: 3px; }
.favorite { font-size: 20px; text-decoration: none !important; color: var(--muted); }
.favorite.active { color: var(--red); }
.favorite-folder-control { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 9px; margin-top: 12px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.favorite-folder-control select { min-width: 0; border: 1px solid var(--line); background: rgba(255,255,255,.45); padding: 7px 9px; color: var(--ink); font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none; }

.notice { margin-bottom: 22px; padding: 13px 16px; border-left: 4px solid var(--blue); background: rgba(36,63,107,.08); }
.empty { grid-column: 1 / -1; padding: 60px 0; font-family: Georgia, serif; font-size: 25px; color: var(--muted); }
.favorites-empty { grid-column: 1 / -1; min-height: 250px; display: grid; place-items: center; align-content: center; gap: 8px; border: 1px dashed var(--line); color: var(--muted); text-align: center; }
.favorites-empty span { color: var(--red); font-size: 30px; }
.favorites-empty h3 { margin: 0; font-family: Georgia, serif; font-size: 27px; font-weight: 400; color: var(--ink); }
.favorites-empty p { max-width: 430px; margin: 0; font-size: 13px; line-height: 1.5; }
.favorite-organizer { margin: -4px 0 28px; padding: 20px; border: 1px solid var(--ink); background: rgba(255,255,255,.25); }
.favorite-organizer[hidden] { display: none; }
.favorite-organizer-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.favorite-organizer-heading h3 { margin: 4px 0 0; font-family: Georgia, serif; font-size: 25px; font-weight: 400; }
.favorite-folder-create { display: grid; grid-template-columns: minmax(160px, 250px) auto; }
.favorite-folder-create input, .favorite-folder-editor input { min-width: 0; border: 1px solid var(--ink); background: #faf8f2; padding: 9px 11px; }
.favorite-folder-create button, .favorite-folder-editor button { border: 1px solid var(--ink); border-left: 0; background: var(--ink); color: white; padding: 9px 13px; }
.grid.favorite-folders-view { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); align-items: start; }
.favorite-folder-card { position: relative; min-height: 220px; overflow: hidden; border: 1px solid var(--ink); background: rgba(255,255,255,.28); padding: 22px; color: var(--ink); text-align: left; transition: background .2s ease, color .2s ease, transform .2s ease; }
.favorite-folder-card:hover { background: var(--ink); color: white; transform: translateY(-3px); }
.favorite-folder-kind { display: block; color: var(--red); font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.favorite-folder-symbol { position: relative; display: block; width: 72px; height: 48px; margin: 30px 0 22px; border: 1px solid currentColor; border-radius: 2px; }
.favorite-folder-symbol::before { content: ''; position: absolute; left: -1px; top: -12px; width: 31px; height: 12px; border: 1px solid currentColor; border-bottom: 0; border-radius: 2px 5px 0 0; }
.favorite-folder-symbol i { position: absolute; left: 11px; right: 11px; bottom: 12px; height: 1px; background: currentColor; opacity: .45; }
.favorite-folder-card strong { display: block; font-family: Georgia, serif; font-size: 27px; font-weight: 400; line-height: 1.05; }
.favorite-folder-card small { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; }
.favorite-folder-card:hover small { color: rgba(255,255,255,.7); }
.favorite-folder-open { position: absolute; right: 20px; bottom: 18px; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.favorite-folder-card.unfiled { border-style: dashed; }
.favorite-folder-navigation { display: flex; align-items: center; gap: 20px; }
.favorite-folder-navigation > button { border: 1px solid var(--ink); background: transparent; padding: 9px 12px; color: var(--ink); }
.favorite-folder-navigation > button:hover { background: var(--ink); color: white; }
.favorite-folder-navigation h3 { margin: 4px 0 0; font-family: Georgia, serif; font-size: 25px; font-weight: 400; }
.favorite-folder-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.favorite-folder-chip { display: inline-flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 99px; background: transparent; padding: 7px 11px; color: var(--muted); font-size: 11px; }
.favorite-folder-chip b { min-width: 20px; border-radius: 99px; background: rgba(27,27,24,.08); padding: 2px 6px; color: var(--ink); font-size: 9px; }
.favorite-folder-chip:hover, .favorite-folder-chip.active { border-color: var(--red); background: var(--red); color: white; }
.favorite-folder-chip.active b { background: rgba(255,255,255,.2); color: white; }
.favorite-folder-editor { display: grid; grid-template-columns: auto minmax(150px, 260px) auto auto 1fr; align-items: center; gap: 0; margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line); }
.favorite-folder-editor label { margin-right: 10px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.favorite-folder-editor .danger-light { border: 1px solid var(--red); background: transparent; color: var(--red); margin-left: 8px; }
.favorite-folder-editor small { margin-left: 12px; color: var(--muted); font-size: 10px; line-height: 1.35; }

dialog { width: min(1080px, calc(100vw - 30px)); max-height: calc(100vh - 30px); border: 1px solid var(--ink); padding: 0; background: var(--paper); color: var(--ink); }
dialog::backdrop { background: rgba(16,17,15,.78); }
.favorite-folder-dialog { width: min(480px, calc(100vw - 30px)); }
.favorite-folder-dialog form { display: grid; gap: 12px; padding: 28px; }
.favorite-folder-dialog h2 { margin: 0; font-family: Georgia, serif; font-size: 34px; font-weight: 400; }
.favorite-folder-dialog p { margin: 0 0 6px; color: var(--muted); font-size: 12px; }
.favorite-folder-dialog label { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.favorite-folder-dialog select { width: 100%; border: 1px solid var(--ink); background: #faf8f2; padding: 12px; color: var(--ink); }
.favorite-folder-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.favorite-folder-dialog-actions button { border: 1px solid var(--ink); background: transparent; padding: 10px 18px; color: var(--ink); }
.favorite-folder-dialog-actions button[type="submit"] { background: var(--ink); color: white; }
.dialog-close { position: sticky; float: right; top: 10px; right: 10px; z-index: 2; width: 40px; height: 40px; border: 1px solid var(--ink); background: var(--paper); font-size: 25px; }
.detail { padding: 26px; }
.detail-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 24px; margin-bottom: 20px; }
.detail h2 { font-size: clamp(34px, 5vw, 62px); max-width: 850px; line-height: .95; margin: 0; }
.detail-favorite { display: inline-flex; align-items: center; gap: 9px; border: 1px solid var(--red); border-radius: 99px; background: transparent; padding: 9px 14px; color: var(--red); white-space: nowrap; }
.detail-favorite span { font-size: 20px; line-height: 1; }
.detail-favorite strong { font-size: 11px; letter-spacing: .04em; }
.detail-favorite:hover, .detail-favorite.active { background: var(--red); color: white; }
.detail-favorite:disabled { cursor: wait; opacity: .58; }
.detail-why { max-width: 850px; margin: 0 0 20px; padding: 14px 16px; }
.detail-why strong { font-size: 10px; }
.detail-why ul { font-size: 12px; line-height: 1.55; }
.detail-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 20px 0 30px; }
.detail-gallery figure { margin: 0; background: #ded8cb; border: 1px solid #d2cabb; }
.detail-image-frame { position: relative; height: min(430px, 56vh); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.detail-image-frame.loading::before { content: ''; position: absolute; z-index: 1; inset: 0; background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.5) 46%, transparent 62%); transform: translateX(-100%); animation: image-loading 1.25s ease-in-out infinite; }
.detail-gallery img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.detail-gallery figcaption { padding: 8px 10px; font-size: 10px; color: var(--muted); border-top: 1px solid #d2cabb; }
.resolution-note { display: block; margin-top: 4px; text-transform: none; letter-spacing: 0; }
.limited-resolution .resolution-note { color: var(--pending); }
.image-unavailable .detail-image-frame::after { content: 'Anteprima non disponibile dalla fonte'; padding: 18px; color: var(--red); text-align: center; }
.image-unavailable img { display: none; }
.image-actions { padding: 0 10px 10px; }
.download-link { display: inline-block; color: var(--red); font-size: 12px; text-underline-offset: 3px; }
.load-more-wrap { grid-column: 1 / -1; display: flex; justify-content: center; padding: 22px 0 8px; }
.load-more { min-width: min(360px, 100%); border: 1px solid var(--ink); background: transparent; color: var(--ink); padding: 13px 26px; text-transform: uppercase; letter-spacing: .08em; }
.load-more:hover { background: var(--ink); color: white; }
.load-more span { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; letter-spacing: .04em; text-transform: none; }
.load-more:hover span { color: #d9d5ca; }
.remote-load-more { flex-wrap: wrap; align-items: center; gap: 10px 18px; border-top: 1px solid var(--line); }
.remote-load-more button { min-width: min(360px, 100%); border: 1px solid var(--blue); background: transparent; color: var(--blue); padding: 13px 26px; text-transform: uppercase; letter-spacing: .08em; }
.remote-load-more button:hover { background: var(--blue); color: white; }
.remote-load-more button:disabled { cursor: wait; opacity: .6; }
.remote-load-more button span { display: block; margin-top: 4px; font-size: 9px; letter-spacing: .04em; text-transform: none; }
.remote-load-more p, .remote-load-more small { margin: 0; color: var(--muted); font-size: 11px; }
.guided-feed-mode > .results-heading { display: none; }
.guided-feed-heading { grid-column: 1 / -1; display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 4px 0 2px; padding: 16px 0 13px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.guided-feed-heading > div { display: flex; align-items: baseline; gap: 9px; }
.guided-feed-heading span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.guided-feed-heading strong { font-family: Georgia, serif; font-size: 28px; font-weight: 400; }
.guided-feed-heading small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.detail-storage-note { margin: -15px 0 28px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 30px; border-top: 1px solid var(--ink); }
.field { padding: 12px 0; border-bottom: 1px solid var(--line); }
.field dt { text-transform: uppercase; letter-spacing: .1em; font-size: 10px; color: var(--muted); margin-bottom: 5px; }
.field dd { margin: 0; line-height: 1.4; }
.source-metadata { margin-top: 22px; border: 1px solid var(--line); }
.source-metadata > summary { cursor: pointer; padding: 14px 16px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.source-metadata .detail-grid { margin: 0 16px 16px; }
.official-resource-links { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 18px; }
.official-resource-links a { color: var(--blue); font-size: 12px; font-weight: 700; text-underline-offset: 3px; }
.provenance { margin-top: 24px; border: 1px solid var(--verified); padding: 16px; color: var(--verified); }
.provenance a { color: inherit; font-weight: 700; }

footer { border-top: 1px solid var(--ink); padding: 22px clamp(22px, 6vw, 92px); display: flex; justify-content: space-between; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
footer a { color: var(--ink); }
.footer-links { display: flex; gap: 22px; }

@keyframes image-loading {
  to { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
  .image-wrap.loading::before, .detail-image-frame.loading::before { animation: none; }
}

@media (max-width: 720px) {
  .brand-row { gap: 20px; }
  .brand-lockup { width: 86px; }
  .product-title-main { font-size: clamp(40px, 11vw, 68px); }
  .product-title-context { margin-top: 13px; letter-spacing: .12em; white-space: normal; }
  .product-title-context::after { display: none; }
  .product-subtitle { margin-top: 12px; }
  .search-row { grid-template-columns: 1fr; }
  .search-row:has(.search-cancel:not([hidden])) { grid-template-columns: 1fr; }
  .search-row button { border-left: 0; border-top: 1px solid var(--ink); padding: 14px; }
  .workspace-actions { min-height: 58px; }
  .mode-grid { grid-template-columns: 1fr; }
  .source-divider { grid-template-columns: auto minmax(30px, 1fr) auto; gap: 7px 10px; margin-top: 12px; }
  .source-divider-kicker { grid-column: 1 / -1; }
  .source-divider i { grid-column: 2; }
  .source-divider-action { grid-column: 3; grid-row: 2; }
  .source-divider-title { align-items: flex-start; flex-direction: column; gap: 4px; }
  .source-divider strong { font-size: 21px; }
  .detail-heading { grid-template-columns: 1fr; gap: 14px; }
  .detail-favorite { justify-self: start; }
  .mode-card { min-height: 180px; }
  .search-options-content { grid-template-columns: 1fr; align-items: start; }
  .search-filter-actions { align-items: stretch; flex-direction: column; }
  .search-filter-actions button { width: 100%; }
  .search-shortcuts { align-items: flex-start; flex-direction: column; }
  .explore-entry { align-items: flex-start; flex-direction: column; }
  .visual-search-panel { align-items: flex-start; flex-direction: column; }
  .intent-grid { grid-template-columns: 1fr 1fr; }
  .guided-intro { grid-template-columns: 1fr; }
  .guided-steps { grid-template-columns: 1fr; }
  .guided-steps.iccd-steps { grid-template-columns: 1fr; }
  .guided-steps.iccd-location-steps { grid-template-columns: 1fr; }
  .visual-site-grid { grid-template-columns: 1fr; }
  .register-grid { grid-template-columns: 1fr; }
  .project-grid, .node-grid { grid-template-columns: 1fr; }
  .project-suggestion-grid { grid-template-columns: 1fr; }
  .guided-toolbar, .manifest-box { grid-template-columns: 1fr; }
  .iccd-region-control { grid-template-columns: 1fr; }
  .tome-visual-search .guided-toolbar { grid-template-columns: 1fr; }
  .project-scope-search .guided-toolbar { grid-template-columns: 1fr; }
  .visual-concept-heading { align-items: flex-start; flex-direction: column; }
  .visual-concept-heading > strong { text-align: left; }
  .visual-concept-grid { grid-template-columns: 1fr; }
  .guided-feed-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
  .guided-feed-heading > div { align-items: flex-start; flex-direction: column; gap: 4px; }
  .continuing-search-banner { align-items: stretch; flex-direction: column; }
  .visible-level-search .guided-toolbar { grid-template-columns: 1fr; }
  .favorite-organizer-heading { align-items: stretch; flex-direction: column; }
  .favorite-folder-create { grid-template-columns: 1fr auto; }
  .grid.favorite-folders-view { grid-template-columns: 1fr; }
  .favorite-folder-card { min-height: 190px; }
  .favorite-folder-navigation { align-items: flex-start; flex-direction: column; }
  .favorite-folder-editor { grid-template-columns: 1fr auto; gap: 8px; }
  .favorite-folder-editor label, .favorite-folder-editor small { grid-column: 1 / -1; margin: 0; }
  .favorite-folder-editor .danger-light { margin: 0; border-left: 1px solid var(--red); }
  .register-card { grid-template-columns: 120px 1fr; grid-template-rows: auto; }
  .register-card img { width: 120px; height: 100%; min-height: 150px; border-bottom: 0; border-right: 1px solid var(--line); }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-image-frame { height: 330px; }
}

@media (max-width: 480px) {
  .masthead { padding-top: 18px; }
  .brand-row { align-items: flex-start; gap: 16px; }
  .brand-lockup { width: 68px; }
  .product-title-main { font-size: clamp(35px, 10.6vw, 48px); line-height: .88; }
  .product-title-context { gap: 6px; margin-top: 10px; font-size: 8px; line-height: 1.35; }
  .product-title-context::before { width: 18px; margin-right: 0; }
  .product-subtitle { max-width: 300px; margin-top: 9px; font-size: 9px; line-height: 1.35; }
  .powered-by { display: block; }
  .powered-by img { margin: 2px auto 0; }
  .intent-grid { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Schermate aggiunte dalla versione PHP: accesso, diagnostica, sessione.
   -------------------------------------------------------------------------- */

.session-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  padding: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.session-user strong { color: var(--ink); font-weight: 600; }

.session-link {
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.session-link:hover { border-bottom-color: var(--blue); }

.gate-body { display: flex; min-height: 100vh; }

.gate { margin: auto; padding: 24px; width: 100%; max-width: 420px; }

.gate-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 32px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .06);
}

.gate-card h1 { margin: 0; font-size: 26px; letter-spacing: -.01em; }

.gate-subtitle { margin: 2px 0 24px; color: var(--muted); font-size: 14px; }

.gate-card label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--muted);
}

.gate-card input[type="text"],
.gate-card input[type="password"] {
  width: 100%;
  padding: 11px 12px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
  font: inherit;
  color: var(--ink);
}

.gate-card input:focus { outline: 2px solid var(--blue); outline-offset: 1px; }

.gate-card button {
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 3px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.gate-card button:disabled { background: var(--muted); cursor: not-allowed; }

.gate-error {
  margin: 0 0 18px;
  padding: 10px 12px;
  border-left: 3px solid var(--red);
  background: rgba(163, 52, 42, .07);
  color: var(--red);
  font-size: 14px;
}

.gate-note { margin: 16px 0 0; font-size: 13px; color: var(--muted); }

.admin { max-width: 900px; margin: 0 auto; padding: 32px 24px 64px; }

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 8px;
}

.admin h1 { font-size: 24px; margin: 0; }

.admin h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin: 36px 0 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: #fff;
  border: 1px solid var(--line);
}

.admin-table td, .admin-table th {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-weight: 400;
}

.admin-table tr:last-child td,
.admin-table tr:last-child th { border-bottom: 0; }

.admin-table th { font-weight: 600; white-space: nowrap; }
.admin-table td:first-child { width: 28px; font-weight: 700; }
.check-ok td:first-child { color: var(--verified); }
.check-ko td:first-child { color: var(--red); }
.check-ko { background: rgba(163, 52, 42, .05); }

.admin-note { font-size: 14px; color: var(--muted); max-width: 62ch; }

.admin-action, .admin-form button {
  padding: 9px 14px;
  margin: 0 8px 8px 0;
  border: 1px solid var(--blue);
  border-radius: 3px;
  background: #fff;
  color: var(--blue);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.admin-action:hover, .admin-form button:hover { background: var(--blue); color: #fff; }
.admin-action:disabled { opacity: .5; cursor: progress; }

.admin-form { display: flex; gap: 8px; flex-wrap: wrap; }

.admin-form input {
  flex: 1 1 240px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  font: inherit;
}

.admin-output {
  margin-top: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 12.5px;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
