@charset "UTF-8";
:root {
  --rs-bg-page: #f0f2f5;
  --rs-bg-glass: rgba(255, 255, 255, 0.55);
  --rs-bg-glass-hover: rgba(255, 255, 255, 0.7);
  --rs-bg-elevated: #ffffff;
  --rs-bg-inset: #e8eaed;
  --rs-bg-overlay: rgba(0, 0, 0, 0.4);
  --rs-border-decorative: rgba(0, 0, 0, 0.10);
  --rs-border-input: #7e828a;
  --rs-border-focus: #006b4e;
  --rs-text-primary: #1a1d24;
  --rs-text-secondary: #4a4e56;
  --rs-text-tertiary: #696d76;
  --rs-text-inverse: #ffffff;
  --rs-color-success: #006b4e;
  --rs-color-success-dim: rgba(0, 107, 78, 0.12);
  --rs-color-danger: #a12040;
  --rs-color-danger-dim: rgba(161, 32, 64, 0.1);
  --rs-color-info: #2a4fa8;
  --rs-color-info-dim: rgba(42, 79, 168, 0.1);
  --rs-color-warning: #7a4b00;
  --rs-color-warning-dim: rgba(122, 75, 0, 0.08);
  --rs-accent: #006b4e;
  --rs-accent-hover: #005540;
  --rs-accent-dim: rgba(0, 107, 78, 0.12);
  --rs-accent-on: #ffffff;
  --rs-accent-btn-bg: #008060;
  --rs-accent-btn-hover: #006b4e;
  --rs-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --rs-shadow-md: 0 2px 12px rgba(0, 0, 0, 0.06);
  --rs-shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.08);
  --rs-shadow-focus: 0 0 0 3px rgba(0, 107, 78, 0.2);
  --rs-font-body: Outfit, system-ui, -apple-system, sans-serif;
  --rs-font-mono: JetBrains Mono, ui-monospace, Cascadia Code, monospace;
  --rs-space-1: 4px;
  --rs-space-2: 8px;
  --rs-space-3: 12px;
  --rs-space-4: 16px;
  --rs-space-5: 20px;
  --rs-space-6: 24px;
  --rs-space-8: 32px;
  --rs-space-10: 40px;
  --rs-space-12: 48px;
  --rs-space-16: 64px;
  --rs-space-20: 80px;
  --rs-radius-sm: 6px;
  --rs-radius-md: 10px;
  --rs-radius-lg: 14px;
  --rs-radius-xl: 16px;
  --rs-radius-full: 9999px;
  --rs-text-4xl: 2.25rem;
  --rs-text-3xl: 1.875rem;
  --rs-text-2xl: 1.5rem;
  --rs-text-xl: 1.25rem;
  --rs-text-lg: 1.125rem;
  --rs-text-base: 1rem;
  --rs-text-sm: 0.875rem;
  --rs-text-xs: 0.75rem;
  --rs-text-2xs: 0.6875rem;
  --rs-weight-regular: 400;
  --rs-weight-medium: 500;
  --rs-weight-semibold: 600;
  --rs-weight-bold: 700;
  --rs-transition-fast: 0.15s ease;
  --rs-transition-normal: 0.2s ease;
  --rs-accent-primary: #006b4e;
  --rs-accent-secondary: #008060;
}

[data-theme=dark] {
  --rs-bg-page: #0a0e1a;
  --rs-bg-glass: rgba(255, 255, 255, 0.06);
  --rs-bg-glass-hover: rgba(255, 255, 255, 0.1);
  --rs-bg-elevated: #131722;
  --rs-bg-inset: #0d1120;
  --rs-bg-overlay: rgba(0, 0, 0, 0.6);
  --rs-border-decorative: rgba(255, 255, 255, 0.10);
  --rs-border-input: #606472;
  --rs-border-focus: #00e5a0;
  --rs-text-primary: #e8eaed;
  --rs-text-secondary: #b0b4bc;
  --rs-text-tertiary: #828690;
  --rs-text-inverse: #0a0e1a;
  --rs-color-success: #00e5a0;
  --rs-color-success-dim: rgba(0, 229, 160, 0.15);
  --rs-color-danger: #ff6b8a;
  --rs-color-danger-dim: rgba(255, 107, 138, 0.15);
  --rs-color-info: #5b8def;
  --rs-color-info-dim: rgba(91, 141, 239, 0.15);
  --rs-color-warning: #ffb84d;
  --rs-color-warning-dim: rgba(255, 184, 77, 0.12);
  --rs-accent: #00e5a0;
  --rs-accent-hover: #00c98c;
  --rs-accent-dim: rgba(0, 229, 160, 0.15);
  --rs-accent-on: #0a0e1a;
  --rs-accent-btn-bg: #00e5a0;
  --rs-accent-btn-hover: #00c98c;
  --rs-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --rs-shadow-md: 0 2px 12px rgba(0, 0, 0, 0.2);
  --rs-shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.25);
  --rs-shadow-focus: 0 0 0 3px rgba(0, 229, 160, 0.25);
  --rs-accent-primary: #00e5a0;
  --rs-accent-secondary: #00c98c;
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
body {
  font-family: var(--rs-font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--rs-text-primary);
  background: var(--rs-bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.rs-text--primary {
  color: var(--rs-text-primary);
}

.rs-text--secondary {
  color: var(--rs-text-secondary);
}

.rs-text--tertiary {
  color: var(--rs-text-tertiary);
}

.rs-text--inverse {
  color: var(--rs-text-inverse);
}

.rs-text--success {
  color: var(--rs-color-success);
}

.rs-text--danger {
  color: var(--rs-color-danger);
}

.rs-text--info {
  color: var(--rs-color-info);
}

.rs-text--warning {
  color: var(--rs-color-warning);
}

.rs-text--accent {
  color: var(--rs-accent);
}

.rs-text--4xl {
  font-size: 2.25rem;
}

.rs-text--3xl {
  font-size: 1.875rem;
}

.rs-text--2xl {
  font-size: 1.5rem;
}

.rs-text--xl {
  font-size: 1.25rem;
}

.rs-text--lg {
  font-size: 1.125rem;
}

.rs-text--base {
  font-size: 1rem;
}

.rs-text--sm {
  font-size: 0.875rem;
}

.rs-text--xs {
  font-size: 0.75rem;
}

.rs-text--2xs {
  font-size: 0.6875rem;
}

.rs-text--medium {
  font-weight: 500;
}

.rs-text--semibold {
  font-weight: 600;
}

.rs-text--bold {
  font-weight: 700;
}

.rs-text--mono {
  font-family: var(--rs-font-mono);
}

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

.rs-skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--rs-accent);
  color: var(--rs-accent-on);
  padding: 12px 24px;
  border-radius: 0 0 10px 10px;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  z-index: 200;
}
.rs-skip-link:focus {
  top: 0;
}

*:focus-visible {
  outline: 3px solid var(--rs-border-focus);
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

.rs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--rs-font-body);
  font-weight: 600;
  font-size: 0.875rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  min-height: 44px;
  padding: 12px 20px;
}
.rs-btn:focus-visible {
  outline: 3px solid var(--rs-border-focus);
  outline-offset: 2px;
}
.rs-btn:focus:not(:focus-visible) {
  outline: none;
}
.rs-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.rs-btn__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.rs-btn--primary {
  background: var(--rs-accent-btn-bg);
  color: var(--rs-accent-on);
  box-shadow: var(--rs-shadow-sm);
}
.rs-btn--primary:hover {
  background: var(--rs-accent-btn-hover);
  box-shadow: var(--rs-shadow-md);
  transform: translateY(-1px);
}
.rs-btn--primary:active {
  transform: translateY(0);
  box-shadow: none;
}
.rs-btn--secondary {
  background: var(--rs-bg-glass);
  color: var(--rs-text-primary);
  border: 1px solid var(--rs-border-input);
  box-shadow: var(--rs-shadow-sm);
}
.rs-btn--secondary:hover {
  background: var(--rs-bg-glass-hover);
}
.rs-btn--ghost {
  background: transparent;
  color: var(--rs-accent);
}
.rs-btn--ghost:hover {
  background: var(--rs-accent-dim);
}
.rs-btn--danger {
  background: var(--rs-color-danger);
  color: var(--rs-text-inverse);
  box-shadow: var(--rs-shadow-sm);
}
.rs-btn--danger:hover {
  opacity: 0.9;
}
.rs-btn--sm {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 0.75rem;
}
.rs-btn--lg {
  min-height: 52px;
  padding: 16px 32px;
  font-size: 1rem;
}
.rs-btn--block {
  width: 100%;
}

