:root {
  --bg: #111111;
  --panel: #242424;
  --panel-soft: #2b2b2b;
  --panel-border: rgba(255, 255, 255, 0.06);
  --text: #f6f6f6;
  --muted: #888888;
  --blue: #7cc8ff;
  --green: #5de08d;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top, rgba(88, 88, 88, 0.14), transparent 28%),
    #0d0d0d;
  color: var(--text);
  font-family: "SF Pro Display", "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.phone-shell {
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  position: relative;
}

.app-frame {
  position: relative;
  width: 390px;
  min-height: 844px;
  padding: 20px 16px 32px;
  overflow: hidden;
  border-radius: 38px;
  background: linear-gradient(180deg, #111111 0%, #121212 100%);
  box-shadow: var(--shadow);
}

.screen-header,
.profile-header,
.card-topline,
.metric-head,
.section-heading,
.water-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.home-topbar {
  display: flex;
  justify-content: flex-start;
}

.screen {
  display: none;
  padding-top: 10px;
  transition: transform 180ms ease, opacity 180ms ease;
  will-change: transform, opacity;
}

.screen.is-active {
  display: block;
}

.profile-header {
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  margin: 20px 0 24px;
}

.profile-header h1,
.screen-header h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.avatar {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, #788cff, #7fd8ff);
  background-size: cover;
  background-position: center;
}

.avatar-button {
  border: 0;
  cursor: pointer;
}

.gear-button {
  background: linear-gradient(180deg, #272727, #202020);
}

.gear-icon {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(124, 200, 255, 0.92);
}

.gear-icon::before,
.gear-icon::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background:
    conic-gradient(
      from 0deg,
      rgba(124, 200, 255, 0.92) 0deg 18deg,
      transparent 18deg 60deg,
      rgba(124, 200, 255, 0.92) 60deg 78deg,
      transparent 78deg 120deg,
      rgba(124, 200, 255, 0.92) 120deg 138deg,
      transparent 138deg 180deg,
      rgba(124, 200, 255, 0.92) 180deg 198deg,
      transparent 198deg 240deg,
      rgba(124, 200, 255, 0.92) 240deg 258deg,
      transparent 258deg 300deg,
      rgba(124, 200, 255, 0.92) 300deg 318deg,
      transparent 318deg 360deg
    );
  -webkit-mask: radial-gradient(circle, transparent 0 11px, black 11px);
}

.gear-icon::after {
  inset: 4px;
  background: #202020;
  -webkit-mask: none;
}

.card {
  width: 100%;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--panel-soft), var(--panel));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.water-card {
  display: block;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.card-topline strong,
.metric-head h2,
.section-heading h2,
.list-link span {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.card-topline span,
.metric-head span,
.metric-note,
.section-heading span,
.chart-x-axis,
.chart-y-axis {
  color: var(--muted);
}

.progress-bar {
  width: 100%;
  height: 14px;
  margin-top: 12px;
  border-radius: 999px;
  background: #31363a;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #58c2ff, #8ad8ff);
}

.water-footer {
  margin-top: 12px;
}

.drops {
  display: flex;
  gap: 8px;
}

.drops span {
  width: 8px;
  height: 8px;
  opacity: 0.5;
  border: 1px solid #60c8ff;
  border-radius: 60% 60% 70% 70%;
}

.drops span.is-filled {
  opacity: 1;
  background: rgba(96, 200, 255, 0.28);
}

.metric-card {
  padding-bottom: 14px;
}

.metric-value {
  margin: 8px 0 6px;
  color: var(--blue);
  font-size: 3rem;
  line-height: 1;
  font-weight: 800;
}

.metric-note {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.35;
}

.reminder-card {
  cursor: pointer;
}

.notification-card {
  display: block;
  border: 1px solid rgba(124, 200, 255, 0.12);
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.notification-card .metric-head span {
  color: var(--blue);
  font-weight: 700;
}

.weight-widget-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 14px 0 10px;
}

.weight-editor {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: text;
}

.weight-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.weight-current,
.weight-previous {
  display: block;
  font-size: 2rem;
  line-height: 1;
  font-weight: 800;
}

.weight-current {
  color: var(--blue);
}

.weight-previous {
  color: rgba(255, 255, 255, 0.34);
}

.weight-input {
  display: none;
  width: 100%;
  margin-top: 6px;
  border: 0;
  border-radius: 12px;
  background: rgba(124, 200, 255, 0.1);
  color: var(--blue);
  padding: 10px 12px;
  font-size: 1rem;
  font-weight: 700;
}

.weight-editor.is-editing .weight-current {
  display: none;
}

.weight-editor.is-editing .weight-input {
  display: block;
}

.health-tag {
  color: var(--green);
  font-weight: 600;
}

.screen-header {
  gap: 12px;
  margin-bottom: 22px;
}

.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--panel-border);
  border-radius: 50%;
  background: linear-gradient(180deg, #2d2d2d, #232323);
  color: #fafafa;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.add-button {
  color: var(--blue);
  font-weight: 700;
}

.spacer {
  width: 40px;
}

.measurement-chip {
  width: 96px;
  padding: 12px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  text-align: center;
}

.measurement-chip span,
.measurement-chip small {
  display: block;
  color: var(--muted);
}

.measurement-chip strong {
  display: block;
  margin: 6px 0 2px;
  color: var(--green);
  font-size: 2rem;
  line-height: 1;
}

.stacked {
  display: block;
}

.stacked .pill-blue {
  display: inline-block;
  margin-top: 10px;
}

.pill-blue {
  padding: 8px 14px;
  border-radius: 999px;
  color: white;
  background: linear-gradient(180deg, #7bc9ff, #6cbcff);
  font-size: 0.82rem;
  font-weight: 700;
}

.chart-wrap {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.chart-y-axis {
  width: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 0.75rem;
}

.chart-area {
  position: relative;
  flex: 1;
  height: 220px;
}

.grid-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.grid-line:nth-child(1) {
  top: 12px;
}

.grid-line:nth-child(2) {
  top: 64px;
}

.grid-line:nth-child(3) {
  top: 116px;
}

.grid-line:nth-child(4) {
  top: 168px;
}

.trend-svg {
  width: 100%;
  height: 180px;
  margin-top: 8px;
}

.chart-x-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.75rem;
}

.list-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: var(--blue);
}

.history-list {
  display: grid;
  gap: 14px;
}

.supplement-checklist,
.supplement-list {
  display: grid;
  gap: 12px;
}

.profile-card h2 {
  margin: 0;
  font-size: 1rem;
}

.profile-editor-top {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-avatar-large {
  width: 76px;
  height: 76px;
  flex: 0 0 auto;
}

.profile-form {
  margin-top: 22px;
}

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

.profile-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.text-action {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--blue);
  font-size: 0.88rem;
  font-weight: 700;
}

.danger-action {
  color: #ff615b;
}



.supplement-checklist {
  margin-top: 14px;
}

.supplement-home-item,
.supplement-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.supplement-home-item {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.supplement-home-copy strong,
.supplement-item-copy strong {
  display: block;
  font-size: 0.95rem;
}

.supplement-home-copy span,
.supplement-item-copy span,
.supplement-item-copy p {
  color: var(--muted);
  font-size: 0.82rem;
}

.supplement-item-copy p {
  margin: 8px 0 0;
  line-height: 1.4;
}

.supplement-days {
  display: block;
  margin-top: 6px;
}

.supplement-check {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: transparent;
  cursor: pointer;
}

.supplement-check.is-taken {
  background: rgba(93, 224, 141, 0.2);
  color: var(--green);
}

.supplement-check.is-taken::before {
  content: "✓";
  font-weight: 800;
}

.supplement-form {
  margin-top: 18px;
}

.supplement-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 92px);
  gap: 12px;
  align-items: end;
}

