:root {
  --bg: #faf6f0;
  --surface: #fffdf9;
  --surface-2: #fff8ee;
  --text: #2c2419;
  --text-muted: #7a6f62;
  --accent: #e8876a;
  --accent-deep: #c96a4f;
  --accent-soft: #fde8df;
  --mint: #7eb8a4;
  --mint-soft: #e8f4ef;
  --border: rgba(44, 36, 25, 0.08);
  --shadow: 0 8px 32px rgba(44, 36, 25, 0.08);
  --radius: 20px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "DM Sans", system-ui, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.bg-glow--top {
  width: 280px;
  height: 280px;
  top: -80px;
  right: -60px;
  background: rgba(232, 135, 106, 0.25);
}

.bg-glow--bottom {
  width: 320px;
  height: 320px;
  bottom: 120px;
  left: -100px;
  background: rgba(126, 184, 164, 0.2);
}

.app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
  padding-bottom: calc(3rem + env(safe-area-inset-bottom));
}

.page-loading {
  position: fixed;
  inset: 0;
  z-index: 84;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(250, 246, 240, 0.52);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.page-loading--visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.page-loading__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  min-width: 8.5rem;
  padding: 1.15rem 1.35rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  background: rgba(255, 253, 249, 0.98);
  box-shadow: 0 12px 40px rgba(44, 36, 25, 0.12);
}

.page-loading__spinner {
  width: 2.35rem;
  height: 2.35rem;
  border: 3px solid rgba(232, 135, 106, 0.18);
  border-top-color: var(--accent-deep);
  border-radius: 50%;
  animation: page-loading-spin 0.7s linear infinite;
}

.page-loading__text {
  margin: 0;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

body.body--loading {
  overflow: hidden;
}

@keyframes page-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.header {
  position: relative;
  margin-bottom: 1.5rem;
}

.header__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.5rem;
  margin-bottom: 0.35rem;
}

.header__top-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  max-width: 62%;
}

.header__user {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.header__avatar {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 2px 8px rgba(44, 36, 25, 0.1);
  font-size: 0.92rem;
  line-height: 1;
}

.header__username {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header__logout {
  flex-shrink: 0;
  padding: 0.35rem 0.55rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.header__logout:active {
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.header__admin-entry {
  flex-shrink: 0;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  color: var(--mint-deep);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.header__admin-entry:active {
  background: var(--mint-soft);
}

.brand-logo {
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}

.brand-logo--header {
  width: 2.5rem;
  height: 2.5rem;
}

.brand-logo--page {
  width: 3.25rem;
  height: 3.25rem;
  margin-bottom: 0.35rem;
}

.brand-logo--hero {
  width: 3.75rem;
  height: 3.75rem;
}

.header__title {
  margin: 0.1rem 0 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header__disclaimer {
  margin: 0.2rem 0 0;
  font-size: 0.72rem;
  line-height: 1.55;
  color: rgba(122, 111, 98, 0.85);
}

.header__disclaimer-link {
  color: var(--accent-deep);
  font-weight: 600;
  text-decoration: none;
}

.header__disclaimer-link:active {
  opacity: 0.75;
}

.header__subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.header__profile-entry {
  margin-top: 0.5rem;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-deep);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.card--profile[hidden] {
  display: none;
}

.card--profile {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--mint-soft) 55%, var(--surface)),
    var(--surface)
  );
}

.profile__hint {
  margin: -0.5rem 0 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.form--compact {
  gap: 0.85rem;
}

.form--compact .form__field input,
.form--compact .form__select {
  min-height: 46px;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}

.form__select {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 0.85rem 1rem;
  border: 1.5px solid rgba(44, 36, 25, 0.12);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  min-height: 50px;
  appearance: none;
  -webkit-appearance: none;
}

.form__select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 135, 106, 0.18);
}

.btn--compact-save {
  min-height: 46px;
  padding: 0.75rem;
  margin-top: 0.15rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.card--hero {
  background: linear-gradient(145deg, var(--surface) 0%, var(--accent-soft) 100%);
  text-align: center;
  padding: 1.75rem 1.25rem;
}

.card__label {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.card__title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}

.card__header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.card__title--inline {
  margin: 0;
  flex-shrink: 0;
}

.hero-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  text-align: left;
  padding-bottom: 0.25rem;
}

.hero-current__left {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.hero-current__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  flex-shrink: 0;
}

.hero-current__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--mint);
  letter-spacing: 0.04em;
}