.rs-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rs-field__label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--rs-text-primary);
}
.rs-field__label--required::after {
  content: " *";
  color: var(--rs-color-danger);
}
.rs-field__hint {
  font-size: 0.75rem;
  color: var(--rs-text-tertiary);
}
.rs-field__error {
  font-size: 0.75rem;
  color: var(--rs-color-danger);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}
.rs-field__error svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.rs-field--error .rs-input {
  border-color: var(--rs-color-danger);
}
.rs-field--error .rs-input:focus {
  box-shadow: 0 0 0 3px rgba(161, 32, 64, 0.15);
}
[data-theme=dark] .rs-field--error .rs-input:focus {
  box-shadow: 0 0 0 3px rgba(255, 107, 138, 0.2);
}
.rs-field--success .rs-input {
  border-color: var(--rs-color-success);
}

.rs-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--rs-border-input);
  border-radius: 10px;
  background: var(--rs-bg-elevated);
  color: var(--rs-text-primary);
  font-family: var(--rs-font-body);
  font-size: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-height: 44px;
}
.rs-input::placeholder {
  color: var(--rs-text-tertiary);
}
.rs-input:hover {
  border-color: var(--rs-text-secondary);
}
.rs-input:focus {
  border-color: var(--rs-border-focus);
  box-shadow: var(--rs-shadow-focus);
  outline: none;
}
.rs-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--rs-bg-inset);
}
.rs-input--mono {
  font-family: var(--rs-font-mono);
  font-size: 1.125rem;
}

.rs-textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.5;
}

.rs-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23696d76' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}
[data-theme=dark] .rs-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23828690' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

.rs-checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  cursor: pointer;
}
.rs-checkbox__input {
  width: 20px;
  height: 20px;
  border: 2px solid var(--rs-border-input);
  border-radius: 6px;
  appearance: none;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  background: var(--rs-bg-elevated);
  position: relative;
}
.rs-checkbox__input:focus-visible {
  outline: 3px solid var(--rs-border-focus);
  outline-offset: 2px;
}
.rs-checkbox__input:focus:not(:focus-visible) {
  outline: none;
}
.rs-checkbox__input:checked {
  background: var(--rs-accent);
  border-color: var(--rs-accent);
}
.rs-checkbox__input:checked::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 10px;
  border: 2px solid var(--rs-accent-on);
  border-top: none;
  border-left: none;
  transform: translate(-50%, -60%) rotate(45deg);
}
.rs-checkbox__label {
  font-size: 0.875rem;
  cursor: pointer;
}

.rs-radio {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  cursor: pointer;
}
.rs-radio__input {
  width: 20px;
  height: 20px;
  border: 2px solid var(--rs-border-input);
  border-radius: 9999px;
  appearance: none;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  background: var(--rs-bg-elevated);
  position: relative;
}
.rs-radio__input:focus-visible {
  outline: 3px solid var(--rs-border-focus);
  outline-offset: 2px;
}
.rs-radio__input:focus:not(:focus-visible) {
  outline: none;
}
.rs-radio__input:checked {
  background: var(--rs-accent);
  border-color: var(--rs-accent);
}
.rs-radio__input:checked::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: var(--rs-accent-on);
  border-radius: 9999px;
}
.rs-radio__label {
  font-size: 0.875rem;
  cursor: pointer;
}

.rs-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}
.rs-radio-group--vertical {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.rs-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  cursor: pointer;
  position: relative;
}
.rs-toggle__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.rs-toggle__input:checked + .rs-toggle__track {
  background: var(--rs-accent);
  border-color: var(--rs-accent);
}
.rs-toggle__input:checked + .rs-toggle__track::after {
  transform: translateX(20px);
  background: var(--rs-accent-on);
}
.rs-toggle__input:focus-visible + .rs-toggle__track {
  outline: 3px solid var(--rs-border-focus);
  outline-offset: 2px;
}
.rs-toggle__track {
  width: 44px;
  height: 24px;
  border-radius: 9999px;
  background: var(--rs-bg-inset);
  border: 2px solid var(--rs-border-input);
  position: relative;
  transition: all 0.15s ease;
  cursor: pointer;
  flex-shrink: 0;
}
.rs-toggle__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 9999px;
  background: var(--rs-text-tertiary);
  transition: all 0.15s ease;
}
.rs-toggle__label {
  font-size: 0.875rem;
}

.rs-range {
  width: 100%;
  height: 6px;
  border-radius: 9999px;
  background: var(--rs-bg-inset);
  appearance: none;
  outline: none;
  margin: 8px 0;
}
.rs-range::-webkit-slider-thumb {
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  background: var(--rs-accent);
  cursor: pointer;
  border: 3px solid var(--rs-bg-elevated);
  box-shadow: var(--rs-shadow-sm);
}
.rs-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  background: var(--rs-accent);
  cursor: pointer;
  border: 3px solid var(--rs-bg-elevated);
  box-shadow: var(--rs-shadow-sm);
}

.rs-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 6px;
}
.rs-badge__icon {
  width: 12px;
  height: 12px;
}
.rs-badge--success {
  background: var(--rs-color-success-dim);
  color: var(--rs-color-success);
}
.rs-badge--danger {
  background: var(--rs-color-danger-dim);
  color: var(--rs-color-danger);
}
.rs-badge--info {
  background: var(--rs-color-info-dim);
  color: var(--rs-color-info);
}
.rs-badge--warning {
  background: var(--rs-color-warning-dim);
  color: var(--rs-color-warning);
}
.rs-badge--neutral {
  background: var(--rs-bg-inset);
  color: var(--rs-text-secondary);
}

.rs-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--rs-font-body);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 9999px;
  border: 1px solid var(--rs-border-input);
  background: var(--rs-bg-glass);
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 36px;
}
.rs-chip:focus-visible {
  outline: 3px solid var(--rs-border-focus);
  outline-offset: 2px;
}
.rs-chip:focus:not(:focus-visible) {
  outline: none;
}
.rs-chip:hover {
  background: var(--rs-bg-glass-hover);
}
.rs-chip--active {
  background: var(--rs-accent-dim);
  border-color: var(--rs-accent);
  color: var(--rs-accent);
}

.rs-alert {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 14px;
  font-size: 0.875rem;
}
.rs-alert__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}
.rs-alert__content {
  flex: 1;
}
.rs-alert__title {
  font-weight: 600;
  margin-bottom: 4px;
}
.rs-alert--success {
  background: var(--rs-color-success-dim);
  color: var(--rs-color-success);
  border: 1px solid var(--rs-color-success);
}
.rs-alert--danger {
  background: var(--rs-color-danger-dim);
  color: var(--rs-color-danger);
  border: 1px solid var(--rs-color-danger);
}
.rs-alert--info {
  background: var(--rs-color-info-dim);
  color: var(--rs-color-info);
  border: 1px solid var(--rs-color-info);
}
.rs-alert--warning {
  background: var(--rs-color-warning-dim);
  color: var(--rs-color-warning);
  border: 1px solid var(--rs-color-warning);
}

.rs-toast {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--rs-bg-elevated);
  border: 1px solid var(--rs-border-decorative);
  border-radius: 14px;
  box-shadow: var(--rs-shadow-lg);
  font-size: 0.875rem;
  font-weight: 500;
}
.rs-toast__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.rs-progress {
  width: 100%;
  height: 8px;
  background: var(--rs-bg-inset);
  border-radius: 9999px;
  overflow: hidden;
}
.rs-progress__bar {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.5s ease;
}
.rs-progress--success .rs-progress__bar {
  background: var(--rs-color-success);
}
.rs-progress--info .rs-progress__bar {
  background: var(--rs-color-info);
}
.rs-progress--warning .rs-progress__bar {
  background: var(--rs-color-warning);
}
.rs-progress--danger .rs-progress__bar {
  background: var(--rs-color-danger);
}

