@font-face {
  font-family: "ZCOOL KuaiLe";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/zcool-kuaile-chinese-simplified-400-normal.woff2") format("woff2");
  unicode-range: U+3000-303F, U+3400-4DBF, U+4E00-9FFF, U+FF00-FFEF;
}

@font-face {
  font-family: "ZCOOL KuaiLe";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/zcool-kuaile-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-024F;
}

:root {
  --ink: #59494b;
  --muted: #8d777c;
  --line: #f0dfdc;
  --paper: #fff9ef;
  --panel: #fffdfb;
  --cream: #fff2cf;
  --custard: #f6d680;
  --blush: #f7d2dc;
  --lilac: #e7dcf5;
  --soft-pink: #fff5f7;
  --accent: #b76f86;
  --accent-strong: #8e5165;
  --amber: #b9854d;
  --red: #bf6f75;
  --shadow: 0 12px 28px rgba(126, 86, 78, 0.08);
  --display-font: "ZCOOL KuaiLe", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  --body-font: "ZCOOL KuaiLe", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-family: var(--body-font);
}

* { box-sizing: border-box; }
body { min-width: 320px; margin: 0; color: var(--ink); background: var(--paper); font-weight: 400; font-synthesis: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.brand strong, .nav-item, .topbar h1, .view-heading h2, .section-heading h2, .dialog-head h2, .backup-panel h2, .button, .icon-button, .task-text, .task-summary-item strong, .project-title strong, .followup-name, .status-pill {
  font-family: var(--display-font);
  font-weight: 400;
}

.app-shell { display: grid; min-height: 100vh; grid-template-columns: 252px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; display: flex; height: 100vh; flex-direction: column; padding: 24px 16px 18px; border-right: 1px solid #edddc1; background: var(--cream); }
.brand { display: flex; align-items: center; gap: 11px; padding: 5px 8px 30px; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid rgba(141, 88, 65, 0.14); border-radius: 8px; background: var(--custard); color: #765044; font-weight: 800; box-shadow: 0 5px 12px rgba(147, 102, 66, 0.1); }
.brand strong, .brand span { display: block; }
.brand strong { color: #654c46; font-size: 16px; }
.brand span, .sidebar-note { color: var(--muted); font-size: 12px; }
.nav-list { display: grid; gap: 6px; }
.nav-item { min-height: 42px; border: 1px solid transparent; border-radius: 8px; padding: 0 12px; background: transparent; color: #6e5a5b; text-align: left; transition: background 160ms ease, border-color 160ms ease, transform 160ms ease; }
.nav-item:hover { border-color: rgba(183, 111, 134, 0.22); background: rgba(255, 253, 251, 0.72); transform: translateX(2px); }
.nav-item.active { border-color: rgba(173, 105, 126, 0.24); background: var(--blush); color: #714655; font-weight: 800; box-shadow: 0 4px 10px rgba(157, 93, 114, 0.08); }
.mascot-shelf { width: 100%; margin: auto 0 6px; padding: 0 2px; }
.mascot-shelf img { display: block; width: 100%; max-height: 126px; object-fit: contain; object-position: center; opacity: 0.92; }
.sidebar-note { margin: 0 8px 2px; line-height: 1.55; }

.main-content { min-width: 0; max-width: 1600px; padding: 0 clamp(22px, 4vw, 64px) 52px; margin: 0 auto; }
.topbar, .view-heading, .row-heading, .dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.topbar { min-height: 122px; border-bottom: 1px solid var(--line); }
.topbar h1, .view-heading h2, .section-heading h2, .dialog-head h2, .backup-panel h2 { margin: 0; line-height: 1.2; }
.topbar h1 { color: #503f42; font-size: 30px; }
.topbar-actions, .toolbar, .dialog-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.eyebrow { margin: 0 0 7px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: 0; text-transform: uppercase; }
.button, .icon-button { min-height: 40px; border: 1px solid #ead9d6; border-radius: 8px; padding: 0 13px; background: #fffdfb; color: var(--ink); box-shadow: 0 2px 0 rgba(117, 77, 70, 0.02); transition: border-color 160ms ease, background 160ms ease, transform 160ms ease; }
.button:hover, .icon-button:hover { border-color: rgba(183, 111, 134, 0.48); background: var(--soft-pink); transform: translateY(-1px); }
.button.primary { border-color: #af687e; background: var(--accent); color: #fff; box-shadow: 0 6px 14px rgba(183, 111, 134, 0.2); }
.button.primary:hover { background: var(--accent-strong); }
.button.danger { border-color: rgba(191, 111, 117, 0.28); background: #fff8f7; color: var(--red); }
.file-button { display: inline-flex; align-items: center; }
.app-view { padding-top: 34px; }
.view-heading { align-items: end; margin-bottom: 24px; }
.view-heading h2 { color: #564447; font-size: 24px; }
.view-heading p, .backup-panel > p:not(.eyebrow) { max-width: 760px; margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.view-heading .demo-hint { color: var(--amber); font-size: 13px; }
.commission-search { display: block; width: min(340px, 100%); }
.commission-search input, .search, .toolbar select, .month-input, label input, label select, label textarea, .inline-link { width: 100%; min-height: 42px; border: 1px solid #eadbd7; border-radius: 8px; padding: 9px 12px; background: #fffdfb; color: var(--ink); }
.commission-search input:focus, .search:focus, .toolbar select:focus, .month-input:focus, label input:focus, label select:focus, label textarea:focus, .inline-link:focus { border-color: rgba(183, 111, 134, 0.68); outline: 3px solid rgba(247, 210, 220, 0.55); }

.commission-section, .followup-panel, .table-panel, .backup-panel, .weekly-plan-panel, .weekly-preview-panel { margin-bottom: 24px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: var(--shadow); }
.overdue-section { border-color: rgba(185, 133, 77, 0.48); background: #fffdf9; }
.section-heading { margin-bottom: 16px; }
.row-heading { align-items: end; padding: 21px 21px 0; }
.muted { color: var(--muted); font-size: 13px; }
.commission-list { display: grid; }
.commission-row { display: grid; grid-template-columns: minmax(156px, 1.2fr) repeat(3, minmax(100px, 0.8fr) ) minmax(156px, 1.2fr) auto; gap: 16px; align-items: center; padding: 17px 21px; border-top: 1px solid var(--line); }
.commission-row:first-child { border-top: 0; }
.commission-name { display: grid; min-width: 0; gap: 5px; }
.commission-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.commission-meta, .commission-label { color: var(--muted); font-size: 12px; }
.commission-value { margin-top: 3px; color: #59464a; font-size: 14px; font-weight: 800; }
.commission-actions { display: flex; justify-content: end; flex-wrap: wrap; gap: 8px; }
.commission-actions .button { min-height: 35px; padding: 0 10px; }
.overdue-days { color: var(--amber); }
.empty-list { padding: 26px 21px; color: var(--muted); font-size: 14px; }

.summary-band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; border: 1px solid #eadfdd; border-radius: 8px; background: #eadfdd; box-shadow: var(--shadow); }
.review-metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: 24px; }
.metric { min-height: 112px; padding: 20px; background: #fffdfb; }
.metric:nth-child(3n + 1) { background: #fffaf0; }
.metric:nth-child(3n + 2) { background: #fff8fa; }
.metric:nth-child(3n) { background: #fbf8ff; }
.metric-label { display: block; color: var(--muted); font-size: 13px; }
.metric strong { display: block; margin-top: 10px; color: #5b464a; font-size: 33px; line-height: 1; }
.wide-panel { margin-top: 24px; padding: 21px; }
.followup-list { display: grid; gap: 10px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.16fr) minmax(320px, 0.84fr); gap: 24px; margin-top: 52px; }
.dashboard-panel { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: var(--shadow); }
.home-grid .dashboard-panel:first-child { border-top: 4px solid var(--custard); }
.home-grid .dashboard-panel:last-child { border-top: 4px solid var(--lilac); }
.task-list, .project-list { display: grid; gap: 10px; padding: 0 21px 21px; }
.task-summary { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 21px 16px; }
.task-summary-item { display: grid; min-width: 118px; gap: 4px; border: 1px solid #eedfdd; border-radius: 8px; padding: 10px 12px; background: #fffaf4; color: var(--ink); text-align: left; }
.task-summary-item:hover { border-color: rgba(183, 111, 134, 0.42); background: #fffdfb; }
.task-summary-item span { color: var(--muted); font-size: 12px; }
.task-summary-item strong { color: #61494d; font-size: 17px; }
.task-summary-submission { background: #fff7f7; border-left: 3px solid var(--red); }
.task-summary-followup, .task-summary-content { background: #fff9ed; border-left: 3px solid var(--amber); }
.task-summary-weekly, .task-summary-weekly-quantified { background: #fbf8ff; border-left: 3px solid #a588c6; }
.task-summary-project { background: #fff6f8; border-left: 3px solid var(--accent); }
.task-item { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid #eddfdc; border-left: 4px solid #a588c6; border-radius: 8px; padding: 14px 15px; background: #fffdfb; color: var(--ink); text-align: left; }
.task-item:hover { border-color: rgba(183, 111, 134, 0.46); background: #fffaf7; }
.task-item.priority-high { border-left-color: var(--red); }
.task-item.priority-medium { border-left-color: var(--amber); }
.task-main { display: grid; min-width: 0; gap: 5px; }
.task-text { font-weight: 800; line-height: 1.5; }
.task-priority { color: var(--muted); font-size: 12px; }
.task-actions { display: flex; flex: 0 0 auto; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.task-actions .button { min-height: 33px; padding: 0 10px; }
.weekly-panel { margin-top: 24px; border-top: 4px solid var(--blush); }
.weekly-list { display: grid; padding: 0 21px 21px; }
.weekly-task { display: flex; align-items: flex-start; gap: 12px; padding: 15px 0; border-top: 1px solid var(--line); }
.weekly-task:first-child { border-top: 0; }
.weekly-task input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); }
.weekly-task-body { display: grid; min-width: 0; gap: 5px; }
.weekly-task-body strong { line-height: 1.45; }
.weekly-task-body span { color: var(--muted); font-size: 13px; line-height: 1.55; }
.weekly-plan-panel { display: grid; gap: 18px; padding: 21px; }
.weekly-plan-grid { display: grid; grid-template-columns: minmax(180px, 0.38fr) minmax(220px, 0.62fr); gap: 16px; align-items: end; }
.weekly-plan-upload { display: grid; gap: 8px; }
.weekly-plan-upload > span { color: var(--muted); font-size: 13px; font-weight: 800; }
.weekly-plan-upload small { color: var(--muted); font-size: 12px; }
.weekly-plan-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.weekly-preview-list { display: grid; }
.weekly-preview-row { display: grid; gap: 5px; padding: 15px 21px; border-top: 1px solid var(--line); border-left: 4px solid #a588c6; }
.weekly-preview-row.priority-p0 { border-left-color: var(--red); }
.weekly-preview-row.priority-p1 { border-left-color: var(--amber); }
.weekly-preview-row strong { line-height: 1.45; }
.weekly-preview-row span { color: var(--muted); font-size: 13px; }

.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.project-section + .project-section { margin-top: 34px; }
.project-section-heading { margin-bottom: 14px; }
.project-section-heading h3 { margin: 0; color: #496234; font-family: var(--display-font); font-size: 19px; font-weight: 400; }
.project-card { min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 21px; background: var(--panel); box-shadow: var(--shadow); }
.project-card:nth-child(3n + 1) { border-top: 4px solid var(--custard); }
.project-card:nth-child(3n + 2) { border-top: 4px solid var(--blush); }
.project-card:nth-child(3n) { border-top: 4px solid var(--lilac); }
.project-card-head { display: grid; grid-template-columns: 1fr; gap: 14px; }
.project-card-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; gap: 9px; }
.project-card-actions .button { display: inline-flex; min-width: 0; min-height: 36px; align-items: center; justify-content: center; padding: 0 8px; white-space: nowrap; font-size: 12px; }
.project-card-actions .project-card-action { border-color: #557b3d; background: #7fa65d; color: #fffdf2; box-shadow: 2px 3px 0 rgba(79, 111, 55, 0.18); }
.project-card-actions .project-card-action:hover { border-color: #557b3d; background: #6e964e; }
.project-title { display: grid; min-width: 0; gap: 6px; }
.project-title strong { min-width: 0; font-size: 17px; }
.project-title span, .project-description, .project-progress { color: var(--muted); font-size: 13px; line-height: 1.6; }
.project-description { min-height: 44px; margin: 17px 0 13px; }
.project-progress { border-top: 1px solid var(--line); padding-top: 13px; }
.creator-name a { color: var(--accent-strong); font-size: 13px; text-decoration: none; }
.creator-name a:hover { text-decoration: underline; }
.project-brief-links { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.project-brief-link { display: inline-flex; width: max-content; min-height: 32px; align-items: center; justify-content: center; margin: 0; padding: 0 10px; font-size: 12px; text-decoration: none; }
.project-library-button, .project-review-button { min-height: 32px; padding: 0 9px; font-size: 13px; }
.project-scheduled-tasks-button { min-height: 32px; padding: 0 9px; font-size: 13px; }
.project-review-button:disabled { cursor: not-allowed; opacity: 0.52; }
.project-scheduled-task-editor { display: grid; gap: 9px; }
.project-scheduled-task-editor > span { color: var(--muted); font-size: 13px; font-weight: 800; }
.project-scheduled-task-composer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, 0.36fr) max-content; gap: 9px; }
.project-scheduled-task-draft-list, .project-scheduled-tasks-list { display: grid; gap: 8px; }
.project-scheduled-task-draft { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; background: #fffdf2; font-size: 13px; }
.project-scheduled-task { display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: #fffdf2; }
.project-scheduled-task > div { display: grid; gap: 4px; min-width: 0; }
.project-scheduled-task > div > span { color: var(--muted); font-size: 13px; }
.project-scheduled-task.due-soon { border-color: #d8786e; background: #fff8f4; }
.scheduled-task-alert { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: 5px; border-radius: 50%; background: #d55e55; color: #fff; font-family: Arial, sans-serif; font-size: 12px; font-weight: 800; line-height: 1; vertical-align: middle; }
.project-library-list { display: grid; gap: 10px; margin-top: 20px; }
.project-library-item { display: block; border: 2px solid #a8c88a; border-radius: 15px 18px 14px 17px; padding: 12px 14px; background: #fffdf2; color: #40552f; font-size: 14px; text-decoration: none; }
.project-library-item:hover { border-color: #628c47; background: #f7fde9; }
.project-review-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 20px; }
.project-review-option { display: grid; min-height: 118px; gap: 8px; border: 2px solid #78985c; border-radius: 18px 22px 17px 20px; padding: 18px; background: #fffdf2; color: #40552f; text-align: left; }
.project-review-option:hover { border-color: var(--outline); background: #f1fadf; }
.project-review-option strong { font-family: var(--display-font); font-size: 18px; font-weight: 400; }
.project-review-option span { color: #71845b; font-size: 13px; }
.project-review-list { display: grid; gap: 10px; margin-top: 20px; }
.project-review-document { display: block; border: 2px solid #a8c88a; border-radius: 15px 18px 14px 17px; padding: 12px 14px; background: #fffdf2; color: #40552f; font-size: 14px; text-decoration: none; }
.project-review-document:hover { border-color: #628c47; background: #f7fde9; }
.project-review-upload { display: grid; gap: 14px; margin-top: 20px; }
.project-review-upload[hidden] { display: none; }
.project-card.compact { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 15px 0 0; box-shadow: none; }
.project-card.compact:first-child { border-top: 0; padding-top: 0; }
.project-card.compact .project-card-head { gap: 10px; }
.project-card.compact .project-card-actions .button { min-height: 32px; }
.project-card.compact .project-description { min-height: 0; margin: 8px 0; }
.project-card.compact .project-card-head .button { min-height: 32px; padding: 0 9px; }
.project-card.compact .project-brief-links { margin-top: 10px; }
.project-card.compact .project-scheduled-tasks-button { min-height: 32px; }
.performance-panel { margin-top: 24px; }
.performance-list { display: grid; }
.performance-row { display: grid; grid-template-columns: minmax(150px, 1.2fr) repeat(5, minmax(92px, 0.8fr)); gap: 16px; align-items: center; padding: 17px 21px; border-top: 1px solid var(--line); }
.performance-row:first-child { border-top: 0; }
.month-select { width: min(180px, 100%); }
.followup-item { display: grid; width: 100%; gap: 5px; border: 1px solid #eddfdc; border-radius: 8px; padding: 13px; background: #fffaf5; color: var(--ink); text-align: left; }
.followup-item:hover { border-color: rgba(183, 111, 134, 0.48); background: var(--soft-pink); }
.followup-name { font-weight: 800; }
.followup-meta { color: var(--muted); font-size: 13px; }
.toolbar { margin: 0 0 24px; }
.search { flex: 1 1 280px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 860px; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--line); padding: 15px 12px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; font-weight: 800; }
td:first-child, th:first-child { padding-left: 21px; }
td:last-child, th:last-child { padding-right: 21px; }
.creator-name { display: grid; gap: 4px; }
.status-pill { display: inline-flex; min-height: 28px; align-items: center; border-radius: 999px; padding: 0 10px; background: #faedf1; color: var(--accent-strong); font-size: 13px; font-weight: 800; }
.status-pill.warn { background: #fff2d8; color: var(--amber); }
.status-pill.stop { background: #fff0ef; color: var(--red); }
.row-actions { display: flex; gap: 8px; }
.row-actions .button { min-height: 35px; padding: 0 10px; }
.empty-state { padding: 48px 21px; text-align: center; }
.empty-state h3, .empty-state p { margin: 0 0 8px; }
.empty-state p { color: var(--muted); }
.backup-panel { max-width: 720px; padding: 27px; }

dialog { width: min(780px, calc(100% - 28px)); border: 1px solid var(--line); border-radius: 8px; padding: 0; color: var(--ink); box-shadow: 0 20px 54px rgba(104, 67, 66, 0.2); }
dialog::backdrop { background: rgba(95, 69, 71, 0.28); }
.creator-form { padding: 22px; background: #fffaf5; }
.icon-button { width: 40px; padding: 0; font-size: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
label { display: grid; gap: 7px; }
label span { color: var(--muted); font-size: 13px; font-weight: 800; }
label.wide { grid-column: 1 / -1; }
.form-section { display: grid; gap: 5px; padding-top: 8px; border-top: 1px solid var(--line); }
.form-section span { color: var(--ink); font-size: 14px; font-weight: 800; }
.form-section small { color: var(--muted); font-size: 12px; line-height: 1.5; }
textarea { resize: vertical; }
.dialog-actions { margin-top: 21px; }
.spacer { flex: 1 1 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
:focus-visible { outline: 3px solid rgba(183, 111, 134, 0.28); outline-offset: 2px; }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 14px 18px; border-right: 0; border-bottom: 1px solid #edddc1; }
  .brand { padding: 4px 0 13px; }
  .nav-list { display: flex; overflow-x: auto; padding-bottom: 2px; }
  .nav-item { flex: 0 0 auto; }
  .mascot-shelf, .sidebar-note { display: none; }
  .commission-row { grid-template-columns: minmax(150px, 1fr) repeat(2, minmax(104px, 0.8fr)); }
  .commission-actions { justify-content: start; }
  .home-grid, .project-grid { grid-template-columns: 1fr; }
  .review-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .performance-row { grid-template-columns: minmax(150px, 1fr) repeat(3, minmax(100px, 0.8fr)); }
}
@media (max-width: 760px) {
  .project-card-head { flex-direction: column; }
  .project-card-actions { width: 100%; justify-content: flex-start; }
}

@media (max-width: 640px) {
  .project-scheduled-task-composer { grid-template-columns: 1fr; }
  .project-scheduled-task-composer .button { width: 100%; }
  .project-scheduled-task { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 640px) {
  .main-content { padding: 0 16px 32px; }
  .topbar, .view-heading { align-items: stretch; flex-direction: column; padding: 20px 0; }
  .topbar { min-height: 0; }
  .topbar-actions .button, .topbar-actions .file-button { flex: 1 1 auto; justify-content: center; }
  .commission-search { width: 100%; }
  .task-item { align-items: stretch; flex-direction: column; }
  .task-actions { justify-content: flex-start; }
  .task-summary-item { flex: 1 1 132px; }
  .weekly-plan-grid { grid-template-columns: 1fr; }
  .summary-band, .form-grid { grid-template-columns: 1fr; }
  .review-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .performance-row { grid-template-columns: 1fr 1fr; }
  .performance-row .commission-name { grid-column: 1 / -1; }
  .commission-row { grid-template-columns: 1fr 1fr; gap: 12px; }
  .commission-name, .commission-actions { grid-column: 1 / -1; }
  .project-review-options { grid-template-columns: 1fr; }
  label.wide { grid-column: auto; }
}

/* Matcha hand-drawn skin: visual-only overrides, keeping the existing layout intact. */
:root {
  --ink: #3f512f;
  --muted: #6f8059;
  --line: #b8d59a;
  --paper: #fff9e6;
  --panel: #dff2c7;
  --cream: #edf8d9;
  --custard: #bddf94;
  --blush: #d3edb7;
  --lilac: #e9f6d7;
  --soft-pink: #f7fde9;
  --accent: #6f9652;
  --accent-strong: #557b3d;
  --amber: #9b7549;
  --red: #b87367;
  --matcha: #dff2c7;
  --matcha-soft: #edf8d9;
  --outline: #4d6437;
  --shadow: 2px 3px 0 rgba(100, 132, 73, 0.18);
}

body { background: #fff9e6; }
.app-shell { position: relative; }
.sidebar { border-right: 2px solid var(--outline); background: #edf8d9; }
.topbar { border-bottom: 2px solid #c7dfaa; }
.brand-mark { border: 2px solid var(--outline); background: #c8e8a5; color: var(--outline); box-shadow: none; }
.avatar-control { position: relative; overflow: hidden; cursor: pointer; }
.avatar-control:hover { border-color: #628c47; }
.brand-mark.has-avatar { padding: 0; background: #fffdf2; }
.brand-mark [hidden] { display: none !important; }
.brand-mark #profileAvatar { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center; }
.brand strong, .topbar h1, .view-heading h2, .section-heading h2, .dialog-head h2, .backup-panel h2 { color: #38502a; }
.brand span, .sidebar-note, .view-heading p, .backup-panel > p:not(.eyebrow), .muted, .commission-meta, .commission-label, .task-priority, .project-title span, .project-description, .project-progress, .followup-meta, .metric-label, th, label span { color: #71845b; }
.eyebrow { color: #668c4b; }

.nav-item { border: 2px solid transparent; border-radius: 18px 22px 17px 20px; color: #4b6038; }
.nav-item:hover { border-color: #89a96a; background: #f7fde9; transform: none; }
.nav-item.active { border-color: var(--outline); background: #cfeab0; color: #38502a; box-shadow: 2px 3px 0 rgba(92, 125, 64, 0.14); }
.mascot-shelf { display: none; }

.button, .icon-button { border: 2px solid #78985c; border-radius: 15px 18px 14px 17px; background: #fffdf2; color: #40552f; box-shadow: none; }
.button:hover, .icon-button:hover { border-color: var(--outline); background: #f1fadf; transform: none; }
.button.primary { border-color: #557b3d; background: #7fa65d; box-shadow: 2px 3px 0 rgba(79, 111, 55, 0.18); }
.button.primary:hover { background: #6e964e; }
.button.danger { border-color: #be8a7e; background: #fff5e9; color: #9d6258; }

.commission-search input, .search, .toolbar select, .month-input, label input, label select, label textarea, .inline-link { border: 2px solid #a8c88a; border-radius: 15px 18px 14px 17px; background: #fffdf2; color: #40552f; }
.commission-search input:focus, .search:focus, .toolbar select:focus, .month-input:focus, label input:focus, label select:focus, label textarea:focus, .inline-link:focus { border-color: #628c47; outline: 3px solid rgba(187, 223, 148, 0.58); }

.commission-section, .followup-panel, .table-panel, .backup-panel, .weekly-plan-panel, .weekly-preview-panel, .dashboard-panel, .project-card, .summary-band, dialog {
  border: 2px solid var(--outline);
  border-radius: 22px 18px 24px 19px / 18px 24px 19px 23px;
  background: var(--matcha);
  box-shadow: var(--shadow);
}
.commission-section, .dashboard-panel, .project-card { position: relative; }
.commission-section::before, .dashboard-panel::before {
  position: absolute;
  top: -10px;
  left: 24px;
  width: 42px;
  height: 12px;
  border: 2px solid var(--outline);
  border-bottom: 0;
  border-radius: 15px 15px 0 0;
  background: #fff9e6;
  content: "";
  pointer-events: none;
}
.home-grid .dashboard-panel:first-child::before {
  top: -70px;
  left: 20px;
  z-index: 1;
  width: 70px;
  height: 70px;
  border: 0;
  border-radius: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='78' height='92' viewBox='0 0 78 92'%3E%3Cg stroke='%234d6437' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M23 57C10 49 9 35 14 27c11 5 17 16 16 29z' fill='%23c99062'/%3E%3Cpath d='M48 56c-1-13 5-24 16-29 4 10-1 22-12 30z' fill='%23c99062'/%3E%3Cpath d='M12 80c0-15 11-27 25-27s25 12 25 27v10H12z' fill='%23e4bd94'/%3E%3Ccircle cx='31' cy='70' r='1.8' fill='%234d6437'/%3E%3Ccircle cx='44' cy='70' r='1.8' fill='%234d6437'/%3E%3Cpath d='M35 77c2 2 5 2 7 0' fill='none'/%3E%3Cpath d='M8 96c8-6 17-6 25 0M45 96c8-6 17-6 25 0' fill='none' stroke='%2389b763'/%3E%3C/g%3E%3C/svg%3E") center bottom / contain no-repeat;
}
.home-grid .dashboard-panel:last-child::before {
  top: -70px;
  left: 20px;
  z-index: 1;
  width: 70px;
  height: 70px;
  border: 0;
  border-radius: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='78' height='92' viewBox='0 0 78 92'%3E%3Cg stroke='%234d6437' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M23 57C10 49 9 35 14 27c11 5 17 16 16 29z' fill='%23dcb48b'/%3E%3Cpath d='M48 56c-1-13 5-24 16-29 4 10-1 22-12 30z' fill='%23dcb48b'/%3E%3Cpath d='M12 80c0-15 11-27 25-27s25 12 25 27v10H12z' fill='%23fffdf2'/%3E%3Ccircle cx='31' cy='70' r='1.8' fill='%234d6437'/%3E%3Ccircle cx='44' cy='70' r='1.8' fill='%234d6437'/%3E%3Cpath d='M35 77c2 2 5 2 7 0' fill='none'/%3E%3Cpath d='M8 96c8-6 17-6 25 0M45 96c8-6 17-6 25 0' fill='none' stroke='%2389b763'/%3E%3C/g%3E%3C/svg%3E") center bottom / contain no-repeat;
}
.commission-section[aria-labelledby="firstCommissionHeading"]::before {
  top: -50px;
  left: 20px;
  z-index: 1;
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='78' height='92' viewBox='0 0 78 92'%3E%3Cg stroke='%234d6437' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M23 57C10 49 9 35 14 27c11 5 17 16 16 29z' fill='%23dcb48b'/%3E%3Cpath d='M48 56c-1-13 5-24 16-29 4 10-1 22-12 30z' fill='%23dcb48b'/%3E%3Cpath d='M12 80c0-15 11-27 25-27s25 12 25 27v10H12z' fill='%23fffdf2'/%3E%3Ccircle cx='31' cy='70' r='1.8' fill='%234d6437'/%3E%3Ccircle cx='44' cy='70' r='1.8' fill='%234d6437'/%3E%3Cpath d='M35 77c2 2 5 2 7 0' fill='none'/%3E%3C/g%3E%3C/svg%3E") center bottom / contain no-repeat;
}
.commission-section[aria-labelledby="repeatCommissionHeading"]::before {
  top: -50px;
  left: 20px;
  z-index: 1;
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='78' height='92' viewBox='0 0 78 92'%3E%3Cg stroke='%234d6437' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M23 57C10 49 9 35 14 27c11 5 17 16 16 29z' fill='%23c99062'/%3E%3Cpath d='M48 56c-1-13 5-24 16-29 4 10-1 22-12 30z' fill='%23c99062'/%3E%3Cpath d='M12 80c0-15 11-27 25-27s25 12 25 27v10H12z' fill='%23e4bd94'/%3E%3Ccircle cx='31' cy='70' r='1.8' fill='%234d6437'/%3E%3Ccircle cx='44' cy='70' r='1.8' fill='%234d6437'/%3E%3Cpath d='M35 77c2 2 5 2 7 0' fill='none'/%3E%3C/g%3E%3C/svg%3E") center bottom / contain no-repeat;
}
.commission-section[aria-labelledby="overdueCommissionHeading"]::before {
  top: -50px;
  left: 20px;
  z-index: 1;
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='78' height='92' viewBox='0 0 78 92'%3E%3Cg stroke='%234d6437' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M23 57C10 49 9 35 14 27c11 5 17 16 16 29z' fill='%23dcb48b'/%3E%3Cpath d='M48 56c-1-13 5-24 16-29 4 10-1 22-12 30z' fill='%23dcb48b'/%3E%3Cpath d='M12 80c0-15 11-27 25-27s25 12 25 27v10H12z' fill='%23fffdf2'/%3E%3Ccircle cx='31' cy='70' r='1.8' fill='%234d6437'/%3E%3Ccircle cx='44' cy='70' r='1.8' fill='%234d6437'/%3E%3Cpath d='M35 77c2 2 5 2 7 0' fill='none'/%3E%3C/g%3E%3C/svg%3E") center bottom / contain no-repeat;
}
.overdue-section { border-color: #9b7549; background: #f2f7d9; }
.home-grid .dashboard-panel:first-child, .home-grid .dashboard-panel:last-child, .weekly-panel, .project-card:nth-child(3n + 1), .project-card:nth-child(3n + 2), .project-card:nth-child(3n) { border-top-color: var(--outline); }
.summary-band { background: #c8e4ab; }
.metric { background: #e6f4d1; }
.metric:nth-child(3n + 1), .metric:nth-child(3n + 2), .metric:nth-child(3n) { background: #e6f4d1; }
.metric strong, .commission-value, .task-summary-item strong { color: #40552f; }

.task-summary-item, .task-item, .followup-item { border: 2px solid #a9c98c; border-radius: 18px 14px 20px 16px; background: #f5fbe8; color: #40552f; }
.task-summary-item:hover, .task-item:hover, .followup-item:hover { border-color: #648b49; background: #fbfff3; }
.task-summary-submission, .task-summary-followup, .task-summary-content, .task-summary-weekly, .task-summary-weekly-quantified, .task-summary-project { background: #f3fae5; border-left-color: #719b52; }
.task-item { border-left-color: #789e5a; }
.task-item.priority-high { border-left-color: #bd7e70; }
.task-item.priority-medium { border-left-color: #ad8650; }
.weekly-task, .weekly-preview-row, .commission-row, .performance-row, th, td, .project-progress, .project-card.compact { border-color: #c4dca8; }
.weekly-preview-row { border-left-color: #789e5a; }
.weekly-preview-row.priority-p0 { border-left-color: #bd7e70; }
.weekly-preview-row.priority-p1 { border-left-color: #ad8650; }
.followup-item, .task-summary-item { box-shadow: none; }

.status-pill { background: #cbe9ae; color: #41652f; }
.status-pill.warn { background: #f4e4b9; color: #866234; }
.status-pill.stop { background: #f7ded5; color: #9c5f55; }
.creator-name a { color: #537d3c; }
.creator-form { background: #eff9de; }
dialog { color: var(--ink); box-shadow: 3px 4px 0 rgba(82, 111, 57, 0.2); }
dialog::backdrop { background: rgba(72, 93, 55, 0.22); }

.sidebar::after {
  position: absolute;
  bottom: 4px;
  left: 12px;
  width: 170px;
  height: 86px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='210' height='110' viewBox='0 0 210 110'%3E%3Cg stroke='%234d6437' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M26 61C14 53 13 39 18 31c11 5 17 16 16 29z' fill='%23c78e5e'/%3E%3Cpath d='M50 60c-1-13 5-23 16-28 4 10-1 21-12 29z' fill='%23c78e5e'/%3E%3Cpath d='M15 87c0-17 12-30 27-30s27 13 27 30v8H15z' fill='%23e5b889'/%3E%3Ccircle cx='33' cy='76' r='1.8' fill='%234d6437'/%3E%3Ccircle cx='50' cy='76' r='1.8' fill='%234d6437'/%3E%3Cpath d='M38 82c3.5 4 8.5 4 12 0' fill='none'/%3E%3Cpath d='M72 62C60 54 59 40 65 31c12 5 19 17 17 30z' fill='%23dcb48b'/%3E%3Cpath d='M103 60c-1-13 7-24 19-27 3 11-3 21-14 29z' fill='%23dcb48b'/%3E%3Cpath d='M61 88c0-18 14-32 30-32s29 14 29 32v7H61z' fill='%23fffdf2'/%3E%3Ccircle cx='81' cy='76' r='1.8' fill='%234d6437'/%3E%3Ccircle cx='100' cy='76' r='1.8' fill='%234d6437'/%3E%3Cpath d='M87 82c3.5 4 8.5 4 12 0' fill='none' stroke-width='3'/%3E%3Cpath d='M146 85c0-7 5-12 12-12s12 5 12 12c0-7 5-12 12-12s12 5 12 12c0 8-7 14-18 21-11-7-18-13-18-21 0 7-7 14-18 21-11-7-18-13-18-21z' fill='%239dc879'/%3E%3Cpath d='M176 106v4M167 109h20' fill='none'/%3E%3C/g%3E%3Ctext x='13' y='22' fill='%235d803f' font-family='cursive' font-size='15'%3ELUCKY DAY%3C/text%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  content: "";
  pointer-events: none;
}
@media (max-width: 980px) {
  .sidebar::after { display: none; }
}
 .auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--page, #fff9e6);
}

.auth-card {
  width: min(100%, 430px);
  padding: 36px;
  border: 1px solid rgba(63, 48, 35, 0.12);
  border-radius: 28px;
  background: #fffdf5;
  box-shadow: 0 24px 70px rgba(73, 50, 25, 0.12);
}

.auth-card h1 { margin: 0 0 8px; }
.auth-intro { color: var(--muted, #786b5c); }
.auth-form { display: grid; gap: 16px; margin-top: 24px; }
.auth-form label { display: grid; gap: 6px; }
.auth-form input { width: 100%; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; }
.auth-links button { padding: 0; border: 0; background: transparent; color: var(--accent, #9c5c36); cursor: pointer; }
.auth-message { min-height: 24px; margin: 12px 0 0; color: #35704e; }
.auth-message.error { color: #a94442; }
.invite-panel > p { margin: 0 0 16px; color: var(--muted); }
.invite-form, .invite-created { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.invite-form label, .invite-created label { display: grid; flex: 1 1 220px; gap: 6px; }
.invite-list { display: grid; gap: 10px; margin-top: 12px; }
.invite-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 2px solid #a9c98c; border-radius: 14px; background: #f5fbe8; }
.invite-row p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
