:root {
  color-scheme: light;
  --page: #f2f4f0;
  --surface: #fffef9;
  --surface-2: #f7f8f3;
  --surface-3: #ebefe8;
  --ink: #101714;
  --text: #202824;
  --muted: #737c76;
  --border: #dbe2dc;
  --shadow: 0 24px 56px rgba(20, 31, 27, 0.13);
  --soft-shadow: 0 10px 26px rgba(20, 31, 27, 0.07);
  --focus: #2b7062;
  --done: #2f865b;
  --now: #3268b8;
  --long: #bd8f22;
  --daily: #c64d45;
  --high: #bd4a3d;
  --medium: #9b6d1f;
  --low: #4d768f;
  --danger: #b74136;
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@property --progress {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --page: #111613;
  --surface: #1b231f;
  --surface-2: #232d28;
  --surface-3: #2c3731;
  --ink: #f5f8f2;
  --text: #e8eee7;
  --muted: #a8b4ad;
  --border: #3b4840;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.42);
  --soft-shadow: 0 16px 36px rgba(0, 0, 0, 0.26);
  --focus: #82d2bf;
  --done: #83d59e;
  --now: #8fb9ff;
  --long: #f0c85c;
  --daily: #ff9188;
  --high: #ff8b7e;
  --medium: #e8c46b;
  --low: #9ec9dd;
  --danger: #ff897d;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(43, 112, 98, 0.12), transparent 32%),
    linear-gradient(220deg, rgba(64, 94, 156, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(255, 254, 249, 0.86), rgba(242, 244, 240, 0.98)),
    var(--page);
  color: var(--text);
  font-family: var(--font);
}

body::selection {
  background: rgba(43, 112, 98, 0.22);
}

.auth-gate {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(110deg, rgba(11, 19, 16, 0.94), rgba(18, 36, 30, 0.8)),
    url("./assets/planner-hero.png") center / cover no-repeat;
}

.auth-panel {
  width: min(100%, 430px);
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  background: rgba(16, 28, 23, 0.9);
  color: #f8fbf3;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(18px);
}

.auth-panel .brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 22px;
  border-radius: var(--radius);
  background: #f8fbf3;
  color: #176453;
}

.auth-panel h1 {
  max-width: 10ch;
  margin: 8px 0 10px;
  font-size: 2rem;
  line-height: 1.05;
}

.auth-copy {
  margin: 0;
  color: rgba(248, 251, 243, 0.74);
  line-height: 1.55;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 26px;
}

.auth-form .field {
  gap: 7px;
}

.auth-form input {
  min-height: 44px;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
  color: #f8fbf3;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.auth-actions .secondary-button {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
  color: #f8fbf3;
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  color: rgba(248, 251, 243, 0.62);
  font-size: 0.82rem;
}

.auth-divider::before,
.auth-divider::after {
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  content: "";
}

.google-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: var(--radius);
  background: #fff;
  color: #252525;
  font-weight: 700;
}

.google-button:hover {
  background: #f5f5f5;
}

.google-mark {
  color: #4285f4;
  font-family: Arial, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
}

.email-link-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: #f8fbf3;
  font-weight: 700;
}

.email-link-button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.auth-status {
  min-height: 1.35em;
  margin: 0;
  color: rgba(248, 251, 243, 0.76);
  font-size: 0.86rem;
  line-height: 1.45;
}

.auth-status.is-error {
  color: #ffaca3;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  flex: 0 0 auto;
}

.app-shell {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 84px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(7, 12, 10, 0.92), rgba(12, 19, 16, 0.72) 46%, rgba(14, 22, 19, 0.28)),
    url("./assets/planner-hero.png") center / cover no-repeat;
  color: #f8fbf3;
  box-shadow: var(--shadow);
}

.hero::after {
  position: absolute;
  inset: auto 0 0;
  height: 50%;
  content: "";
  background: linear-gradient(0deg, rgba(11, 15, 13, 0.5), transparent);
  pointer-events: none;
}

.topbar {
  position: relative;
  z-index: 1;
}

.topbar {
  min-height: 82px;
  padding: 14px 18px;
}

.date-nav-main {
  display: grid;
  grid-template-columns: minmax(126px, 1fr) minmax(260px, auto) minmax(126px, 1fr);
  gap: 16px;
  width: min(820px, calc(100% - 134px));
  margin: 0 auto;
  align-items: center;
}

.date-lockup {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 0;
  text-align: center;
}

.date-lockup .brand-mark {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
}

.date-lockup p {
  margin: 0;
  color: rgba(248, 251, 243, 0.72);
  font-size: 0.72rem;
  font-weight: 840;
  letter-spacing: 0;
  text-transform: uppercase;
}

