/* ==========================================================================
   个人时间手账
   A quiet, local-first place for time and small daily goals.
   ========================================================================== */

:root {
  --bg: #f4f8f5;
  --ink: #20372f;
  --ink-soft: #3c544a;
  --muted: #6c8178;
  --faint: #95a79f;
  --line: #e4ede8;
  --line-strong: #d5e4dc;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --surface-soft: #f8fbf9;
  --accent: #2f7d6b;
  --accent-deep: #245f51;
  --accent-soft: #eaf5ef;
  --accent-wash: #f2f9f5;
  --peach: #e5b38c;
  --danger: #a85249;
  --danger-soft: #fcf0ee;
  --shadow-card: 0 22px 55px -40px rgba(31, 71, 58, 0.42), 0 2px 8px rgba(31, 55, 47, 0.025);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-sans: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(980px 680px at 4% -10%, rgba(196, 229, 213, 0.68), transparent 62%),
    radial-gradient(820px 560px at 104% -4%, rgba(247, 225, 202, 0.56), transparent 58%),
    radial-gradient(760px 620px at 52% 112%, rgba(207, 228, 217, 0.42), transparent 68%),
    linear-gradient(180deg, #f6faf7 0%, #f2f7f4 100%);
  background-attachment: fixed;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image: radial-gradient(rgba(69, 109, 94, 0.13) 0.6px, transparent 0.6px);
  background-size: 18px 18px;
  opacity: 0.22;
  content: "";
  pointer-events: none;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent 55%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent 55%);
}

::selection {
  color: #173a2e;
  background: #cfe9de;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button,
input {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

button:focus-visible,
a:focus-visible,
label:focus-visible {
  outline: 2px solid #5e9f8d;
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 14px;
  left: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  color: #fff;
  background: var(--accent-deep);
  font-size: 12px;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.page {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 24px 32px 34px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 3px 2px 24px;
}

.topbar-tools {
  display: flex;
  flex: none;
  align-items: center;
  gap: 13px;
}

.save-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid rgba(220, 234, 226, 0.86);
  border-radius: 999px;
  color: #7a8e85;
  background: rgba(255, 255, 255, 0.48);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.status-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: #68aa8e;
  box-shadow: 0 0 0 3px rgba(104, 170, 142, 0.12);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.save-status.is-warning {
  color: #946e45;
  border-color: #ecdfcb;
  background: rgba(255, 250, 243, 0.8);
}

.save-status.is-warning .status-dot {
  background: #d29c61;
  box-shadow: 0 0 0 3px rgba(210, 156, 97, 0.14);
}

.tool-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(218, 231, 224, 0.92);
  border-radius: 11px;
  color: #647d73;
  background: rgba(255, 255, 255, 0.56);
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s var(--ease-out);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.icon-button:hover {
  border-color: #c2dcd1;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.94);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Hero and date controls
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 8px 4px 30px;
}

.hero-copy {
  min-width: 0;
  animation: fade-up 0.55s var(--ease-out) both;
}

.eyebrow {
  display: block;
  color: #82988e;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.19em;
  line-height: 1.3;
}

.hero-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 11px;
}

.hero h1 {
  margin: 0;
  color: #1d352d;
  font-size: clamp(38px, 4.35vw, 52px);
  font-weight: 650;
  letter-spacing: -0.055em;
  line-height: 1.08;
}

.weekday {
  padding: 4px 8px;
  border: 1px solid rgba(224, 236, 230, 0.88);
  border-radius: 7px;
  color: #688177;
  background: rgba(255, 255, 255, 0.48);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
}

.today-badge {
  padding: 4px 7px;
  border-radius: 6px;
  color: #f7fbf9;
  background: var(--accent);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  line-height: 1.4;
}

.hero-summary {
  max-width: 620px;
  margin: 13px 0 0;
  color: #6d8379;
  font-size: 13px;
  line-height: 1.75;
}

.hero-side {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  padding-bottom: 3px;
  animation: fade-up 0.55s 0.06s var(--ease-out) both;
}

.date-tools {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
}

.date-controls {
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 5px;
  border: 1px solid rgba(225, 237, 231, 0.94);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 14px 35px -30px rgba(35, 74, 61, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.arrow-button {
  display: grid;
  width: 33px;
  height: 33px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 9px;
  color: #6d857c;
  background: transparent;
  transition: color 0.18s ease, background 0.18s ease;
}

.arrow-button svg {
  width: 17px;
  height: 17px;
}

.arrow-button:hover {
  color: var(--accent);
  background: #eef7f2;
}

.date-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 33px;
  padding: 0 9px;
  border: 0;
  border-radius: 9px;
  color: #3c5c50;
  background: transparent;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.date-button:hover,
.date-button[aria-expanded="true"] {
  color: var(--accent-deep);
  background: #edf7f2;
}

.calendar-icon {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--accent);
}

.date-chevron {
  width: 13px;
  height: 13px;
  flex: none;
  color: #93a79e;
  transition: color 0.18s ease, transform 0.2s var(--ease-out);
}

.date-button:hover .date-chevron,
.date-button[aria-expanded="true"] .date-chevron {
  color: var(--accent);
}

.date-button[aria-expanded="true"] .date-chevron {
  transform: rotate(180deg);
}

.date-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 9px);
  right: 0;
  width: 302px;
  max-width: calc(100vw - 28px);
  padding: 16px;
  border: 1px solid #deece5;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 28px 60px -30px rgba(27, 65, 53, 0.42), 0 8px 24px -20px rgba(27, 65, 53, 0.22);
  animation: calendar-in 0.18s var(--ease-out) both;
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 11px;
}

.calendar-title {
  color: #2d4d41;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.calendar-nav-button {
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: #71897f;
  background: transparent;
  transition: color 0.18s ease, background 0.18s ease;
}

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

.calendar-nav-button:hover {
  color: var(--accent);
  background: #eef7f2;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  margin-bottom: 4px;
}

.calendar-weekdays span {
  height: 22px;
  color: #9aaca4;
  font-size: 9px;
  font-weight: 600;
  line-height: 22px;
  text-align: center;
}

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

.calendar-day {
  position: relative;
  display: grid;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 9px;
  color: #405b50;
  background: transparent;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.calendar-day:hover {
  color: var(--accent);
  background: #eef8f3;
}

.calendar-day.is-outside {
  color: #bac8c2;
  font-weight: 400;
}

.calendar-day.is-today {
  color: var(--accent-deep);
  font-weight: 650;
}

.calendar-day.is-today::after {
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
  transform: translateX(-50%);
}

.calendar-day.is-selected {
  color: #f8fcf9;
  background: var(--accent);
  box-shadow: 0 6px 13px -9px rgba(36, 102, 84, 0.75);
  font-weight: 650;
}

.calendar-day.is-selected:hover {
  background: var(--accent-deep);
}

.calendar-day.is-selected::after {
  display: none;
}

.calendar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px dashed #e4eee8;
}

.calendar-hint {
  color: #9aaba3;
  font-size: 9px;
  line-height: 1.5;
}

.calendar-quick-actions {
  display: flex;
  flex: none;
  gap: 4px;
}

.calendar-quick-button {
  padding: 5px 7px;
  border: 1px solid #e4eee8;
  border-radius: 7px;
  color: #6a8378;
  background: #f8fbf9;
  font-family: inherit;
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.2;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.calendar-quick-button:hover {
  border-color: #c9ddd3;
  color: var(--accent);
  background: #f0f8f4;
}

.calendar-quick-button[data-quick-offset="0"] {
  border-color: #d7ebe1;
  color: var(--accent);
  background: #eef8f3;
}

.today-button {
  padding: 4px 6px;
  border: 0;
  border-bottom: 1px dashed #aecbbe;
  border-radius: 4px;
  color: var(--accent);
  background: transparent;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.5;
  transition: color 0.18s ease, background 0.18s ease;
}

.today-button:hover {
  color: var(--accent-deep);
  background: rgba(255, 255, 255, 0.55);
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.56fr) minmax(335px, 0.9fr);
  align-items: start;
  gap: 24px;
}

.main-column,
.side-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.card {
  position: relative;
  overflow: hidden;
  padding: 26px;
  border: 1px solid rgba(225, 236, 230, 0.9);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  animation: fade-up 0.55s var(--ease-out) both;
}

.card::before {
  position: absolute;
  z-index: 0;
  top: -110px;
  right: -90px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(190, 226, 210, 0.2), transparent 68%);
  content: "";
  pointer-events: none;
}

