html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Outfit, sans-serif;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  background: #111827;
  color: rgba(255, 255, 255, 0.9);
}

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

a {
  text-decoration: none;
}

.ds-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.ds-brand-copy {
  display: flex;
  flex-direction: column;
}

.ds-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--color-brand-500), #14b8a6);
  color: var(--color-white);
  font-weight: 700;
  letter-spacing: 0.08em;
  box-shadow: var(--shadow-theme-lg);
}

.ds-body {
  min-height: 100vh;
}

.ds-app-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 20px 18px;
}

.ds-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid rgba(208, 213, 221, 0.9);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  border-radius: 30px;
  padding: 24px 28px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

.ds-topbar-main {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  min-width: 0;
}

.ds-topbar-copy {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.ds-topbar-copy h1 {
  margin: 0;
  color: #111827;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.02;
}

.ds-topbar-copy p {
  margin: 0;
  max-width: 62ch;
  color: var(--color-gray-600);
  font-size: 15px;
  line-height: 1.55;
}

.ds-topbar-meta {
  display: grid;
  gap: 14px;
  justify-items: end;
  min-width: 220px;
}

.ds-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  border-radius: 999px;
  background: rgba(70, 95, 255, 0.08);
  padding: 8px 12px;
  color: var(--color-brand-600);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ds-context-card {
  display: grid;
  gap: 4px;
  min-width: 210px;
  border-radius: 22px;
  border: 1px solid var(--color-gray-200);
  background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(244, 247, 251, 1));
  padding: 14px 16px;
  text-align: right;
}

.ds-context-card span {
  color: var(--color-gray-500);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ds-context-card strong {
  color: var(--color-gray-800);
  font-size: 18px;
  line-height: 1.2;
}

.ds-mini-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--color-brand-500), #14b8a6);
  padding: 12px 16px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 12px 28px rgba(70, 95, 255, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ds-mini-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(70, 95, 255, 0.24);
}

.ds-page-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
  padding: 4px;
}

.ds-page-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  border: 1px solid rgba(208, 213, 221, 0.9);
  background: rgba(255, 255, 255, 0.9);
  padding: 13px 18px;
  color: var(--color-gray-700);
  font-size: 14px;
  font-weight: 600;
  transition: 0.2s ease;
}

.ds-page-tab:hover {
  border-color: rgba(70, 95, 255, 0.28);
  color: var(--color-brand-600);
}

.ds-page-tab.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--color-brand-500), #14b8a6);
  color: #fff;
  box-shadow: 0 12px 28px rgba(70, 95, 255, 0.2);
}

.ds-main {
  padding-top: 24px;
}

.flash-stack {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.flash-message {
  border-radius: 16px;
  border: 1px solid rgba(208, 213, 221, 0.9);
  background: rgba(255, 255, 255, 0.92);
  padding: 14px 16px;
  font-size: 14px;
}

.flash-message.is-success {
  border-color: rgba(18, 183, 106, 0.18);
  background: var(--color-success-50);
  color: var(--color-success-700);
}

.flash-message.is-error {
  border-color: rgba(240, 68, 56, 0.18);
  background: var(--color-error-50);
  color: var(--color-error-700);
}

.dark .flash-message.is-success {
  background: rgba(18, 183, 106, 0.12);
}

.dark .flash-message.is-error {
  background: rgba(240, 68, 56, 0.12);
}

.ds-page-stack {
  display: grid;
  gap: 24px;
}

.ds-link-grid,
.ds-page-two-column,
.ds-dashboard-hero {
  display: grid;
  gap: 24px;
}

.ds-link-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ds-primary-only {
  display: grid;
}

.ds-page-two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ds-dashboard-hero {
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.95fr);
}

.ds-hero-panel,
.ds-quick-link {
  display: grid;
  gap: 12px;
  border-radius: 24px;
  border: 1px solid var(--color-gray-200);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 248, 255, 0.96));
  padding: 24px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.ds-hero-panel h2 {
  margin: 0;
  color: var(--color-gray-900);
  font-size: clamp(2rem, 3vw, 2.5rem);
  font-weight: 700;
  line-height: 1.05;
}

.ds-hero-panel > p:last-child {
  margin: 0;
  color: var(--color-gray-600);
  font-size: 15px;
  line-height: 1.6;
}

.ds-stat-ribbon {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.ds-stat-pill {
  border-radius: 18px;
  border: 1px solid rgba(208, 213, 221, 0.92);
  background: rgba(255, 255, 255, 0.9);
  padding: 16px;
}

.ds-stat-pill span {
  display: block;
  color: var(--color-gray-500);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ds-stat-pill strong {
  display: block;
  margin-top: 8px;
  color: var(--color-gray-900);
  font-size: 26px;
  line-height: 1.05;
}

.ds-quick-links {
  display: grid;
  gap: 14px;
}

.ds-quick-link {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.ds-quick-link:hover {
  transform: translateY(-1px);
  border-color: rgba(70, 95, 255, 0.24);
  box-shadow: var(--shadow-theme-md);
}

.ds-quick-link h3 {
  margin: 0 0 6px;
  color: var(--color-gray-900);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
}

.ds-quick-link p:last-child {
  margin: 0;
  color: var(--color-gray-600);
  font-size: 14px;
  line-height: 1.55;
}

.ds-quick-link-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  border-radius: 999px;
  background: rgba(70, 95, 255, 0.08);
  padding: 10px 12px;
  color: var(--color-brand-600);
  font-size: 13px;
  font-weight: 700;
}

.ds-scroll-target {
  scroll-margin-top: 24px;
}

.ds-shell-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(320px, 0.9fr);
  gap: 24px;
}

.ds-side-column,
.ds-log-groups,
.ds-manage-grid,
.ds-analysis-grid {
  display: grid;
  gap: 24px;
}

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

.ds-analysis-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.ds-analysis-grid > * {
  grid-column: span 4;
}

.ds-analysis-grid > .ds-wide-panel {
  grid-column: span 8;
}

.ds-primary-panel,
.ds-panel-head,
.ds-card-body,
.ds-panel-actions {
  width: 100%;
}

.ds-panel-head,
.ds-panel-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px;
}

.ds-panel-actions {
  flex-wrap: wrap;
}

.ds-card-body {
  padding: 20px 24px 24px;
}

