:root { color-scheme: light dark; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { margin: 0; background: var(--tg-theme-bg-color, #101114); color: var(--tg-theme-text-color, #f5f5f5); }
main { max-width: 720px; margin: 0 auto; padding: 18px; }
h1 { margin: 4px 0 6px; font-size: 26px; }
h2 { margin: 0 0 12px; font-size: 18px; }
.card { background: var(--tg-theme-secondary-bg-color, #1b1d22); border-radius: 16px; padding: 16px; margin: 12px 0; box-shadow: 0 1px 0 rgba(255,255,255,.06) inset; }
.switch-row { display: flex; justify-content: space-between; align-items: center; font-size: 18px; }
input, select { font: inherit; padding: 10px; border-radius: 10px; border: 1px solid #7775; background: transparent; color: inherit; }
input[type="checkbox"] { width: 24px; height: 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid #7775; border-radius: 999px; padding: 10px 14px; cursor: pointer; user-select: none; }
.chip.active { background: var(--tg-theme-button-color, #2ea6ff); color: var(--tg-theme-button-text-color, white); border-color: transparent; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2 label { display: flex; flex-direction: column; gap: 8px; }
button#save { width: 100%; border: 0; border-radius: 14px; padding: 14px 18px; background: var(--tg-theme-button-color, #2ea6ff); color: var(--tg-theme-button-text-color, white); font: inherit; font-weight: 700; }
pre { white-space: pre-wrap; margin: 0; }
.muted, #subtitle, #status { color: var(--tg-theme-hint-color, #aaa); }

.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 12px; }
.inline-form button { border: 0; border-radius: 10px; padding: 10px 12px; background: var(--tg-theme-button-color, #2ea6ff); color: var(--tg-theme-button-text-color, white); font: inherit; }
.chip.locked { opacity: .95; }
.threshold-group { border-top: 1px solid #7774; padding-top: 12px; margin-top: 12px; }
.threshold-group:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.threshold-group h3 { margin: 0 0 8px; }
.threshold-row { display: grid; grid-template-columns: 1fr 90px 20px; gap: 8px; align-items: center; margin: 8px 0; }
.threshold-row.pair { opacity: .88; }
.threshold-row input { width: 100%; box-sizing: border-box; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.tab { border: 1px solid #7775; border-radius: 12px; padding: 10px; background: transparent; color: inherit; font: inherit; }
.tab.active { background: var(--tg-theme-button-color, #2ea6ff); color: var(--tg-theme-button-text-color, white); border-color: transparent; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.order-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.order-form label { display: flex; flex-direction: column; gap: 6px; }
.actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 12px; }
.actions button, .order-actions button { border: 0; border-radius: 10px; padding: 10px 12px; background: var(--tg-theme-button-color, #2ea6ff); color: var(--tg-theme-button-text-color, white); font: inherit; }
.actions .secondary { background: transparent; border: 1px solid #7775; color: inherit; }
.orders-list { display: flex; flex-direction: column; gap: 10px; }
.order-item { border: 1px solid #7774; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.order-actions { display: flex; gap: 8px; }
.order-actions .danger { background: #d33; color: white; }
@media (max-width: 520px) { .order-form { grid-template-columns: 1fr; } }
.add-symbol span { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.add-symbol button { border: 0; border-radius: 10px; padding: 8px 12px; background: var(--tg-theme-button-color, #2ea6ff); color: var(--tg-theme-button-text-color, white); font: inherit; }