.rs-tabs {
  display: inline-flex;
  gap: 2px;
  background: var(--rs-bg-inset);
  border-radius: 10px;
  padding: 3px;
}
.rs-tabs__tab {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-family: var(--rs-font-body);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--rs-text-tertiary);
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 36px;
}
.rs-tabs__tab:focus-visible {
  outline: 3px solid var(--rs-border-focus);
  outline-offset: 2px;
}
.rs-tabs__tab:focus:not(:focus-visible) {
  outline: none;
}
.rs-tabs__tab:hover {
  color: var(--rs-text-secondary);
}
.rs-tabs__tab[aria-selected=true] {
  background: var(--rs-bg-glass);
  color: var(--rs-text-primary);
  box-shadow: var(--rs-shadow-sm);
}

.rs-table {
  width: 100%;
  border-collapse: collapse;
}
.rs-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--rs-text-tertiary);
  padding: 12px 16px;
  border-bottom: 1px solid var(--rs-border-decorative);
}
.rs-table td {
  padding: 12px 16px;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--rs-border-decorative);
}
.rs-table tbody tr:hover {
  background: var(--rs-accent-dim);
}
.rs-table__mono {
  font-family: var(--rs-font-mono);
  font-weight: 500;
}

.rs-modal {
  position: fixed;
  inset: 0;
  background: var(--rs-bg-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  padding: 16px;
}
.rs-modal[hidden] {
  display: none;
}
.rs-modal__dialog {
  background: var(--rs-bg-elevated);
  border: 1px solid var(--rs-border-decorative);
  border-radius: 16px;
  padding: 32px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--rs-shadow-lg);
  position: relative;
}
.rs-modal__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.rs-modal__desc {
  font-size: 0.875rem;
  color: var(--rs-text-secondary);
  margin-bottom: 24px;
}
.rs-modal__actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}
.rs-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--rs-text-tertiary);
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}
.rs-modal__close:focus-visible {
  outline: 3px solid var(--rs-border-focus);
  outline-offset: 2px;
}
.rs-modal__close:focus:not(:focus-visible) {
  outline: none;
}
.rs-modal__close:hover {
  background: var(--rs-bg-inset);
}

.rs-empty {
  text-align: center;
  padding: 48px 24px;
}
.rs-empty__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  color: var(--rs-text-tertiary);
  opacity: 0.5;
}
.rs-empty__title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.rs-empty__desc {
  font-size: 0.875rem;
  color: var(--rs-text-secondary);
  margin-bottom: 24px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.rs-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  gap: 16px;
}

.rs-topbar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.rs-topbar__brand-glyph {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--rs-accent-primary), var(--rs-accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
}

.rs-topbar__brand-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--rs-text-primary);
}
.rs-topbar__brand-text span {
  color: var(--rs-accent-primary);
}

.rs-topbar__nav {
  display: flex;
  gap: 2px;
  background: var(--rs-bg-glass);
  border: 1px solid var(--rs-border-decorative);
  border-radius: 10px;
  padding: 3px;
  backdrop-filter: blur(16px);
}

.rs-topbar__nav-link {
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--rs-text-tertiary);
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.rs-topbar__nav-link:hover {
  color: var(--rs-text-secondary);
  background: rgba(255, 255, 255, 0.04);
}
.rs-topbar__nav-link--active {
  background: var(--rs-bg-glass);
  color: var(--rs-text-primary);
  box-shadow: var(--rs-shadow-sm);
}

.rs-topbar__user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rs-topbar__user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--rs-color-danger), var(--rs-color-warning));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.rs-topbar__user-avatar:hover {
  transform: scale(1.05);
}

@media (max-width: 640px) {
  .rs-topbar__nav {
    display: none;
  }
}
.rs-bottom-nav {
  display: none;
}

@media (max-width: 640px) {
  .rs-container {
    padding-bottom: 96px;
  }
  .rs-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 72px;
    background: var(--rs-bg-elevated);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--rs-border-decorative);
    box-shadow: var(--rs-shadow-lg);
    padding: 8px 8px env(safe-area-inset-bottom, 8px);
    justify-content: space-around;
    align-items: center;
  }
  .rs-bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-decoration: none;
    color: var(--rs-text-tertiary);
    font-size: 0.62rem;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 10px;
    transition: color 0.15s ease;
    min-width: 52px;
  }
  .rs-bottom-nav__item svg {
    width: 20px;
    height: 20px;
  }
  .rs-bottom-nav__item--active {
    color: var(--rs-accent-primary);
  }
}
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ═══════════════════════════════════════════
   DESIGN TOKENS — LIGHT THEME (default)
   ═══════════════════════════════════════════ */
:root {
  /* Background */
  --bg-page: #f0f2f5;
  --bg-glass: rgba(255,255,255,0.55);
  --bg-glass-hover: rgba(255,255,255,0.7);
  --bg-elevated: #ffffff;
  --bg-inset: #e8eaed;
  --bg-overlay: rgba(0,0,0,0.4);
  /* Borders */
  --border-decorative: rgba(0,0,0,0.10);
  --border-input: #7e828a;
  --border-focus: #006B4E;
  /* Text */
  --text-primary: #1a1d24;
  --text-secondary: #4a4e56;
  --text-tertiary: #696d76;
  --text-inverse: #ffffff;
  /* Semantic colours */
  --color-success: #006B4E;
  --color-success-dim: rgba(0,107,78,0.12);
  --color-danger: #A12040;
  --color-danger-dim: rgba(161,32,64,0.1);
  --color-info: #2A4FA8;
  --color-info-dim: rgba(42,79,168,0.1);
  --color-warning: #7A4B00;
  --color-warning-dim: rgba(122,75,0,0.08);
  /* Accent */
  --accent: #006B4E;
  --accent-hover: #005540;
  --accent-dim: rgba(0,107,78,0.12);
  --accent-on: #ffffff;
  --accent-btn-bg: #008060;
  --accent-btn-hover: #006B4E;
  /* Typography scale */
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --text-4xl: 2.25rem;
  --text-3xl: 1.875rem;
  --text-2xl: 1.5rem;
  --text-xl: 1.25rem;
  --text-lg: 1.125rem;
  --text-base: 1rem;
  --text-sm: 0.875rem;
  --text-xs: 0.75rem;
  --text-2xs: 0.6875rem;
  --leading-tight: 1.2;
  --leading-normal: 1.5;
  --leading-relaxed: 1.7;
  --weight-light: 300;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-focus: 0 0 0 3px rgba(0,107,78,0.2);
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s ease;
  --transition-slow: 0.35s ease;
  /* Layout */
  --content-max: 1100px;
  --sidebar-width: 260px;
}

/* ═══════════════════════════════════════════
   DARK THEME OVERRIDES
   ═══════════════════════════════════════════ */
[data-theme=dark] {
  --bg-page: #0a0e1a;
  --bg-glass: rgba(255,255,255,0.06);
  --bg-glass-hover: rgba(255,255,255,0.1);
  --bg-elevated: #131722;
  --bg-inset: #0d1120;
  --bg-overlay: rgba(0,0,0,0.6);
  --border-decorative: rgba(255,255,255,0.10);
  --border-input: #606472;
  --border-focus: #00E5A0;
  --text-primary: #e8eaed;
  --text-secondary: #b0b4bc;
  --text-tertiary: #828690;
  --text-inverse: #0a0e1a;
  --color-success: #00E5A0;
  --color-success-dim: rgba(0,229,160,0.15);
  --color-danger: #FF6B8A;
  --color-danger-dim: rgba(255,107,138,0.15);
  --color-info: #5B8DEF;
  --color-info-dim: rgba(91,141,239,0.15);
  --color-warning: #FFB84D;
  --color-warning-dim: rgba(255,184,77,0.12);
  --accent: #00E5A0;
  --accent-hover: #00C98C;
  --accent-dim: rgba(0,229,160,0.15);
  --accent-on: #0a0e1a;
  --accent-btn-bg: #00E5A0;
  --accent-btn-hover: #00C98C;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-md: 0 2px 12px rgba(0,0,0,0.2);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.25);
  --shadow-focus: 0 0 0 3px rgba(0,229,160,0.25);
}

