:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f5f7;
  color: #17191c;
  --border: #dfe2e7;
  --muted: #6e737b;
  --surface: #fff;
  --ink: #17191c;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, textarea { font: inherit; }
button, .button {
  border: 0; border-radius: 10px; padding: 10px 15px; background: #17191c; color: #fff;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; touch-action: manipulation;
}
button:disabled, .button[aria-disabled="true"] { cursor: wait; opacity: .58; }
button:focus-visible, .button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(34, 91, 190, .35); outline-offset: 2px;
}
button.secondary, .button.secondary { background: #fff; color: #17191c; border: 1px solid var(--border); }
.topbar { display: flex; justify-content: space-between; align-items: end; max-width: 1180px; margin: 0 auto; padding: 36px 24px 20px; }
h1 { font-size: clamp(28px, 4vw, 48px); margin: 2px 0 0; letter-spacing: -.04em; }
.eyebrow { font-size: 12px; letter-spacing: .18em; font-weight: 700; color: var(--muted); }
main { max-width: 1180px; margin: 0 auto; padding: 0 24px 60px; }
.panel, .token-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 1px 1px rgba(0,0,0,.03); }
.token-card { padding: 18px; display: flex; gap: 24px; align-items: center; justify-content: space-between; }
.token-card p, .panel p { color: var(--muted); margin: 5px 0 0; font-size: 14px; }
.token-control { display: grid; gap: 6px; min-width: min(100%, 460px); }
.token-control > label { margin: 0; }
.token-row { display: flex; gap: 8px; }
.feedback { display: block; min-height: 18px; color: var(--muted); font-size: 13px; }
input, textarea { width: 100%; min-height: 44px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: #fafbfc; color: var(--ink); }
textarea { resize: vertical; }
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin: 16px 0; }
.stat { background: #17191c; color: #fff; border-radius: 14px; padding: 16px; min-height: 92px; }
.stat strong { display: block; font-size: 30px; letter-spacing: -.04em; }
.stat span { color: #b9bec6; font-size: 13px; }
.composer { display: grid; grid-template-columns: .8fr 1.2fr; gap: 28px; padding: 22px; }
.panel-title { font-weight: 700; font-size: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.tabs { display: flex; gap: 7px; margin: 22px 0 10px; overflow-x: auto; }
.tab { background: transparent; color: var(--muted); border: 1px solid transparent; white-space: nowrap; }
.tab.active { background: #fff; color: var(--ink); border-color: var(--border); }
.content-panel { min-height: 300px; overflow: hidden; }
.item { display: grid; grid-template-columns: 150px 1fr auto; gap: 16px; padding: 17px 20px; border-bottom: 1px solid var(--border); align-items: start; }
.item:last-child { border-bottom: 0; }
.item-meta { font-size: 12px; color: var(--muted); word-break: break-word; }
.item-title { font-weight: 650; line-height: 1.4; }
.item-body { margin-top: 6px; color: #4d5259; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.badge { border: 1px solid var(--border); border-radius: 999px; padding: 4px 8px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.badge.complete, .badge.done { background: #e9f8ef; color: #22653b; border-color: #ccebd7; }
.badge.failed { background: #fff0f0; color: #9d2f2f; border-color: #f2cccc; }
.item-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: end; }
.item-actions a, .item-actions button { padding: 6px 9px; font-size: 12px; }
.empty { padding: 50px; text-align: center; color: var(--muted); }
.error { margin: 12px 0; padding: 12px 14px; border-radius: 10px; background: #fff0f0; color: #8b2424; border: 1px solid #f0caca; }
.hidden { display: none !important; }
.footer-actions { margin-top: 18px; display: flex; gap: 15px; align-items: center; color: var(--muted); font-size: 13px; }
@media (max-width: 850px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .composer { grid-template-columns: 1fr; }
  .token-card { align-items: stretch; flex-direction: column; }
  .token-row { min-width: 0; }
  .item { grid-template-columns: 1fr; }
  .item-actions { justify-content: start; }
}
@media (max-width: 520px) {
  .topbar { padding: 24px 16px 16px; }
  main { padding: 0 12px 40px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .token-row { flex-direction: column; }
  .footer-actions { align-items: stretch; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