.supplement-form-grid .form-field {
  min-width: 0;
}

.supplement-form-grid .form-field:last-child {
  width: 92px;
  justify-self: end;
}

.repeat-days {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 6px;
}

.repeat-days {
  margin-top: 4px;
}

.repeat-day {
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-weight: 700;
}

.repeat-day {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  font-size: 0.78rem;
}

.repeat-day.is-active {
  background: rgba(124, 200, 255, 0.18);
  color: var(--blue);
}

.form-field {
  display: block;
  margin-bottom: 14px;
}

.form-field span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.form-field input,
.form-field textarea {
  width: 100%;
  border: 0;
  border-radius: 14px;
  background: #212121;
  color: var(--text);
  padding: 14px 16px;
  resize: vertical;
}

#supplementTime {
  min-width: 0;
  width: 100%;
  max-width: 92px;
  -webkit-appearance: none;
  appearance: none;
  text-align: center;
  letter-spacing: 0.02em;
  padding-left: 8px;
  padding-right: 8px;
  font-size: 0.95rem;
}

.primary-action {
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #42cbff, #26b7ff);
  color: white;
  font-weight: 800;
}

.supplement-item {
  align-items: flex-start;
}

.supplement-item-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
}

.supplement-delete {
  position: absolute;
  top: 50%;
  right: 18px;
  width: 56px;
  height: 56px;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: #ff453a;
  color: white;
  cursor: pointer;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  box-shadow: 0 12px 24px rgba(255, 69, 58, 0.22);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.supplement-delete:hover {
  transform: translateY(-50%) scale(1.03);
  box-shadow: 0 16px 28px rgba(255, 69, 58, 0.28);
}

.supplement-item.swipeable {
  position: relative;
  z-index: 1;
  touch-action: pan-y;
  transition: transform 180ms ease;
}

.supplement-item.swipeable.is-revealed {
  transform: translateX(-84px);
}

.supplement-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(124, 200, 255, 0.14);
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 700;
}

