:root {
  --bg: #f6f7f9; --card: #ffffff; --text: #14161a; --muted: #6b7280; --line: #e5e7eb;
  --accent: #3b82f6; --danger: #ef4444; --soft: #eef2f7;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1115; --card: #181b21; --text: #eef0f3; --muted: #8b93a1; --line: #262a32;
          --soft: #20242c; color-scheme: dark; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; border-radius: 12px; padding: 10px 16px; background: var(--soft); cursor: pointer; }
button.primary { background: var(--accent); color: #fff; font-weight: 600; }
button.ghost { background: transparent; color: var(--muted); }
button.danger { background: transparent; color: var(--danger); }
input, select, textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
.muted { color: var(--muted); }
.err { color: var(--danger); margin: 0; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: min(360px, 100%); background: var(--card); border-radius: 20px; padding: 28px;
  display: grid; gap: 14px; justify-items: center; box-shadow: 0 10px 40px rgba(0,0,0,.12); }
.login h1 { margin: 0; font-size: 22px; }

#app { max-width: 720px; margin: 0 auto; padding: 16px 16px 60px; }
.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.brand { font-weight: 700; font-size: 20px; }
.quick { display: flex; gap: 8px; }
.quick input { font-size: 17px; padding: 13px 14px; }
.quick button { width: 52px; font-size: 24px; padding: 0; }
.preview { min-height: 22px; margin: 6px 4px 10px; font-size: 14px; }

.day { margin-top: 18px; }
.day h3 { margin: 0 0 6px 4px; font-size: 14px; font-weight: 600; color: var(--muted); text-transform: none; }
.day.today h3 { color: var(--accent); }
.item { display: flex; gap: 12px; align-items: stretch; background: var(--card); border-radius: 14px;
  padding: 12px 14px; margin-bottom: 6px; cursor: pointer; border: 1px solid var(--line); }
.item:hover { border-color: var(--accent); }
.item.past { opacity: .5; }
.item .bar { width: 4px; border-radius: 4px; flex: none; }
.item .time { width: 92px; flex: none; font-variant-numeric: tabular-nums; }
.item .time small { display: block; color: var(--muted); }
.item .title { font-weight: 600; word-break: break-word; }
.item .note { color: var(--muted); font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.item .rep { color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); padding: 8px 4px; }

dialog { border: 0; border-radius: 20px; padding: 22px; width: min(480px, calc(100vw - 24px));
  background: var(--card); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog h2 { margin: 0 0 14px; font-size: 19px; }
dialog label { display: grid; gap: 5px; font-size: 14px; color: var(--muted); margin-bottom: 12px; }
dialog label input, dialog label select, dialog label textarea { color: var(--text); font-size: 16px; }
dialog .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
dialog .check { display: flex; align-items: center; gap: 8px; color: var(--text); }
dialog .check input { width: auto; }
.colors { display: flex; gap: 10px; margin: 2px 0 14px; }
.colors button { width: 30px; height: 30px; border-radius: 50%; padding: 0; border: 3px solid transparent; }
.colors button.on { border-color: var(--text); }
.actions { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.actions.col { flex-direction: column; align-items: stretch; }
.grow { flex: 1; }
@media (max-width: 420px) { .item .time { width: 70px; } dialog .row { grid-template-columns: 1fr; } }
