﻿:root {
  --bg: #edf6ef;
  --bg-deep: #e3f0e7;
  --surface: #ffffff;
  --surface-soft: #f7faf8;
  --surface-muted: #eff3f0;
  --ink: #101612;
  --ink-soft: #465049;
  --muted: #77827b;
  --faint: #a8b2ac;
  --line: #e1e9e4;
  --line-strong: #d2ddd6;
  --accent: #18a86a;
  --accent-dark: #0e8652;
  --accent-bright: #52d98e;
  --accent-soft: #e6f7ed;
  --danger: #c95858;
  --danger-soft: #fff0ef;
  --complete-soft: #ecefed;
  --shadow-sm: 0 12px 36px rgba(32, 62, 44, 0.07);
  --shadow-md: 0 24px 60px rgba(32, 62, 44, 0.1);
  --shadow-lg: 0 34px 90px rgba(19, 42, 29, 0.18);
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 32px;
  --font-display: "Aptos Display", "SF Pro Display", "HarmonyOS Sans SC", "PingFang SC", sans-serif;
  --font-body: "Aptos", "SF Pro Text", "HarmonyOS Sans SC", "PingFang SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% -4%, rgba(83, 211, 139, 0.24), rgba(83, 211, 139, 0) 34rem),
    radial-gradient(circle at -8% 82%, rgba(161, 222, 185, 0.22), rgba(161, 222, 185, 0) 32rem),
    linear-gradient(180deg, #eff8f2 0%, var(--bg) 58%, var(--bg-deep) 100%);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  z-index: 0;
  inset: 0;
  background-image: radial-gradient(rgba(25, 74, 47, 0.14) 0.55px, transparent 0.55px);
  background-size: 20px 20px;
  content: "";
  opacity: 0.19;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 72%);
  mask-image: linear-gradient(to bottom, #000, transparent 72%);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

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

button:focus-visible,
input:focus-visible,
dialog:focus-visible {
  outline: 3px solid rgba(24, 168, 106, 0.24);
  outline-offset: 3px;
}

svg {
  display: block;
  width: 1.2em;
  height: 1.2em;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.page-glow {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
}

.page-glow-top {
  top: -330px;
  right: -160px;
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, rgba(69, 194, 123, 0.2), rgba(69, 194, 123, 0) 68%);
}

.page-glow-bottom {
  bottom: -380px;
  left: -220px;
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, rgba(139, 214, 170, 0.18), rgba(139, 214, 170, 0) 68%);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 56px 32px 84px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 46px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 9px;
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.17em;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
}

.eyebrow::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(24, 168, 106, 0.09);
  content: "";
}

.page-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3.25rem, 7vw, 5.8rem);
  font-weight: 780;
  letter-spacing: -0.07em;
  line-height: 0.94;
}

.today-label {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 560;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 999px;
  padding: 0 21px;
  font-weight: 740;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.primary-button {
  color: #ffffff;
  background: #121914;
  box-shadow: 0 15px 34px rgba(25, 48, 33, 0.2);
}

.primary-button:hover {
  background: #242e27;
  box-shadow: 0 18px 42px rgba(25, 48, 33, 0.26);
  transform: translateY(-2px);
}

.primary-button:active,
.secondary-button:active,
.icon-button:active,
.task-toggle:active {
  transform: translateY(1px);
}

.secondary-button {
  color: var(--ink-soft);
  background: var(--surface-muted);
}

.secondary-button:hover {
  background: #e5ebe7;
}

.weekly-panel,
.task-panel,
.history-panel,
.progress-card {
  border: 1px solid rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-sm);
}

.weekly-panel {
  display: grid;
  grid-template-columns: minmax(190px, 220px) minmax(0, 1fr);
  align-items: center;
  gap: 38px;
  margin-bottom: 24px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(24px) saturate(1.16);
}

.weekly-summary h2,
.section-heading h2,
.progress-card h2,
.dialog-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.24rem;
  font-weight: 760;
  letter-spacing: -0.035em;
}

.weekly-status {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.weekly-chart-wrap {
  min-width: 0;
}

.weekly-progress-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 740;
}

.weekly-progress-heading span:last-child {
  color: var(--accent-dark);
}

.weekly-progress-track {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ece8;
  box-shadow: inset 0 1px 2px rgba(31, 55, 40, 0.07);
}