/* ═══════════════════════════════════════════
   BASE STYLES
   ═══════════════════════════════════════════ */
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ═══ ACCESSIBILITY ═══ */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  background: var(--accent);
  color: var(--accent-on);
  padding: var(--space-3) var(--space-6);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  z-index: 200;
  text-decoration: none;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
}

*:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
/* ═══ LAYOUT ═══ */
.container {
  position: relative;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-12) var(--space-8);
}

/* ═══ BUTTONS ═══ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  min-height: 44px;
  padding: var(--space-3) var(--space-5);
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--accent-btn-bg);
  color: var(--accent-on);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--accent-btn-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-secondary {
  background: var(--bg-glass);
  color: var(--text-primary);
  border: 1px solid var(--border-input);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-glass-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
}

.btn-ghost:hover {
  background: var(--accent-dim);
}

.btn-disabled,
.btn:disabled,
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn svg {
  display: inline-block;
  vertical-align: middle;
  margin: 0 4px;
}

.btn-danger {
  background: var(--color-danger);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
  opacity: 0.9;
}

.btn-sm {
  min-height: 36px;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
}

.btn-lg {
  min-height: 52px;
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ═══ FORM INPUTS ═══ */
.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
}

.form-label-req::after {
  content: " *";
  color: var(--color-danger);
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.form-hint a {
  color: var(--color-info);
  text-decoration: none;
  font-size: var(--text-sm);
}

.form-hint a:hover {
  text-decoration: underline;
}

.auth-card-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.auth-card__brand {
  font-size: 22px;
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-5);
}
.auth-card__brand span {
  color: var(--accent);
}

.auth-card__title {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  margin: 0 0 var(--space-3);
}

.auth-card__text {
  color: var(--text-secondary);
  line-height: var(--leading-normal);
  margin: 0 0 var(--space-5);
}

.auth-card form {
  text-align: left;
}

.auth-card .btn-block {
  margin-top: var(--space-2);
}

.auth-card__msg {
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  min-height: 1.2em;
  text-align: center;
}
.auth-card__msg.error {
  color: var(--color-danger);
}
.auth-card__msg.success {
  color: var(--color-success);
}

.auth-card__secondary {
  margin-top: var(--space-5);
  font-size: var(--text-base);
}
.auth-card__secondary a {
  color: var(--color-info);
  text-decoration: none;
}
.auth-card__secondary a:hover {
  text-decoration: underline;
}

.auth-card .hidden,
.hidden {
  display: none !important;
}

.form-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  min-height: 44px;
}

.form-input::placeholder {
  color: var(--text-tertiary);
}

.form-input:hover {
  border-color: var(--text-secondary);
}

.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-focus);
  outline: none;
}

.form-input-mono {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
}

.form-field-error .form-input {
  border-color: var(--color-danger);
}

.form-field-error .form-input:focus {
  box-shadow: 0 0 0 3px rgba(161, 32, 64, 0.15);
}

[data-theme=dark] .form-field-error .form-input:focus {
  box-shadow: 0 0 0 3px rgba(255, 107, 138, 0.2);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--color-danger);
  font-weight: var(--weight-medium);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.form-error svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.form-field-success .form-input {
  border-color: var(--color-success);
}

.form-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--bg-inset);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
  line-height: var(--leading-normal);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23696d76' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  padding-right: var(--space-10);
}

[data-theme=dark] .form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23828690' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  cursor: pointer;
}

.form-check-input {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-input);
  border-radius: var(--radius-sm);
  appearance: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  background: var(--bg-elevated);
  position: relative;
}

.form-check-input[type=radio] {
  border-radius: var(--radius-full);
}

.form-check-input:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.form-check-input:checked::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.form-check-input[type=checkbox]:checked::after {
  width: 6px;
  height: 10px;
  border: 2px solid var(--accent-on);
  border-top: none;
  border-left: none;
  transform: translate(-50%, -60%) rotate(45deg);
}

.form-check-input[type=radio]:checked::after {
  width: 8px;
  height: 8px;
  background: var(--accent-on);
  border-radius: var(--radius-full);
}

.form-check-label {
  font-size: var(--text-sm);
  cursor: pointer;
}

/* Toggle */
.form-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  cursor: pointer;
}

.toggle-track {
  width: 44px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--bg-inset);
  border: 2px solid var(--border-input);
  position: relative;
  transition: all var(--transition-fast);
  cursor: pointer;
  flex-shrink: 0;
}

.toggle-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  background: var(--text-tertiary);
  transition: all var(--transition-fast);
}

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

.toggle-input:checked + .toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-input:checked + .toggle-track::after {
  transform: translateX(20px);
  background: var(--accent-on);
}

.toggle-input:focus-visible + .toggle-track {
  outline: 3px solid var(--border-focus);
  outline-offset: 2px;
}

.toggle-label {
  font-size: var(--text-sm);
}

/* ═══ BADGES ═══ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  padding: 3px var(--space-3);
  border-radius: var(--radius-sm);
}

.badge svg {
  width: 12px;
  height: 12px;
}

.badge-success {
  background: var(--color-success-dim);
  color: var(--color-success);
}

.badge-danger {
  background: var(--color-danger-dim);
  color: var(--color-danger);
}

.badge-info {
  background: var(--color-info-dim);
  color: var(--color-info);
}

.badge-warning {
  background: var(--color-warning-dim);
  color: var(--color-warning);
}

.badge-neutral {
  background: var(--bg-inset);
  color: var(--text-secondary);
}

/* ═══ ALERTS ═══ */
.alert {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
}

.alert svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-1);
}

.alert-success {
  background: var(--color-success-dim);
  color: var(--color-success);
  border: 1px solid var(--color-success);
}

.alert-danger {
  background: var(--color-danger-dim);
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
}

.alert-info {
  background: var(--color-info-dim);
  color: var(--color-info);
  border: 1px solid var(--color-info);
}

.alert-warning {
  background: var(--color-warning-dim);
  color: var(--color-warning);
  border: 1px solid var(--color-warning);
}

/* ═══ CARDS ═══ */
.card {
  background: var(--bg-glass);
  border: 1px solid var(--border-decorative);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  backdrop-filter: blur(16px);
  margin-bottom: var(--space-4);
}

.glass {
  background: var(--bg-glass);
  border: 1px solid var(--border-decorative);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(16px);
}

.card h2 {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}

/* ═══ MESSAGE STATES ═══ */
.loading, .success, .error {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  margin: var(--space-2) 0;
}

.loading {
  background: var(--bg-inset);
  color: var(--text-secondary);
  text-align: center;
}

.success {
  background: var(--color-success-dim);
  color: var(--color-success);
  border: 1px solid var(--color-success);
}

.error {
  background: var(--color-danger-dim);
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
}

/* ═══ ACCOUNT MENU TRIGGER ═══ */
/* A clearly-labeled "Account" button (icon + text) replaces the bare avatar.
   Signposts the Profile/Settings/Logout menu — important on mobile, where the
   main topbar nav is hidden and the name alone (or an initial) wasn't obvious. */
.rs-topbar__account {
  display: inline-flex;
  align-items: center;
  gap: 8px; /* rs-space-2 */
  padding: 8px 12px; /* rs-space-2 rs-space-3 */
  background: var(--rs-bg-glass);
  border: 1px solid var(--rs-border-decorative);
  border-radius: 10px; /* rs-radius-md */
  color: var(--rs-text-primary);
  font-family: var(--rs-font-body);
  font-size: 0.875rem; /* rs-text-sm */
  font-weight: 600; /* rs-weight-semibold */
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease; /* rs-transition-fast */
}

.rs-topbar__account:hover {
  background: var(--rs-bg-elevated);
  border-color: var(--rs-text-tertiary);
}

