:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  font-size: 15px;
  font-synthesis: none;
  color: var(--tg-theme-text-color, #19242c);
  background: var(--tg-theme-bg-color, #fff);
  color-scheme: light dark;
  --surface: var(--tg-theme-secondary-bg-color, #f4f6f8);
  --text: var(--tg-theme-text-color, #19242c);
  --muted: var(--tg-theme-hint-color, #84909b);
  --accent: var(--tg-theme-button-color, #3180f6);
  --accent-text: var(--tg-theme-button-text-color, #fff);
  --line: color-mix(in srgb, var(--text) 9%, transparent);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--tg-theme-bg-color, #fff); }
button, textarea, input { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .55; cursor: default; }
button:focus-visible, textarea:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.shell { max-width: 810px; padding: 22px 20px 70px; margin: 0 auto; }
.topbar { display: flex; align-items: center; gap: 12px; padding-bottom: 28px; }
.brand-icon { display: grid; place-items: center; font-size: 26px; width: 46px; height: 46px; color: var(--accent); background: var(--surface); border-radius: 15px; }
.brand { flex: 1; min-width: 0; }
.eyebrow { font-size: 10px; font-weight: 750; color: var(--muted); letter-spacing: .13em; }
h1, h2, p { margin: 0; }
h1 { font-size: 19px; letter-spacing: -.035em; margin-top: 3px; }
h2 { font-size: 24px; letter-spacing: -.045em; line-height: 1.17; }
.role { color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent); padding: 6px 10px; border-radius: 99px; font-size: 12px; font-weight: 650; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding: 0 0 24px; }
.subtitle { color: var(--accent); font-weight: 700; font-size: 12px; margin-bottom: 8px; }
.intro .muted { margin-top: 10px; line-height: 1.55; }
.muted { color: var(--muted); }
.button { display: inline-flex; align-items: center; justify-content: center; border: none; border-radius: 12px; min-height: 42px; padding: 10px 16px; font-weight: 650; white-space: nowrap; }
.button.primary { background: var(--accent); color: var(--accent-text); }
.button.ghost { color: var(--accent); background: var(--surface); }
.controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 8px 0 27px; }
.tabs { display: inline-flex; background: var(--surface); border-radius: 11px; padding: 4px; gap: 2px; flex: 0 0 auto; }
.tab { border: none; border-radius: 8px; background: transparent; padding: 8px 19px; color: var(--muted); font-weight: 650; }
.tab.active { background: var(--tg-theme-bg-color, #fff); color: var(--text); box-shadow: 0 1px 5px #0000000c; }
.search { display: flex; align-items: center; gap: 8px; border-radius: 11px; background: var(--surface); padding: 0 13px; min-height: 42px; flex: 1; max-width: 330px; color: var(--muted); font-size: 22px; }
.search input { color: var(--text); background: transparent; border: 0; outline: none; width: 100%; min-width: 0; font-size: 13px; }
.search input::placeholder { color: var(--muted); }
.section-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 700; margin: 0 0 14px; }
.list { display: grid; gap: 10px; }
.item { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); padding: 17px 18px; border-radius: 15px; }
.item-body { flex: 1; min-width: 0; }
.meta { display: flex; flex-wrap: wrap; gap: 7px 13px; align-items: center; color: var(--muted); font-size: 11px; font-weight: 550; }
.meta .id { color: var(--accent); font-weight: 750; }
.prediction { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.6; margin: 11px 0 0; }
.item-actions { flex: 0 0 auto; }
.icon-button { border: 0; background: transparent; color: var(--muted); font-size: 25px; line-height: 1; padding: 5px 9px; border-radius: 9px; }
.icon-button:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, transparent); }
.more { text-align: center; padding: 25px 0; }
.empty { text-align: center; padding: 62px 16px; background: var(--surface); border-radius: 15px; color: var(--muted); }
.empty-symbol { font-size: 39px; color: var(--accent); margin-bottom: 15px; }
.empty h2 { color: var(--text); font-size: 18px; margin-bottom: 7px; }
.error-screen { text-align: center; padding: 70px 20px; }
.error-screen h2 { margin-bottom: 12px; }
.error-screen p { line-height: 1.6; }
.dialog { position: fixed; width: min(100% - 28px, 540px); max-height: min(85vh, 730px); border: 1px solid var(--line); border-radius: 18px; background: var(--tg-theme-bg-color, #fff); color: var(--text); box-shadow: 0 15px 60px #0002; padding: 0; }
.dialog::backdrop { background: #0009; }
.editor-form { padding: 22px; }
.editor-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 27px; }
.editor-head h2 { font-size: 20px; }
.field-label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 11px; }
textarea { width: 100%; resize: vertical; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--text); padding: 15px; line-height: 1.6; min-height: 150px; outline: none; }
textarea::placeholder { color: var(--muted); }
.editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 17px; }
.editor-footer .muted { font-size: 12px; }
.delete-button { display: block; width: 100%; margin-top: 17px; padding: 10px; background: transparent; border: 0; color: var(--tg-theme-destructive-text-color, #df4e57); font-weight: 650; }
.toast { position: fixed; bottom: max(30px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 30px); background: var(--text); color: var(--tg-theme-bg-color, #fff); box-shadow: 0 10px 28px #0002; border-radius: 12px; padding: 12px 18px; font-size: 13px; z-index: 10; }
@media(max-width: 540px) {
  .shell { padding: 16px 14px 60px; }
  .topbar { padding-bottom: 29px; }
  .intro { flex-wrap: wrap; align-items: center; }
  .intro h2 { font-size: 24px; }
  .intro .button { flex: 1; width: 100%; }
  .controls { flex-wrap: wrap; gap: 12px; }
  .tabs { width: 100%; }
  .tab { flex: 1; }
  .search { max-width: unset; width: 100%; }
  .item { padding: 14px; }
}
