:root,
[data-theme="light"] {
  --ht-color-primary: #0f9d94;
  --ht-color-primary-dark: #0a7f78;
  --ht-color-primary-soft: #eefafa;
  --ht-color-primary-ghost: rgba(15, 157, 148, 0.08);

  --ht-color-bg: #f7fbfb;
  --ht-color-surface: #ffffff;
  --ht-color-surface-muted: #f1f7f7;
  --ht-color-border: #dce9e8;

  --ht-color-text: #16302d;
  --ht-color-text-muted: #5f7774;
  --ht-color-text-soft: #8aa09d;

  --ht-color-success-bg: #edf8f1;
  --ht-color-success-text: #1e7a46;

  --ht-color-low-bg: #e9f8f6;
  --ht-color-low-text: #0b7c74;
  --ht-color-medium-bg: #fff6df;
  --ht-color-medium-text: #a26a00;
  --ht-color-high-bg: #fdecec;
  --ht-color-high-text: #c62828;

  --ht-color-disabled-bg: #ebefed;
  --ht-color-disabled-text: #98a29d;

  --ht-shadow-xs: 0 1px 2px rgba(16, 24, 20, 0.04);
  --ht-shadow-sm: 0 8px 24px rgba(16, 24, 20, 0.06);
  --ht-shadow-md: 0 16px 40px rgba(16, 24, 20, 0.08);
  --ht-shadow-lg: 0 24px 52px rgba(16, 24, 20, 0.12);

  --ht-font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;

  --ht-font-size-xs: 0.8125rem;
  --ht-font-size-sm: 0.9375rem;
  --ht-font-size-base: 1rem;
  --ht-font-size-lg: 1.125rem;
  --ht-font-size-xl: 1.5rem;
  --ht-font-size-2xl: 2rem;

  --ht-space-1: 0.25rem;
  --ht-space-2: 0.5rem;
  --ht-space-3: 0.75rem;
  --ht-space-4: 1rem;
  --ht-space-5: 1.25rem;
  --ht-space-6: 1.5rem;
  --ht-space-7: 1.75rem;
  --ht-space-8: 2rem;
  --ht-space-10: 2.5rem;
  --ht-space-12: 3rem;

  --ht-radius-sm: 12px;
  --ht-radius-md: 14px;
  --ht-radius-lg: 16px;
  --ht-radius-xl: 20px;
  --ht-radius-pill: 999px;

  --ht-header-height: 72px;
  --ht-nav-height: 78px;
  --ht-max-width: 1440px;
  --ht-content-width: 1080px;

  --ht-transition-fast: 160ms ease;
  --ht-transition-base: 220ms ease;
}

[data-theme="dark"] {
  --ht-color-primary: #4dd0c8;
  --ht-color-primary-dark: #26b8ae;
  --ht-color-primary-soft: #123432;
  --ht-color-primary-ghost: rgba(77, 208, 200, 0.12);

  --ht-color-bg: #071b1a;
  --ht-color-surface: #102827;
  --ht-color-surface-muted: #163332;
  --ht-color-border: #214544;

  --ht-color-text: #edf8f7;
  --ht-color-text-muted: #a9c1bf;
  --ht-color-text-soft: #7f9a97;

  --ht-color-success-bg: #133330;
  --ht-color-success-text: #7ce7dd;

  --ht-color-low-bg: #123432;
  --ht-color-low-text: #7ce7dd;

  --ht-color-medium-bg: #3f3517;
  --ht-color-medium-text: #f0cf72;

  --ht-color-high-bg: #3d2020;
  --ht-color-high-text: #ff9b9b;

  --ht-color-disabled-bg: #29403f;
  --ht-color-disabled-text: #87a09d;

  --ht-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.16);
  --ht-shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.2);
  --ht-shadow-md: 0 16px 40px rgba(0, 0, 0, 0.26);
  --ht-shadow-lg: 0 24px 52px rgba(0, 0, 0, 0.32);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ht-color-bg);
  color: var(--ht-color-text);
  font-family: var(--ht-font-family);
  font-size: var(--ht-font-size-base);
  line-height: 1.6;
  transition:
    background-color var(--ht-transition-base),
    color var(--ht-transition-base);
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
}

