*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #080c12;
  --surface: #0f1520;
  --surface2: #161d2e;
  --border: rgba(255,255,255,0.07);
  --border-bright: rgba(255,255,255,0.14);
  --text: #f0f4ff;
  --text-muted: #6b7a99;
  --text-dim: #3a4560;
  --accent: #4f8ef7;
  --accent-glow: rgba(79,142,247,0.15);
  --under: #60a5fa;
  --healthy: #34d399;
  --over: #fbbf24;
  --obese: #f87171;
  --radius: 16px;
  --radius-sm: 10px;
  --font-scale: 1.25;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: calc(16px * var(--font-scale));
  overflow: hidden;
}

.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

.grid-overlay {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background-image:
    linear-gradient(rgba(79,142,247,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79,142,247,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

.shape { position: absolute; animation: floatShape ease-in-out infinite; }

@keyframes floatShape {
  0%   { transform: translate(0,0) rotate(0deg) scale(1); }
  25%  { transform: translate(15px,-25px) rotate(45deg) scale(1.05); }
  50%  { transform: translate(-10px,-40px) rotate(90deg) scale(0.95); }
  75%  { transform: translate(-20px,-15px) rotate(135deg) scale(1.02); }
  100% { transform: translate(0,0) rotate(180deg) scale(1); }
}

.orb {
  position: absolute; border-radius: 50%;
  filter: blur(55px); animation: driftOrb ease-in-out infinite;
}

@keyframes driftOrb {
  0%,100% { transform: translate(0,0); }
  33%     { transform: translate(25px,-35px); }
  66%     { transform: translate(-20px,20px); }
}

.contact-btn {
  position: fixed; top: 18px; right: 18px; z-index: 200;
  display: flex; align-items: center; gap: 7px;
  padding: 7px 14px 7px 10px;
  background: rgba(15,21,32,0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(74,222,128,0.3);
  border-radius: 20px;
  text-decoration: none; color: #4ade80;
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  transition: all 0.2s;
}

.contact-btn:hover {
  background: rgba(74,222,128,0.1);
  border-color: #4ade80;
  box-shadow: 0 0 16px rgba(74,222,128,0.2);
}

.contact-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4ade80; box-shadow: 0 0 6px #4ade80;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,100% { box-shadow: 0 0 6px #4ade80; }
  50%     { box-shadow: 0 0 14px #4ade80, 0 0 24px rgba(74,222,128,0.4); }
}

.access-wrap {
  position: fixed; bottom: 20px; right: 20px; z-index: 200;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
}

.access-panel {
  background: rgba(10,14,22,0.92);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-bright);
  border-radius: 14px; padding: 12px 14px;
  display: none; flex-direction: column; gap: 10px; min-width: 150px;
}

.access-panel.open { display: flex; animation: fadeUp 0.2s ease; }

@keyframes fadeUp {
  from { opacity:0; transform:translateY(8px); }
  to   { opacity:1; transform:translateY(0); }
}

.access-title {
  font-size: 10px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-dim);
}

.access-options { display: flex; gap: 6px; }

.size-btn {
  flex: 1; padding: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px; color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  cursor: pointer; transition: all 0.2s;
}

.size-btn:nth-child(2) { font-size: 15px; }
.size-btn:nth-child(3) { font-size: 18px; }

.size-btn.active {
  border-color: var(--accent); color: var(--accent);
  background: var(--accent-glow);
}

.access-toggle {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(15,21,32,0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-bright);
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}

.access-toggle:hover { border-color: var(--accent); color: var(--accent); }

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  width: auto;
  z-index: 100;
  display: flex;
}

.sidebar-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  gap: 8px;

  padding: 18px 14px; /* bigger tap area */

  min-width: 52px;    /* IMPORTANT: makes it easier to hit */
  min-height: 120px;  /* gives it presence */

  background: rgba(15,21,32,0.75);
  backdrop-filter: blur(12px);

  border: 1px solid var(--border-bright);
  border-left: none;
  border-radius: 0 14px 14px 0;

  color: var(--text-muted);
  cursor: pointer;

  transition: all 0.2s ease;
}

