:root {
  --cream: #f4f0dc;
  --cream-bright: #fbf8e9;
  --cream-muted: #d8d1aa;
  --ink: #20211d;
  --text: #f8f7f1;
  --text-muted: rgba(248, 247, 241, 0.68);
  --text-subtle: rgba(248, 247, 241, 0.46);
  --glass: rgba(34, 39, 35, 0.24);
  --glass-soft: rgba(255, 255, 255, 0.115);
  --glass-hover: rgba(255, 255, 255, 0.18);
  --glass-border: rgba(255, 255, 255, 0.36);
  --glass-border-strong: rgba(255, 255, 255, 0.52);
  --danger: #ffc0b8;
  --shadow-shell: 0 32px 100px rgba(4, 7, 5, 0.42);
  --shadow-card: 0 16px 46px rgba(4, 7, 5, 0.2);
  --radius-xl: 36px;
  --radius-lg: 26px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --font-ui: "Aptos", "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  --font-display: "Aptos Display", "Segoe UI Variable Display", "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: #191c1a;
}

body {
  display: grid;
  min-height: 100vh;
  margin: 0;
  padding: 28px;
  overflow-x: hidden;
  color: var(--text);
  background: radial-gradient(circle at 18% 4%, #6f7468 0, transparent 36rem), linear-gradient(145deg, #353a36, #171a18 72%);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  place-items: center;
}

.background-layer {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.background-image {
  width: 100%;
  height: 100%;
  opacity: 0;
  object-fit: cover;
  filter: blur(0.6px) saturate(0.98) brightness(0.94) scale(1.018);
  transform: scale(1.018);
  transition: opacity 650ms ease;
}

.background-image.is-ready {
  opacity: 1;
}

.background-overlay {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: radial-gradient(circle at 50% 32%, rgba(255, 255, 255, 0.02), rgba(9, 12, 10, 0.18) 82%), linear-gradient(115deg, rgba(9, 12, 10, 0.08), rgba(255, 255, 255, 0.035) 48%, rgba(9, 12, 10, 0.16));
  backdrop-filter: blur(1.2px);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

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

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(244, 240, 220, 0.48);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 760px);
  margin: 0;
  padding: 26px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.045)), var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 30px;
  box-shadow: 0 30px 90px rgba(4, 7, 5, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(28px) saturate(135%);
}

.storage-warning {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  padding: 13px 16px;
  color: #fff3ce;
  background: rgba(120, 84, 26, 0.5);
  border: 1px solid rgba(255, 224, 148, 0.24);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.5;
  backdrop-filter: blur(16px);
}

.storage-warning svg {
  width: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

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

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

.today-date {
  margin: 0 0 5px;
  color: var(--cream-muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.1em;
}

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

h1 {
  margin-bottom: 5px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 3.2rem);
  font-weight: 650;
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.page-intro {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 450;
  letter-spacing: 0.01em;
}

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

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  padding: 0 17px;
  border: 0;
  border-radius: 999px;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.primary-button {
  gap: 8px;
  color: var(--ink);
  background: var(--cream);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.17);
}

.primary-button:hover {
  background: var(--cream-bright);
  box-shadow: 0 13px 34px rgba(0, 0, 0, 0.24);
  transform: translateY(-1px);
}

.primary-button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.secondary-button {
  color: #252620;
  background: var(--cream);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.15);
}

.secondary-button:hover {
  background: var(--cream-bright);
}

.ghost-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.ghost-button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.danger-button {
  color: #2a1714;
  background: var(--danger);
}

.danger-button:hover {
  background: #ffd3cd;
}

.primary-button:active,
.secondary-button:active,
.ghost-button:active,
.danger-button:active {
  transform: translateY(1px);
}

.glass-icon-button {
  display: inline-flex;
  width: 43px;
  height: 43px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0;
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.glass-icon-button:hover {
  color: var(--ink);
  background: var(--cream);
  transform: translateY(-1px);
}

.glass-icon-button svg {
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.progress-card {
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
  padding: 20px 23px 21px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.055));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), var(--shadow-card);
  backdrop-filter: blur(18px);
}