.ds-kicker {
  margin: 0 0 6px;
  color: var(--color-brand-500);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ds-head-actions,
.ds-inline-form,
.ds-form-actions,
.ds-record-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ds-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--color-brand-500);
  padding: 12px 18px;
  color: var(--color-white);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  transition: 0.2s ease;
}

.ds-action:hover {
  background: var(--color-brand-600);
}

.ds-action-secondary {
  border-color: var(--color-gray-200);
  background: var(--color-white);
  color: var(--color-gray-700);
}

.ds-action-secondary:hover {
  background: var(--color-gray-50);
}

.dark .ds-action-secondary {
  border-color: var(--color-gray-800);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.9);
}

.ds-calendar-wrap {
  padding: 20px 24px 24px;
}

.ds-calendar-footer {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.ds-inline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ds-legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  border: 1px solid rgba(208, 213, 221, 0.92);
  background: rgba(255, 255, 255, 0.9);
  padding: 10px 14px;
  color: var(--color-gray-700);
  font-size: 13px;
  font-weight: 600;
}

.ds-calendar-labels {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
  color: var(--color-gray-500);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.ds-day-card {
  min-height: 118px;
  border-radius: 20px;
  border: 1px solid var(--color-gray-200);
  background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(249, 250, 251, 1));
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.ds-day-card:hover {
  transform: translateY(-1px);
  border-color: rgba(70, 95, 255, 0.25);
  box-shadow: var(--shadow-theme-md);
}

.ds-day-card.is-selected {
  border-color: var(--color-brand-500);
  box-shadow: var(--shadow-focus-ring);
}

.ds-day-card.is-dimmed {
  opacity: 0.55;
}

.ds-day-card.tone-strong {
  background: linear-gradient(180deg, rgba(242, 247, 255, 1), rgba(236, 243, 255, 1));
}

.ds-day-card.tone-mixed {
  background: linear-gradient(180deg, rgba(255, 250, 245, 1), rgba(255, 246, 237, 1));
}

.ds-day-card.tone-missed {
  background: linear-gradient(180deg, rgba(255, 251, 250, 1), rgba(254, 243, 242, 1));
}

.ds-day-card.tone-future {
  background: linear-gradient(180deg, rgba(249, 250, 251, 1), rgba(242, 244, 247, 1));
}

.dark .ds-day-card {
  border-color: var(--color-gray-800);
  background: rgba(255, 255, 255, 0.03);
}

.dark .ds-day-card.tone-strong {
  background: rgba(70, 95, 255, 0.09);
}

.dark .ds-day-card.tone-mixed {
  background: rgba(247, 144, 9, 0.1);
}

.dark .ds-day-card.tone-missed {
  background: rgba(240, 68, 56, 0.08);
}

.ds-day-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  color: var(--color-gray-500);
  font-size: 12px;
  font-weight: 600;
}

.ds-day-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--color-white);
  color: var(--color-gray-800);
  font-size: 15px;
  font-weight: 700;
  box-shadow: var(--shadow-theme-xs);
}

.dark .ds-day-number {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.9);
}

.ds-day-number.is-today {
  background: var(--color-brand-500);
  color: var(--color-white);
}

.ds-dot-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ds-dot {
  --dot-color: var(--color-brand-500);
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--dot-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--dot-color) 12%, transparent);
}

.ds-dot.large {
  width: 14px;
  height: 14px;
}

.ds-dot-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 28px;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--color-gray-100);
  color: var(--color-gray-600);
  box-shadow: none;
  font-size: 11px;
  font-weight: 700;
}

.dark .ds-dot-more {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
}

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

.ds-summary-pill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.ds-summary-pill {
  border-radius: 18px;
  border: 1px solid var(--color-gray-200);
  background: var(--color-gray-50);
  padding: 16px;
}

.ds-summary-pill span {
  display: block;
  color: var(--color-gray-500);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ds-summary-pill strong {
  display: block;
  margin-top: 8px;
  color: var(--color-gray-800);
  font-size: 24px;
  line-height: 1.1;
}

.dark .ds-summary-pill {
  border-color: var(--color-gray-800);
  background: rgba(255, 255, 255, 0.03);
}

.dark .ds-summary-pill strong {
  color: rgba(255, 255, 255, 0.9);
}

.ds-metric-card {
  border-radius: 18px;
  border: 1px solid var(--color-gray-200);
  background: var(--color-gray-50);
  padding: 16px;
}

.dark .ds-metric-card {
  border-color: var(--color-gray-800);
  background: rgba(255, 255, 255, 0.03);
}

.ds-metric-card span {
  display: block;
  color: var(--color-gray-500);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ds-metric-card strong {
  display: block;
  margin-top: 8px;
  color: var(--color-gray-800);
  font-size: 24px;
  line-height: 1.1;
}

.dark .ds-metric-card strong {
  color: rgba(255, 255, 255, 0.9);
}

.ds-legend-list,
.ds-goal-stack,
.ds-warning-list,
.ds-goal-analysis-list {
  display: grid;
  gap: 14px;
}

.ds-legend-row,
.ds-goal-analysis-item,
.ds-warning-item {
  display: grid;
  gap: 10px;
  border-radius: 16px;
  border: 1px solid var(--color-gray-200);
  background: var(--color-gray-50);
  padding: 14px 16px;
}

.dark .ds-legend-row,
.dark .ds-goal-analysis-item,
.dark .ds-warning-item {
  border-color: var(--color-gray-800);
  background: rgba(255, 255, 255, 0.03);
}

.ds-legend-meta,
.ds-goal-meta,
.ds-record-meta {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ds-legend-meta strong,
.ds-goal-meta strong,
.ds-record-meta strong,
.ds-warning-item strong,
.ds-health-row strong {
  color: var(--color-gray-800);
  font-weight: 600;
}

.dark .ds-legend-meta strong,
.dark .ds-goal-meta strong,
.dark .ds-record-meta strong,
.dark .ds-warning-item strong,
.dark .ds-health-row strong {
  color: rgba(255, 255, 255, 0.9);
}

.ds-legend-meta p,
.ds-warning-item p,
.ds-goal-analysis-item p,
.ds-record-meta p,
.ds-health-row p {
  margin: 2px 0 0;
  color: var(--color-gray-500);
  font-size: 13px;
}

.ds-progress {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: var(--color-gray-200);
}

.dark .ds-progress {
  background: rgba(255, 255, 255, 0.08);
}

.ds-progress-fill {
  --track-color: var(--color-brand-500);
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--track-color) 68%, white), var(--track-color));
}

