:root {
  --green:#0b2e2a; --peach:#e7a477; --cream:#f9f0e1; --clay:#87452f; --ink:#1d1d1b; --white:#fff;
  --paper:#faf8f3; --line:#ded5c7; --muted:#62594f;
  color:var(--ink); background:var(--paper); font:16px/1.48 system-ui,sans-serif;
}
* { box-sizing:border-box }
[hidden] { display:none!important }
body { margin:0 }
input, select, textarea, button { font:inherit }
a { color:var(--clay); text-underline-offset:.18em }
.skip { position:absolute; left:12px; top:-100px; padding:10px 12px; background:var(--white) }
.skip:focus { top:10px; z-index:2 }
:focus-visible { outline:3px solid var(--clay); outline-offset:3px }
.topbar { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px clamp(18px,4vw,58px); background:var(--cream); border-bottom:1px solid var(--line) }
.brand { display:block }
.brand img { display:block; object-fit:contain; width:min(190px,48vw); height:auto }
.account { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:8px }
.account span { padding-right:6px; color:var(--muted); font-size:.875rem }
main { max-width:1600px; margin:auto }
h1,h2,h3,p { margin:0 }
h1,h2 { font-family:Georgia,serif; font-weight:400; line-height:1.15 }
h1 { font-size:clamp(2rem,4vw,3.35rem); letter-spacing:-.035em }
h2 { font-size:clamp(1.5rem,3vw,2.15rem) }
button { cursor:pointer; border-radius:6px; min-height:44px }
button:disabled { cursor:wait; opacity:.6 }
.primary,.secondary { padding:8px 14px; font-weight:600; border:1px solid var(--line) }
.primary { background:var(--clay); color:var(--white); border-color:var(--clay) }
.secondary { background:var(--white); color:var(--ink) }
.primary:hover { background:var(--green); border-color:var(--green) }
.secondary:hover { background:var(--cream) }
.welcome { margin:clamp(26px,7vw,94px) auto; width:min(860px,calc(100% - 36px)); display:grid; grid-template-columns:1.1fr 1fr; background:var(--white); border:1px solid var(--line); border-radius:16px; overflow:hidden }
.welcome-title { background:var(--peach); padding:clamp(30px,6vw,65px) clamp(24px,5vw,52px); color:var(--ink); border-left:10px solid var(--clay) }
.welcome-title p { text-transform:uppercase; letter-spacing:.12em; font-size:.8rem; font-weight:700; color:#4d281c }
.welcome-title h1 { margin:16px 0 24px; font-size:clamp(2.5rem,6vw,4.4rem) }
.welcome-form { padding:clamp(24px,4vw,44px) }
.welcome form { display:grid; gap:14px }
.palette { display:flex; gap:4px }
.palette i { width:24px; height:7px; background:var(--green) }
.palette i:nth-child(2){background:var(--clay)} .palette i:nth-child(3){background:var(--white)} .palette i:nth-child(4){background:var(--ink)} .palette i:nth-child(5){background:var(--cream)} .palette i:nth-child(6){background:var(--peach); outline:1px solid var(--clay)}
.library { padding:25px clamp(16px,4vw,58px) 50px; display:grid; grid-template-columns:190px minmax(0,1fr); gap:clamp(13px,3vw,42px) }
.shelf nav { display:grid; gap:7px }
.shelf button { display:flex; width:100%; gap:10px; align-items:center; justify-content:space-between; border:1px solid transparent; color:var(--ink); background:transparent; text-align:left; padding:9px 12px; font-weight:600 }
.shelf button small { color:var(--muted) }
.shelf button[aria-current="true"] { border-color:var(--line); background:var(--white) }
.shelf button:hover { background:var(--cream) }
.shelf button.guide { border-left:4px solid var(--green) }
.shelf button.inspiration { border-left:4px solid var(--peach) }
.shelf button.research { border-left:4px solid var(--ink) }
.shelf button.jobs { border-left:4px solid var(--clay) }
.review-link { display:flex; align-items:center; min-height:44px; padding:8px 12px; margin-top:9px; border:1px solid var(--line); border-left:4px solid var(--peach); border-radius:6px; background:var(--white); font-weight:600 }
.review-link:hover { background:var(--cream) }
.catalogue-header { background:var(--cream); padding:clamp(17px,3vw,30px); border-radius:12px; border:1px solid var(--line); border-top:5px solid var(--peach) }
.catalogue-title,.results-header,.form-header { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px }
.catalogue-title h1 { color:var(--ink) }
.search { display:grid; grid-template-columns:minmax(0,1.7fr) repeat(2,minmax(0,1fr)); gap:12px; margin-top:18px }
label { display:grid; gap:5px; font-size:.875rem; font-weight:600 }
input,select,textarea { width:100%; min-width:0; max-width:100%; border:1px solid #bcb2a4; border-radius:5px; padding:8px 10px; min-height:44px; background:var(--white); color:var(--ink) }
select { text-overflow:ellipsis }
textarea { resize:vertical }
small { font-size:.8125rem; color:var(--muted) }
.results-header { margin:14px 0 10px; min-height:34px; color:var(--muted) }
.results { display:grid; gap:12px; grid-template-columns:repeat(auto-fit,minmax(min(100%,265px),1fr)) }
.record { text-align:left; background:var(--white); border:1px solid var(--line); border-top:4px solid var(--green); padding:14px 15px; display:flex; flex-direction:column; gap:6px; color:var(--ink); align-items:flex-start; width:100% }
.record:hover { background:var(--cream) }
.record.inspiration { border-top-color:var(--peach); background:#fff4e9 }
.record.research { border-top-color:var(--ink) }
.record.jobs { border-top-color:var(--clay); background:#f8e9df }
.kind { display:inline-block; color:var(--green); font-size:.75rem; font-weight:700; letter-spacing:.04em; text-transform:uppercase }
.inspiration .kind,.jobs .kind { color:var(--clay) }
.research .kind { color:var(--ink) }
.record strong { font-family:Georgia,serif; font-size:1.2rem; line-height:1.2; font-weight:400 }
.record .description { color:#51493f; font-size:.88rem }
#more { margin-top:16px }
.message { color:#783b28; margin-top:12px }
dialog { width:min(660px,calc(100% - 30px)); border:1px solid var(--line); border-radius:12px; padding:0; color:var(--ink); background:var(--white); max-height:calc(100dvh - 30px) }
dialog::backdrop { background:#1d1d1b9c }
.dialog-inner { padding:clamp(16px,3vw,27px); display:grid; gap:13px }
.dialog-actions { display:flex; justify-content:flex-end; gap:8px; flex-wrap:wrap }
.detail article { display:grid; gap:11px }
.detail .detail-meta { color:var(--muted); font-size:.875rem }
.detail-notes { white-space:pre-wrap; padding:12px 14px; background:var(--cream); border-left:4px solid var(--peach) }
.detail-sources { padding-left:20px; margin:0; display:grid; gap:8px }
.detail-sources a { overflow-wrap:anywhere }
.detail-figure { margin:0; padding:8px; border:1px solid var(--line); border-radius:6px }
.detail-figure img { width:100%; height:auto; display:block }
.detail-figure figcaption { margin-top:6px }
dialog .form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px }
@media(max-width:760px){
  .library{grid-template-columns:1fr;padding-top:14px}
  .shelf nav{display:flex;flex-wrap:wrap;gap:6px}
  .shelf button{width:auto;min-height:44px;padding:6px 8px;font-size:.875rem}
  .search{grid-template-columns:1fr 1fr}
  .search label:first-child{grid-column:1/-1}
}
@media(max-width:520px){
  .welcome{grid-template-columns:1fr}
  .topbar{align-items:flex-start}
  .account span{display:none}
  .account button,.dialog-actions button{padding:6px 9px;font-size:.8125rem}
  dialog .form-grid{grid-template-columns:1fr}
}
