/* ---------- Boot ---------- */
.boot { min-height: 100vh; width: 100%; display: grid; place-content: center; text-align: center; gap: 6px; color: var(--brass-bright); background: var(--walnut-900); }
.boot span { font-family: var(--font-display); font-size: 2.4rem; letter-spacing: .4em; padding-left: .4em; }
.boot small { color: var(--on-dark-3); }

/* ---------- Generic bits ---------- */
.linkbtn { background: none; border: 0; padding: 0; color: var(--brass-ink); text-decoration: underline; cursor: pointer; font: inherit; text-align: left; }
.linkbtn.strong, .strong { font-weight: 700; color: var(--ink); }
.linkbtn.strong { text-decoration: none; }
.linkbtn.strong:hover { text-decoration: underline; }
.strong-link { font-weight: 700; color: var(--ink); text-decoration: none; }
.strong-link:hover { text-decoration: underline; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; }
.calm { display: flex; gap: 8px; align-items: center; color: var(--healthy); font-weight: 600; padding: 12px 0; border-top: 1px solid var(--rule); }
.mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.mini-list li { padding-bottom: 10px; border-bottom: 1px solid var(--rule); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot-critical { background: var(--critical); } .dot-attention { background: #c88a14; } .dot-healthy { background: var(--healthy); }

/* ---------- Asset page ---------- */
.crumbs { display: flex; gap: 10px; align-items: center; font-size: .9rem; margin-bottom: 14px; }
.crumbs a { display: inline-flex; align-items: center; gap: 4px; }
.asset-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 22px; align-items: start; padding-bottom: 20px; border-bottom: 1px solid var(--rule); }
.vitrine {
  position: relative; width: 150px; height: 140px; border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 14px; overflow: hidden;
  background: radial-gradient(ellipse 80% 70% at 50% 0%, #3b5a47, #1c2e24 70%); box-shadow: inset 0 0 0 4px #4a2f1c, inset 0 0 0 5px rgba(216,184,116,.5), inset 0 0 30px rgba(0,0,0,.6);
}
.vitrine .mini { width: 92px; position: relative; z-index: 1; filter: drop-shadow(0 6px 5px rgba(0,0,0,.5)); }
.vitrine .plinth { width: 70px; height: 8px; background: linear-gradient(180deg, #caa75f 0 1.5px, #3a2414 1.5px); }
.vitrine .spot { position: absolute; inset: 0; opacity: 1; background: conic-gradient(from 180deg at 50% -6%, transparent 158deg, rgba(255,228,165,.28) 180deg, transparent 202deg); }
.asset-title .h1 { overflow-wrap: anywhere; }
.badges { margin-top: 8px; }
.asset-actions { justify-content: flex-end; }
.asset-actions .menu-list { min-width: 250px; }
.photos { display: flex; gap: 8px; overflow-x: auto; margin-top: 12px; }
.photos:empty { display: none; }
.photos img { height: 120px; border-radius: var(--radius); border: 1px solid var(--rule); }
.next-action { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin: 20px 0 0; padding: 14px 18px; border-radius: var(--radius); border: 1px solid var(--rule); border-left: 4px solid var(--info); background: var(--ivory); }
.next-action.critical { border-left-color: var(--critical); background: #fbf1ee; }
.next-action.attention { border-left-color: #c88a14; background: #fcf5e6; }
.next-action.healthy { border-left-color: var(--healthy); }
.na-title { font-weight: 700; font-size: 1.1rem; margin: 0; }
.next-action .muted { margin: 2px 0 0; max-width: 70ch; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px 24px; margin: 22px 0 0; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.facts dt { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; margin-bottom: 3px; }
.facts dd { margin: 0; line-height: 1.55; }
.facts .pill { margin: 2px 0; }
.gaps { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; font-size: .9rem; color: var(--ink-2); margin: 14px 0 0; }
.gaps > span { flex: 1; min-width: 220px; }
.tabs { display: flex; gap: 2px; margin-top: 26px; border-bottom: 1px solid var(--rule-strong); overflow-x: auto; scrollbar-width: none; }
.tabs [role=tab] { border: 0; background: none; padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs [role=tab][aria-selected='true'] { color: var(--ink); border-bottom-color: var(--brass-deep); }
.tabs [role=tab]:hover { color: var(--ink); }
[role=tabpanel] { padding-top: 20px; outline: none; }
[role=tabpanel]:focus-visible { outline: 2px solid var(--brass); outline-offset: 4px; }
.doclist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.docline { width: 100%; display: flex; gap: 12px; align-items: center; padding: 12px 6px; border: 0; border-bottom: 1px solid var(--rule); background: none; cursor: pointer; text-align: left; color: var(--ink); }
.docline:hover { background: rgba(255,255,255,.4); }
.docline-main { flex: 1; min-width: 0; display: grid; }
.docline-main .strong { overflow-wrap: anywhere; }
.docline-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cover { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.cover-item { display: flex; justify-content: space-between; gap: 16px; padding: 14px 4px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.cover-item p { margin: 0 0 3px; }
.cover-state { display: grid; gap: 6px; justify-items: end; }
.chart-fig { max-width: 860px; margin: 0 0 14px; padding: 12px 14px 8px; background: var(--ivory); border: 1px solid var(--rule); border-radius: var(--radius); }

/* ---------- Overview ---------- */
.briefing { padding: 18px 20px; }
.brief-lead { font-family: var(--font-display); font-size: 1.3rem; line-height: 1.3; margin: 10px 0 12px; color: var(--ivory); }
.brief-list { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 8px; font-size: .92rem; }
.brief-list a { color: var(--on-dark); }
.brief-list a:hover { color: var(--brass-bright); }
.brief-k { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--brass-bright); font-weight: 700; margin-right: 4px; }
.valuenote { margin: 12px 0 0; padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--ivory); }
.valuenote strong { font-family: var(--font-display); font-size: 1.5rem; margin-left: 6px; }

/* ---------- Collection grid ---------- */
.agrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.acard { position: relative; display: grid; border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--ivory); overflow: hidden; }
.acard-link { display: grid; gap: 2px; padding: 0 14px 10px; text-decoration: none; color: var(--ink); }
.acard-art { display: flex; justify-content: center; align-items: flex-end; height: 118px; margin: 0 -14px 10px; padding-bottom: 10px; background: radial-gradient(ellipse 80% 80% at 50% 0%, #3b5a47, #1c2e24 75%); box-shadow: inset 0 -3px 0 #b8954f; }
.acard-art .mini { width: 92px; filter: drop-shadow(0 6px 5px rgba(0,0,0,.5)); }
.acard-name { font-weight: 700; overflow-wrap: anywhere; }
.acard-sub { font-size: .84rem; }
.acard-foot { padding: 0 14px 14px; display: flex; gap: 6px; flex-wrap: wrap; }
.acard-sel { position: absolute; top: 8px; left: 8px; z-index: 2; background: rgba(251,247,238,.92); border-radius: 3px; padding: 4px; line-height: 0; }
.acard-sel input { width: 18px; height: 18px; accent-color: var(--walnut-800); }
.tiny-art { display: inline-flex; width: 44px; height: 36px; border-radius: 3px; background: radial-gradient(ellipse at 50% 0%, #3b5a47, #1c2e24); align-items: center; justify-content: center; flex-shrink: 0; }
.tiny-art .mini { width: 34px; }
.tbl input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--walnut-800); }
.bulkbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--brass); border-radius: var(--radius); background: #fbf3df; position: sticky; top: 64px; z-index: 3; }
.bulkbar p { margin: 0 8px 0 0; }

/* ---------- Documents ---------- */
.dropstrip { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 10px; margin-bottom: 14px; border: 1px dashed var(--rule-strong); border-radius: var(--radius); color: var(--ink-3); font-size: .9rem; }
.dropstrip.over { border-color: var(--brass-deep); background: #fffaf0; color: var(--ink); border-width: 2px; padding: 22px; }
.doctbl td { vertical-align: middle; }

/* ---------- Tasks page ---------- */
details.group > summary { list-style: none; cursor: pointer; }
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary::after { content: '▾'; color: var(--ink-3); margin-left: 4px; }
details.group:not([open]) > summary::after { content: '▸'; }

/* ---------- Insights ---------- */
.cal { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.cal-m { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 6px; border-bottom: 1px solid var(--rule); padding-bottom: 4px; }
.cal ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cal li li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .92rem; }

/* ---------- Settings ---------- */
.set { padding: 24px 0; border-bottom: 1px solid var(--rule); scroll-margin-top: 80px; }
.set > .sec-title { margin-bottom: 14px; }
.set-row { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 14px 0; border-top: 1px solid var(--rule); flex-wrap: wrap; }
.set-row > div:first-child { flex: 1; min-width: 260px; }
.set-row .h3 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.set-row p { margin: 4px 0 0; max-width: 70ch; font-size: .92rem; }
.set-row-grid { padding-top: 14px; border-top: 1px solid var(--rule); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .9rem; }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: 13px; background: var(--paper-3); border: 1px solid var(--rule-strong); position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0; }
.switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .2s; }
.switch input:checked { background: var(--forest); border-color: var(--forest); }
.switch input:checked::after { transform: translateX(18px); }
.switch input:disabled { opacity: .5; cursor: not-allowed; }
.switch span { color: var(--ink-2); }

/* ---------- Assistant ---------- */
.assist {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(440px, 100vw); display: flex; flex-direction: column;
  background: var(--paper); border-left: 1px solid var(--rule-strong); box-shadow: -20px 0 50px rgba(0,0,0,.25);
}
@media (prefers-reduced-motion: no-preference) { .assist { animation: slide-in .25s var(--ease); } @keyframes slide-in { from { transform: translateX(30px); opacity: 0; } } }
.assist-head { display: flex; justify-content: space-between; gap: 10px; padding: 16px 18px 12px; background: linear-gradient(180deg, var(--walnut-800), var(--walnut-900)); color: var(--on-dark); }
.assist-title { font-family: var(--font-display); font-size: 1.45rem; margin: 0; display: flex; gap: 8px; align-items: center; color: var(--brass-bright); }
.assist-sub { margin: 6px 0 0; font-size: .8rem; color: var(--on-dark-2); display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.assist-head .btn-icon:hover { background: rgba(255,255,255,.08); }
.assist-log { flex: 1; overflow-y: auto; padding: 16px 18px; display: grid; gap: 12px; align-content: start; }
.assist-empty p { margin: 0 0 10px; color: var(--ink-2); }
.assist-empty .chips { display: grid; gap: 6px; }
.assist-empty .chip { justify-content: flex-start; border-radius: var(--radius); text-align: left; }
.chip-sm { font-size: .8rem; padding: 4px 9px; }
button.chip { font: inherit; font-size: .88rem; color: var(--ink); }
button.chip:hover { border-color: var(--brass-deep); }
.msg p { margin: 0; }
.msg-user { justify-self: end; max-width: 85%; background: var(--walnut-800); color: var(--on-dark); padding: 9px 13px; border-radius: 12px 12px 2px 12px; }
.msg-bot { max-width: 100%; background: var(--ivory); border: 1px solid var(--rule); padding: 12px 14px; border-radius: 2px 12px 12px 12px; display: grid; gap: 10px; }
.msg-err { border-color: #e3b5ac; background: var(--critical-bg); }
.msg-err p { display: flex; gap: 6px; align-items: flex-start; }
.blk-title { font-weight: 700; font-size: .85rem; margin: 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.blk-list { margin: 0; padding-left: 18px; display: grid; gap: 5px; font-size: .92rem; }
.blk-note { font-size: .84rem; color: var(--ink-3); display: flex; gap: 6px; align-items: flex-start; margin: 0; }
.blk-table th { width: 42%; font-weight: 600; color: var(--ink-2); }
.draft { border: 1px dashed var(--rule-strong); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 8px; background: var(--paper); }
.draft-msg { white-space: pre-wrap; font: inherit; font-size: .88rem; margin: 0; padding: 10px; background: #fff; border: 1px solid var(--rule); border-radius: 3px; }
.dl-tight { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px 12px; font-size: .9rem; }
.sources { margin: 0; color: var(--ink-3); }
.thinking { display: inline-flex; gap: 4px; padding: 4px 0; }
.thinking span:not(.sr-only) { width: 7px; height: 7px; border-radius: 50%; background: var(--brass); opacity: .4; }
@media (prefers-reduced-motion: no-preference) {
  .thinking span:not(.sr-only) { animation: blink 1s infinite; }
  .thinking span:nth-child(2) { animation-delay: .15s; } .thinking span:nth-child(3) { animation-delay: .3s; }
  @keyframes blink { 50% { opacity: 1; } }
}
.caret { display: inline-block; width: 7px; height: 1em; background: var(--brass-deep); margin-left: 2px; vertical-align: -2px; }
.assist-form { display: flex; gap: 8px; padding: 12px 14px 6px; border-top: 1px solid var(--rule); background: var(--ivory); }
.assist-form textarea { min-height: 44px; max-height: 140px; resize: none; }
.assist-foot { margin: 0; padding: 0 14px 12px; font-size: .76rem; color: var(--ink-3); background: var(--ivory); }

/* ---------- Search ---------- */
.search-box { display: flex; align-items: center; gap: 8px; border: 1px solid var(--rule-strong); border-radius: var(--radius); padding: 0 10px; background: var(--ivory); }
.search-box input { border: 0 !important; outline: none !important; background: transparent; padding-left: 0; }
.gs-list { list-style: none; margin: 12px 0 8px; padding: 0; max-height: 50vh; overflow-y: auto; }
.gs-list li { display: flex; gap: 10px; align-items: baseline; padding: 9px 10px; border-radius: 3px; cursor: pointer; }
.gs-list li[aria-selected='true'], .gs-list li:hover { background: var(--paper-2); }
.gs-kind { font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--brass-ink); font-weight: 700; min-width: 70px; }

/* ---------- Welcome ---------- */
.welcome-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 14px; }
.choice { display: grid; gap: 4px; text-align: left; padding: 14px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--ivory); cursor: pointer; }
.choice:hover { border-color: var(--brass-deep); background: #fffdf7; }
.choice:first-child { background: var(--walnut-800); color: var(--on-dark); border-color: var(--walnut-800); }
.choice:first-child strong { color: var(--brass-bright); }
.choice span { font-size: .86rem; color: inherit; opacity: .85; }

@media (max-width: 860px) {
  .asset-head { grid-template-columns: auto minmax(0, 1fr); }
  .asset-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .welcome-choices { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .assist { width: 100vw; bottom: 0; }
  .vitrine { width: 96px; height: 96px; }
  .vitrine .mini { width: 64px; }
  .asset-head { gap: 14px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .bulkbar { top: 58px; }
  .menu-list { right: auto; left: 0; }
  .task-actions .menu-list, .asset-actions .menu-list { right: 0; left: auto; }
}
.set-row > select { width: auto; min-width: 180px; }
