:root {
  --primary: #0b3d91;
  --primary-600: #082f72;
  --accent: #f59e0b;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --success: #16a34a;
  --danger: #dc2626;
  --warn: #d97706;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 1px rgba(15,23,42,.04);
  --shadow-md: 0 6px 18px rgba(15,23,42,.08);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* Navbar */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 14px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
}
.nav-links a {
  color: var(--text);
  font-weight: 500;
}
.nav-links a:hover { color: var(--primary); }

.nav-form { display: inline; margin: 0; }

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: .9rem;
}
.lang-switch a { color: var(--muted); }
.lang-switch a.active { color: var(--primary); font-weight: 700; }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  width: 38px;
  height: 38px;
  padding: 8px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2.5px;
  width: 100%;
  background: var(--text);
  margin: 4px 0;
  border-radius: 2px;
}

@media (max-width: 880px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--surface);
    flex-direction: column;
    align-items: stretch;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    display: none;
  }
  .nav-links a { padding: 8px 0; }
  .nav-links.open { display: flex; }
  .nav-form { width: 100%; }
}

/* Main */
.main { padding: 32px 0 56px; min-height: 60vh; }

/* Beam form: support diagram + field hints */
.beam-support-block {
  margin-bottom: 22px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.beam-diagram-box {
  margin-top: 14px;
  padding: 16px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
}
.beam-diagram-caption {
  margin: 0 0 10px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.beam-diagram-svg svg {
  max-width: 100%;
  height: auto;
  min-height: 72px;
}
.beam-diagram-svg[hidden] { display: none; }
.beam-diagram-dynamic { width: 100%; min-height: 110px; }
.beam-diagram-svg-live { width: 100%; height: auto; display: block; }
.beam-diagram-note { margin-top: 8px; color: var(--warn); font-weight: 500; }
.beam-custom-field {
  margin-top: 8px;
}
.form-row .hint {
  display: block;
  margin-top: 6px;
  line-height: 1.45;
}

/* Beam: q × b → w conversion diagram */
.beam-load-diagram {
  margin: 8px 0 24px;
  padding: 18px 20px;
  background: linear-gradient(180deg, #f0f9ff 0%, #fff 100%);
  border: 1px solid #bae6fd;
  border-radius: 12px;
}
.beam-load-diagram-title {
  margin: 0 0 12px;
  font-size: .95rem;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
}
.beam-load-diagram-svg {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}
.beam-load-diagram-formula {
  margin: 14px 0 0;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  font-family: "JetBrains Mono", Menlo, monospace;
  padding: 10px 14px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.beam-load-diagram-result {
  margin-top: 18px;
}
.beam-subsection-title {
  margin: 22px 0 10px;
  font-size: 1.05rem;
  color: var(--primary);
}
.beam-spans-panel,
.beam-point-loads-panel,
.beam-query-panel {
  margin-top: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}
.beam-span-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px 16px;
}
.beam-total-span {
  font-weight: 600;
  color: var(--primary);
}
.beam-load-table-wrap { overflow-x: auto; margin: 10px 0; }
.beam-load-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.beam-load-table th,
.beam-load-table td {
  padding: 8px 10px;
  border: 1px solid var(--border);
  text-align: left;
}
.beam-load-table th { background: #f1f5f9; font-weight: 600; }
.beam-load-table input { width: 100%; min-width: 80px; }
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  cursor: pointer;
}

@media (min-width: 720px) {
  .beam-support-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
  }
  .beam-support-block .form-row { margin: 0; }
  .beam-diagram-box { margin-top: 0; }
}

/* Unit selector on calculation forms */
.unit-selector {
  margin-bottom: 20px;
  padding: 16px 18px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.unit-selector-title {
  margin: 0 0 4px;
  font-weight: 700;
  font-size: .95rem;
  color: var(--text);
}
.unit-selector-desc {
  margin: 0 0 12px;
  font-size: .88rem;
  color: var(--muted);
}
.unit-selector-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.unit-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: .9rem;
  transition: border-color .15s, box-shadow .15s;
}
.unit-option:has(input:checked) {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 61, 145, .12);
  background: #eff6ff;
}
.unit-option input { accent-color: var(--primary); }

/* User panel */
.panel-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Admin subnav & dashboard */
.admin-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.admin-subnav a {
  color: var(--muted);
  font-weight: 600;
  font-size: .92rem;
  text-decoration: none;
  padding: 6px 0;
}
.admin-subnav a:hover { color: var(--primary); }
.admin-subnav a.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}
.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.admin-stat-card {
  text-align: center;
  padding: 18px 14px;
}
.admin-stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}
.admin-stat-label {
  font-size: .85rem;
  color: var(--muted);
  margin-top: 6px;
}
.admin-stat-sub { margin-top: 8px; font-size: .75rem; }
.admin-alert {
  margin-bottom: 22px;
  padding: 18px 20px;
  border-radius: 12px;
  border: 1px solid #fecaca;
  background: #fef2f2;
}
.admin-alert-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.admin-alert-desc {
  margin: 0 0 12px;
  color: #7f1d1d;
  font-size: .92rem;
}
.admin-alert-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}
.admin-alert-list li + li { margin-top: 6px; }
.admin-alert-list a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #fecaca;
  text-decoration: none;
  color: inherit;
}
.admin-alert-list a:hover { border-color: var(--primary); }
.admin-alert-subject { display: block; font-weight: 600; }
.admin-alert-meta { display: block; font-size: .8rem; color: var(--muted); margin-top: 2px; }
.admin-subnav .nav-badge {
  display: inline-block;
  min-width: 18px;
  padding: 1px 6px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  vertical-align: middle;
}
.admin-action-card--alert { border-color: #fecaca; box-shadow: 0 0 0 1px #fecaca; }
table.data tr.row-unread { background: #fffbeb; }
.admin-lang-blocks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.admin-fieldset {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px 8px;
  margin: 0;
  min-width: 0;
}
.admin-fieldset legend {
  font-weight: 700;
  padding: 0 8px;
}
textarea.about-editor {
  min-height: 280px;
  height: auto;
  padding: 12px 14px;
  line-height: 1.5;
  font-family: inherit;
  resize: vertical;
}
.about-content h1 { margin: 0 0 1rem; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.about-content h2 { margin: 1.5rem 0 .75rem; font-size: 1.25rem; }
.about-content p { margin: 0 0 1rem; line-height: 1.6; color: var(--text); }
.about-content ol { margin: 0 0 1rem; padding-left: 1.4rem; line-height: 1.6; }
.about-content li { margin-bottom: .35rem; }
.admin-message-body {
  white-space: pre-wrap;
  line-height: 1.55;
  padding: 14px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--border);
}
.admin-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}
.admin-action-card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform .15s, box-shadow .15s;
}
.admin-action-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.admin-action-card h3 { margin: 0 0 8px; color: var(--primary); }
.admin-action-card p { margin: 0 0 14px; color: var(--muted); font-size: .9rem; }