.date-lockup h1 {
  margin: 0;
  color: #f8fbf3;
  font-size: clamp(1.8rem, 3.2vw, 3.15rem);
  line-height: 0.98;
  letter-spacing: 0;
  text-wrap: balance;
}

.day-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.11);
  color: #f8fbf3;
  font-weight: 850;
  backdrop-filter: blur(16px);
  transition:
    transform 140ms ease,
    background-color 140ms ease,
    border-color 140ms ease;
}

.day-switch:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.18);
}

.day-switch-prev {
  justify-self: end;
}

.day-switch-next {
  justify-self: start;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.12);
  color: #cdeee1;
  backdrop-filter: blur(16px);
}

.brand-lockup h1,
.progress-panel h2,
.column h2,
.modal-header h2 {
  margin: 0;
  color: inherit;
  letter-spacing: 0;
}

.brand-lockup h1 {
  margin-top: 2px;
  font-size: clamp(1.35rem, 1.8vw, 1.8rem);
  line-height: 1.02;
}

.brand-lockup p,
.eyebrow,
.field span {
  margin: 0;
  color: inherit;
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0;
  opacity: 0.74;
  text-transform: uppercase;
}

.top-actions,
.panel-heading,
.modal-footer > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-actions {
  position: absolute;
  top: 18px;
  right: 18px;
}

.account-email {
  max-width: 190px;
  overflow: hidden;
  color: rgba(248, 251, 243, 0.82);
  font-size: 0.75rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button,
.tiny-button,
.column-add {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background-color 140ms ease,
    color 140ms ease;
}

.icon-button,
.column-add,
.tiny-button {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
}

.topbar .icon-button,
.file-button {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.14);
  color: #f8fbf3;
  backdrop-filter: blur(16px);
}

.icon-button:hover,
.tiny-button:hover,
.column-add:hover,
.primary-button:hover,
.secondary-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.workspace-tabs,
.tab-panel,
.board {
  margin-top: 12px;
}

.workspace-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--soft-shadow);
}

.workspace-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 112px;
  min-height: 38px;
  padding: 0 13px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 840;
}

.workspace-tab.is-active {
  background: var(--ink);
  color: var(--surface);
}

.add-workspace-button.is-popover-open {
  background: color-mix(in srgb, var(--focus) 12%, var(--surface));
  color: var(--text);
}

.tab-panel[hidden] {
  display: none !important;
}

.command-bar {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--soft-shadow);
}

.board-panel {
  display: grid;
  gap: 14px;
}

.task-form {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(174px, 220px) auto;
  gap: 8px;
  align-items: end;
}

.add-task-form {
  display: grid;
  gap: 14px;
}

.add-task-form .title-field input {
  min-height: 48px;
  font-size: 1.03rem;
}

.add-task-form .task-details {
  margin-top: 0;
}

.add-task-form .notes-field {
  margin-top: 10px;
}

.add-task-form .modal-footer {
  align-items: center;
}

.filter-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(280px, 0.85fr);
  gap: 8px;
  align-items: end;
}

.board-tools {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--soft-shadow);
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field span {
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  outline: none;
}

input,
select {
  padding: 0 12px;
}

textarea {
  min-height: 130px;
  padding: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: color-mix(in srgb, var(--focus) 82%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent);
}

.primary-button,
.secondary-button,
.google-button,
.email-link-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  white-space: nowrap;
  transition:
    transform 140ms ease,
    background-color 140ms ease,
    border-color 140ms ease;
}

.primary-button {
  background: var(--ink);
  color: var(--surface);
}

.secondary-button {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.danger-button {
  border-color: color-mix(in srgb, var(--danger) 28%, var(--border));
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  color: var(--danger);
}

.filter-selects {
  display: grid;
  grid-template-columns: repeat(2, minmax(118px, 1fr));
  gap: 8px;
  align-items: end;
}

.task-details {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.task-details summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 820;
  list-style: none;
  text-transform: uppercase;
}

.task-details summary::-webkit-details-marker {
  display: none;
}

.task-details summary svg {
  width: 15px;
  height: 15px;
  transition: transform 140ms ease;
}

.task-details[open] summary svg {
  transform: rotate(180deg);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.progress-panel {
  min-height: 170px;
  padding: 22px;
  border: 0;
  border-radius: 0;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: none;
}

.progress-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--done) 10%, transparent), transparent 54%),
    color-mix(in srgb, var(--surface) 97%, transparent);
}

