/* ============================================
   BLOOD ALCOHOL LEVEL CALCULATOR - STYLESHEET
   Health/Safety - Amber Warning Theme
   Premium Professional Design
   ============================================ */

:root {
  --primary: #f59e0b;
  --primary-dark: #d97706;
  --primary-light: #fbbf24;
  --primary-bg: #fffbeb;
  --secondary: #b45309;
  --accent: #ef4444;
  --success: #10b981;
  --success-bg: #d1fae5;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --error: #ef4444;
  --error-bg: #fee2e2;
  --safe: #10b981;
  --caution: #f59e0b;
  --danger: #ef4444;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-sans); font-size: 16px; line-height: 1.6; color: var(--gray-800); background: var(--gray-50); min-height: 100vh; display: flex; flex-direction: column; }
h1, h2, h3 { font-weight: 600; line-height: 1.3; color: var(--gray-900); }
h1 { font-size: 2.25rem; margin-bottom: 1rem; }
h2 { font-size: 1.5rem; margin-top: 2rem; margin-bottom: 1rem; }
h3 { font-size: 1.125rem; margin-top: 1.5rem; margin-bottom: 0.75rem; }
p { margin-bottom: 1rem; }
a { color: var(--primary-dark); text-decoration: none; }
a:hover { color: var(--primary); text-decoration: underline; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.content-narrow { max-width: 800px; margin: 0 auto; }
main { flex: 1; padding: 2rem 0 3rem; }

/* ============================================
   HEADER
   ============================================ */
.header { background: white; border-bottom: 1px solid var(--gray-200); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.125rem; color: var(--gray-900); text-decoration: none; }
.logo:hover { text-decoration: none; color: var(--primary-dark); }
.logo-icon { width: 32px; height: 32px; color: var(--primary); }
.nav-desktop { display: flex; align-items: center; gap: 1.5rem; }
.nav-desktop a { font-size: 0.9375rem; font-weight: 500; color: var(--gray-600); padding: 0.5rem 0; border-bottom: 2px solid transparent; }
.nav-desktop a:hover, .nav-desktop a.active { color: var(--primary-dark); text-decoration: none; border-bottom-color: var(--primary); }
.nav-toggle { display: none; background: none; border: none; padding: 0.5rem; cursor: pointer; color: var(--gray-700); }
.nav-toggle svg { width: 24px; height: 24px; }
.nav-mobile { display: none; position: absolute; top: 100%; left: 0; right: 0; background: white; border-bottom: 1px solid var(--gray-200); padding: 1rem; box-shadow: var(--shadow-lg); z-index: 99; }
.nav-mobile.active { display: block; }
.nav-mobile a { display: block; padding: 0.5rem 1rem; color: var(--gray-700); font-weight: 500; border-radius: var(--radius-md); }
@media (max-width: 768px) { .nav-desktop { display: none; } .nav-toggle { display: block; } }

/* ============================================
   INTRO
   ============================================ */
.intro-text { font-size: 1.125rem; color: var(--gray-600); margin-bottom: 1.5rem; max-width: 720px; margin-left: auto; margin-right: auto; }

/* ============================================
   CALCULATOR CARD - 720px Width
   ============================================ */
.calculator-card {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  margin-bottom: 2rem;
  overflow: hidden;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid var(--gray-200);
}

/* ============================================
   TABS
   ============================================ */
/* Unit Toggle */
.unit-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: white;
  border-bottom: 1px solid var(--gray-200);
}
.unit-toggle-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-right: 0.25rem;
}
.unit-toggle-btns {
  display: flex;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.unit-toggle-btn {
  padding: 0.3rem 0.75rem;
  border: none;
  background: white;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--gray-600);
  font-weight: 500;
  transition: all 0.15s ease;
}
.unit-toggle-btn:first-child { border-right: 1px solid var(--gray-300); }
.unit-toggle-btn.active {
  background: var(--primary);
  color: white;
  font-weight: 600;
}
.unit-toggle-btn:hover:not(.active) { background: var(--gray-50); }

