:root {
  --bg: #f4f8ff;
  --surface: #ffffff;
  --surface-muted: #eef5ff;
  --stat-surface: #eef5ff;
  --field-surface: var(--stat-surface);
  --field-locked-base: #f7fbff;
  --field-locked-stripe: #d9e9ff;
  --text: #142033;
  --muted: #66758f;
  --line: #d8e4f5;
  --primary: #2563eb;
  --primary-soft: #e8f1ff;
  --primary-dark: #1d4ed8;
  --blue: #2563eb;
  --disabled-button-text: #7288aa;
  --danger: #c93a3a;
  --warning: #a76b00;
  --success: #1d6fd8;
  --shadow:
    0 16px 38px rgba(37, 99, 235, 0.10),
    0 0 20px rgba(37, 99, 235, 0.06);
  --radius: 14px;
  --space-sm: 10px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 22px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button,
a,
input,
select,
textarea,
[role="button"],
.brand-home,
.report-card {
  -webkit-tap-highlight-color: transparent;
}

a:active {
  color: var(--primary-dark);
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100%;
}

.loading,
.noscript {
  max-width: 440px;
  margin: 48px auto;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.route-loader {
  min-height: calc(100svh - 236px - env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  padding: 24px;
}

.route-loader-mark {
  position: relative;
  width: clamp(240px, 78vw, 360px);
  aspect-ratio: 1;
}

.route-loader-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  overflow: visible;
}

.route-loader-logo .arrow-up {
  animation: route-arrow-up 1.35s ease-in-out infinite;
}

.route-loader-logo .arrow-down {
  animation: route-arrow-down 1.35s ease-in-out infinite;
}

@keyframes route-arrow-up {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

@keyframes route-arrow-down {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .route-loader-logo .arrow-up,
  .route-loader-logo .arrow-down {
    animation: none;
  }
}

.auth-layout {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.auth-card,
.panel {
  width: 100%;
  min-width: 0;
  max-width: 520px;
  background: var(--surface);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.auth-brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 20px;
  min-width: 0;
}

.auth-logo-frame {
  width: var(--auth-logo-size, 64px);
  height: var(--auth-logo-size, 64px);
  flex: 0 0 var(--auth-logo-size, 64px);
  display: grid;
  place-items: center;
  background: #eff6ff;
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
  overflow: hidden;
}

.auth-logo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

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

.auth-brand-copy h1 {
  margin: 0;
}

.auth-brand-copy p {
  width: 100%;
  max-width: 300px;
  margin: 4px 0 0;
  color: #8493aa;
  font-size: 14px;
  line-height: 1.35;
}

.auth-card h1,
.auth-card h2,
.panel h2,
.section-title {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.2;
}

.subtitle,
.muted {
  color: var(--muted);
}

.subtitle {
  margin: 0 0 var(--space-xl);
  line-height: 1.45;
}

.field {
  margin: 0 0 var(--space-lg);
}

.report-first-field {
  margin-top: 20px;
}

.field label,
.label {
  display: block;
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 48px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}

.field.locked input:disabled,
.measurement-field.locked input:disabled {
  color: var(--muted);
  background:
    repeating-linear-gradient(
      135deg,
      var(--field-locked-base) 0,
      var(--field-locked-base) 8px,
      var(--field-locked-stripe) 8px,
      var(--field-locked-stripe) 14px
    );
  cursor: not-allowed;
  opacity: 1;
  -webkit-text-fill-color: var(--muted);
}

.weight-input {
  width: 100%;
  max-width: 260px;
  min-height: 90px;
  border: 0;
  border-bottom: 3px solid var(--primary);
  background: transparent;
  color: var(--text);
  font-size: 56px;
  font-weight: 800;
  text-align: center;
  outline: none;
}

.weight-stepper,
.weight-input-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: 20px 0 22px;
}

.weight-step-button {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: #dbeafe;
  color: var(--primary-dark);
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}

.weight-step-button:active {
  background: #cfe1ff;
  transform: scale(0.96);
}

.button {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

.button:hover {
  background: var(--primary-dark);
}

.button:not(:disabled):active {
  background: var(--primary-dark);
  transform: scale(0.985);
}

.button:disabled {
  background:
    repeating-linear-gradient(
      135deg,
      var(--field-locked-base) 0,
      var(--field-locked-base) 8px,
      var(--field-locked-stripe) 8px,
      var(--field-locked-stripe) 14px
    );
  color: var(--disabled-button-text);
  cursor: not-allowed;
  box-shadow: none;
}

.primary-action-button,
.report-save-action .button {
  min-height: 64px;
  border-radius: 16px;
  font-size: 16px;
}

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

.button.secondary:not(:disabled):active {
  background: #dbeafe;
}

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

.button.danger:not(:disabled):active {
  background: #f5d7d7;
}

.button.inline {
  width: auto;
  min-height: 38px;
  padding: 8px 12px;
  font-size: 14px;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 800;
  padding: 0;
}

.link-button:active {
  color: var(--primary-dark);
  transform: scale(0.98);
}

.message,
.error {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  margin-top: var(--space-md);
  padding: 11px 13px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  animation: feedback-in 180ms ease-out;
}

.message {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.error {
  background: #fdeaea;
  color: var(--danger);
}

@keyframes feedback-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .message,
  .error {
    animation: none;
  }
}

.app-layout {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 14px calc(148px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 16px;
}

.brand-home {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: min(68vw, 420px);
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.brand-home:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.24);
  outline-offset: 4px;
  border-radius: 14px;
}

.brand-home:active {
  opacity: 0.72;
  transform: scale(0.99);
}

.brand-logo {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
}

.brand-copy {
  display: grid;
  min-width: 0;
  line-height: 1.15;
}

.brand-copy .muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand {
  font-size: 22px;
  font-weight: 900;
}

.topbar-date-card {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0;
}

.date-weekday {
  color: var(--muted);
  font-size: 24px;
  font-weight: 300;
  line-height: 1.2;
}

.date-stack {
  display: inline-flex;
  align-items: baseline;
  padding-left: 10px;
  border-left: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.date-stack strong {
  color: var(--muted);
  font-size: 24px;
  font-weight: 300;
  line-height: 1.2;
}

.content-grid {
  display: grid;
  gap: var(--space-lg);
}

.content-grid.single-column {
  max-width: 640px;
}

.profile-admin-section {
  margin-top: var(--space-lg);
}

.panel {
  max-width: none;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin: 0 0 8px;
}

.panel-title-row h2 {
  margin: 0;
}

.profile-logout-button {
  min-height: 32px;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 14px;
  font-weight: 900;
}

.profile-logout-button:active {
  background: #dbeafe;
  transform: scale(0.98);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}

.stat {
  padding: 13px;
  border-radius: 12px;
  background: var(--stat-surface);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stat strong {
  display: block;
  margin-top: 4px;
  font-size: 21px;
}

.week-progress-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.week-progress {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  margin-top: 10px;
}

.week-progress-segment {
  display: block;
  min-width: 0;
  height: 16px;
  border-radius: 5px;
}

.week-progress-segment.future {
  background: #d9e8fb;
}

.week-progress-segment.missing {
  background: #f5c84b;
}

.week-progress-segment.filled {
  background: #35c778;
}

.warning {
  padding: 12px;
  border-radius: 12px;
  background: #fff4db;
  color: var(--warning);
  font-weight: 800;
  line-height: 1.35;
}

.report-reminder,
.report-lock-note {
  padding: 12px;
  border-radius: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.report-reminder {
  margin: var(--space-md) 0 var(--space-lg);
}

.report-reminder.due {
  background: #fff0d7;
  color: #a95500;
}

.report-reminder.submitted {
  background: #eafbf1;
  color: #167249;
}

.report-lock-note {
  margin: var(--space-md) 0 0;
}

.average-note {
  margin: var(--space-lg) 0 0;
}

.warning.report-lock-note,
.report-reminder.average-note {
  background: var(--field-surface);
  color: var(--muted);
  font-weight: 400;
}

.report-reminder.today-report-reminder {
  font-weight: 400;
}

.report-reminder.report-lock-note {
  font-weight: 400;
}

.segmented {
  display: flex;
  gap: var(--space-md);
}

.segmented button {
  flex: 1;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.segmented button.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  box-shadow: none;
}

.segmented button:active {
  background: #eaf2ff;
  transform: scale(0.985);
}

.segmented button.active:active {
  background: #dbeafe;
}

.weekday-segmented {
  gap: 6px;
}

.weekday-segmented button {
  min-width: 0;
  min-height: 42px;
  padding: 8px 0;
  font-size: 13px;
}

#profile-form .field {
  margin: 0 0 var(--space-md);
  padding: var(--space-md);
  border-radius: 14px;
  background: var(--field-surface);
}

#profile-form .field label {
  margin-bottom: 8px;
  color: var(--text);
}

#profile-form .field input {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: #fff;
}

#profile-form .field input:focus {
  background: var(--primary-soft);
  box-shadow: none;
}

#profile-form .segmented button {
  border: 0;
  background: #fff;
  box-shadow: none;
}

#profile-form .segmented button.active {
  border: 0;
  background: #dbeafe;
  color: var(--primary-dark);
}

#profile-form .segmented button:active {
  background: #eaf2ff;
}

