:root {
    --primary: #1565c0;
    --primary-dark: #0d47a1;
    --primary-light: #e3f2fd;
    --primary-surface: #f5f9ff;
    --danger: #d32f2f;
    --danger-light: #fce4ec;
    --success: #2e7d32;
    --success-light: #e8f5e9;
    --warning: #e65100;
    --warning-light: #fff3e0;
    --info: #0277bd;
    --bg: #f4f6f9;
    --bg-card: #ffffff;
    --text: #212121;
    --text-secondary: #546e7a;
    --text-muted: #90a4ae;
    --border: #e0e4ea;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.1);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --transition: all 0.2s ease;
    --app-shadow: 0 0 30px rgba(0,0,0,0.06);
    --font: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
    --bottom-nav-height: 60px;
    --top-nav-height: 54px;
}

[data-theme="dark"] {
    --primary: #64b5f6;
    --primary-dark: #42a5f5;
    --primary-light: #1a2940;
    --primary-surface: #1a2740;
    --danger: #ef5350;
    --danger-light: #3e1a1a;
    --success: #66bb6a;
    --success-light: #1a3a1a;
    --warning: #ffa726;
    --warning-light: #3a2a1a;
    --info: #4fc3f7;
    --bg: #121318;
    --bg-card: #1e1f26;
    --text: #e4e6eb;
    --text-secondary: #9ea3b0;
    --text-muted: #6b7080;
    --border: #2e3038;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.4);
    --app-shadow: 0 0 40px rgba(255,255,255,0.025), 0 0 20px rgba(255,255,255,0.015);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; height: 100%; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    direction: rtl;
    height: 100vh; overflow: hidden;
    padding-top: var(--top-nav-height);
    padding-bottom: var(--bottom-nav-height);
    -webkit-tap-highlight-color: transparent;
    transition: background 0.35s ease;
}
a { color: var(--primary); text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; }
svg { display: inline-block; vertical-align: middle; }

/* ========== TOP NAVBAR ========== */
.top-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--top-nav-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px; direction: rtl;
    transition: max-width 0.35s ease, padding 0.35s ease,
                box-shadow 0.35s ease, border-radius 0.35s ease;
}
.top-nav-left { display: flex; align-items: center; gap: 4px; }
.top-nav-btn {
    width: 38px; height: 38px; border: none; background: transparent;
    border-radius: 10px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition); color: var(--text-secondary);
    touch-action: manipulation;
}
.top-nav-btn svg { width: 20px; height: 20px; }
.top-nav-btn:hover { background: var(--primary-surface); color: var(--primary); }
.top-nav-title { font-size: 19px; font-weight: 700; color: var(--text); }

/* ========== BOTTOM NAVBAR ========== */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    height: var(--bottom-nav-height);
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-around;
    padding: 0 8px; padding-bottom: env(safe-area-inset-bottom, 0);
    direction: rtl;
    transition: max-width 0.35s ease, padding 0.35s ease,
                box-shadow 0.35s ease, border-radius 0.35s ease;
}
.bottom-nav-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 4px 12px; border: none; background: transparent;
    cursor: pointer; color: var(--text-muted);
    transition: var(--transition); min-width: 56px; min-height: 48px;
    text-decoration: none; position: relative; border-radius: 8px;
    touch-action: manipulation;
}
.bottom-nav-item .nav-icon { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; }
.bottom-nav-item .nav-icon svg { width: 20px; height: 20px; }
.bottom-nav-item .nav-label { font-size: 14px; font-weight: 500; }
.bottom-nav-item:active { transform: scale(0.93); }
.bottom-nav-item.active { color: var(--primary); background: var(--primary-surface); }

