* {
  box-sizing: border-box;
}

:root {
  --paper: #f5f0e6;
  --ink: #152014;
  --card: #fffaf0;
  --line: #d6c9b4;
  --on: #146b3a;
  --off: #7a1111;
  --button: #152014;
  --button-text: #fff7e6;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", sans-serif;
  background:
    radial-gradient(circle at 15% 10%, #ffe8b3 0%, rgba(255, 232, 179, 0.2) 25%, transparent 45%),
    radial-gradient(circle at 90% 85%, #d8f5c4 0%, rgba(216, 245, 196, 0.2) 25%, transparent 50%),
    linear-gradient(145deg, #f2e7d2 0%, #efe2cb 45%, #e6d8bf 100%);
  color: var(--ink);
  display: grid;
  place-items: center;
  padding: 20px;
}

.control-shell {
  width: 100%;
  max-width: 560px;
}

.control-card {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 16px 50px rgba(28, 26, 18, 0.18);
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 5.4vw, 44px);
  line-height: 1;
}

.lead {
  margin: 0 0 22px;
  color: #4a4a42;
  font-size: 16px;
}

.state-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.state-label {
  font-size: 14px;
  color: #645d4f;
}

.state-badge {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14px;
  border: 1px solid;
}

.state-badge.on {
  color: var(--on);
  border-color: #7dc19a;
  background: #e6f7ed;
}

.state-badge.off {
  color: var(--off);
  border-color: #e0a1a1;
  background: #feecec;
}

.toggle-btn {
  width: 100%;
  border: none;
  border-radius: 14px;
  background: var(--button);
  color: var(--button-text);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  padding: 18px 16px;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}

.toggle-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.toggle-btn:active {
  transform: translateY(0);
}

.toggle-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.volume-panel {
  margin-top: 14px;
}

.volume-label {
  display: block;
  font-size: 14px;
  color: #4a4a42;
  margin-bottom: 8px;
}

.volume-range {
  width: 100%;
  accent-color: #152014;
}

.reset-btn {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8f1e3;
  color: #3e382e;
  padding: 9px 12px;
  font-size: 13px;
  cursor: pointer;
}

.reset-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.status-line {
  margin: 12px 0 0;
  font-size: 14px;
}

.status-line {
  min-height: 20px;
  color: #5e5346;
}

.schedule-panel {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.schedule-panel h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.schedule-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-bottom: 10px;
  font-size: 13px;
  color: #645d4f;
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fffdf7;
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
}

.schedule-table th,
.schedule-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e6dac7;
  font-size: 13px;
  text-align: left;
}

.schedule-table thead th {
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #5f5a4e;
  background: #f7efde;
}

.schedule-table tbody tr:last-child td {
  border-bottom: none;
}

@media (max-width: 480px) {
  .control-card {
    padding: 22px;
  }

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

  .toggle-btn {
    font-size: 21px;
  }
}