.ds-callout {
  margin: 0 24px;
  border-radius: 16px;
  border: 1px solid rgba(247, 144, 9, 0.18);
  background: var(--color-warning-50);
  padding: 14px 16px;
  color: var(--color-warning-700);
  font-size: 14px;
}

.dark .ds-callout {
  background: rgba(247, 144, 9, 0.12);
}

.ds-callout-inline {
  margin: 16px 0 0;
}

.ds-log-groups {
  padding: 20px 24px 24px;
}

.ds-log-group {
  display: grid;
  gap: 16px;
}

.ds-log-group-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.ds-log-card {
  border-radius: 20px;
  border: 1px solid var(--color-gray-200);
  background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(249, 250, 251, 1));
  padding: 18px;
  box-shadow: inset 3px 0 0 var(--habit-color, var(--color-brand-500));
  display: grid;
  gap: 14px;
}

.dark .ds-log-card {
  border-color: var(--color-gray-800);
  background: rgba(255, 255, 255, 0.03);
}

.ds-log-card-top,
.ds-check {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ds-check {
  align-items: center;
  justify-content: flex-start;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-gray-700);
}

.dark .ds-check {
  color: rgba(255, 255, 255, 0.75);
}

.ds-check input {
  accent-color: var(--color-brand-500);
  width: 18px;
  height: 18px;
}

.ds-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ds-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(70, 95, 255, 0.08);
  padding: 8px 12px;
  color: var(--color-brand-600);
  font-size: 12px;
  font-weight: 700;
}

.dark .ds-chip {
  background: rgba(70, 95, 255, 0.16);
  color: var(--color-brand-300);
}

.ds-form-grid,
.ds-half-grid {
  display: grid;
  gap: 12px;
}

.ds-form-grid {
  grid-template-columns: 140px minmax(0, 1fr);
}

.ds-note-field {
  min-width: 0;
}

.ds-goal-mini {
  display: grid;
  gap: 8px;
  border-radius: 16px;
  border: 1px solid var(--color-gray-200);
  background: rgba(255, 255, 255, 0.6);
  padding: 12px 14px;
}

.dark .ds-goal-mini {
  border-color: var(--color-gray-800);
  background: rgba(255, 255, 255, 0.03);
}

.ds-goal-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.ds-card-body {
  display: grid;
  gap: 18px;
}

.ds-app-form {
  display: grid;
  gap: 14px;
}

.ds-app-form label {
  display: grid;
  gap: 8px;
  color: var(--color-gray-700);
  font-size: 14px;
  font-weight: 500;
}

.dark .ds-app-form label {
  color: rgba(255, 255, 255, 0.85);
}

.app-input,
.app-textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--color-gray-200);
  background: transparent;
  padding: 12px 14px;
  color: var(--color-gray-800);
  font-size: 14px;
  outline: none;
}

.app-input:focus,
.app-textarea:focus {
  border-color: var(--color-brand-300);
  box-shadow: var(--shadow-focus-ring);
}

.dark .app-input,
.dark .app-textarea {
  border-color: var(--color-gray-800);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.9);
}

.app-textarea {
  resize: vertical;
  min-height: 96px;
}

.app-color-input {
  min-height: 48px;
  padding: 6px;
}

.app-input-small {
  min-height: 48px;
}

.ds-record-list {
  display: grid;
  gap: 12px;
  max-height: 340px;
  overflow: auto;
  padding-right: 4px;
}

.ds-empty-state {
  display: grid;
  gap: 8px;
  border-radius: 18px;
  border: 1px dashed var(--color-gray-300);
  background: rgba(249, 250, 251, 0.9);
  padding: 18px;
}

.ds-empty-state strong {
  color: var(--color-gray-800);
}

.ds-empty-state p {
  margin: 0;
  color: var(--color-gray-500);
  font-size: 14px;
  line-height: 1.5;
}

.ds-record-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 16px;
  border: 1px solid var(--color-gray-200);
  background: var(--color-gray-50);
  padding: 14px 16px;
}

.ds-record-row.stacked {
  align-items: flex-start;
}

.ds-record-actions form {
  margin: 0;
}

.dark .ds-record-row {
  border-color: var(--color-gray-800);
  background: rgba(255, 255, 255, 0.03);
}

.ds-text-link {
  color: var(--color-brand-600);
  font-size: 14px;
  font-weight: 600;
  background: none;
  border: 0;
  padding: 0;
}

.ds-text-link:hover {
  color: var(--color-brand-700);
}

.ds-text-danger {
  color: var(--color-error-600);
}

.ds-text-danger:hover {
  color: var(--color-error-700);
}

.ds-week-bars {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  min-height: 240px;
}

.ds-week-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ds-week-bar strong,
.ds-warning-item span {
  color: var(--color-gray-800);
  font-size: 14px;
  font-weight: 700;
}

.dark .ds-week-bar strong,
.dark .ds-warning-item span {
  color: rgba(255, 255, 255, 0.9);
}

.ds-week-bar span {
  color: var(--color-gray-500);
  font-size: 12px;
}

.ds-week-bar-track {
  width: 100%;
  height: 180px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(228, 231, 236, 0.8), rgba(228, 231, 236, 0.3));
}

.dark .ds-week-bar-track {
  background: rgba(255, 255, 255, 0.06);
}

.ds-week-bar-fill {
  width: 100%;
  min-height: 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--color-brand-400), var(--color-brand-600));
}

.ds-warning-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.ds-goal-analysis-item {
  gap: 8px;
}

.ds-health-table {
  display: grid;
  gap: 12px;
}

.ds-health-head,
.ds-health-row {
  display: grid;
  grid-template-columns: 1.6fr 0.8fr 0.8fr 0.8fr 1.4fr;
  gap: 16px;
  align-items: center;
}

.ds-health-head {
  padding: 0 4px;
  color: var(--color-gray-500);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ds-health-row {
  border-radius: 18px;
  border: 1px solid var(--color-gray-200);
  background: var(--color-gray-50);
  padding: 16px;
}

.dark .ds-health-row {
  border-color: var(--color-gray-800);
  background: rgba(255, 255, 255, 0.03);
}

.ds-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 6px 12px;
  color: var(--color-gray-500);
  font-size: 13px;
}