.ht-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--ht-max-width);
  margin: 0 auto;
  background: var(--ht-color-bg);
  transition: background-color var(--ht-transition-base);
}

.ht-app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--ht-header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ht-space-4);
  padding: 0 var(--ht-space-4);
  background: var(--ht-color-surface);
  border-bottom: 1px solid var(--ht-color-border);
  box-shadow: var(--ht-shadow-xs);
  transition:
    background-color var(--ht-transition-base),
    border-color var(--ht-transition-base);
}

.ht-app-title {
  margin: 0;
  color: var(--ht-color-primary);
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.ht-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--ht-radius-pill);
  background: var(--ht-color-surface-muted);
  border: 1px solid var(--ht-color-border);
  color: var(--ht-color-text-muted);
  font-size: 0.875rem;
  font-weight: 700;
  box-shadow: var(--ht-shadow-xs);
}

.ht-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ht-color-primary);
  flex: 0 0 auto;
}

.ht-app-main {
  flex: 1;
  width: 100%;
  padding: var(--ht-space-4);
  padding-bottom: calc(var(--ht-nav-height) + var(--ht-space-6));
  background: var(--ht-color-bg);
  transition: background-color var(--ht-transition-base);
}

.ht-view-card {
  width: 100%;
  min-height: calc(100vh - var(--ht-header-height) - var(--ht-nav-height) - (var(--ht-space-4) * 2));
  padding: 0;
  background: var(--ht-color-surface);
  border: 1px solid var(--ht-color-border);
  border-radius: 24px;
  box-shadow: var(--ht-shadow-sm);
  overflow: hidden;
  transition:
    background-color var(--ht-transition-base),
    border-color var(--ht-transition-base),
    box-shadow var(--ht-transition-base);
}

.ht-screen {
  padding: var(--ht-space-6);
  background: var(--ht-color-surface);
  transition: background-color var(--ht-transition-base);
}

.ht-screen__content {
  width: 100%;
  max-width: var(--ht-content-width);
  margin: 0 auto;
}

.ht-screen--page {
  min-height: 100%;
}

.ht-welcome-stack,
.ht-consent-stack,
.ht-checkin-stack,
.ht-history-stack,
.ht-settings-stack {
  display: flex;
  flex-direction: column;
  gap: var(--ht-space-6);
}


.ht-hero-copy {
  display: flex;
  flex-direction: column;
  gap: var(--ht-space-2);
}

.ht-hero-copy--left {
  text-align: left;
}

