/* Layout: a white page with one big thing on it. The dark red Up next card holds the to-do you're on, a plain list sits under it, and adding lives behind one round button. */
:root {
  --wine: #5B0F0F;
  --wine-deep: #470B0B;
  --navy: #2E3E5B;
  --white: #FFFFFF;
  --soft: #F6F4F3;
  --ink: #241517;
  --muted: #6F6265;
  --line: #ECE7E6;
  --ring: #BDB1B2;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.23, 1, .32, 1);
  --drawer: cubic-bezier(.32, .72, 0, 1);
  --gutter-l: max(20px, env(safe-area-inset-left, 0px));
  --gutter-r: max(20px, env(safe-area-inset-right, 0px));
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--white); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.4; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p, ul { margin: 0; padding: 0; font-weight: 400; }
ul { list-style: none; }
:focus-visible { outline: 2.5px solid var(--navy); outline-offset: 2px; }

/* Fraunces set soft, so it carries the same round warmth as Cooper */
h1, .hero h2, .hero-num, .section-head h2, .row-title, .sheet-head h2, .brand, .count { font-variation-settings: "SOFT" 100, "WONK" 0; font-optical-sizing: auto; }
.hero h2, .hero-num, .section-head h2, .row-title, .sheet-head h2, .brand { font-weight: 560; }
h1, .count, .is-done .row-title { font-weight: 360; }

.page {
  max-width: 620px; margin-inline: auto;
  padding-top: calc(18px + env(safe-area-inset-top, 0px)); padding-bottom: calc(170px + var(--safe-b));
  padding-left: var(--gutter-l); padding-right: var(--gutter-r);
}

/* Top of the page */
.status { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted); }

.head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 8px; }
h1 { font-family: var(--serif); font-size: 31px; line-height: 1.12; letter-spacing: -.015em; text-wrap: balance; }
.sub { margin-top: 8px; font-size: 16px; color: var(--muted); }