.hero-current__time {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.hero-current__volume {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent-deep);
  line-height: 1.1;
}

.hero-current__range {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
}

.hero-divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(44, 36, 25, 0.12) 20%,
    rgba(44, 36, 25, 0.12) 80%,
    transparent
  );
  margin: 0.85rem 0 0.5rem;
}

.hero-date {
  margin: 0.35rem 0 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
}

.hero-time {
  font-family: var(--font-display);
  font-size: 3.25rem;
  font-weight: 700;
  line-height: 1.1;
  margin: 0.5rem 0 0.25rem;
  letter-spacing: -0.03em;
  color: var(--accent-deep);
}

.hero-volume {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.25rem;
}

.hero-volume span:first-child {
  font-size: 2.5rem;
  font-weight: 700;
  font-family: var(--font-display);
}

.hero-volume__unit {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
}

.hero-range {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.hero-meta {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.metrics__item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.65rem 0.4rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.metrics__value {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-deep);
}

.metrics__value--small {
  font-size: 0.75rem;
  font-weight: 600;
}

.metrics__label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline__item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.timeline__item:last-child {
  border-bottom: none;
}

.timeline__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.timeline__time {
  font-weight: 700;
  font-size: 1.1rem;
  min-width: 3.5rem;
}

.timeline__vol {
  flex: 1;
  color: var(--text-muted);
}

.timeline__empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.5rem 0;
}

.timeline__date {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 2.5rem;
}

.chart-wrap {
  position: relative;
  height: 248px;
  margin-top: 0.15rem;
  padding: 0.65rem 0.35rem 0.15rem;
  border-radius: 16px;
  background: linear-gradient(
    180deg,
    rgba(253, 232, 223, 0.45) 0%,
    rgba(255, 253, 249, 0) 72%
  );
}

.chart-wrap canvas {
  display: block;
}

.chart-wrap--weight {
  height: 210px;
  background: linear-gradient(
    180deg,
    rgba(232, 244, 239, 0.55) 0%,
    rgba(255, 253, 249, 0) 72%
  );
}

.weight__summary {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.weight__form {
  margin-top: 1rem;
}

.weight__form-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0.75rem;
}

.weight-log {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.weight-log__empty {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.35rem 0;
}

.weight-log__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: var(--surface-2);
}

.weight-log__item--birth {
  background: var(--mint-soft);
}

.weight-log__meta {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
}

.weight-log__date {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.weight-log__value {
  font-weight: 700;
  color: var(--text);
}

.weight-log__delete {
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.weight-log__delete:active {
  background: rgba(44, 36, 25, 0.06);
}

@media (max-width: 380px) {
  .weight__form-row {
    grid-template-columns: 1fr;
  }
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form__field[hidden] {
  display: none !important;
}

.form__field span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form__field input {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.85rem 1rem;
  border: 1.5px solid rgba(44, 36, 25, 0.12);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  min-height: 50px;
  box-shadow: inset 0 1px 2px rgba(44, 36, 25, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form__field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 135, 106, 0.18);
}

.form__field textarea,
.form__textarea {
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  padding: 0.85rem 1rem;
  border: 1.5px solid rgba(44, 36, 25, 0.12);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  min-height: 8rem;
  resize: vertical;
  box-shadow: inset 0 1px 2px rgba(44, 36, 25, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form__field textarea:focus,
.form__textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 135, 106, 0.18);
}

.form__picker {
  position: relative;
  display: flex;
  align-items: center;
}

.form__picker--grow {
  flex: 1;
  min-width: 0;
}

.form__picker-input {
  width: 100%;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.85rem 2.75rem 0.85rem 1rem;
  min-height: 50px;
  border: 1.5px solid rgba(44, 36, 25, 0.12);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  box-shadow: inset 0 1px 2px rgba(44, 36, 25, 0.04);
  appearance: none;
  -webkit-appearance: none;
  color-scheme: light;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form__picker-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 135, 106, 0.18);
}

.form__picker-input::-webkit-date-and-time-value {
  text-align: left;
}

.form__picker-input::-webkit-datetime-edit {
  padding: 0;
}

.form__picker-input::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}

.form__picker-input::-webkit-calendar-picker-indicator,
.form__picker-input::-webkit-clear-button {
  opacity: 0;
  position: absolute;
  right: 0;
  top: 0;
  width: 3rem;
  height: 100%;
  cursor: pointer;
}

.form__picker-icon {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-deep);
  opacity: 0.75;
  pointer-events: none;
}