.ht-eyebrow {
  margin: 0;
  color: var(--ht-color-primary);
  font-size: var(--ht-font-size-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ht-screen-title {
  margin: 0;
  font-size: clamp(1.75rem, 2vw + 1rem, 2.5rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ht-color-text);
}

.ht-screen-subtitle {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ht-color-text);
}

.ht-screen-text {
  margin: 0;
  color: var(--ht-color-text-muted);
  font-size: 1rem;
  line-height: 1.65;
  max-width: 60ch;
}

/* عنوان صفحه check-in با accent teal */
.ht-screen-title--accent {
  color: #0f766e;
}

[data-theme="dark"] .ht-screen-title--accent {
  color: #7ce7dd;
}

.ht-logo-mark__tooth {
  width: 34px;
  height: 44px;
  background: var(--ht-color-primary);
  border-radius: 48% 48% 42% 42% / 38% 38% 62% 62%;
  position: relative;
}

.ht-logo-mark__tooth::before,
.ht-logo-mark__tooth::after {
  content: '';
  position: absolute;
  bottom: -8px;
  width: 10px;
  height: 18px;
  background: var(--ht-color-primary);
  border-radius: 0 0 10px 10px;
}

.ht-logo-mark__tooth::before {
  left: 4px;
  transform: rotate(10deg);
}

.ht-logo-mark__tooth::after {
  right: 4px;
  transform: rotate(-10deg);
}

.ht-action-block {
  width: 100%;
}

.ht-action-block--stack,
.ht-submit-block {
  display: flex;
  flex-direction: column;
  gap: var(--ht-space-3);
}

.ht-btn {
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color var(--ht-transition-fast),
    color var(--ht-transition-fast),
    border-color var(--ht-transition-fast),
    box-shadow var(--ht-transition-fast),
    transform var(--ht-transition-fast);
}

.ht-btn:active {
  transform: translateY(1px) scale(0.992);
}

.ht-btn:disabled {
  cursor: not-allowed;
  background: var(--ht-color-disabled-bg);
  color: var(--ht-color-disabled-text);
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

.ht-btn--primary {
  background: var(--ht-color-primary);
  color: #ffffff;
  box-shadow: var(--ht-shadow-xs);
}

.ht-btn--primary:hover {
  background: var(--ht-color-primary-dark);
  box-shadow: var(--ht-shadow-sm);
}

.ht-btn--secondary {
  background: var(--ht-color-surface);
  color: var(--ht-color-primary);
  border-color: var(--ht-color-border);
}

.ht-btn--secondary:hover {
  background: var(--ht-color-primary-soft);
  border-color: color-mix(in srgb, var(--ht-color-primary) 18%, transparent);
}

.ht-btn--large {
  min-height: 54px;
}

.ht-card {
  background: var(--ht-color-surface);
  border: 1px solid var(--ht-color-border);
  border-radius: 18px;
  box-shadow: var(--ht-shadow-sm);
  transition:
    background-color var(--ht-transition-base),
    border-color var(--ht-transition-base),
    box-shadow var(--ht-transition-base),
    transform var(--ht-transition-base);
}

.ht-card:hover {
  box-shadow: var(--ht-shadow-md);
}

.ht-consent-card,
.ht-section-card,
.ht-empty-state-card,
.ht-settings-card,
.ht-info-card {
  padding: var(--ht-space-6);
}

.ht-consent-card,
.ht-section-card,
.ht-empty-state-card,
.ht-settings-card,
.ht-info-card,
.ht-history-card {
  display: flex;
  flex-direction: column;
  gap: var(--ht-space-5);
}

.ht-consent-list {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: var(--ht-space-3);
  color: var(--ht-color-text-muted);
}

.ht-consent-list li::marker {
  color: var(--ht-color-primary);
}

.ht-consent-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.ht-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: var(--ht-space-3);
  padding: var(--ht-space-4);
  border: 1px solid var(--ht-color-border);
  border-radius: 14px;
  background: var(--ht-color-surface);
  transition:
    background-color var(--ht-transition-base),
    border-color var(--ht-transition-fast),
    box-shadow var(--ht-transition-fast);
}

.ht-checkbox-row:focus-within {
  border-color: var(--ht-color-primary);
  box-shadow: 0 0 0 4px var(--ht-color-primary-ghost);
}

.ht-checkbox-input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--ht-color-primary);
}

.ht-checkbox-label {
  color: var(--ht-color-text);
  font-weight: 600;
}

.ht-feedback-message,
.ht-toast-message {
  margin: 0;
  min-height: 1.5rem;
  font-size: var(--ht-font-size-sm);
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity var(--ht-transition-base),
    transform var(--ht-transition-base);
}

.ht-feedback-message {
  color: var(--ht-color-success-text);
}

.ht-feedback-message.is-visible,
.ht-toast-message.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.ht-toast-message {
  padding: var(--ht-space-4);
  border-radius: 14px;
  background: var(--ht-color-success-bg);
  color: var(--ht-color-success-text);
  border: 1px solid rgba(30, 122, 70, 0.12);
  box-shadow: var(--ht-shadow-xs);
}

.ht-section-head {
  display: flex;
  flex-direction: column;
  gap: var(--ht-space-2);
}