.weekly-progress-track > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-bright), var(--accent));
  box-shadow: 0 4px 14px rgba(24, 168, 106, 0.28);
  transition: width 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.weekly-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(26px, 1fr));
  gap: 13px;
  height: 92px;
  margin-top: 20px;
}

.weekly-day {
  display: grid;
  min-width: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
  text-align: center;
}

.weekly-bar-track {
  display: flex;
  min-height: 58px;
  align-items: flex-end;
  overflow: hidden;
  border-radius: 11px;
  background: #edf1ee;
}

.weekly-bar-fill {
  display: block;
  width: 100%;
  min-height: 0;
  border-radius: 10px;
  background: #b7e8cb;
  transition: height 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.weekly-day.is-today .weekly-bar-track {
  box-shadow: inset 0 0 0 2px rgba(24, 168, 106, 0.28);
}

.weekly-day.is-today .weekly-bar-fill {
  background: linear-gradient(180deg, var(--accent-bright), var(--accent));
}

.weekly-day.is-future .weekly-bar-track {
  background: #f1f4f2;
}

.weekly-day.is-missed .weekly-bar-track {
  background: #f8ecea;
}

.weekly-day-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 730;
  white-space: nowrap;
}

.weekly-day-label small {
  color: var(--faint);
  font-size: 0.61rem;
  font-weight: 620;
}

.weekly-day.is-today .weekly-day-label {
  color: var(--accent-dark);
}