.sidebar-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(79,142,247,0.08);
  transform: translateX(2px);
}
.toggle-icon { font-size: 18px; }
.toggle-label {
  font-size: calc(10px * var(--font-scale));
  letter-spacing: 0.08em;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.sidebar-panel {
  width: 0;
  height: 100vh;

  overflow: hidden;

  opacity: 0;
  transform: translateX(-10px);
  pointer-events: none;

  background: rgba(8,12,18,0.95);
  border-right: 1px solid var(--border-bright);

  backdrop-filter: blur(20px);

  display: flex;
  flex-direction: column;

  transition: width 0.35s ease, opacity 0.2s ease, transform 0.2s ease;
}

.sidebar-panel.open {
  width: 320px;
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.sidebar-header {
  padding: 16px 16px 12px; border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 3px;
}

.sidebar-title { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; }
.sidebar-note {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.50);
  letter-spacing: 0.03em;
  font-style: normal;
}

.history-list {
  flex: 1;
  overflow-y: auto;

  padding: 10px 8px;

  scrollbar-width: thin;
  scrollbar-color: var(--surface2) transparent;
}

.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-track { background: transparent; }
.history-list::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 4px; }

.history-empty {
  font-size: 12px; color: var(--text-dim);
  text-align: center; padding: 24px 0; white-space: nowrap;
}

.history-item {
  border-radius: 12px; padding: 11px 13px;
  display: flex; flex-direction: column; gap: 3px;
  white-space: nowrap; animation: slideIn 0.25s ease;
  border: 1px solid transparent; transition: border-color 0.2s;
}

@keyframes slideIn {
  from { opacity:0; transform:translateX(-10px); }
  to   { opacity:1; transform:translateX(0); }
}

