 :root{--ink:#202522;--muted:#69716c;--paper:#f7f5ef;--panel:#fffefa;--line:#e4e1d7;--green:#315d4e;--gold:#d59a35;--shadow:0 12px 30px rgba(31,38,33,.06)}*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font:15px/1.5 system-ui,sans-serif}.site-header{height:72px;padding:0 max(24px,calc((100vw - 1320px)/2));border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;background:#fbfaf6}.brand{font:600 21px Georgia,serif;color:var(--ink);text-decoration:none}.brand span{color:var(--gold);margin-right:6px}.header-actions{display:flex;align-items:center;gap:18px}.local-note{font-size:13px;color:var(--muted)}button{font:inherit;cursor:pointer}.quiet-button,.filter-button,.secondary-button{border:1px solid var(--line);border-radius:7px;background:transparent;padding:8px 12px;color:var(--ink)}.workspace{max-width:1320px;margin:auto;padding:42px 24px 56px}.project-bar{display:flex;justify-content:space-between;align-items:end;margin-bottom:28px}.eyebrow{margin:0 0 5px;text-transform:uppercase;color:var(--green);font-size:11px;letter-spacing:.08em}.project-bar h1,.panel h2{font:600 32px/1.1 Georgia,serif;margin:0}.project-description{margin:8px 0 0;color:var(--muted)}.primary-button{border:0;border-radius:7px;background:var(--green);color:white;padding:11px 16px;font-weight:600}.summary-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:22px}.summary-grid article{padding:16px 18px;background:#eef1e9;border-radius:8px}.summary-grid p{margin:0;color:var(--muted)}.summary-grid .metric{font:600 23px Georgia,serif;color:var(--ink)}.content-grid{display:grid;grid-template-columns:minmax(280px,1fr) minmax(360px,1.35fr) 270px;gap:18px;align-items:start}.panel{background:var(--panel);border:1px solid var(--line);box-shadow:var(--shadow);border-radius:10px;padding:20px}.panel-heading,.detail-top,.section-title,.detail-footer{display:flex;align-items:center;justify-content:space-between;gap:12px}.panel h2{font-size:24px}.search{display:flex;align-items:center;border:1px solid var(--line);border-radius:7px;padding:0 10px;margin:20px 0 8px;background:white}.search input{border:0;outline:0;width:100%;padding:10px 4px;font:inherit;background:transparent}.search span{color:var(--muted);font-size:19px}.count{margin:0 0 12px;color:var(--muted);font-size:12px}.fact-list,.connections ul,.review-panel ul{list-style:none;margin:0;padding:0}.fact-list{display:grid;gap:7px}.fact-card{display:grid;width:100%;text-align:left;border:1px solid transparent;background:transparent;border-radius:7px;padding:11px;color:var(--ink);gap:3px}.fact-card:hover,.fact-card:focus-visible,.fact-card.selected{background:#eff5f0;border-color:#b7cec0;outline:none}.fact-card strong{font-size:14px}.fact-card>span:not(.fact-type){font-size:12px;color:var(--muted)}.fact-card small{color:#8a5c14;font-weight:600;font-size:11px}.fact-type{width:max-content;border-radius:99px;padding:2px 6px;text-transform:uppercase;font-size:10px;background:#e5ede7;color:var(--green)}.fact-type.rule{background:#f6ebd8;color:#8a5c14}.fact-type.place{background:#e6eff4;color:#386778}.fact-type.event{background:#eee6f2;color:#6d4a7b}.detail-panel{min-height:536px}.status-line{display:flex;gap:7px;align-items:center;margin:18px 0;color:#8a5c14;font-size:13px;font-weight:600}.status-dot{width:8px;height:8px;background:var(--gold);border-radius:50%}.detail-body{font:16px/1.65 Georgia,serif;margin:0 0 20px;max-width:52ch}.tag-row{display:flex;gap:6px;flex-wrap:wrap}.tag-row span{background:#eef1e9;padding:4px 8px;border-radius:99px;color:#465c4e;font-size:12px}.connections{border-top:1px solid var(--line);margin-top:24px;padding-top:20px}.connections h3{font-size:14px;margin:0}.text-button{border:0;background:transparent;padding:0;color:var(--green);font-size:13px;font-weight:600}.connections li{border-bottom:1px solid var(--line);padding:12px 0}.connections a,.review-panel a{color:var(--ink);text-decoration:none;font-weight:600;font-size:13px}.connections a span{color:var(--muted);font-weight:400;margin-left:5px}.detail-footer{margin-top:28px;color:var(--muted);font-size:12px}.danger{color:#a34235}.review-panel{background:#315d4e;color:#fff;border:0}.review-panel .eyebrow{color:#cee3d4}.review-panel h2{font-size:24px}.review-panel>p:not(.eyebrow){color:#d9e8de;font-size:13px}.review-panel li{display:grid;padding:12px 0;border-top:1px solid rgba(255,255,255,.18)}.review-panel a{color:#fff}.review-panel li span{color:#c3d8ca;font-size:11px;margin-top:2px}.secondary-button{width:100%;margin-top:18px;background:#fff;color:var(--green);border:0;font-weight:600}.skip-link{position:absolute;left:-9999px}.skip-link:focus{left:12px;top:12px;z-index:2;background:#fff;padding:8px;color:#000}@media(max-width:1000px){.content-grid{grid-template-columns:1fr 1fr}.review-panel{grid-column:1/-1}.review-panel ul{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}}@media(max-width:680px){.site-header{padding:0 16px}.local-note{display:none}.workspace{padding:28px 16px}.project-bar{align-items:start;gap:18px;flex-direction:column}.summary-grid,.content-grid{grid-template-columns:1fr}.review-panel ul{grid-template-columns:1fr}.panel{padding:17px}.project-bar h1{font-size:29px}.header-actions{gap:8px}}
.workspace-status{min-height:1.5em;margin:0 0 12px;color:var(--muted);font-size:13px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.connection-button,.review-panel li button{border:0;background:transparent;padding:0;color:inherit;font:inherit;text-align:left}.connection-button{color:var(--ink);font-weight:600;font-size:13px}.connection-button span{color:var(--muted);font-weight:400;margin-left:5px}.review-panel li button{color:#fff;font-weight:600;font-size:13px}.empty-list{padding:12px 0;color:var(--muted);font-size:13px}.muted-tag{color:var(--muted)!important}.workspace-status{min-height:1.5em;margin:0 0 14px;color:var(--muted)}dialog{width:min(520px,calc(100% - 32px));border:1px solid var(--line);border-radius:10px;padding:24px;background:var(--panel);color:var(--ink);box-shadow:var(--shadow)}dialog::backdrop{background:rgba(26,34,29,.42)}dialog h2{font:600 25px Georgia,serif;margin:0 0 14px}dialog form{display:grid;gap:14px}dialog label{display:grid;gap:5px;font-weight:600}dialog input,dialog select,dialog textarea{width:100%;border:1px solid var(--line);border-radius:6px;padding:8px;font:inherit;background:#fff;color:var(--ink)}dialog textarea{min-height:100px;resize:vertical}.dialog-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:4px}.form-error{margin:0;color:#a34235;font-weight:600}.dialog-note{margin:0;color:var(--muted)}.danger-button{background:#a34235}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #d59a35;outline-offset:2px}
.detail-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
 .recovery-panel{max-width:720px;margin-bottom:22px}.recovery-panel h1{font:600 28px/1.1 Georgia,serif;margin:0}.recovery-panel p:not(.eyebrow){max-width:62ch;color:var(--muted)}.recovery-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:18px}.project-controls{display:flex;align-items:end;gap:10px;margin-top:18px}.project-switcher{display:grid;gap:4px;width:min(100%,340px);color:var(--muted);font-size:12px;font-weight:600}.project-switcher select{width:100%;border:1px solid var(--line);border-radius:7px;padding:8px;background:#fff;color:var(--ink);font:inherit}@media(max-width:680px){.project-controls{align-items:stretch;flex-direction:column}.project-controls .quiet-button{width:max-content}}
.tag-filter{display:flex;align-items:end;gap:12px;margin:0 0 8px;flex-wrap:wrap}.tag-filter label{display:grid;gap:4px;color:var(--muted);font-size:12px;font-weight:600}.tag-filter select{min-width:160px;min-height:44px;border:1px solid var(--line);border-radius:7px;padding:7px;background:#fff;color:var(--ink);font:inherit}.tag-filter .text-button:disabled{color:var(--muted);cursor:not-allowed}@media(max-width:680px){.tag-filter{align-items:stretch;flex-direction:column}.tag-filter select{width:100%}}

/* Keep primary header actions comfortably operable on touch-sized screens. */
.quiet-button,.filter-button,.secondary-button,.primary-button{min-height:44px}
.section-title .text-button,.detail-footer .text-button,.tag-filter .text-button{min-height:44px;padding:8px 0}
.tag-management-list{list-style:none;margin:0;padding:0}.tag-management-list li{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:12px 0;border-top:1px solid var(--line)}.tag-management-list span{display:grid;gap:2px}.tag-management-list small{color:var(--muted)}.tag-management-list .tag-management-actions{display:flex;align-items:center;gap:12px;flex:none;flex-wrap:wrap}.tag-management-actions .text-button{min-height:44px;padding:8px 0}
.connection-item{display:flex;align-items:baseline;justify-content:space-between;gap:12px}.connection-content{min-width:0}.connection-note{margin:4px 0 0;color:var(--muted);font-size:13px;white-space:pre-wrap}.connection-actions{display:flex;align-items:center;gap:12px;flex:none}.connection-actions .text-button{min-height:44px;padding:8px 0}.remove-link-button{min-height:44px;padding:8px 0}
.status-line .text-button{margin-left:auto;min-height:44px;padding:8px 0}
dialog{max-height:calc(100vh - 32px);overflow:auto}
@media(max-width:680px){.site-header{min-height:72px;height:auto;padding:10px 16px;align-items:flex-start;gap:10px}.brand{padding:10px 0;line-height:1.15}.header-actions{gap:8px;flex-wrap:wrap}.connection-item{align-items:flex-start;flex-direction:column;gap:5px}}@media(max-width:360px){.site-header{align-items:stretch;flex-direction:column}.header-actions{width:100%}.header-actions .quiet-button{flex:1}}
.library-filters{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}@media(max-width:680px){.panel-heading{align-items:flex-start}.library-filters{justify-content:flex-start}}
.empty-filter-state{display:grid;justify-items:start;gap:10px}.empty-filter-state p{margin:0}
