:root {
  --bg: #f6f6f4;
  --card: #ffffff;
  --fg: #1a1a1a;
  --muted: #8a8a8a;
  --line: #e4e4e0;
  --accent: #1a1a1a;
  --accent-fg: #ffffff;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --card: #1c1c1c;
    --fg: #f0f0f0;
    --muted: #7a7a7a;
    --line: #2c2c2c;
    --accent: #f0f0f0;
    --accent-fg: #111111;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Hiragino Sans", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
main {
  max-width: 480px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 20px) 16px calc(env(safe-area-inset-bottom) + 40px);
}
form {
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
input, select, button { font: inherit; color: inherit; }
#text, select, input[type="time"] {
  width: 100%;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  appearance: none;
  -webkit-appearance: none;
}
input[type="time"] { min-height: 44px; }
.row { display: flex; gap: 8px; align-items: center; }
.dash { color: var(--muted); }
.switch { display: flex; justify-content: space-between; align-items: center; }
.switch input {
  appearance: none; -webkit-appearance: none;
  width: 50px; height: 30px; border-radius: 15px;
  background: var(--line); position: relative; transition: background .2s;
}
.switch input::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 24px; height: 24px; border-radius: 50%; background: #fff;
  transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.switch input:checked { background: #34c759; }
.switch input:checked::after { transform: translateX(20px); }
#rep { display: flex; flex-direction: column; gap: 12px; }
#rep[hidden], [hidden] { display: none !important; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.days button, .seg span, .quick button {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 10px;
  padding: 9px 0;
  text-align: center;
}
.days button.on, .seg input:checked + span, .quick button:active {
  background: var(--accent); color: var(--accent-fg); border-color: var(--accent);
}
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg input { display: none; }
.seg span { display: block; }
button[type="submit"], .sub {
  border: 0; border-radius: 12px; padding: 13px;
  background: var(--accent); color: var(--accent-fg); font-weight: 600;
}
.sub { width: 100%; margin-bottom: 16px; }
#list { list-style: none; padding: 0; margin-top: 20px; }
#list li {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: 14px;
  padding: 12px 8px 12px 16px; margin-bottom: 8px;
}
#list .body { flex: 1; min-width: 0; }
#list .t { overflow-wrap: anywhere; }
#list .w { color: var(--muted); font-size: 13px; margin-top: 2px; }
#list .del {
  border: 0; background: none; color: var(--muted);
  font-size: 22px; width: 40px; height: 40px; border-radius: 50%;
}
