/* PlanWell site. Colours are the Mac app's own tokens (PlanWellDesignSystem.swift). */
:root {
  --window: #f4f6f9;
  --grid: #f2f5f7;
  --sidebar: #e9ecf0;
  --panel: rgba(255, 255, 255, 0.86);
  --chip: rgba(254, 254, 254, 0.92);
  --chip-2: rgba(235, 238, 242, 0.9);
  --chip-border: rgba(145, 159, 173, 0.58);
  --line: rgba(199, 208, 217, 0.56);
  --line-strong: rgba(163, 176, 187, 0.72);
  --text: #1d1d1f;
  --text-2: #5f656d;
  --text-3: #8b9199;
  --accent: #008573;
  --accent-ink: #ffffff;
  --accent-soft: rgba(214, 244, 237, 0.9);
  --red: #ff3b30;
  --red-ink: #ffffff;
  --shadow: 0 1px 2px rgba(20, 30, 40, 0.06), 0 12px 32px rgba(20, 30, 40, 0.1);
  --radius: 8px;
  --chip-radius: 6px;
  --col: clamp(46px, 4.1vw, 62px);
  --gutter: clamp(96px, 8.5vw, 132px);
  --bar: 76px;
  --p: clamp(28px, calc((100dvh - var(--bar) - 98px - 124px) / 11), 40px);
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --window: #1b1d21;
    --grid: #1d2024;
    --sidebar: #25282d;
    --panel: rgba(45, 47, 52, 0.9);
    --chip: rgba(80, 85, 93, 0.9);
    --chip-2: rgba(60, 64, 70, 0.9);
    --chip-border: rgba(133, 145, 159, 0.54);
    --line: rgba(79, 88, 98, 0.46);
    --line-strong: rgba(106, 116, 128, 0.68);
    --text: #f2f2f4;
    --text-2: #aab0b8;
    --text-3: #7d848d;
    --accent: #4ddfc9;
    --accent-ink: #06201c;
    --accent-soft: rgba(18, 61, 64, 0.85);
    --red: #ff453a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 14px 36px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --window: #1b1d21; --grid: #1d2024; --sidebar: #25282d; --panel: rgba(45, 47, 52, 0.9);
  --chip: rgba(80, 85, 93, 0.9); --chip-2: rgba(60, 64, 70, 0.9); --chip-border: rgba(133, 145, 159, 0.54);
  --line: rgba(79, 88, 98, 0.46); --line-strong: rgba(106, 116, 128, 0.68);
  --text: #f2f2f4; --text-2: #aab0b8; --text-3: #7d848d;
  --accent: #4ddfc9; --accent-ink: #06201c; --accent-soft: rgba(18, 61, 64, 0.85); --red: #ff453a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 14px 36px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--window);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Top bar (the app's toolbar) ---------- */
.bar {
  position: sticky; top: 0; z-index: 20;
  height: var(--bar);
  display: flex; align-items: center; gap: 20px;
  padding: 0 clamp(16px, 2vw, 28px);
  background: color-mix(in srgb, var(--window) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(18px);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 0.6px solid var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 18px; text-decoration: none; letter-spacing: -0.01em;
}
.brand svg { width: 24px; height: 24px; }
.month {
  margin: 0; font-size: clamp(22px, 2.3vw, 30px); font-weight: 700; letter-spacing: -0.02em;
  min-width: 9ch; white-space: nowrap;
}
.month span { font-weight: 400; color: var(--text-2); }
.bar nav { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.tool {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 999px;
  border: 0.6px solid var(--chip-border); background: var(--chip);
  font-size: 13.5px; font-weight: 500; text-decoration: none; white-space: nowrap;
  cursor: pointer; color: var(--text);
}
.tool:hover { border-color: var(--line-strong); background: var(--panel); }
.tool.buy { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.tool.buy:hover { filter: brightness(1.06); background: var(--accent); }
.tool.jump { display: none; }

/* ---------- The week grid ---------- */
.frame {
  display: grid;
  grid-template-columns: var(--gutter) minmax(0, 1fr);
  height: calc(100vh - var(--bar));
  height: calc(100dvh - var(--bar));
  min-height: 620px;
}
.rows, .grid {
  display: grid;
  grid-template-rows: 58px 40px repeat(11, var(--p)) minmax(124px, 1fr);
}
.rows {
  background: var(--sidebar);
  border-right: 0.6px solid var(--line);
  margin: 0; padding: 0; list-style: none;
  font-size: 12.5px; color: var(--text-2); text-align: right;
}
.rows li { display: flex; align-items: center; justify-content: flex-end; padding-right: 14px; font-variant-numeric: tabular-nums; }
.rows li.strong { font-weight: 600; color: var(--text); }
.rows li:last-child { align-items: flex-start; padding-top: 16px; border-top: 0.6px solid var(--line); }

.scroller {
  overflow-x: auto; overflow-y: hidden;
  background: var(--grid);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  overscroll-behavior-x: contain;
}
.grid {
  position: relative;
  grid-template-columns: repeat(var(--cols, 112), var(--col));
  grid-auto-flow: dense;
  height: 100%;
  width: max-content;
  /* vertical day lines + horizontal period lines */
  background-image: linear-gradient(to right, var(--line) 0.6px, transparent 0.6px);
  background-size: var(--col) 100%;
}
/* horizontal period lines, stopping at the todo row */
.grid::before {
  content: ""; position: absolute; left: 0; right: 0; top: 98px;
  height: calc(var(--p) * 11 + 1px);
  background: linear-gradient(to bottom, var(--line) 0.6px, transparent 0.6px) 0 0 / 100% var(--p);
  pointer-events: none;
}
.sec { display: contents; }

.days { display: contents; }
.day {
  grid-row: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 500; letter-spacing: 0.02em; color: var(--text-2); line-height: 1.2;
  border-bottom: 0.6px solid var(--line); background: var(--grid);
}
.day b { font-size: 16px; font-weight: 500; color: var(--text); letter-spacing: 0; }
.day.we, .day.we b { color: var(--red); }
.day.today { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); border-radius: 6px; margin: 4px 3px; }
.day.today, .day.today b { color: var(--accent); }

/* Chips, straight from the timeline */
.chip {
  align-self: center; justify-self: stretch;
  margin: 0 3px; height: 26px;
  display: flex; align-items: center; gap: 6px; padding: 0 8px;
  border-radius: var(--chip-radius);
  border: 0.8px solid var(--chip-border);
  background: var(--chip);
  font-size: 13px; font-weight: 500; line-height: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-decoration: none; color: var(--text);
  box-shadow: 0 0.5px 1px rgba(0, 0, 0, 0.04);
}
a.chip:hover { border-color: var(--accent); }
.chip.event { grid-row: 2; font-weight: 600; }
.chip.red { background: var(--red); color: var(--red-ink); border-color: transparent; }
.chip.teal { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.chip.klass { color: var(--text-2); font-weight: 500; opacity: 0.8; cursor: pointer; user-select: none; transition: box-shadow 0.12s, opacity 0.12s; }
.chip.klass:hover { opacity: 1; border-color: var(--accent); box-shadow: 0 0 0 0.75px var(--accent); }
.chip.klass.now { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); opacity: 1; color: var(--text); }
/* click a class: it and every class with the same name get the app's accent ring */
.chip.klass.hl { opacity: 1; color: var(--text); border-color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .chip.klass { animation: pop 0.5s both; animation-delay: calc(var(--i, 0) * 12ms); }
  @keyframes pop { from { opacity: 0; transform: scale(0.9); } }
}

/* Todo row */
.todos {
  grid-row: 14; align-self: start; margin: 10px 3px 0;
  display: flex; flex-direction: column; gap: 5px; min-width: 0;
}
.todo {
  display: flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 10px;
  background: var(--panel); border: 0.6px solid var(--chip-border); border-radius: var(--chip-radius);
  font-size: 13.5px; cursor: pointer; user-select: none; white-space: nowrap; overflow: hidden;
}
.todo input { margin: 0; width: 14px; height: 14px; accent-color: var(--accent); flex: none; cursor: pointer; }
.todo:has(input:checked) span { text-decoration: line-through; color: var(--text-3); }
.todo a { color: var(--accent); font-weight: 600; text-decoration: none; }
.todo.important span { color: var(--red); font-weight: 600; }

/* Content blocks sit on the grid like selected items */
.block {
  position: relative; z-index: 2;
  margin: 6px 3px; min-width: 0; min-height: 0;
}
.card {
  background: var(--panel);
  border: 0.6px solid var(--chip-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: clamp(16px, 1.6vw, 26px);
  overflow: hidden;
}
.copy { display: flex; flex-direction: column; justify-content: safe center; }
.eyebrow {
  margin: 0 0 12px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent);
}
h1, h2 { margin: 0 0 14px; letter-spacing: -0.025em; line-height: 1.04; font-weight: 700; }
h1 { font-size: clamp(32px, 3.3vw, 52px); }
h2 { font-size: clamp(27px, 2.5vw, 40px); }
h1 span, h2 span { font-weight: 400; color: var(--text-2); }
.lead { font-size: clamp(15px, 1.05vw, 17px); color: var(--text-2); margin: 0 0 20px; max-width: 30em; }
.copy .lead { margin-bottom: 22px; }
.hero { padding-left: clamp(20px, 2.4vw, 40px); }
h1 span { display: block; }
.copy p { margin: 0 0 12px; color: var(--text-2); }
.copy p strong { color: var(--text); font-weight: 600; }
.ticks { margin: 4px 0 0; padding: 0; list-style: none; display: grid; gap: 7px; font-size: 14px; }
.ticks li { display: flex; gap: 9px; align-items: baseline; }
.ticks li::before {
  content: ""; flex: none; width: 13px; height: 13px; border-radius: 4px; transform: translateY(2px);
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 6.2 5 8.2 9 4' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px no-repeat;
}

.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.store {
  display: inline-flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 18px 0 14px; border-radius: 12px;
  background: var(--text); color: var(--window); text-decoration: none;
  font-weight: 600; font-size: 15px; line-height: 1.1;
}
.store svg { width: 22px; height: 22px; fill: currentColor; }
.store small { display: block; font-size: 10.5px; font-weight: 500; opacity: 0.75; letter-spacing: 0.02em; }
.store:hover { filter: brightness(1.15); }
.fine { font-size: 13px; color: var(--text-3); margin: 0; }
.fine a { color: var(--text-2); }
.copy .hint { display: inline-flex; align-items: center; gap: 8px; margin: 26px 0 0; font-size: 13px; color: var(--text-3); }
.hint kbd {
  font: inherit; font-size: 12px; padding: 1px 7px; border-radius: 5px;
  border: 0.6px solid var(--chip-border); background: var(--chip);
}
@media (prefers-reduced-motion: no-preference) {
  .hint svg { animation: nudge 1.6s ease-in-out infinite; }
  @keyframes nudge { 50% { transform: translateX(5px); } }
}

/* Screenshot */
.shot { display: flex; align-items: center; }
.shot img {
  width: auto; height: 100%; max-width: 100%; object-fit: contain;
  border-radius: 14px; box-shadow: var(--shadow);
  border: 0.6px solid var(--line);
}

/* Google Calendar settings mock */
.mock { padding: 0; display: flex; flex-direction: column; }
.mock-head {
  display: flex; align-items: center; gap: 7px; padding: 12px 16px;
  border-bottom: 0.6px solid var(--line); font-size: 13px; font-weight: 600;
}
.dots { display: inline-flex; gap: 6px; margin-right: 8px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; }
.dots i:nth-child(3) { background: #28c840; }
.mock-body { padding: 16px; display: grid; gap: 14px; font-size: 13.5px; overflow: hidden; }
.mock-label { font-size: 11.5px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 6px; }
.cal-row {
  display: grid; grid-template-columns: 16px 1fr auto; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 7px; background: var(--chip-2);
}
.cal-row + .cal-row { margin-top: 5px; }
.cal-row i { width: 12px; height: 12px; border-radius: 4px; background: var(--c); }
.cal-row.off { opacity: 0.55; }
.select {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 6px;
  background: var(--chip); border: 0.6px solid var(--chip-border); font-size: 12.5px; font-weight: 500;
}
.select::after {
  content: ""; width: 7px; height: 7px; border-right: 1.4px solid var(--text-3); border-bottom: 1.4px solid var(--text-3);
  transform: rotate(45deg) translate(-2px, -1px);
}
.note { font-size: 12.5px; color: var(--text-2); margin: 0; }
.note b { color: var(--accent); font-weight: 600; }

/* Menu bar + widget mock */
.menubar {
  display: flex; align-items: center; justify-content: flex-end; gap: 18px;
  height: 36px; padding: 0 14px; border-radius: 10px;
  background: linear-gradient(90deg, #5d7fa6, #7aa0c4);
  color: #fff; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow);
  white-space: nowrap; overflow: hidden;
}
.menubar .pw { display: inline-flex; align-items: center; gap: 7px; padding: 3px 9px; border-radius: 6px; background: rgba(255, 255, 255, 0.24); }
.menubar .pw svg { width: 15px; height: 15px; }
.menubar .dim { font-weight: 500; opacity: 0.9; }
.widgets { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; align-self: start; }
.widget {
  border-radius: 20px; padding: 16px; background: var(--panel); box-shadow: var(--shadow);
  border: 0.6px solid var(--line); display: flex; flex-direction: column; gap: 9px; min-width: 0;
}
.widget h3 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); }
.w-item { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.w-item span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-item span:last-child { color: var(--text-2); font-variant-numeric: tabular-nums; flex: none; }
.w-item.red span:last-child { color: var(--red); font-weight: 600; }
.w-todo { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.w-todo::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 1.3px solid var(--chip-border); flex: none; }
.w-todo.done { color: var(--text-3); text-decoration: line-through; }
.w-todo.done::before { background: var(--accent); border-color: var(--accent); }

/* Markdown file mock */
.file { padding: 0; display: grid; grid-template-columns: 38% 1fr; }
.tree { border-right: 0.6px solid var(--line); padding: 14px 10px; font-size: 13px; background: var(--chip-2); }
.tree div { padding: 3px 8px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree .dir { font-weight: 600; margin-top: 6px; }
.tree .dir:first-child { margin-top: 0; }
.tree .f { padding-left: 22px; color: var(--text-2); }
.tree .f.on { background: var(--accent-soft); color: var(--text); }
pre {
  margin: 0; padding: 16px 18px; overflow: hidden;
  font: 12.5px/1.65 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--text);
}
pre .k { color: var(--accent); }
pre .d { color: var(--text-3); }

/* Price */
.price { text-align: left; }
.big { white-space: nowrap; font-size: clamp(54px, 5.4vw, 90px); font-weight: 700; letter-spacing: -0.04em; line-height: 0.95; margin: 0 0 6px; }
.big span { font-size: 0.42em; font-weight: 500; color: var(--text-2); letter-spacing: -0.02em; }
.receipt { display: grid; gap: 6px; margin: 12px 0 22px; font-size: 14px; }
.receipt div { display: flex; justify-content: space-between; gap: 18px; padding-bottom: 6px; border-bottom: 0.6px dashed var(--line-strong); }
.receipt div span:last-child { color: var(--text-2); }

.foot { font-size: 13.5px; }
.foot a { color: var(--accent); font-weight: 500; text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.yt {
  display: flex; align-items: center; gap: 14px; margin: 6px 0 16px; padding: 12px 16px;
  border-radius: 10px; border: 0.6px solid var(--chip-border); background: var(--chip-2);
  text-decoration: none; color: var(--text);
}
.foot a.yt { color: var(--text); }
.foot a.yt:hover { text-decoration: none; border-color: #ff0000; }
.yt img { width: 40px; height: 40px; flex: none; }
.yt b { display: block; font-size: 15px; font-weight: 600; }
.yt small { display: block; font-size: 12.5px; color: var(--text-2); }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ---------- Phones and narrow windows: read top to bottom ---------- */
@media (max-width: 820px), (max-height: 640px) {
  :root { --bar: 60px; }
  .bar { gap: 12px; }
  .month, .bar nav .tool:not(.buy) { display: none; }
  .brand { font-size: 17px; }
  .frame { display: block; height: auto; min-height: 0; }
  .rows, .days, .chip.klass { display: none; }
  .scroller { overflow: visible; background: var(--window); }
  .grid {
    display: flex; flex-direction: column; width: auto; height: auto;
    padding: 12px 16px 40px; background: none; gap: 12px;
  }
  .sec { display: flex; flex-direction: column; gap: 12px; padding-top: 26px; }
  .sec:first-child { padding-top: 6px; }
  .block { margin: 0; }
  .chip { margin: 0; align-self: flex-start; }
  .chip.event { display: none; }
  .todos { margin: 0; align-self: stretch; }
  .shot img { width: 100%; }
  .shot img { height: auto; aspect-ratio: 1800 / 1165; }
  .card { padding: 20px; }
  .copy .hint { display: none; }
  .hero { padding-left: 0; }
  .widgets { grid-template-columns: 1fr; }
  .file { grid-template-columns: 1fr; }
  .tree { border-right: 0; border-bottom: 0.6px solid var(--line); }
  .menubar .dim { display: none; }
}

/* ---------- Plain pages (privacy, support) ---------- */
.page { max-width: 820px; margin: 0 auto; padding: 40px 20px 80px; }
.page h1 { margin-bottom: 10px; }
.page .lead { margin-bottom: 8px; }
.stamp { display: inline-flex; margin: 6px 0 30px; }
.entries { display: grid; gap: 12px; }
.entry { background: var(--panel); border: 0.6px solid var(--chip-border); border-radius: var(--radius); padding: 20px 22px; }
.entry h2 { font-size: 19px; letter-spacing: -0.01em; margin: 0 0 8px; line-height: 1.25; }
.entry p, .entry li { color: var(--text-2); margin: 0 0 8px; }
.entry p:last-child { margin-bottom: 0; }
.entry strong { color: var(--text); }
.entry a { color: var(--accent); }
.entry ul { margin: 0 0 8px; padding-left: 20px; }
.page-foot { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 8px; }