.calc-tabs {
  display: flex;
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.calc-tabs::-webkit-scrollbar { display: none; }
.calc-tab {
  flex: 1;
  min-width: 0;
  padding: 0.875rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gray-600);
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  border-bottom: 3px solid transparent;
  transition: all 0.15s ease;
}
.calc-tab:hover { color: var(--gray-800); background: var(--gray-50); }
.calc-tab.active { color: var(--primary-dark); background: white; border-bottom-color: var(--primary); font-weight: 600; }
.calc-tab svg { width: 20px; height: 20px; }
.calc-tab-label { white-space: nowrap; font-size: 0.8125rem; }

/* ============================================
   PANEL
   ============================================ */
.calc-panel { display: none; padding: 1.25rem; }
.calc-panel.active { display: block; }
.panel-intro {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 1.25rem;
  line-height: 1.5;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-100);
}

/* ============================================
   INLINE HELP / DRINK HELPER
   ============================================ */
.inline-help {
  background: var(--primary-bg);
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: 0.625rem 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--gray-700);
  line-height: 1.5;
}
.inline-help strong { color: var(--gray-900); }
.drink-helper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
}
.drink-helper-item {
  text-align: center;
  font-size: 0.6875rem;
  color: var(--gray-600);
  line-height: 1.3;
}
.drink-helper-item span {
  display: block;
  font-size: 1.25rem;
  margin-bottom: 0.125rem;
}
.drink-helper-item strong {
  color: var(--gray-800);
  font-size: 0.75rem;
}
.form-hint-important {
  font-size: 0.6875rem;
  color: var(--primary-dark);
  margin-top: 0.25rem;
  font-weight: 500;
}
.time-input-group {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}
.time-input-part {
  flex: 1;
  position: relative;
}
.time-input-part .form-input {
  padding-right: 3rem;
}
.time-input-suffix {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  color: var(--gray-400);
  font-weight: 500;
  pointer-events: none;
}
@media (max-width: 480px) {
  .drink-helper { grid-template-columns: repeat(3, 1fr); gap: 0.375rem; padding: 0.5rem; }
  .drink-helper-item span { font-size: 1rem; }
}

/* ============================================
   FORM LAYOUT
   ============================================ */
.form-grid { display: grid; gap: 1rem; }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.form-group { display: flex; flex-direction: column; gap: 0.25rem; }
.form-label { font-size: 0.8125rem; font-weight: 600; color: var(--gray-700); }
.form-hint { font-size: 0.6875rem; color: var(--gray-500); margin-top: 0.125rem; }

/* ============================================
   INPUT FIELDS - 44px Height
   ============================================ */
.form-input, .form-select {
  width: 100%;
  height: 44px;
  padding: 0 0.875rem;
  font-size: 0.9375rem;
  color: var(--gray-800);
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
  cursor: text;
}
.form-input[type="number"] { cursor: text; }
.form-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.5rem;
}

/* Date inputs - fully clickable */
.form-input[type="date"],
.form-input[type="time"],
.form-input[type="datetime-local"] {
  cursor: pointer;
  position: relative;
}
.form-input[type="date"]::-webkit-calendar-picker-indicator,
.form-input[type="time"]::-webkit-calendar-picker-indicator,
.form-input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  position: absolute;
  right: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

/* Input with Unit Selector */
.input-with-unit {
  display: flex;
  gap: 0.5rem;
}
.input-with-unit .form-input {
  flex: 1;
  min-width: 0;
}
.form-select-unit {
  width: 72px;
  flex-shrink: 0;
  padding-left: 0.625rem;
  padding-right: 1.75rem;
}

/* ============================================
   RADIO OPTIONS
   ============================================ */
