:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #63706c;
  --line: #d7ddd9;
  --panel: #ffffff;
  --accent: #0f8f73;
  --accent-dark: #087158;
  --warm: #f5c04e;
  --sky: #d9eff5;
  --bg: #f6f8f6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(15, 143, 115, 0.12), transparent 38%),
    linear-gradient(315deg, rgba(245, 192, 78, 0.22), transparent 42%),
    var(--bg);
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: 24px;
}

.panel {
  width: min(100%, 460px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(23, 33, 31, 0.12);
  padding: 24px;
}

.admin-panel {
  width: min(100%, 460px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(23, 33, 31, 0.12);
  padding: 24px;
}

.admin-panel.wide {
  width: min(100%, 980px);
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.device-status {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.led {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  box-shadow: 0 0 0 4px rgba(188, 37, 37, 0.12);
  background: #bc2525;
}

.device-status.online .led {
  background: #159947;
  box-shadow: 0 0 0 4px rgba(21, 153, 71, 0.14);
}

h2 {
  margin: 0;
  font-size: 22px;
}

.panel.compact {
  width: min(100%, 420px);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background: var(--sky);
  display: grid;
  place-items: end center;
  grid-template-columns: repeat(3, 7px);
  gap: 5px;
  padding-bottom: 14px;
  border: 1px solid #b9dce5;
}

.brand-mark span {
  display: block;
  width: 7px;
  border-radius: 999px;
  background: var(--accent);
}

.brand-mark span:nth-child(1) {
  height: 14px;
}

.brand-mark span:nth-child(2) {
  height: 24px;
}

.brand-mark span:nth-child(3) {
  height: 34px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}

.status-box {
  display: grid;
  gap: 5px;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfb;
}

.status-box strong {
  font-size: 17px;
}

.status-box span {
  color: var(--muted);
  line-height: 1.4;
}

.plans {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.plan {
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.plan:hover,
.plan.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.plan span {
  display: grid;
  gap: 4px;
  font-weight: 700;
}

.plan small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.plan strong {
  font-size: 22px;
}

.countdown {
  margin: 12px 0 0;
  min-height: 24px;
  color: var(--accent-dark);
  font-weight: 800;
}

.actions {
  display: grid;
  gap: 10px;
}

.actions.split {
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

button,
.button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  padding: 0 18px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button:hover {
  background: var(--accent-dark);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.secondary:hover {
  background: #f0f4f2;
}

code {
  font-size: 0.95em;
}

.form-grid,
.settings-grid {
  display: grid;
  gap: 14px;
}

.settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 16px;
}

legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
}

input,
select {
  min-height: 42px;
  padding: 0 12px;
  background: #fff;
}

textarea {
  min-height: 420px;
  padding: 12px;
  resize: vertical;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
}

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
}

.check-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.check-row input {
  width: 18px;
  min-height: 18px;
}

.form-note {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.script-box {
  margin-top: 20px;
}

@media (max-width: 380px) {
  .shell {
    padding: 12px;
  }

  .panel {
    padding: 18px;
  }

  h1 {
    font-size: 26px;
  }

  .plan {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 760px) {
  .admin-shell {
    padding: 12px;
  }

  .settings-grid,
  .actions.split {
    grid-template-columns: 1fr;
  }

  .admin-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-tools {
    width: 100%;
    justify-content: space-between;
  }
}