.card > * {
  position: relative;
  z-index: 1;
}

.log-card {
  scroll-margin-top: 18px;
  animation-delay: 0.08s;
}

.tasks-card {
  background: linear-gradient(152deg, rgba(255, 255, 255, 0.94) 0%, rgba(247, 252, 249, 0.89) 100%);
  animation-delay: 0.13s;
}

.distribution-card {
  animation-delay: 0.18s;
}

.week-card {
  margin-top: 24px;
  animation-delay: 0.16s;
}

.distribution-card::before {
  top: auto;
  right: -80px;
  bottom: -100px;
  background: radial-gradient(circle, rgba(241, 213, 183, 0.2), transparent 68%);
}

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

.card-heading h2 {
  margin: 6px 0 0;
  color: #27443a;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.35;
}

.soft-badge {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid #dcece4;
  border-radius: 999px;
  color: #4e7f70;
  background: #eef7f2;
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
  line-height: 1.4;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.soft-badge--plain {
  color: #7a8e85;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.5);
}

.log-card.is-editing .soft-badge {
  color: #f8fcfa;
  border-color: var(--accent);
  background: var(--accent);
}

/* --------------------------------------------------------------------------
   Time entry form
   -------------------------------------------------------------------------- */

.record-form {
  margin-top: 21px;
  padding: 18px;
  border: 1px solid #e6f0ea;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #f9fcfa 0%, #f6faf8 100%);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.log-card.is-editing .record-form {
  border-color: #b9dacb;
  background: linear-gradient(180deg, #f6fcf8 0%, #f1f9f5 100%);
  box-shadow: inset 0 0 0 3px rgba(47, 125, 107, 0.035);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field label,
.category-fieldset legend {
  padding: 0;
  color: #6c8379;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.065em;
  line-height: 1.4;
}

.field label span {
  margin-left: 2px;
  color: #9aaba3;
  font-weight: 400;
  letter-spacing: 0;
}

.field input {
  width: 100%;
  height: 45px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: none;
  color: #304a40;
  background: #fff;
  font-size: 13.5px;
  font-weight: 450;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.field input::placeholder {
  color: #a6b7af;
}

.field input:hover {
  border-color: #c5d9d0;
}

.field input:focus {
  border-color: #83b8a7;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(47, 125, 107, 0.085);
}

.field--title input {
  height: 49px;
  padding: 0 14px;
  font-size: 14px;
}

.form-time-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 13px minmax(110px, 1fr) minmax(130px, 0.8fr);
  align-items: end;
  gap: 9px;
  margin-top: 13px;
}

.field--time input {
  padding: 0 10px;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.time-separator {
  padding-bottom: 15px;
  color: #a4b5ad;
  font-size: 11px;
  text-align: center;
}

.duration-hint {
  display: flex;
  height: 45px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 0 11px;
  border: 1px solid #e2efe8;
  border-radius: 11px;
  background: #eef7f2;
  line-height: 1.2;
  transition: background 0.2s ease;
}

.duration-hint span {
  color: #8aa097;
  font-size: 8.5px;
  font-weight: 650;
  letter-spacing: 0.09em;
}

.duration-hint strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: #3c7463;
  font-size: 11.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.duration-hint.is-overnight strong {
  color: #9a703f;
}

.category-fieldset {
  min-width: 0;
  margin: 14px 0 0;
  padding: 0;
  border: 0;
}

.category-fieldset legend {
  margin-bottom: 7px;
}

.category-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.category-chip {
  --cat-color: #4b8b7a;
  --cat-rgb: 75, 139, 122;
  --cat-ink: #34705f;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 31px;
  padding: 6px 10px;
  border: 1px solid #e2ebe6;
  border-radius: 999px;
  color: #687e74;
  background: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease, transform 0.18s var(--ease-out);
}

.category-chip:hover {
  border-color: rgba(var(--cat-rgb), 0.42);
  color: var(--cat-ink);
  background: rgba(var(--cat-rgb), 0.055);
  transform: translateY(-1px);
}

.category-chip[aria-pressed="true"] {
  border-color: rgba(var(--cat-rgb), 0.56);
  color: var(--cat-ink);
  background: rgba(var(--cat-rgb), 0.11);
  font-weight: 650;
  box-shadow: inset 0 0 0 1px rgba(var(--cat-rgb), 0.05);
}

.category-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--cat-color);
  transition: box-shadow 0.18s ease;
}

.category-chip[aria-pressed="true"] .category-dot {
  box-shadow: 0 0 0 3px rgba(var(--cat-rgb), 0.15);
}

.form-bottom {
  display: flex;
  align-items: flex-end;
  gap: 11px;
  margin-top: 14px;
}

.field--note {
  flex: 1;
}

.form-actions {
  display: flex;
  flex: none;
  gap: 7px;
}

.button {
  display: inline-flex;
  height: 45px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s var(--ease-out);
}

.button--primary {
  color: #f8fcf9;
  background: linear-gradient(135deg, #36836f 0%, #2a6858 100%);
  box-shadow: 0 10px 20px -12px rgba(35, 94, 78, 0.6);
}

.button--primary:hover {
  box-shadow: 0 14px 24px -13px rgba(35, 94, 78, 0.68);
  transform: translateY(-1px);
}

.button--primary:active {
  box-shadow: 0 5px 12px -10px rgba(35, 94, 78, 0.65);
  transform: translateY(0);
}

.button--ghost {
  border-color: var(--line-strong);
  color: #71847b;
  background: rgba(255, 255, 255, 0.7);
}

.button--ghost:hover {
  border-color: #bed6cb;
  color: var(--accent);
  background: #fff;
}

.button-icon {
  width: 15px;
  height: 15px;
}

.form-error {
  margin: 11px 0 0;
  padding: 8px 10px;
  border: 1px solid #f4ded9;
  border-radius: 9px;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 10.5px;
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
   Time axis
   -------------------------------------------------------------------------- */

.records-section {
  margin-top: 25px;
  padding-top: 21px;
  border-top: 1px dashed #dce9e2;
}

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

.section-heading-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.section-heading h3 {
  margin: 0;
  color: #355146;
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.record-count {
  flex: none;
  padding: 3px 7px;
  border: 1px solid #e4eee8;
  border-radius: 999px;
  color: #80938b;
  background: #f2f8f5;
  font-size: 9px;
  font-weight: 500;
  line-height: 1.4;
}

.record-total {
  flex: none;
  color: #8c9e96;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.records-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 15px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 47px 14px minmax(0, 1fr);
  gap: 9px;
}

.timeline-time {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  padding-top: 11px;
  color: #3e5d50;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.timeline-time span:last-child {
  color: #95a69f;
  font-size: 10px;
  font-weight: 500;
}

.timeline-rail {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 16px;
}

.timeline-dot {
  z-index: 1;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cat-color);
  box-shadow: 0 0 0 4px #fbfdfc;
}

.timeline-item:not(:last-child) .timeline-rail::after {
  position: absolute;
  top: 25px;
  bottom: -10px;
  left: 50%;
  width: 1px;
  background: linear-gradient(to bottom, #dce9e3, #eef5f1);
  content: "";
  transform: translateX(-0.5px);
}

.timeline-card {
  position: relative;
  min-width: 0;
  padding: 11px 12px 11px 14px;
  border: 1px solid #edf3f0;
  border-radius: 14px;
  background: #fbfdfc;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s var(--ease-out);
}

.timeline-card::before {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 2px;
  border-radius: 2px;
  background: var(--cat-color);
  content: "";
  opacity: 0.58;
}

.timeline-card:hover {
  border-color: #e2ede7;
  background: #f8fcf9;
  transform: translateX(2px);
}

.timeline-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.timeline-card h4 {
  margin: 0;
  color: #2e473d;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.record-actions {
  display: flex;
  flex: none;
  gap: 1px;
  margin: -3px -4px 0 0;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.timeline-item:hover .record-actions,
.record-actions:focus-within {
  opacity: 1;
  transform: translateY(0);
}

.record-action {
  display: grid;
  width: 25px;
  height: 25px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: #93a59d;
  background: transparent;
  transition: color 0.16s ease, background 0.16s ease;
}

.record-action svg {
  width: 13px;
  height: 13px;
}

.record-action:hover {
  color: #3f7263;
  background: #eaf3ee;
}

.record-action--delete:hover {
  color: #ad5c51;
  background: #fcefec;
}

.timeline-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 6px;
  color: #889b93;
  font-size: 10.5px;
  line-height: 1.5;
}

.category-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--cat-ink);
  background: rgba(var(--cat-rgb), 0.1);
  font-size: 9px;
  font-weight: 650;
  line-height: 1.4;
}

.category-tag i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cat-color);
}

.duration-text {
  color: #70877d;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.record-note {
  min-width: 0;
  margin: 0;
  color: #8b9d95;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.record-note::before {
  margin-right: 4px;
  color: #b6c4bd;
  content: "·";
}

/* --------------------------------------------------------------------------
   Empty states
   -------------------------------------------------------------------------- */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  margin-top: 15px;
  padding: 29px 20px 27px;
  border: 1px dashed #dce9e2;
  border-radius: 17px;
  background: linear-gradient(180deg, rgba(248, 252, 250, 0.8), rgba(255, 255, 255, 0.46));
  text-align: center;
}