.radio-group { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.radio-option {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  cursor: pointer;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  transition: all 0.15s ease;
}
.radio-option:hover { border-color: var(--primary-light); background: var(--primary-bg); }
.radio-option:has(input:checked) { border-color: var(--primary); background: var(--primary-bg); }
.radio-option input { width: 14px; height: 14px; accent-color: var(--primary); cursor: pointer; }

/* ============================================
   CALCULATE BUTTON - 48px Height
   ============================================ */
.calculate-btn {
  width: 100%;
  height: 48px;
  margin-top: 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px 0 rgba(245, 158, 11, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.calculate-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px 0 rgba(245, 158, 11, 0.45); }
.calculate-btn:active { transform: translateY(0); }
.calculate-btn svg { width: 18px; height: 18px; }

/* ============================================
   RESULTS SECTION - 800px Width
   ============================================ */
.results-section {
  display: none;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-200);
}
.results-section.visible { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Primary Result Display */
.result-primary {
  text-align: center;
  padding: 1.5rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-lg);
  border: 2px solid;
}
.result-primary.safe { background: var(--success-bg); border-color: var(--success); }
.result-primary.caution { background: var(--warning-bg); border-color: var(--warning); }
.result-primary.danger { background: var(--error-bg); border-color: var(--error); }
.result-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.result-value { font-size: 3rem; font-weight: 700; line-height: 1.1; }
.result-value.safe { color: var(--success); }
.result-value.caution { color: var(--primary-dark); }
.result-value.danger { color: var(--error); }
.result-unit { font-size: 1.25rem; font-weight: 500; }
.result-sublabel { font-size: 1rem; font-weight: 600; margin-top: 0.5rem; color: var(--gray-700); }

/* ============================================
   BAC GAUGE - Visual Chart
   ============================================ */
.bac-gauge { margin: 1.5rem 0; position: relative; }
.bac-gauge-track {
  height: 40px;
  border-radius: var(--radius-lg);
  display: flex;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.bac-gauge-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 600;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.bac-gauge-segment.safe { background: linear-gradient(180deg, var(--success) 0%, #059669 100%); flex: 8; }
.bac-gauge-segment.caution { background: linear-gradient(180deg, var(--caution) 0%, #d97706 100%); flex: 7; }
.bac-gauge-segment.danger { background: linear-gradient(180deg, var(--danger) 0%, #dc2626 100%); flex: 22; }
.bac-gauge-labels {
  display: flex;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--gray-500);
  font-weight: 500;
}
.bac-gauge-labels span { flex: 1; }
.bac-gauge-labels span:nth-child(2) { text-align: center; }
.bac-gauge-labels span:last-child { text-align: right; }
.bac-marker {
  position: absolute;
  top: 0;
  width: 4px;
  height: 40px;
  background: var(--gray-900);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(0,0,0,0.4);
  transition: left 0.3s ease;
}
.bac-marker::after {
  content: '';
  position: absolute;
  top: -6px;
  left: -4px;
  width: 12px;
  height: 12px;
  background: var(--gray-900);
  border-radius: 50%;
}

/* ============================================
   WARNING BOX
   ============================================ */
.warning-box {
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-top: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.warning-box.danger { background: var(--error-bg); border: 1px solid var(--error); }
.warning-box.caution { background: var(--warning-bg); border: 1px solid var(--warning); }
.warning-box.safe { background: var(--success-bg); border: 1px solid var(--success); }
.warning-box-icon { font-size: 1.25rem; flex-shrink: 0; line-height: 1; }
.warning-box-text { font-size: 0.875rem; font-weight: 500; line-height: 1.5; }
.warning-box.danger .warning-box-text { color: #991b1b; }
.warning-box.caution .warning-box-text { color: #92400e; }
.warning-box.safe .warning-box-text { color: #065f46; }

/* ============================================
   RESULTS GRID
   ============================================ */
.results-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin-top: 1rem; }
.results-grid-3 { grid-template-columns: repeat(3, 1fr); }
.results-grid-4 { grid-template-columns: repeat(4, 1fr); }
.result-item {
  padding: 1rem;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  text-align: center;
  border: 1px solid var(--gray-200);
}
.result-item-label {
  font-size: 0.6875rem;
  color: var(--gray-500);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  font-weight: 500;
}
.result-item-value { font-size: 1.125rem; font-weight: 700; color: var(--gray-800); }

/* ============================================
   ENHANCED RESULTS - Summary Tables
   ============================================ */
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin: 1rem 0;
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--gray-200);
}
.results-table th,
.results-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}
.results-table th {
  font-weight: 600;
  color: var(--gray-600);
  background: var(--gray-50);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}
.results-table td { color: var(--gray-700); }
.results-table tr:last-child td { border-bottom: none; }
.results-table .metric { font-weight: 500; color: var(--gray-800); }
.results-table .value { font-weight: 600; }
.results-table .value.safe { color: var(--success); }
.results-table .value.caution { color: var(--caution); }
.results-table .value.danger { color: var(--danger); }
.results-table .reference { font-size: 0.8125rem; color: var(--gray-500); }

/* Input Summary Table */
.input-summary {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin: 1rem 0;
}
.input-summary-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.025em;
  margin-bottom: 0.75rem;
}
.input-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
}
.input-summary-item {
  font-size: 0.8125rem;
}
.input-summary-label {
  color: var(--gray-500);
  font-size: 0.6875rem;
  text-transform: uppercase;
}
.input-summary-value {
  font-weight: 600;
  color: var(--gray-800);
}

/* ============================================
   TIPS GRID
   ============================================ */
.tips-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-200);
}
.tips-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 1rem;
}
.tips-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
.tip-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.875rem;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
}
.tip-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-bg);
  border-radius: var(--radius-sm);
  font-size: 1rem;
}
.tip-content { flex: 1; min-width: 0; }
.tip-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.125rem;
}
.tip-text {
  font-size: 0.75rem;
  color: var(--gray-600);
  line-height: 1.4;
}