.form__time-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.form__time-row .form__picker-input {
  font-size: 1.05rem;
}

.form__optional-row {
  margin: -0.25rem 0 0.5rem;
}

.btn--compact {
  min-height: auto;
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 10px;
  width: 100%;
}

.btn {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 14px;
  padding: 1rem;
  cursor: pointer;
  min-height: 52px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--accent);
  color: white;
}

.btn--primary:hover {
  background: var(--accent-deep);
}

.btn--ghost {
  flex-shrink: 0;
  padding: 0 1rem;
  min-width: 4.25rem;
  min-height: 50px;
  background: var(--surface);
  color: var(--text-muted);
  border: 1.5px solid rgba(44, 36, 25, 0.12);
  border-radius: 12px;
  font-size: 0.9rem;
}

.btn--ghost:not(:disabled):hover {
  color: var(--accent-deep);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.btn--ghost:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.feed-log {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.feed-log__date-filter {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  position: relative;
}

.feed-log__date-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  background: var(--surface);
  color: var(--accent-deep);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.feed-log__date-btn:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.feed-log__date-btn--active {
  border-color: var(--accent-deep);
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
}

.feed-log__date-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-deep);
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  cursor: pointer;
}

.feed-log__date-input--hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  right: 0;
  bottom: 0;
}

.feed-log__empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.feed-log__day-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.feed-log__day-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--accent-deep);
}

.feed-log__day-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.feed-log__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.feed-log__item {
  display: flex;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
}

.feed-log__item--last {
  padding-bottom: 0;
}

.feed-log__rail {
  position: relative;
  width: 12px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 0.35rem;
}

.feed-log__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--mint);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--mint);
  z-index: 1;
}

.feed-log__line {
  flex: 1;
  width: 2px;
  margin-top: 4px;
  background: linear-gradient(to bottom, var(--mint-soft), transparent);
  border-radius: 1px;
  min-height: 1.5rem;
}

.feed-log__body {
  position: relative;
  flex: 1;
  min-width: 0;
  padding-right: 1.5rem;
}

.feed-log__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.feed-log__menu-btn {
  position: absolute;
  top: -0.1rem;
  right: -0.15rem;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1;
  opacity: 0.35;
  cursor: pointer;
}

.feed-log__menu-btn:active {
  opacity: 0.7;
  background: var(--surface-2);
}

.feed-log__menu {
  position: absolute;
  top: 1.35rem;
  right: 0;
  z-index: 20;
  min-width: 5.5rem;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.feed-log__menu-item {
  display: block;
  width: 100%;
  padding: 0.45rem 0.65rem;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.feed-log__menu-item:active {
  background: var(--surface-2);
}

.feed-log__menu-item--danger {
  color: #c45c42;
}

.feed-log__time {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.feed-log__finish {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.feed-log__volume {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-deep);
}

.feed-log__volume small {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
}

.feed-log__bar {
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.25rem;
}

.feed-log__bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mint), #9ecfb8);
  transition: width 0.4s ease;
}

.feed-log__tag {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--mint-soft);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  margin-top: 0.15rem;
}

.record-modal[hidden] {
  display: none;
}

.record-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.record-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(44, 36, 25, 0.35);
}

.record-modal__sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  padding: 1rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 32px rgba(44, 36, 25, 0.12);
}

.record-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.record-modal__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
}

