/* Bricolage Grotesque (SIL Open Font License), hosted here rather than loaded from Google. */
@font-face {
  font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(fonts/bricolage-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(fonts/bricolage-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Bold, playful style: thick ink outlines, hard offset shadows, bright colour blocks.
   Default palette ("Sherbet"). Other palettes live in static/schemes.js and override
   these variables inline on <html>. */
:root {
  --bg: #f6f4ef;
  --dot: #dcd6c8;
  --ink: #161616;
  --surface: #ffffff;
  --field: #ffffff;
  --text: #161616;
  --muted: #5c5850;
  --accent: #ff7fc4;
  --accent-text: #161616;
  --sticker: #ff6fb5;
  --danger: #c4122f;
  --border: 2.5px;
  --radius: 16px;
  --font: "Bricolage Grotesque", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1.3px, transparent 1.4px);
  background-size: 22px 22px;
  color: var(--text);
  font: 16px/1.5 var(--font);
}
button, input, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }

/* ---------- buttons: sticker style that presses down ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: var(--border) solid var(--ink); background: var(--surface); color: var(--text);
  padding: 7px 14px; border-radius: 12px; cursor: pointer; white-space: nowrap;
  font-weight: 700; box-shadow: 3px 3px 0 var(--ink);
  transition: transform .08s, box-shadow .08s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.primary { background: var(--accent); color: var(--accent-text); font-weight: 800; }
.btn.small { padding: 3px 10px; font-size: 13px; border-radius: 10px; box-shadow: 2px 2px 0 var(--ink); }
.btn.small:hover { box-shadow: 3px 3px 0 var(--ink); }
.btn.small:active { box-shadow: 0 0 0 var(--ink); }
.btn.danger { color: var(--danger); }
.btn.icon { width: 38px; padding: 7px 0; }
.btn:disabled, .btn:disabled:hover { opacity: .35; cursor: default; transform: none; box-shadow: 3px 3px 0 var(--ink); }

input[type=text], input[type=password], textarea {
  width: 100%; padding: 10px 12px; border-radius: 12px;
  border: var(--border) solid var(--ink); background: var(--field);
}
input:focus, textarea:focus { outline: none; box-shadow: 4px 4px 0 var(--accent); }
label { display: block; font-size: 14px; font-weight: 700; margin: 14px 0 4px; }
.error { color: var(--danger); font-size: 14px; font-weight: 600; min-height: 1.5em; margin: 8px 0 0; }

/* the "log" in the logo is a tilted sticker */
.logo { font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; }
.logo span {
  display: inline-block; margin-left: 3px; padding: 0 7px; transform: rotate(-5deg);
  background: var(--sticker); color: var(--ink); border: var(--border) solid var(--ink);
  border-radius: 9px; box-shadow: 2px 2px 0 var(--ink);
}

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card {
  width: 100%; max-width: 380px; background: var(--surface); color: var(--text);
  border: var(--border) solid var(--ink); border-radius: var(--radius); padding: 30px;
  box-shadow: 8px 8px 0 var(--ink);
}
.login-card h1 { margin: 0 0 6px; font-size: 34px; }
.login-card p { margin: 0 0 8px; color: var(--muted); }
.login-card .btn { width: 100%; margin-top: 22px; padding: 11px; font-size: 17px; }

/* ---------- app shell ---------- */
header.top {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg); border-bottom: var(--border) solid var(--ink);
}
.top-inner {
  max-width: 820px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.brand { font-size: 22px; margin-right: auto; }
.who { font-size: 14px; font-weight: 700; }

main { max-width: 820px; margin: 0 auto; padding: 20px 16px 80px; }

.daybar { display: flex; align-items: center; gap: 10px; margin: 8px 0 20px; flex-wrap: wrap; }
.daybar h2 { margin: 0; font-size: 32px; font-weight: 800; letter-spacing: -0.02em; flex: 1; min-width: 180px; }
.daybar input[type=date] {
  border: var(--border) solid var(--ink); background: var(--surface); color: var(--text);
  border-radius: 12px; padding: 6px 12px; font-weight: 600; box-shadow: 3px 3px 0 var(--ink);
}

/* 24h strip */
.strip {
  position: relative; height: 62px; margin-bottom: 28px;
  background: var(--surface); color: var(--text);
  border: var(--border) solid var(--ink); border-radius: var(--radius); box-shadow: 5px 5px 0 var(--ink);
}
.strip-track { position: absolute; left: 18px; right: 18px; top: 0; bottom: 0; }
.strip-hour { position: absolute; bottom: 5px; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: var(--muted); }
.strip-tick { position: absolute; top: 14px; height: 18px; width: 2px; border-radius: 1px; background: var(--ink); opacity: .2; }
.strip-now { position: absolute; top: 8px; bottom: 20px; width: 3px; border-radius: 2px; background: var(--danger); }
.strip-dot {
  position: absolute; top: 13px; width: 20px; height: 20px; margin-left: -10px;
  border-radius: 50%; border: var(--border) solid var(--ink); cursor: pointer; padding: 0;
  box-shadow: 2px 2px 0 var(--ink); transition: transform .1s;
}
.strip-dot:hover { transform: scale(1.25) rotate(-8deg); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: -8px 0 22px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700;
  border: var(--border) solid var(--ink); background: var(--surface); color: var(--text); border-radius: 999px;
  padding: 3px 12px; cursor: pointer; box-shadow: 2px 2px 0 var(--ink);
}
.chip.off { opacity: .4; box-shadow: none; }
.swatch { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); flex: none; }