.history-item-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
}

.history-delete {
  position: absolute;
  top: 50%;
  right: 18px;
  width: 56px;
  height: 56px;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: #ff453a;
  color: white;
  font-weight: 800;
  cursor: pointer;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  box-shadow: 0 12px 24px rgba(255, 69, 58, 0.22);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.history-delete:hover {
  transform: translateY(-50%) scale(1.03);
  box-shadow: 0 16px 28px rgba(255, 69, 58, 0.28);
}

.trash-icon {
  position: relative;
  width: 20px;
  height: 20px;
}

.trash-icon::before,
.trash-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.trash-icon::before {
  top: 6px;
  width: 12px;
  height: 10px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-top: 0;
  border-radius: 0 0 4px 4px;
}

.trash-icon::after {
  top: 3px;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 -3px 0 -1px rgba(255, 255, 255, 0.92);
}

.history-item {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
  touch-action: pan-y;
  transition: transform 180ms ease;
}

.history-item > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.history-date {
  font-weight: 700;
}

.history-value {
  color: var(--green);
  font-weight: 800;
}

.history-check {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.18);
  font-size: 0.9rem;
}

.history-item.is-revealed {
  transform: translateX(-84px);
}

.water-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
}

.water-modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.done-button {
  min-width: 72px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: #1c1c1e;
  color: var(--blue);
  font-weight: 700;
}

.water-ring-wrap {
  margin-top: 28px;
  display: grid;
  justify-items: center;
}

.water-ring {
  width: 224px;
  height: 224px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #111111 58%, transparent 59%),
    conic-gradient(#5ccfff var(--water-progress, 0%), #133748 0);
}

.water-ring-inner {
  width: 156px;
  height: 156px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #111111;
  text-align: center;
}

.water-ring-inner strong {
  display: block;
  font-size: 3.3rem;
  line-height: 1;
}

.water-ring-inner span {
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 600;
}

.water-goal-text {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
}

.water-section {
  margin-top: 34px;
}

.water-section h3 {
  margin: 0 0 14px;
  font-size: 1rem;
}

.quick-add-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-add-button {
  padding: 10px 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(92, 207, 255, 0.14);
  color: var(--blue);
  font-weight: 700;
}

.custom-water-row {
  display: flex;
  gap: 10px;
}

.custom-water-row input {
  flex: 1;
  min-width: 0;
  height: 52px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  background: #212121;
  color: var(--text);
}

.add-water-button {
  min-width: 118px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #42cbff, #26b7ff);
  color: white;
  font-weight: 800;
}

.reset-water-button {
  display: block;
  margin: 240px auto 0;
  border: 0;
  background: transparent;
  color: #ff615b;
  font-weight: 700;
}

@media (max-width: 430px) {
  .phone-shell {
    padding: 0;
    background: #111111;
  }

  .app-frame {
    width: 390px;
    max-width: 100vw;
    min-height: 844px;
    height: 100dvh;
    border-radius: 0;
    padding-top: max(20px, env(safe-area-inset-top));
    padding-right: 16px;
    padding-bottom: max(32px, env(safe-area-inset-bottom));
    padding-left: 16px;
  }

  .supplement-form-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 88px);
    gap: 10px;
  }

  .supplement-form-grid .form-field:last-child {
    width: 88px;
  }

  #supplementTime {
    max-width: 88px;
    font-size: 0.9rem;
  }

}