#profile-form .segmented button.active:active {
  background: #cfe1ff;
}

.bottom-nav {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(28px + env(safe-area-inset-bottom));
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(var(--tab-count), 1fr);
  gap: 4px;
  max-width: 520px;
  margin: 0 auto;
  padding: 6px;
  background: rgba(255, 255, 255, 0.94);
  border: 0;
  border-radius: 999px;
  box-shadow:
    0 0 52px rgba(37, 99, 235, 0.30),
    0 0 18px rgba(37, 99, 235, 0.16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
}

.mobile-nav-veil {
  position: fixed;
  left: 0;
  right: 0;
  bottom: -18px;
  z-index: 19;
  height: calc(136px + env(safe-area-inset-bottom));
  background: rgba(244, 248, 255, 0.12);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.04) 10%, rgba(0, 0, 0, 0.28) 24%, rgba(0, 0, 0, 0.72) 42%, #000 58%, #000 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.04) 10%, rgba(0, 0, 0, 0.28) 24%, rgba(0, 0, 0, 0.72) 42%, #000 58%, #000 100%);
  pointer-events: none;
}

.bottom-nav button {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.bottom-nav button.active {
  background: var(--surface-muted);
  color: var(--primary);
}

.bottom-nav button:active {
  background: var(--surface-muted);
  transform: scale(0.985);
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: var(--space-lg) 0;
}

.account-actions {
  display: grid;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.back-link {
  display: inline-flex;
  margin-bottom: 14px;
}

.report-editor-form {
  display: grid;
  gap: var(--space-lg);
}

.report-edit-title {
  color: var(--text);
}

.week-selector {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 46px;
  gap: 8px;
  align-items: stretch;
  margin-bottom: var(--space-lg);
}

.week-selector-step {
  border: 0;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 900;
  min-height: 54px;
  font-size: 28px;
  line-height: 1;
  transition: background 0.16s, color 0.16s, transform 0.16s;
}

.week-selector-step:not(:disabled):active {
  background: #dbeafe;
  color: var(--primary-dark);
  transform: scale(0.97);
}

.week-selector-step:disabled {
  color: var(--disabled-button-text);
  cursor: default;
  opacity: 0.42;
}

.week-selector-range {
  display: grid;
  gap: 4px;
  align-content: center;
  min-width: 0;
  min-height: 54px;
  padding: 9px 12px;
  border-radius: 14px;
  background: var(--field-surface);
}

.week-selector-range span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.week-selector-range strong {
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-selector-range.has-report strong {
  color: var(--muted);
}

.report-save-action {
  display: grid;
  gap: var(--space-md);
  margin-top: var(--space-lg);
  padding: 0;
}

.report-save-action .button:disabled,
.report-save-action .button:disabled:hover,
.report-save-action .button:disabled:active {
  box-shadow: none;
  transform: none;
}

.report-save-action .message,
.report-save-action .error {
  margin-top: 0;
}

.report-delete-button {
  margin-top: 2px;
}

.report-delete-confirm {
  display: grid;
  gap: var(--space-md);
  margin-top: 2px;
  padding: var(--space-md);
  border-radius: 16px;
  background: #fce8e8;
  color: var(--danger);
}

.report-delete-confirm[hidden] {
  display: none;
}

.report-delete-confirm p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.report-delete-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.history-report-list {
  display: grid;
  gap: var(--space-lg);
}

.history-report-list.empty {
  min-height: min(54svh, 520px);
  place-items: center;
}

.empty-history-note {
  width: min(100%, 520px);
  padding: 18px 20px;
  border-radius: 18px;
  background: var(--stat-surface);
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}

.report-card {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: var(--space-md);
  padding: var(--space-lg);
  border: 0;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  transition: background 0.16s, box-shadow 0.16s, filter 0.16s, transform 0.16s;
}

.report-card:hover,
.report-card:focus-visible {
  background: #f8fbff;
  box-shadow: 0 18px 42px rgba(37, 99, 235, 0.14);
  outline: none;
  transform: translateY(-1px);
}

.report-card:active,
.report-card.is-activating {
  box-shadow:
    inset 0 10px 24px rgba(37, 99, 235, 0.42),
    inset 0 -8px 18px rgba(96, 165, 250, 0.28),
    0 5px 14px rgba(37, 99, 235, 0.08);
  transform: translateY(3px) scale(0.982);
}

.report-card-header {
  display: flex;
  align-items: center;
  min-height: 26px;
}

.report-card-header strong {
  color: var(--text);
  font-size: 17px;
  font-weight: 900;
}

.report-card-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.report-card-metric {
  min-width: 0;
  padding: 11px 9px;
  border-radius: 12px;
  background: var(--stat-surface);
  transition: background 0.16s;
}

.report-card-metric > span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-card-metric > strong {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  margin-top: 4px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.1;
  white-space: nowrap;
}

.history-load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 72px;
  padding: 16px 20px;
  border: 0;
  border-radius: var(--radius);
  background: #e8f1ff;
  color: var(--primary);
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: center;
  transition: background 0.18s, box-shadow 0.18s, color 0.18s, transform 0.18s;
}

.history-load-more span {
  font-size: 16px;
  font-weight: 900;
  line-height: 1.15;
}

.history-load-more:hover,
.history-load-more:focus-visible {
  background: #dbeafe;
  box-shadow: 0 18px 42px rgba(37, 99, 235, 0.14);
  color: var(--primary-dark);
  outline: none;
  transform: translateY(-1px);
}

.history-load-more:active,
.history-load-more.is-loading {
  background: #c7dcff;
  box-shadow: 0 22px 50px rgba(37, 99, 235, 0.24);
  color: var(--primary-dark);
  transform: translateY(-2px) scale(1.012);
}

.history-load-more.is-loading span::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 8px;
  border-radius: 999px;
  background: currentColor;
  animation: history-load-more-pulse 0.62s ease-in-out infinite alternate;
  vertical-align: 2px;
}

.history-load-more:disabled {
  cursor: default;
}

@keyframes history-load-more-pulse {
  from {
    opacity: 0.35;
    transform: scale(0.78);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.trend-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  color: #9aa9bd;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.trend-indicator.up {
  color: #2563eb;
}

.trend-indicator.down {
  color: #60a5fa;
}

.trend-indicator.flat {
  background: transparent;
  color: #9aa9bd;
}

.trend-indicator svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.trend-indicator path {
  fill: none;
  stroke: currentColor;
  stroke-width: 4.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.measurement-field {
  display: grid;
  grid-template-columns: minmax(58px, max-content) minmax(0, 1fr);
  gap: var(--space-md);
  align-items: center;
  margin: 0 0 var(--space-md);
  padding: var(--space-md);
  border: 0;
  border-radius: 14px;
  background: var(--field-surface);
}

.measurement-field.locked {
  background: var(--field-surface);
}

.measurement-label {
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.measurement-field.locked .measurement-label {
  color: var(--muted);
}

.measurement-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.measurement-control input {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.measurement-control input:focus {
  background: #fff;
  box-shadow: none;
}

.measurement-unit {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.week-weight-list {
  display: grid;
  gap: var(--space-md);
}

.week-weight-row {
  display: grid;
  grid-template-columns: minmax(78px, 0.42fr) minmax(0, 1fr);
  gap: var(--space-md);
  align-items: center;
  padding: var(--space-md);
  border: 0;
  border-radius: 14px;
  background: var(--field-surface);
  overflow: hidden;
}

.week-weight-row.disabled {
  background: var(--field-surface);
  color: var(--muted);
}

.week-weight-day {
  display: grid;
  gap: 2px;
}

.week-weight-day strong {
  font-size: 16px;
}

.week-weight-day span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.small-input {
  max-width: 120px;
  min-height: 38px;
  padding: 8px;
  border: 0;
  border-radius: 10px;
  background: #fff;
}

.week-weight-input {
  width: 100%;
  min-width: 0;
  max-width: none;
  outline: none;
}

.week-weight-input:focus {
  background: #fff;
  box-shadow: none;
}

.week-weight-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 0;
  gap: 8px;
  align-items: center;
  justify-content: stretch;
  min-width: 0;
  transition: grid-template-columns 0.18s ease;
}

.week-weight-control.is-editing,
.week-weight-control.is-dirty,
.week-weight-control.is-saving,
.week-weight-control.is-saved {
  grid-template-columns: minmax(0, 1fr) auto 42px;
  justify-content: stretch;
}

.week-weight-unit {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.week-weight-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  opacity: 0;
  transform: translateX(6px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.16s ease;
}

.week-weight-control.is-editing .week-weight-save,
.week-weight-control.is-dirty .week-weight-save,
.week-weight-control.is-saving .week-weight-save,
.week-weight-control.is-saved .week-weight-save {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}

.week-weight-control.is-saving .week-weight-save {
  opacity: 0.72;
}

.week-weight-control.is-editing .week-weight-save:active,
.week-weight-control.is-dirty .week-weight-save:active {
  background: var(--primary-dark);
  transform: translateX(0) scale(0.96);
}

.week-weight-control.is-saved .week-weight-save {
  background: #35c778;
}

.week-weight-control.is-closing .week-weight-save {
  background: #35c778;
}

.week-weight-save:disabled {
  cursor: default;
}

.week-weight-input::placeholder {
  color: #9aabc4;
  opacity: 1;
}

.week-weight-input:disabled {
  color: var(--muted);
  background:
    repeating-linear-gradient(
      135deg,
      var(--field-locked-base) 0,
      var(--field-locked-base) 8px,
      var(--field-locked-stripe) 8px,
      var(--field-locked-stripe) 14px
    );
  cursor: not-allowed;
  opacity: 1;
  -webkit-text-fill-color: var(--muted);
}

.week-weight-control.disabled {
  grid-template-columns: minmax(0, 1fr) auto 0;
}

.week-weight-control.disabled .week-weight-save {
  display: none;
}

.danger-zone {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.danger-panel {
  border-color: #f0b8b8;
}

.measurement-guide {
  display: grid;
  gap: var(--space-lg);
}

.measurement-guide-list {
  display: grid;
  gap: var(--space-md);
}

.measurement-guide-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: var(--space-md);
  align-items: center;
  padding: var(--space-md);
  border-radius: 18px;
  background: var(--field-surface);
}

.measurement-guide-item h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.15;
}

.measurement-guide-item p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.measurement-guide-figure {
  width: 112px;
  aspect-ratio: 1;
  border-radius: 20px;
  background: #f8fbff;
  display: grid;
  place-items: center;
}

.measurement-guide-figure svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.guide-head,
.guide-body,
.guide-shoulders {
  fill: none;
  stroke: #b8cdf0;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.guide-head {
  fill: #eef5ff;
}

.guide-tape,
.guide-tape-light {
  fill: none;
  stroke: var(--primary);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.guide-tape-light {
  stroke: #60a5fa;
  stroke-width: 4;
}

.confirm-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 16px;
  color: var(--text);
  font-weight: 700;
  line-height: 1.35;
}

.confirm-row input {
  flex: 0 0 auto;
  margin-top: 3px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table th,
.table td {
  padding: 9px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.table th {
  color: var(--muted);
  font-size: 12px;
}

.admin-users-table {
  table-layout: fixed;
}

.admin-users-table th:nth-child(1),
.admin-users-table td:nth-child(1) {
  width: 33%;
}

.admin-users-table th:nth-child(2),
.admin-users-table td:nth-child(2) {
  width: 13%;
}

.admin-users-table th:nth-child(3),
.admin-users-table td:nth-child(3) {
  width: 14%;
}

.admin-users-table th:nth-child(4),
.admin-users-table td:nth-child(4) {
  width: 13%;
}

.admin-users-table th:nth-child(5),
.admin-users-table td:nth-child(5) {
  width: 27%;
  text-align: right;
}

.admin-users-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-users-table td:last-child {
  overflow: visible;
}

.admin-users-table .button.inline {
  min-width: 74px;
  padding-inline: 10px;
  white-space: nowrap;
}

@media (min-width: 760px) {
  .app-layout {
    padding: 26px 24px 32px;
  }

  .content-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    align-items: stretch;
  }

  .content-grid.single-column {
    grid-template-columns: minmax(0, 1fr);
  }

  .bottom-nav {
    position: sticky;
    top: 0;
    bottom: auto;
    left: auto;
    right: auto;
    z-index: 30;
    max-width: 1120px;
    margin: 0 auto 16px;
    border: 0;
    border-radius: 999px;
    padding: 6px;
    box-shadow: none;
    overflow: visible;
  }

  .mobile-nav-veil {
    display: none;
  }

  .bottom-nav::after {
    content: "";
    position: absolute;
    left: -1px;
    right: -1px;
    bottom: -17px;
    height: 16px;
    background: var(--bg);
    pointer-events: none;
  }

  .bottom-nav button {
    min-height: 42px;
  }

  .measurement-field {
    grid-template-columns: minmax(58px, max-content) minmax(0, 1fr);
  }
}

@media (min-width: 760px) and (max-width: 899px) {
  .content-grid.admin-grid,
  .content-grid.profile-admin-section {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 900px) {
  .content-grid.profile-admin-section {
    grid-template-columns: minmax(0, 1fr);
    margin-top: var(--space-lg);
  }
}

@media (max-width: 520px) {
  .topbar {
    gap: 8px;
  }

  .brand-home {
    max-width: calc(100% - 164px);
    gap: 8px;
  }

  .brand-logo {
    width: 48px;
    height: 48px;
  }

  .brand {
    font-size: 20px;
  }

  .topbar-date-card {
    min-height: 48px;
    gap: 8px;
  }

  .date-weekday {
    font-size: 24px;
  }

  .date-stack {
    padding-left: 8px;
  }

  .date-stack strong {
    font-size: 24px;
  }

  .weight-stepper {
    gap: 10px;
  }

  .weight-input {
    max-width: 170px;
    font-size: 48px;
  }

  .weight-step-button {
    flex-basis: 50px;
    width: 50px;
    height: 50px;
  }

  .measurement-guide-item {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .measurement-guide-figure {
    width: 92px;
  }
}
