:root {
  color-scheme: dark;
  --bg: #080c12;
  --panel: #111822;
  --line: #263342;
  --muted: #8d9bad;
  --text: #f4f7fb;
  --blue: #2d9cff;
  --cyan: #36d8eb;
  --violet: #d457ff;
  --green: #42df91;
  --yellow: #f6c95f;
  --red: #ff6f7d;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 85% 0%, rgba(45, 156, 255, 0.14), transparent 30rem),
    radial-gradient(circle at 10% 45%, rgba(212, 87, 255, 0.07), transparent 28rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.site-header {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 1220px;
  margin: 0 auto;
  padding: 28px 24px 12px;
}

.brand-link { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.brand-mark {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 1px solid rgba(54, 216, 235, 0.55);
  border-radius: 15px;
  color: var(--cyan);
  background: linear-gradient(145deg, rgba(54, 216, 235, 0.14), rgba(45, 156, 255, 0.05));
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.brand-title { display: block; font-size: 18px; letter-spacing: -0.02em; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 760px; margin-bottom: 16px; font-size: clamp(38px, 6vw, 70px); line-height: 0.98; letter-spacing: -0.055em; }
h2 { margin-bottom: 0; font-size: 21px; letter-spacing: -0.025em; }
.eyebrow, .step { margin-bottom: 5px; color: var(--cyan); font-size: 11px; font-weight: 750; letter-spacing: 0.16em; text-transform: uppercase; }

.connection-pill { display: flex; align-items: center; gap: 8px; margin-left: auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(17, 24, 34, 0.75); font-size: 12px; }
.connection-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); }

main { max-width: 1220px; margin: 0 auto; padding: 42px 24px 80px; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 36px; padding: 54px 0 42px; }
.hero-copy { max-width: 680px; margin-bottom: 0; color: var(--muted); font-size: 17px; line-height: 1.65; }
.schedule-card { min-width: 180px; padding: 20px; border: 1px solid rgba(45, 156, 255, 0.25); border-radius: 18px; background: linear-gradient(150deg, rgba(45, 156, 255, 0.12), rgba(17, 24, 34, 0.65)); box-shadow: var(--shadow); }
.schedule-card span, .schedule-card small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; }
.schedule-card strong { display: block; margin: 7px 0; color: var(--cyan); font-size: 29px; }

.account-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding: 11px 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: rgba(17, 24, 34, 0.72); font-size: 12px; }
.account-bar strong { color: var(--text); }
.account-bar form { margin: 0; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.8fr); gap: 22px; }
.panel { border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(160deg, rgba(21, 31, 43, 0.98), rgba(14, 20, 29, 0.98)); box-shadow: var(--shadow); }
.entry-panel, .preview-panel, .history-panel { padding: 28px; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 28px; }

