:root {
  --paper: #f3efe6;
  --ink: #1e1a15;
  --muted: #5c5348;
  --card: #fffdf8;
  --line: #e4d9c6;
  --accent: #8c3a28;
  --accent-ink: #fff8f5;
  --weekend: #f7f1e4;
  --shadow: 0 10px 30px rgba(70, 48, 18, 0.06);
  --sans: "Avenir Next", "Segoe UI", sans-serif;
  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
}

button, input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h1, h2, p { margin: 0; }

h1, h2 { font-family: var(--serif); font-weight: 600; }

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 28px 0 18px;
}

.brand {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.export-row {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.export-row a { color: var(--accent); }

h1 { font-size: 40px; line-height: 1; }

.who {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ghost, .primary, .text-button, a.ghost {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 8px 14px;
}

a.ghost { display: inline-block; text-decoration: none; }

.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.text-button {
  background: transparent;
}

.year-nav, .notice {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

.notice {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--muted);
}

.month {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.month h2 { font-size: 22px; margin-bottom: 8px; }

.scroller { overflow-x: auto; }

.track {
  display: grid;
  grid-template-columns: repeat(var(--days), minmax(28px, 1fr));
  gap: 3px;
  min-width: 900px;
}

.day-num {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 4px 0 8px;
  border-radius: 6px;
  border: 0;
  background: transparent;
}

button.day-num { cursor: pointer; }

button.day-num:hover { background: #f3e6d4; }

.day-num.weekend { background: var(--weekend); }

.day-num.today {
  color: var(--accent);
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--accent);
}

.login-screen, .locked-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card {
  width: min(440px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.card h1 { font-size: 36px; margin: 4px 0 8px; }

.lede { color: var(--muted); margin-bottom: 18px; }

label { display: block; font-size: 14px; margin: 12px 0 6px; }

input[type="email"], input[type="password"], input[type="text"], input[type="number"], input[type="date"], select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}

textarea { min-height: 88px; resize: vertical; }

input[type="color"] {
  width: 64px;
  height: 40px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.error, .hint {
  margin-top: 14px;
  font-size: 14px;
}

.error { color: var(--accent); }

.hint a { color: var(--accent); }

.banner {
  background: #f8e7df;
  border: 1px solid #efcfc3;
  color: var(--ink);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.hook-banner h2, .hook-section h2 { font-size: 22px; margin: 0 0 6px; }

.hook {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  margin-top: 10px;
}

.hook h3 { font-family: var(--serif); font-size: 20px; margin: 0; }

.hook-section { margin-top: 18px; }

#hook-window input[type="number"] { width: 90px; }

.month-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.tag-key {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 4px 12px 4px 4px;
}

.swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-block;
}

.sheet { min-width: 960px; }

.month.zoomed .sheet { min-width: 1400px; }

.lanes {
  position: relative;
  height: calc(var(--lanes) * 40px);
  min-height: 10px;
  margin-top: 6px;
}

.bar.highlight { outline: 3px solid var(--ink); outline-offset: 2px; }

.catalog { display: grid; gap: 10px; }

.product {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}

.product-main {
  display: grid;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.product-name { font-family: var(--serif); font-size: 22px; }

.product-meta, .product-note, .product-promo { color: var(--muted); font-size: 14px; }

.product-note { color: var(--ink); }

.promo-links { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }

.promo-links button {
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 0;
  text-align: left;
  cursor: pointer;
}

button[aria-current="true"] { border-color: var(--ink); }

.bar {
  position: absolute;
  top: calc(var(--lane) * 40px);
  left: calc(100% * var(--start) / var(--days));
  width: calc(100% * var(--span) / var(--days) - 4px);
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  box-shadow: inset 0 0 0 1px rgba(30, 26, 21, 0.12);
}

.bar-label, .handle {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
}

.bar-label {
  flex: 1;
  min-width: 0;
  text-align: left;
  padding: 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: grab;
  font-size: 13px;
}

.handle {
  width: 12px;
  flex: none;
  cursor: ew-resize;
}

.handle::after {
  content: "";
  display: block;
  width: 2px;
  height: 14px;
  margin: 10px auto 0;
  background: currentColor;
  opacity: 0.5;
  border-radius: 2px;
}

.month.zoomed .bar-label { font-size: 13px; }

.month-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.month-list li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

dialog.editor {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  width: min(520px, calc(100% - 24px));
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
}

dialog.editor::backdrop { background: rgba(40, 28, 16, 0.4); }

.dialog-body { padding: 22px; }

.dialog-body h2 { font-size: 28px; margin-bottom: 8px; }

.date-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 720px) {
  h1 { font-size: 32px; }
  .top { flex-direction: column; align-items: flex-start; }
  .who { justify-content: flex-start; }
}