/* ========== SIDE MENU ========== */
.side-menu-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45); z-index: 200;
    opacity: 0; visibility: hidden; transition: 0.3s ease;
}
.side-menu-overlay.open { opacity: 1; visibility: visible; }
.side-menu {
    position: fixed; top: 0; right: -300px; bottom: 0; width: 300px;
    background: var(--bg-card); z-index: 201; transition: 0.3s ease;
    padding: 0; display: flex; flex-direction: column;
}
.side-menu.open { right: 0; }
.side-menu-header {
    display: flex; align-items: center; gap: 14px;
    padding: 20px 20px 16px; margin: 0 0 8px;
    border-bottom: 1px solid var(--border);
}
.side-menu-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--primary-light); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 700;
}
.side-menu-user { font-size: 16px; line-height: 1.5; flex: 1; }
.side-menu-user strong { display: block; font-size: 18px; font-weight: 600; }
.side-menu-item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 20px; margin: 0 8px;
    border-radius: 10px; color: var(--text); font-size: 17px; font-weight: 500;
    transition: var(--transition); cursor: pointer; text-decoration: none;
    touch-action: manipulation;
}
.side-menu-item:hover { background: var(--primary-surface); color: var(--primary); }
.side-menu-item:active { transform: scale(0.97); }
.side-menu-divider { border: none; border-top: 1px solid var(--border); margin: 8px 16px; }

/* ========== PAGE CONTAINERS ========== */
.page { height: calc(100vh - var(--top-nav-height) - var(--bottom-nav-height)); overflow-y: auto; padding: 16px; transition: max-width 0.35s ease, padding 0.35s ease, box-shadow 0.35s ease, border-radius 0.35s ease; }
.page-center { display: flex; align-items: center; justify-content: center; flex-direction: column; }
.container { max-width: 480px; margin: 0 auto; padding: 0 16px; }

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 28px; border: none; border-radius: var(--radius);
    font-size: 17px; font-weight: 600; cursor: pointer;
    transition: var(--transition); text-align: center; min-height: 48px;
    touch-action: manipulation;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(21,101,192,0.25); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(21,101,192,0.35); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-surface); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--border-light, var(--bg)); color: var(--text); }
.btn-block { width: 100%; }
.btn-lg { padding: 18px 36px; font-size: 19px; }
.btn-round { border-radius: 50px; }
.btn-sm { padding: 12px 20px; font-size: 16px; min-height: 42px; }

/* ========== FORM ========== */
.form-group { margin-bottom: 12px; }
.form-label { display: block; font-size: 15px; font-weight: 600; margin-bottom: 4px; color: var(--text-secondary); }
.form-input, .form-select {
    width: 100%; padding: 12px 14px; border: 2px solid var(--border);
    border-radius: var(--radius); background: var(--bg-card); color: var(--text);
    font-size: 17px; transition: var(--transition); outline: none;
}
.form-input:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

/* ========== CARDS ========== */
.card {
    background: var(--bg-card); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px;
    touch-action: manipulation;
}
.card-clickable { cursor: pointer; transition: var(--transition); }
.card-clickable:active { transform: scale(0.98); }
@media (hover: hover) {
    .card-clickable:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
}

/* ========== WIZARD ========== */
.wizard-step { animation: slideIn 0.35s ease; }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.wizard-progress {
    display: flex; gap: 6px; justify-content: center; margin-bottom: 20px;
}
.wizard-dot {
    width: 10px; height: 10px; border-radius: 50%; background: var(--border);
    transition: var(--transition);
}
.wizard-dot.active { background: var(--primary); width: 24px; border-radius: 5px; }
.wizard-dot.done { background: var(--text-muted); }

/* ========== CLINICAL AVATAR ========== */
.clinical-container {
    text-align: center; padding: 16px 0; position: relative;
}
.clinical-avatar {
    width: 72px; height: 72px; margin: 0 auto 14px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(21,101,192,0.2);
    transition: var(--transition);
}
.clinical-avatar .avatar-icon {
    width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
    color: #fff;
}
.clinical-avatar .avatar-icon svg { width: 28px; height: 28px; }
.clinical-avatar.small .avatar-icon { width: 22px; height: 22px; }
.clinical-avatar.small .avatar-icon svg { width: 22px; height: 22px; }
.clinical-avatar.small { width: 56px; height: 56px; }
.clinical-avatar.small .avatar-icon { font-size: 22px; }
.clinical-avatar.ghost { background: var(--bg); box-shadow: none; border: 2px solid var(--border); }
.clinical-avatar.ghost .avatar-icon { color: var(--text-muted); }
.clinical-avatar.success { background: linear-gradient(135deg, var(--success-light), var(--success)); }
.clinical-avatar.success .avatar-icon { color: #fff; }

.clinical-speech {
    background: var(--bg-card); border: 2px solid var(--border);
    border-radius: var(--radius-lg); padding: 18px 24px; margin: 10px auto;
    max-width: 380px; position: relative; text-align: center;
    box-shadow: var(--shadow-sm);
}
.clinical-speech::before {
    content: ''; position: absolute; top: -10px; right: 50%;
    transform: translateX(50%); border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid var(--bg-card);
}
.clinical-speech .question-text {
    font-size: 19px; font-weight: 600; line-height: 1.7;
}
.clinical-thinking {
    display: flex; gap: 6px; justify-content: center; padding: 20px 0;
}
.clinical-thinking span {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--primary); animation: clinical-bounce 1.4s ease-in-out infinite;
}
.clinical-thinking span:nth-child(2) { animation-delay: 0.2s; }
.clinical-thinking span:nth-child(3) { animation-delay: 0.4s; }
@keyframes clinical-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}

