:root {
  color-scheme: light;
  --bg-top: #f4efe7;
  --bg-bottom: #d8e6df;
  --panel: rgba(255, 255, 255, 0.84);
  --panel-border: rgba(31, 111, 95, 0.16);
  --text: #17352d;
  --muted: #5a746d;
  --accent: #1f6f5f;
  --accent-strong: #175548;
  --accent-soft: #d9efe9;
  --danger: #8f2d2d;
  --shadow: 0 22px 70px rgba(39, 72, 62, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 35%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero {
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 4.2rem);
  line-height: 1;
}

.hero-copy {
  max-width: 62ch;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 20px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  padding: 24px;
}

.panel-header h2,
.entries-header h3,
form h3 {
  margin: 0;
}

.panel-header p,
.entries-header p,
.muted,
.status-message,
.empty-state {
  color: var(--muted);
}

.panel-header p,
.entries-header p,
.status-message {
  margin: 6px 0 0;
}

.stack {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
}

label span {
  font-size: 0.95rem;
  font-weight: 600;
}

input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(23, 53, 45, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.94);
}

.input-with-action {
  position: relative;
}

.input-with-action input {
  padding-right: 48px;
}

.password-toggle-button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
}

.password-toggle-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-toggle-button .icon-eye-off {
  display: none;
}

.password-toggle-button[data-visible="true"] .icon-eye {
  display: none;
}

.password-toggle-button[data-visible="true"] .icon-eye-off {
  display: block;
}

input:focus {
  outline: 2px solid rgba(31, 111, 95, 0.26);
  border-color: var(--accent);
}

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  cursor: pointer;
}

button:hover {
  filter: brightness(1.04);
}

button:disabled {
  opacity: 0.7;
  cursor: wait;
  filter: none;
}

.secondary-button {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.hidden {
  display: none;
}

.auth-panel {
  display: grid;
  gap: 18px;
}

.user-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(217, 239, 233, 0.8);
}

.summary-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.summary-card,
.entries-card,
.chart-card {
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(23, 53, 45, 0.08);
}

.summary-card {
  padding: 14px 16px;
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}

.summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.55rem;
}

.chart-card {
  position: relative;
  padding: 12px;
  min-height: 320px;
}

#weight-chart {
  width: 100%;
  height: 320px;
  display: block;
}

.empty-state {
  position: absolute;
  inset: auto 24px 24px;
  margin: 0;
}

.entries-card {
  margin-top: 18px;
  padding: 18px;
}

.entries-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  gap: 10px;
}

.entry-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(244, 239, 231, 0.68);
}

.entry-row strong {
  font-size: 1rem;
}

.entry-row span {
  color: var(--muted);
}

.danger-button {
  padding: 8px 12px;
  background: #fce8e8;
  color: var(--danger);
}

.status-message[data-tone="error"] {
  color: var(--danger);
}

@media (max-width: 880px) {
  .app-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100vw - 18px, 1120px);
    padding-top: 18px;
  }

  .panel {
    padding: 18px;
    border-radius: 22px;
  }

  .summary-row {
    grid-template-columns: 1fr;
  }

  .entry-row {
    grid-template-columns: 1fr auto;
  }

  .entry-row button {
    grid-column: 1 / -1;
  }
}
