:root {
  --green: #285847;
  --ink: #243d32;
  --muted: #7b8981;
  --line: #e4e8e2;
  --paper: #fff;
  --bg: #f7f8f4;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:disabled { cursor: default; opacity: .4; }
:focus-visible { outline: 2px solid #599a7c; outline-offset: 3px; }
.sidebar { width: 236px; background: #fff; border-right: 1px solid var(--line); height: 100vh; padding: 31px 21px; position: fixed; display: flex; flex-direction: column; }
.brand { display: flex; gap: 10px; align-items: center; color: var(--green); margin-bottom: 44px; }
.brand svg { width: 36px; height: 36px; flex: none; }
.brand strong { display: block; font-size: 19px; letter-spacing: 1px; }
.brand small { color: var(--muted); font-size: 8px; letter-spacing: 1px; }
.nav-label { color: #98a39c; font-size: 11px; letter-spacing: 2px; padding-left: 12px; margin-bottom: 10px; }
#categoryNav button { display: flex; width: 100%; border: 0; background: transparent; padding: 11px 13px; border-radius: 7px; margin-bottom: 5px; color: #65766b; text-align: left; justify-content: space-between; }
#categoryNav button.active, #categoryNav button:hover { background: #edf3ed; color: var(--green); }
#categoryNav button.active { font-weight: 600; }
#categoryNav b { font-size: 12px; font-weight: 500; }
.subject { border-top: 1px solid var(--line); padding: 24px 10px; margin-top: 24px; display: flex; gap: 12px; align-items: center; }
.subject-symbol { background: #f3f4ed; border-radius: 8px; padding: 8px 12px; font: italic 22px Georgia, serif; }
.subject strong { font-size: 12px; font-weight: 500; }
.subject p { font-size: 11px; color: var(--muted); margin: 2px 0 0; }
.sidebar-bottom { margin-top: auto; color: var(--muted); font-size: 12px; padding: 12px; }
.sidebar-bottom > span:last-child { display: block; padding-top: 6px; color: #a1aaa4; font-size: 11px; }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #6c9c7e; margin-right: 7px; }
main { margin-left: 236px; max-width: 1436px; padding: 0 42px 20px; }
.topbar { height: 85px; display: flex; align-items: center; gap: 14px; }
.breadcrumb { color: #64796b; font-size: 12px; }
.breadcrumb span { color: #bcc6bf; margin: 0 12px; }
.topbar #refresh { margin-left: auto; }
.secondary { border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #576e5f; padding: 6px 12px; font-size: 12px; }
.secondary:hover { background: #f0f5ef; }
.menu { display: none; }
.intro { min-height: 162px; border: 1px solid #dce7d9; background: #eaf0e5; border-radius: 10px; padding: 27px 31px; display: flex; justify-content: space-between; overflow: hidden; }
.eyebrow { color: #6b8875; font-size: 11px; letter-spacing: 2px; margin: 0 0 8px; }
h1 { margin: 0; font-size: 26px; letter-spacing: .4px; font-weight: 600; }
.intro-copy { font-size: 12px; color: #78917f; margin: 9px 0 0; }
.intro-art { position: relative; width: 158px; flex: none; color: #809877; font-family: Georgia, serif; }
.intro-art span { font-size: 82px; position: absolute; left: 8px; top: -16px; opacity: .4; }
.intro-art i { position: absolute; font-size: 70px; top: 30px; right: -12px; opacity: .4; }
.intro-art b { font-family: inherit; font-size: 12px; font-weight: 400; letter-spacing: 6px; position: absolute; right: 25px; top: 8px; }
.overview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0 28px; }
.overview-item { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 13px 18px; }
.overview-item strong { font-size: 24px; font-weight: 600; margin-right: 6px; }
.overview-item span { color: #90a092; font-size: 11px; }
.overview-item p { color: var(--muted); font-size: 11px; margin: 1px 0 0; }
.section-head { display: flex; align-items: center; gap: 15px; margin-bottom: 17px; }
h2 { font-size: 19px; margin: 0; }
.section-subtitle { color: #97a399; font-size: 11px; }
.search { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 7px; padding: 10px 14px; background: #fff; }
.search:focus-within { border-color: #8cb79b; }
.search svg { width: 19px; height: 19px; stroke: #97a89c; fill: none; stroke-width: 1.6; }
input { border: 0; outline: 0; width: 100%; background: transparent; color: var(--ink); font-size: 12px; }
input::placeholder { color: #9aa69e; }
.filters { display: flex; gap: 18px; align-items: center; margin: 16px 0; }
.filter-label { color: #8a9a8f; font-size: 12px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips button { border: 0; background: transparent; border-radius: 5px; padding: 5px 11px; color: #728375; font-size: 12px; }
.chips button.active { background: var(--green); color: #fff; }
.results-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; color: #8b9a90; font-size: 11px; }
.results-bar strong { color: #44634e; font-weight: 600; }
.sort-label { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
select { border: 0; background: transparent; color: #5f7465; font-size: 11px; padding: 4px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 18px; display: flex; align-items: center; gap: 18px; transition: border-color .15s; }
.card:hover { border-color: #b2c8b6; }
.document { width: 49px; height: 60px; border: 1px solid #dce7db; border-radius: 4px; background: #f5f8f2; flex: none; display: flex; flex-direction: column; justify-content: center; padding: 9px; }
.document span { font-size: 11px; color: #6c8e73; letter-spacing: 1px; }
.document i { display: block; height: 2px; background: #d7e2d3; width: 100%; margin-top: 6px; }
.document i:last-child { width: 65%; }
.card-content { flex: 1; min-width: 0; }
.card-title { display: block; border: 0; padding: 0; background: transparent; color: var(--ink); text-align: left; font-size: 13px; line-height: 1.7; font-weight: 500; }
.card-title:hover { color: #518261; }
.meta { color: var(--muted); font-size: 11px; }
.card .meta { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.tag { display: inline-block; background: #f0f5ed; color: #6e8b6e; border-radius: 3px; padding: 1px 6px; font-size: 10px; }
.tag.answer { background: #faf3e7; color: #ad8f54; }
.card-actions { display: flex; gap: 8px; flex: none; }
.card-actions .primary, .card-actions .secondary { font-size: 11px; padding: 6px 10px; }
.pending { color: #a1763e; font-size: 11px; margin-top: 9px; }
.state { text-align: center; color: var(--muted); padding: 36px; }
.state[hidden] { display: none; }
.pager { display: flex; justify-content: center; gap: 5px; margin: 25px 0; align-items: center; }
.pager button { border: 1px solid var(--line); background: #fff; border-radius: 5px; padding: 5px 10px; color: #6d8375; font-size: 12px; min-width: 30px; }
.pager button.active { background: var(--green); border-color: var(--green); color: #fff; }
.pager span { color: #9baa9e; padding: 0 3px; }
footer { color: #a0aca3; font-size: 10px; text-align: center; padding: 8px; }
dialog { border: 1px solid var(--line); border-radius: 12px; padding: 24px; width: min(680px, 92vw); max-height: 85vh; color: var(--ink); box-shadow: 0 12px 50px #183b2d26; }
dialog::backdrop { background: #173b2d55; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dialog-head .eyebrow { margin: 0; }
.icon-button { border: 0; background: transparent; color: #74927d; font-size: 25px; padding: 0 5px; }
#detailTitle { font-size: 18px; line-height: 1.6; }
#detailFiles { margin: 18px 0; }
.file { display: flex; gap: 15px; align-items: center; justify-content: space-between; padding: 13px 0; border-top: 1px solid var(--line); }
.file-name { min-width: 0; font-size: 12px; overflow-wrap: anywhere; }
.file-name small { display: block; color: #8d9e92; margin-top: 4px; }
.file-actions { display: flex; gap: 10px; flex: none; font-size: 12px; color: #3b7450; }
.file-actions a:hover { text-decoration: underline; }
#detailPending { overflow-wrap: anywhere; }
#detailPending p { margin: 4px 0; }
.dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 17px; margin-top: 18px; }
.dialog-footer small { color: #94a198; font-size: 10px; }
.primary { background: var(--green); color: #fff; border: 1px solid var(--green); border-radius: 5px; padding: 8px 13px; cursor: pointer; font-size: 12px; white-space: nowrap; }
.primary:hover { background: #346c56; }
.primary[aria-disabled="true"] { background: #e5e9e3; border-color: #e5e9e3; color: #9aaa9c; cursor: default; }
@media (min-width: 1500px) { main { margin-left: max(236px, calc((100vw - 1200px) / 2)); } }
@media (max-width: 1050px) {
  main { padding-left: 26px; padding-right: 26px; }
  .sidebar { width: 205px; padding-left: 16px; padding-right: 16px; }
  main { margin-left: 205px; }
  .brand strong { font-size: 17px; }
  .card { gap: 12px; flex-wrap: wrap; }
  .card-actions { width: 100%; justify-content: flex-end; }
  .intro-art { width: 90px; }
  h1 { font-size: 23px; }
}
@media (max-width: 700px) {
  .sidebar { transform: translateX(-100%); z-index: 2; transition: transform .2s; box-shadow: 5px 0 20px #183b2d15; }
  .sidebar.open { transform: none; }
  main { margin: 0; padding: 0 16px 15px; }
  .topbar { height: 64px; }
  .menu { display: block; }
  .intro { min-height: auto; padding: 22px; }
  .intro-art { display: none; }
  h1 { font-size: 22px; }
  .intro-copy { font-size: 11px; }
  .overview { gap: 7px; margin-bottom: 23px; }
  .overview-item { padding: 10px; }
  .overview-item strong { display: block; font-size: 21px; }
  .overview-item > span { display: none; }
  .overview-item p { font-size: 10px; }
  .card { padding: 14px; }
  .card-content { min-width: 0; }
  .document { width: 39px; height: 51px; padding: 7px; }
  .section-subtitle { font-size: 10px; }
  .filters { gap: 8px; }
  .chips { gap: 3px; }
  .chips button { padding: 5px 8px; font-size: 11px; }
  .dialog-footer { flex-wrap: wrap; }
  .file { align-items: flex-start; }
}

[hidden] { display: none !important; }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topbar-actions #refresh { margin-left: 0; }
.membership { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 15px 18px; margin-bottom: 18px; }
.member-summary { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.member-summary > div { display: flex; align-items: center; gap: 10px; }
.member-summary > button, .member-summary > a { margin-left: auto; }
.member-badge { display: inline-block; color: var(--green); background: #ecf3e9; border-radius: 4px; padding: 3px 8px; font-size: 11px; }
.quota { color: #6b7d70; font-size: 12px; }
.quota b { color: var(--green); }
.membership .meta { margin: 7px 0 0; }
.notice { border: 1px solid #dfd0ad; background: #fff8e9; color: #805c27; padding: 12px 16px; border-radius: 7px; overflow-wrap: anywhere; }
.text-button { border: 0; background: transparent; color: #3b7450; padding: 0; font-size: 12px; }
.text-button:hover { text-decoration: underline; }
#authDialog { width: min(430px, 92vw); }
.form-stack { display: flex; flex-direction: column; gap: 15px; }
.form-stack label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.form-stack input, .form-stack select { width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 5px; background: #fff; font-size: 13px; }
.form-stack input:focus, .form-stack select:focus { border-color: #8cb79b; }
.form-stack input:disabled { background: var(--bg); color: var(--muted); }
.form-stack .checkbox-row { flex-direction: row; align-items: center; }
.form-stack input[type="checkbox"] { width: auto; }
.form-error { color: #a34232; font-size: 12px; margin: 0; }
.auth-switch { display: block; margin: 18px auto 0; }
#authForm { margin-top: 20px; }
.admin-main { max-width: 1200px; margin: 0 auto; padding: 0 28px 35px; }
.admin-brand { font-size: 18px; font-weight: 600; }
.admin-brand span { margin-left: 12px; color: var(--muted); font-size: 12px; font-weight: 400; }
.admin-heading { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 16px 0 25px; }
.admin-heading h1 { font-size: 25px; }
.admin-panel { border: 1px solid var(--line); background: #fff; padding: 22px; border-radius: 9px; margin-bottom: 20px; }
.admin-panel .section-head { justify-content: space-between; }
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.plan-card { padding: 17px; border: 1px solid var(--line); border-radius: 7px; align-items: stretch; }
.plan-card .member-badge { align-self: flex-start; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 12px; text-align: left; }
th { font-weight: 500; color: var(--muted); background: var(--bg); white-space: nowrap; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); }
td strong { font-weight: 500; }
td small { display: block; }
td:last-child .secondary { white-space: nowrap; }
.disabled-tag { background: #fbede9; color: #a25743; }
@media (max-width: 700px) {
  .topbar { gap: 8px; }
  .topbar-actions { gap: 5px; }
  .topbar-actions .primary, .topbar-actions .secondary { padding: 6px 8px; font-size: 11px; }
  .breadcrumb { font-size: 10px; }
  .breadcrumb span { margin: 0 4px; }
  .membership { padding: 12px; }
  .member-summary { gap: 8px; }
  .quota { width: 100%; }
  .member-summary > a { margin-left: 0; }
  .admin-main { margin: 0; padding: 0 14px 20px; }
  .admin-brand { font-size: 15px; }
  .admin-brand span { display: block; margin-left: 0; font-size: 10px; }
  .admin-heading { flex-wrap: wrap; padding-top: 10px; }
  .admin-heading h1 { font-size: 20px; }
  .admin-panel { padding: 15px; }
  .plan-grid { grid-template-columns: 1fr; }
  th, td { padding: 10px 8px; }
}