.ht-section-title,
.ht-settings-title,
.ht-empty-state-title {
  margin: 0;
  color: var(--ht-color-text);
  font-size: 1.2rem;
  font-weight: 750;
  line-height: 1.3;
}

.ht-section-text,
.ht-settings-description,
.ht-empty-state-text,
.ht-info-card__text {
  margin: 0;
  color: var(--ht-color-text-muted);
  line-height: 1.6;
}

.ht-checkin-form {
  display: flex;
  flex-direction: column;
  gap: var(--ht-space-5);
}

.ht-selector-grid {
  display: grid;
  gap: var(--ht-space-3);
}

.ht-selector-grid--pain {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ht-selector-grid--bleeding {
  grid-template-columns: 1fr;
}

.ht-selector-card {
  width: 100%;
  min-height: 92px;
  padding: var(--ht-space-4);
  border: 1px solid var(--ht-color-border);
  border-radius: 16px;
  background: var(--ht-color-surface);
  text-align: left;
  transition:
    background-color var(--ht-transition-base),
    border-color var(--ht-transition-fast),
    box-shadow var(--ht-transition-fast),
    transform var(--ht-transition-fast);
}

.ht-selector-card:hover {
  border-color: color-mix(in srgb, var(--ht-color-primary) 22%, transparent);
  box-shadow: var(--ht-shadow-xs);
  transform: translateY(-1px);
}

.ht-selector-card:active {
  transform: translateY(1px) scale(0.992);
}

.ht-selector-card.is-selected {
  border-color: var(--ht-color-primary);
  background: var(--ht-color-primary-soft);
  box-shadow: 0 0 0 4px var(--ht-color-primary-ghost);
}

.ht-selector-card__header {
  display: flex;
  align-items: center;
  gap: var(--ht-space-3);
}

.ht-selector-card__value {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--ht-color-surface-muted);
  border: 1px solid color-mix(in srgb, var(--ht-color-primary) 16%, transparent);
  color: var(--ht-color-primary);
  font-weight: 800;
  flex: 0 0 auto;
}

.ht-selector-card.is-selected .ht-selector-card__value {
  background: var(--ht-color-primary);
  color: #ffffff;
  border-color: var(--ht-color-primary);
}

.ht-selector-card__title {
  color: var(--ht-color-text);
  font-weight: 700;
}

.ht-selector-card__subtitle {
  margin: var(--ht-space-3) 0 0;
  color: var(--ht-color-text-muted);
  font-size: var(--ht-font-size-sm);
  line-height: 1.5;
}

.ht-notes-textarea {
  width: 100%;
  min-height: 140px;
  padding: var(--ht-space-4);
  border: 1px solid var(--ht-color-border);
  border-radius: 16px;
  background: var(--ht-color-surface);
  color: var(--ht-color-text);
  line-height: 1.65;
  transition:
    background-color var(--ht-transition-base),
    border-color var(--ht-transition-fast),
    box-shadow var(--ht-transition-fast);
  resize: vertical;
}

.ht-notes-textarea::placeholder {
  color: var(--ht-color-text-soft);
}

.ht-notes-textarea:focus {
  outline: none;
  border-color: var(--ht-color-primary);
  box-shadow: 0 0 0 4px var(--ht-color-primary-ghost);
}

.ht-history-list {
  display: grid;
  gap: var(--ht-space-4);
}

.ht-history-card {
  padding: var(--ht-space-5);
  background: var(--ht-color-surface);
  border: 1px solid var(--ht-color-border);
  border-radius: 18px;
  box-shadow: var(--ht-shadow-sm);
  transition:
    background-color var(--ht-transition-base),
    border-color var(--ht-transition-base),
    box-shadow var(--ht-transition-base);
}

.ht-history-card--calmer {
  opacity: 0.98;
}

.ht-history-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ht-space-4);
}

.ht-history-card__date {
  margin: 0;
  color: var(--ht-color-text);
  font-size: 1.1rem;
  font-weight: 750;
}