.review-rhythm-panel {
  grid-column: 1 / -1;
  min-height: 144px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--done) 12%, transparent), transparent 58%),
    color-mix(in srgb, var(--surface-2) 92%, transparent);
}

.progress-panel h2 {
  margin-top: 6px;
  font-size: 1.12rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.progress-panel p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ring {
  --progress: 0deg;
  display: grid;
  width: 132px;
  height: 132px;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--surface) 50%, transparent 52%),
    conic-gradient(var(--done) var(--progress), var(--surface-3) 0);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--done) 12%, transparent),
    0 18px 38px color-mix(in srgb, var(--done) 18%, transparent);
  transition:
    --progress 980ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 180ms ease,
    box-shadow 180ms ease;
}

.ring span {
  font-size: 2.15rem;
  font-weight: 900;
  color: var(--text);
}

.progress-panel.is-complete .ring {
  transform: scale(1.04);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--done) 22%, transparent),
    0 18px 36px color-mix(in srgb, var(--done) 24%, transparent);
}

.panel-heading {
  justify-content: space-between;
}

.mini-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.mini-stat-grid div {
  min-height: 58px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.mini-stat-grid strong {
  display: block;
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1;
}

.mini-stat-grid span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 820;
  text-transform: uppercase;
}

.review-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.review-card {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--soft-shadow);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.section-heading h2 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 1.18rem;
  line-height: 1.15;
}

.section-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  gap: 10px;
  align-items: start;
}

.column {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  box-shadow: 0 14px 34px rgba(20, 31, 27, 0.06);
  overflow: hidden;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.column.is-over {
  border-color: color-mix(in srgb, var(--column-color) 56%, var(--border));
  box-shadow:
    0 14px 34px rgba(20, 31, 27, 0.08),
    0 0 0 2px color-mix(in srgb, var(--column-color) 18%, transparent);
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 60px;
  padding: 13px;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--column-color) 12%, transparent), transparent 72%),
    var(--surface);
}

.column-done {
  --column-color: var(--done);
}

.column-now {
  --column-color: var(--now);
}

.column-long {
  --column-color: var(--long);
}

.column-daily {
  --column-color: var(--daily);
}

.column h2 {
  font-size: 0.96rem;
  line-height: 1.15;
}

.column-header span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 780;
}

.column-add {
  border-color: color-mix(in srgb, var(--column-color) 28%, var(--border));
  color: var(--column-color);
}

.task-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 320px;
  padding: 10px;
}

.task-list.is-over,
.column.is-over .task-list {
  background: color-mix(in srgb, var(--column-color) 8%, transparent);
}

.task-card {
  --accent: var(--focus);
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 104px;
  padding: 13px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 64%),
    color-mix(in srgb, var(--surface) 95%, var(--accent));
  box-shadow: 0 10px 22px rgba(20, 31, 27, 0.07);
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    opacity 140ms ease;
}

.task-card.is-movable {
  cursor: grab;
}

.task-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(20, 31, 27, 0.1);
}

.task-card.is-dragging {
  opacity: 0.5;
  cursor: grabbing;
}

body.is-card-dragging {
  user-select: none;
}

.task-card.is-overdue {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--border));
}

.task-card.priority-high {
  --accent: var(--high);
  border-color: color-mix(in srgb, var(--high) 54%, var(--border));
  border-left-width: 4px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--high) 16%, transparent), transparent 62%),
    color-mix(in srgb, var(--surface) 91%, var(--high));
  box-shadow:
    0 14px 28px color-mix(in srgb, var(--high) 16%, transparent),
    0 0 0 1px color-mix(in srgb, var(--high) 10%, transparent);
}

.task-card.priority-high:hover {
  box-shadow:
    0 16px 30px color-mix(in srgb, var(--high) 18%, transparent),
    0 0 0 1px color-mix(in srgb, var(--high) 12%, transparent);
}

.task-card.is-daily-done {
  background: color-mix(in srgb, var(--done) 10%, var(--surface));
}

.task-card.is-done-for-today {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--done) 13%, transparent), transparent 64%),
    color-mix(in srgb, var(--surface) 94%, var(--done));
}

.task-card.is-archived-preview {
  opacity: 0.82;
  border-style: dashed;
  background: color-mix(in srgb, var(--surface-2) 86%, var(--surface));
}

.task-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.complete-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 78px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 880;
  white-space: nowrap;
}

.complete-icon {
  display: grid;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  place-items: center;
  border-radius: 50%;
}

.complete-button svg {
  width: 15px;
  height: 15px;
}

.complete-button.is-active {
  background: var(--accent);
  color: #ffffff;
}

.task-copy {
  min-width: 0;
}