/* ========== BODY MAP ========== */
.body-map-wrapper {
    display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.body-map-svg { width: 200px; height: auto; cursor: pointer; }
.body-map-svg path.region {
    fill: #e8d5c4; stroke: #8b7355; stroke-width: 1.5;
    transition: all 0.3s; cursor: pointer;
}
.body-map-svg path.region:hover { fill: var(--primary-light); stroke: var(--primary); }
.body-map-svg path.region.selected { fill: var(--primary); stroke: var(--primary-dark); }

.region-tabs { display: flex; gap: 4px; width: 100%; }
.region-tab {
    flex: 1; padding: 10px; text-align: center; border: none;
    background: var(--bg); border-radius: 10px 10px 0 0;
    cursor: pointer; font-size: 15px; font-weight: 500; color: var(--text-secondary);
    transition: var(--transition);
}
.region-tab.active { background: var(--bg-card); color: var(--primary); font-weight: 700; }

.region-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%;
}
.region-btn {
    padding: 14px 8px; border: 2px solid var(--border); border-radius: var(--radius);
    background: var(--bg-card); cursor: pointer; text-align: center;
    transition: var(--transition); font-size: 15px; font-weight: 500;
}
.region-btn:active { transform: scale(0.97); }
.region-btn:hover { border-color: var(--primary); }
.region-btn.selected { border-color: var(--primary); background: var(--primary); color: #fff; }
.region-btn .region-icon { font-size: 26px; display: block; margin-bottom: 4px; }

/* ========== ANSWER BUTTONS ========== */
.answer-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px;
}
.answer-btn {
    padding: 16px; border: 2px solid var(--border); border-radius: var(--radius);
    background: var(--bg-card); font-size: 17px; font-weight: 600; cursor: pointer;
    transition: var(--transition); text-align: center; min-height: 50px;
    color: var(--text);
}
.answer-btn:active { transform: scale(0.97); }
.answer-btn:hover { border-color: var(--primary); background: var(--primary-surface); }
.answer-btn.full { grid-column: 1 / -1; }
.answer-btn.answer-yes { color: var(--primary); border-color: var(--primary-light); }
.answer-btn.answer-yes:hover { border-color: var(--primary); background: var(--primary-surface); }
.answer-btn.answer-no { color: var(--text-secondary); }