.weekly-note {
  min-height: 17px;
  margin: 11px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.73rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-layout {
  display: grid;
  grid-template-columns: minmax(280px, 330px) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
}

.progress-card,
.task-panel {
  min-height: 438px;
  border-radius: var(--radius-lg);
}

.progress-card {
  position: relative;
  display: flex;
  overflow: hidden;
  flex-direction: column;
  padding: 28px;
  color: #ffffff;
  background:
    radial-gradient(circle at 84% 10%, rgba(82, 217, 142, 0.18), rgba(82, 217, 142, 0) 35%),
    linear-gradient(155deg, #17211b 0%, #0d130f 72%);
  box-shadow: 0 30px 65px rgba(17, 41, 27, 0.2);
}

.progress-card::before {
  position: absolute;
  top: -85px;
  right: -90px;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(117, 231, 164, 0.13);
  border-radius: 50%;
  content: "";
}

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

.progress-card-heading,
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.progress-card .section-kicker {
  color: var(--accent-bright);
}

.progress-card h2 {
  color: #ffffff;
}

.progress-date {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  font-weight: 650;
}

.progress-ring {
  --progress: 0deg;
  position: relative;
  display: grid;
  width: 178px;
  height: 178px;
  place-items: center;
  margin: 45px auto 32px;
  border-radius: 50%;
  background: conic-gradient(var(--accent-bright) var(--progress), rgba(255, 255, 255, 0.12) 0deg);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.2);
  transition: background 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.progress-ring::after {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 5px solid #131b16;
  border-radius: 50%;
  background: var(--accent-bright);
  content: "";
  box-shadow: 0 0 22px rgba(82, 217, 142, 0.68);
  transform: translateY(-89px);
}

.progress-ring-inner {
  display: flex;
  width: 136px;
  height: 136px;
  align-items: baseline;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
  background: #121a15;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 34px rgba(0, 0, 0, 0.24);
}

.progress-ring-inner strong {
  align-self: center;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 2.9rem;
  font-weight: 760;
  letter-spacing: -0.07em;
  line-height: 1;
}

.progress-ring-inner span {
  margin-left: 4px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.78rem;
  font-weight: 650;
}

.progress-message {
  min-height: 43px;
  margin: 0 0 20px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.92rem;
  line-height: 1.55;
  text-align: center;
}

.progress-track {
  width: 100%;
  height: 8px;
  margin-top: auto;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-bright), #a4efc2);
  box-shadow: 0 0 18px rgba(82, 217, 142, 0.45);
  transition: width 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.task-panel {
  padding: 28px;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(24px) saturate(1.1);
}

.task-count-badge,
.streak-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 750;
  white-space: nowrap;
}

.task-count-badge {
  min-height: 32px;
  padding: 0 13px;
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.task-list {
  display: grid;
  gap: 12px;
  margin-top: 26px;
}

.task-card {
  display: flex;
  min-height: 88px;
  align-items: center;
  gap: 13px;
  border: 1px solid #e8eeea;
  border-radius: 22px;
  padding: 14px 14px 14px 12px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 8px 24px rgba(30, 56, 41, 0.045);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.task-card:hover {
  border-color: #d6e2da;
  box-shadow: 0 14px 32px rgba(30, 56, 41, 0.075);
  transform: translateY(-1px);
}

.task-card.is-complete {
  border-color: #e2e6e3;
  background: var(--complete-soft);
  box-shadow: none;
}

.task-toggle {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 15px;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.task-check {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  border: 1.5px solid #cad6ce;
  border-radius: 16px;
  color: transparent;
  background: #ffffff;
  box-shadow: inset 0 1px 0 #ffffff, 0 5px 14px rgba(28, 56, 40, 0.05);
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.task-toggle:hover .task-check {
  border-color: var(--accent);
  transform: scale(1.03);
}

.task-check svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.5;
}

.task-card.is-complete .task-check {
  border-color: #9ca6a0;
  color: #ffffff;
  background: #8e9892;
  box-shadow: none;
}

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

.task-name {
  display: block;
  overflow: hidden;
  margin-bottom: 7px;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 740;
  letter-spacing: -0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 180ms ease;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.task-card.is-complete .task-name,
.task-card.is-complete .task-meta {
  color: #8b948e;
}

.task-card.is-complete .task-name {
  text-decoration-color: #aab2ad;
  text-decoration-line: line-through;
  text-decoration-thickness: 1px;
}

.streak-badge {
  min-height: 25px;
  padding: 0 9px;
  color: #69736d;
  background: #eff2f0;
}

.task-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
}

.text-action {
  min-height: 34px;
  border: 0;
  border-radius: 10px;
  padding: 0 9px;
  color: var(--muted);
  background: transparent;
  font-size: 0.76rem;
  font-weight: 680;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}

.text-action:hover {
  color: var(--ink);
  background: #f0f4f1;
}

.text-action.is-danger:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.empty-state {
  display: flex;
  min-height: 286px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  border: 1px dashed #d6e1da;
  border-radius: 24px;
  color: var(--muted);
  background: rgba(247, 250, 248, 0.76);
  text-align: center;
}

.empty-state-icon {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 21px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.empty-state-icon svg {
  width: 27px;
  height: 27px;
}

.empty-state h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.04rem;
}

.empty-state p {
  max-width: 340px;
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.65;
}

.empty-state .primary-button {
  margin-top: 20px;
}

.history-panel {
  margin-top: 24px;
  border-radius: var(--radius-lg);
  padding: 30px;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(24px) saturate(1.1);
}

.history-heading {
  align-items: center;
  margin-bottom: 25px;
}

.history-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
}

.history-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.legend-dot.is-complete {
  background: var(--accent);
}

.legend-dot.is-missed {
  background: #e4aaa5;
}

.legend-dot.is-makeup {
  border: 2px solid var(--accent);
  background: #ffffff;
}

.legend-dot.is-rest {
  background: #dce3df;
}

.history-content {
  min-width: 0;
}

.history-scroll {
  overflow-x: auto;
  padding-bottom: 5px;
  scrollbar-color: #cbd8d0 transparent;
  scrollbar-width: thin;
}

.history-table {
  width: 100%;
  min-width: 920px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.history-table th,
.history-table td {
  border-bottom: 1px solid var(--line);
  padding: 13px 7px;
  text-align: center;
}

.history-table th:first-child,
.history-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 184px;
  padding-left: 0;
  padding-right: 18px;
  text-align: left;
  background: rgba(255, 255, 255, 0.96);
}

.history-table th:last-child,
.history-table td:last-child {
  width: 80px;
  padding-right: 0;
}

.history-table thead th {
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 720;
}

.history-table thead th:first-child,
.history-table thead th:last-child {
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.history-table thead th span {
  display: block;
}

.history-date-number {
  margin-top: 4px;
  color: var(--faint);
  font-size: 0.64rem;
  font-weight: 640;
}

.history-habit-name {
  display: block;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 740;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-schedule {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--faint);
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-actions {
  display: flex;
  gap: 3px;
  margin-top: 5px;
}

.history-actions .text-action {
  min-height: 25px;
  padding: 0 5px;
  font-size: 0.66rem;
}

.status-mark {
  display: inline-grid;
  width: 27px;
  height: 27px;
  appearance: none;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0;
  font-family: inherit;
  font-size: 0.71rem;
  font-weight: 800;
  line-height: 1;
}

.status-mark.is-complete {
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 7px 16px rgba(24, 168, 106, 0.22);
}

.status-mark.is-makeup {
  border: 1px dashed #78c79d;
  color: var(--accent-dark);
  background: #edf9f2;
  font-size: 1rem;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.status-mark.is-makeup:hover {
  border-style: solid;
  border-color: var(--accent);
  color: #ffffff;
  background: var(--accent);
  transform: translateY(-1px) scale(1.04);
}

.status-mark.is-makeup:focus-visible {
  outline: 3px solid rgba(24, 168, 106, 0.24);
  outline-offset: 3px;
}

.status-mark.is-missed {
  color: #b76a65;
  background: #f8e9e7;
}

.status-mark.is-rest,
.status-mark.is-outside {
  color: #b2bcb6;
  background: #f1f4f2;
}

.status-mark.is-pending {
  border: 2px solid var(--accent);
  background: #ffffff;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.history-streak {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 760;
  white-space: nowrap;
}

.history-empty {
  display: flex;
  min-height: 178px;
  align-items: center;
  justify-content: center;
  border: 1px dashed #d6e1da;
  border-radius: 24px;
  color: var(--muted);
  background: rgba(247, 250, 248, 0.76);
  font-size: 0.88rem;
  text-align: center;
}

.history-table tbody tr:last-child td {
  border-bottom: 0;
}

.habit-dialog {
  width: min(92vw, 540px);
  max-height: min(90vh, 740px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 34px;
  padding: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(28px);
}

.habit-dialog::backdrop {
  background: rgba(15, 28, 20, 0.36);
  backdrop-filter: blur(7px);
}

.habit-dialog[open] {
  animation: dialog-in 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.habit-dialog form {
  padding: 34px;
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface-muted);
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.icon-button:hover {
  color: var(--ink);
  background: #e6ece8;
}

.field-label,
.weekday-fieldset legend {
  display: block;
  margin-bottom: 11px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 740;
}

.text-input {
  width: 100%;
  height: 52px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 0 16px;
  color: var(--ink);
  background: var(--surface-soft);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.text-input::placeholder {
  color: #a8b2ac;
}

.text-input:hover {
  border-color: #c5d4ca;
}

.text-input:focus {
  border-color: var(--accent);
  outline: none;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(24, 168, 106, 0.1);
}

.weekday-fieldset {
  min-width: 0;
  margin: 26px 0 0;
  border: 0;
  padding: 0;
}

.field-help {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 0.75rem;
}

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

.weekday-option {
  position: relative;
  cursor: pointer;
}

.weekday-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.weekday-option span {
  display: grid;
  height: 46px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.82rem;
  font-weight: 730;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.weekday-option:hover span {
  border-color: #c8d7cd;
  transform: translateY(-1px);
}

.weekday-option input:checked + span {
  border-color: var(--accent);
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(24, 168, 106, 0.2);
}

.weekday-option input:focus-visible + span {
  outline: 3px solid rgba(24, 168, 106, 0.24);
  outline-offset: 2px;
}

.form-error {
  min-height: 21px;
  margin: 14px 0 0;
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 680;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.toast {
  position: fixed;
  z-index: 20;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100vw - 48px));
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  padding: 14px 17px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px);
  font-size: 0.82rem;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.page-header,
.weekly-panel,
.today-layout,
.history-panel {
  animation: keynote-rise 650ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.weekly-panel {
  animation-delay: 70ms;
}

.today-layout {
  animation-delay: 140ms;
}

.history-panel {
  animation-delay: 210ms;
}

.task-card {
  animation: task-rise 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.task-card:nth-child(2) {
  animation-delay: 45ms;
}

.task-card:nth-child(3) {
  animation-delay: 90ms;
}

.task-card:nth-child(4) {
  animation-delay: 135ms;
}

@keyframes keynote-rise {
  from {
    opacity: 0;
    filter: blur(6px);
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@keyframes task-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .weekly-panel {
    grid-template-columns: minmax(170px, 205px) minmax(0, 1fr);
    gap: 25px;
  }
}

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

  .page-header {
    align-items: flex-start;
  }

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

  .progress-card,
  .task-panel {
    min-height: auto;
  }

  .progress-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 146px;
    column-gap: 20px;
  }

  .progress-card-heading {
    align-self: center;
  }

  .progress-ring {
    grid-row: 1 / span 2;
    grid-column: 2;
    width: 134px;
    height: 134px;
    margin: 0;
  }

  .progress-ring::after {
    width: 18px;
    height: 18px;
    border-width: 4px;
    transform: translateY(-67px);
  }

  .progress-ring-inner {
    width: 102px;
    height: 102px;
  }

  .progress-ring-inner strong {
    font-size: 2.2rem;
  }

  .progress-ring-inner span {
    font-size: 0.7rem;
  }

  .progress-message {
    align-self: end;
    margin: 0;
    text-align: left;
  }

  .progress-track {
    grid-column: 1 / -1;
    margin-top: 22px;
  }
}

@media (max-width: 600px) {
  .page-header {
    flex-direction: column;
    gap: 24px;
    margin-bottom: 34px;
  }

  .page-header .primary-button {
    width: 100%;
  }

  .weekly-panel,
  .progress-card,
  .task-panel,
  .history-panel {
    border-radius: 25px;
  }

  .weekly-panel {
    grid-template-columns: 1fr;
    gap: 21px;
    padding: 23px 21px;
  }

  .weekly-chart {
    gap: 8px;
  }

  .weekly-day-label {
    flex-direction: column;
    gap: 1px;
  }

  .weekly-note {
    white-space: normal;
  }

  .progress-card,
  .task-panel,
  .history-panel {
    padding: 22px 20px;
  }

  .progress-card {
    grid-template-columns: minmax(0, 1fr) 104px;
  }

  .progress-ring {
    width: 102px;
    height: 102px;
  }

  .progress-ring::after {
    width: 15px;
    height: 15px;
    border-width: 3px;
    transform: translateY(-52px);
  }

  .progress-ring-inner {
    width: 78px;
    height: 78px;
    flex-direction: column;
    align-items: center;
  }

  .progress-ring-inner strong {
    font-size: 1.75rem;
  }

  .progress-ring-inner span {
    margin: -3px 0 0;
    font-size: 0.62rem;
  }

  .task-card {
    align-items: flex-start;
    border-radius: 19px;
    padding: 12px;
  }

  .task-toggle {
    align-items: flex-start;
  }

  .task-check {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    border-radius: 14px;
  }

  .task-name {
    padding-top: 2px;
  }

  .task-actions {
    flex-direction: column;
  }

  .text-action {
    min-height: 27px;
    padding: 0 5px;
    font-size: 0.71rem;
  }

  .history-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .history-legend {
    justify-content: flex-start;
  }

  .habit-dialog form {
    padding: 27px 21px;
  }

  .weekday-grid {
    gap: 6px;
  }

  .weekday-option span {
    height: 43px;
    border-radius: 12px;
  }

  .dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .dialog-actions button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.timer-action {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.timer-action:hover {
  color: #ffffff;
  background: var(--accent);
}

.timer-dialog {
  width: min(94vw, 780px);
  max-height: min(92vh, 860px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 34px;
  padding: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(28px);
}

.timer-dialog::backdrop {
  background: rgba(15, 28, 20, 0.36);
  backdrop-filter: blur(7px);
}

.timer-dialog[open] {
  animation: dialog-in 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.timer-dialog form {
  padding: 32px;
}

.timer-dialog-heading {
  margin-bottom: 22px;
}

.timer-habit-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  border: 1px solid #dbe8df;
  border-radius: 18px;
  padding: 15px 17px;
  background: linear-gradient(135deg, #f5fbf7, #edf7f1);
}

.timer-habit-context span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 680;
}

.timer-habit-context strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 760;
}

.timer-setting-group {
  margin-top: 23px;
}

.timer-setting-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.timer-setting-title h3 {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 760;
}

.timer-setting-title span {
  color: var(--faint);
  font-size: 0.68rem;
  font-weight: 640;
}

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

.duration-option,
.timer-theme-option,
.timer-reminder-option {
  position: relative;
  cursor: pointer;
}

.duration-option input,
.timer-theme-option input,
.timer-reminder-option input,
.switch-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.duration-option span {
  display: grid;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.8rem;
  font-weight: 730;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.duration-option:hover span {
  border-color: #bfd7c7;
  transform: translateY(-1px);
}

.duration-option input:checked + span {
  border-color: #121a15;
  color: #ffffff;
  background: #121a15;
  box-shadow: 0 8px 18px rgba(18, 26, 21, 0.17);
}

.custom-duration-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 11px 13px 11px 15px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.78rem;
  font-weight: 680;
}

.custom-duration-row[hidden] {
  display: none;
}

.custom-duration-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-duration-input input {
  width: 88px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 0 10px;
  color: var(--ink);
  background: #ffffff;
  font-weight: 730;
  text-align: center;
}

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

.timer-theme-card {
  display: flex;
  min-height: 158px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 10px;
  background: #ffffff;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.timer-theme-option:hover .timer-theme-card {
  border-color: #bfd7c7;
  transform: translateY(-1px);
}

.timer-theme-option input:checked + .timer-theme-card {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(24, 168, 106, 0.1), 0 14px 28px rgba(27, 70, 46, 0.09);
}

.timer-theme-preview {
  position: relative;
  display: grid;
  height: 72px;
  place-items: center;
  overflow: hidden;
  border-radius: 14px;
}

.timer-theme-preview::before {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.6);
  border-right-color: var(--accent-bright);
  border-radius: 50%;
  content: "";
  transform: rotate(-38deg);
}

.timer-theme-preview i {
  position: absolute;
  color: inherit;
  font-size: 0.9rem;
  font-style: normal;
  font-weight: 800;
}

.timer-theme-preview.is-light {
  color: #111a14;
  background: linear-gradient(135deg, #ffffff, #edf6f0);
}

.timer-theme-preview.is-light::before {
  border-color: #d8e5dd;
  border-right-color: #24b873;
}

.timer-theme-preview.is-dark {
  color: #ffffff;
  background: linear-gradient(135deg, #21382a, #08100c);
}

.timer-theme-preview.is-dark::before {
  border-color: rgba(255, 255, 255, 0.14);
  border-right-color: #5ee59b;
}

.timer-theme-preview.is-auto {
  color: #111a14;
  background: linear-gradient(115deg, #ffffff 0 49%, #122018 50% 100%);
}

.timer-theme-card strong {
  margin: 11px 4px 0;
  color: var(--ink);
  font-size: 0.83rem;
  font-weight: 760;
}

.timer-theme-card small {
  margin: 4px 4px 0;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.45;
}

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

.timer-reminder-card {
  display: flex;
  min-height: 82px;
  align-items: center;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 13px;
  background: var(--surface-soft);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.timer-reminder-option input:checked + .timer-reminder-card {
  border-color: #9ed8b7;
  background: #e9f8ef;
  box-shadow: 0 0 0 3px rgba(24, 168, 106, 0.08);
}

.reminder-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 13px;
  font-size: 1rem;
  font-style: normal;
  font-weight: 800;
}

.reminder-icon.is-gentle {
  color: #5f7568;
  background: #e6ece8;
}

.reminder-icon.is-strong {
  color: #ffffff;
  background: var(--accent);
}

.timer-reminder-card > span:last-child {
  min-width: 0;
}

.timer-reminder-card strong,
.timer-reminder-card small {
  display: block;
}

.timer-reminder-card strong {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 760;
}

.timer-reminder-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.45;
}

.timer-sound-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  cursor: pointer;
}

.timer-sound-row strong,
.timer-sound-row small {
  display: block;
}

.timer-sound-row strong {
  color: var(--ink-soft);
  font-size: 0.79rem;
}

.timer-sound-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.65rem;
}

.switch-control {
  position: relative;
  width: 50px;
  height: 30px;
  flex: 0 0 50px;
}

.switch-control i {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d8e0db;
  transition: background 160ms ease;
}

.switch-control i::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 3px 8px rgba(30, 48, 37, 0.18);
  content: "";
  transition: transform 160ms ease;
}

.switch-control input:checked + i {
  background: var(--accent);
}

.switch-control input:checked + i::after {
  transform: translateX(20px);
}

.timer-dialog-actions {
  position: sticky;
  z-index: 3;
  bottom: -32px;
  margin: 20px -32px -32px;
  border-top: 1px solid rgba(225, 233, 228, 0.85);
  padding: 16px 32px 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), #ffffff 34%);
  backdrop-filter: blur(18px);
}

.timer-screen {
  --timer-ink: #101712;
  --timer-muted: #748078;
  --timer-line: rgba(19, 48, 31, 0.1);
  --timer-track: rgba(19, 48, 31, 0.1);
  --timer-accent: #18a86a;
  --timer-accent-bright: #52d98e;
  --timer-button-bg: #121a15;
  --timer-button-ink: #ffffff;
  --timer-ring-inner: #f7fcf9;
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  min-height: 100dvh;
  overflow: hidden;
  flex-direction: column;
  padding: max(28px, env(safe-area-inset-top)) max(30px, env(safe-area-inset-right)) max(30px, env(safe-area-inset-bottom)) max(30px, env(safe-area-inset-left));
  color: var(--timer-ink);
  background: #eff8f2;
}

.timer-screen[hidden] {
  display: none !important;
}

.timer-screen.theme-dark {
  --timer-ink: #f5fbf7;
  --timer-muted: #8e9e95;
  --timer-line: rgba(255, 255, 255, 0.11);
  --timer-track: rgba(255, 255, 255, 0.09);
  --timer-accent: #52d98e;
  --timer-accent-bright: #a4f2c2;
  --timer-button-bg: rgba(255, 255, 255, 0.1);
  --timer-button-ink: #ffffff;
  --timer-ring-inner: #0b150f;
  background:
    radial-gradient(circle at 50% 32%, rgba(50, 164, 101, 0.24), rgba(50, 164, 101, 0) 29rem),
    linear-gradient(145deg, #14251b 0%, #07100b 68%);
}

.timer-screen.theme-light {
  background:
    radial-gradient(circle at 76% 12%, rgba(82, 217, 142, 0.24), rgba(82, 217, 142, 0) 31rem),
    linear-gradient(145deg, #f7fcf9 0%, #e6f4eb 100%);
}

.timer-screen-ambient {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(72vw, 780px);
  aspect-ratio: 1;
  border: 1px solid var(--timer-line);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.timer-screen-ambient::before,
.timer-screen-ambient::after {
  position: absolute;
  border: 1px solid var(--timer-line);
  border-radius: 50%;
  content: "";
}

.timer-screen-ambient::before {
  inset: 12%;
}

.timer-screen-ambient::after {
  inset: 25%;
}

.timer-screen-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.timer-screen-header p {
  margin: 0 0 8px;
  color: var(--timer-accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.timer-screen-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.4vw, 2rem);
  font-weight: 760;
  letter-spacing: -0.04em;
}

.timer-exit-button {
  min-height: 44px;
  border: 1px solid var(--timer-line);
  border-radius: 999px;
  padding: 0 18px;
  color: var(--timer-ink);
  background: var(--timer-button-bg);
  font-size: 0.78rem;
  font-weight: 720;
  cursor: pointer;
}

.timer-screen.theme-light .timer-exit-button {
  color: #ffffff;
}

.timer-screen-stage {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 0;
  flex: 1;
  place-items: center;
}

.timer-screen-ring {
  --timer-progress: 360deg;
  position: relative;
  display: grid;
  width: min(54vw, 430px);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--timer-accent) var(--timer-progress), var(--timer-track) 0deg);
  box-shadow: 0 0 70px color-mix(in srgb, var(--timer-accent) 17%, transparent);
  transition: background 220ms linear;
}

.timer-screen-ring::after {
  position: absolute;
  top: -1px;
  left: 50%;
  width: 18px;
  height: 18px;
  border: 5px solid var(--timer-accent);
  border-radius: 50%;
  background: var(--timer-ink);
  content: "";
  transform: translate(-50%, -50%);
}

.timer-screen-ring-inner {
  position: relative;
  display: flex;
  width: 83%;
  height: 83%;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--timer-line);
  border-radius: 50%;
  background: var(--timer-ring-inner);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-align: center;
}

.timer-screen-ring-inner strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(4.2rem, 10vw, 8.2rem);
  font-weight: 770;
  letter-spacing: -0.075em;
  line-height: 0.9;
}

.timer-screen.theme-dark .timer-screen-ring-inner strong {
  color: #ffffff;
}

.timer-screen-ring-inner span {
  margin-top: 14px;
  color: var(--timer-muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.timer-screen-controls {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.timer-screen-controls[hidden] {
  display: none;
}

.timer-control-button,
.timer-snooze-button,
.timer-complete-button,
.timer-dismiss-button {
  min-height: 50px;
  border: 0;
  border-radius: 999px;
  padding: 0 22px;
  font-weight: 740;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.timer-control-button {
  border: 1px solid var(--timer-line);
  color: var(--timer-ink);
  background: var(--timer-button-bg);
}

.timer-screen.theme-light .timer-control-button {
  color: #ffffff;
}

.timer-control-button:hover,
.timer-snooze-button:hover,
.timer-complete-button:hover,
.timer-dismiss-button:hover {
  transform: translateY(-2px);
}

.timer-finish-panel {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: flex;
  overflow: auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px;
  text-align: center;
  background: color-mix(in srgb, var(--timer-ink) 5%, transparent);
  backdrop-filter: blur(18px);
}

.timer-finish-panel[hidden] {
  display: none;
}

.timer-screen.reminder-strong .timer-finish-panel {
  background:
    radial-gradient(circle at 50% 40%, rgba(82, 217, 142, 0.32), rgba(82, 217, 142, 0) 28rem),
    color-mix(in srgb, var(--timer-ink) 6%, transparent);
  animation: timer-alarm-pulse 1.4s ease-in-out infinite alternate;
}

.timer-finish-kicker {
  margin: 0 0 8px;
  color: var(--timer-accent);
  font-size: 0.72rem;
  font-weight: 820;
  letter-spacing: 0.18em;
}

.timer-finish-panel h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3.8rem, 11vw, 8rem);
  font-weight: 790;
  letter-spacing: -0.08em;
  line-height: 0.94;
}

.timer-finish-panel > p:not(.timer-finish-kicker) {
  max-width: 560px;
  margin: 18px 0 0;
  color: var(--timer-muted);
  font-size: clamp(0.92rem, 1.6vw, 1.08rem);
  line-height: 1.6;
}

.timer-finish-actions {
  display: flex;
  gap: 12px;
  margin-top: 38px;
}

.timer-snooze-button {
  color: var(--timer-ink);
  background: color-mix(in srgb, var(--timer-ink) 8%, transparent);
  border: 1px solid var(--timer-line);
}

.timer-complete-button {
  color: var(--timer-button-ink);
  background: var(--timer-button-bg);
  box-shadow: 0 16px 34px rgba(13, 36, 23, 0.2);
}

.timer-screen.theme-dark .timer-complete-button {
  color: #07100b;
  background: var(--timer-accent-bright);
}

.timer-dismiss-button {
  margin-top: 17px;
  min-height: 38px;
  color: var(--timer-muted);
  background: transparent;
  font-size: 0.75rem;
}

@keyframes timer-alarm-pulse {
  from {
    filter: brightness(1);
  }
  to {
    filter: brightness(1.08);
  }
}

body.timer-active {
  overflow: hidden;
}

@media (max-width: 720px) {
  .timer-dialog form {
    padding: 26px 20px;
  }

  .timer-dialog-actions {
    bottom: -26px;
    margin: 18px -20px -26px;
    padding: 14px 20px 18px;
  }

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

  .timer-theme-grid,
  .timer-reminder-grid {
    grid-template-columns: 1fr;
  }

  .timer-theme-card {
    min-height: 138px;
  }

  .timer-screen {
    padding: max(22px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  }

  .timer-screen-ring {
    width: min(78vw, 350px);
  }

  .timer-screen-ring-inner strong {
    font-size: clamp(3.7rem, 18vw, 6rem);
  }

  .timer-screen-ring-inner span {
    margin-top: clamp(5.5rem, 21vw, 7.4rem);
  }

  .timer-screen-controls {
    gap: 9px;
  }

  .timer-control-button {
    min-height: 47px;
    padding: 0 18px;
  }

  .timer-finish-actions {
    width: 100%;
    max-width: 430px;
    flex-direction: column-reverse;
  }

  .timer-snooze-button,
  .timer-complete-button {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .timer-habit-context,
  .timer-setting-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .timer-screen-header h2 {
    font-size: 1.15rem;
  }

  .timer-screen-ring {
    width: min(80vw, 310px);
  }

  .timer-screen-ring-inner strong {
    font-size: clamp(3.2rem, 17vw, 5rem);
  }
}



.duration-option input:focus-visible,
.timer-theme-option input:focus-visible,
.timer-reminder-option input:focus-visible,
.switch-control input:focus-visible {
  outline: none;
}

.duration-option input:focus-visible + span,
.timer-reminder-option input:focus-visible + .timer-reminder-card {
  outline: 3px solid rgba(24, 168, 106, 0.24);
  outline-offset: 2px;
}

.timer-theme-option input:focus-visible + .timer-theme-card {
  outline: 3px solid rgba(24, 168, 106, 0.24);
  outline-offset: 2px;
}

.switch-control input:focus-visible + i {
  outline: 3px solid rgba(24, 168, 106, 0.24);
  outline-offset: 3px;
}