/* vertical timeline */
.timeline { position: relative; padding-left: 84px; }
.timeline::before {
  content: ""; position: absolute; left: 66px; top: 8px; bottom: 8px; width: 3px;
  background: repeating-linear-gradient(var(--ink) 0 8px, transparent 8px 14px);
}
.entry { position: relative; margin-bottom: 34px; scroll-margin-top: 96px; }
.entry-time {
  position: absolute; left: -84px; top: 4px; padding: 1px 7px;
  font-variant-numeric: tabular-nums; font-weight: 800; font-size: 14px;
  background: var(--surface); border: var(--border) solid var(--ink); border-radius: 9px;
  box-shadow: 2px 2px 0 var(--ink); transform: rotate(-3deg);
}
.entry-dot {
  position: absolute; left: -26px; top: 7px; width: 18px; height: 18px; border-radius: 50%;
  border: var(--border) solid var(--ink);
}
.card {
  background: var(--surface); color: var(--text);
  border: var(--border) solid var(--ink); border-radius: var(--radius);
  overflow: hidden; box-shadow: 6px 6px 0 var(--ink);
}
.card.flash { animation: wiggle .5s; }
@keyframes wiggle {
  25% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } 75% { transform: rotate(-.8deg); }
}
/* the header strip is tinted with the poster's colour (set inline) */
.card-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  border-bottom: var(--border) solid var(--ink); color: #161616;
}
.card-head .name { font-weight: 800; font-size: 17px; }
.card-head .spacer { flex: 1; }
.card-head .btn { background: #ffffff; color: #161616; }
.card-head .btn.danger { color: #c4122f; }
.card img {
  display: block; width: 100%; max-height: 70vh; object-fit: contain; cursor: zoom-in;
  background: var(--field); border-bottom: var(--border) solid var(--ink);
}
.note { padding: 12px 16px; white-space: pre-wrap; word-wrap: break-word; font-size: 17px; }
.note.empty { color: var(--muted); font-style: italic; font-size: 15px; }
.note-edit { padding: 12px 14px; }
.note-edit textarea { min-height: 80px; resize: vertical; }
.note-edit .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }

.empty-day {
  text-align: center; font-weight: 700; padding: 48px 16px; background: var(--surface);
  border: var(--border) dashed var(--ink); border-radius: var(--radius);
}

/* dialogs */
dialog {
  border: var(--border) solid var(--ink); border-radius: var(--radius); background: var(--surface); color: var(--text);
  padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  box-shadow: 8px 8px 0 var(--ink);
}
dialog::backdrop { background: rgba(0,0,0,.5); }
.dlg-head {
  display: flex; align-items: center; padding: 14px 18px;
  background: var(--accent); color: var(--accent-text); border-bottom: var(--border) solid var(--ink);
}
.dlg-head h3 { margin: 0; flex: 1; font-size: 20px; font-weight: 800; }
.dlg-body { padding: 4px 18px 20px; }
.dlg-body h4 { margin: 20px 0 0; font-size: 16px; font-weight: 800; }
.preview { width: 100%; border-radius: 12px; margin-top: 14px; display: block; border: var(--border) solid var(--ink); }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--ink); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.user-list { list-style: none; padding: 0; margin: 8px 0 0; }
.user-list li {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 0; border-bottom: 2px dashed var(--ink);
}
.user-list li:last-child { border-bottom: none; }
.user-list .uname { font-weight: 800; flex: 1; min-width: 120px; }
.user-list .meta { color: var(--muted); font-size: 13px; font-weight: 600; }
.badge {
  font-size: 11px; font-weight: 800; background: var(--sticker); color: var(--ink);
  padding: 1px 7px; border-radius: 999px; border: 2px solid var(--ink);
}

