/* style.css — Salaria modern UI design system */

/* ─── GOOGLE FONTS ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ─── DESIGN TOKENS ─────────────────────────────────────────────────────────── */
:root {
  --color-bg:          hsl(215, 20%, 96%);
  --color-bg-alt:      hsl(215, 18%, 92%);
  --color-card:        hsl(0, 0%, 100%);
  --color-card-alt:    hsl(215, 25%, 98%);
  --color-border:      hsl(215, 20%, 88%);
  --color-border-focus:hsl(215, 70%, 55%);
  --color-accent:      hsl(215, 70%, 50%);
  --color-accent-hover:hsl(215, 70%, 43%);
  --color-accent-light:hsl(215, 70%, 95%);
  --color-accent-glow: hsl(215, 70%, 50%, 0.15);
  --color-text:        hsl(215, 25%, 15%);
  --color-text-muted:  hsl(215, 15%, 50%);
  --color-text-subtle: hsl(215, 15%, 68%);
  --color-success:     hsl(152, 55%, 42%);
  --color-danger:      hsl(0, 60%, 55%);
  --color-warning:     hsl(45, 95%, 85%);

  --font-base: 'Inter', system-ui, -apple-system, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 3px hsl(215,25%,15%,0.06), 0 1px 2px hsl(215,25%,15%,0.04);
  --shadow-md: 0 10px 30px hsl(215, 25%, 15%, 0.04), 0 4px 12px hsl(215, 25%, 15%, 0.02);
  --shadow-lg: 0 8px 32px hsl(215,25%,15%,0.10), 0 4px 12px hsl(215,25%,15%,0.06);
  --shadow-focus: 0 0 0 3px var(--color-accent-glow);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

:root.dark-mode {
  --color-bg:          hsl(215, 25%, 10%);
  --color-bg-alt:      hsl(215, 25%, 13%);
  --color-card:        hsl(215, 20%, 15%);
  --color-card-alt:    hsl(215, 25%, 17%);
  --color-border:      hsl(215, 25%, 22%);
  --color-border-focus:hsl(215, 70%, 55%);
  --color-text:        hsl(215, 20%, 95%);
  --color-text-muted:  hsl(215, 15%, 70%);
  --color-text-subtle: hsl(215, 15%, 55%);
  --color-accent:      hsl(215, 70%, 58%);
  --color-accent-hover:hsl(215, 70%, 65%);
  --color-accent-light:hsl(215, 25%, 22%);
}

/* ─── RESET ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-base);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}
img, canvas { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
select, input { font-family: inherit; }

/* ─── LAYOUT ─────────────────────────────────────────────────────────────────── */
.site-header {
  background: hsl(215, 70%, 50%);
  border-bottom: none;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 1rem;
  padding: 0 1rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}
.logo-icon {
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-icon svg { width: 18px; height: 18px; fill: #fff; }
.logo-text { font-size: 1.1rem; font-weight: 700; color: #fff; letter-spacing: -0.02em; }
.logo-year { font-size: 0.75rem; font-weight: 500; color: var(--color-accent); margin-left: 0.3rem; }

/* ─── LANG SWITCHER ──────────────────────────────────────────────────────────── */
#lang-switcher {
  display: flex;
  align-items: center;
}
.lang-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: auto;
}
.lang-select-wrap::after {
  content: "";
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid rgba(255, 255, 255, 0.8);
  pointer-events: none;
}
.lang-select {
  appearance: none;
  -webkit-appearance: none;
  width: auto;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font-base);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.3rem 1.6rem 0.3rem 0.7rem;
  cursor: pointer;
  outline: none;
  transition: background var(--transition);
}
.lang-select:hover {
  background: rgba(255, 255, 255, 0.25);
}
.lang-select:focus {
  background: rgba(255, 255, 255, 0.25);
  outline: none;
  box-shadow: none;
}
.lang-select option {
  background: var(--color-card);
  color: var(--color-text);
  font-weight: 500;
}

/* ─── THEME TOGGLE ───────────────────────────────────────────────────────────── */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.theme-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.theme-btn:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }
.theme-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-sun { display: none; }
.dark-mode .icon-moon { display: none; }
.dark-mode .icon-sun { display: block; }

