:root {
  color-scheme: light;
  --bg: #f6f0e7;
  --surface: #fffdf9;
  --surface-2: #efe7dc;
  --ink: #251f21;
  --muted: #6c6261;
  --line: #ded4ca;
  --teal: #337d6e;
  --teal-soft: #dcebe5;
  --red: #c43a45;
  --red-soft: #fae5e7;
  --shadow: 0 18px 50px rgba(65, 47, 38, .09);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #161414;
  --surface: #211e1f;
  --surface-2: #2c2829;
  --ink: #f5eeea;
  --muted: #bdb1ae;
  --line: #413b3d;
  --teal: #86c7b7;
  --teal-soft: #203a34;
  --red: #ff7780;
  --red-soft: #452529;
  --shadow: 0 18px 50px rgba(0, 0, 0, .28);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--ink); font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0 28px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 28px; margin-bottom: 30px; }
.eyebrow, .label { margin: 0 0 7px; color: var(--muted); font-size: 12px; font-weight: 750; letter-spacing: .085em; text-transform: uppercase; }
h1, h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: -.025em; }
h1 { max-width: 720px; font-size: clamp(34px, 5vw, 62px); line-height: 1.02; }
h2 { font-size: 27px; line-height: 1.15; }
.lede { max-width: 660px; margin: 14px 0 0; color: var(--muted); font-size: 17px; }
.top-actions, .control-actions, .dialog-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 7px; padding: 10px 16px; background: var(--surface); color: var(--ink); text-decoration: none; cursor: pointer; font-weight: 720; transition: transform .15s ease, border-color .15s ease, background .15s ease; }
.icon-button { width: 44px; padding: 8px; font-size: 21px; line-height: 1; }
.button:hover { transform: translateY(-1px); border-color: var(--teal); }
.button:focus-visible, .filter:focus-visible, input:focus-visible { outline: 3px solid color-mix(in srgb, var(--teal) 45%, transparent); outline-offset: 2px; }
.button.primary { border-color: var(--teal); background: var(--teal); color: #fff; }
html[data-theme="dark"] .button.primary { color: #12201c; }
.summary { display: grid; grid-template-columns: 1.2fr repeat(3, 1fr); gap: 13px; margin-bottom: 18px; }
.summary-card { display: flex; min-height: 142px; flex-direction: column; justify-content: flex-end; border: 1px solid var(--line); border-radius: 16px; padding: 20px; background: var(--surface); box-shadow: var(--shadow); }
.summary-card strong { margin-bottom: 4px; font-family: Georgia, "Times New Roman", serif; font-size: 28px; font-weight: 500; }
.summary-card span:last-child { color: var(--muted); }
.primary-card { border-color: color-mix(in srgb, var(--teal) 35%, var(--line)); background: linear-gradient(145deg, var(--teal-soft), var(--surface)); }
.primary-card strong { color: var(--teal); }
.control-panel { display: grid; grid-template-columns: 1fr auto; gap: 18px 30px; align-items: center; border: 1px solid var(--line); border-radius: 16px; padding: 22px; background: var(--surface); }
.control-panel p { margin: 7px 0 0; color: var(--muted); }
.action-status { grid-column: 1 / -1; min-height: 1.4em; margin: -2px 0 0 !important; }
.action-status.is-error { color: var(--red); }
main { margin-top: 42px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.search-wrap input { width: min(320px, 100%); min-height: 44px; border: 1px solid var(--line); border-radius: 7px; padding: 10px 13px; background: var(--surface); color: var(--ink); }
.filter-row { display: flex; gap: 8px; margin: 18px 0; overflow-x: auto; padding-bottom: 3px; }
.filter { min-height: 38px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px; background: transparent; color: var(--muted); cursor: pointer; }
.filter.is-active { border-color: var(--teal); background: var(--teal-soft); color: var(--ink); }
.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.project-card { display: flex; min-height: 244px; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: var(--surface); }
.card-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.project-card h3 { margin: 0; font-size: 18px; line-height: 1.25; }
.status { flex: 0 0 auto; border-radius: 999px; padding: 4px 8px; background: var(--teal-soft); color: var(--teal); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.status.attention { background: var(--red-soft); color: var(--red); }
.project-meta { display: grid; grid-template-columns: 96px 1fr; gap: 6px 10px; margin: 20px 0; font-size: 13px; }
.project-meta dt { color: var(--muted); }
.project-meta dd { margin: 0; overflow-wrap: anywhere; }
.card-links { display: flex; gap: 9px; flex-wrap: wrap; margin-top: auto; }
.card-links a { color: var(--teal); font-weight: 750; text-underline-offset: 3px; }
.empty-state { border: 1px dashed var(--line); border-radius: 14px; padding: 30px; color: var(--muted); text-align: center; }
footer { display: grid; grid-template-columns: 1fr auto; gap: 4px 20px; margin-top: 34px; border-top: 1px solid var(--line); padding-top: 19px; color: var(--muted); font-size: 13px; }
footer p { margin: 0; }
.version { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
dialog { width: min(520px, calc(100% - 28px)); border: 1px solid var(--line); border-radius: 16px; padding: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(15, 12, 13, .55); backdrop-filter: blur(3px); }
dialog form { padding: 24px; }
dialog p:not(.label) { color: var(--muted); }
.dialog-actions { justify-content: flex-end; margin-top: 22px; }
.notice.error { color: var(--red); }
.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; }
@media (max-width: 900px) { .summary { grid-template-columns: repeat(2, 1fr); } .project-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .shell { width: min(100% - 22px, 1180px); padding-top: 24px; }
  .topbar, .section-heading { align-items: stretch; flex-direction: column; }
  .top-actions .button, .control-actions .button { flex: 1 1 auto; }
  .summary { grid-template-columns: 1fr 1fr; gap: 9px; }
  .summary-card { min-height: 128px; padding: 15px; }
  .summary-card strong { font-size: 23px; }
  .control-panel { grid-template-columns: 1fr; padding: 18px; }
  .action-status { grid-column: 1; }
  .project-grid { grid-template-columns: 1fr; }
  .search-wrap input { width: 100%; }
  footer { grid-template-columns: 1fr; }
  .version { grid-row: auto; grid-column: auto; margin-top: 9px; }
}
@media (max-width: 640px) {
  .top-actions .icon-button { flex: 0 0 44px; }
}