label { display: block; margin: 20px 0 8px; color: #c8d2df; font-size: 13px; font-weight: 650; }
input, textarea { width: 100%; border: 1px solid #314051; border-radius: 12px; outline: none; color: var(--text); background: #0b1119; transition: border-color 150ms, box-shadow 150ms; }
input { height: 48px; padding: 0 14px; }
textarea { min-height: 155px; padding: 14px; resize: vertical; font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; line-height: 1.65; }
input:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(45, 156, 255, 0.12); }
.price-input { display: grid; grid-template-columns: auto 1fr; align-items: center; border: 1px solid #314051; border-radius: 12px; overflow: hidden; background: #0b1119; }
.price-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(45, 156, 255, 0.12); }
.price-input span { padding: 0 14px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: 0.12em; }
.price-input input { border: 0; border-left: 1px solid #263342; border-radius: 0; box-shadow: none; }
.field-note { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.field-note.invalid { color: var(--red); }

.primary-button, .ghost-button { border: 1px solid transparent; border-radius: 10px; font-weight: 700; }
.primary-button { display: block; width: 100%; min-height: 52px; margin-top: 20px; padding: 15px 20px; color: white; background: linear-gradient(110deg, #147be8, #2d9cff); box-shadow: 0 13px 30px rgba(45, 156, 255, 0.22); text-align: center; }
.primary-button:hover { filter: brightness(1.08); }
.ghost-button { padding: 9px 12px; color: #b9c5d3; background: #121b26; border-color: #304052; font-size: 11px; }
.ghost-button:hover { color: white; border-color: #4c647c; }
.button-link { display: inline-block; text-decoration: none; }

.message { margin-top: 18px; padding: 12px 14px; border-radius: 10px; font-size: 12px; line-height: 1.5; }
.message.success { color: #a5f4c9; background: rgba(66, 223, 145, 0.1); border: 1px solid rgba(66, 223, 145, 0.25); }
.message.error { color: #ffb2ba; background: rgba(255, 111, 125, 0.1); border: 1px solid rgba(255, 111, 125, 0.25); }
.global-message { margin: 0 0 18px; }

.state-badge { padding: 7px 10px; border-radius: 999px; color: var(--muted); background: #0c131c; border: 1px solid var(--line); font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.state-badge.ready { color: var(--green); border-color: rgba(66, 223, 145, 0.35); }
.state-badge.warning { color: var(--yellow); border-color: rgba(246, 201, 95, 0.3); }
.signal-preview { margin: 0; }
.signal-preview div { display: flex; justify-content: space-between; gap: 20px; padding: 14px 0; border-bottom: 1px solid rgba(49, 64, 81, 0.65); }
.signal-preview dt { color: var(--muted); font-size: 12px; }
.signal-preview dd { margin: 0; color: white; font-family: "Cascadia Code", Consolas, monospace; font-size: 13px; font-weight: 700; text-align: right; }
.signal-preview .accent-row dd, .accent-cell { color: var(--blue); }
.range-visual { position: relative; margin: 35px 10px 28px; padding: 20px 0; }
.range-track { position: relative; height: 5px; border-radius: 99px; background: linear-gradient(90deg, var(--violet), var(--blue), var(--cyan)); }
.range-track span { position: absolute; top: 50%; left: 50%; width: 15px; height: 15px; border: 3px solid white; border-radius: 50%; background: var(--blue); box-shadow: 0 0 16px rgba(45, 156, 255, 0.85); transform: translate(-50%, -50%); transition: left 180ms ease; }
.range-label { position: absolute; color: var(--muted); font-size: 9px; letter-spacing: 0.1em; }
.high-label { right: 0; top: 0; }
.low-label { left: 0; bottom: 0; }
.safety-note { margin-top: 18px; padding: 18px; border: 1px solid rgba(45, 156, 255, 0.18); border-radius: 14px; background: rgba(45, 156, 255, 0.05); }
.safety-note strong { font-size: 12px; }
.safety-note ul { margin: 12px 0 0; padding-left: 18px; color: var(--muted); font-size: 11px; line-height: 1.9; }

.history-panel { margin-top: 22px; }
.history-heading { align-items: center; }
.toolbar { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 12px 14px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 10px; letter-spacing: 0.09em; text-align: left; text-transform: uppercase; }
td { padding: 15px 14px; border-bottom: 1px solid rgba(38, 51, 66, 0.65); color: #d8e0e9; font-family: "Cascadia Code", Consolas, monospace; }
tbody tr:hover { background: rgba(45, 156, 255, 0.035); }
.empty-row { padding: 30px; color: var(--muted); text-align: center; font-family: inherit; }

.auth-page { display: flex; min-height: 100vh; flex-direction: column; }
.auth-shell { display: grid; width: 100%; flex: 1; place-items: center; padding-top: 40px; }
.auth-card { width: min(100%, 470px); padding: 34px; border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(160deg, rgba(21, 31, 43, 0.99), rgba(14, 20, 29, 0.99)); box-shadow: var(--shadow); }
.auth-card h1 { margin-bottom: 12px; font-size: clamp(34px, 7vw, 48px); }
.auth-copy { color: var(--muted); font-size: 14px; line-height: 1.7; }
.auth-card code { color: var(--cyan); }
.check-row { display: grid; grid-template-columns: 20px 1fr; gap: 12px; align-items: start; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #0b1119; cursor: pointer; }
.check-row input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--blue); }
.check-row strong, .check-row small { display: block; }
.check-row small { margin-top: 4px; color: var(--muted); font-weight: 400; line-height: 1.45; }

footer { display: flex; justify-content: space-between; gap: 24px; max-width: 1220px; width: 100%; margin: 0 auto; padding: 24px; color: #6f7d8e; border-top: 1px solid rgba(38, 51, 66, 0.55); font-size: 10px; }

@media (max-width: 860px) {
  .hero { align-items: start; flex-direction: column; }
  .schedule-card { width: 100%; }
  .workspace-grid { grid-template-columns: 1fr; }
  .connection-pill { display: none; }
  .history-heading { align-items: start; flex-direction: column; }
  .toolbar { justify-content: start; }
}

@media (max-width: 560px) {
  .site-header, main { padding-left: 16px; padding-right: 16px; }
  main { padding-top: 18px; }
  .hero { padding-top: 34px; }
  .entry-panel, .preview-panel, .history-panel, .auth-card { padding: 20px; border-radius: 17px; }
  .panel-heading { flex-direction: column; }
  .toolbar { width: 100%; }
  .toolbar a { flex: 1 1 28%; text-align: center; }
  .account-bar { align-items: start; }
  footer { flex-direction: column; padding: 20px 16px; }
}