.lightbox {
  position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.92);
  display: grid; place-items: center; cursor: zoom-out; padding: 16px;
}
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* palette picker */
.schemes { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-top: 10px; }
.scheme {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; font-weight: 700;
  border: var(--border) solid var(--ink); border-radius: 12px; background: var(--surface); text-align: left; font-size: 14px;
  box-shadow: 2px 2px 0 var(--ink);
}
.scheme.active { background: var(--accent); color: var(--accent-text); }
.scheme-chip { display: flex; flex: none; border-radius: 50%; overflow: hidden; width: 22px; height: 22px; border: 2px solid var(--ink); }
.scheme-chip span { flex: 1; }

@media (max-width: 560px) {
  .timeline { padding-left: 28px; }
  .timeline::before { left: 8px; }
  .entry-time { position: static; display: inline-block; margin-bottom: 8px; }
  .entry-dot { left: -28px; }
  .who { display: none; }
  .brand { font-size: 18px; }
  .brand.logo span { padding: 0 5px; margin-left: 2px; }
  .top-inner { gap: 7px; flex-wrap: nowrap; padding: 12px 14px; }
  .top-inner .btn { padding: 5px 8px; font-size: 13px; border-radius: 10px; box-shadow: 2px 2px 0 var(--ink); }
  .daybar h2 { flex-basis: 100%; }
  .daybar input[type=date] { flex: 1; min-width: 0; font-size: 15px; padding: 6px 10px; }
  .strip-hour:nth-of-type(4n) { display: none; } /* hide 03, 09, 15, 21 */
}

/* comments */
.comments { border-top: 2px dashed var(--ink); padding: 10px 16px 14px; }
.comment-list:empty { display: none; }
.comment { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; }
.comment .swatch { margin-top: 6px; }
.comment-main { flex: 1; min-width: 0; }
.comment-name { font-weight: 800; margin-right: 6px; }
.comment-time { font-size: 12px; font-weight: 600; color: var(--muted); }
.comment-body { white-space: pre-wrap; word-wrap: break-word; }
.comment-delete {
  flex: none; width: 26px; height: 26px; border-radius: 8px; cursor: pointer; padding: 0;
  border: 2px solid transparent; background: none; color: var(--muted); font-size: 18px; line-height: 1;
}
.comment-delete:hover { border-color: var(--ink); color: var(--danger); }
.comment-form { display: flex; gap: 8px; margin-top: 8px; }
.comment-form input[type=text] { padding: 7px 12px; }

.account-footer { border-top: 2px dashed var(--ink); padding-top: 16px; }

/* notification settings */
.notif-status { margin: 8px 0; font-weight: 600; }
.notif-hint { margin: 8px 0; padding: 10px 12px; font-size: 14px; background: var(--field); border: 2px dashed var(--ink); border-radius: 12px; }
.notif-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 6px; }
.notif-actions:not(:has(.btn:not(.hidden))) { display: none; }
.notif-prefs { display: grid; gap: 8px; margin-top: 12px; }
.notif-prefs .checkbox { margin: 0; font-weight: 600; flex-wrap: wrap; }
.time-input {
  font: inherit; font-weight: 700; padding: 2px 8px; border-radius: 10px;
  border: var(--border) solid var(--ink); background: var(--field); color: var(--text);
}
