:root {
  --bg: var(--tg-theme-bg-color, #fff);
  --bg2: var(--tg-theme-secondary-bg-color, #f2f2f7);
  --text: var(--tg-theme-text-color, #000);
  --hint: var(--tg-theme-hint-color, #8e8e93);
  --link: var(--tg-theme-link-color, #2481cc);
  --btn: var(--tg-theme-button-color, #2481cc);
  --btn-text: var(--tg-theme-button-text-color, #fff);
  --danger: #e53935;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.4 -apple-system, system-ui, sans-serif; background: var(--bg2); color: var(--text); }
.tabs { position: sticky; top: 0; display: flex; background: var(--bg); border-bottom: 1px solid var(--bg2); z-index: 5; }
.tabs button { flex: 1; padding: 12px 0; border: 0; background: none; color: var(--hint); font-size: 15px; border-bottom: 2px solid transparent; }
.tabs button.active { color: var(--btn); border-color: var(--btn); }
main { padding: 12px; }
.tab { display: none; }
.tab.active { display: block; }
label { display: block; margin: 12px 0 4px; font-weight: 600; }
label small { font-weight: 400; color: var(--hint); }
textarea, input { width: 100%; padding: 10px; border: 1px solid var(--bg2); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; }
button { padding: 11px 14px; border: 0; border-radius: 10px; background: var(--btn); color: var(--btn-text); font: inherit; font-weight: 600; cursor: pointer; }
button.secondary { background: var(--bg); color: var(--btn); border: 1px solid var(--btn); }
button.danger { background: var(--danger); color: #fff; }
button.small { padding: 6px 10px; font-size: 13px; }
button:disabled { opacity: .5; }
.row2, .row3 { display: grid; gap: 8px; margin-top: 12px; }
.row2 { grid-template-columns: 1fr 1fr; }
.row3 { grid-template-columns: 1fr 1fr 1fr; }
.row3 label { font-weight: 400; font-size: 13px; color: var(--hint); margin-top: 0; }
.hint { color: var(--hint); font-size: 13px; margin-top: 4px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.card { background: var(--bg); border-radius: 12px; padding: 12px; margin-top: 8px; }
.card h3 { margin: 0 0 8px; font-size: 16px; }
.card input { margin-bottom: 8px; }
.card .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.muted { color: var(--hint); font-size: 13px; }
.preview { font-size: 13px; color: var(--hint); margin-top: 4px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bar { height: 6px; border-radius: 3px; background: var(--bg2); overflow: hidden; margin-top: 8px; display: flex; }
.bar .s { background: #43a047; } .bar .f { background: var(--danger); }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--bg2); white-space: nowrap; }
.badge.running, .badge.active { background: #e3f2e5; color: #2e7d32; }
.badge.paused, .badge.limited { background: #fff3e0; color: #ef6c00; }
.badge.dead, .badge.stopped { background: #fdecea; color: #c62828; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 6px 10px; background: var(--bg); border-radius: 10px; font-weight: 400; }
.checks input { width: auto; }
.empty { text-align: center; color: var(--hint); padding: 32px 0; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: flex-end; z-index: 10; }
.modal[hidden], .toast[hidden], [hidden] { display: none !important; }
.modal-body { position: relative; background: var(--bg); width: 100%; max-height: 80vh; overflow: auto; border-radius: 16px 16px 0 0; padding: 16px; }
.modal .close { position: absolute; right: 10px; top: 10px; background: none; color: var(--hint); padding: 4px 8px; }
.tline { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--bg2); font-size: 13px; }
.tline .err { color: var(--danger); font-size: 12px; }
.toast { position: fixed; left: 12px; right: 12px; bottom: 16px; background: #323232; color: #fff; padding: 12px; border-radius: 10px; z-index: 20; }