/* Admin quick access tiles (Foodovia-style squares) */
.qa-section-title {
  margin: 0 0 16px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}
.qa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 8px;
}
.qa-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  text-decoration: none;
  color: inherit;
  min-height: 200px;
  padding: 18px 14px 16px;
  gap: 8px;
  border: 3px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(145deg, #fff 0%, #f8fafc 100%);
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.qa-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: inherit;
}
.qa-tile__badge {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 2;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid var(--primary);
  color: var(--primary);
  font-size: .72rem;
  font-weight: 800;
  line-height: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
}
.qa-tile__badge--danger {
  border-color: var(--danger);
  color: var(--danger);
}
.qa-tile__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  margin-bottom: 4px;
  border-radius: 12px;
  flex-shrink: 0;
  transition: transform .2s, background .2s, color .2s;
}
.qa-tile__icon svg {
  width: 30px;
  height: 30px;
}
.qa-tile:hover .qa-tile__icon {
  transform: scale(1.08);
}
.qa-tile__label {
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.35;
  margin: 0;
  width: 100%;
  word-break: break-word;
  hyphens: auto;
}
.qa-tile__desc {
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.4;
  margin: 0;
  width: 100%;
  word-break: break-word;
  hyphens: auto;
  flex: 1;
}
.qa-tile--slate .qa-tile__icon { background: linear-gradient(145deg, #f1f5f9, #e2e8f0); color: #475569; }
.qa-tile--slate:hover { border-color: #64748b; }
.qa-tile--slate:hover .qa-tile__icon { background: #64748b; color: #fff; }

.qa-tile--green .qa-tile__icon { background: linear-gradient(145deg, #dcfce7, #bbf7d0); color: #15803d; }
.qa-tile--green:hover { border-color: #22c55e; }
.qa-tile--green:hover .qa-tile__icon { background: #22c55e; color: #fff; }

.qa-tile--emerald .qa-tile__icon { background: linear-gradient(145deg, #d1fae5, #a7f3d0); color: #047857; }
.qa-tile--emerald:hover { border-color: #10b981; }
.qa-tile--emerald:hover .qa-tile__icon { background: #10b981; color: #fff; }

.qa-tile--amber .qa-tile__icon { background: linear-gradient(145deg, #fef3c7, #fde68a); color: #b45309; }
.qa-tile--amber:hover { border-color: #f59e0b; }
.qa-tile--amber:hover .qa-tile__icon { background: #f59e0b; color: #fff; }
.qa-tile--alert { border-color: #fecaca; }

.qa-tile--gray .qa-tile__icon { background: linear-gradient(145deg, #f3f4f6, #e5e7eb); color: #4b5563; }
.qa-tile--gray:hover { border-color: #6b7280; }
.qa-tile--gray:hover .qa-tile__icon { background: #6b7280; color: #fff; }

.qa-tile--blue .qa-tile__icon { background: linear-gradient(145deg, #dbeafe, #bfdbfe); color: #1d4ed8; }
.qa-tile--blue:hover { border-color: #3b82f6; }
.qa-tile--blue:hover .qa-tile__icon { background: #3b82f6; color: #fff; }

.qa-tile--violet .qa-tile__icon { background: linear-gradient(145deg, #ede9fe, #ddd6fe); color: #5b21b6; }
.qa-tile--violet:hover { border-color: #7c3aed; }
.qa-tile--violet:hover .qa-tile__icon { background: #7c3aed; color: #fff; }

.deposit-modes {
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
}
.deposit-modes legend {
  width: 100%;
  font-weight: 700;
  margin-bottom: 4px;
}
.deposit-mode-opt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: .92rem;
}
.deposit-day-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.deposit-period-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
}
.result-item.deposit-info-only .label {
  color: var(--muted);
  font-weight: 500;
}
.result-item.deposit-info-only .value {
  color: var(--muted);
  font-size: .95em;
}

@media (max-width: 480px) {
  .qa-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .qa-tile { min-height: 168px; padding: 14px 10px 12px; }
  .qa-tile__label { font-size: .88rem; }
  .qa-tile__desc { font-size: .75rem; }
  .qa-tile__icon { width: 52px; height: 52px; }
  .qa-tile__icon svg { width: 26px; height: 26px; }
}

/* Permanent legal disclaimer (below calculation modules) */
.disclaimer-footer {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-style: italic;
  font-size: .85rem;
  line-height: 1.55;
  color: var(--muted);
  text-align: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  font-size: .95rem;
  line-height: 1;
  white-space: nowrap;
  transition: all .15s ease;
  box-sizing: border-box;
}
.btn-sm { height: 36px; padding: 0 14px; font-size: .85rem; }
.btn-lg { height: 52px; padding: 0 28px; font-size: 1rem; }
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-600); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warn   { background: var(--warn); color: #fff; }
.btn-success{ background: var(--success); color: #fff; }
.btn-block { width: 100%; }

/* Cards & hero */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 18px; }

.hero {
  background: linear-gradient(135deg, #0b3d91, #1d4ed8 60%, #2563eb);
  color: #fff;
  padding: 64px 0 72px;
  border-bottom-left-radius: 36px;
  border-bottom-right-radius: 36px;
  margin-top: -32px;
}
.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  line-height: 1.15;
}
.hero p { font-size: 1.05rem; max-width: 680px; opacity: .92; }
.hero-cta { margin-top: 22px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero-cta .btn { height: 48px; padding: 0 24px; font-size: 1rem; }
.hero-cta .btn-primary { background: var(--accent); border-color: var(--accent); color: #1f2937; }

/* Features grid */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 36px;
}
.feature h3 { margin: 0 0 6px; font-size: 1.1rem; }
.feature p { margin: 0; color: var(--muted); }

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px 18px;
}
.form-row { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-row label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .01em;
}
.form-row .hint { font-size: .8rem; color: var(--muted); }
/* All form controls share the EXACT same size, padding, border and font */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="date"],
select,
textarea {
  width: 100%;
  height: 44px;                /* same height for input + select */
  box-sizing: border-box;
  padding: 0 14px;             /* vertical centering via height; horizontal padding equal */
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font: 400 .95rem/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  vertical-align: middle;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Native select dropdown arrow (custom, consistent across browsers) */
select {
  padding-right: 38px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='%2364748b' d='M2 4l4 4 4-4z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 12px;
  cursor: pointer;
}

textarea {
  height: auto;
  min-height: 140px;
  padding: 12px 14px;
  resize: vertical;
}

input::placeholder, textarea::placeholder { color: #94a3b8; }

/* Password show/hide toggle */
.password-wrap {
  position: relative;
  width: 100%;
}
.password-wrap input[type="password"],
.password-wrap input[type="text"].password-visible {
  padding-right: 44px;
}
.password-toggle {
  position: absolute;
  right: 0;
  top: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 0 10px 10px 0;
  padding: 0;
}
.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--primary);
  outline: none;
}
.password-toggle svg {
  width: 20px;
  height: 20px;
  display: block;
}
.password-toggle[aria-pressed="true"] { color: var(--primary); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11,61,145,.15);
}

input:disabled, select:disabled, textarea:disabled {
  background: #f1f5f9;
  color: var(--muted);
  cursor: not-allowed;
}
.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  flex-wrap: wrap;
}

/* Alerts */
.alert {
  margin: 18px 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid;
  font-size: .95rem;
}
.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert-error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-warn    { background: #fffbeb; color: #92400e; border-color: #fde68a; }

/* Tables */
table.data {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
table.data th, table.data td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: .92rem;
}
table.data thead { background: #f1f5f9; }
table.data tbody tr:last-child td { border-bottom: 0; }
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-muted   { background: #e2e8f0; color: #334155; }

/* Captcha box — height-aligned with inputs/buttons (44px) */
.captcha-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.captcha-img {
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 6px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  user-select: none;
  -webkit-user-select: none;
}
.captcha-img svg { display: block; pointer-events: none; height: 36px; width: auto; }
.captcha-input {
  width: 120px;
  flex: 0 0 120px;
  text-align: center;
  letter-spacing: .1em;
  font-weight: 600;
}
.btn-reload {
  height: 44px;
  width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--muted);
}
.btn-reload:hover { color: var(--primary); border-color: var(--primary); }

/* Auth card */
.auth-wrap { display: grid; place-items: center; padding: 30px 0; }
.auth-card { max-width: 460px; width: 100%; }
.divider {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); margin: 16px 0; text-align: center;
}
.divider::before, .divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.oauth-buttons { display: grid; gap: 10px; }
.btn-oauth {
  width: 100%;
  background: #fff;
  border-color: var(--border);
}
.btn-oauth.btn-google { color: #1f2937; }
.btn-oauth.btn-apple { background: #000; color: #fff; border-color: #000; }
.btn-oauth.btn-apple:hover { background: #111; }

/* Calc page */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 20px;
}
.calc-tile {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 200px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s;
}
.calc-tile:hover { transform: translateY(-3px); }
.calc-tile h3 { margin: 0 0 8px; }
.calc-tile p { color: var(--muted); }
.calc-tile .btn { align-self: flex-start; margin-top: 14px; }

/* Results */
.steps { display: grid; gap: 14px; }
.step { background: #f8fafc; border-left: 4px solid var(--primary); padding: 14px 16px; border-radius: 8px; }
.step h4 { margin: 0 0 6px; color: var(--primary); }
.formula { font-family: "JetBrains Mono", "Fira Code", Menlo, monospace; background: #0f172a; color: #f8fafc; padding: 10px 12px; border-radius: 8px; font-size: .92rem; overflow-x: auto; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 14px; }
.result-item { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.result-item .label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.result-item .value { font-size: 1.15rem; font-weight: 700; }
.status-pill {
  display: inline-block; padding: 6px 14px; border-radius: 999px; font-weight: 700; letter-spacing: .04em;
}
.status-safe   { background: #dcfce7; color: #166534; }
.status-unsafe { background: #fee2e2; color: #991b1b; }

.chart-card { padding: 18px; }
.chart-card canvas { width: 100% !important; height: 320px !important; }

/* Footer */
.footer {
  background: #0f172a;
  color: #cbd5e1;
  padding: 18px 0 14px;
  margin-top: 28px;
  font-size: .88rem;
}
.footer .footer-brand { color: #fff; margin-bottom: 6px; }
.footer .footer-brand .brand-name { font-size: 1rem; }
.footer .footer-brand .brand-mark { font-size: 1.1rem; }
.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px 32px;
  align-items: start;
}
.footer-main { min-width: 0; }
.footer h4 { color: #fff; margin: 0 0 6px; font-size: .85rem; }
.footer-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.footer-list a { color: #cbd5e1; }
.footer-list a:hover { color: #fff; }
.footer-about {
  color: #94a3b8;
  margin: 0 0 6px;
  line-height: 1.45;
  font-size: .85rem;
  max-width: 42rem;
}
.footer-copy {
  margin: 0;
  color: #94a3b8;
  font-size: .8rem;
  line-height: 1.35;
}
.footer-copy small { font-size: inherit; }
.footer .lang-switch a { color: #cbd5e1; }
.footer .lang-switch a.active { color: #fff; }
.footer-lang-col { padding-top: 2px; }

@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr; gap: 14px; }
}