/* ─── HERO ───────────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, hsl(215,70%,50%) 0%, hsl(220,65%,42%) 100%);
  color: #fff;
  text-align: center;
  padding: 2.5rem 1.5rem 2rem;
}
.hero h1 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; letter-spacing: -0.03em; }
.hero p  { font-size: 0.9rem; opacity: 0.85; margin-top: 0.4rem; font-weight: 400; }

/* ─── MAIN CONTENT ───────────────────────────────────────────────────────────── */
main {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  padding: 1.5rem 1rem 3rem;
}

.calc-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  grid-template-areas: 
    "left right"
    "left chart";
  gap: 1.5rem;
  align-items: start;
}
.left-col { grid-area: left; }
.right-col { grid-area: right; }
#chart-panel { grid-area: chart; }

/* ─── CARD ───────────────────────────────────────────────────────────────────── */
.card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: fadeUp 0.4s ease both;
  min-width: 0;
  transition: var(--transition);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card-header {
  padding: 1.25rem 0;
  margin: 0 1.25rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.card-header-icon {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  background: var(--color-accent-light);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-accent);
}
.card-header-icon svg { width: 15px; height: 15px; stroke: currentColor; fill: none; }
.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.01em;
  margin: 0;
}
.card-body { padding: 1.25rem; }
.card.empty-state .card-body {
  display: none;
}

/* ─── FORM ELEMENTS ──────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 1.25rem;
}
.form-group:last-child { margin-bottom: 0; }
.split-inputs {
  display: flex;
  gap: 1.25rem;
}
.inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.inputs-grid .form-group {
  margin-bottom: 0;
}
@media (max-width: 480px) {
  .inputs-grid { grid-template-columns: 1fr; }
}
.warning-box {
  background: var(--color-warning);
  color: #1a1a1a;
  border-radius: var(--radius-md);
  padding: 0.8rem 1rem;
  margin-top: 0;
  margin-bottom: 1.25rem;
  display: flex !important;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  animation: fadeUp 0.3s ease;
  line-height: 1.4;
}
.warning-box.hidden { display: none !important; }
.warning-icon { width: 18px; height: 18px; stroke: #1a1a1a; flex-shrink: 0; margin-top: 1px; }
.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 0.4rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.form-select, .form-input {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--color-text);
  background: var(--color-card);
  transition: var(--transition);
  appearance: none;
  -webkit-appearance: none;
  outline: none;
}
#period-select { color: transparent; }
#period-select option { color: var(--color-text); }
.form-select {
  padding-right: 2rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
input[type="number"].form-input::-webkit-inner-spin-button,
input[type="number"].form-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"].form-input {
  -moz-appearance: textfield;
}
.form-input::placeholder {
  color: var(--color-text-subtle);
  font-weight: 400;
  opacity: 0.6;
}
#gross-input::placeholder, #net-input::placeholder {
  font-size: 1.25rem;
}
.form-select:hover, .form-input:hover,
.form-select:focus, .form-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: var(--shadow-focus);
}
.form-input {
  caret-color: var(--color-text);
}
#gross-input, #net-input {
  background: var(--color-card-alt);
}
#vouchers-input {
  background: var(--color-card);
}
.form-input.is-last-edited {
  border-color: var(--color-text-muted) !important;
  box-shadow: none !important;
}
.form-input.is-last-edited:focus {
  border-color: var(--color-accent) !important;
  box-shadow: var(--shadow-focus) !important;
}
.dark-mode .form-input {
  caret-color: #fff;
}
.select-wrap {
  position: relative;
}
.select-wrap::after {
  content: "";
  position: absolute;
  right: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--color-text-muted);
  pointer-events: none;
}
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap .form-input {
  padding-right: 2.8rem;
}
#gross-input, #net-input {
  font-size: 1.25rem;
  font-weight: 600;
}
.input-suffix {
  position: absolute;
  right: 0.8rem;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--color-text-subtle);
  pointer-events: none;
}

/* ─── DIRECTION TOGGLE ───────────────────────────────────────────────────────── */
.direction-toggle {
  display: flex;
  gap: 0;
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.direction-toggle input[type="radio"] { display: none; }
.direction-toggle label {
  flex: 1;
  text-align: center;
  padding: 0.5rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}
.direction-toggle input[type="radio"]:checked + label {
  background: var(--color-accent);
  color: #fff;
}
.direction-toggle label:hover { background: var(--color-accent-light); color: var(--color-accent); }
.direction-toggle input[type="radio"]:checked + label:hover { background: var(--color-accent); }

/* ─── DIVIDER ────────────────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--color-border);
  margin: 1rem 0;
}

/* ─── RESULTS PANEL ──────────────────────────────────────────────────────────── */
.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.result-card {
  background:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 3px,
      hsla(215, 20%, 70%, 0.18) 3px,
      hsla(215, 20%, 70%, 0.18) 4px
    ),
    var(--color-card);
  border: none;
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: var(--transition);
}
.dark-mode .result-card {
  background:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 3px,
      hsla(215, 20%, 60%, 0.10) 3px,
      hsla(215, 20%, 60%, 0.10) 4px
    ),
    var(--color-card);
}
.result-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.15rem;
}
.result-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

