:root {
  --bg: var(--tg-theme-bg-color, #f4f5f7);
  --surface: var(--tg-theme-secondary-bg-color, #ffffff);
  --text: var(--tg-theme-text-color, #202124);
  --muted: var(--tg-theme-hint-color, #74777f);
  --accent: var(--tg-theme-button-color, #6f45c2);
  --accent-text: var(--tg-theme-button-text-color, #ffffff);
  --danger: #cc3d4a;
  --line: color-mix(in srgb, var(--text) 10%, transparent);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: calc(18px + env(safe-area-inset-top)) 18px 12px; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .18em; }
h1 { margin: 3px 0 0; font-size: 26px; line-height: 1.15; }
main { padding: 0 14px calc(30px + env(safe-area-inset-bottom)); }
.icon-button, .text-button { border: 0; color: var(--accent); background: transparent; min-width: 42px; height: 42px; font-size: 28px; border-radius: 14px; }
.topbar .icon-button { background: var(--accent); color: var(--accent-text); box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 28%, transparent); }
.text-button { font-size: 15px; font-weight: 700; width: auto; padding: 0 8px; }
.search { display: grid; grid-template-columns: auto 1fr auto; gap: 9px; align-items: center; background: var(--surface); padding: 8px 9px 8px 14px; border-radius: 16px; border: 1px solid var(--line); }
.search span { color: var(--muted); font-size: 23px; }
.search input { border: 0; outline: 0; background: transparent; color: var(--text); min-width: 0; }
.search button, .primary { border: 0; border-radius: 11px; padding: 9px 13px; background: var(--accent); color: var(--accent-text); font-weight: 700; }
.tabs { display: flex; gap: 7px; overflow-x: auto; padding: 14px 0 10px; scrollbar-width: none; }
.tabs button { white-space: nowrap; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 9px 13px; }
.tabs button.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.issue-list { display: grid; gap: 9px; }
.issue { width: 100%; text-align: left; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 17px; padding: 14px; box-shadow: 0 3px 12px rgba(0,0,0,.035); }
.issue-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.issue-id { color: var(--muted); font-weight: 700; font-size: 13px; }
.badge { border-radius: 999px; padding: 4px 8px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-size: 12px; font-weight: 700; }
.issue-title { font-size: 16px; font-weight: 720; line-height: 1.3; }
.issue-meta { color: var(--muted); font-size: 13px; margin-top: 9px; display: flex; gap: 8px; flex-wrap: wrap; }
.status { border-radius: 14px; padding: 12px; margin: 4px 0 10px; background: var(--surface); color: var(--muted); }
.status.error { color: var(--danger); }
.hidden { display: none !important; }
.secondary { display: block; width: 100%; margin-top: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--accent); padding: 12px; border-radius: 14px; font-weight: 700; }
.loader { display: flex; gap: 6px; justify-content: center; padding: 32px; }
.loader i { width: 7px; height: 7px; background: var(--accent); border-radius: 50%; animation: pulse .9s infinite alternate; }
.loader i:nth-child(2) { animation-delay: .2s; }.loader i:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { to { opacity: .25; transform: translateY(-5px); } }
.sheet { width: 100%; max-width: 620px; height: 100%; max-height: 100%; margin: 0 0 0 auto; border: 0; padding: 0; background: var(--bg); color: var(--text); }
.sheet::backdrop { background: rgba(0,0,0,.35); }
.sheet-head { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 50px 1fr 50px; align-items: center; min-height: calc(58px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 8px 0; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); text-align: center; }
.sheet-head span, .sheet-head strong { font-size: 15px; }
.sheet-body { padding: 18px 16px calc(32px + env(safe-area-inset-bottom)); }
.detail-title { margin: 0 0 14px; font-size: 23px; line-height: 1.25; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 10px; }
.fact small { color: var(--muted); display: block; margin-bottom: 3px; }
.description { white-space: pre-wrap; line-height: 1.5; margin: 18px 0; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0; }
.actions button { border: 0; border-radius: 13px; padding: 12px; background: var(--accent); color: var(--accent-text); font-weight: 700; }
.editor { display: grid; gap: 9px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 13px; margin: 12px 0; }
.editor select, .editor input, .editor textarea, .form-grid input, .form-grid select, .form-grid textarea { width: 100%; border: 1px solid var(--line); background: var(--bg); color: var(--text); padding: 11px; border-radius: 11px; outline: none; }
.comments h3 { margin-top: 22px; }
.comment { border-left: 3px solid var(--accent); padding: 3px 0 3px 11px; margin: 14px 0; }
.comment small { color: var(--muted); }
.comment p { white-space: pre-wrap; margin: 5px 0; }
.form-grid { display: grid; gap: 15px; }
.form-grid label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
@media (min-width: 700px) { main { max-width: 760px; margin: auto; }.topbar { max-width: 780px; margin: auto; }.issue-list { grid-template-columns: 1fr 1fr; } }