@media (max-width: 1380px) {
  .ds-link-grid,
  .ds-dashboard-hero,
  .ds-page-two-column,
  .ds-shell-grid {
    grid-template-columns: 1fr;
  }

  .ds-manage-grid {
    grid-template-columns: 1fr;
  }

  .ds-analysis-grid > *,
  .ds-analysis-grid > .ds-wide-panel {
    grid-column: span 12;
  }
}

@media (max-width: 1100px) {
  .ds-topbar {
    flex-direction: column;
  }

  .ds-topbar-meta {
    width: 100%;
    justify-items: stretch;
  }

  .ds-context-card {
    text-align: left;
  }

  .ds-log-grid {
    grid-template-columns: 1fr;
  }

  .ds-form-grid,
  .ds-health-head,
  .ds-health-row {
    grid-template-columns: 1fr;
  }

  .ds-health-head {
    display: none;
  }
}

@media (max-width: 900px) {
  .ds-stat-ribbon {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ds-calendar-labels,
  .ds-calendar-grid {
    gap: 8px;
  }

  .ds-day-card {
    min-height: 92px;
    padding: 10px;
  }

  .ds-day-number {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    font-size: 13px;
  }

  .ds-metric-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .ds-app-shell {
    padding: 18px 14px 14px;
  }

  .ds-topbar {
    padding: 20px 18px;
    border-radius: 24px;
  }

  .ds-topbar-main {
    flex-direction: column;
  }

  .ds-brand {
    width: 100%;
  }

  .ds-panel-head,
  .ds-panel-actions,
  .ds-log-card-top,
  .ds-record-row,
  .ds-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .ds-inline-form,
  .ds-head-actions {
    width: 100%;
  }

  .ds-inline-form .app-input,
  .ds-inline-form .ds-action,
  .ds-head-actions .ds-action,
  .ds-form-actions .ds-action,
  .ds-mini-action {
    width: 100%;
  }

  .ds-metric-grid,
  .ds-summary-pill-grid,
  .ds-stat-ribbon {
    grid-template-columns: 1fr;
  }

  .ds-calendar-grid,
  .ds-calendar-labels {
    grid-template-columns: repeat(7, minmax(42px, 1fr));
    overflow-x: auto;
  }

  .ds-calendar-wrap {
    overflow-x: auto;
  }

  .ds-log-groups,
  .ds-calendar-wrap,
  .ds-card-body,
  .ds-panel-head,
  .ds-panel-actions {
    padding-left: 16px;
    padding-right: 16px;
  }

  .ds-quick-link {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Navigation Bar
   ═══════════════════════════════════════════════════════════════════════════ */

.ds-nav {
  background: rgba(17, 24, 39, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.ds-nav-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ds-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
}

.ds-nav-brand svg {
  color: var(--color-brand-400, #818cf8);
}

.ds-nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ds-nav-user {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s;
}

.ds-nav-user:hover {
  color: #fff;
}

.ds-nav-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s;
}

.ds-nav-logout:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Auth — Enterprise split-pane
   ═══════════════════════════════════════════════════════════════════════════ */

.auth-shell {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  background: radial-gradient(120% 100% at 0% 0%, #1a1f33 0%, #0a0e1a 55%);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  color: rgba(255, 255, 255, 0.9);
}
.auth-shell-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100%;
}
@media (min-width: 900px) {
  .auth-shell-inner { flex-direction: row; align-items: stretch; }
}

/* ── Left — Hero ── */
.auth-hero {
  flex: 1;
  position: relative;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 56px 64px;
  background:
    radial-gradient(80% 60% at 20% 10%, rgba(99, 102, 241, 0.22), transparent 60%),
    radial-gradient(60% 50% at 90% 90%, rgba(34, 197, 94, 0.12), transparent 60%),
    linear-gradient(180deg, #131a2c 0%, #0d1220 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
  min-width: 0;
}
@media (min-width: 900px) { .auth-hero { display: flex; } }
@media (min-width: 1200px) { .auth-hero { padding: 64px 72px; } }

.auth-hero-brand,
.auth-hero-body,
.auth-hero-foot {
  width: 100%;
  max-width: 520px;
  position: relative;
  z-index: 1;
}

.auth-hero-orbs { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.auth-hero-orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.45; }
.auth-hero-orb-1 {
  width: 360px; height: 360px; top: -80px; left: -80px; background: #6366f1;
  animation: orbFloat 14s ease-in-out infinite;
}
.auth-hero-orb-2 {
  width: 280px; height: 280px; bottom: -60px; right: -60px; background: #22c55e; opacity: 0.3;
  animation: orbFloat 18s ease-in-out infinite reverse;
}
.auth-hero-orb-3 {
  width: 200px; height: 200px; top: 50%; right: 20%; background: #a855f7; opacity: 0.22;
  animation: orbFloat 22s ease-in-out infinite;
}
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(40px, -30px); }
}

.auth-hero-brand { display: flex; align-items: center; gap: 10px; }
.auth-hero-mark {
  width: 36px; height: 36px; border-radius: 11px; background: #6366f1; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px; letter-spacing: -0.02em;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.45);
}
.auth-hero-name { font-size: 16px; font-weight: 700; color: #fff; letter-spacing: -0.01em; }

.auth-hero-body { display: flex; flex-direction: column; }
.auth-hero-title {
  margin: 0 0 20px;
  font-size: 44px; font-weight: 700; line-height: 1.06; letter-spacing: -0.03em;
  background: linear-gradient(180deg, #ffffff 0%, rgba(255,255,255,0.72) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
@media (min-width: 1200px) { .auth-hero-title { font-size: 50px; } }
.auth-hero-sub {
  margin: 0 0 40px; font-size: 16.5px; line-height: 1.55;
  color: rgba(255, 255, 255, 0.62); max-width: 480px;
}

.auth-hero-mock { max-width: 460px; margin-bottom: 36px; }
.auth-mock-card {
  background: linear-gradient(180deg, #1a2032 0%, #131826 100%);
  border: 1px solid rgba(255,255,255,0.07); border-radius: 18px; padding: 20px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.02) inset;
}
.auth-mock-card-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px;
}
.auth-mock-month { display: block; font-size: 15px; font-weight: 700; color: #fff; letter-spacing: -0.015em; }
.auth-mock-sub { display: block; font-size: 11.5px; font-weight: 500; color: rgba(255,255,255,0.45); margin-top: 2px; }
.auth-mock-ring { position: relative; width: 42px; height: 42px; }
.auth-mock-ring-pct {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff;
}
.auth-mock-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.auth-mock-cell {
  aspect-ratio: 1; border-radius: 7px; background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.04);
  display: flex; align-items: center; justify-content: center; gap: 1px; padding: 2px;
}
.auth-mock-cell.is-today {
  background: rgba(99,102,241,0.18); border-color: rgba(99,102,241,0.45);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.2);
}
.auth-mock-cell i { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--d, transparent); }

.auth-hero-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0; max-width: 460px; margin: 0; padding: 18px 0 0;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.auth-hero-stat { display: flex; flex-direction: column; gap: 6px; padding: 4px 16px; }
.auth-hero-stat:first-child { padding-left: 0; }
.auth-hero-stat:last-child  { padding-right: 0; }
.auth-hero-stat + .auth-hero-stat { border-left: 1px solid rgba(255,255,255,0.07); }
.auth-hero-stat-key { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.42); }
.auth-hero-stat-val { margin: 0; font-size: 24px; font-weight: 700; color: #fff; letter-spacing: -0.02em; line-height: 1; display: inline-flex; align-items: baseline; gap: 3px; }
.auth-hero-stat-val span { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.45); letter-spacing: 0; }

.auth-hero-foot { font-size: 12px; color: rgba(255,255,255,0.35); }
.auth-hero-foot a { color: rgba(255,255,255,0.55); text-decoration: none; }
.auth-hero-foot a:hover { color: #818cf8; }

/* ── Right — Form pane ── */
.auth-pane {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 40px 24px; position: relative; min-width: 0;
}
@media (min-width: 900px)  { .auth-pane { padding: 56px 48px; } }
@media (min-width: 1200px) { .auth-pane { padding: 64px 64px; } }

.auth-card {
  width: 100%; max-width: 420px; background: transparent; border: none; padding: 0; box-shadow: none;
  animation: authCardIn 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@media (min-width: 900px) {
  .auth-card {
    max-width: 432px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px; padding: 40px 36px;
    box-shadow: 0 30px 60px -20px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.015) inset;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  }
}
@keyframes authCardIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-mobile-brand {
  display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 36px;
}
@media (min-width: 900px) { .auth-mobile-brand { display: none; } }

.auth-card-head { margin-bottom: 32px; }
.auth-form-title { margin: 0 0 8px; font-size: 26px; font-weight: 800; color: #fff; letter-spacing: -0.02em; line-height: 1.2; }
.auth-form-sub { margin: 0; font-size: 14px; color: rgba(255,255,255,0.55); line-height: 1.5; }

.auth-form { display: flex; flex-direction: column; gap: 14px; }

.auth-input { position: relative; display: block; }
.auth-input input {
  width: 100%; height: 52px; padding: 0 14px 0 42px;
  background: rgba(255,255,255,0.035); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 13px; color: #fff; font-size: 14.5px; outline: none; font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.auth-input input::placeholder { color: transparent; }
.auth-input input:focus {
  border-color: rgba(99,102,241,0.6); background: rgba(255,255,255,0.05);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.18);
}
.auth-input label {
  position: absolute; left: 42px; top: 50%; transform: translateY(-50%);
  font-size: 14.5px; font-weight: 500; color: rgba(255,255,255,0.45);
  pointer-events: none; transition: opacity 0.18s ease, transform 0.18s ease;
  background: transparent; padding: 0; max-width: calc(100% - 60px);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.auth-input input:focus + label,
.auth-input input:not(:placeholder-shown) + label {
  opacity: 0; transform: translateY(-50%) translateX(-4px);
}
.auth-input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: rgba(255,255,255,0.35); pointer-events: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.auth-input input:focus ~ .auth-input-icon { color: #a5b4fc; }

.auth-toggle-pw {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: rgba(255,255,255,0.4); cursor: pointer; padding: 6px;
  display: inline-flex; border-radius: 8px; transition: color 0.2s, background 0.2s; z-index: 2;
}
.auth-toggle-pw:hover { color: #fff; background: rgba(255,255,255,0.06); }

.auth-submit {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 22px; min-height: 52px; border: none; border-radius: 13px;
  background: #6366f1; color: #fff; font-family: inherit; font-size: 14.5px; font-weight: 700;
  letter-spacing: -0.01em; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
  box-shadow: 0 10px 26px rgba(99,102,241,0.38); margin-top: 10px;
  -webkit-tap-highlight-color: transparent;
}
.auth-submit svg { transition: transform 0.2s; }
.auth-submit:hover { background: #5253e6; box-shadow: 0 14px 32px rgba(99,102,241,0.48); }
.auth-submit:hover svg { transform: translateX(2px); }
.auth-submit:active { transform: scale(0.99); }

.auth-switch { text-align: center; margin: 26px 0 0; font-size: 13.5px; color: rgba(255,255,255,0.5); }
.auth-switch a { color: #a5b4fc; font-weight: 700; text-decoration: none; }
.auth-switch a:hover { color: #c7d2fe; text-decoration: underline; }

@media (max-width: 768px) {
  .auth-pane { padding: 36px 22px 48px; }
  .auth-mobile-brand { margin-bottom: 32px; }
  .auth-card-head { margin-bottom: 28px; }
  .auth-form { gap: 12px; }
  .auth-submit { margin-top: 12px; }
  .auth-switch { margin-top: 24px; }
}
@media (max-width: 480px) {
  .auth-pane { padding: 28px 20px 44px; }
  .auth-mobile-brand { margin-bottom: 28px; gap: 9px; }
  .auth-mobile-brand .auth-hero-mark { width: 32px; height: 32px; font-size: 15px; border-radius: 10px; }
  .auth-mobile-brand .auth-hero-name { font-size: 15px; }
  .auth-card-head { margin-bottom: 24px; }
  .auth-form-title { font-size: 22px; }
  .auth-form-sub { font-size: 13.5px; }
  .auth-form { gap: 12px; }
  .auth-input input { font-size: 16px; height: 50px; }
  .auth-input label { font-size: 16px; }
  .auth-submit { min-height: 50px; margin-top: 14px; }
  .auth-switch { margin-top: 22px; font-size: 13px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Account Settings Page
   ═══════════════════════════════════════════════════════════════════════════ */

.account-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 0 40px;
}

.account-header {
  margin-bottom: 32px;
}

.account-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 16px;
  transition: color 0.2s;
}

.account-back:hover {
  color: var(--color-brand-400, #818cf8);
}

.account-header h1 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
}

.account-header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.45);
  font-size: 14px;
  line-height: 1.5;
}

.account-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.account-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 28px;
}

.account-card-danger {
  border-color: rgba(239, 68, 68, 0.2);
}

.account-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  color: rgba(255, 255, 255, 0.85);
}

.account-card-danger .account-card-head {
  color: #f87171;
}

.account-card-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.account-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.account-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.account-field label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 600;
}

.account-input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 46px;
}

.account-input:focus {
  border-color: var(--color-brand-400, #818cf8);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.account-input-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.account-hint {
  color: rgba(255, 255, 255, 0.3);
  font-size: 12px;
}

.account-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin: 4px 0;
}

.account-btn {
  align-self: flex-start;
  min-height: 44px;
}

.account-btn-danger {
  align-self: flex-start;
  padding: 12px 20px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
  min-height: 44px;
}

.account-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: 0.2s;
  min-height: 44px;
}

.account-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

.ds-dialog {
  background: #1f2937;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 28px;
  color: white;
  width: min(420px, calc(100vw - 32px));
  max-width: 420px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Slide-in animation for flash messages
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Enhanced Mobile Responsiveness
   ═══════════════════════════════════════════════════════════════════════════ */

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

  .ds-nav-inner {
    padding: 0 12px;
    height: 50px;
  }

  .ds-nav-user {
    display: none;
  }

  .ds-nav-brand span {
    font-size: 14px;
  }

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

  .auth-title {
    font-size: 20px;
  }

  .ds-day-card {
    min-height: 70px;
    padding: 6px;
    border-radius: 12px;
  }

  .ds-day-number {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    font-size: 12px;
  }

  .ds-day-top small {
    font-size: 10px;
  }

  .ds-dot {
    width: 8px;
    height: 8px;
  }

  .ds-dot-stack {
    gap: 4px;
  }

  .ds-calendar-labels,
  .ds-calendar-grid {
    gap: 4px;
  }

  .ds-calendar-labels span {
    font-size: 10px;
  }

  .ds-dialog {
    padding: 20px 16px;
    border-radius: 16px;
  }

  .ds-panel-head {
    padding: 16px !important;
    gap: 12px !important;
  }

  .ds-calendar-footer {
    padding: 16px !important;
  }

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

  .account-header h1 {
    font-size: 22px;
  }

  .account-btn,
  .account-btn-danger {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 360px) {
  .ds-calendar-labels,
  .ds-calendar-grid {
    grid-template-columns: repeat(7, minmax(36px, 1fr));
  }

  .ds-day-card {
    min-height: 56px;
    padding: 4px;
  }

  .ds-dot-stack {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Mobile Navigation — Hamburger Menu
   ═══════════════════════════════════════════════════════════════════════════ */

.ds-nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: 0.2s;
}

.ds-nav-hamburger:active {
  background: rgba(255, 255, 255, 0.08);
}

.ds-mobile-menu {
  display: none;
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(17, 24, 39, 0.98);
  backdrop-filter: blur(20px);
  z-index: 999;
  flex-direction: column;
  padding: 24px 20px;
  gap: 8px;
}

.ds-mobile-menu.open {
  display: flex;
}

.ds-mobile-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 12px;
  transition: 0.2s;
}

.ds-mobile-menu a:hover,
.ds-mobile-menu a:active {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.ds-mobile-menu .mobile-logout {
  color: #f87171;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.15);
  margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Tablet & Mobile — 768px
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .ds-nav-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .ds-nav-right {
    gap: 8px;
  }

  .ds-nav-user {
    display: none;
  }

  .ds-nav-brand span {
    font-size: 14px;
  }

  .ds-nav-inner {
    padding: 0 14px;
  }

  .ds-app-shell {
    padding: 14px 10px 100px;
  }

  .ds-calendar-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }

  .ds-calendar-labels,
  .ds-calendar-grid {
    min-width: 700px;
    gap: 4px;
  }

  .ds-calendar-labels span {
    font-size: 11px;
  }

  .ds-day-card {
    min-height: 78px;
    padding: 8px 6px;
  }

  .ds-panel-head {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 16px !important;
    padding: 18px !important;
  }

  .ds-panel-head > div:last-child {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .account-page {
    max-width: 100%;
    padding: 0 4px 120px;
  }

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

  .account-header h1 {
    font-size: 22px;
  }

  .account-field > div {
    flex-direction: column;
  }

  .account-btn,
  .account-btn-danger,
  .account-btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .ds-dialog {
    width: calc(100vw - 24px);
    max-width: none;
    padding: 24px 18px;
    border-radius: 20px;
  }

  dialog {
    margin: 0;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 90vh;
    overflow-y: auto;
  }

  .flash-stack {
    bottom: 90px !important;
    right: 12px !important;
    left: 12px !important;
  }

  .flash-message {
    font-size: 13px;
    padding: 12px 16px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Small Mobile — 480px (extends existing 480px breakpoint)
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
  .ds-nav-inner {
    height: 48px;
  }

  .ds-nav-logout {
    display: none;
  }

  .ds-nav-right {
    gap: 4px;
  }

  .auth-card {
    padding: 24px 16px;
    border-radius: 18px;
    max-width: 100%;
  }

  .auth-title {
    font-size: 20px;
  }

  .auth-brand {
    margin-bottom: 24px;
  }

  .auth-input-wrap input {
    padding: 10px 12px 10px 38px;
    font-size: 16px;
    min-height: 48px;
  }

  .auth-submit {
    min-height: 50px;
    font-size: 16px;
  }

  .account-card {
    border-radius: 14px;
  }

  .account-input {
    font-size: 16px;
    min-height: 48px;
  }

  input[type="month"].app-input {
    width: 100%;
    min-height: 44px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Mobile Bottom Navigation Bar
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .ds-mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.97);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 998;
    padding: 6px 16px;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    justify-content: space-around;
    align-items: center;
    height: 64px;
  }

  .ds-mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 14px;
    color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    border-radius: 12px;
    transition: 0.2s;
    min-width: 60px;
    -webkit-tap-highlight-color: transparent;
  }

  .ds-mobile-nav-item svg {
    width: 22px;
    height: 22px;
  }

  .ds-mobile-nav-item.active {
    color: #818cf8;
    background: rgba(99,102,241,0.1);
  }

  .ds-mobile-nav-item:active {
    background: rgba(255, 255, 255, 0.06);
    transform: scale(0.95);
  }
}

@media (min-width: 769px) {
  .ds-mobile-bottom-nav {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Touch Target & Usability Improvements
   ═══════════════════════════════════════════════════════════════════════════ */

@media (pointer: coarse) {
  .ds-day-card {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
  }

  .ds-day-card:active {
    transform: scale(0.96);
    transition: transform 0.1s;
  }

  button,
  .ds-action,
  .auth-submit,
  .account-btn,
  .account-btn-danger,
  .account-btn-secondary,
  a[role="button"] {
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
  }

  input[type="checkbox"] {
    min-width: 24px;
    min-height: 24px;
  }

  input[type="radio"] {
    min-width: 22px;
    min-height: 22px;
  }

  .status-btn {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  select,
  input[type="month"] {
    min-height: 44px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Prevent horizontal overflow
   ═══════════════════════════════════════════════════════════════════════════ */

body {
  overflow-x: hidden;
  max-width: 100vw;
}

img, svg, video, canvas {
  max-width: 100%;
  height: auto;
}

.ds-calendar-wrap::-webkit-scrollbar {
  height: 4px;
}

.ds-calendar-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.ds-calendar-wrap::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Mobile Dashboard Layout — Efficiency-Focused
   ═══════════════════════════════════════════════════════════════════════════ */

/* Show/hide desktop vs mobile layouts */
.ds-desktop-layout { display: block; }
.ds-mobile-layout { display: none; }

@media (max-width: 767px) {
  .ds-desktop-layout { display: none; }
  .ds-mobile-layout { display: block; }
}

/* ── Month Selector Bar ─────────────────────────────────────────────── */

.mob-month-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 0 16px;
}

.mob-month-label {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  min-width: 130px;
  text-align: center;
}

.mob-month-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 18px;
  font-weight: 600;
  transition: 0.2s;
}

.mob-month-arrow:active {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* ── Efficiency Score Card ──────────────────────────────────────────── */

/* ── Efficiency Score Card ──────────────────────────────────────────── */

.mob-efficiency-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 22px;
  padding: 24px 20px 20px;
  margin-bottom: 14px;
}

/* Ring */
.mob-eff-ring-wrap {
  position: relative;
  width: 130px;
  height: 130px;
  margin: 0 auto 16px;
}

.mob-eff-ring {
  width: 130px;
  height: 130px;
  filter: drop-shadow(0 0 20px rgba(99,102,241,0.15));
}

.mob-eff-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.mob-eff-pct {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.02em;
}

.mob-eff-pct small {
  font-size: 16px;
  font-weight: 600;
  opacity: 0.6;
  margin-left: 1px;
}

.mob-eff-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  font-weight: 600;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Stats row */
.mob-eff-stats {
  display: flex;
  gap: 0;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 16px;
}

.mob-eff-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 6px;
}

.mob-eff-stat + .mob-eff-stat {
  border-left: 1px solid rgba(255,255,255,0.06);
}

.mob-eff-stat strong {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.mob-eff-stat span {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Today Quick-Log Card ───────────────────────────────────────────── */

.mob-today-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 16px;
}

.mob-today-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.mob-today-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.mob-today-date-badge {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.05);
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
}

/* Smooth dialog animation — uses keyframes since display:none→block kills transitions */
@keyframes dialogIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.ds-dialog[open] {
  animation: dialogIn 0.2s ease forwards;
}

dialog::backdrop {
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Habit toggle rows */
.mob-habit-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 18px;
}

.mob-habit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
  border: 1.5px solid rgba(255,255,255,0.05);
  cursor: pointer;
  transition: 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.mob-habit-row.is-done {
  background: rgba(99,102,241,0.08);
  border-color: rgba(99,102,241,0.25);
  box-shadow: 0 0 12px rgba(99,102,241,0.06);
}

.mob-habit-row:active {
  background: rgba(255,255,255,0.06);
  transform: scale(0.985);
}

.mob-habit-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mob-habit-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mob-habit-name {
  font-size: 15px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
}

/* Custom toggle switch replacing native checkbox */
.mob-toggle {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mob-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.mob-toggle-knob {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  transition: 0.25s;
  position: relative;
}

.mob-toggle-knob::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
  transition: 0.25s;
}

.mob-toggle input:checked + .mob-toggle-knob {
  background: rgba(99,102,241,0.3);
  border-color: rgba(99,102,241,0.5);
}

.mob-toggle input:checked + .mob-toggle-knob::after {
  left: 23px;
  background: #818cf8;
  box-shadow: 0 2px 8px rgba(99,102,241,0.4);
}

/* Empty state */
.mob-empty-state {
  text-align: center;
  padding: 24px;
  color: rgba(255,255,255,0.3);
  font-size: 14px;
}

.mob-empty-state p {
  margin: 8px 0 0;
}

/* Day status chips */
.mob-status-chips {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.mob-status-chip {
  flex: 1;
  min-width: 60px;
  text-align: center;
  padding: 8px 4px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  transition: 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.mob-status-chip input { display: none; }

.mob-status-chip.is-active,
.mob-status-chip:has(input:checked) {
  color: #fff;
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
}

.mob-status-chip.chip-green:has(input:checked) {
  background: rgba(34,197,94,0.2);
  border-color: rgba(34,197,94,0.4);
  color: #4ade80;
}

.mob-status-chip.chip-yellow:has(input:checked) {
  background: rgba(234,179,8,0.2);
  border-color: rgba(234,179,8,0.4);
  color: #facc15;
}

.mob-status-chip.chip-red:has(input:checked) {
  background: rgba(239,68,68,0.2);
  border-color: rgba(239,68,68,0.4);
  color: #f87171;
}

/* Save button */
.mob-save-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #6366f1, #14b8a6);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.mob-save-btn:active {
  opacity: 0.85;
}

/* ── Week Strip ─────────────────────────────────────────────────────── */

.mob-section {
  margin-bottom: 20px;
}

.mob-section-title {
  font-size: 14px;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mob-week-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.mob-week-day {
  flex: 1;
  min-width: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
  transition: 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.mob-week-day:active {
  background: rgba(255,255,255,0.08);
}

.mob-week-day.is-today {
  background: rgba(99,102,241,0.15);
  border-color: rgba(99,102,241,0.3);
}

.mob-week-day.tone-strong {
  border-color: rgba(34,197,94,0.2);
}

.mob-week-day-name {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
}

.mob-week-day-num {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

/* Week progress bars */
.mob-week-bar-wrap {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.mob-week-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: #4ade80;
  transition: width 0.4s;
}

/* ── Month Heatmap (GitHub-style) ──────────────────────────────────── */

.mob-heatmap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.mob-heat-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.15s;
  -webkit-tap-highlight-color: transparent;
  min-width: 32px;
  min-height: 32px;
}

.mob-heat-num {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  line-height: 1;
}

.mob-heat-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  max-width: 100%;
  padding: 0 2px;
}

.mob-heat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mob-heat-cell.lvl--1 .mob-heat-num { color: rgba(255,255,255,0.12); }
.mob-heat-cell.lvl-0  { background: rgba(255,255,255,0.02); }
.mob-heat-cell.lvl--1, .mob-heat-cell.lvl-1, .mob-heat-cell.lvl-2, .mob-heat-cell.lvl-3 { background: rgba(255,255,255,0.03); }

/* Day status background fills — like desktop calendar */
.mob-heat-cell.status-green  { background: rgba(34,197,94,0.12); }
.mob-heat-cell.status-yellow { background: rgba(234,179,8,0.12); }
.mob-heat-cell.status-red    { background: rgba(239,68,68,0.12); }

/* Today highlight */
.mob-heat-cell.is-today {
  outline: 2px solid #818cf8;
  outline-offset: 2px;
}
.mob-heat-cell.is-today .mob-heat-num { color: #fff; font-weight: 700; }

/* ── Category Progress Bars ─────────────────────────────────────────── */

.mob-cat-progress-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mob-cat-progress-item {
  background: rgba(255,255,255,0.02);
  border-radius: 14px;
  padding: 12px 14px;
}

.mob-cat-progress-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.mob-cat-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mob-cat-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
}

.mob-cat-pct {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.5);
}

.mob-cat-bar-bg {
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}

.mob-cat-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ── Category Edit/Delete on Mobile ─────────────────────────────────── */

.mob-cat-actions {
  display: flex;
  gap: 6px;
  margin-left: 8px;
}

.mob-cat-edit-btn,
.mob-cat-del-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 13px;
  transition: 0.2s;
  -webkit-tap-highlight-color: transparent;
  vertical-align: middle;
  line-height: 1;
  padding: 0;
}

.mob-cat-edit-btn {
  background: rgba(99,102,241,0.12);
  border-color: rgba(99,102,241,0.15);
  color: #818cf8;
}

.mob-cat-edit-btn:active {
  background: rgba(99,102,241,0.25);
}

.mob-cat-del-btn {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.15);
  color: #f87171;
}

.mob-cat-del-btn:active {
  background: rgba(239,68,68,0.25);
}

/* ── Password Modal Centering ───────────────────────────────────────── */

.password-modal {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  bottom: auto !important;
  right: auto !important;
  width: min(420px, calc(100vw - 32px)) !important;
  max-width: 420px !important;
  border-radius: 20px !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  margin: 0 !important;
}

/* ── Danger Zone ──────────────────────────────────────────────────── */

.account-danger-text {
  color: rgba(255,255,255,0.5);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 24px;
}

.account-btn-danger {
  align-self: stretch;
  width: 100%;
  justify-content: center;
  text-align: center;
  padding: 14px 24px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
  min-height: 48px;
  display: flex;
  align-items: center;
}

.account-btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* ── General Mobile Button Polish ───────────────────────────────────── */

@media (max-width: 767px) {
  .mob-save-btn,
  .account-btn,
  .account-btn-danger,
  .account-btn-secondary,
  .auth-submit {
    border-radius: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
  }

  .mob-cat-progress-item {
    padding: 14px 14px;
    border: 1px solid rgba(255,255,255,0.04);
  }

  .mob-status-chips {
    gap: 6px;
  }

  .mob-status-chip {
    border-radius: 10px;
    padding: 10px 6px;
    font-size: 11px;
  }
}

/* ── Desktop Danger Zone ────────────────────────────────────────────── */

@media (min-width: 768px) {
  .account-btn-danger {
    align-self: stretch;
    width: 100%;
    justify-content: center;
  }
}

/* ── Category Modal ────────────────────────────────────────────────── */

.cat-modal {
  padding: 28px 24px 24px;
  width: min(380px, calc(100vw - 32px));
}

.cat-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.cat-field span {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
}

.cat-field input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  color: #fff;
  font-size: 14px;
  outline: none;
  min-height: 46px;
  transition: border-color 0.2s;
}

.cat-field input[type="text"]:focus {
  border-color: #818cf8;
}

.cat-field input[type="color"] {
  width: 100%;
  height: 42px;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: transparent;
  padding: 3px;
}

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

.cat-btn-cancel {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

.cat-btn-cancel:hover { background: rgba(255,255,255,0.08); color: #fff; }

.cat-btn-save {
  flex: 2;
  padding: 12px;
  border-radius: 12px;
  border: none;
  background: #6366f1;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.cat-btn-save:hover { background: #5558e6; }

/* ── Toast Notifications (non-intrusive) ────────────────────────────── */

.toast-msg {
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s, transform 0.3s;
  animation: toastIn 0.25s ease-out;
  max-width: 320px;
  text-align: center;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.toast-info  { background: rgba(99,102,241,0.9); }
.toast-error { background: rgba(239,68,68,0.9); }
.toast-success { background: rgba(34,197,94,0.9); }

/* ── Custom Confirm Dialog ──────────────────────────────────────────── */

.toast-dialog {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  background: #1f2937;
  padding: 0;
  width: min(340px, calc(100vw - 40px));
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
  bottom: auto !important;
  right: auto !important;
}

.toast-dialog::backdrop {
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}

.toast-dialog-inner {
  padding: 24px 20px;
  text-align: center;
}

.toast-btn-cancel,
.toast-btn-ok {
  flex: 1;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: 0.2s;
}

.toast-btn-cancel {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
}

.toast-btn-cancel:hover {
  background: rgba(255,255,255,0.12);
}

.toast-btn-ok {
  background: rgba(239,68,68,0.15);
  color: #f87171;
}

.toast-btn-ok:hover {
  background: rgba(239,68,68,0.25);
}