.record-modal__close {
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: var(--mint-soft);
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.toast {
  position: fixed;
  bottom: calc(1.5rem + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--text);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 100;
  pointer-events: none;
  white-space: nowrap;
}

.toast--show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.fab-nav__backdrop {
  position: fixed;
  inset: 0;
  z-index: 87;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(44, 36, 25, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.fab-nav__backdrop--visible {
  opacity: 1;
  pointer-events: auto;
}

.fab-nav-wrap {
  position: fixed;
  right: calc(1rem + env(safe-area-inset-right));
  bottom: calc(8.85rem + env(safe-area-inset-bottom));
  z-index: 88;
}

.fab-nav__menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.65rem);
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px) scale(0.94);
  transform-origin: bottom right;
  transition:
    opacity 0.26s ease,
    transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.fab-nav-wrap--open .fab-nav__menu {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.fab-nav__panel {
  min-width: 11.25rem;
  padding: 0.55rem;
  border: 1px solid rgba(232, 135, 106, 0.18);
  border-radius: 1rem;
  background: rgba(255, 253, 249, 0.97);
  box-shadow:
    0 12px 40px rgba(44, 36, 25, 0.14),
    0 2px 8px rgba(44, 36, 25, 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.fab-nav__panel-title {
  margin: 0 0 0.35rem;
  padding: 0.15rem 0.55rem 0.5rem;
  border-bottom: 1px solid rgba(44, 36, 25, 0.07);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.fab-nav__item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.5rem 0.55rem;
  border: none;
  border-radius: 0.65rem;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.15s ease,
    transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  -webkit-appearance: none;
}

.fab-nav__item-icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  background: rgba(253, 232, 223, 0.85);
  color: var(--accent-deep);
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.fab-nav__item-label {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.fab-nav__item-title {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
}

.fab-nav__item-hint {
  color: var(--text-muted);
  font-size: 0.67rem;
  font-weight: 500;
  line-height: 1.25;
}

.fab-nav__item--active {
  background: linear-gradient(135deg, rgba(253, 232, 223, 0.75) 0%, rgba(255, 248, 238, 0.9) 100%);
}

.fab-nav__item--active .fab-nav__item-icon {
  background: var(--accent-deep);
  color: #fff;
}

.fab-nav__item--active .fab-nav__item-title {
  color: var(--accent-deep);
}

.fab-nav__item:active {
  transform: scale(0.98);
}

.fab-nav__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  padding: 0;
  border: 1px solid rgba(232, 135, 106, 0.28);
  border-radius: 50%;
  background: linear-gradient(145deg, #fffdf9 0%, #fde8df 100%);
  color: var(--accent-deep);
  box-shadow: 0 4px 16px rgba(196, 92, 66, 0.2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  -webkit-appearance: none;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.fab-nav-wrap--open .fab-nav__toggle {
  background: var(--accent-deep);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 18px rgba(196, 92, 66, 0.35);
}

.fab-nav__toggle:active {
  transform: scale(0.94);
}

.fab-nav__icon {
  display: block;
}

.fab-nav__icon--close {
  display: none;
}

.fab-nav-wrap--open .fab-nav__icon--menu {
  display: none;
}

.fab-nav-wrap--open .fab-nav__icon--close {
  display: block;
}

#nextCard,
#todayPanel,
#curvePanel,
#recordPanel,
#historyPanel,
#weightPanel {
  scroll-margin-top: 0.75rem;
}

.fab-actions {
  position: fixed;
  right: calc(1rem + env(safe-area-inset-right));
  bottom: calc(1.25rem + env(safe-area-inset-bottom));
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

.fab-feedback,
.fab-refresh {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  -webkit-appearance: none;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
  text-decoration: none;
}

.fab-feedback {
  border: 1px solid rgba(126, 184, 164, 0.35);
  background: linear-gradient(145deg, #fffdf9 0%, var(--mint-soft) 100%);
  color: var(--mint-deep);
  box-shadow: 0 4px 14px rgba(90, 154, 134, 0.18);
}

.fab-feedback:active {
  transform: scale(0.94);
}

.fab-refresh {
  border: none;
  background: var(--accent-deep);
  color: #fff;
  box-shadow: 0 4px 16px rgba(196, 92, 66, 0.35);
}

.fab-refresh:focus {
  outline: none;
  background: var(--accent-deep);
}

.fab-refresh:focus-visible {
  box-shadow:
    0 4px 16px rgba(196, 92, 66, 0.35),
    0 0 0 3px rgba(255, 255, 255, 0.5);
}

.fab-refresh:active {
  transform: scale(0.94);
  background: #b35a42;
}

.fab-refresh:disabled {
  opacity: 0.65;
  cursor: wait;
  pointer-events: none;
}

.fab-refresh:disabled:active {
  transform: none;
}

.fab-refresh--spin svg {
  animation: fab-spin 0.7s linear infinite;
}

@keyframes fab-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 380px) {
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-time {
    font-size: 2.75rem;
  }
}

.login-page .app {
  padding-top: 2rem;
}

.login {
  position: relative;
  z-index: 1;
  max-width: 420px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
  padding-bottom: calc(3rem + env(safe-area-inset-bottom));
}

.login__header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.login__heading {
  min-width: 0;
}

.login__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
}

.login__subtitle {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.login__card {
  padding: 1.25rem;
}

.login__tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin-bottom: 1rem;
  padding: 0.25rem;
  border-radius: 12px;
  background: var(--surface-2);
}

.login__tab {
  border: none;
  border-radius: 9px;
  padding: 0.55rem 0.75rem;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, color 0.15s ease;
}

.login__tab--active {
  background: var(--surface);
  color: var(--accent-deep);
  box-shadow: 0 2px 8px rgba(44, 36, 25, 0.06);
}

.login__form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login__oauth {
  margin-top: 0.15rem;
}

.login__divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.1rem 0 1rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.login__divider::before,
.login__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login__divider span {
  flex-shrink: 0;
}

.login__error {
  margin: 0;
  color: #c0392b;
  font-size: 0.85rem;
}

.login__wechat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
  padding: 0.5rem 0 0.25rem;
}

.login__wechat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: #e8f8ef;
  color: #07c160;
}

.login__wechat-text {
  margin: 0;
  font-weight: 600;
  font-size: 1rem;
}

.login__hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.btn--wechat {
  width: 100%;
  min-height: 52px;
  border: none;
  border-radius: 14px;
  background: #07c160;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn--wechat:active {
  transform: scale(0.98);
}

.btn--wechat:disabled {
  opacity: 0.65;
  cursor: wait;
}

.feedback {
  position: relative;
  z-index: 1;
  max-width: 420px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  padding-bottom: calc(3rem + env(safe-area-inset-bottom));
}

.feedback__header {
  margin-bottom: 1.25rem;
}

.feedback__back {
  display: inline-block;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
}

.feedback__back:active {
  color: var(--accent-deep);
}

.feedback__title {
  margin: 0.15rem 0 0;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
}

.feedback__subtitle {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.feedback__card {
  padding: 1.25rem;
}

.feedback__error {
  margin: 0;
  color: #c0392b;
  font-size: 0.85rem;
  line-height: 1.45;
}

.feedback__success {
  margin: 0;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: var(--mint-soft);
  color: var(--mint-deep);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
}

.admin {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
  padding-bottom: calc(3rem + env(safe-area-inset-bottom));
}

.admin__header {
  margin-bottom: 1rem;
}

.admin__header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.admin__back {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
}

.admin__back:active {
  color: var(--accent-deep);
}

.admin__refresh {
  padding: 0.35rem 0.75rem;
  border: 1px solid rgba(44, 36, 25, 0.1);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.admin__refresh:disabled {
  opacity: 0.65;
  cursor: wait;
}

.admin__title {
  margin: 0.15rem 0 0;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
}

.admin__subtitle {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.admin__error {
  margin: 0 0 1rem;
  color: #c0392b;
  font-size: 0.85rem;
  line-height: 1.45;
}

.admin__list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.admin__loading,
.admin__empty {
  padding: 1.25rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  text-align: center;
}

.admin__empty p {
  margin: 0;
}

.admin__item {
  padding: 1rem 1.1rem;
}

.admin__item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.admin__item-user {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
}

.admin__item-time {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.35;
  white-space: nowrap;
}

.admin__item-content {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin__item-contact {
  margin: 0.65rem 0 0;
  color: var(--mint-deep);
  font-size: 0.85rem;
  line-height: 1.45;
}

.admin__item-meta {
  margin: 0.65rem 0 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.4;
  word-break: break-all;
}