.ring { position: relative; width: 58px; height: 58px; flex: none; }
.ring svg { width: 58px; height: 58px; display: block; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring .track { stroke: var(--line); }
.ring .fill { stroke: var(--wine); stroke-linecap: round; transition: stroke-dashoffset 360ms var(--ease); }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* The one big card */
.hero {
  position: relative; overflow: hidden; margin-top: 22px;
  background: var(--wine); color: var(--white);
  border-radius: 28px; padding: 22px 22px 18px;
  display: grid; gap: 14px;
}
.hero-num {
  position: absolute; right: 8px; bottom: -44px;
  font-family: var(--serif); font-size: 210px; line-height: 1;
  color: rgba(255, 255, 255, .07); pointer-events: none; user-select: none;
}
.hero > *:not(.hero-num) { position: relative; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 15px; color: rgba(255, 255, 255, .78); }
.hero h2 { font-family: var(--serif); font-size: 29px; line-height: 1.16; overflow-wrap: anywhere; text-wrap: pretty; }
.hero-due { font-size: 15px; color: rgba(255, 255, 255, .78); margin-top: -6px; }
.hero-actions { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.hero :focus-visible { outline-color: var(--white); }

.big {
  flex: 1; min-height: 54px; padding: 0 22px; border-radius: 18px;
  background: var(--white); color: var(--wine); font-size: 17px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform 140ms var(--ease);
}
.big svg { width: 20px; height: 20px; }
.big:active { transform: scale(.97); }
.quiet-light { min-height: 54px; padding: 0 16px; border-radius: 18px; font-size: 16px; color: rgba(255, 255, 255, .88); transition: transform 140ms var(--ease), background-color 160ms ease; }
.quiet-light:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .quiet-light:hover { background: rgba(255, 255, 255, .1); } }

/* Sections */
.section { margin-top: 26px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-bottom: 2px; }
.section-head h2 { font-family: var(--serif); font-size: 20px; line-height: 1.25; }
.section-head span { font-size: 13.5px; color: var(--muted); }

/* List rows */
.row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 6px; padding-block: 8px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row-text { min-width: 0; }
.row-title { font-family: var(--serif); font-size: 18px; line-height: 1.25; overflow-wrap: anywhere; text-wrap: pretty; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; margin-top: 3px; font-size: 14px; color: var(--muted); }
.who { display: inline-flex; align-items: center; gap: 6px; }
.who i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.c-client { background: var(--wine); }
.c-content { background: var(--navy); }
.c-admin { background: #8A7C7E; }
.c-personal { background: #B9A07C; }

.check { width: 44px; height: 44px; margin-left: -8px; display: grid; place-items: center; transition: transform 140ms var(--ease); }
.check:active { transform: scale(.9); }
.check i { width: 26px; height: 26px; border-radius: 50%; border: 1.75px solid var(--ring); background: var(--white); display: grid; place-items: center; transition: background-color 160ms ease, border-color 160ms ease; }
.check svg { width: 15px; height: 15px; color: var(--white); opacity: 0; transition: opacity 120ms ease; }
.is-done .check i { background: var(--wine); border-color: var(--wine); }
.is-done .check svg { opacity: 1; }
.is-done .row-title { color: var(--muted); font-family: var(--serif); text-decoration: line-through; text-decoration-thickness: 1px; }
@media (hover: hover) and (pointer: fine) { .check:hover i { border-color: var(--wine); } }

.link { min-height: 44px; padding-inline: 8px; margin-right: -8px; font-size: 14.5px; color: var(--muted); border-radius: 10px; white-space: nowrap; }
@media (hover: hover) and (pointer: fine) { .link:hover { color: var(--wine); } }

.pill {
  min-height: 40px; padding: 0 16px; border-radius: 14px; font-size: 14.5px; font-weight: 600; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--soft); color: var(--wine);
  transition: transform 140ms var(--ease), background-color 160ms ease;
}
.pill:active { transform: scale(.97); }
.pill-main { background: var(--wine); color: var(--white); }
@media (hover: hover) and (pointer: fine) {
  .pill:hover { background: var(--line); }
  .pill-main:hover { background: var(--wine-deep); }
}

.more { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; color: var(--wine); font-size: 16px; font-weight: 500; text-align: left; }
.more b { width: 26px; height: 26px; margin-left: 1px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); font-weight: 500; font-size: 18px; line-height: 1; }

/* Done count */
.count { font-family: var(--serif); font-size: 76px; line-height: 1; color: var(--wine); margin-top: 18px; font-variant-numeric: lining-nums; }
.empty { padding-block: 18px; font-size: 16px; color: var(--muted); }

/* Finished state of the big card */
.hero.calm .hero-actions { margin-top: 2px; }

/* Round add button */
.fab {
  position: fixed; z-index: 5; right: var(--gutter-r); bottom: calc(82px + var(--safe-b));
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--wine); color: var(--white);
  display: grid; place-items: center;
  box-shadow: 0 10px 22px rgba(91, 15, 15, .26);
  transition: transform 140ms var(--ease);
}
.fab svg { width: 26px; height: 26px; }
.fab:active { transform: scale(.94); }

/* Tabs on a phone, side menu on a laptop */
.side {
  position: fixed; z-index: 4; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 4px var(--gutter-r) calc(4px + var(--safe-b)) var(--gutter-l);
}
.brand, .side-add { display: none; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); }
.tab { min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12.5px; color: var(--muted); border-radius: 12px; }
.tab svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab[aria-current="page"] { color: var(--wine); font-weight: 600; }
.tab .name { display: flex; gap: 4px; }
.tab .name b { font-weight: inherit; font-variant-numeric: tabular-nums; }