.ht-history-card__relative {
  margin: 0.25rem 0 0;
  color: var(--ht-color-text-muted);
  font-size: var(--ht-font-size-sm);
}

.ht-history-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--ht-space-3);
}

.ht-metric-badge {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--ht-space-4);
  border-radius: 14px;
  border: 1px solid transparent;
}

.ht-metric-badge--low {
  background: var(--ht-color-low-bg);
  color: var(--ht-color-low-text);
}

.ht-metric-badge--medium {
  background: var(--ht-color-medium-bg);
  color: var(--ht-color-medium-text);
}

.ht-metric-badge--high {
  background: var(--ht-color-high-bg);
  color: var(--ht-color-high-text);
}

.ht-metric-badge__label,
.ht-history-notes__label {
  font-size: var(--ht-font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ht-metric-badge__value {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
}

.ht-history-notes {
  display: flex;
  flex-direction: column;
  gap: var(--ht-space-2);
}

.ht-history-notes__label {
  margin: 0;
  color: var(--ht-color-text-muted);
}

.ht-history-notes__text {
  margin: 0;
  color: var(--ht-color-text);
  white-space: pre-wrap;
  word-break: break-word;
}

.ht-entry-delete-button {
  min-width: 88px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid color-mix(in srgb, var(--ht-color-high-text) 22%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--ht-color-high-bg) 70%, var(--ht-color-surface));
  color: var(--ht-color-high-text);
  font-weight: 700;
  transition:
    background-color var(--ht-transition-fast),
    border-color var(--ht-transition-fast),
    transform var(--ht-transition-fast);
}

.ht-entry-delete-button:hover {
  filter: brightness(0.98);
}

.ht-entry-delete-button:active {
  transform: translateY(1px) scale(0.99);
}

.ht-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ht-space-4);
}

.ht-settings-copy {
  display: flex;
  flex-direction: column;
  gap: var(--ht-space-2);
}

.ht-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.ht-switch__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ht-switch__track {
  width: 64px;
  height: 36px;
  padding: 3px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ht-color-text-soft) 35%, var(--ht-color-surface));
  border: 1px solid var(--ht-color-border);
  transition:
    background-color var(--ht-transition-fast),
    border-color var(--ht-transition-fast),
    box-shadow var(--ht-transition-fast);
}

.ht-switch__thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateX(0);
  transition:
    transform var(--ht-transition-fast),
    background-color var(--ht-transition-fast);
}

.ht-switch__input:checked + .ht-switch__track {
  background: color-mix(in srgb, var(--ht-color-primary) 28%, var(--ht-color-surface));
  border-color: color-mix(in srgb, var(--ht-color-primary) 34%, var(--ht-color-border));
}

.ht-switch__input:checked + .ht-switch__track .ht-switch__thumb {
  transform: translateX(28px);
  background: var(--ht-color-primary);
}

.ht-empty-state-card {
  align-items: center;
  text-align: center;
}

.ht-empty-state-icon {
  width: 74px;
  height: 74px;
  border-radius: 20px;
  background: var(--ht-color-surface-muted);
  border: 1px solid var(--ht-color-border);
  position: relative;
}

.ht-empty-state-icon::before {
  content: '';
  position: absolute;
  inset: 20px 24px;
  border-radius: 12px;
  border: 3px solid var(--ht-color-primary);
  border-top-width: 6px;
}

.ht-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--ht-space-2);
  width: 100%;
  max-width: var(--ht-max-width);
  margin: 0 auto;
  padding: var(--ht-space-2) var(--ht-space-3) calc(var(--ht-space-2) + env(safe-area-inset-bottom));
  background: var(--ht-color-surface);
  border-top: 1px solid var(--ht-color-border);
  box-shadow: 0 -10px 24px rgba(16, 24, 20, 0.06);
  transition:
    background-color var(--ht-transition-base),
    border-color var(--ht-transition-base);
}