.rs-topbar__account-icon {
  flex-shrink: 0;
  color: var(--rs-text-secondary);
}

.rs-topbar__account-caret {
  flex-shrink: 0;
  color: var(--rs-text-tertiary);
  transition: transform 0.15s ease;
}

.rs-topbar__account[aria-expanded=true] .rs-topbar__account-caret {
  transform: rotate(180deg);
}

/* Keep the "Account" label visible at every width — on mobile the main nav is
   hidden, so there's room, and the explicit label is the whole point of this
   change (the old bare avatar/initial wasn't signposted). */
/* ═══ PROFILE DROPDOWN HEADER (shows the signed-in user's name) ═══ */
.profile-nav__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 10px; /* rs-space-2 rs-space-3 */
}

.profile-nav__avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px; /* rs-radius-md */
  background: linear-gradient(135deg, var(--rs-color-danger), var(--rs-color-warning));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700; /* rs-weight-bold */
  font-size: 0.875rem; /* rs-text-sm */
}

.profile-nav__name {
  font-weight: 600; /* rs-weight-semibold */
  font-size: 0.875rem; /* rs-text-sm */
  color: var(--rs-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-status {
  font-size: 0.75rem; /* rs-text-xs */
  color: var(--rs-text-tertiary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.user-status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rs-color-success);
}

/* ═══ PROFILE DROPDOWN ═══ */
.nav-profile-wrapper {
  position: relative;
}

.profile-nav {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  flex-direction: column;
  gap: 2px;
  background: var(--rs-bg-elevated);
  border: 1px solid var(--rs-border-decorative);
  border-radius: 10px; /* rs-radius-md */
  padding: 6px;
  min-width: 160px;
  z-index: 200;
  box-shadow: var(--rs-shadow-lg);
  backdrop-filter: blur(20px);
}

.profile-nav.open {
  display: flex;
}

.nav-link {
  color: var(--rs-text-secondary);
  text-decoration: none;
  padding: 8px 12px; /* rs-space-2 rs-space-3 */
  border-radius: 6px; /* rs-radius-sm */
  transition: background 0.15s ease, color 0.15s ease; /* rs-transition-fast */
  font-size: 16px;
  font-weight: 500; /* rs-weight-medium */
  display: block;
  width: 100%;
  text-align: left;
}

.nav-link:hover {
  background: var(--rs-bg-glass);
  color: var(--rs-text-primary);
}

.nav-link-button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--rs-font-body);
}

.nav-link-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.nav-divider {
  border: none;
  border-top: 1px solid var(--rs-border-decorative);
  margin: 4px 8px;
}

/* ═══ GOAL SELECTOR ═══ */
.goal-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  width: 100%;
}

.goal-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-3);
  background: var(--bg-glass);
  border: 2px solid var(--border-decorative);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-body);
  color: var(--text-tertiary);
}

.goal-option:hover {
  background: var(--bg-glass-hover);
  transform: translateY(-2px);
}

.goal-option.active {
  background: var(--color-success-dim);
  border-color: var(--color-success);
}

.goal-option[data-goal=lose].active {
  background: var(--color-danger-dim);
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.goal-option[data-goal=maintain].active {
  background: var(--color-info-dim);
  border-color: var(--color-info);
  color: var(--color-info);
}

.goal-option[data-goal=gain].active {
  background: var(--color-success-dim);
  border-color: var(--color-success);
  color: var(--color-success);
}

.goal-option[data-goal=lose].active .goal-arrow {
  stroke: var(--color-danger);
}

.goal-option[data-goal=maintain].active .goal-arrow {
  stroke: var(--color-info);
}

.goal-option[data-goal=gain].active .goal-arrow {
  stroke: var(--color-success);
}

.goal-arrow {
  width: 48px;
  height: 48px;
  stroke: currentColor;
}

.goal-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

@media (max-width: 768px) {
  .goal-selector {
    grid-template-columns: 1fr;
  }
}
/* ═══ SYNC PROGRESS ═══ */
.sync-progress {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--color-success-dim);
  border: 1px solid var(--color-success);
  border-radius: var(--radius-md);
  margin: var(--space-2) 0;
}

.sync-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-success-dim);
  border-top-color: var(--color-success);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.sync-message {
  flex: 1;
  text-align: left;
}

.sync-message strong {
  display: block;
  color: var(--color-success);
  font-size: var(--text-sm);
  margin-bottom: 4px;
}

.sync-message p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  line-height: 1.4;
}

/* ═══ PROFILE DETAILS ═══ */
.profile-details {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-4) var(--space-6);
  align-items: baseline;
}

.profile-details dt {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-align: right;
}

.profile-details dd {
  margin: 0;
  padding: 0;
  font-size: var(--text-base);
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .profile-details {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .profile-details dt {
    text-align: left;
    margin-top: var(--space-3);
  }
  .profile-details dt:first-of-type {
    margin-top: 0;
  }
}
/* ═══ STATUS BADGES ═══ */
.status-badge {
  display: inline-block;
  padding: 4px var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}

.status-badge.status-connected {
  background: var(--color-success-dim);
  color: var(--color-success);
}

.status-badge.status-disconnected {
  background: var(--color-danger-dim);
  color: var(--color-danger);
}

/* ═══ PROFILE GRIDS ═══ */
.profile-top-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-3);
}

@media (max-width: 768px) {
  .profile-top-grid {
    grid-template-columns: 1fr;
  }
}
/* ═══ DATA TABLE ═══ */
.data-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.data-toolbar-actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.data-table thead th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-decorative);
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border-decorative);
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
  background: var(--accent-dim);
}

.data-table tbody td {
  padding: var(--space-3) var(--space-4);
  vertical-align: middle;
}

.form-check-input {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-input);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.form-check-input:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.form-check-input:indeterminate {
  background: var(--accent);
  border-color: var(--accent);
}

.mono {
  font-family: var(--font-mono);
  font-weight: var(--weight-medium);
}

/* ═══ LOG ENTRY PAGE ═══ */
.log-page {
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: var(--space-16);
}

@media (max-width: 768px) {
  .log-page {
    /* Clear the bottom nav + (ad + inset via --ad-clearance). The logging
       flow hides the ad, so --ad-clearance is usually 0 here; the base 120px
       still clears the 72px nav and its safe-area padding. */
    padding-bottom: calc(120px + var(--ad-clearance, 0px));
  }
}
.log-hero {
  text-align: center;
  margin-bottom: var(--space-8);
}

.log-hero-title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-3);
}

.log-date-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  background: var(--bg-glass);
  border: 1px solid var(--border-decorative);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-body);
  font-weight: var(--weight-medium);
  min-height: 36px;
}

.log-date-button:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
}

.log-date-button svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.log-date-picker {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.log-big-input {
  font-family: var(--font-mono);
  font-size: var(--text-4xl);
  text-align: center;
  padding: var(--space-6);
  border: 2px solid var(--border-input);
}

.log-big-input:focus {
  border-color: var(--border-focus);
}

.log-unit-select {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  margin-top: var(--space-3);
  margin-bottom: var(--space-6);
}

.unit-btn {
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-tertiary);
  background: transparent;
  cursor: pointer;
  min-height: 36px;
  transition: all var(--transition-fast);
}

.unit-btn:hover {
  background: var(--bg-inset);
}

.unit-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.log-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

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

/* ═══ DELETE CONFIRMATION PAGE ═══ */
.delete-entries-list {
  max-height: 400px;
  overflow-y: auto;
}

.delete-entry-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-decorative);
  font-size: var(--text-sm);
}

.delete-entry-item:last-child {
  border-bottom: none;
}

.delete-entry-date {
  color: var(--text-secondary);
}

.delete-entry-weight {
  font-size: var(--text-base);
  color: var(--color-danger);
  font-weight: var(--weight-semibold);
}

/* ═══ SUCCESS PAGE ═══ */
.success-icon {
  background: var(--color-success-dim);
}

.success-icon svg {
  color: var(--color-success);
}

.success-summary {
  text-align: center;
  margin: var(--space-6) 0;
  padding: var(--space-6);
  background: var(--bg-glass);
  border: 1px solid var(--border-decorative);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(16px);
}

