:root {
  color-scheme: light;
  --bg: #f3f7f5;
  --surface: #fff;
  --text: #172f2a;
  --muted: #536c64;
  --line: #dce7e1;
  --accent: #006c5b;
  --soft: #e0f1e9;
  --soft-text: #075f4d;
  --error: #a82432;
  --error-bg: #fff1f2;
  --safe-top: max(env(safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #10201b;
  --surface: #192d25;
  --text: #edf8f0;
  --muted: #aec3b7;
  --line: #354a3e;
  --accent: #007d69;
  --soft: #214d3e;
  --soft-text: #b2ebd2;
  --error: #ffb7bf;
  --error-bg: #46282d;
}
* { box-sizing: border-box; }
html { min-width: 280px; background: var(--bg); }
body { margin: 0; color: var(--text); font-size: 15px; line-height: 1.5; }
button, input, textarea { font: inherit; }
button, a, input, textarea, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .65; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid #139fe2; outline-offset: 3px;
}
button, textarea, input { color: var(--text); }
button { touch-action: manipulation; }
button svg, a svg { pointer-events: none; }
[hidden] { display: none !important; }
.app { max-width: 540px; min-height: 100svh; margin: 0 auto; display: flex; flex-direction: column; background: var(--bg); }
.header { display: flex; gap: 12px; align-items: center; padding: calc(18px + var(--safe-top) + var(--tg-content-safe-area-inset-top, 0px)) 22px 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.mark { width: 43px; height: 43px; display: grid; place-items: center; flex-shrink: 0; color: white; background: var(--accent); border-radius: 14px; font-weight: 800; letter-spacing: -1px; }
.brand { font-size: 16px; font-weight: 800; letter-spacing: 1.4px; }
.subtitle { font-size: 12px; color: var(--muted); }
.demo-banner { padding: 10px 22px; background: var(--soft); color: var(--soft-text); border-bottom: 1px solid var(--line); font-size: 12px; }
main { flex: 1; padding: 27px 22px 34px; min-width: 0; }
h1 { font-size: 29px; line-height: 1.2; letter-spacing: -.8px; margin: 0 0 13px; overflow-wrap: anywhere; }
h2 { font-size: 19px; line-height: 1.35; margin: 0 0 10px; }
h1:focus { outline: none; }
p { margin: 0 0 19px; }
.muted { color: var(--muted); font-size: 14px; }
.eyebrow { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 1.25px; margin: 0 0 13px; }
.intro { margin-bottom: 27px; }
.stack { display: grid; gap: 12px; }
.home-card { display: flex; align-items: center; gap: 14px; min-height: 93px; padding: 19px 16px; border: 1px solid var(--line); border-radius: 19px; text-align: left; background: var(--surface); width: 100%; }
.home-card > span:nth-child(2) { flex: 1; min-width: 0; }
.home-card strong { display: block; font-size: 17px; font-weight: 700; }
.home-card small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.home-card.primary-card { background: var(--accent); border-color: var(--accent); color: #fff; }
.primary-card small { color: #e3fff6; }
.icon-tile { display: grid; place-items: center; flex-shrink: 0; width: 45px; height: 45px; border-radius: 14px; color: var(--soft-text); background: var(--soft); }
.primary-card .icon-tile { background: #ffffff24; color: #fff; }
svg { width: 22px; height: 22px; flex-shrink: 0; vertical-align: middle; }
.chevron { width: 18px; height: 18px; opacity: .65; }
.home-note { margin-top: 23px; display: flex; align-items: flex-start; gap: 9px; font-size: 12px; color: var(--muted); }
.home-note svg { width: 17px; height: 17px; margin-top: 2px; }
.nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 8px 10px calc(8px + var(--safe-bottom) + var(--tg-content-safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--line); }
.nav button { display: flex; align-items: center; flex-direction: column; gap: 3px; border: 0; border-radius: 13px; background: transparent; color: var(--muted); padding: 8px 3px; font-size: 11px; min-height: 58px; }
.nav button span { font-size: 23px; height: 25px; line-height: 1; }
.nav button[aria-current="page"] { color: var(--soft-text); background: var(--soft); font-weight: 700; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); border: 0; background: none; padding: 0 4px 0 0; min-height: 44px; margin: -12px 0 10px; font-size: 13px; }
.back svg { width: 17px; height: 17px; }
.primary, .secondary { display: flex; justify-content: center; align-items: center; gap: 9px; padding: 14px 15px; width: 100%; min-height: 50px; border-radius: 14px; font-weight: 650; text-decoration: none; text-align: center; }
.primary { color: #fff; background: var(--accent); border: 1px solid var(--accent); }
.secondary { background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.text-button { min-height: 44px; background: none; border: none; color: var(--soft-text); font-size: 13px; padding: 8px 4px; text-decoration: underline; text-underline-offset: 3px; }
.card { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); padding: 18px; margin-bottom: 15px; }
.choice { display: flex; align-items: center; justify-content: space-between; text-align: left; width: 100%; padding: 17px; min-height: 64px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; }
.choice[aria-pressed="true"], .box[aria-pressed="true"] { border: 2px solid var(--accent); background: var(--soft); color: var(--soft-text); }
.box-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 22px; }
.box { min-height: 58px; border: 1px solid var(--line); background: var(--surface); border-radius: 13px; font-size: 18px; font-weight: 650; }
.progress { display: flex; gap: 6px; margin: 8px 0 24px; }
.progress span { flex: 1; height: 4px; border-radius: 5px; background: var(--line); }
.progress .complete { background: var(--accent); }
.step-caption { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
label { display: block; font-size: 13px; font-weight: 650; margin: 16px 0 8px; }
textarea { display: block; width: 100%; min-height: 140px; resize: vertical; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 16px; }
input[type="file"] { display: block; max-width: 100%; font-size: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 11px; }
input[type="file"]::file-selector-button { background: var(--soft); color: var(--soft-text); border: none; border-radius: 7px; min-height: 34px; padding: 6px 9px; margin-right: 8px; }
.count { margin: 5px 0 15px; text-align: right; font-size: 12px; color: var(--muted); }
.file-info { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; margin: 8px 0 15px; }
.field-hint { margin: 8px 0 15px; color: var(--muted); font-size: 12px; }
.error { background: var(--error-bg); color: var(--error); border-radius: 12px; padding: 12px 14px; font-size: 13px; margin: 16px 0; overflow-wrap: anywhere; }
.notice { padding: 16px; background: var(--soft); color: var(--soft-text); border-radius: 14px; font-size: 13px; margin: 16px 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.status { display: inline-block; color: var(--soft-text); background: var(--soft); border-radius: 7px; padding: 4px 8px; font-size: 11px; font-weight: 650; }
.request-card { display: block; text-align: left; width: 100%; }
.request-card h2 { margin: 13px 0 8px; font-size: 17px; }
.request-card .description { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 12px; }
.description { white-space: pre-wrap; overflow-wrap: anywhere; }
.small { font-size: 12px; color: var(--muted); }
.detail-list { margin: 0 0 17px; }
.detail-list > div { padding: 9px 0; display: grid; grid-template-columns: 85px minmax(0, 1fr); gap: 8px; border-bottom: 1px solid var(--line); }
.detail-list dt { color: var(--muted); font-size: 12px; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 600; }
.timeline { list-style: none; padding: 0; margin: 14px 0 24px; }
.timeline li { position: relative; padding: 0 0 20px 25px; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: 3px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.timeline li::after { content: ""; position: absolute; left: 6px; top: 20px; bottom: 1px; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline time { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.timeline .reply { margin-top: 7px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.success-icon { width: 58px; height: 58px; display: grid; place-items: center; color: var(--soft-text); background: var(--soft); border-radius: 20px; margin: 9px 0 24px; }
.success-icon svg { width: 29px; height: 29px; }
.empty { padding: 27px 17px; text-align: center; }
.empty .icon-tile { margin: 0 auto 16px; }
details { border-bottom: 1px solid var(--line); padding: 15px 0; }
summary { cursor: pointer; font-size: 14px; font-weight: 650; min-height: 28px; }
details p { font-size: 13px; color: var(--muted); margin: 13px 0 0; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 210px; font-size: 14px; color: var(--muted); }
.spinner { width: 19px; height: 19px; display: inline-block; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.actions { display: grid; gap: 10px; margin-top: 22px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; border-right-color: currentColor; } }
@media (max-width: 360px) { main { padding: 24px 16px 29px; } .header { padding-left: 16px; padding-right: 16px; } .home-card { padding: 16px 12px; gap: 11px; } .home-card strong { font-size: 16px; } .icon-tile { width: 39px; height: 39px; } h1 { font-size: 27px; } }
@media (min-width: 560px) { .app { border-right: 1px solid var(--line); border-left: 1px solid var(--line); } }