/* Add sheet */
.scrim { position: fixed; inset: 0; z-index: 8; background: rgba(36, 21, 23, .4); opacity: 0; visibility: hidden; transition: opacity 200ms ease, visibility 0s linear 200ms; }
.scrim.on { opacity: 1; visibility: visible; transition: opacity 200ms ease; }
.sheet {
  position: fixed; z-index: 9; left: 0; right: 0; bottom: 0;
  background: var(--white); border-radius: 26px 26px 0 0;
  padding: 20px var(--gutter-r) calc(18px + var(--safe-b)) var(--gutter-l);
  display: grid; gap: 12px;
  transform: translateY(100%); visibility: hidden;
  transition: transform 280ms var(--drawer), visibility 0s linear 280ms;
}
.sheet.on { transform: translateY(0); visibility: visible; transition: transform 300ms var(--drawer); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head h2 { font-family: var(--serif); font-size: 23px; line-height: 1.2; }
.sheet input {
  width: 100%; height: 56px; padding: 0 16px; border: 0; border-radius: 16px;
  background: var(--soft); font-size: 17px;
}
.sheet input::placeholder { color: var(--muted); opacity: 1; }
.sheet input:focus { outline: 2px solid var(--wine); outline-offset: 0; }
.hints { min-height: 22px; display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 14.5px; color: var(--muted); }
.send { min-height: 54px; border-radius: 18px; background: var(--wine); color: var(--white); font-size: 17px; font-weight: 600; transition: transform 140ms var(--ease); }
.send:active { transform: scale(.98); }

/* Toast */
.toast {
  position: fixed; z-index: 7; left: 50%; bottom: calc(156px + var(--safe-b));
  width: max-content; max-width: calc(100% - 40px);
  display: flex; align-items: center; gap: 14px;
  background: var(--ink); color: var(--white);
  padding: 11px 18px; border-radius: 16px; font-size: 15px; line-height: 1.3;
  opacity: 0; transform: translate(-50%, 8px); pointer-events: none;
  transition: opacity 160ms ease, transform 200ms var(--ease);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { flex: none; min-height: 32px; font-weight: 600; color: var(--white); text-decoration: underline; text-underline-offset: 3px; }

/* One view at a time */
body:not([data-tab="today"]) #view-today,
body:not([data-tab="later"]) #view-later,
body:not([data-tab="done"]) #view-done,
body:not([data-tab="today"]) .ring { display: none; }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); align-items: start; }
  .side {
    position: sticky; top: 0; bottom: auto; height: 100vh;
    background: var(--soft); -webkit-backdrop-filter: none; backdrop-filter: none;
    border-top: 0; padding: 30px 16px;
    display: grid; align-content: start; gap: 20px;
  }
  .brand { display: block; padding-inline: 10px; font-family: var(--serif); font-size: 23px; line-height: 1.15; color: var(--wine); }
  .side-add {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; border-radius: 14px; background: var(--wine); color: var(--white); font-weight: 600;
    transition: transform 140ms var(--ease), background-color 160ms ease;
  }
  .side-add svg { width: 19px; height: 19px; }
  .side-add:active { transform: scale(.97); }
  .side-add:hover { background: var(--wine-deep); }
  .tabs { grid-template-columns: 1fr; gap: 2px; }
  .tab { flex-direction: row; justify-content: flex-start; gap: 11px; min-height: 46px; padding-inline: 10px; font-size: 15.5px; color: var(--ink); }
  .tab .name { flex: 1; justify-content: space-between; }
  .tab .name b { color: var(--muted); font-weight: 400; }
  .tab[aria-current="page"] { background: var(--white); color: var(--wine); }
  .tab:not([aria-current="page"]):hover { background: rgba(255, 255, 255, .6); }
  .fab { display: none; }
  .page { padding-top: 40px; padding-bottom: 80px; }
  h1 { font-size: 44px; }
  .hero { padding: 26px 28px 22px; }
  .hero h2 { font-size: 33px; }
  .toast { left: calc(50% + 126px); bottom: 28px; }
  .sheet {
    left: 50%; right: auto; bottom: auto; top: 18vh; width: 480px;
    border-radius: 24px; padding: 24px;
    transform: translate(-50%, 12px); opacity: 0;
    transition: transform 200ms var(--ease), opacity 160ms ease, visibility 0s linear 200ms;
  }
  .sheet.on { transform: translate(-50%, 0); opacity: 1; transition: transform 220ms var(--ease), opacity 160ms ease; }
}

@media (prefers-reduced-motion: reduce) {
  .big, .quiet-light, .check, .pill, .fab, .send, .side-add, .toast, .sheet, .sheet.on, .ring .fill { transition: opacity 160ms ease, background-color 160ms ease; }
  .big:active, .quiet-light:active, .check:active, .pill:active, .fab:active, .send:active, .side-add:active { transform: none; }
  .toast, .toast.on { transform: translate(-50%, 0); }
}

/* Log out */
.logout { margin-top: 28px; }

/* Login and setup pages */
.gate { max-width: 400px; margin-inline: auto; padding: calc(56px + env(safe-area-inset-top, 0px)) var(--gutter-r) 40px var(--gutter-l); display: grid; gap: 12px; }
.gate h1 { color: var(--wine); font-weight: 560; }
.gate form { display: grid; gap: 8px; margin-top: 8px; }
.gate label { font-size: 15px; color: var(--muted); margin-top: 6px; }
.gate input { width: 100%; height: 54px; padding: 0 16px; border: 0; border-radius: 16px; background: var(--soft); font-size: 17px; }
.gate input:focus { outline: 2px solid var(--wine); outline-offset: 0; }
.gate .send { margin-top: 12px; }
.gate-error { padding: 12px 14px; border-radius: 14px; background: var(--soft); color: var(--wine); font-size: 15px; }