.success-weight {
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  color: var(--color-success);
  margin-bottom: var(--space-2);
}

.success-weight .mono {
  font-family: var(--font-mono);
}

.success-time {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* ═══ ONBOARDING COMPONENTS ═══ */
.onboard-page {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
  padding: var(--space-6) 0;
}

.onboard-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xl);
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-6);
}

.onboard-icon svg {
  width: 32px;
  height: 32px;
  color: var(--accent);
}

.onboard-title {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-3);
}

.onboard-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}

/* ═══ BULK UPLOAD PAGE ═══ */
.supported-formats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.format-item {
  padding: var(--space-4);
  background: var(--bg-inset);
  border-radius: var(--radius-md);
}

.format-item strong {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--text-primary);
  font-size: var(--text-sm);
}

.format-item p {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin: 0;
}

.code-block {
  font-size: var(--text-xs);
  background: var(--bg-elevated);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  color: var(--text-secondary);
}

.import-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.import-stat {
  padding: var(--space-4);
  background: var(--bg-glass);
  border: 1px solid var(--border-decorative);
  border-radius: var(--radius-lg);
  text-align: center;
}

.import-stat-value {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--accent);
  margin-bottom: var(--space-2);
}

.import-stat-label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.import-results {
  max-width: 400px;
  margin: var(--space-6) auto;
}

.result-item {
  display: flex;
  justify-content: space-between;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-decorative);
}

.result-item:last-child {
  border-bottom: none;
}

.result-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.result-value {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
}

.result-value.success {
  color: var(--color-success);
}

.result-value.error {
  color: var(--color-danger);
}

/* ═══════════════════════════════════════════
   PROFILE PAGE
   ═══════════════════════════════════════════ */
.profile-header {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin-bottom: var(--space-8);
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--color-danger), var(--color-warning));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--weight-bold);
  font-size: var(--text-xl);
  color: white;
  flex-shrink: 0;
}

.profile-info {
  flex: 1;
}

.profile-name {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-1);
}

.profile-meta {
  font-size: 16px;
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════
   PAGE HEADERS
   ═══════════════════════════════════════════ */
.page-title {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-2);
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
}

@media (min-width: 640px) {
  .page-title {
    font-size: var(--text-4xl);
  }
  .page-subtitle {
    font-size: 16px;
    margin-bottom: var(--space-8);
  }
}
.card-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-2);
}

.card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
}

@media (min-width: 640px) {
  .card-title {
    font-size: var(--text-2xl);
  }
  .card-desc {
    font-size: 16px;
  }
}
/* ═══════════════════════════════════════════
   CHARTS PAGE
   ═══════════════════════════════════════════ */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-decorative);
}

@media (min-width: 640px) {
  .chart-legend {
    gap: var(--space-6);
    flex-wrap: nowrap;
  }
}
.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 14px;
  color: var(--text-secondary);
}

@media (min-width: 640px) {
  .legend-item {
    font-size: 16px;
  }
}
.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-line-with-dot,
.legend-line-dashed {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.legend-line-with-dot svg,
.legend-line-dashed svg {
  display: block;
}

.view-toggle {
  display: flex;
  gap: var(--space-1);
  background: var(--bg-inset);
  padding: 3px;
  border-radius: var(--radius-md);
  width: 100%;
}

.view-toggle-btn {
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-weight: var(--weight-semibold);
  font-size: 13px;
  color: var(--text-tertiary);
  background: transparent;
  border: none;
  font-family: var(--font-body);
  min-height: 32px;
  flex: 1;
}

@media (min-width: 640px) {
  .view-toggle-btn {
    padding: var(--space-1) var(--space-3);
    font-size: 14px;
  }
}
.view-toggle-btn:hover {
  color: var(--text-primary);
}

.view-toggle-btn.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
}

.chart-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.chart-header .card-title {
  margin-bottom: 0;
}

.chart-header .card-desc {
  margin-bottom: 0;
  order: 3;
}

.chart-controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
}

.chart-nav-buttons {
  display: flex;
  gap: var(--space-2);
  width: 100%;
}

.chart-nav-buttons .btn {
  flex: 1;
  font-size: 13px;
}

@media (min-width: 640px) {
  .chart-nav-buttons .btn {
    font-size: 14px;
  }
}
.charts-page-wrapper {
  margin: 0;
}

@media (min-width: 768px) {
  .charts-page-wrapper {
    margin: 0 auto;
  }
}
.charts-page-header {
  padding: 0 var(--space-4);
}

@media (min-width: 768px) {
  .charts-page-header {
    padding: 0;
  }
}
.chart-card {
  padding: var(--space-4) 0;
  background: transparent;
  border: none;
  border-radius: 0;
  margin-bottom: 0;
}

@media (min-width: 768px) {
  .chart-card {
    padding: var(--space-6) 0;
    background: var(--bg-glass);
    border: 1px solid var(--border-decorative);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(16px);
    margin-bottom: var(--space-4);
  }
}
.chart-header {
  padding-left: var(--space-4);
  padding-right: var(--space-4);
  padding-bottom: var(--space-2);
}

@media (min-width: 768px) {
  .chart-header {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
    padding-bottom: 0;
  }
}
.chart-container-wrapper {
  position: relative;
  height: 300px;
  width: 100%;
  padding-left: 0;
  padding-right: 0;
}

@media (min-width: 768px) {
  .chart-container-wrapper {
    height: 400px;
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
}
.chart-legend {
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

@media (min-width: 768px) {
  .chart-legend {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
}
.chart-no-data {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--text-secondary);
}

@media (min-width: 768px) {
  .chart-no-data {
    padding: var(--space-8) var(--space-6);
  }
}
/* Desktop layout - horizontal */
@media (min-width: 768px) {
  .chart-header {
    gap: var(--space-3);
  }
  .chart-controls {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .view-toggle {
    width: auto;
  }
  .view-toggle-btn {
    flex: 0 0 auto;
  }
  .chart-nav-buttons {
    width: auto;
  }
  .chart-nav-buttons .btn {
    flex: 0 0 auto;
  }
}
/* ═══════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: calc(72px + var(--space-4)); /* above bottom nav (72px) */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  z-index: 9999;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - var(--space-8));
}

.toast {
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-lg);
  font-size: 15px;
  font-weight: var(--weight-medium);
  font-family: var(--font-body);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
  white-space: nowrap;
  backdrop-filter: blur(12px);
}

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

.toast-success {
  background: var(--color-success-dim);
  color: var(--color-success);
  border: 1px solid var(--color-success);
}

.toast-error {
  background: var(--color-danger-dim);
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
}

.toast-info {
  background: var(--color-info-dim);
  color: var(--color-info);
  border: 1px solid var(--color-info);
}

@media (min-width: 768px) {
  .toast-container {
    bottom: var(--space-6);
  }
}
/* ═══════════════════════════════════════════
   SETTINGS PAGE
   ═══════════════════════════════════════════ */
.settings-page-header {
  max-width: 640px;
  margin: 0 auto;
  margin-bottom: var(--space-8);
}

.settings-page-title {
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-2);
}

.settings-page-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
}

.settings-grid {
  display: grid;
  gap: var(--space-6);
  max-width: 640px;
  margin: 0 auto;
}

.settings-section-title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-2);
}

.settings-section-desc {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: var(--space-5);
}

.settings-section-title.danger {
  color: var(--color-danger);
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border-decorative);
  min-height: 56px;
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-row--stack {
  display: block;
  padding: var(--space-3) 0;
  min-height: 0;
}
.settings-row--stack .settings-row-label {
  display: block;
  margin-bottom: var(--space-2);
}
.settings-row--stack .settings-row-desc {
  margin-top: var(--space-1);
}
.settings-row--stack .rs-input {
  width: 100%;
}

.settings-form .btn {
  margin-top: var(--space-3);
}

.settings-form-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}
.settings-form-actions .btn {
  margin-top: var(--space-3);
}

.settings-msg {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  min-height: 1.2em;
}
.settings-msg.error {
  color: var(--color-danger);
}
.settings-msg.success {
  color: var(--color-success);
}