/* ========== RESULT ========== */
.result-card {
    text-align: center; padding: 28px 20px;
    background: var(--bg-card); border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.result-disease { font-size: 28px; font-weight: 700; color: var(--primary); margin: 8px 0; }
.result-probability { font-size: 44px; font-weight: 700; color: var(--success); }
.stat-label { font-size: 16px; color: var(--text-secondary); font-weight: 600; }

.med-item {
    padding: 14px 16px; background: var(--bg); border-radius: var(--radius);
    border-right: 4px solid var(--primary); margin-bottom: 8px; text-align: right;
}
.med-item h4 { font-size: 17px; margin-bottom: 2px; }
.med-item .detail { font-size: 15px; color: var(--text-secondary); }

/* ========== BADGES ========== */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 14px; border-radius: 6px; font-size: 14px; font-weight: 600;
}
.badge-confirmed { background: var(--success-light); color: var(--success); }
.badge-probable { background: var(--warning-light); color: var(--warning); }
.badge-possible { background: var(--bg); color: var(--text-secondary); }
.badge-unlikely { background: var(--danger-light); color: var(--danger); }
.badge-rx { background: #fff3cd; color: #856404; }
.badge-otc { background: #d4edda; color: #155724; }
.badge-level-high { background: var(--success-light); color: var(--success); }
.badge-level-medium { background: var(--warning-light); color: var(--warning); }
.badge-level-low { background: var(--bg); color: var(--text-muted); }

/* ========== LOADING ========== */
.spinner { width: 26px; height: 26px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
.spinner-lg { width: 34px; height: 34px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45); display: flex; align-items: flex-end; justify-content: center;
    z-index: 300; animation: fadeIn 0.2s ease;
}
.modal-content {
    background: var(--bg-card); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    width: 100%; max-width: 500px; max-height: 85vh; overflow-y: auto;
    animation: slideUp 0.3s ease;
}
.modal-body { padding: 20px 24px 28px; }
.modal-handle { width: 36px; height: 4px; background: var(--border); border-radius: 2px; margin: 10px auto 12px; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ========== ALERTS ========== */
.alert { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 12px; font-size: 16px; line-height: 1.6; }
.alert-danger { background: var(--danger-light); color: var(--danger); border-right: 4px solid var(--danger); }
.alert-success { background: var(--success-light); color: var(--success); border-right: 4px solid var(--success); }
.alert-warning { background: var(--warning-light); color: var(--warning); border-right: 4px solid var(--warning); }
.alert-info { background: var(--primary-light); color: var(--primary); border-right: 4px solid var(--primary); }

/* ========== TOAST ========== */
.toast-container {
    position: fixed; top: 66px; left: 50%; transform: translateX(-50%); z-index: 999;
    display: flex; flex-direction: column; gap: 8px; align-items: center;
    pointer-events: none;
}
.toast {
    padding: 12px 24px; border-radius: 50px; font-size: 16px; font-weight: 500;
    box-shadow: var(--shadow-lg); animation: toastIn 0.3s ease;
    min-width: 200px; text-align: center; pointer-events: auto;
}
.toast-success { background: var(--success); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }
.toast-info { background: var(--primary); color: #fff; }
@keyframes toastIn { from { transform: translateY(-16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ========== EMPTY STATE ========== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .empty-icon { width: 48px; height: 48px; margin: 0 auto 10px; opacity: 0.35; display: flex; align-items: center; justify-content: center; }
.empty-state .empty-icon svg { width: 48px; height: 48px; }
.empty-state h3 { font-size: 18px; margin-bottom: 6px; color: var(--text-secondary); }
.empty-state p { font-size: 16px; }

/* ========== TYPOGRAPHY ========== */
h1 { font-size: 32px; font-weight: 700; line-height: 1.4; }
h2 { font-size: 28px; font-weight: 700; line-height: 1.4; }
h3 { font-size: 20px; font-weight: 600; line-height: 1.5; }
h4 { font-size: 18px; font-weight: 600; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-small { font-size: 16px; }
.text-xs { font-size: 14px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.ml-4 { margin-left: 4px; }
.mr-4 { margin-right: 4px; }
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }

/* ========== SELF/OTHER SELECTOR ========== */
.self-other-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.self-other-btn {
    padding: 22px; border: 2px solid var(--border); border-radius: var(--radius);
    background: var(--bg-card); cursor: pointer; text-align: center;
    transition: var(--transition);
}
.self-other-btn:active { transform: scale(0.97); }
.self-other-btn:hover, .self-other-btn.selected { border-color: var(--primary); background: var(--primary-surface); }
.self-other-btn .label { font-size: 19px; font-weight: 600; }
.self-other-btn .gender-icon { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; margin: 0 auto 4px; color: var(--text-secondary); }
.self-other-btn .gender-icon svg { width: 24px; height: 24px; }
.self-other-btn.selected .gender-icon { color: var(--primary); }
.gender-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; }
[data-theme="dark"] .gender-btn { color: var(--text-secondary); }
[data-theme="dark"] .gender-btn.selected { color: var(--primary); }

/* ========== PHONE INPUT ========== */
.phone-input-wrapper {
    display: flex; flex-direction: row; align-items: center;
    border: 2px solid var(--border); border-radius: var(--radius);
    background: var(--bg-card); direction: ltr;
}
.phone-input-wrapper:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.phone-prefix {
    padding: 10px 6px 10px 10px; background: var(--bg);
    font-size: 16px; font-weight: 600; color: var(--text-secondary);
    border-left: 1px solid var(--border);
    white-space: nowrap; flex-shrink: 0;
    line-height: 1.5;
}
.phone-input-wrapper input {
    flex: 1; padding: 10px 8px; border: none; outline: none;
    font-size: 16px; background: transparent; color: var(--text);
    direction: ltr; text-align: left; min-width: 0;
}

/* ========== DASHBOARD LIST ========== */
.history-item {
    padding: 16px; background: var(--bg-card); border-radius: var(--radius);
    box-shadow: var(--shadow); margin-bottom: 10px; cursor: pointer;
    transition: var(--transition);
}
.history-item:active { transform: scale(0.98); }
.history-item .disease { font-size: 18px; font-weight: 600; }
.history-item .meta { font-size: 15px; color: var(--text-secondary); margin-top: 4px; }

/* ========== PAGE-SPECIFIC OVERRIDES ========== */
.tab-bar { display: flex; gap: 4px; margin-bottom: 16px; background: var(--bg); border-radius: var(--radius); padding: 4px; }
.tab-btn { flex: 1; padding: 12px 16px; text-align: center; border: none; background: transparent; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; color: var(--text-secondary); transition: all 0.2s; }
.tab-btn.active { background: var(--bg-card); color: var(--primary); box-shadow: var(--shadow-sm); }
.search-box { position: relative; margin-bottom: 16px; }
.search-box input { width: 100%; padding: 16px 48px 16px 48px; border: 2px solid var(--border); border-radius: var(--radius); background: var(--bg-card); color: var(--text); font-size: 17px; outline: none; }
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.search-box .search-icon { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-muted); pointer-events: none; display: flex; align-items: center; justify-content: center; }
.search-box .search-icon svg { width: 18px; height: 18px; }
.search-box .clear-btn { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); background: none; border: none; width: 18px; height: 18px; cursor: pointer; color: var(--text-muted); padding: 0; display: none; align-items: center; justify-content: center; }
.search-box .clear-btn svg { width: 18px; height: 18px; }

.category-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { padding: 8px 16px; border: none; border-radius: 20px; cursor: pointer; font-size: 15px; font-weight: 500; background: var(--bg); color: var(--text-secondary); transition: all 0.2s; white-space: nowrap; }
.chip.active { background: var(--primary); color: #fff; }
.chip:hover { background: var(--primary-light); color: var(--primary); }

.criteria-level { font-size: 15px; padding: 3px 12px; border-radius: 6px; font-weight: 600; }

.evidence-item { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 16px; display: flex; justify-content: space-between; align-items: center; }
.safety-banner { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 12px; font-size: 16px; }
.safety-red { background: var(--danger-light); border-right: 4px solid var(--danger); }
.safety-orange { background: var(--warning-light); border-right: 4px solid var(--warning); }

.phase-steps { display: flex; gap: 4px; margin-bottom: 14px; justify-content: center; }
.phase-step { width: 28px; height: 4px; border-radius: 2px; background: var(--border); }
.phase-step.active { background: var(--primary); }
.phase-step.done { background: var(--text-muted); }

/* ========== RESPONSIVE / TABLET ========== */
@media (min-width: 768px) {
    body { background: var(--bg-card); }
    .top-nav {
        width: 100%; max-width: 700px; left: 50% !important; right: auto !important;
        transform: translateX(-50%);
        background: var(--bg-card);
        border-radius: 0;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--app-shadow);
    }
    .page {
        width: 100%; max-width: 700px; margin: 0 auto; padding: 24px;
        background: var(--bg-card);
        border-radius: 0;
        box-shadow: var(--app-shadow);
    }
    body { background: var(--bg-card); }
    .bottom-nav {
        width: 100%; max-width: 700px; left: 50% !important; right: auto !important;
        transform: translateX(-50%);
        background: var(--bg-card);
        border-radius: 0;
        border-top: 1px solid var(--border);
        box-shadow: var(--app-shadow);
    }
}

/* ========== PRINT ========== */
@media print { .top-nav, .bottom-nav, .side-menu, .side-menu-overlay, .no-print { display: none !important; } body { padding: 0; } }
