/* ── Menu toggle button (matches .menu-icon-btn from React) ── */
.menu-toggle {
    background: transparent;
    border: none;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    color: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(14px, 3.5vw, 16px);
    width: 2.34em;
    height: 2.34em;
    -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
    .menu-toggle:hover { background: #222325; }
}
.menu-toggle:active { background: #292c31; }
.menu-toggle-bars {
    display: flex;
    flex-direction: column;
    gap: 0.4em;
}
.menu-toggle .bar {
    width: 1.25em;
    height: 0.125em;
    background-color: #f9fafb;
    border-radius: 1px;
}

/* ── Side menu panel ───────────────── */
/* em units used inside panel so sizes are relative to this
   element's font-size (matching React's rem-based layout). */
.side-menu {
    position: fixed;
    top: 0;
    right: -21em;
    width: 21em;
    height: 100dvh;
    background-color: #1f2937;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
    transition: right 0.3s ease-in-out;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    padding: 1em 1.25em 0;
    font-size: clamp(14px, 3.5vw, 16px);
    line-height: normal;
    direction: ltr;
}
.side-menu.open { right: 0; }

.side-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #374151;
    padding-bottom: 0.375em;
}
.side-menu-title {
    margin: 0;
    text-align: right;
    font-weight: 800;
    color: #f9fafb;
    font-size: 1.25em;
}
.menu-close-btn {
    background: transparent;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
    .menu-close-btn:hover { background: #374151; }
}
.menu-close-btn:active { background: #292c31; }

.side-menu-body {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 0.5em;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.side-menu-body::-webkit-scrollbar { display: none; }

.side-menu-item {
    background: none;
    border: none;
    padding: 0.57em 0.715em;
    text-align: right;
    cursor: pointer;
    border-radius: 8px;
    font-size: 1.05em;
    font-weight: 700;
    transition: background-color 0.2s ease;
    color: #f9a61d;
    text-decoration: none;
    display: block;
    font-family: inherit;
}
.side-menu-item:hover { background-color: #374151; }

.side-menu-divider {
    border-top: 1px solid #374151;
    margin: 0.667em 0.715em 0;
    width: 50%;
    align-self: flex-end;
}
.side-menu-section-title {
    font-size: 1.05em;
    font-weight: 700;
    color: #d1d5db;
    padding: 0.475em 0.715em 0.285em;
    margin-top: 0.38em;
    text-align: right;
    letter-spacing: 0.03em;
}

.side-menu-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15em;
    padding: 0.5em 0.75em;
    border-top: 1px solid #374151;
}
.side-menu-footer-row {
    display: flex;
    align-items: center;
    gap: 0.4em;
}
.side-menu-footer-item {
    background: none;
    border: none;
    padding: 0.2em 0;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 400;
    transition: color 0.2s ease;
    color: #9ca3af;
    text-decoration: none;
    font-family: inherit;
}
.side-menu-footer-item:hover { color: #f9fafb; }
.side-menu-footer-sep { color: #4b5563; }

.side-menu-promo {
    display: block;
    margin: 0.5em 0.715em;
    padding: 0.6em 0.715em;
    background: rgba(167,139,250,0.08);
    border: 1px dashed rgba(167,139,250,0.5);
    border-radius: 8px;
    font-size: 0.9em;
    color: #d1d5db;
    text-align: center;
    text-decoration: none;
}
.side-menu-promo span { color: #f9a61d; font-weight: 700; }
.side-menu-promo:hover { background: rgba(167,139,250,0.14); }

/* ── Overlay ───────────────────────── */
.side-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
}
.side-menu-overlay.open { display: block; }
/* ── Toolbar ──────────────────────── */
.toolbar {
    margin-top: -1.2rem;
    margin-bottom: 0;
    margin-right: -0.1em;
    display: flex;
    flex-direction: column;
    padding-bottom: 1rem;
}
.toolbar-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}
.toolbar .breadcrumb {
    display: block;
    font-size: 0.8rem;
    color: #9ca3af;
    margin: 0;
    min-width: 0;
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.toolbar .breadcrumb a, .toolbar .breadcrumb span { unicode-bidi: isolate; }
.toolbar .breadcrumb a { color: var(--link); text-decoration: none; }
.toolbar .breadcrumb a:hover { text-decoration: underline; }
.toolbar .breadcrumb .bc-sep { color: #9ca3af; margin: 0 0.2rem; }
.hero-updated {
    display: block;
    font-size: 0.75rem;
    color: #a1aabd;
    background: rgba(107,114,128,0.1);
    padding: 0.15rem 0.55rem;
    border-radius: 0.3rem;
    white-space: nowrap;
    text-align: end;
    margin-top: 0;
    width: fit-content;
    align-self: flex-end;
}
/* ── Related articles ────────────── */
.bp-related-articles { margin-top: 1rem; }
.bp-related-header { display: flex; align-items: center; justify-content: space-between; margin: 0 0 0.5rem; }
.bp-related-header h3 { font-size: 1.1rem; font-weight: 600; color: var(--text-bright); margin: 0; }
.bp-related-see-all { color: var(--accent); font-size: 0.85rem; font-weight: 700; text-decoration: none; white-space: nowrap; transition: opacity 0.2s; }
.bp-related-see-all:hover { opacity: 0.8; }
.bp-related-row { display: grid; grid-template-columns: repeat(2, 1fr); grid-auto-rows: 9rem; gap: 0.65rem; }
.bp-related-card { position: relative; border-radius: 0.75rem; overflow: hidden; cursor: pointer; text-decoration: none; border: 1px solid #374151; }
.bp-related-card:first-child { grid-row: span 2; }
.bp-related-card > img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.7s ease; }
.bp-related-card:hover > img { transform: scale(1.09); }
.bp-related-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 2.5rem 0.75rem 0.6rem; background: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0.85) 40%, rgba(0,0,0,0.5) 65%, rgba(0,0,0,0.15) 80%, transparent 100%); }
.bp-related-title { font-size: 0.82rem; font-weight: 700; color: #f9fafb; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bp-related-card:first-child .bp-related-title { font-size: 1rem; font-weight: 800; -webkit-line-clamp: 3; }
@media (max-width: 600px) {
    .bp-related-row { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 8rem; }
    .bp-related-card:first-child { grid-column: span 2; grid-row: span 1; }
}
.bp-related-card .bc-reviewer { margin-bottom: 0; margin-top: 0.3rem; }
.bp-related-card .bc-reviewer-pic { width: 18px !important; height: 18px !important; max-width: 18px; max-height: 18px; min-width: 18px; min-height: 18px; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--accent); margin-left: 0.3rem; flex-shrink: 0; }
.bc-reviewer { display: flex; align-items: center; flex-wrap: wrap; row-gap: 0.15rem; column-gap: 0; margin-bottom: 0.4rem; margin-top: 0.5rem; font-size: 0.78rem; color: #9ca3af; line-height: 1.4; }
.bc-reviewer-pic { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--accent); margin-left: 0.3rem; }
.bc-reviewer-label { color: var(--accent); font-weight: 700; margin-left: 0.25rem; }
.bc-reviewer-name { font-weight: 700; color: var(--text); }
.bc-reviewer-title { font-weight: bold; }
/* ═══════════════════════════════════════════════════════════════════
   Calculators Listing Page
   ═══════════════════════════════════════════════════════════════════ */

.calc-page { max-width: 72rem; margin: 0 auto; padding: 0.8rem 1.5rem 4rem; }
.calc-page .toolbar { margin-top: 0; }

/* ── Hero ─────────────────────────── */
.calc-hero { background: var(--surface); border-radius: 1rem; padding: 1.5rem; margin-bottom: 1.5rem; position: relative; overflow: hidden; text-align: center; }
.calc-hero::before { content: ""; position: absolute; inset: 0; border: 1px solid var(--border); border-radius: 1rem; pointer-events: none; }
.calc-site-logo { height: 5rem; width: auto; position: absolute; top: 1rem; left: 1rem; z-index: 1; }
.calc-site-logo-link { display: contents; }
.calc-hero h1 { margin: 0 0 0.35rem; font-size: 1.5rem; color: var(--text-bright); line-height: 1.3; }
.calc-hero-sub { font-size: 0.9rem; color: #9ca3af; margin-bottom: 0; }

/* ── Tags ─────────────────────────── */
.calc-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; padding: 0 0 1.5rem; }
.calc-tag { background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 0.4rem 1rem; border-radius: 2rem; cursor: pointer; font-size: 0.875rem; font-weight: 600; font-family: var(--font); transition: all 0.2s ease; }
.calc-tag:hover { background: #374151; border-color: #4b5563; color: var(--text-bright); }
.calc-tag--active { background: var(--accent); border-color: var(--accent); color: #141415; }
.calc-tag--active:hover { background: #e8950c; border-color: #e8950c; color: #141415; }

/* ── Card grid ────────────────────── */
.calc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1.5rem; padding-bottom: 3rem; }

.calc-card { background: var(--surface); border-radius: 1rem; overflow: hidden; cursor: pointer; transition: transform 0.25s ease, box-shadow 0.25s ease; border: 1px solid var(--border); }
@media (hover: hover) {
    .calc-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.4); border-color: #4b5563; }
}
.calc-card-link { display: block; text-decoration: none; color: inherit; -webkit-tap-highlight-color: transparent; }

.calc-card-icon-wrap { position: relative; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface); }
.calc-card-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.calc-card-tags-row { position: absolute; top: 0.75rem; right: 0.75rem; display: flex; gap: 0.4rem; flex-wrap: wrap; }
.calc-card-tag { background: rgba(249,166,29,0.9); color: #141415; padding: 0.2rem 0.65rem; border-radius: 1rem; font-size: 0.85rem; font-weight: 700; backdrop-filter: blur(4px); }

.calc-card-body { padding: 1rem 1.25rem 1.25rem; }
.calc-card-title { font-size: 1.1rem; font-weight: 800; margin: 0; line-height: 1.5; color: #f1f5f9; }
.calc-card-desc { font-size: 0.85rem; color: #9ca3af; margin: 0.4rem 0 0; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Emergency badge on card ──────── */
.calc-card--emergency { border-color: var(--border); }

/* ═══════════════════════════════════════════════════════════════════
   Calculator Step Page
   ═══════════════════════════════════════════════════════════════════ */

.calc-step-page { max-width: 40rem; margin: 0 auto; padding: 0.8rem 1.5rem 1rem; display: flex; flex-direction: column; min-height: 100dvh; }
.calc-step-page .toolbar { margin-top: 0; }
#calc-container { flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 0; }
.calc-step-page .disclaimer { margin-top: 2rem; }
.calc-page-title { font-size: 1.6rem; font-weight: 800; color: var(--text-bright); text-align: center; margin: 1rem 0 1.5rem; }

/* ── Progress dots ────────────────── */
.calc-progress { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-bottom: 2rem; }
.calc-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); transition: background 0.3s ease, transform 0.3s ease; }
.calc-dot--active { background: var(--accent); transform: scale(1.3); }
.calc-dot--done { background: var(--accent); opacity: 0.5; }

/* ── Step card ────────────────────── */
.calc-step-card { background: var(--surface); border: 1px solid var(--border); border-radius: 1rem; padding: 2rem 1.75rem; margin-bottom: 1.5rem; animation: fadeSlideIn 0.3s ease; }
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.calc-step-title { font-size: 1.3rem; font-weight: 800; color: var(--text-bright); margin: 0 0 0.5rem; line-height: 1.4; }
.calc-step-explain { font-size: 0.9rem; color: #9ca3af; margin: 0 0 1.5rem; line-height: 1.6; }

/* ── Input widgets ────────────────── */
.calc-input-group { margin-bottom: 1rem; }
.calc-input-label { display: block; font-size: 0.85rem; color: var(--text); margin-bottom: 0.4rem; font-weight: 600; }

.calc-number-input { width: 100%; padding: 0.75rem 1rem; background: var(--bg); border: 1px solid var(--border); border-radius: 0.75rem; color: var(--text-bright); font-size: 1.1rem; font-family: var(--font); transition: border-color 0.2s, box-shadow 0.2s; }
/* Hide number input spinners globally */
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.calc-number-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(249,166,29,0.2); }
.calc-number-input::placeholder { color: #6b7280; }
.calc-input-error { display: block; color: #f87171; font-size: 0.8rem; margin-top: 0.35rem; }

/* ── Select / option buttons ──────── */
.calc-options { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; }
.calc-options--column { flex-direction: column; align-items: stretch; }
.calc-options--column .calc-option-btn { text-align: center; }
.calc-option-btn { background: rgba(55,65,81,0.4); border: 1px solid var(--border); color: var(--text); padding: 0.6rem 1.2rem; border-radius: 0.75rem; cursor: pointer; font-size: 0.95rem; font-weight: 600; font-family: var(--font); transition: all 0.2s ease; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.calc-option-btn:hover { background: #374151; border-color: #4b5563; color: var(--text-bright); }
.calc-option-btn:active { background: var(--accent); border-color: var(--accent); color: #141415; }

/* ── Breed avatars inside option buttons ── */
.calc-option-avatars { display: flex; gap: 0.5rem; justify-content: center; }
.calc-option-avatar-wrap { width: 56px; height: 56px; border-radius: 50%; background: #fff; display: flex; align-items: flex-end; justify-content: center; flex-shrink: 0; overflow: hidden; }
.calc-option-avatar { width: 44px; height: 44px; border-radius: 0 0 50% 50%; object-fit: cover; flex-shrink: 0; }
.calc-option-label { text-align: center; }
.calc-option-sublabel { text-align: center; font-size: 0.8rem; font-weight: 400; color: #9ca3af; }


/* ── Navigation buttons ───────────── */
.calc-nav { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.calc-btn { flex: 1; padding: 0.75rem 1.5rem; border-radius: 0.75rem; font-size: 1rem; font-weight: 700; font-family: var(--font); cursor: pointer; transition: all 0.2s ease; border: none; }
.calc-btn--next { background: var(--accent); color: #141415; }
.calc-btn--next:hover { background: #e8950c; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(249,166,29,0.3); }
.calc-btn--next:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.calc-btn--back { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.calc-btn--back:hover { background: #374151; border-color: #4b5563; }

/* ═══════════════════════════════════════════════════════════════════
   Result Card
   ═══════════════════════════════════════════════════════════════════ */

.calc-result { background: var(--surface); border: 1px solid var(--border); border-radius: 1rem; padding: 2rem 1.75rem; animation: fadeSlideIn 0.3s ease; }

/* ── Result box (severity-colored) ── */
.calc-severity { padding: 1.5rem 1.75rem; border-radius: 0.75rem; margin-bottom: 1.25rem; text-align: center; }
.calc-result-title { font-size: 1.4rem; font-weight: 800; margin: 0 0 0.35rem; }
.calc-result-subtitle { font-size: 0.95rem; margin: 0; line-height: 1.5; }

.calc-severity--safe { background: rgba(5,150,105,0.15); border: 1px solid rgba(5,150,105,0.4); }
.calc-severity--safe .calc-result-title { color: #34d399; }
.calc-severity--safe .calc-result-subtitle { color: #6ee7b7; }

.calc-severity--mild { background: rgba(249,166,29,0.1); border: 1px solid rgba(249,166,29,0.3); }
.calc-severity--mild .calc-result-title { color: var(--accent); }
.calc-severity--mild .calc-result-subtitle { color: #fbbf24; }

.calc-severity--moderate { background: rgba(249,115,22,0.12); border: 1px solid rgba(249,115,22,0.35); }
.calc-severity--moderate .calc-result-title { color: #fb923c; }
.calc-severity--moderate .calc-result-subtitle { color: #fdba74; }

.calc-severity--severe { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.35); }
.calc-severity--emergency { border-color: #ef4444; }
.calc-severity--severe .calc-result-title { color: #f87171; }
.calc-severity--severe .calc-result-subtitle { color: #fca5a5; }

/* ── Emergency card ───────────────── */
.calc-emergency { background: rgba(239,68,68,0.12); border: 1.5px solid #ef4444; border-radius: 0.75rem; padding: 1.25rem; margin-bottom: 1.25rem; }
.calc-emergency-title { font-size: 1rem; font-weight: 800; color: #f87171; margin: 0 0 0.4rem; display: flex; align-items: center; gap: 0.4rem; }
.calc-emergency-text { font-size: 0.85rem; color: #fca5a5; margin: 0; line-height: 1.6; }

/* ── Dosage info ──────────────────── */
.calc-dosage { background: var(--bg); border: 1px solid var(--border); border-radius: 0.75rem; padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.calc-dosage-row { display: flex; justify-content: space-between; align-items: center; padding: 0.4rem 0; }
.calc-dosage-row + .calc-dosage-row { border-top: 1px solid var(--border); }
.calc-dosage-label { font-size: 0.85rem; color: #9ca3af; }
.calc-dosage-value { font-size: 0.95rem; font-weight: 700; color: var(--text-bright); }
.currency { font-family: Arial, sans-serif; font-size: 0.8em; unicode-bidi: embed; direction: ltr; }

/* ── Disclaimer ───────────────────── */
.calc-disclaimer { background: rgba(249,166,29,0.08); border: 1px solid rgba(249,166,29,0.25); border-radius: 0.75rem; padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.calc-disclaimer-title { font-size: 0.85rem; font-weight: 700; color: var(--accent); margin: 0 0 0.3rem; }
.calc-disclaimer-text { font-size: 0.8rem; color: #9ca3af; margin: 0; line-height: 1.6; }

/* ── Related article card ─────────── */
.calc-article-card { display: flex; gap: 1rem; background: var(--bg); border: 1px solid var(--border); border-radius: 0.75rem; padding: 1rem; text-decoration: none; color: inherit; transition: border-color 0.2s, transform 0.2s; margin-bottom: 1rem; }
.calc-article-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.calc-article-card-img { width: 80px; height: 80px; border-radius: 0.5rem; object-fit: cover; flex-shrink: 0; }
.calc-article-card-body { display: flex; flex-direction: column; justify-content: center; }
.calc-article-card-label { font-size: 0.7rem; color: var(--accent); font-weight: 700; text-transform: uppercase; margin-bottom: 0.2rem; }
.calc-article-card-title { font-size: 0.9rem; font-weight: 700; color: var(--text-bright); margin: 0; line-height: 1.4; }
.calc-article-card-desc { font-size: 0.78rem; color: #9ca3af; margin: 0.2rem 0 0; line-height: 1.4; }

/* ── Buddy CTA callout ──────────────────── */
.calc-callout { background: linear-gradient(135deg, #1a2535 0%, #1f2937 100%); border: 1.5px solid var(--accent); border-radius: 1rem; padding: 1.25rem 1.5rem; margin-top: 1.25rem; margin-bottom: 0.25rem; }
.calc-callout-body { display: flex; flex-direction: column; gap: 0.35rem; }
.calc-callout-title { font-size: 0.95rem; font-weight: 700; color: var(--text-bright); margin: 0; }
.calc-callout-text { font-size: 0.82rem; color: #9ca3af; margin: 0; line-height: 1.5; }
.calc-callout-cta { display: inline-block; background: var(--accent); color: #000; font-weight: 700; font-size: 0.85rem; padding: 0.45rem 1.2rem; border-radius: 0.5rem; text-decoration: none; font-family: var(--font); margin-top: 0.5rem; align-self: center; transition: transform 0.15s, box-shadow 0.15s; }
.calc-callout-cta:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(249,166,29,0.3); }

/* ── Restart button ───────────────── */
.calc-restart { display: block; width: 100%; padding: 0.75rem; background: var(--bg); border: 1px solid var(--border); border-radius: 0.75rem; color: var(--text); font-size: 0.9rem; font-weight: 600; font-family: var(--font); cursor: pointer; text-align: center; margin-top: 1.25rem; transition: all 0.2s; }
.calc-restart:hover { background: #374151; border-color: #4b5563; color: var(--text-bright); }

/* ── Mobile ───────────────────────── */
@media (max-width: 600px) {
    .calc-page { padding: 0.8rem 1rem 3rem; }
    .calc-hero { padding: 1.25rem 1rem; }
    .calc-site-logo-link { display: block; }
    .calc-site-logo { position: static;}
    .calc-hero h1 { font-size: 1.25rem; }
    .calc-grid { grid-template-columns: 1fr; gap: 1rem; }
    .calc-tags { padding: 0 0 1rem; }
    .calc-step-page { padding: 0.8rem 1rem 1rem; }
    .calc-step-card { padding: 1.5rem 1.25rem; }
    .calc-result { padding: 1.5rem 1.25rem; }
    .calc-article-card { flex-direction: column; }
    .calc-article-card-img { width: 100%; height: 120px; }
}