.settings-row-info {
  flex: 1;
}

.settings-row-label {
  font-size: 16px;
  font-weight: var(--weight-medium);
  margin-bottom: 4px;
  color: var(--text-primary);
}

.settings-row-desc {
  font-size: 16px;
  color: var(--text-tertiary);
}

.theme-selector,
.unit-selector {
  display: flex;
  gap: var(--space-2);
  background: var(--bg-inset);
  padding: 3px;
  border-radius: var(--radius-md);
}

.theme-option,
.unit-option {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-weight: var(--weight-semibold);
  font-size: 16px;
  color: var(--text-tertiary);
  background: transparent;
  border: none;
  font-family: var(--font-body);
  min-height: 36px;
}

.theme-option:hover,
.unit-option:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
}

.theme-option.active,
.unit-option.active {
  background: var(--bg-glass);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.settings-row .btn {
  min-width: 140px;
  white-space: nowrap;
  font-size: 16px;
}

#saveMessage {
  margin-top: var(--space-4);
}

@media (max-width: 768px) {
  .settings-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }
  .settings-row .btn,
  .theme-selector,
  .unit-selector {
    width: 100%;
  }
  .settings-row-info {
    width: 100%;
  }
}
/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  z-index: 1001;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 480px) {
  .profile-header {
    flex-direction: column;
    text-align: center;
  }
  .settings-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }
  .settings-row .btn {
    width: 100%;
  }
}
/* ═══════════════════════════════════════════
   HERO SUMMARY CARD
   ═══════════════════════════════════════════ */
/* Dashboard "Home" heading + freshness caption ("Updating…" / "Updated 2m ago").
   The caption reserves a fixed height so toggling its text never shifts the
   layout below it. */
.dash-heading {
  margin-bottom: var(--space-6);
}

.dash-sync-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  min-height: 18px; /* reserve space whether or not text is shown */
  font-size: var(--text-sm, 0.875rem);
  color: var(--text-tertiary);
}

.dash-sync-status__icon {
  width: 13px;
  height: 13px;
  flex: none;
  display: none; /* only shown (and spun) while syncing */
}

.dash-sync-status.is-syncing .dash-sync-status__icon {
  display: inline-block;
  animation: dashSyncSpin 0.9s linear infinite;
}

@keyframes dashSyncSpin {
  to {
    transform: rotate(360deg);
  }
}
.hero-summary {
  display: none;
  margin-bottom: var(--space-6);
  padding: var(--space-5) var(--space-6);
}

.hero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.hero-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1px 2fr;
  align-items: stretch;
  gap: 0;
  margin-bottom: var(--space-6);
}

.hero-changes-wrapper {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  align-items: stretch;
  gap: 0;
}

.hero-weight-column {
  padding-right: var(--space-6);
}

.hero-weight-display {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.hero-weight-value {
  font-family: var(--font-mono);
  font-size: 4rem;
  font-weight: var(--weight-bold);
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--color-info);
}

.hero-weight-unit {
  font-size: 1.375rem;
  font-weight: var(--weight-semibold);
  color: var(--color-info);
}

.hero-weight-alts {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.hero-weight-alts-divider {
  margin-left: var(--space-3);
  margin-right: var(--space-3);
  color: var(--border-color);
}

.hero-divider {
  width: 1px;
  align-self: stretch;
  background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.1) 20%, rgba(255, 255, 255, 0.1) 80%, transparent 100%);
}

.hero-change-column {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-change-column--weekly {
  padding: 0 var(--space-6);
}

.hero-change-column--monthly {
  padding-left: var(--space-6);
}

.hero-change-header {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: var(--weight-medium);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.hero-change-icon {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-size: 14px;
}

.hero-change-value {
  font-family: var(--font-mono);
  font-size: 1.875rem;
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: var(--space-1);
  font-variant-numeric: tabular-nums;
}

.hero-change-label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.hero-progress {
  padding-top: var(--space-5);
  border-top: 1px solid transparent;
  border-image: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.1) 20%, rgba(255, 255, 255, 0.1) 80%, transparent 100%);
  border-image-slice: 1;
  display: none;
}

.hero-progress-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-tertiary);
  margin-bottom: var(--space-3);
}

.hero-progress-bar-wrapper {
  position: relative;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
  margin-bottom: var(--space-2);
}

.hero-progress-summary {
  color: var(--text-secondary);
  font-weight: var(--weight-medium);
  font-size: var(--text-sm);
  text-align: right;
}

.hero-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00C48A 0%, #00E5A0 100%);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: 0 0 16px rgba(0, 229, 160, 0.4);
}

.hero-no-goal {
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-color);
  display: none;
  text-align: center;
}

.hero-no-goal-text {
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
}