/* ============================================
   WHAT THIS MEANS SECTION
   ============================================ */
.interpretation-box {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1rem;
}
.interpretation-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.5rem;
}
.interpretation-text {
  font-size: 0.875rem;
  color: var(--gray-600);
  line-height: 1.6;
  margin: 0;
}

/* ============================================
   PRINT BUTTON
   ============================================ */
.print-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray-600);
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  margin-top: 1rem;
}
.print-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
  color: var(--gray-800);
}
.print-btn svg { width: 16px; height: 16px; }

/* ============================================
   HORIZONTAL BAR CHART
   ============================================ */
.bar-chart {
  margin: 0.5rem 0;
}
.bar-chart-label {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-bottom: 0.25rem;
}
.bar-chart-track {
  height: 8px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.bar-chart-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}
.bar-chart-fill.safe { background: var(--success); }
.bar-chart-fill.caution { background: var(--caution); }
.bar-chart-fill.danger { background: var(--danger); }

/* ============================================
   RANGE/SLIDER INPUT
   ============================================ */
.form-input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  padding: 0;
  background: var(--gray-200);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
}
.form-input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  background: var(--primary);
  border: 3px solid white;
  border-radius: 50%;
  cursor: grab;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: transform 0.15s ease;
}
.form-input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.1); }
.form-input[type="range"]::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.15); }
.form-input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: var(--primary);
  border: 3px solid white;
  border-radius: 50%;
  cursor: grab;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.form-input[type="range"]::-moz-range-track {
  height: 8px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
}
.form-input[type="range"]:focus { box-shadow: none; }
.form-input[type="range"]:focus::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px var(--primary-bg), 0 2px 8px rgba(0,0,0,0.2);
}

.slider-value {
  display: inline-block;
  min-width: 3rem;
  padding: 0.25rem 0.5rem;
  background: var(--primary-bg);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary-dark);
  text-align: center;
}
.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.6875rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
}

/* ============================================
   CONTENT SECTION - 800px Width
   ============================================ */
.content-section {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid var(--gray-200);
}
.content-section h2 { margin-top: 0; }
.content-section h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--primary);
  margin-top: 0.5rem;
  border-radius: var(--radius-full);
}