.empty-illustration {
  color: #9cc4b5;
}

.empty-illustration svg {
  width: 60px;
  height: 60px;
}

.empty-copy strong {
  display: block;
  color: #455f54;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
}

.empty-copy span {
  display: block;
  margin-top: 4px;
  color: #94a69e;
  font-size: 10px;
  line-height: 1.65;
}

.empty-state--tasks {
  flex-direction: row;
  gap: 10px;
  margin-top: 14px;
  padding: 15px 14px;
  border-radius: 14px;
  text-align: left;
}

.empty-illustration--check svg {
  width: 46px;
  height: 46px;
}

.empty-state--tasks .empty-copy strong {
  font-size: 11px;
}

.empty-state--tasks .empty-copy span {
  margin-top: 2px;
  font-size: 9.5px;
}

/* --------------------------------------------------------------------------
   Daily goals
   -------------------------------------------------------------------------- */

.count-badge {
  flex: none;
  padding: 5px 8px;
  border: 1px solid #dcece4;
  border-radius: 8px;
  color: var(--accent);
  background: #eef7f2;
  font-size: 10px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  line-height: 1.4;
}

.task-progress {
  margin-top: 18px;
}

.progress-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 9px;
  color: #7c9188;
  font-size: 10.5px;
  line-height: 1.5;
}