/* Gross computed row */
#gross-computed-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  background: hsl(215,70%,97%);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  font-size: 0.85rem;
}
#gross-computed-row .gc-label { color: var(--color-text-muted); font-weight: 500; }
#gross-computed-row .gc-value { color: var(--color-accent); font-weight: 700; margin-left: auto; }

/* ─── CONTRIBUTION TABLE ─────────────────────────────────────────────────────── */
.contrib-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}
.contrib-table {
  width: 100%;
  min-width: 500px;
  border-collapse: collapse;
  font-size: 0.83rem;
}
.contrib-table th {
  background: var(--color-bg);
  padding: 0.55rem 0.85rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.72rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
.contrib-table td {
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  white-space: nowrap;
}
.contrib-table tr:last-child td { border-bottom: none; }
.contrib-table tbody tr:hover { background: var(--color-bg); }
.contrib-table tfoot td {
  font-weight: 700;
  background: var(--color-bg);
  border-top: 2px solid var(--color-border);
  color: var(--color-text);
  border-bottom: none;
}
.contrib-table td:not(:first-child),
.contrib-table th:not(:first-child) { text-align: right; }

/* Sticky first column */
.contrib-table th:first-child {
  position: sticky;
  left: 0;
  background: var(--color-bg);
  z-index: 2;
}
.contrib-table td:first-child {
  position: sticky;
  left: 0;
  background: var(--color-card);
  z-index: 1;
}
.contrib-table tbody tr:hover td:first-child {
  background: var(--color-bg);
}
.contrib-table tfoot td:first-child {
  position: sticky;
  left: 0;
  background: var(--color-bg);
  z-index: 2;
}

/* ─── CHART SECTION ──────────────────────────────────────────────────────────── */
.chart-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.chart-canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-width: 260px;
  margin: 0 auto;
}
#salary-chart {
  width: 100%;
  height: 100%;
}
.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.legend-item:hover { background: var(--color-bg); }
.legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-label {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  flex: 1;
}
.legend-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  text-align: right;
}
.legend-pct {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-subtle);
  min-width: 38px;
  text-align: right;
}

/* ─── COLUMNS ────────────────────────────────────────────────────────────────── */
.right-col, .left-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
}
.side-by-side {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 1024px) {
  .side-by-side {
    grid-template-columns: 280px 1fr;
    align-items: flex-start;
  }
}