.ht-bottom-nav__link {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--ht-space-3);
  border-radius: 14px;
  text-decoration: none;
  color: var(--ht-color-text-muted);
  font-size: 0.875rem;
  font-weight: 700;
  transition:
    background-color var(--ht-transition-fast),
    color var(--ht-transition-fast),
    transform var(--ht-transition-fast);
}

.ht-bottom-nav__link:hover {
  background: var(--ht-color-primary-soft);
  color: var(--ht-color-primary);
}

.ht-bottom-nav__link.is-active {
  background: var(--ht-color-primary);
  color: #ffffff;
}

.ht-bottom-nav__link:active {
  transform: translateY(1px) scale(0.99);
}

.ht-install-banner {
  display: none;
  position: fixed;
  left: var(--ht-space-4);
  right: var(--ht-space-4);
  bottom: calc(var(--ht-nav-height) + var(--ht-space-4));
  z-index: 70;
  max-width: 520px;
  margin: 0 auto;
  padding: var(--ht-space-5);
  border-radius: 20px;
  background: var(--ht-color-surface);
  border: 1px solid var(--ht-color-border);
  box-shadow: var(--ht-shadow-lg);
  transition:
    background-color var(--ht-transition-base),
    border-color var(--ht-transition-base);
}

.ht-install-banner.is-visible {
  display: block;
}

.ht-install-banner__title {
  margin: 0 0 var(--ht-space-2);
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--ht-color-text);
}

.ht-install-banner__text {
  margin: 0 0 var(--ht-space-4);
  color: var(--ht-color-text-muted);
  line-height: 1.6;
}

.ht-install-banner__actions {
  display: flex;
  gap: var(--ht-space-2);
  flex-wrap: wrap;
}

.ht-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ht-btn:focus-visible,
.ht-selector-card:focus-visible,
.ht-notes-textarea:focus-visible,
.ht-entry-delete-button:focus-visible,
.ht-checkbox-input:focus-visible,
.ht-switch__input:focus-visible + .ht-switch__track,
.ht-bottom-nav__link:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--ht-color-primary) 14%, transparent);
  outline-offset: 2px;
}

