:root {
  --bg: #f4f6f5; --card: #fff; --ink: #1f2a28; --muted: #6b7a77;
  --brand: #0f766e; --danger: #b91c1c; --line: #e3e8e6; --r: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); padding-bottom: 96px;
  padding-top: env(safe-area-inset-top); }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
button { font: inherit; border: 0; border-radius: 10px; padding: .7rem 1rem;
  background: var(--brand); color: #fff; font-weight: 600; cursor: pointer; }
button.secondary { background: var(--line); color: var(--ink); }
button.link { background: none; color: var(--brand); padding: .4rem; font-weight: 500; }
button.danger { background: none; color: var(--danger); padding: .2rem .5rem; font-size: .85rem; }
input, select { font: inherit; width: 100%; padding: .7rem; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; margin-top: .25rem; }
label { display: block; margin: .6rem 0; font-size: .9rem; }
.row { display: flex; gap: .6rem; } .row > * { flex: 1; }

.screen { max-width: 560px; margin: 0 auto; padding: 12px; }
.card { background: var(--card); border-radius: var(--r); padding: 1rem; box-shadow: 0 1px 3px #0001; }
.center { text-align: center; margin-top: 15vh; }
.center form { display: grid; gap: .6rem; }
.logo { font-size: 3rem; }

header { display: flex; align-items: center; gap: .5rem; padding: .4rem 0; }
header .title { font-weight: 700; font-size: 1.15rem; flex: 1; }
.chip { padding: .2rem .6rem; border-radius: 999px; color: #fff; font-size: .85rem; }

.weeknav { display: flex; align-items: center; justify-content: space-between; text-align: center;
  background: var(--card); border-radius: var(--r); padding: .5rem; margin: .5rem 0; }
.weeknav button { background: var(--line); color: var(--ink); font-size: 1.3rem; padding: .3rem .9rem; }
.wk { font-weight: 700; }

.alert { background: #fef3c7; border-radius: 10px; padding: .6rem .8rem; margin: .5rem 0; font-size: .9rem; }

.day { background: var(--card); border-radius: var(--r); padding: .8rem; margin: .6rem 0; }
.day h3 { margin: 0 0 .5rem; font-size: 1rem; }
.bar { position: relative; height: 26px; background: #eef2f1; border-radius: 8px; overflow: hidden; direction: ltr; }
.bar .blk { position: absolute; top: 0; bottom: 0; opacity: .9; }
.ticks { display: flex; justify-content: space-between; direction: ltr; font-size: .7rem; color: var(--muted); margin: .15rem 0 .4rem; }
.bk { display: flex; align-items: center; gap: .5rem; padding: .35rem 0; border-top: 1px solid var(--line); font-size: .92rem; }
.bk:first-of-type { border-top: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.bk .t { direction: ltr; font-variant-numeric: tabular-nums; }
.bk .n { color: var(--muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk.bumped { text-decoration: line-through; opacity: .55; }
.free { color: var(--muted); font-size: .9rem; }

.fab { position: fixed; bottom: calc(16px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  box-shadow: 0 4px 14px #0f766e55; border-radius: 999px; padding: .9rem 1.4rem; font-size: 1.05rem;
  white-space: nowrap; }

dialog { border: 0; border-radius: var(--r); width: min(92vw, 420px); padding: 1.2rem; }
dialog::backdrop { background: #0006; }
dialog h2 { margin: 0 0 .4rem; }

.toast { position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: .7rem 1rem; border-radius: 10px; z-index: 10; max-width: 90vw; }
.toast.err { background: var(--danger); }
