:root {
  --bg: var(--tg-theme-bg-color, #fff);
  --secondary-bg: var(--tg-theme-secondary-bg-color, #f4f4f5);
  --text: var(--tg-theme-text-color, #101114);
  --hint: var(--tg-theme-hint-color, #707579);
  --link: var(--tg-theme-link-color, #2481cc);
  --button: var(--tg-theme-button-color, #2481cc);
  --button-text: var(--tg-theme-button-text-color, #fff);
  --separator: color-mix(in srgb, var(--hint) 20%, transparent);
  --safe-top: max(env(safe-area-inset-top), var(--app-content-safe-top, 0px), var(--tg-content-safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom), var(--app-content-safe-bottom, 0px), var(--tg-content-safe-area-inset-bottom, 0px));
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font: 15px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { overscroll-behavior-y: none; }
button, input, select { font: inherit; }
button { border: 0; cursor: pointer; }
#app { min-height: 100vh; padding: calc(40px + var(--safe-top)) 12px calc(72px + var(--safe-bottom)); }
.view { max-width: 680px; margin: 0 auto; }
.topline { display: flex; justify-content: space-between; align-items: center; min-height: 34px; margin: 0 4px 10px; }
.title { font-size: 20px; font-weight: 700; letter-spacing: -.25px; }
.status { font-size: 13px; font-weight: 600; color: var(--hint); }
.online { color: #31a24c; } .offline { color: #e35d5b; } .paused { color: #e1a317; }
.panel { background: var(--secondary-bg); border-radius: 13px; padding: 12px; margin: 8px 0; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; overflow: hidden; padding: 0; background: var(--separator); }
.stat { background: var(--secondary-bg); padding: 12px; min-height: 64px; }
.stat strong { display: block; font-size: 19px; line-height: 1.1; }.stat span { color: var(--hint); font-size: 13px; }
.primary, .secondary { min-height: 45px; border-radius: 11px; width: 100%; font-weight: 650; padding: 0 14px; }
.primary { background: var(--button); color: var(--button-text); }.secondary { background: var(--secondary-bg); color: var(--link); }
.section-label { color: var(--hint); font-size: 13px; margin: 18px 4px 6px; font-weight: 600; }
.list { background: var(--secondary-bg); border-radius: 13px; overflow: hidden; }.item { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 9px 12px; border-bottom: 1px solid var(--separator); }.item:last-child { border-bottom: 0; }
.item-main { min-width: 0; flex: 1; }.item-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }.item-meta { color: var(--hint); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.score { font-size: 12px; padding: 3px 7px; border-radius: 10px; background: color-mix(in srgb, var(--link) 12%, transparent); color: var(--link); }
.empty { color: var(--hint); text-align: center; padding: 30px 20px; }.empty p { margin: 4px auto 16px; max-width: 280px; }
.tabs { position: fixed; z-index: 3; left: 0; right: 0; bottom: 0; height: calc(60px + var(--safe-bottom)); padding-bottom: var(--safe-bottom); display: grid; grid-template-columns: repeat(4, 1fr); background: color-mix(in srgb, var(--bg) 92%, transparent); border-top: 1px solid var(--separator); backdrop-filter: blur(16px); }
.tab { color: var(--hint); background: transparent; font-size: 11px; display: grid; place-content: center; gap: 1px; }.tab span { font-size: 19px; line-height: 18px; }.tab.active { color: var(--link); font-weight: 700; }
.search { width: 100%; border: 0; outline: none; border-radius: 10px; background: var(--secondary-bg); color: var(--text); padding: 11px 12px; margin: 0 0 8px; }.search::placeholder { color: var(--hint); }
.toggle { position: relative; flex: 0 0 46px; width: 46px; height: 28px; border-radius: 15px; background: #b7b7b9; }.toggle::after { content: ""; position: absolute; width: 22px; height: 22px; top: 3px; left: 3px; background: white; border-radius: 50%; transition: transform .16s ease; }.toggle.on { background: var(--button); }.toggle.on::after { transform: translateX(18px); }
.row-action { color: var(--link); background: transparent; font-weight: 600; padding: 8px; }.row-action:disabled { color: var(--hint); }
.field { display: grid; gap: 5px; padding: 10px 12px; border-bottom: 1px solid var(--separator); }.field:last-child { border: 0; }.field label { color: var(--hint); font-size: 13px; }.field input, .field select { background: transparent; border: 0; outline: none; color: var(--text); padding: 2px 0; width: 100%; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 9px; padding: 7px 9px; background: var(--secondary-bg); margin: 2px; }.chip button { color: var(--hint); background: transparent; padding: 0; font-size: 16px; }
.detail-sheet { position: fixed; z-index: 4; inset: auto 0 0; max-height: 80vh; padding: 18px 14px calc(20px + var(--safe-bottom)); overflow: auto; background: var(--bg); border-radius: 18px 18px 0 0; box-shadow: 0 -8px 28px #0002; }.detail-sheet pre { white-space: pre-wrap; font: inherit; color: var(--text); }.scrim { position: fixed; z-index: 3; inset: 0; background: #0006; }.toast { position: fixed; z-index: 6; left: 50%; bottom: calc(72px + var(--safe-bottom)); transform: translate(-50%, 12px); opacity: 0; pointer-events: none; background: #1c1c1e; color: white; border-radius: 10px; padding: 9px 13px; font-size: 13px; transition: .18s; }.toast.show { transform: translate(-50%, 0); opacity: 1; }
.skeleton { background: linear-gradient(90deg, var(--secondary-bg), color-mix(in srgb, var(--hint) 12%, var(--secondary-bg)), var(--secondary-bg)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 12px; }.hero { height: 90px; }.row { height: 58px; margin-top: 8px; } @keyframes shimmer { to { background-position: -200% 0; } }
.small { font-size: 13px; color: var(--hint); }.icon { width: 34px; height: 34px; flex: none; display: grid; place-content: center; background: color-mix(in srgb, var(--link) 14%, transparent); color: var(--link); border-radius: 50%; font-weight: 700; }
