:root {
 font-family: system-ui, sans-serif;
 color: #211d1b;
 background: #f8f5f2;
 --red: #bb151c;
 --line: #e7ddd7;
 --muted: #645b57;
 --surface: #fffdfb;
 --app-gutter: clamp(16px, 4vw, 56px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.app-bar, .app-main { width: min(calc(100% - 2 * var(--app-gutter)), 1328px); margin-inline: auto; }
.app-bar {
 position: sticky;
 z-index: 2;
 top: 14px;
 display: grid;
 grid-template-columns: auto minmax(0, 1fr) auto;
 align-items: center;
 gap: 12px;
 margin-block: 20px 30px;
 padding: 8px 10px;
 border-radius: 999px;
 background: #090909;
 box-shadow: 0 8px 24px #1d14141a;
}
.app-brand { display: grid; place-items: center; width: 152px; height: 48px; border-radius: 999px; background: white; }
.app-brand svg { display: block; }
.app-links { display: flex; justify-content: center; gap: 2px; min-width: 0; padding: 3px; }
.app-links a { display: flex; align-items: center; flex: none; min-height: 38px; padding: 6px 12px; border-radius: 999px; color: white; text-decoration: none; font-size: 13px; font-weight: 650; white-space: nowrap; }
.app-links a:hover, .app-links a[aria-current="page"] { background: #ffffff24; }
.app-links a:focus-visible { outline-color: white; outline-offset: 1px; }
.app-logout { border: 0; border-radius: 999px; min-height: 38px; padding: 6px 16px; background: white; color: #171312; font-size: 13px; font-weight: 700; }
.app-logout:hover { background: #f4e2df; }
.app-main { padding-bottom: 48px; }
.page-header, .details-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.page-header { margin-bottom: 22px; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: clamp(27px, 4vw, 48px); letter-spacing: -.05em; }
h2 { font-size: 22px; letter-spacing: -.02em; overflow-wrap: anywhere; }
h3 { font-size: 16px; }
.preview { color: #75421d; background: #f8e8d8; padding: 10px 14px; border-radius: 8px; width: fit-content; }
.secondary, .primary { min-height: 42px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 13px; background: var(--surface); color: inherit; font-weight: 650; }
.workspace { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(0, 1.2fr); gap: 20px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: clamp(16px, 2.4vw, 28px); min-width: 0; }
.search { margin: 18px 0 14px; }
label { display: grid; gap: 8px; font-size: 14px; font-weight: 650; }
input, select, textarea { width: 100%; padding: 10px; border: 1px solid #c8bbb4; border-radius: 7px; color: inherit; background: #fff; }
textarea { resize: vertical; }
.requests { padding: 0; margin: 0; list-style: none; }
.requests li + li { border-top: 1px solid var(--line); }
.requests button { display: grid; gap: 5px; width: 100%; padding: 13px 10px; border: 0; border-left: 3px solid transparent; background: transparent; color: inherit; text-align: left; overflow-wrap: anywhere; }
.requests button:hover, .requests button[aria-pressed="true"] { background: #f9eeeb; }
.requests button[aria-pressed="true"] { border-left-color: var(--red); }
.requests small, .quiet, dt { color: var(--muted); }
.dashboard-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; color: inherit; text-decoration: none; font-weight: 650; }
a.stat:hover { border-color: var(--red); }
.stat strong { color: var(--red); font-size: clamp(28px, 4vw, 42px); line-height: 1.1; }
.dashboard-charts { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; margin-bottom: 20px; }
.timeline-plot { --timeline-height: clamp(146px, 16vw, 185px); --axis-width: 34px; position: relative; margin-top: 30px; }
.timeline-axis { position: absolute; inset: 0 0 auto var(--axis-width); height: var(--timeline-height); display: flex; flex-direction: column; justify-content: space-between; }
.timeline-axis > div { position: relative; border-top: 1px solid var(--line); }
.timeline-axis span { position: absolute; inset-inline-end: calc(100% + 8px); transform: translateY(-50%); color: var(--muted); font-size: 11px; }
.timeline-days { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin: 0; padding: 0 0 0 var(--axis-width); list-style: none; }
.timeline-column { display: flex; align-items: flex-end; justify-content: center; height: var(--timeline-height); }
.timeline-bar {
 position: relative;
 width: min(54%, 42px);
 height: var(--bar-height);
 border-radius: 6px 6px 0 0;
 background: linear-gradient(180deg, #df333a, var(--red));
 transform-origin: bottom;
 animation: timeline-rise 580ms cubic-bezier(.22, .7, .26, 1) var(--bar-delay) both;
}
.timeline-value { position: absolute; bottom: calc(100% + 5px); left: 50%; transform: translateX(-50%); color: #91242a; font-size: 12px; font-weight: 750; }
.timeline-label { display: grid; gap: 3px; margin-top: 8px; text-align: center; font-size: 12px; font-weight: 650; }
.timeline-label small { color: var(--muted); font-size: 10px; font-weight: 450; }
.status-chart {
 --status-new: #bd2028;
 --status-working: #a86209;
 --status-done: #287257;
 display: grid;
 grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
 align-items: center;
 gap: clamp(10px, 2vw, 24px);
 min-height: 220px;
 margin-top: 22px;
}
.status-ring { position: relative; display: grid; place-items: center; width: min(100%, 174px); aspect-ratio: 1; justify-self: center; }
.status-ring-fill {
 position: absolute;
 inset: 0;
 border-radius: 50%;
 background: conic-gradient(var(--status-new) 0 var(--new-end), var(--status-working) var(--new-end) var(--working-end), var(--status-done) var(--working-end) 100%);
 animation: ring-enter 700ms cubic-bezier(.22, .7, .26, 1) both;
}
.status-ring-fill.empty { background: #ebe3de; }
.status-total { position: relative; display: grid; place-content: center; width: 73%; aspect-ratio: 1; border-radius: 50%; background: var(--surface); text-align: center; }
.status-total strong { font-size: clamp(26px, 3vw, 36px); line-height: 1.05; }
.status-total span { color: var(--muted); font-size: 12px; }
.status-key { padding: 0; margin: 0; list-style: none; }
.status-key a { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto minmax(34px, auto); align-items: center; gap: 8px; padding: 10px 3px; color: inherit; font-size: 13px; text-decoration: none; }
.status-key li + li { border-top: 1px solid var(--line); }
.status-key a:hover { color: var(--red); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; }
[data-status="new"] .status-dot { background: var(--status-new); }
[data-status="working"] .status-dot { background: var(--status-working); }
[data-status="done"] .status-dot { background: var(--status-done); }
.status-key small { color: var(--muted); text-align: right; }
@keyframes timeline-rise { from { transform: scaleY(0); opacity: .4; } to { transform: scaleY(1); opacity: 1; } }
@keyframes ring-enter { from { transform: scale(.82) rotate(-22deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
 .timeline-bar, .status-ring-fill { animation: none; }
}
.recent { margin-top: 12px; }
.recent a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 6px; color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.recent a:hover { background: #f9eeeb; }
.recent a > span:first-child { display: grid; gap: 4px; }
.badge { flex: none; font-size: 12px; font-weight: 700; color: #852325; background: #f9ebe8; padding: 6px 8px; border-radius: 6px; }
.metadata { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; margin: 20px 0; padding: 15px 0; border-block: 1px solid var(--line); }
dt { font-size: 13px; }
dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.message { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; margin: 8px 0 24px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 14px; }
.primary { background: var(--red); border-color: var(--red); color: white; justify-self: start; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.follow-up { margin-bottom: 24px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #faf1ed; }
.follow-up summary { cursor: pointer; font-weight: 700; }
.follow-up-draft { display: grid; gap: 14px; margin: 14px 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.follow-up-copy { margin: 0; white-space: pre-line; line-height: 1.55; }
.follow-up a { display: inline-flex; align-items: center; text-decoration: none; }
.follow-up a[aria-disabled="true"] { cursor: not-allowed; opacity: .55; }
.follow-up-hint { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
#list-status, #save-status { color: var(--muted); font-size: 14px; }
#list-status:empty, #save-status:empty { display: none; }
.login-page {
 display: grid;
 grid-template-columns: minmax(0, 1fr);
 min-height: 100svh;
 place-items: center;
 background: radial-gradient(ellipse at 78% 15%, #f5dcd7, transparent 55%), #f8f5f2;
}
.login-shell { width: min(100%, 512px); padding: 20px; margin: 0 auto; }
.login-card { padding: clamp(24px, 7vw, 44px); box-shadow: 0 24px 70px #5c2a1814; }
.login-logo { display: block; max-width: 100%; height: auto; margin-bottom: 28px; }
.login-card h1 { font-size: clamp(30px, 5vw, 42px); }
.login-subtitle { margin: 6px 0 26px; }
#login-fields { gap: 8px; }
#login-fields input { min-height: 46px; margin-bottom: 10px; }
.login-submit { width: 100%; min-height: 46px; }
.login-demo { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.login-demo p { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.login-status { color: #8d1720; font-size: 14px; margin: 12px 0 0; }
.login-status:empty { display: none; }
@media (max-width: 860px) {
 .app-bar { grid-template-columns: minmax(0, 1fr) auto; border-radius: 24px; gap: 4px; }
 .app-links { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; overflow-x: auto; }
 .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
 .dashboard-charts { grid-template-columns: minmax(0, 1fr); }
 .status-chart { min-height: 0; }
}
@media (max-width: 620px) {
 .workspace, .metadata { grid-template-columns: minmax(0, 1fr); }
 .page-header, .details-header { flex-wrap: wrap; }
 .workspace .card { scroll-margin-top: 130px; }
}
@media (max-width: 540px) {
 .app-links { flex-wrap: wrap; overflow: visible; }
 .app-links a { min-height: 34px; padding-inline: 9px; }
 .workspace .card { scroll-margin-top: 166px; }
}