.progress-card::after {
  position: absolute;
  top: -90px;
  right: -38px;
  width: 210px;
  height: 210px;
  background: radial-gradient(circle, rgba(248, 244, 220, 0.2), transparent 68%);
  content: "";
  pointer-events: none;
}

.progress-card__top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.section-kicker {
  margin-bottom: 7px;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.12em;
}

.progress-summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 0;
  font-variant-numeric: tabular-nums;
}

.progress-summary strong {
  color: var(--cream-bright);
  font-family: var(--font-display);
  font-size: clamp(2.65rem, 7vw, 3.55rem);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.075em;
}

.progress-summary span {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.progress-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--cream);
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
}

.progress-message {
  position: relative;
  z-index: 1;
  margin: 12px 0 11px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 450;
}

.progress-track {
  position: relative;
  z-index: 1;
  height: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.24);
  border-radius: 999px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18);
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #d7d1b2, var(--cream-bright));
  border-radius: inherit;
  box-shadow: 0 0 22px rgba(248, 244, 220, 0.28);
  transition: width 360ms ease;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-family: var(--font-display);
  font-size: 1.04rem;
  font-weight: 620;
  letter-spacing: -0.025em;
}

.habit-list-count {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.habit-list {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.habit-card {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 7px 8px 7px 12px;
  background: var(--glass-soft);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(16px);
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.habit-card:hover {
  background: var(--glass-hover);
  border-color: var(--glass-border-strong);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.13);
  transform: translateY(-1px);
}

.habit-card.is-complete {
  color: var(--ink);
  background: rgba(246, 242, 221, 0.72);
  border-color: rgba(255, 255, 255, 0.66);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
}

.habit-toggle {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 11px;
  min-width: 0;
  min-height: 42px;
  padding: 0;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
}

.habit-checkbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  color: transparent;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.52);
  border-radius: 9px;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.habit-checkbox svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.8;
}

.habit-toggle:hover .habit-checkbox {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.82);
  transform: scale(1.04);
}

.is-complete .habit-checkbox {
  color: var(--cream-bright);
  background: var(--ink);
  border-color: var(--ink);
}

.habit-label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.habit-name {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.91rem;
  font-weight: 560;
  letter-spacing: 0.01em;
  transition: color 180ms ease, opacity 180ms ease;
}

.habit-time {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.is-complete .habit-time {
  color: rgba(32, 33, 29, 0.54);
}

.is-complete .habit-name {
  color: #5d5e54;
  text-decoration: line-through;
  text-decoration-color: rgba(32, 33, 29, 0.38);
  text-decoration-thickness: 1.4px;
}

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

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--text-subtle);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.icon-button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.11);
}

.delete-habit-button:hover {
  color: #ffd2cc;
  background: rgba(195, 78, 67, 0.18);
}

.is-complete .icon-button {
  color: rgba(32, 33, 29, 0.52);
}

.is-complete .icon-button:hover {
  color: var(--ink);
  background: rgba(32, 33, 29, 0.08);
}

.is-complete .delete-habit-button:hover {
  color: #a63f36;
  background: rgba(171, 61, 51, 0.1);
}

.icon-button:active {
  transform: scale(0.95);
}

.icon-button svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.empty-state {
  display: grid;
  justify-items: center;
  padding: 34px 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.065);
  border: 1px dashed rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
}

.empty-state__icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 17px;
  color: var(--ink);
  background: var(--cream);
  border-radius: 19px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.14);
  place-items: center;
}

.empty-state__icon svg {
  width: 30px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.empty-state h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
  font-weight: 620;
}