@media (max-width: 640px) {
  .container {
    padding: var(--space-6) var(--space-4);
    /* Clear the fixed bottom nav (72px) + a gap + the ad banner and bottom
       safe-area inset (both in --ad-clearance, set by ads.js; 0 when no ad).
       Without --ad-clearance the page content rendered behind the ad and into
       the gesture-bar zone under edge-to-edge. */
    padding-bottom: calc(96px + var(--ad-clearance, 0px));
  }
  /* Hero responsive layout */
  .hero-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
  }
  .hero-weight-column {
    padding-right: 0;
    padding-bottom: var(--space-5);
    border-bottom: 1px solid var(--border-color);
  }
  /* Hide divider between weight and changes */
  .hero-grid > .hero-divider {
    display: none;
  }
  .hero-change-column--weekly {
    padding: 0 var(--space-4) 0 0;
  }
  .hero-change-column--monthly {
    padding: 0 0 0 var(--space-4);
  }
  .onboard-actions {
    flex-direction: column;
  }
  .data-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .data-toolbar-actions {
    width: 100%;
    flex-direction: column;
  }
  .data-toolbar-actions .btn {
    width: 100%;
  }
  /* Remove extra horizontal padding on charts page for mobile */
  .charts-page-header {
    padding-left: 0;
    padding-right: 0;
  }
  .chart-header {
    padding-left: 0;
    padding-right: 0;
  }
}
a:not([class]),
.rs-link {
  color: var(--rs-color-info, var(--color-info, #2a4fa8));
  text-decoration: none;
}
a:not([class]):hover, a:not([class]):focus-visible,
.rs-link:hover,
.rs-link:focus-visible {
  text-decoration: underline;
}

:root {
  --ad-clearance: 0px;
}

@media (max-width: 640px) {
  .rs-bottom-nav {
    bottom: var(--ad-clearance, 0px);
  }
  .rs-bottom-nav {
    padding-bottom: var(--ad-nav-pad, env(safe-area-inset-bottom, 8px));
  }
  .rs-container {
    padding-bottom: calc(96px + var(--ad-clearance, 0px));
  }
}
body {
  padding-top: max(var(--safe-area-inset-top, 0px), env(safe-area-inset-top, 0px));
  padding-left: max(var(--safe-area-inset-left, 0px), env(safe-area-inset-left, 0px));
  padding-right: max(var(--safe-area-inset-right, 0px), env(safe-area-inset-right, 0px));
  background: var(--bg-page);
}

html {
  background: var(--bg-page);
}

body::before,
body::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  background: var(--bg-page);
  z-index: 90;
  pointer-events: none;
}

body::before {
  top: 0;
  height: max(var(--safe-area-inset-top, 0px), env(safe-area-inset-top, 0px));
}

body::after {
  bottom: 0;
  height: max(var(--ad-clearance, 0px), env(safe-area-inset-bottom, 0px));
}

.rs-card {
  background: var(--rs-bg-glass);
  border: 1px solid var(--rs-border-decorative);
  border-radius: var(--rs-radius-lg);
  box-shadow: var(--rs-shadow-md);
  backdrop-filter: blur(20px);
}

.home-page {
  position: relative;
  overflow-x: hidden;
  background: var(--rs-bg-page);
  color: var(--rs-text-primary);
  font-family: var(--rs-font-body);
}
.home-page::before, .home-page::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(130px);
  z-index: 0;
  pointer-events: none;
}
.home-page::before {
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, var(--rs-accent-dim), transparent 70%);
  top: -180px;
  right: -140px;
}
.home-page::after {
  width: 680px;
  height: 680px;
  background: radial-gradient(circle, var(--rs-color-info-dim), transparent 70%);
  bottom: -260px;
  left: -200px;
}
.home-page .home-wrap {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}
.home-page section {
  position: relative;
  z-index: 1;
}
.home-page .home-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
}
.home-page .home-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}
.home-page .home-brand__text {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--rs-text-primary);
}
.home-page .home-brand__text span {
  color: var(--rs-accent);
}
.home-page .home-nav__links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.home-page .home-nav__link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--rs-text-secondary);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--rs-radius-md);
}
.home-page .home-nav__link:hover {
  color: var(--rs-text-primary);
  background: var(--rs-bg-glass);
}
.home-page .home-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  padding: 64px 0 72px;
}
.home-page .home-hero__title {
  font-size: clamp(2.4rem, 4.4vw, 3.5rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: var(--rs-text-primary);
  margin-bottom: 20px;
  text-wrap: balance;
}
.home-page .home-hero__title .accent {
  color: var(--rs-accent);
}
.home-page .home-hero__sub {
  font-size: 1.18rem;
  line-height: 1.55;
  color: var(--rs-text-secondary);
  max-width: 30ch;
  margin-bottom: 30px;
}
.home-page .home-hero__cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.home-page .home-hero__note {
  margin-top: 22px;
  font-size: 0.85rem;
  color: var(--rs-text-tertiary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.home-page .home-hero__note svg {
  width: 15px;
  height: 15px;
  color: var(--rs-accent);
  flex-shrink: 0;
}
.home-page .play-badge {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: transform 0.15s ease;
}
.home-page .play-badge:hover {
  transform: translateY(-1px);
}
.home-page .play-badge picture {
  display: block;
}
.home-page .play-badge img {
  height: 56px;
  width: auto;
  display: block;
}
.home-page .play-soon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--rs-text-secondary);
  background: var(--rs-bg-elevated);
  border: 1px solid var(--rs-border-decorative);
  border-radius: 999px;
  padding: 10px 16px;
}
.home-page .play-soon svg {
  width: 16px;
  height: 16px;
  color: var(--rs-accent);
  flex-shrink: 0;
}
.home-page .home-hero__goals {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.home-page .goalpill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--rs-text-primary);
  background: var(--rs-bg-glass);
  border: 1px solid var(--rs-border-decorative);
  padding: 6px 13px;
  border-radius: var(--rs-radius-full);
  backdrop-filter: blur(12px);
}
.home-page .goalpill .a {
  color: var(--rs-accent);
  font-weight: 700;
}
.home-page .goaltext {
  font-size: 0.82rem;
  color: var(--rs-text-tertiary);
  margin-left: 2px;
}
.home-page .chartcard {
  padding: 26px;
}
.home-page .chartcard__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  gap: 12px;
}
.home-page .chartcard__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--rs-text-primary);
  line-height: 1.2;
  white-space: nowrap;
}
.home-page .chartcard__meta {
  font-family: var(--rs-font-body);
  font-size: 0.78rem;
  color: var(--rs-text-tertiary);
  margin-top: 4px;
}
.home-page .chartcard__canvas {
  position: relative;
  height: 240px;
}
.home-page .chartcard__legend {
  display: flex;
  gap: 18px;
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--rs-text-secondary);
}
.home-page .lg {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.home-page .lg__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--rs-text-tertiary);
  background: var(--rs-bg-elevated);
}
.home-page .lg__line {
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: var(--rs-color-success);
}
.home-page .sec-head {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 44px;
}
.home-page .sec-head h2 {
  font-size: clamp(1.8rem, 3vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--rs-text-primary);
  margin-bottom: 12px;
  text-wrap: balance;
}
.home-page .sec-head p {
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--rs-text-secondary);
}
.home-page .divider-label {
  font-family: var(--rs-font-body);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--rs-accent);
  margin-bottom: 14px;
}
.home-page .features {
  padding: 40px 0 24px;
}
.home-page .features__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.home-page .feature {
  padding: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.home-page .feature h3 {
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--rs-text-primary);
  margin-bottom: 8px;
}
.home-page .feature p {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--rs-text-secondary);
}
.home-page .feature__icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: var(--rs-radius-md);
  background: var(--rs-accent-dim);
  color: var(--rs-accent);
  margin-bottom: 18px;
}
.home-page .feature__icon svg {
  width: 23px;
  height: 23px;
}
.home-page .how {
  padding: 72px 0 40px;
}
.home-page .steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.home-page .step {
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.home-page .step h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--rs-text-primary);
  margin-bottom: 8px;
}
.home-page .step p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--rs-text-secondary);
}
.home-page .step__num {
  font-family: var(--rs-font-body);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--rs-accent);
  background: var(--rs-accent-dim);
  width: 46px;
  height: 46px;
  border-radius: var(--rs-radius-md);
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
}
.home-page .ctaband {
  text-align: center;
  padding: 66px 32px;
  margin: 64px 0;
  border-radius: var(--rs-radius-xl);
  background: var(--rs-bg-glass);
  border: 1px solid var(--rs-border-decorative);
  backdrop-filter: blur(20px);
  box-shadow: var(--rs-shadow-md);
}
.home-page .ctaband h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--rs-text-primary);
  margin-bottom: 14px;
}
.home-page .ctaband p {
  font-size: 1.05rem;
  color: var(--rs-text-secondary);
  max-width: 460px;
  margin: 0 auto 28px;
}
.home-page .ctaband__cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}
.home-page .home-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--rs-border-decorative);
  padding: 30px 0 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.home-page .home-footer .copy {
  font-size: 0.85rem;
  color: var(--rs-text-tertiary);
}
.home-page .home-footer__links {
  display: flex;
  gap: 22px;
}
.home-page .home-footer__links a {
  font-size: 0.85rem;
  color: var(--rs-color-info, var(--color-info, #2a4fa8));
  text-decoration: none;
}
.home-page .home-footer__links a:hover {
  text-decoration: underline;
}
@media (max-width: 900px) {
  .home-page .home-hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 40px 0 48px;
  }
  .home-page .home-hero__sub {
    max-width: none;
  }
  .home-page .features__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .home-page .home-nav__link {
    display: none;
  }
}
@media (max-width: 640px) {
  .home-page .steps {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .home-page .step {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 16px;
    text-align: left;
    padding: 20px;
  }
  .home-page .step__num {
    margin: 0;
    grid-row: 1/span 2;
    align-self: center;
  }
  .home-page .step h3 {
    align-self: end;
    margin-bottom: 4px;
  }
  .home-page .step p {
    align-self: start;
  }
  .home-page .home-hero__cta .rs-btn,
  .home-page .ctaband__cta .rs-btn {
    width: 100%;
    justify-content: center;
  }
  .home-page .home-hero__cta .play-badge,
  .home-page .ctaband__cta .play-badge {
    justify-content: center;
  }
}
@media (max-width: 460px) {
  .home-page .features__grid {
    grid-template-columns: 1fr;
  }
}

.form-input.is-locked {
  opacity: 0.7;
  cursor: not-allowed;
  background: var(--bg-inset, rgba(255, 255, 255, 0.04));
}

.rs-footer {
  border-top: 1px solid var(--rs-border-decorative, rgba(255, 255, 255, 0.08));
  margin-top: var(--space-8, 40px);
  padding: 20px 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.rs-footer .rs-footer__copy {
  font-size: 0.85rem;
  color: var(--rs-text-tertiary, var(--text-tertiary));
}
.rs-footer .rs-footer__links {
  display: flex;
  gap: 20px;
}
.rs-footer .rs-footer__links a {
  font-size: 0.85rem;
  color: var(--rs-color-info, var(--color-info, #2a4fa8));
  text-decoration: none;
}
.rs-footer .rs-footer__links a:hover {
  text-decoration: underline;
}
@media (max-width: 640px) {
  .rs-footer {
    margin-bottom: 84px;
  }
}