/* ─── YEAR BADGE IN HEADER ───────────────────────────────────────────────────── */
.year-select-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.year-label-sm { font-size: 0.72rem; font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.year-select-inline {
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-bg);
  padding: 0.25rem 0.5rem;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}
.year-select-inline:focus { border-color: var(--color-border-focus); box-shadow: var(--shadow-focus); }

/* ─── GDPR BANNER ────────────────────────────────────────────────────────────── */
.gdpr-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--color-card);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 24px hsl(215,25%,15%,0.1);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  animation: slideUp 0.4s ease both;
}
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.gdpr-banner.banner-hide {
  animation: slideDown 0.4s ease both;
}
@keyframes slideDown {
  from { transform: translateY(0); opacity: 1; }
  to   { transform: translateY(100%); opacity: 0; }
}
.gdpr-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--color-accent-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--color-accent);
}
.gdpr-text {
  flex: 1;
  font-size: 0.83rem;
  color: var(--color-text-muted);
  min-width: 200px;
}
.gdpr-text a {
  color: var(--color-accent);
  font-weight: 600;
  text-decoration: none;
}
.gdpr-text a:hover { text-decoration: underline; }
.gdpr-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.83rem;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--color-accent);
  color: #fff;
}
.btn-primary:hover { background: var(--color-accent-hover); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--color-border);
  color: var(--color-text-muted);
}
.btn-ghost:hover { border-color: var(--color-accent); color: var(--color-accent); background: var(--color-accent-light); }

/* ─── FOOTER ─────────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--color-bg);
  padding: 2rem 0 1rem;
}
.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  text-align: center;
  padding: 0 1rem;
}
@media (min-width: 640px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
  .footer-disclaimer { margin: 0; text-align: right; max-width: 55%; }
  .footer-copy { text-align: left; flex-shrink: 0; margin-top: 0; }
}
.footer-disclaimer {
  font-size: 0.78rem;
  color: var(--color-text-subtle);
  max-width: 100%;
  margin: 0 0 0.8rem;
}
.footer-copy {
  font-size: 0.75rem;
  color: var(--color-text-subtle);
}
.footer-copy a { color: var(--color-accent); text-decoration: none; font-weight: 500; }
.footer-made-in {
  text-align: center;
  opacity: 0.7;
  font-size: 0.8rem;
  margin-top: 2rem;
  color: var(--color-text-muted);
}

/* ─── UTILITY ────────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }

/* ─── RESPONSIVE ─────────────────────────────────────────────────────────────── */
@media (min-width: 1240px) {
  .calc-grid {
    grid-template-columns: 360px 1fr 340px;
    grid-template-areas: "left right chart";
  }
}

@media (max-width: 1024px) {
  .calc-grid {
    grid-template-columns: 1fr;
    grid-template-areas: 
      "left"
      "right"
      "chart";
    max-width: 800px;
    margin: 0 auto;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .hero { padding: 1.8rem 1rem 1.5rem; }
  .hero h1 { font-size: 1.3rem; }
  main { padding: 1rem 0.75rem 5rem; }
  .header-inner { padding: 0 0.75rem; }
  .footer-inner { padding: 0 0.75rem; }
  .calc-grid { gap: 1rem; max-width: 100%; min-width: 0; }
  .card-body { padding: 1rem; }
  .card-header { padding: 0.9rem 0; margin: 0 1rem; }
  .results-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .result-label { font-size: 0.65rem; }
  .result-value { font-size: 0.95rem; }
  .gdpr-banner { padding: 0.9rem 1rem; gap: 0.75rem; }
  .gdpr-icon { display: none; }
  .lang-select { font-size: 0.72rem; padding: 0.25rem 1.6rem 0.25rem 0.6rem; }
  .header-inner { height: 54px; }
  .logo-text { font-size: 1rem; }
  .chart-canvas-wrap { max-width: 220px; }
}

@media (max-width: 380px) {
  .logo-year { display: none; }
  .direction-toggle label { font-size: 0.72rem; padding: 0.45rem 0.4rem; }
}