.task-title {
  margin: 0;
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 820;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.task-notes {
  display: -webkit-box;
  margin: 7px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.38;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.subtask-list {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.subtask-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.subtask-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.subtask-item.is-done span {
  text-decoration: line-through;
  opacity: 0.64;
}

.subtask-toggle {
  display: grid;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  padding: 0;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border));
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  color: var(--accent);
}

.subtask-toggle:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.subtask-toggle svg {
  width: 13px;
  height: 13px;
}

.task-menu {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
}

.task-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.mini-button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
}

.mini-button:hover {
  color: var(--text);
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.task-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  max-width: 100%;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 820;
  line-height: 1.1;
  overflow-wrap: anywhere;
  white-space: nowrap;
}

.tag-button {
  cursor: pointer;
}

.tag-button:hover {
  border-color: color-mix(in srgb, var(--focus) 42%, var(--border));
  color: var(--focus);
  background: color-mix(in srgb, var(--focus) 8%, var(--surface));
}

.tag-button.is-active {
  border-color: color-mix(in srgb, var(--focus) 54%, var(--border));
  background: color-mix(in srgb, var(--focus) 12%, var(--surface));
  color: var(--focus);
}

.tag-button:focus-visible {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent);
  outline: none;
}

.task-chip.priority-high {
  border-color: color-mix(in srgb, var(--high) 32%, var(--border));
  color: var(--high);
}

.task-chip.priority-medium {
  border-color: color-mix(in srgb, var(--medium) 32%, var(--border));
  color: var(--medium);
}

.task-chip.priority-low {
  border-color: color-mix(in srgb, var(--low) 32%, var(--border));
  color: var(--low);
}

.task-chip.status-done-chip {
  border-color: color-mix(in srgb, var(--done) 34%, var(--border));
  background: color-mix(in srgb, var(--done) 9%, var(--surface));
  color: var(--done);
}

.task-chip.due-overdue {
  border-color: color-mix(in srgb, var(--danger) 38%, var(--border));
  color: var(--danger);
}

.category-insight {
  display: grid;
  grid-template-columns: minmax(140px, 0.42fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--focus) 24%, var(--border));
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--focus) 8%, transparent), transparent),
    color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--soft-shadow);
}

.category-insight h2 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.category-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.category-stats span {
  min-height: 50px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 820;
}

.category-stats strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1;
}

.category-clear {
  min-width: 98px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.action-link {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 820;
}

.action-link:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 36%, var(--border));
}

.empty-state {
  display: grid;
  min-height: 170px;
  place-items: center;
  border: 1px dashed color-mix(in srgb, var(--column-color) 26%, var(--border));
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 780;
  text-align: center;
  padding: 18px;
}

.modal {
  width: min(680px, calc(100vw - 24px));
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
}

.modal::backdrop {
  background: rgba(8, 12, 10, 0.62);
  backdrop-filter: blur(6px);
}

.add-modal {
  width: min(620px, calc(100vw - 24px));
}

.modal-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-header,
.modal-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-header h2 {
  margin-top: 5px;
  font-size: 1.35rem;
}

.dialog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.stat-card {
  min-height: 96px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 820;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin-top: 12px;
  color: var(--ink);
  font-size: clamp(1.65rem, 3vw, 2.4rem);
  line-height: 1;
}

.review-panel.is-entering .stat-card,
.review-panel.is-entering .review-rhythm-panel {
  animation: stat-refresh 620ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: var(--stat-delay, 0ms);
}

.stats-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.chart-panel,
.analysis-panel {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.chart-panel h3 {
  margin: 6px 0 0;
  font-size: 1.06rem;
}

.chart-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.range-control {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.range-button {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 840;
  white-space: nowrap;
}

.range-button.is-active {
  background: var(--ink);
  color: var(--surface);
}

.custom-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.chart-pair {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.metric-chart {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding-top: 12px;
  border-top: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
}

.metric-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.metric-chart-header span,
.metric-chart-header strong {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1;
  text-transform: uppercase;
}

.metric-chart-header strong {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
}

.stats-bars {
  --bar-count: 7;
  display: grid;
  grid-template-columns: repeat(var(--bar-count), minmax(56px, 1fr));
  gap: 7px;
  align-items: end;
  min-height: 150px;
  margin-top: 0;
  overflow-x: auto;
  padding-bottom: 4px;
}

.bar-item {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 6px;
  align-items: end;
  min-width: 0;
  height: 150px;
}

.bar-count {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 820;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.bar-track {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: 100%;
  align-self: end;
  overflow: hidden;
  padding: 0 4px;
  border-bottom: 1px solid color-mix(in srgb, var(--muted) 24%, var(--border));
  border-radius: 0 0 4px 4px;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--surface-3) 54%, transparent));
}

.bar-fill {
  display: block;
  width: 100%;
  height: var(--bar-height, 0);
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--done), color-mix(in srgb, var(--long) 72%, var(--done)));
  box-shadow: 0 8px 16px color-mix(in srgb, var(--done) 14%, transparent);
  transform-origin: bottom;
  animation: bar-rise 760ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.count-bars .bar-fill {
  background: linear-gradient(180deg, var(--daily), color-mix(in srgb, var(--medium) 72%, var(--daily)));
  box-shadow: 0 8px 16px color-mix(in srgb, var(--daily) 16%, transparent);
}