/* ============================================
   DISCLAIMER BOX
   ============================================ */
.disclaimer {
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: var(--gray-600);
}
.disclaimer strong { color: var(--gray-800); }

/* ============================================
   DATA TABLE
   ============================================ */
.table-responsive { overflow-x: auto; margin: 1.5rem 0; -webkit-overflow-scrolling: touch; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 500px;
}
.data-table th, .data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}
.data-table th {
  font-weight: 600;
  color: var(--gray-700);
  background: var(--gray-50);
  position: sticky;
  top: 0;
}
.data-table td { color: var(--gray-600); }
.data-table tbody tr:hover { background: var(--primary-bg); }
.data-table .safe { color: var(--success); font-weight: 600; }
.data-table .caution { color: var(--caution); font-weight: 600; }
.data-table .danger { color: var(--danger); font-weight: 600; }

/* ============================================
   FAQ
   ============================================ */
.faq-section {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}
.faq-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.faq-item {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: white;
}
.faq-question {
  width: 100%;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: left;
  color: var(--gray-800);
  background: var(--gray-50);
  border: none;
  cursor: pointer;
}
.faq-question:hover { background: var(--gray-100); }
.faq-question svg { width: 18px; height: 18px; color: var(--gray-400); transition: transform 0.15s ease; flex-shrink: 0; margin-left: 1rem; }
.faq-item.open .faq-question svg { transform: rotate(180deg); }
.faq-answer { display: none; padding: 1rem; background: white; }
.faq-item.open .faq-answer { display: block; }

/* ============================================
   BLOG GRID
   ============================================ */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}
.blog-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.blog-card-content { padding: 1.25rem; }
.blog-card-meta { font-size: 0.75rem; color: var(--gray-500); margin-bottom: 0.5rem; }
.blog-card h3 { margin: 0 0 0.5rem; font-size: 1.0625rem; }
.blog-card h3 a { color: var(--gray-900); }
.blog-card p { font-size: 0.875rem; color: var(--gray-600); margin-bottom: 0; }

/* ============================================
   VISUAL HORIZONTAL BAR CHARTS
   ============================================ */