@media (min-width: 768px) {
  .ht-app-header {
    padding-inline: var(--ht-space-6);
  }

  .ht-app-main {
    padding: var(--ht-space-6);
    padding-bottom: calc(var(--ht-nav-height) + var(--ht-space-6));
  }

  .ht-screen {
    padding: var(--ht-space-8);
  }

  .ht-action-block--stack {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .ht-action-block--stack .ht-btn {
    width: auto;
    min-width: 220px;
  }

  .ht-history-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ht-history-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ht-selector-grid--bleeding {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ht-install-banner {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(520px, calc(100vw - 48px));
  }
}

@media (min-width: 1024px) {
  .ht-app-header {
    padding-inline: var(--ht-space-8);
  }

  .ht-app-main {
    padding: var(--ht-space-8);
    padding-bottom: calc(var(--ht-nav-height) + var(--ht-space-8));
  }

  .ht-screen {
    padding: var(--ht-space-10);
  }

  .ht-checkin-form {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: var(--ht-space-5);
    align-items: start;
  }

  .ht-checkin-form > .ht-section-card:nth-of-type(1) {
    grid-column: 1 / 2;
  }

  .ht-checkin-form > .ht-section-card:nth-of-type(2) {
    grid-column: 2 / 3;
  }

  .ht-checkin-form > .ht-section-card:nth-of-type(3),
  .ht-checkin-form > .ht-submit-block,
  .ht-checkin-form > .ht-toast-message {
    grid-column: 1 / -1;
  }

  .ht-selector-grid--pain {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ht-settings-stack {
    max-width: 860px;
  }
}

@media (max-width: 480px) {
  .ht-app-title {
    font-size: 1rem;
  }

  .ht-status-pill {
    font-size: 0.8125rem;
    padding-inline: 10px;
  }

  .ht-screen {
    padding: var(--ht-space-5);
  }

  .ht-selector-grid--pain,
  .ht-selector-grid--bleeding {
    grid-template-columns: 1fr;
  }

  .ht-history-card__top,
  .ht-settings-row {
    flex-direction: column;
    align-items: stretch;
  }

  .ht-entry-delete-button,
  .ht-install-banner__actions .ht-btn {
    width: 100%;
  }

  .ht-switch {
    align-self: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.ht-slider-field {
  display: flex;
  flex-direction: column;
  gap: var(--ht-space-5);
}

.ht-slider-summary {
  display: flex;
  align-items: center;
  gap: var(--ht-space-4);
  padding: var(--ht-space-4);
  border: 1px solid var(--ht-color-border);
  border-radius: 18px;
  background: var(--ht-color-surface-muted);
}

.ht-slider-summary__value {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--ht-color-primary);
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 800;
  flex: 0 0 auto;
  box-shadow: var(--ht-shadow-xs);
}

.ht-slider-summary__copy {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ht-slider-summary__label {
  margin: 0;
  color: var(--ht-color-text);
  font-size: 1rem;
  font-weight: 750;
}

.ht-slider-summary__description {
  margin: 0;
  color: var(--ht-color-text-muted);
  font-size: var(--ht-font-size-sm);
  line-height: 1.5;
}

.ht-slider-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--ht-space-3);
}

.ht-range-slider {
  --ht-range-progress: 0%;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 14px;
  border-radius: 999px;
  outline: none;
  background: linear-gradient(
    to right,
    var(--ht-color-primary) 0%,
    var(--ht-color-primary) var(--ht-range-progress),
    var(--ht-color-surface-muted) var(--ht-range-progress),
    var(--ht-color-surface-muted) 100%
  );
  border: 1px solid var(--ht-color-border);
  cursor: pointer;
  transition: box-shadow var(--ht-transition-fast), border-color var(--ht-transition-fast);
}

.ht-range-slider:focus-visible {
  box-shadow: 0 0 0 4px var(--ht-color-primary-ghost);
  border-color: var(--ht-color-primary);
}

.ht-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  border: 4px solid var(--ht-color-primary);
  box-shadow: var(--ht-shadow-sm);
  cursor: pointer;
}

.ht-range-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  border: 4px solid var(--ht-color-primary);
  box-shadow: var(--ht-shadow-sm);
  cursor: pointer;
}

.ht-range-slider::-moz-range-track {
  height: 14px;
  border-radius: 999px;
  background: transparent;
}

.ht-slider-scale {
  display: grid;
  align-items: start;
}

.ht-slider-scale--pain {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.ht-slider-scale--bleeding {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ht-slider-scale__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
}

.ht-slider-scale__tick {
  width: 2px;
  height: 10px;
  border-radius: 999px;
  background: var(--ht-color-border);
}

.ht-slider-scale__label {
  color: var(--ht-color-text-muted);
  font-size: var(--ht-font-size-xs);
  font-weight: 700;
}

@media (max-width: 480px) {
  .ht-slider-summary {
    align-items: flex-start;
  }

  .ht-slider-summary__value {
    width: 48px;
    height: 48px;
    font-size: 1.125rem;
  }

  .ht-slider-scale__label {
    font-size: 0.72rem;
  }
}

.ht-welcome-stack {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--ht-space-6);
}

.ht-welcome-stack .ht-hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--ht-space-2);
}

.ht-welcome-stack .ht-screen-text,
.ht-welcome-stack .ht-screen-subtitle,
.ht-welcome-stack .ht-screen-title,
.ht-welcome-stack .ht-eyebrow {
  text-align: center;
}

.ht-logo-mark {
  width: 92px;
  height: 92px;
  margin: 0 auto;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: var(--ht-color-surface);
  border: 1px solid var(--ht-color-border);
  box-shadow: var(--ht-shadow-sm);
}

.ht-logo-mark__img {
  display: block;
  width: 64px;
  height: 64px;
  margin: 0 auto;
  object-fit: contain;
}