.bar-label {
  display: grid;
  gap: 3px;
  min-width: 0;
  text-align: center;
}

.bar-label time {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 820;
  line-height: 1.1;
}

.bar-label small {
  color: color-mix(in srgb, var(--muted) 92%, var(--text));
  font-size: 0.62rem;
  font-weight: 760;
  line-height: 1.1;
}

.analysis-panel p {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

@keyframes bar-rise {
  from {
    transform: scaleY(0);
  }

  to {
    transform: scaleY(1);
  }
}

@keyframes stat-refresh {
  0% {
    transform: translateY(8px);
    filter: saturate(0.92);
    opacity: 0.72;
  }

  100% {
    transform: translateY(0);
    filter: saturate(1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ring,
  .bar-fill,
  .stat-card,
  .review-rhythm-panel,
  .task-card,
  .icon-button,
  .tiny-button,
  .column-add,
  .primary-button,
  .secondary-button,
  .danger-button {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  background: rgba(16, 23, 20, 0.92);
  color: #f8fbf3;
  box-shadow: var(--shadow);
}

.toast button {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.12);
  color: #f8fbf3;
  font-weight: 820;
}

@media (max-width: 1260px) {
  .task-form {
    grid-template-columns: minmax(260px, 1fr) minmax(174px, 220px) auto;
  }

  .filter-row {
    grid-template-columns: minmax(240px, 1fr) minmax(360px, 1fr);
  }

  .filter-selects {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .compact-field {
    grid-column: span 1;
  }

  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stats-layout {
    grid-template-columns: 1fr;
  }

  .board {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }
}

@media (max-width: 820px) {
  .app-shell {
    padding: 10px;
  }

  .hero {
    min-height: auto;
  }

  .topbar {
    min-height: 158px;
    padding: 14px;
  }

  .date-nav-main {
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 10px;
    padding-top: 34px;
  }

  .date-lockup {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .day-switch-prev,
  .day-switch-next {
    justify-self: stretch;
  }

  .day-switch-prev {
    grid-column: 1;
    grid-row: 2;
  }

  .day-switch-next {
    grid-column: 2;
    grid-row: 2;
  }

  .top-actions {
    top: 14px;
    right: 14px;
  }

  .account-email {
    display: none;
  }

  .task-form,
  .filter-row,
  .filter-selects,
  .category-insight,
  .review-panel,
  .board,
  .stats-grid,
  .custom-range,
  .dialog-grid {
    grid-template-columns: 1fr;
  }

  .category-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .progress-panel {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .ring {
    width: 106px;
    height: 106px;
  }

  .ring span {
    font-size: 1.72rem;
  }

  .modal-footer {
    display: grid;
  }

  .chart-heading {
    display: grid;
  }

  .range-control {
    width: 100%;
  }

  .range-button {
    flex: 1 1 0;
  }

  .stats-bars {
    min-height: 130px;
  }

  .bar-item {
    height: 130px;
  }

  .modal-footer > div,
  .modal-footer .danger-button {
    width: 100%;
  }

  .modal-footer > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .auth-gate {
    padding: 14px;
  }

  .auth-panel {
    padding: 24px;
  }

  .topbar {
    display: grid;
  }

  .top-actions {
    justify-content: end;
  }

  .date-nav-main {
    grid-template-columns: 1fr;
  }

  .day-switch-prev,
  .day-switch-next,
  .date-lockup {
    grid-column: 1;
  }

  .day-switch-prev {
    grid-row: 2;
  }

  .day-switch-next {
    grid-row: 3;
  }

  .date-lockup h1 {
    font-size: 1.75rem;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .task-topline {
    grid-template-columns: 1fr;
  }

  .complete-button {
    width: 100%;
  }

  .task-footer {
    display: grid;
  }

  .task-menu {
    justify-content: start;
  }

  .category-stats {
    grid-template-columns: 1fr;
  }

  .category-clear {
    width: 100%;
  }
}