.empty-state p {
  max-width: 320px;
  margin-bottom: 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.page-footer {
  margin-top: 20px;
  color: var(--text-subtle);
  font-size: 0.68rem;
  text-align: center;
  letter-spacing: 0.02em;
}
.modal {
  width: min(calc(100% - 32px), 500px);
  max-width: none;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: var(--radius-lg);
}

.modal::backdrop {
  background: rgba(8, 11, 9, 0.58);
  backdrop-filter: blur(8px);
}

.modal[open] {
  animation: modal-in 200ms ease both;
}

.modal-card {
  padding: 28px;
  background: linear-gradient(145deg, rgba(54, 54, 47, 0.84), rgba(30, 31, 27, 0.88));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 28px 84px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(28px);
}

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

.modal-heading h2,
#delete-dialog-title {
  margin-bottom: 0;
  font-family: var(--font-display);
  font-size: 1.42rem;
  font-weight: 620;
  letter-spacing: -0.035em;
}

.modal-close {
  flex: 0 0 auto;
  margin: -7px -7px 0 0;
  color: var(--text-muted);
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.84rem;
  font-weight: 620;
}

.text-input {
  width: 100%;
  height: 52px;
  padding: 0 15px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.text-input::placeholder {
  color: rgba(248, 247, 241, 0.34);
}

.text-input:hover {
  border-color: rgba(255, 255, 255, 0.26);
}

.text-input:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--cream-muted);
  box-shadow: 0 0 0 4px rgba(244, 240, 220, 0.1);
  outline: none;
}

.text-input.has-error {
  border-color: #f2a79f;
}

.form-error {
  min-height: 20px;
  margin: 7px 0 0;
  color: #ffc7c1;
  font-size: 0.78rem;
}

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

.delete-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 17px;
  color: #ffd5d0;
  background: rgba(180, 67, 57, 0.24);
  border-radius: 16px;
  place-items: center;
}

.delete-icon svg {
  width: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.delete-message {
  margin: 12px 0 0;
  color: var(--text-muted);
  line-height: 1.65;
}

.background-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 18px;
}

.background-summary__icon {
  display: grid;
  width: 45px;
  height: 45px;
  flex: 0 0 auto;
  color: var(--ink);
  background: var(--cream);
  border-radius: 14px;
  place-items: center;
}

.background-summary__icon svg {
  width: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.background-summary strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.92rem;
  font-weight: 650;
}

.background-summary p {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.background-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.background-choice {
  display: flex;
  min-width: 0;
  min-height: 86px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 9px;
  padding: 13px 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 17px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.background-choice:hover {
  color: var(--ink);
  background: var(--cream);
  border-color: var(--cream);
  transform: translateY(-1px);
}

.background-choice svg {
  width: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.background-choice:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.background-choice:disabled:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.13);
}

.background-status {
  min-height: 38px;
  margin: 13px 0 0;
  color: var(--text-subtle);
  font-size: 0.75rem;
  line-height: 1.55;
}

.data-description {
  margin: -7px 0 18px;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.65;
}

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

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(9px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@media (max-width: 680px) {
  .page-shell {
    width: 100%;
    margin: 0;
    padding: 22px 17px 24px;
    border-radius: 28px;
    backdrop-filter: blur(23px) saturate(120%);
  }

  .page-header {
    align-items: stretch;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 26px;
  }

  h1 {
    font-size: clamp(2.45rem, 14vw, 3.5rem);
  }

  .header-actions {
    justify-content: space-between;
  }

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

  .glass-icon-button {
    width: 48px;
    height: 48px;
  }

  .progress-card {
    padding: 24px 21px 25px;
    border-radius: 22px;
  }

  .progress-card__top {
    gap: 12px;
  }

  .progress-badge {
    min-height: 29px;
    padding: 0 10px;
    font-size: 0.68rem;
  }

  .habit-card {
    min-height: 68px;
    padding-right: 6px;
  }

  .habit-toggle {
    gap: 11px;
  }

  .habit-actions {
    gap: 0;
  }

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

  .modal-card {
    padding: 23px 19px;
  }

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

  .background-choice {
    min-height: 54px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 11px;
    padding: 0 15px;
  }

  .background-choice svg {
    width: 20px;
  }

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

  .modal-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;
  }
}