.history-bmi  { font-family: 'DM Mono', monospace; font-size: 20px; font-weight: 500; }
.history-status { font-size: 11px; font-weight: 600; letter-spacing: 0.02em; }
.history-details { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.history-time { font-size: 10px; opacity: 0.5; }

.ui {
  position: relative; z-index: 10; width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center;
}

.header {
  width: 100%;
  max-width: 440px;

  padding: 0 20px 0;  /* remove top push */
  display: flex;
  justify-content: flex-end;
}

.reset-btn {
  display: flex;
  align-items: center;
  gap: 5px;

  background: var(--surface2);
  border: 1px solid var(--border-bright);
  color: var(--text-muted);

  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  .reset-btn {
  margin-bottom: 4px;
}

  cursor: pointer;

  /* IMPORTANT for smooth spin */
  transition: transform 0.4s ease, color 0.2s ease, border-color 0.2s ease;
  transform-origin: center;
}
.reset-btn.spin {
  transform: rotate(360deg) scale(1.05);
}
.reset-icon {
  display: inline-block;
  transition: transform 0.6s ease;
}

.reset-icon.spin {
  animation: spin 0.6s ease;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.main {
  width: 100%;
  max-width: 440px;
  padding: 20px;

  display: flex;
  flex-direction: column;

  gap: 6px;
}

.bmi-panel {
  margin-bottom: 2px;
}

.card {
  margin-top: 2px;
}

.bmi-panel {
  background: rgba(15,21,32,0.75); /* same vibe as inputs */
  backdrop-filter: blur(14px);

  border: 1px solid var(--border);
  border-radius: var(--radius);

  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;

  position: relative;
  overflow: hidden;
}

.bmi-panel {
  background: rgba(15,21,32,0.55); /* SAME transparency feel as inputs */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  border: 1px solid var(--border);
  border-radius: var(--radius);

  padding: 20px;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;

  position: relative;
  overflow: hidden;
}

.bmi-panel::before {
  content: ''; position: absolute; top: -40px; left: 50%;
  transform: translateX(-50%); width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(79,142,247,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.bmi-ring { position: relative; width: 120px; height: 120px; }
.ring-svg { width: 100%; height: 100%; }
.ring-bg  { fill: none; stroke: var(--surface2); stroke-width: 8; }
.ring-fill {
  fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round;
  transition: stroke-dashoffset 0.5s cubic-bezier(0.4,0,0.2,1), stroke 0.4s;
}

.bmi-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}

#bmiNumber {
  font-family: 'DM Mono', monospace;
  font-size: calc(26px * var(--font-scale));
  font-weight: 500; color: var(--text); line-height: 1;
}

.bmi-label { font-size: 11px; color: var(--text-muted); letter-spacing: 0.1em; margin-top: 2px; }

#bmiStatus {
  font-size: calc(14px * var(--font-scale));
  color: var(--text-muted); min-height: 20px; font-weight: 500;
}

.unit-ref {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap; justify-content: center;
}

.unit-ref span {
  font-size: calc(10px * var(--font-scale));
  color: rgba(255, 255, 255, 0.60);
  letter-spacing: 0.02em;
}
.ref-dot {
  opacity: 0.4;
  color: rgba(79,142,247,0.7);
}

.card {
  background: rgba(15, 21, 32, 0.65);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-section { padding: 14px 16px; }

.section-label {
  font-size: calc(11px * var(--font-scale));
  font-weight: 600;
  letter-spacing: 0.10em;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.input-row {
  display: grid; grid-template-columns: 1fr 36px 1fr;
  gap: 8px; align-items: center;
}

.input-group {
  background: rgba(22, 29, 46, 0.6);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  padding: 10px 14px;
  gap: 6px;
  transition: border-color 0.2s, background 0.2s;
}
.input-group:focus-within {
  border-color: rgba(79,142,247,0.5);
  background: rgba(79,142,247,0.06);
}

.input-group input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-family: 'DM Mono', monospace;
  font-size: calc(16px * var(--font-scale)); width: 100%; min-width: 0;
}

.input-group input::placeholder { color: var(--text-dim); }
.input-group input::-webkit-inner-spin-button,
.input-group input::-webkit-outer-spin-button { -webkit-appearance: none; }

.unit { font-size: calc(12px * var(--font-scale)); font-weight: 500; color: var(--text-muted); flex-shrink: 0; }

.swap-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; background: var(--surface2);
  border: 1px solid var(--border-bright); border-radius: 50%;
  color: var(--accent); font-size: 16px;
  cursor: pointer; transition: all 0.25s; user-select: none;
}

.swap-btn:hover { background: var(--accent-glow); border-color: var(--accent); transform: rotate(180deg); }

.divider { height: 1px; background: var(--border); margin: 0 16px; }

.calc-btn {
  width: calc(100% - 12px); margin: 6px; padding: 14px;
  background: var(--accent); border: none; border-radius: var(--radius-sm);
  color: white; font-family: 'DM Sans', sans-serif;
  font-size: calc(14px * var(--font-scale)); font-weight: 600;
  letter-spacing: 0.03em; cursor: pointer; transition: all 0.2s;
}

.calc-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(79,142,247,0.35); }
.calc-btn:active { transform: translateY(0); }
.contact-btn {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  justify-content: center;
}
.contact-btn::after {
  content: "Contact";
  position: absolute;
  right: 36px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15,21,32,0.95);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11px;
  color: #4ade80;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  white-space: nowrap;
}

.contact-btn:hover::after {
  opacity: 1;
}
.history-item {
  border-radius: 12px;
  padding: 12px 14px;

  display: flex;
  flex-direction: column;

  gap: 6px; /* 🔥 main fix — gives breathing room */

  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);

  animation: slideIn 0.25s ease;
  transition: all 0.2s ease;
}
.history-item:hover {
  transform: translateX(4px);
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
}

.history-bmi {
  font-family: 'DM Mono', monospace;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.1;
}

.history-status {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.9;
  margin-top: -2px;
}

.history-details {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.85;
  letter-spacing: 0.02em;
}

.history-time {
  font-size: 9px;
  opacity: 0.5;
  letter-spacing: 0.06em;
  margin-top: 2px;
  margin-bottom: 2px;
}
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px; /
}
.sidebar-title {
  font-size: calc(13px * var(--font-scale));
  font-weight: 600;
}

.sidebar-note {
  font-size: calc(10px * var(--font-scale));
}
.history-bmi {
  font-family: 'DM Mono', monospace;
  font-size: calc(18px * var(--font-scale));
  font-weight: 600;
}

.history-status {
  font-size: calc(11px * var(--font-scale));
}

.history-details {
  font-size: calc(10px * var(--font-scale));
}

.history-time {
  font-size: calc(9px * var(--font-scale));
}
.ui {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100%;

  display: flex;
  flex-direction: column;
  align-items: center;

  padding-top: 40px; /* 👈 THIS moves all 3 boxes down together */
}