:root {
  color-scheme: light;
  --ink: #222920;
  --muted: #60665b;
  --green: #253b2e;
  --deep: #1d2e24;
  --paper: #f5f3ec;
  --card: #fffdf8;
  --line: #deded2;
  --gold: #d6b576;
  --soft-green: #e8eee4;
  --soft-gold: #f6ecd5;
  --soft-red: #f7e7df;
  --red: #8f392b;
  --radius: 12px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-size: 14px; line-height: 1.6; }
button, input, textarea, select { font: inherit; }
a { color: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #94723b; outline-offset: 3px; }
[hidden] { display: none !important; }
.skip { position: fixed; z-index: 10; top: -80px; left: 12px; background: var(--card); padding: 8px 12px; }
.skip:focus { top: 8px; }
.sidebar { width: 228px; position: fixed; inset: 0 auto 0 0; background: var(--deep); color: #f5f0e1; display: flex; flex-direction: column; padding: 33px 17px 20px; z-index: 3; }
.brand { display: flex; gap: 13px; align-items: center; text-decoration: none; margin: 0 12px 43px; }
.brand strong { display: block; font-family: "Songti SC", SimSun, serif; font-size: 26px; font-weight: 800; letter-spacing: .13em; line-height: 1.24; }
.brand small { display: block; color: #b8c0b3; font-size: 11px; letter-spacing: .19em; margin-top: 4px; }
.seal { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid #a78b56; border-radius: 7px; color: #e3c588; background: #293b2e; font-family: "Songti SC", SimSun, serif; font-size: 26px; font-weight: 800; }
nav { display: grid; gap: 5px; }
nav a { display: flex; align-items: center; gap: 12px; min-height: 45px; border-radius: 7px; padding: 7px 13px; color: #c4cbbf; text-decoration: none; border: 1px solid transparent; }
nav a span { color: #a3b09f; font-size: 19px; text-align: center; width: 21px; line-height: 1; }
nav a:hover { background: #2a4032; color: #fff5df; }
nav a[aria-current="page"] { background: #354b3b; color: #ffefd0; font-weight: 700; border-color: #50614c; }
nav a[aria-current="page"] span { color: var(--gold); }
.side-foot { margin-top: auto; border-top: 1px solid #455345; padding: 19px 12px 0; display: flex; align-items: flex-start; gap: 10px; }
.side-foot i, .storage i { width: 7px; height: 7px; border-radius: 50%; background: #8d9f76; display: inline-block; flex: none; }
.side-foot i { margin-top: 7px; }
.side-foot strong, .side-foot small { display: block; }
.side-foot strong { font-size: 12px; }
.side-foot small { color: #b7c0b2; margin-top: 2px; font-size: 11px; }
.workspace { margin-left: 228px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { background: #fbfaf5; min-height: 67px; border-bottom: 1px solid var(--line); padding: 10px 34px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.crumb, .top-actions { display: flex; align-items: center; gap: 13px; }
.crumb span { color: var(--muted); }
.crumb strong { color: var(--green); font-size: 13px; }
.storage { color: var(--muted); font-size: 12px; white-space: nowrap; }
.storage i { margin-right: 6px; }
.storage.failed i { background: var(--red); }
.menu { display: none; }
#content { padding: 32px 34px 38px; width: 100%; max-width: 1510px; margin: 0 auto; flex: 1; }
#content:focus { outline: none; }
.footer { padding: 16px 34px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--muted); }
h1, h2, h3, p, figure { margin: 0; }
h1 { font-family: "Songti SC", "STSong", SimSun, serif; font-size: clamp(34px, 4vw, 54px); font-weight: 800; line-height: 1.15; letter-spacing: .025em; }
h2 { font-size: 19px; line-height: 1.35; }
h3 { font-size: 15px; line-height: 1.4; }
.hero { display: grid; grid-template-columns: minmax(0, 1.09fr) minmax(0, .91fr); overflow: hidden; border-radius: 15px; background: var(--green); color: #f9f1de; min-height: 297px; }
.hero-copy { padding: clamp(27px, 3.5vw, 51px); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.hero h1 { text-wrap: balance; }
.hero h1 span { display: inline-block; }
.hero .eyebrow { color: #e2c58d; margin-bottom: 13px; }
.eyebrow { font-size: 11px; letter-spacing: .16em; font-weight: 750; color: #5e664e; }
.hero p { color: #dfe3d5; margin-top: 16px; line-height: 1.75; }
.hero .buttons { margin-top: 24px; }
.hero figure { display: grid; grid-template-rows: 1fr auto; min-width: 0; background: #6f5437; }
.hero img { width: 100%; height: 100%; min-height: 0; max-height: 322px; object-fit: cover; object-position: center 61%; display: block; }
figcaption { font-size: 11px; line-height: 1.45; padding: 7px 12px; color: #fff4df; background: #433524; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin: 17px 0 22px; }
.metric { display: flex; flex-direction: column; min-height: 122px; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--card); text-decoration: none; min-width: 0; }
.metric:hover { border-color: #899b84; }
.metric-label { color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; }
.metric-mark { color: #50654c; background: var(--soft-green); font-size: 14px; width: 26px; height: 26px; border-radius: 5px; display: grid; place-items: center; }
.metric strong { color: var(--green); font-size: 27px; font-variant-numeric: tabular-nums; letter-spacing: -.04em; line-height: 1.25; margin: 4px 0; overflow-wrap: anywhere; }
.metric small { color: var(--muted); font-size: 11px; }
.split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 16px; }
.section { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 21px; min-width: 0; }
.section + .section.stacked { margin-top: 15px; }
.section-head, .page-head, .record-top, .column-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.page-head { align-items: end; margin-bottom: 21px; }
.page-head h1 { font-size: clamp(31px, 4vw, 44px); }
.page-head p { color: var(--muted); margin-top: 8px; max-width: 62ch; }
.section-head { margin-bottom: 15px; align-items: center; }
.text-link { color: #35583d; text-decoration: underline; text-underline-offset: 3px; font-size: 12px; white-space: nowrap; }
.rows { display: grid; }
.row { padding: 12px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.row strong { display: block; font-size: 13px; }
.row small { color: var(--muted); display: block; margin-top: 3px; }
.row:last-child { padding-bottom: 0; }
.buttons, .toolbar, .chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar { justify-content: space-between; margin-bottom: 15px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #d2d4c8; background: var(--card); border-radius: 7px; color: var(--ink); padding: 8px 13px; min-height: 37px; text-decoration: none; font-weight: 650; font-size: 13px; white-space: nowrap; }
.button:hover { background: #eeeee4; border-color: #869581; }
.button.primary { background: var(--green); color: #fff9ea; border-color: var(--green); }
.button.primary:hover { background: #3a5340; }
.button.gold { background: #e4c486; color: #252a20; border-color: #e4c486; }
.button.gold:hover { background: #f0d59e; }
.button.outline { background: transparent; border-color: #839080; color: #f6efdf; }
.button.outline:hover { background: #3c5243; }
.button.compact { min-height: 33px; padding: 5px 9px; font-size: 12px; }
.button.danger { color: var(--red); }
.badge { display: inline-block; border-radius: 5px; padding: 2px 7px; font-size: 11px; font-weight: 700; color: #54564c; background: #edede5; white-space: nowrap; }
.badge.good { background: var(--soft-green); color: #36553d; }
.badge.wait { background: var(--soft-gold); color: #6c511e; }
.badge.risk { background: var(--soft-red); color: var(--red); }
.chip { border: 1px solid #d6d8cc; padding: 6px 11px; min-height: 34px; border-radius: 7px; background: var(--card); color: var(--muted); font-size: 13px; }
.chip[aria-pressed="true"] { color: var(--green); background: var(--soft-green); border-color: #a4b4a1; font-weight: 750; }
.chip:hover { border-color: #81957f; }
.note { color: var(--muted); font-size: 12px; }
.callout { background: var(--soft-gold); color: #634b24; border-left: 3px solid #b58c47; padding: 11px 13px; border-radius: 0 6px 6px 0; margin-bottom: 15px; font-size: 13px; }
.callout.good { background: var(--soft-green); color: #36553d; border-color: #718c72; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 13px; }
.form-grid .wide { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 650; min-width: 0; }
.field small { font-weight: 400; color: var(--muted); }
.staff-login { max-width: 460px; }
.staff-login .field + .field, #staff-create .field + .field { margin-top: 12px; }
.staff-alternatives { margin-top: 18px; }
.staff-alternatives summary { cursor: pointer; }
#staff-accounts-panel .row .buttons { margin-top: 0; }
input:not([type="checkbox"]), textarea, select { width: 100%; border: 1px solid #d4d6ca; background: #fcfbf6; color: var(--ink); padding: 8px 10px; border-radius: 6px; min-height: 38px; }
input[aria-invalid="true"] { border-color: var(--red); }
textarea { resize: vertical; min-height: 105px; }
textarea.copy-input { min-height: 195px; }
::placeholder { color: #6b7064; opacity: 1; }
fieldset { border: 0; padding: 0; margin: 0 0 15px; min-width: 0; }
legend { font-weight: 750; margin-bottom: 8px; color: var(--green); padding: 0; }
form .buttons { margin-top: 16px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th, td { padding: 10px 9px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
th { color: var(--muted); font-size: 12px; font-weight: 650; background: #f5f5ed; }
td { font-variant-numeric: tabular-nums; font-size: 13px; }
.compare { table-layout: fixed; min-width: 540px; }
.compare th:first-child { width: 96px; }
.compare td { white-space: pre-wrap; }
.price-result { display: grid; gap: 8px; }
.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 13px; }
.result-grid div { background: #eff1e8; padding: 10px; border-radius: 6px; min-width: 0; }
.result-grid small { display: block; color: var(--muted); font-size: 11px; }
.result-grid strong { font-size: 19px; color: var(--green); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.risk-list { display: grid; gap: 11px; }
.risk-row { border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow-wrap: anywhere; }
.risk-row p { margin-top: 6px; font-size: 13px; }
.source-list { display: flex; flex-wrap: wrap; column-gap: 16px; row-gap: 3px; margin-top: 12px; }
.source-list a { font-size: 12px; color: #37573d; text-underline-offset: 3px; }
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.column { background: #edeee5; border: 1px solid #dce0d4; border-radius: 9px; min-width: 0; padding: 12px; }
.column-head { align-items: center; margin: 1px 0 12px; }
.cards { display: grid; gap: 10px; }
.record { border: 1px solid var(--line); border-radius: 8px; background: var(--card); padding: 13px; min-width: 0; overflow-wrap: anywhere; }
.record p { color: #51594e; margin-top: 6px; white-space: pre-wrap; }
.record .buttons { margin-top: 10px; }
.record label select { padding: 4px 7px; min-height: 31px; max-width: 114px; font-size: 12px; }
.record .record-meta { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 6px 10px; color: var(--muted); font-size: 12px; align-items: center; }
.record-top { align-items: flex-start; }
.empty { border: 1px dashed #c4caba; border-radius: 8px; color: var(--muted); padding: 17px; text-align: center; font-size: 13px; }
.grid-records { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters input, .filters select { width: auto; max-width: 100%; }
details { margin-top: 13px; }
summary { cursor: pointer; color: var(--green); font-weight: 700; }
details p { margin: 7px 0 0; }
dialog { padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); width: min(580px, calc(100% - 24px)); max-height: calc(100dvh - 34px); overflow: auto; box-shadow: 0 20px 70px #17271e42; }
dialog::backdrop { background: #18261cd0; }
.dialog-body { padding: 22px; }
.dialog-body .section-head { margin-bottom: 17px; }
.dialog-body .callout { margin-top: 12px; }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 6; max-width: calc(100vw - 36px); padding: 10px 14px; border-radius: 8px; background: var(--deep); color: #fff9ea; box-shadow: 0 4px 18px #17271e40; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 1170px) {
  .sidebar { width: 203px; }
  .workspace { margin-left: 203px; }
  #content, .topbar, .footer { padding-left: 24px; padding-right: 24px; }
  .metric { padding: 12px; }
}
@media (max-width: 955px) {
  .split { grid-template-columns: 1fr; }
  .hero-copy { padding: 26px; }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 740px) {
  .sidebar { display: none; position: absolute; top: 56px; right: 0; bottom: auto; width: auto; padding: 10px 14px 14px; }
  body.nav-open .sidebar { display: block; }
  nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar .brand, .side-foot { display: none; }
  .workspace { margin-left: 0; }
  .menu { display: inline-flex; gap: 5px; align-items: center; background: transparent; border: 0; color: var(--green); font-weight: 700; padding: 5px 0; }
  .topbar { min-height: 56px; padding: 7px 15px; }
  .crumb span { display: none; }
  .top-actions { gap: 6px; }
  #content { padding: 17px 14px 25px; }
  .footer { padding: 10px 14px; }
}
@media (max-width: 520px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding: 22px; }
  .hero img { max-height: 215px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0 16px; }
  .metric { min-height: 100px; }
  .metric strong { font-size: 23px; }
  .section { padding: 14px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .board, .grid-records { grid-template-columns: 1fr; }
  .storage { font-size: 0; }
  .storage i { margin: 0; }
}

.gallery { margin-top: 13px; }
.gallery > img { display: block; width: 100%; max-height: 300px; object-fit: contain; background: white; border: 1px solid var(--line); border-radius: 7px; }
.gallery .buttons { margin-top: 8px; }
.image-draft-row { display: flex; gap: 10px; align-items: center; margin: 8px 0; }
.image-draft-row img { width: 65px; height: 52px; object-fit: contain; background: white; border: 1px solid var(--line); }
.review-section { margin-bottom: 15px; }
.review-history .grid-records { margin-top: 12px; }
.review-history summary .note { margin-left: 5px; font-weight: 400; }
.sidebar { overflow-y: auto; }
.library-text { white-space: pre-wrap; overflow-wrap: anywhere; }
#library-search .buttons { flex-wrap: nowrap; }
#library-query { width: min(25ch, 51vw); }

:root {
  --ink: #1d211f;
  --muted: #58605c;
  --green: #275443;
  --deep: #173c31;
  --paper: #f4f5f3;
  --card: #ffffff;
  --line: #e0e5e1;
  --soft-green: #e8f1eb;
  --soft-gold: #f8f0df;
  --soft-red: #f8e9e6;
  --radius: 20px;
  --shadow: 0 3px 12px #25372d07, 0 1px 2px #25372d06;
  --sidebar-width: 224px;
  font-family: -apple-system, BlinkMacSystemFont, Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
body { font-size: 14px; }
.sidebar {
  width: var(--sidebar-width); padding: 28px 14px 19px;
  background: linear-gradient(165deg,#fbfcfa,#eef2ee 90%); color: var(--ink);
  border-right: 1px solid #dfe5df;
}
.brand { display: grid; gap: 11px; justify-items: start; margin: 3px 12px 31px; }
.brand img, .mobile-brand img { display: block; height: auto; object-fit: contain; }
.brand img { width: 100px; }
.brand small { margin: 0; color: #68716b; font-size: 11px; font-weight: 650; letter-spacing: .13em; }
.mobile-brand { display: none; }
nav { gap: 3px; }
nav a { gap: 10px; min-height: 41px; border-radius: 10px; padding: 7px 10px; color: #444d47; font-weight: 520; font-size: 13px; }
.nav-icon { width: 17px; height: 17px; color: #64716a; flex: none; }
nav a:hover { color: #1e4b3b; background: #e8ede8; }
nav a[aria-current="page"] { color: #204a3b; background: #ddebe2; border-color: #dce9df; font-weight: 700; }
nav a[aria-current="page"] .nav-icon { color: #275745; }
.side-foot { padding: 17px 10px 0; border-color: #dce3dd; }
.side-foot small { color: #626b64; }
.side-foot i,.storage i { background: #49876b; }
.workspace { margin-left: var(--sidebar-width); }
.topbar { position: sticky; top: 0; z-index: 2; min-height: 60px; padding: 9px 36px; background: #fafbf9e8; backdrop-filter: saturate(150%) blur(19px); }
.crumb { gap: 10px; }
.crumb strong { color: var(--ink); }
.top-actions { gap: 10px; }
.storage { display: inline-flex; align-items: center; gap: 6px; }
.storage i { margin-right: 0; }
#team-role { color: #305849; background: #e7eee8; }
#content { padding: 28px 36px 36px; max-width: 1540px; }
.footer { padding: 17px 36px; }
h1 { font-family: inherit; font-size: clamp(31px,4.1vw,53px); font-weight: 760; line-height: 1.13; letter-spacing: -.035em; }
h2 { font-size: 19px; font-weight: 720; letter-spacing: -.025em; }
h3 { font-weight: 680; }
.hero {
  grid-template-columns: minmax(0,1fr) minmax(0,.87fr); min-height: 290px;
  border: 1px solid #e1e8e1; border-radius: 26px; color: #152e24;
  background: radial-gradient(ellipse at 1% 10%,#fbfdfb,transparent 74%),linear-gradient(135deg,#f5f9f4,#e3eee5);
  box-shadow: var(--shadow);
}
.hero-copy { padding: clamp(24px,4vw,55px); }
.hero .eyebrow { color: #426b56; margin-bottom: 13px; }
.eyebrow { font-size: 11px; color: #54695c; font-weight: 700; letter-spacing: .12em; }
.hero p { color: #485a50; margin-top: 13px; line-height: 1.65; font-size: 14px; }
.hero-tasks { width: 100%; margin-top: 19px; }
.hero-tasks .section-head { margin-bottom: 8px; flex-wrap: wrap; gap: 6px 12px; }
.hero-tasks .rows { list-style: none; margin: 0; padding: 0; }
.hero-tasks .row { padding: 7px 0; }
.hero-tasks .row > div { min-width: 0; overflow-wrap: anywhere; }
.hero-tasks .row > .badge { flex-shrink: 0; }
.hero figure { margin: 12px; border-radius: 18px; overflow: hidden; background: #e1d7c8; }
.hero-photo { position: relative; min-height: 224px; }
.hero .hero-photo img { position: absolute; inset: 0; max-height: none; object-position: center 62%; }
figcaption { padding: 7px 10px; font-size: 10.5px; color: #594e3d; background: #f2eae0; }
.metrics { gap: 12px; margin: 17px 0 19px; }
.overview-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); }
.metric { border-radius: 17px; padding: 15px 16px; min-height: 112px; box-shadow: var(--shadow); }
.metric:hover { border-color: #a1b7a7; background: #fcfefc; }
.metric-label { line-height: 1.35; }
.metric-mark { border-radius: 8px; flex: none; color: #476454; background: #eef4ee; width: 23px; height: 23px; }
.metric strong { font-size: clamp(21px,3vw,30px); color: #1d4938; margin-top: 6px; font-weight: 730; }
.section { padding: 20px; box-shadow: var(--shadow); }
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: clamp(29px,3.6vw,43px); }
.page-head p { margin-top: 7px; line-height: 1.7; }
.button { border-radius: 10px; border-color: #dce5dd; background: #f8faf8; padding: 8px 13px; }
.button:hover { background: #edf3ed; border-color: #b7cbbd; }
.button.primary,.button.gold { background: var(--green); color: white; border-color: var(--green); }
.button.primary:hover,.button.gold:hover { background: #1d4536; border-color: #1d4536; }
.button.outline { background: #ffffffa6; color: #234e3e; border-color: #ccdcd0; }
.button.outline:hover { background: #fff; border-color: #a5beae; }
.button.compact { padding: 5px 10px; }
.button.danger { color: #923d33; }
.badge { border-radius: 999px; padding: 2px 8px; }
.chip { border-radius: 9px; border-color: #dde5de; background: #fafcfa; }
.chip[aria-pressed="true"] { border-color: #c1d7c6; background: #e3efe6; }
.text-link { color: #275443; text-decoration-color: #90a99b; }
input:not([type="checkbox"]),textarea,select { border-radius: 9px; background: #f8faf8; border-color: #dfe7df; }
.callout { border-left-width: 0; border-radius: 11px; }
th { background: #f4f7f4; }
.result-grid div { border-radius: 12px; background: #eff5ef; padding: 13px; }
.column { border-radius: 16px; background: #eaf0eb; border-color: #e2eae3; }
.record,.risk-row,.gallery > img { border-radius: 13px; }
dialog { border-radius: 21px; box-shadow: 0 25px 90px #17271e45; }
dialog::backdrop { background: #17251d70; backdrop-filter: blur(4px); }
.toast { border-radius: 13px; }
a,button { -webkit-tap-highlight-color: #27544324; }
@media (max-width: 1170px) {
  :root { --sidebar-width: 200px; }
  #content,.topbar,.footer { padding-left: 24px; padding-right: 24px; }
  .metric { padding: 12px; }
}
@media (max-width: 740px) {
  .sidebar { top: 63px; left: 12px; right: 12px; position: fixed; width: auto; max-height: calc(100dvh - 76px); padding: 11px; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 9px 30px #243b2b25; }
  .workspace { margin-left: 0; }
  .topbar { min-height: 55px; padding: 7px 13px; justify-content: flex-start; gap: 10px; }
  .menu { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #e9f0e9; }
  .mobile-brand { display: block; flex: none; }
  .mobile-brand img { width: 60px; }
  .crumb { display: none; }
  .top-actions { margin-left: auto; gap: 6px; }
  #content { padding: 15px 13px 25px; }
  .footer { padding: 11px 13px; }
}
@media (max-width: 520px) {
  .hero { border-radius: 21px; }
  .hero-copy { padding: 24px 20px 14px; }
  .hero figure { margin: 8px; border-radius: 14px; }
  .hero-photo { min-height: clamp(150px, 45vw, 198px); }
  .metrics,.overview-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .metric { min-height: 98px; }
  .section { padding: 14px; }
  .storage { display: none; }
}
.task-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.task-source { border: 1px solid var(--line); background: #f8faf8; border-radius: 9px; margin-top: 9px; padding: 9px 10px; }
.task-source .buttons { margin-top: 5px; }
.task-source p { margin: 3px 0; }
.task-return-status { display: flex; flex-wrap: wrap; gap: 5px 8px; margin-top: 6px; }
.task-document-text { min-height: 52vh; }
:root {
  --paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='154' height='154'%3E%3Cfilter id='paper'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23000' opacity='.045' d='M0 0h154v154H0z' filter='url(%23paper)'/%3E%3C/svg%3E");
}
body { background-image: var(--paper-grain); }
.sidebar { background-image: var(--paper-grain), linear-gradient(165deg,#fbfcfa,#eef2ee 90%); }
nav a .inbox-badge { width: auto; min-width: 17px; height: 17px; padding: 2px 4px; margin-left: auto; border-radius: 10px; background: #8d3f32; color: white; font: 700 10px/13px system-ui; }
.task-inbox { margin: 0 0 14px; }
.task-inbox summary { cursor: pointer; }
.task-inbox .button { margin-top: 8px; }
.new-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #8d3f32; margin-left: 4px; }

@media (max-width: 740px) {
  .topbar { padding: calc(6px + env(safe-area-inset-top)) max(13px, env(safe-area-inset-right)) 6px max(13px, env(safe-area-inset-left)); }
  .sidebar { top: calc(64px + env(safe-area-inset-top)); max-height: calc(100dvh - 78px - env(safe-area-inset-top)); }
  #content, .footer { padding-left: max(13px, env(safe-area-inset-left)); padding-right: max(13px, env(safe-area-inset-right)); }
  .footer { padding-bottom: calc(11px + env(safe-area-inset-bottom)); gap: 8px; flex-wrap: wrap; }
  .button, .button.compact, .menu, nav a { min-height: 44px; }
  .menu { width: 44px; flex: none; }
  input:not([type="checkbox"]), textarea, select, .record label select { min-height: 44px; font-size: 16px; }
  .row > div:first-child { min-width: 0; overflow-wrap: anywhere; }
  .staff-login { margin: 12px auto 0; }
  dialog { max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .toast { bottom: calc(12px + env(safe-area-inset-bottom)); }
}

@media (max-width: 420px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  #staff-accounts-panel .row { display: grid; gap: 6px; }
  .topbar { gap: 6px; }
  .top-actions .button { padding-inline: 8px; }
}

.project-card + .project-card { margin-top: 14px; }
.project-card p, .project-card .record-meta { margin-top: 8px; }
.project-card .record-meta { font-size: 12px; color: var(--muted); }
.project-card .row > div:first-child, .review-section .row > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.project-card > .buttons, .project-card > .text-link { margin-top: 12px; }
.project-card > .text-link { display: inline-block; }
.hero-tasks .row small { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }

.project-panel { min-width: 0; margin-top: 12px; padding: 12px; background: #f1f6f1; border: 1px solid var(--line); border-radius: 11px; }
.project-panel.section { padding: 18px; }
.project-panel h3, .project-panel strong { overflow-wrap: anywhere; }
.project-panel p { margin: 7px 0 0; }
.project-panel .row > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.project-panel .row .buttons { margin: 0; flex-shrink: 0; }
.project-panel .row > .badge { flex-shrink: 0; }
.project-panel .project-feedback-summary small { white-space: pre-wrap; }

.assistant-draft { margin-top: 10px; }
.assistant-draft textarea { min-height: 105px; }
.assistant-status:empty, .desk-assistant-result:empty { display: none; }
.assistant-status { margin: 8px 0; }
.desk-assistant-result { padding: 12px; margin-top: 14px; border-radius: 10px; background: #edf4ef; }
.desk-assistant-result p { white-space: pre-wrap; line-height: 1.55; }
.desk-assistant-result ul { margin: 8px 0 0; padding-left: 18px; }
.desk-assistant-result a { white-space: normal; overflow-wrap: anywhere; }