.visual-bars {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin: 1.5rem 0;
}
.visual-bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 60px;
  align-items: center;
  gap: 0.75rem;
}
.visual-bar-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray-700);
  text-align: right;
}
.visual-bar-track {
  height: 28px;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.visual-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  padding-left: 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: white;
  min-width: fit-content;
  white-space: nowrap;
}
.visual-bar-fill.safe { background: linear-gradient(90deg, var(--success), #059669); }
.visual-bar-fill.caution { background: linear-gradient(90deg, var(--caution), #d97706); }
.visual-bar-fill.danger { background: linear-gradient(90deg, var(--danger), #dc2626); }
.visual-bar-fill.primary { background: linear-gradient(90deg, #3b82f6, #2563eb); }
.visual-bar-fill.purple { background: linear-gradient(90deg, #8b5cf6, #7c3aed); }
.visual-bar-value {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--gray-800);
}

/* ============================================
   STAT CARDS
   ============================================ */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin: 1rem 0;
}
.stat-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1rem;
  text-align: center;
}
.stat-card-number {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0.25rem;
}
.stat-card-number.safe { color: var(--success); }
.stat-card-number.caution { color: var(--caution); }
.stat-card-number.danger { color: var(--danger); }
.stat-card-number.primary { color: var(--primary-dark); }
.stat-card-label {
  font-size: 0.6875rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.025em;
  font-weight: 600;
}
.stat-card-desc {
  font-size: 0.75rem;
  color: var(--gray-600);
  margin-top: 0.375rem;
  line-height: 1.4;
}

/* ============================================
   MYTH/FACT CARDS
   ============================================ */
.myth-fact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.myth-fact-card {
  border-radius: var(--radius-lg);
  padding: 1rem;
  border: 1px solid;
}
.myth-fact-card.myth {
  background: #fef2f2;
  border-color: #fecaca;
}
.myth-fact-card.fact {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.myth-fact-tag {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.375rem;
}
.myth-fact-card.myth .myth-fact-tag { background: var(--danger); color: white; }
.myth-fact-card.fact .myth-fact-tag { background: var(--success); color: white; }
.myth-fact-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.25rem;
}
.myth-fact-desc {
  font-size: 0.8125rem;
  color: var(--gray-600);
  line-height: 1.4;
}

/* ============================================
   PROCESS/TIMELINE STEPS
   ============================================ */
.process-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 1.5rem 0;
  position: relative;
}
.process-step {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 0;
  position: relative;
}
.process-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 17px;
  top: 44px;
  bottom: 0;
  width: 2px;
  background: var(--gray-200);
}
.process-step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8125rem;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.process-step-content { flex: 1; padding-top: 0.125rem; }
.process-step-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.125rem;
}
.process-step-desc {
  font-size: 0.8125rem;
  color: var(--gray-600);
  line-height: 1.5;
}
.process-step-time {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin-top: 0.25rem;
}

/* ============================================
   DRINK VISUAL CARDS
   ============================================ */
.drink-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.drink-card {
  text-align: center;
  padding: 1rem 0.5rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
}
.drink-card-icon {
  font-size: 2rem;
  margin-bottom: 0.375rem;
  line-height: 1;
}
.drink-card-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.125rem;
}
.drink-card-detail {
  font-size: 0.6875rem;
  color: var(--gray-500);
  line-height: 1.3;
}
.drink-card-alcohol {
  display: inline-block;
  margin-top: 0.375rem;
  padding: 0.125rem 0.5rem;
  background: var(--primary-bg);
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--primary-dark);
}

/* ============================================
   IMPAIRMENT SCALE
   ============================================ */
.impairment-scale {
  display: flex;
  flex-direction: column;
  margin: 1.5rem 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--gray-200);
}
.scale-level {
  display: grid;
  grid-template-columns: 90px 1fr;
  border-bottom: 1px solid var(--gray-100);
}
.scale-level:last-child { border-bottom: none; }
.scale-level-bac {
  padding: 0.75rem 0.625rem;
  font-weight: 700;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}
.scale-level.safe .scale-level-bac { background: var(--success); }
.scale-level.caution .scale-level-bac { background: var(--caution); }
.scale-level.danger .scale-level-bac { background: var(--danger); }
.scale-level-content { padding: 0.75rem 1rem; }
.scale-level-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.125rem;
}
.scale-level-effects {
  font-size: 0.75rem;
  color: var(--gray-600);
  line-height: 1.4;
}

/* ============================================
   INFO CARDS GRID
   ============================================ */
.info-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.info-card {
  padding: 1rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  display: flex;
  gap: 0.75rem;
}
.info-card-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-bg);
  border-radius: var(--radius-md);
}
.info-card-body { flex: 1; min-width: 0; }
.info-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.125rem;
}
.info-card-text {
  font-size: 0.8125rem;
  color: var(--gray-600);
  line-height: 1.4;
}

/* ============================================
   COMPARISON SPLIT
   ============================================ */
.comparison-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}
.comparison-side {
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  background: var(--gray-50);
}
.comparison-side-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.75rem;
  text-align: center;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
}
.comparison-side .visual-bars { margin: 0.75rem 0 0 0; }
.comparison-side .visual-bar-row { grid-template-columns: 70px 1fr 50px; }
.comparison-side .visual-bar-label { font-size: 0.75rem; }
.comparison-side .visual-bar-value { font-size: 0.75rem; }

/* ============================================
   BAC TIMELINE CHART
   ============================================ */
