:root {
  --ink: #1b241c;
  --ink-soft: #536053;
  --dark: #182119;
  --paper: #f5f4ed;
  --card: #fffef9;
  --rule: #d9ded2;
  --signal: #c4f079;
  --signal-dark: #7fa94a;
  --urgent: #e7a664;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Avenir Next", Avenir, "Trebuchet MS", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--signal-dark); outline-offset: 3px; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; min-height: 100dvh; padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
.masthead {
  align-items: center; background: var(--dark); border-bottom: 1px solid #415044; color: #faf9f0;
  display: flex; gap: 10px; height: 68px; padding: 0 max(20px, calc((100vw - 1120px) / 2));
}
.brand-mark { display: grid; grid-template-columns: repeat(3, 4px); gap: 3px; transform: rotate(-30deg); }
.brand-mark span { background: var(--signal); border-radius: 4px; display: block; height: 17px; }
.brand-mark span:nth-child(2) { height: 24px; transform: translateY(-4px); }
.brand-name { font-size: 15px; letter-spacing: .025em; white-space: nowrap; }
.brand-name strong { font-weight: 700; }
.private-badge { border: 1px solid #59685b; border-radius: 100px; color: #a8b5a5; font-size: 10px; letter-spacing: .07em; margin-left: auto; padding: 7px 10px; text-transform: uppercase; }

.app-main { margin: 0 auto; max-width: 1120px; }
.hero { background: var(--dark); color: #faf9f0; min-height: 285px; overflow: hidden; padding: 32px 24px 0; position: relative; }
.hero::after {
  border: 1px solid #526c4d; border-radius: 50%; content: ""; height: 310px; opacity: .7;
  position: absolute; right: -92px; top: 6px; width: 310px;
  box-shadow: 0 0 0 25px #182119, 0 0 0 26px #3c5540, 0 0 0 52px #182119, 0 0 0 53px #334b38;
  pointer-events: none;
}
.hero-kicker, .eyebrow { font-size: 10px; font-weight: 800; letter-spacing: .16em; line-height: 1.2; }
.hero-kicker { align-items: center; color: var(--signal); display: flex; gap: 9px; position: relative; z-index: 1; }
.pulse-dot { background: var(--signal); border-radius: 50%; box-shadow: 0 0 0 5px #c4f07918; height: 6px; width: 6px; }
.hero h1 { font-family: var(--serif); font-size: clamp(48px, 11vw, 78px); font-weight: 400; letter-spacing: -.055em; line-height: .94; margin: 25px 0 14px; position: relative; z-index: 1; }
.hero h1 em { color: var(--signal); font-weight: 400; }
.hero-copy { color: #cad3c4; font-size: 13px; line-height: 1.55; margin: 0 0 29px; max-width: 520px; position: relative; z-index: 1; }
.hero-rule { align-items: center; border-top: 1px solid #536154; color: #a6b5a4; display: flex; font-size: 9px; font-weight: 700; justify-content: space-between; letter-spacing: .15em; min-height: 36px; position: relative; z-index: 1; }

.workspace { padding: 35px 20px 65px; }
.section-heading { align-items: end; display: flex; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.section-heading .eyebrow { color: var(--signal-dark); margin: 0 0 10px; }
.section-heading h2 { font-family: var(--serif); font-size: clamp(28px, 6vw, 42px); font-weight: 400; letter-spacing: -.045em; line-height: 1.1; margin: 0; }
.result-count { color: #6b786b; font-size: 11px; flex: none; padding-bottom: 4px; white-space: nowrap; }
.toolbar { display: grid; gap: 14px; }
.search-field { align-items: center; background: #fffef9; border: 1px solid #d5dccd; border-radius: 12px; display: flex; gap: 10px; height: 50px; padding: 0 14px; transition: border-color .2s, box-shadow .2s; }
.search-field:focus-within { border-color: #799b55; box-shadow: 0 0 0 4px #bce5842b; }
.search-field svg { fill: none; flex: none; height: 18px; stroke: #6e7a69; stroke-linecap: round; stroke-width: 1.8; width: 18px; }
.search-field input { background: transparent; border: 0; color: var(--ink); font-size: 13px; height: 100%; min-width: 0; outline: 0; width: 100%; }
.search-field input::placeholder { color: #919b8e; }
.search-field kbd { color: #98a193; font-family: var(--serif); font-size: 20px; font-weight: 400; }
.platform-picker { background: #e8eade; border-radius: 12px; display: flex; gap: 4px; padding: 4px; }
.platform-button { background: transparent; border: 0; border-radius: 9px; color: #637064; flex: 1; font-size: 13px; font-weight: 700; height: 42px; transition: background .18s, color .18s, box-shadow .18s; }
.platform-button.is-active { background: var(--dark); box-shadow: 0 2px 8px #18211920; color: #fff; }
.platform-sigil { font-size: 15px; margin-right: 4px; }
.category-row { display: flex; gap: 8px; margin: 20px -20px 24px; overflow-x: auto; padding: 0 20px 6px; scrollbar-width: none; }
.category-row::-webkit-scrollbar { display: none; }
.category-chip { background: transparent; border: 1px solid #cbd3c5; border-radius: 100px; color: #586655; flex: none; font-size: 11px; font-weight: 700; padding: 9px 13px; transition: background .16s, border-color .16s, color .16s; white-space: nowrap; }
.category-chip.is-active { background: var(--signal); border-color: var(--signal); color: #213317; }

.item-list { display: grid; gap: 12px; }
.item-card { background: var(--card); border: 1px solid #dce1d7; border-radius: 16px; color: var(--ink); display: block; min-width: 0; padding: 19px 19px 16px; text-align: left; transition: border-color .2s, box-shadow .2s, transform .2s; width: 100%; animation: card-enter .35s both; animation-delay: calc(var(--card-index) * 35ms); }
.item-card:hover { border-color: #a3bb8e; box-shadow: 0 10px 30px #19221a0f; transform: translateY(-2px); }
.card-top, .card-footer { align-items: center; display: flex; justify-content: space-between; gap: 12px; }
.card-labels { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; }
.card-type, .priority-label { border: 1px solid #ccd5c7; border-radius: 100px; color: #53604f; font-size: 9px; font-weight: 800; letter-spacing: .1em; padding: 5px 8px; }
.priority-label { background: #fff2e4; border-color: #efd8bc; color: #9c581f; }
.card-arrow { color: #607d45; font-family: var(--serif); font-size: 21px; line-height: 1; }
.card-title { font-family: var(--serif); font-size: 24px; font-weight: 400; letter-spacing: -.035em; line-height: 1.18; margin: 19px 0 16px; }
.summary-caption { color: #7c9468; font-size: 9px; font-weight: 800; letter-spacing: .12em; margin: 0 0 6px; }
.card-summary { color: #536052; display: -webkit-box; font-size: 13px; line-height: 1.55; margin: 0; max-height: 4.65em; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.card-footer { border-top: 1px solid #e8ebe4; color: #7b8577; font-size: 10px; margin-top: 19px; padding-top: 14px; }
.source-name { color: #4d6449; font-weight: 800; }
.card-date { text-align: right; }

.status-region:empty { display: none; }
.state-card { align-items: start; background: #ecf0e7; border: 1px dashed #cbd7c5; border-radius: 14px; display: flex; gap: 13px; padding: 20px; }
.state-symbol { color: #819973; font-family: var(--serif); font-size: 29px; line-height: .7; }
.state-copy { color: #536354; flex: 1; font-size: 13px; line-height: 1.5; margin: 0; }
.state-action { background: transparent; border: 0; color: #406a3c; font-size: 12px; font-weight: 800; padding: 2px; }
.skeleton-card { background: var(--card); border: 1px solid #e2e7dd; border-radius: 16px; height: 173px; padding: 22px; }
.skeleton-line { background: linear-gradient(90deg, #edf0e9, #e0e7dc, #edf0e9); background-size: 200% 100%; border-radius: 5px; height: 12px; margin: 14px 0; width: 90%; animation: shimmer 1.5s infinite linear; }
.skeleton-line.short { width: 27%; }
.skeleton-line.medium { width: 62%; }

.bottom-nav { align-items: stretch; background: #fafaf5; border-top: 1px solid #d6dccf; bottom: 0; box-shadow: 0 -12px 30px #1821190b; display: flex; gap: 7px; justify-content: center; left: 0; padding: 9px 16px calc(9px + env(safe-area-inset-bottom)); position: fixed; right: 0; z-index: 10; }
.nav-button { align-items: center; background: transparent; border: 0; border-radius: 10px; color: #748171; display: flex; flex: 1; flex-direction: column; gap: 5px; justify-content: center; max-width: 220px; min-height: 51px; padding: 6px 3px; }
.nav-button.is-active { background: #edf4e4; color: #2e522e; }
.nav-button svg { fill: none; height: 19px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 19px; }
.nav-button span { font-size: 10px; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; text-align: center; }

.detail-dialog { background: var(--paper); border: 0; border-radius: 20px 20px 0 0; bottom: 0; box-shadow: 0 -18px 50px #0003; color: var(--ink); height: min(86dvh, 850px); margin: auto 0 0; max-height: 100%; max-width: none; overflow: auto; padding: 0; width: 100%; }
.detail-dialog::backdrop { background: #0c170dbb; }
.dialog-shell { margin: 0 auto; max-width: 730px; min-height: 100%; padding: 0 23px calc(25px + env(safe-area-inset-bottom)); }
.dialog-head { align-items: center; background: var(--paper); border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; min-height: 64px; position: sticky; top: 0; z-index: 1; }
.dialog-head .eyebrow { color: #73886d; }
.icon-button { align-items: center; background: #e8ede2; border: 0; border-radius: 50%; color: #344333; display: flex; font-family: var(--sans); font-size: 26px; height: 35px; justify-content: center; line-height: 1; width: 35px; }
.detail-content { padding-top: 25px; }
.detail-meta { align-items: center; color: #7c8779; display: flex; font-size: 11px; gap: 9px; }
.meta-source { color: #3b683c; font-weight: 800; }
.detail-title { font-family: var(--serif); font-size: clamp(32px, 7vw, 50px); font-weight: 400; letter-spacing: -.05em; line-height: 1.1; margin: 13px 0 23px; }
.detail-priority { background: #fff0e2; border: 1px solid #eec9a2; border-radius: 100px; color: #9c5827; display: inline-block; font-size: 11px; font-weight: 800; margin: 0 0 14px; padding: 7px 10px; }
.detail-section { border-top: 1px solid var(--rule); padding: 22px 0 26px; }
.detail-section .eyebrow { color: #79916b; margin: 0 0 14px; }
.detail-prose { font-size: 15px; line-height: 1.65; white-space: pre-wrap; }
.detail-original { background: #e9ede5; border-left: 3px solid #b5c8a7; color: #50604f; font-size: 13px; line-height: 1.6; padding: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-links { display: grid; gap: 9px; }
.detail-link { background: #fffef9; border: 1px solid #d5decf; border-radius: 10px; color: #355d33; display: block; font-size: 13px; font-weight: 800; overflow-wrap: anywhere; padding: 13px 15px; text-decoration: none; }
.detail-link:hover { border-color: #81a86a; }
.original-link { background: var(--signal); border-color: var(--signal); color: #253b1b; }
.detail-loading, .detail-empty { color: #687666; font-size: 14px; line-height: 1.5; padding: 25px 0; }

@keyframes shimmer { to { background-position-x: -200%; } }
@keyframes card-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; transition-duration: .01ms !important; } }
@media (min-width: 700px) {
  body { background: #e8ece4; }
  .app-shell { background: var(--paper); box-shadow: 0 20px 65px #10201720; margin: 0 auto; max-width: 1120px; }
  .hero { min-height: 345px; padding: 45px 50px 0; }
  .hero h1 { margin-top: 25px; }
  .hero-copy { font-size: 14px; }
  .workspace { padding: 47px 50px 95px; }
  .toolbar { grid-template-columns: minmax(0, 1fr) 240px; }
  .category-row { margin-left: -50px; margin-right: -50px; padding-left: 50px; padding-right: 50px; }
  .item-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bottom-nav { left: 50%; max-width: 1120px; transform: translateX(-50%); }
  .detail-dialog { border-radius: 20px; bottom: auto; height: min(84dvh, 850px); margin: auto; max-width: 760px; }
}