.progress-copy span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#taskProgressPercent {
  flex: none;
  color: #4a7d6d;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 6px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf3f0;
  box-shadow: inset 0 1px 2px rgba(40, 78, 64, 0.035);
}

#taskProgressFill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #9ccfbe 0%, #5a9f8a 100%);
  transition: width 0.42s var(--ease-out);
}

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

.task-form input {
  width: 100%;
  height: 43px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid #e1ebe6;
  border-radius: 12px;
  outline: none;
  color: #334c42;
  background: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.task-form input::placeholder {
  color: #a5b6ae;
}

.task-form input:hover {
  border-color: #cdded6;
}

.task-form input:focus {
  border-color: #85b9a8;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(47, 125, 107, 0.08);
}

.task-add-button {
  display: grid;
  width: 43px;
  height: 43px;
  flex: none;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 12px;
  color: #f7fcfa;
  background: linear-gradient(140deg, #3c8874, #2b6c5c);
  box-shadow: 0 8px 16px -10px rgba(36, 96, 80, 0.65);
  transition: box-shadow 0.18s ease, transform 0.18s var(--ease-out);
}

.task-add-button svg {
  width: 18px;
  height: 18px;
}

.task-add-button:hover {
  box-shadow: 0 11px 20px -11px rgba(36, 96, 80, 0.7);
  transform: translateY(-1px);
}

.task-error {
  margin-top: 8px;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 13px 0 0;
  padding: 0;
  list-style: none;
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  padding: 9px 7px 9px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  transition: background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.task-item:hover {
  border-color: #edf4f0;
  background: #f7faf8;
}

.task-main {
  position: relative;
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: flex-start;
  gap: 9px;
  padding: 1px 0;
  cursor: pointer;
}

.task-checkbox {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

.task-box {
  display: grid;
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 1px;
  place-items: center;
  border: 1.5px solid #c9dad2;
  border-radius: 6px;
  background: #fff;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s var(--ease-out);
}

.task-box svg {
  width: 11px;
  height: 11px;
  color: #fff;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.16s ease, transform 0.18s var(--ease-out);
}

.task-main:hover .task-box {
  border-color: #9ec3b4;
}

.task-checkbox:checked + .task-box {
  border-color: #4f947f;
  background: #4f947f;
  transform: scale(0.96);
}

.task-checkbox:checked + .task-box svg {
  opacity: 1;
  transform: scale(1);
}

.task-checkbox:focus-visible + .task-box {
  outline: 2px solid #65a490;
  outline-offset: 2px;
}

.task-title {
  color: #3b5148;
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  transition: color 0.18s ease;
}

.task-item.is-done {
  opacity: 0.6;
}

.task-item.is-done .task-title {
  color: #7d9188;
  text-decoration: line-through;
  text-decoration-color: #9fb6ac;
}

.task-delete {
  display: grid;
  width: 25px;
  height: 25px;
  flex: none;
  margin-top: -1px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: #97a8a1;
  background: transparent;
  opacity: 0;
  transition: color 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}

.task-delete svg {
  width: 13px;
  height: 13px;
}

.task-item:hover .task-delete,
.task-delete:focus-visible {
  opacity: 1;
}

.task-delete:hover {
  color: #ad5b50;
  background: #fcefec;
}

.tasks-card.is-complete .count-badge {
  border-color: #cfe7dc;
  color: #35725f;
  background: #e6f4ed;
}

.tasks-card.is-complete .progress-track {
  background: #e4f2eb;
}

.task-footer {
  display: flex;
  min-height: 29px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 11px;
  border-top: 1px dashed #e7efea;
}

#taskFooterHint {
  color: #9aaba3;
  font-size: 9.5px;
  line-height: 1.5;
}

.link-button {
  padding: 3px 0;
  border: 0;
  color: #79948a;
  background: transparent;
  font-size: 9.5px;
  line-height: 1.5;
  text-decoration: underline;
  text-decoration-color: #c8d9d1;
  text-underline-offset: 3px;
  transition: color 0.16s ease, text-decoration-color 0.16s ease;
}

.link-button:hover {
  color: var(--accent);
  text-decoration-color: #83b5a4;
}

/* --------------------------------------------------------------------------
   Time distribution
   -------------------------------------------------------------------------- */

.distribution-body {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-top: 17px;
}

.donut-wrap {
  display: flex;
  min-width: 0;
  justify-content: center;
}

.donut {
  position: relative;
  width: 148px;
  height: 148px;
  flex: none;
}

.donut > svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut-track,
.donut-segment {
  fill: none;
  stroke-width: 13;
}

.donut-track {
  stroke: #edf3ef;
}

.donut-segment {
  transition: stroke-dasharray 0.45s var(--ease-out), opacity 0.2s ease;
}

.donut-center {
  position: absolute;
  inset: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 50%;
  text-align: center;
}

.donut-center strong {
  color: #2f5145;
  font-size: 21px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.donut-center span {
  color: #9aaba3;
  font-size: 8.5px;
  letter-spacing: 0.08em;
}

.category-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.legend-item {
  display: grid;
  grid-template-columns: 6px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-width: 0;
  color: #6d8379;
  font-size: 10.5px;
  line-height: 1.4;
}

.legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cat-color);
}

.legend-copy {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.legend-name {
  overflow: hidden;
  color: #5f776c;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-value {
  flex: none;
  color: #91a29a;
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.legend-empty {
  color: #9aaba3;
  font-size: 9.5px;
  line-height: 1.7;
}

.insight {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 17px;
  padding: 10px 11px;
  border: 1px solid #e8f1ec;
  border-radius: 11px;
  background: #f5faf7;
}

.insight-mark {
  flex: none;
  color: #80b09f;
  font-size: 10px;
  line-height: 1.7;
}

.insight p {
  margin: 0;
  color: #72877e;
  font-size: 10.5px;
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   Weekly rhythm
   -------------------------------------------------------------------------- */

.week-summary {
  padding-top: 3px;
  color: #84978e;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  line-height: 1.65;
  text-align: right;
}

.week-summary strong {
  color: #4d7364;
  font-weight: 650;
}

.week-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.week-day {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 2px;
  border: 0;
  border-radius: 11px;
  color: inherit;
  background: transparent;
  transition: transform 0.2s var(--ease-out);
}

.week-day:hover {
  transform: translateY(-2px);
}

.week-hours {
  height: 15px;
  color: #97a8a0;
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  line-height: 15px;
  transition: color 0.18s ease;
}

.week-bar-wrap {
  display: flex;
  width: 100%;
  max-width: 68px;
  height: 120px;
  align-items: flex-end;
  padding: 3px;
  border: 1px solid #edf4f0;
  border-radius: 11px 11px 5px 5px;
  background: linear-gradient(180deg, #f5faf7, #f9fcfb);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.week-bar {
  display: block;
  width: 100%;
  min-height: 4px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #cde7dc, #e5f2ed);
  transition: background 0.2s ease, height 0.35s var(--ease-out);
}

.week-bar.is-empty {
  min-height: 3px;
  background: #e3eee9;
  opacity: 0.7;
}

.week-day:hover .week-bar-wrap {
  border-color: #dcece4;
  background: linear-gradient(180deg, #f2f9f5, #f8fcfa);
}

.week-day:hover .week-bar {
  background: linear-gradient(180deg, #b8dbcd, #dceee7);
}

.week-day.is-active .week-bar {
  background: linear-gradient(180deg, #74b19e, #3f8672);
  box-shadow: 0 5px 10px -7px rgba(49, 114, 94, 0.45);
}

.week-day.is-active .week-bar-wrap {
  border-color: #d7e9e1;
  background: #f3faf6;
}

.week-day.is-active .week-hours {
  color: #407a69;
  font-weight: 650;
}

.week-label {
  color: #7e938a;
  font-size: 10px;
  line-height: 1.4;
  white-space: nowrap;
}

.week-date {
  color: #a5b4ad;
  font-size: 8.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.week-day.is-active .week-label,
.week-day.is-active .week-date {
  color: #3b7665;
  font-weight: 650;
}

.week-hint {
  margin: 9px 0 0;
  color: #a1b0a9;
  font-size: 9px;
  line-height: 1.5;
  text-align: right;
}

/* --------------------------------------------------------------------------
   Footer, toast, noscript
   -------------------------------------------------------------------------- */

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 27px 4px 4px;
  color: #98a9a1;
  font-size: 9.5px;
  line-height: 1.6;
}

.footer p {
  margin: 0;
}

.footer p:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #a7c8b9;
}

.toast {
  position: fixed;
  z-index: 50;
  bottom: 26px;
  left: 50%;
  display: flex;
  max-width: min(90vw, 430px);
  align-items: center;
  gap: 16px;
  padding: 11px 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #f2f8f5;
  background: rgba(31, 54, 46, 0.94);
  box-shadow: 0 18px 40px -20px rgba(24, 54, 43, 0.55);
  font-size: 11.5px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.22s ease, transform 0.28s var(--ease-out);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.toast.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.toast.is-error {
  background: rgba(87, 50, 44, 0.95);
}

.toast-action {
  flex: none;
  padding: 3px 0;
  border: 0;
  color: #a9dfca;
  background: transparent;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.toast-action:hover {
  color: #d4f5e8;
}

.noscript {
  position: fixed;
  z-index: 60;
  right: 16px;
  bottom: 16px;
  left: 16px;
  margin: 0 auto;
  padding: 12px 16px;
  border-radius: 12px;
  color: #713f37;
  background: #fdf1ed;
  font-size: 12px;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(11px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes calendar-in {
  from {
    opacity: 0;
    transform: translateY(-5px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .page {
    padding-right: 24px;
    padding-left: 24px;
  }

  .dashboard {
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.92fr);
    gap: 20px;
  }

  .main-column,
  .side-column {
    gap: 20px;
  }

  .card {
    padding: 23px;
  }

  .form-time-row {
    grid-template-columns: minmax(100px, 1fr) 11px minmax(100px, 1fr) minmax(120px, 0.8fr);
    gap: 8px;
  }

  .distribution-body {
    grid-template-columns: 136px minmax(0, 1fr);
    gap: 14px;
  }

  .donut {
    width: 136px;
    height: 136px;
  }

  .donut-center {
    inset: 28px;
  }
}

@media (max-width: 960px) {
  .dashboard {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .main-column,
  .side-column {
    display: contents;
  }

  .log-card {
    order: 1;
  }

  .tasks-card {
    order: 2;
  }

  .distribution-card {
    order: 3;
  }

  .week-card {
    order: 4;
  }

  .card {
    padding: 26px;
  }

  .form-time-row {
    grid-template-columns: minmax(120px, 1fr) 13px minmax(120px, 1fr) minmax(140px, 0.8fr);
    gap: 10px;
  }

  .distribution-body {
    grid-template-columns: 168px minmax(0, 1fr);
    gap: 26px;
  }

  .donut {
    width: 152px;
    height: 152px;
  }

  .donut-center {
    inset: 31px;
  }

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

  .week-chart {
    gap: 16px;
  }

  .week-bar-wrap {
    max-width: 74px;
    height: 118px;
  }

  .week-hours {
    font-size: 9.5px;
  }

  .week-label {
    font-size: 10.5px;
  }

  .week-date {
    font-size: 9px;
  }
}

@media (max-width: 720px) {
  .page {
    padding: 18px 18px 27px;
  }

  .topbar {
    padding-bottom: 21px;
  }

  .topbar-tools {
    gap: 9px;
  }

  .save-status {
    padding: 6px 8px;
    font-size: 9.5px;
  }

  .icon-button {
    width: 35px;
    height: 35px;
    border-radius: 10px;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 19px;
    padding: 10px 2px 24px;
  }

  .hero h1 {
    font-size: clamp(34px, 9vw, 43px);
  }

  .hero-summary {
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.7;
  }

  .hero-side {
    align-items: flex-start;
    padding-bottom: 0;
  }

  .date-controls {
    border-radius: 14px;
  }

  .date-button {
    height: 32px;
    font-size: 11px;
  }

  .arrow-button {
    width: 32px;
    height: 32px;
  }

  .date-tools {
    flex-wrap: wrap;
  }

  .date-popover {
    top: calc(100% + 8px);
    right: auto;
    left: 0;
  }

  .card {
    padding: 20px;
    border-radius: 23px;
  }

  .card-heading h2 {
    font-size: 18px;
  }

  .record-form {
    padding: 15px;
    border-radius: 17px;
  }

  .field--title input {
    height: 47px;
  }

  .form-time-row {
    grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr);
    gap: 8px;
  }

  .duration-hint {
    grid-column: 1 / -1;
    height: 36px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    padding: 0 11px;
  }

  .duration-hint span {
    font-size: 8.5px;
  }

  .form-bottom {
    flex-direction: column;
    align-items: stretch;
  }

  .form-actions {
    justify-content: flex-end;
    margin-top: 1px;
  }

  .button {
    height: 43px;
    padding: 0 15px;
  }

  .category-chip {
    min-height: 30px;
    padding: 6px 9px;
  }

  .timeline-item {
    grid-template-columns: 42px 13px minmax(0, 1fr);
    gap: 7px;
  }

  .timeline-time {
    font-size: 11px;
  }

  .timeline-time span:last-child {
    font-size: 10px;
  }

  .timeline-card {
    padding: 10px 11px 10px 13px;
  }

  .timeline-card h4 {
    font-size: 12.5px;
  }

  .record-actions {
    opacity: 1;
    transform: none;
  }

  .record-action {
    width: 24px;
    height: 24px;
  }

  .record-note {
    flex-basis: 100%;
  }

  .task-delete {
    opacity: 0.65;
  }

  .empty-state {
    padding: 24px 16px 22px;
  }

  .empty-illustration svg {
    width: 52px;
    height: 52px;
  }

  .task-list {
    gap: 3px;
  }

  .task-form input {
    height: 42px;
  }

  .task-add-button {
    width: 42px;
    height: 42px;
  }

  .distribution-body {
    grid-template-columns: 142px minmax(0, 1fr);
    gap: 18px;
  }

  .donut {
    width: 142px;
    height: 142px;
  }

  .donut-center {
    inset: 29px;
  }

  .donut-center strong {
    font-size: 19px;
  }

  .category-legend {
    display: flex;
    gap: 8px;
  }

  .week-chart {
    gap: 5px;
    margin-top: 16px;
  }

  .week-bar-wrap {
    max-width: none;
    height: 88px;
    padding: 2px;
    border-radius: 8px 8px 4px 4px;
  }

  .week-bar {
    border-radius: 5px 5px 2px 2px;
  }

  .week-hours {
    font-size: 8px;
  }

  .week-day {
    gap: 5px;
    padding: 0;
  }

  .week-label {
    font-size: 9px;
  }

  .week-date {
    font-size: 8px;
  }

  .week-summary {
    max-width: 140px;
    font-size: 9px;
  }

  .footer {
    flex-direction: column;
    gap: 5px;
    padding-top: 22px;
    font-size: 9px;
    text-align: center;
  }

  .toast {
    bottom: 16px;
    max-width: calc(100vw - 32px);
    padding: 10px 13px;
    font-size: 11px;
  }
}

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

  .topbar {
    padding-bottom: 18px;
  }

  .topbar-tools {
    gap: 6px;
  }

  .save-status {
    height: 27px;
    gap: 6px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 9px;
  }

  .status-dot {
    width: 5px;
    height: 5px;
  }

  .tool-group {
    gap: 4px;
  }

  .icon-button {
    width: 33px;
    height: 33px;
    border-radius: 9px;
  }

  .icon-button svg {
    width: 16px;
    height: 16px;
  }

  .hero {
    gap: 16px;
    padding-top: 7px;
  }

  .hero-title-row {
    gap: 8px;
  }

  .hero h1 {
    font-size: clamp(32px, 10vw, 38px);
  }

  .weekday {
    padding: 3px 7px;
    font-size: 10px;
  }

  .today-badge {
    padding: 3px 6px;
    font-size: 9px;
  }

  .date-button {
    gap: 6px;
    padding: 0 7px;
    font-size: 10.5px;
  }

  .calendar-icon {
    width: 14px;
    height: 14px;
  }

  .date-chevron {
    width: 12px;
    height: 12px;
  }

  .date-popover {
    width: min(302px, calc(100vw - 28px));
    padding: 14px;
    border-radius: 17px;
  }

  .calendar-day {
    height: 33px;
    font-size: 11px;
  }

  .calendar-footer {
    flex-wrap: wrap;
  }

  .calendar-hint {
    font-size: 8.5px;
  }

  .calendar-quick-button {
    padding: 5px 6px;
    font-size: 9px;
  }

  .arrow-button {
    width: 30px;
    height: 30px;
  }

  .card {
    padding: 18px 16px;
    border-radius: 21px;
  }

  .card-heading {
    gap: 9px;
  }

  .card-heading h2 {
    font-size: 17px;
  }

  .eyebrow {
    font-size: 8.5px;
    letter-spacing: 0.17em;
  }

  .soft-badge {
    padding: 5px 8px;
    font-size: 8.5px;
  }

  .record-form {
    margin-top: 17px;
    padding: 13px;
  }

  .field input {
    height: 43px;
    font-size: 13px;
  }

  .field--title input {
    height: 46px;
    font-size: 13.5px;
  }

  .form-time-row {
    margin-top: 11px;
  }

  .field--time input {
    padding: 0 8px;
    font-size: 12px;
  }

  .time-separator {
    padding-bottom: 14px;
    font-size: 10px;
  }

  .category-fieldset {
    margin-top: 12px;
  }

  .category-picker {
    gap: 5px;
  }

  .category-chip {
    gap: 5px;
    min-height: 29px;
    padding: 5px 8px;
    font-size: 10.5px;
  }

  .category-dot {
    width: 5px;
    height: 5px;
  }

  .button {
    height: 42px;
    font-size: 11.5px;
  }

  .form-actions .button--primary {
    flex: 1;
  }

  .records-section {
    margin-top: 20px;
    padding-top: 18px;
  }

  .section-heading-main {
    gap: 7px;
  }

  .section-heading h3 {
    font-size: 12.5px;
  }

  .record-total {
    font-size: 9px;
  }

  .timeline-item {
    grid-template-columns: 39px 11px minmax(0, 1fr);
    gap: 6px;
  }

  .timeline-rail {
    padding-top: 15px;
  }

  .timeline-card {
    padding: 9px 9px 9px 12px;
    border-radius: 12px;
  }

  .timeline-card h4 {
    font-size: 12.5px;
  }

  .timeline-meta {
    gap: 5px;
    margin-top: 5px;
    font-size: 10px;
  }

  .category-tag {
    padding: 2px 5px;
    font-size: 8.5px;
  }

  .record-action {
    width: 22px;
    height: 22px;
    border-radius: 6px;
  }

  .record-actions {
    margin-top: -2px;
    margin-right: -3px;
  }

  .record-count {
    padding: 3px 6px;
    font-size: 8.5px;
  }

  .empty-state {
    margin-top: 13px;
    padding: 20px 13px 18px;
  }

  .empty-copy strong {
    font-size: 10.5px;
  }

  .empty-copy span {
    font-size: 9px;
  }

  .empty-state--tasks {
    padding: 12px 11px;
  }

  .empty-illustration--check svg {
    width: 40px;
    height: 40px;
  }

  .task-progress {
    margin-top: 16px;
  }

  .task-form {
    margin-top: 13px;
  }

  .task-form input {
    height: 41px;
    font-size: 11.5px;
  }

  .task-add-button {
    width: 41px;
    height: 41px;
  }

  .task-item {
    padding: 8px 5px 8px 8px;
  }

  .task-title {
    font-size: 12.5px;
  }

  .task-box {
    width: 17px;
    height: 17px;
  }

  .task-footer {
    margin-top: 12px;
    padding-top: 9px;
  }

  #taskFooterHint {
    font-size: 9px;
  }

  .distribution-body {
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 14px;
    margin-top: 15px;
  }

  .donut {
    width: 118px;
    height: 118px;
  }

  .donut-center {
    inset: 24px;
  }

  .donut-center strong {
    font-size: 17px;
  }

  .donut-center span {
    font-size: 7.5px;
  }

  .category-legend {
    gap: 6px;
  }

  .legend-copy {
    gap: 4px;
  }

  .legend-name {
    font-size: 10px;
  }

  .legend-value {
    font-size: 8.5px;
  }

  .legend-item {
    gap: 5px;
  }

  .insight {
    margin-top: 14px;
    padding: 9px 10px;
  }

  .insight p {
    font-size: 10px;
  }

  .week-card .card-heading {
    align-items: flex-start;
  }

  .week-summary {
    max-width: 112px;
    padding-top: 1px;
    font-size: 8.5px;
  }

  .week-chart {
    gap: 3px;
    margin-top: 14px;
  }

  .week-bar-wrap {
    height: 78px;
    padding: 2px;
  }

  .week-hours {
    height: 12px;
    font-size: 7.5px;
    line-height: 12px;
  }

  .week-label {
    font-size: 8.5px;
  }

  .week-date {
    font-size: 7.5px;
  }

  .week-hint {
    font-size: 8.5px;
  }

  .footer p:first-child {
    display: flex;
    justify-content: center;
  }

  .footer p:last-child {
    display: none;
  }
}

@media (hover: none) {
  .record-actions,
  .task-delete {
    opacity: 0.72;
    transform: none;
  }

  .timeline-card:hover {
    transform: none;
  }

  .week-day:hover {
    transform: none;
  }

  .category-chip:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