.bac-timeline-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 180px;
  margin: 1.5rem 0 0 0;
  padding: 0 0.5rem;
  border-bottom: 2px solid var(--gray-300);
  border-left: 2px solid var(--gray-300);
  position: relative;
}
.bac-timeline-bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  position: relative;
  min-width: 0;
  transition: height 0.3s ease;
}
.bac-timeline-bar.safe { background: linear-gradient(180deg, var(--success), #059669); }
.bac-timeline-bar.caution { background: linear-gradient(180deg, var(--caution), #d97706); }
.bac-timeline-bar.danger { background: linear-gradient(180deg, var(--danger), #dc2626); }
.bac-timeline-labels {
  display: flex;
  gap: 3px;
  padding: 0.375rem 0.5rem 0;
}
.bac-timeline-label {
  flex: 1;
  text-align: center;
  font-size: 0.625rem;
  color: var(--gray-500);
  font-weight: 500;
}
.bac-legal-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 2px dashed var(--danger);
  z-index: 1;
}
.bac-legal-line-label {
  position: absolute;
  right: 4px;
  top: -16px;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--danger);
  white-space: nowrap;
}

/* ============================================
   VISUAL CHART RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
  .visual-bar-row { grid-template-columns: 80px 1fr 50px; gap: 0.5rem; }
  .visual-bar-label { font-size: 0.6875rem; }
  .visual-bar-track { height: 22px; }
  .visual-bar-fill { font-size: 0.5625rem; padding-left: 0.5rem; }
  .myth-fact-grid { grid-template-columns: 1fr; }
  .comparison-split { grid-template-columns: 1fr; }
  .scale-level { grid-template-columns: 72px 1fr; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .drink-cards { grid-template-columns: repeat(3, 1fr); }
  .info-cards { grid-template-columns: 1fr; }
  .bac-timeline-chart { height: 140px; }
  .bac-timeline-label { font-size: 0.5rem; }
}

/* ============================================
   FOOTER
   ============================================ */
.footer { background: var(--gray-900); color: var(--gray-400); padding: 2.5rem 0 1.5rem; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.footer-brand .logo { color: white; margin-bottom: 1rem; }
.footer-brand .logo-icon { color: var(--primary-light); }
.footer-brand p { font-size: 0.875rem; }
.footer-nav h4 { color: white; font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; margin-bottom: 1rem; }
.footer-nav ul { list-style: none; }
.footer-nav li { margin-bottom: 0.5rem; }
.footer-nav a { font-size: 0.875rem; color: var(--gray-400); }
.footer-nav a:hover { color: white; text-decoration: none; }
.footer-bottom { padding-top: 1.5rem; border-top: 1px solid var(--gray-800); font-size: 0.8125rem; }

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .header, .footer, .nav-toggle, .calculate-btn, .print-btn, .calc-tabs { display: none !important; }
  .calculator-card, .content-section { box-shadow: none; border: 1px solid #ccc; }
  .results-section { display: block !important; }
  body { background: white; }
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .tips-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .calculator-card {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    border-radius: var(--radius-lg);
  }
  .content-section {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    border-radius: var(--radius-lg);
  }
  .calc-panel { padding: 1rem; }
  .result-value { font-size: 2.5rem; }
  .result-unit { font-size: 1rem; }
  .result-primary { padding: 1.25rem; }
  .bac-gauge-track { height: 32px; }
  .bac-marker { height: 32px; }
  .bac-gauge-segment { font-size: 0.5625rem; }
  .form-row { grid-template-columns: 1fr; }
  .results-grid, .results-grid-3, .results-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .input-summary-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  h1 { font-size: 1.75rem; }
  .intro-text { font-size: 1rem; }
  .calc-panel { padding: 0.875rem; }
  .form-grid { gap: 0.875rem; }
  .form-input, .form-select { height: 44px; font-size: 0.875rem; }
  .calculate-btn { height: 46px; font-size: 0.9375rem; }
  .radio-option { padding: 0.5rem 0.75rem; font-size: 0.75rem; }
  .calc-tab { padding: 0.625rem 0.25rem; }
  .calc-tab-label { font-size: 0.6875rem; }
  .calc-tab svg { width: 18px; height: 18px; }
}
