:root {
  --bg: #07110f;
  --surface: #0d1b18;
  --surface-2: #122520;
  --line: rgba(191, 255, 230, 0.12);
  --text: #f2fbf7;
  --muted: #91a7a0;
  --mint: #69f0b5;
  --mint-dark: #173d31;
  --blue: #7bc8ff;
  --danger: #ff8d82;
  --font-heading: "Montserrat", "Open Sans", Arial, sans-serif;
  --font-body: "Open Sans", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 75% 0%, #12332a 0, transparent 35%), var(--bg); color: var(--text); font-family: var(--font-body); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.shell { width: min(1440px, 100%); margin: 0 auto; padding: 0 28px 64px; }
.topbar { height: 84px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: 12px; align-items: center; color: var(--text); text-decoration: none; font-family: var(--font-heading); font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 38px; aspect-ratio: 1; border-radius: 12px; background: var(--mint); color: #07110f; font: 700 13px var(--font-heading); box-shadow: 0 0 30px rgba(105, 240, 181, .22); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.pill { padding: 8px 11px; border-radius: 999px; background: #302a13; color: #ffe587; font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 32px; padding: 64px 0 34px; }
.eyebrow { margin: 0 0 10px; color: var(--mint); font-size: 11px; font-weight: 700; letter-spacing: .16em; }
h1, h2 { margin: 0; font-family: var(--font-heading); letter-spacing: -.035em; }
h1 { max-width: 760px; font-size: clamp(38px, 5vw, 72px); line-height: 1.02; }
h2 { font-size: 22px; }
.hero-copy { max-width: 700px; margin: 22px 0 0; color: var(--muted); font-size: 17px; line-height: 1.6; }
.health-card { min-width: 285px; display: flex; align-items: center; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: rgba(13, 27, 24, .72); backdrop-filter: blur(12px); }
.health-card strong, .health-card span { display: block; }
.health-card span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.health-dot { width: 12px; height: 12px; flex: 0 0 auto; border-radius: 50%; background: #ffc66d; box-shadow: 0 0 0 7px rgba(255, 198, 109, .1); }
.health-dot.healthy { background: var(--mint); box-shadow: 0 0 0 7px rgba(105, 240, 181, .1); }
.health-dot.degraded { background: var(--danger); box-shadow: 0 0 0 7px rgba(255, 141, 130, .1); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.stat-card { min-height: 145px; padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, rgba(18, 37, 32, .95), rgba(10, 24, 20, .95)); }
.stat-card.accent { background: linear-gradient(145deg, #77f2bd, #3dcf94); color: #07110f; }
.stat-card span, .stat-card small { display: block; color: var(--muted); }
.stat-card.accent span, .stat-card.accent small { color: rgba(7, 17, 15, .68); }
.stat-card strong { display: block; margin: 12px 0 4px; font: 700 30px var(--font-heading); }
.stat-card small { font-size: 12px; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(330px, .75fr); gap: 14px; margin-bottom: 14px; }
.panel { border: 1px solid var(--line); border-radius: 22px; background: rgba(13, 27, 24, .92); padding: 24px; overflow: hidden; }
.panel-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 24px; }
.legend { display: flex; gap: 16px; color: var(--muted); font-size: 12px; }
.legend span { display: flex; align-items: center; gap: 7px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot.regular { background: var(--mint); }.dot.fast { background: var(--blue); }
.availability-grid { display: grid; grid-template-columns: repeat(7, minmax(82px, 1fr)); gap: 8px; }
.day-card { position: relative; min-height: 108px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.day-card.has-regular { border-color: rgba(105, 240, 181, .55); box-shadow: inset 0 0 22px rgba(105, 240, 181, .06); }
.day-card time { display: block; margin-bottom: 16px; font-weight: 600; text-transform: capitalize; }
.counts { display: flex; gap: 7px; }
.count { flex: 1; padding: 7px 4px; border-radius: 8px; background: #0a1714; text-align: center; font-size: 12px; font-weight: 700; }
.count.regular { color: var(--mint); }.count.fast { color: var(--blue); }
.rule-form, .rule-form label { display: grid; gap: 8px; }
.rule-form { gap: 14px; }
.rule-form label { color: var(--muted); font-size: 12px; font-weight: 600; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
input, select { width: 100%; min-height: 44px; padding: 0 13px; border: 1px solid var(--line); border-radius: 11px; outline: none; background: #091713; color: var(--text); }
input:focus, select:focus { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(105, 240, 181, .09); }
.switch-row { grid-template-columns: 1fr 48px !important; align-items: center; min-height: 58px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.switch-row span strong, .switch-row span small { display: block; }.switch-row span strong { color: var(--text); }.switch-row span small { margin-top: 3px; font-weight: 400; }
.switch-row input { display: none; }.switch-row i { position: relative; width: 46px; height: 26px; border-radius: 20px; background: #2a3e38; transition: .2s; }.switch-row i::after { content: ""; position: absolute; width: 20px; height: 20px; top: 3px; left: 3px; border-radius: 50%; background: white; transition: .2s; }
.switch-row input:checked + i { background: var(--mint); }.switch-row input:checked + i::after { transform: translateX(20px); background: #07110f; }
.button { min-height: 42px; padding: 0 16px; border: 1px solid transparent; border-radius: 11px; color: var(--text); font-weight: 700; }
.button-primary { background: var(--mint); color: #07110f; }.button-primary:hover { background: #8af5ca; }
.button-ghost { border-color: var(--line); background: rgba(18, 37, 32, .7); }.button-ghost:hover { border-color: rgba(105, 240, 181, .45); }
.form-message { min-height: 16px; margin: 0; color: var(--mint); font-size: 12px; }
.lower-grid { align-items: start; }
.rules-list, .events-list { display: grid; gap: 9px; }
.rule-item, .event-item { display: grid; gap: 10px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #0a1714; }
.rule-item { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.rule-actions { display: flex; align-items: center; gap: 7px; }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--muted); font-size: 22px; }
.icon-button:hover { border-color: rgba(255, 141, 130, .45); color: var(--danger); }
.rule-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }.rule-title strong { font-family: var(--font-heading); }
.tag { padding: 4px 7px; border-radius: 6px; background: var(--mint-dark); color: var(--mint); font-size: 10px; font-weight: 700; }
.rule-meta, .event-item small { color: var(--muted); font-size: 12px; }
.event-item strong { font-size: 13px; }.event-item small { display: block; margin-top: 4px; }
.empty-state { min-height: 100px; place-items: center; color: var(--muted); }
dialog { width: min(420px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--text); box-shadow: 0 30px 100px rgba(0,0,0,.6); }
dialog::backdrop { background: rgba(2, 8, 6, .82); backdrop-filter: blur(7px); }
.auth-card { display: grid; gap: 16px; padding: 18px; }.auth-card p, .auth-card small { color: var(--muted); line-height: 1.5; }.auth-card small { color: var(--danger); }
.skeleton { opacity: .55; }
@media (max-width: 1050px) { .stats-grid { grid-template-columns: 1fr 1fr; }.workspace-grid { grid-template-columns: 1fr; }.availability-grid { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 680px) { .shell { padding: 0 16px 40px; }.topbar { height: auto; padding: 18px 0; align-items: flex-start; }.brand span:last-child { display: none; }.top-actions { flex-wrap: wrap; justify-content: flex-end; }.hero { padding-top: 42px; flex-direction: column; align-items: stretch; }.health-card { min-width: 0; }.stats-grid { grid-template-columns: 1fr; }.availability-grid { grid-template-columns: repeat(2, 1fr); }.field-pair { grid-template-columns: 1fr; }.panel { padding: 18px; }.legend { display: none; } }
