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

:root {
    --bg-dark: #0a0a0a;
    --glass-bg: rgba(25, 25, 25, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --danger: #ef4444;
    --ok: #22c55e;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
html, body { height: 100%; }
body { background-color: var(--bg-dark); color: var(--text-primary); min-height: 100vh; min-height: 100dvh; display: flex; justify-content: center; align-items: center; overflow: hidden; -webkit-tap-highlight-color: transparent; }

.aurora-bg {
    position: fixed; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.15), transparent 60%), radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.1), transparent 50%);
    animation: aurora 20s linear infinite; z-index: -1; pointer-events: none;
}
@keyframes aurora { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .aurora-bg { animation: none; } }

.glass { background: var(--glass-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--glass-border); }
.glass-inner { background: rgba(0, 0, 0, 0.3); border: 1px solid var(--glass-border); border-radius: 16px; padding: 16px; }
.app-container { width: 100%; max-width: 420px; height: 100vh; height: 100dvh; display: flex; flex-direction: column; position: relative; overflow: hidden; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); }
@media (min-width: 521px) { .app-container { height: 90vh; border-radius: 24px; } }
@media (max-width: 520px) { .app-container { position: fixed; top: 0; right: 0; bottom: 0; left: 0; height: auto; max-width: none; border: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; background: #121216; } }

.app-header { --safe-top: env(safe-area-inset-top, 0px); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; column-gap: 8px; padding: 22px 16px 16px; padding-top: max(22px, calc(var(--safe-top) + 18px)); text-align: center; position: relative; flex-shrink: 0; }
.brand-block { grid-column: 2; min-width: 0; }
.logo { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 24px; font-weight: 700; margin-bottom: 4px; background: linear-gradient(to right, #818cf8, #c084fc); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.logo h1 { font-size: inherit; }
.logo i { color: #818cf8; -webkit-text-fill-color: initial; }
.subtitle { color: var(--text-secondary); font-size: 13px; font-weight: 300; }
.install-chip { grid-column: 3; grid-row: 1; justify-self: end; background: rgba(99, 102, 241, 0.18); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.35); border-radius: 100px; padding: 6px 12px; font-size: 12px; font-weight: 600; cursor: pointer; display: flex; gap: 6px; align-items: center; }

.main-content { flex: 1; padding: 0 20px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.scanner-container { position: relative; flex-direction: column; overflow: hidden; display: flex; justify-content: center; align-items: center; min-height: 300px; padding: 0; flex-shrink: 0; }
#reader { width: 100%; border-radius: 12px; overflow: hidden; }
#reader { position: relative; }
.cam-video { display: block; width: 100%; height: 320px; object-fit: cover; border-radius: 12px; background: #000; }
/* Nişangâh: köşeler + tarama çizgisi (görüntü üstünde) */
.cam-frame { position: absolute; left: 50%; top: 50%; width: 78%; height: 58%; transform: translate(-50%, -50%); pointer-events: none; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.28); border-radius: 14px; }
.cam-frame span { position: absolute; width: 26px; height: 26px; border: 3px solid #fff; }
.cam-frame span:nth-child(1) { left: -2px; top: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; }
.cam-frame span:nth-child(2) { right: -2px; top: -2px; border-left: 0; border-bottom: 0; border-top-right-radius: 14px; }
.cam-frame span:nth-child(3) { left: -2px; bottom: -2px; border-right: 0; border-top: 0; border-bottom-left-radius: 14px; }
.cam-frame span:nth-child(4) { right: -2px; bottom: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }
.cam-laser { position: absolute; left: 6%; right: 6%; height: 2px; top: 50%; background: linear-gradient(90deg, transparent, #a78bfa, transparent); box-shadow: 0 0 10px #a78bfa; animation: camLaser 2.2s ease-in-out infinite; }
@keyframes camLaser { 0%, 100% { top: 12%; } 50% { top: 88%; } }
@media (prefers-reduced-motion: reduce) { .cam-laser { animation: none; } }
/* Okuyucu alanı hep yerleşik kalır (iPhone'da gizli alanda video oynatılmıyor); boşken kart üstte durur */
.scanner-idle { position: absolute; inset: 0; justify-content: center; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 32px 20px; text-align: center; color: var(--text-secondary); font-size: 14px; }
.scanner-idle > i { font-size: 42px; color: #818cf8; opacity: 0.8; }
.scanner-idle .btn-glass { flex: none; padding: 12px 22px; }
.scanner-idle.error p { color: #fca5a5; }
.scanner-tools { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 8px; z-index: 5; }
.tool-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.15); background: rgba(0,0,0,0.55); color: #fff; font-size: 16px; cursor: pointer; backdrop-filter: blur(8px); }
.tool-btn.on { background: #f59e0b; color: #111; border-color: #f59e0b; }

.controls { display: flex; gap: 12px; }
.btn-glass { flex: 1; padding: 14px; border-radius: 12px; border: 1px solid var(--glass-border); background: rgba(255, 255, 255, 0.05); color: var(--text-primary); font-size: 15px; font-weight: 500; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn-glass:hover { background: rgba(255, 255, 255, 0.1); }
.btn-glass:disabled { opacity: 0.5; cursor: default; }
.btn-glass.primary { background: var(--accent); border-color: var(--accent); }
.btn-glass.primary:hover { background: var(--accent-hover); }
.btn-glass.danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); border-color: rgba(239, 68, 68, 0.2); }
.btn-glass.danger.confirm { background: var(--danger); color: #fff; }
.btn-glass.small { flex: none; padding: 10px 14px; font-size: 13px; }

.result-box { animation: slideUp 0.3s ease-out; }
.result-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.result-header h3 { font-size: 15px; display: flex; align-items: center; gap: 6px; }
.result-header h3 i { color: #f59e0b; }
.badge { background: rgba(99, 102, 241, 0.2); color: #818cf8; padding: 4px 10px; border-radius: 100px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.result-details { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.result-details:empty { display: none; }
.detail-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.detail-row .k { color: var(--text-secondary); flex-shrink: 0; }
.detail-row .v { text-align: right; word-break: break-all; font-weight: 500; }
.result-content { background: rgba(255, 255, 255, 0.03); padding: 12px; border-radius: 8px; word-break: break-all; font-size: 14px; margin-bottom: 16px; color: #e5e7eb; max-height: 180px; overflow-y: auto; }
.result-content p { white-space: pre-wrap; }
.action-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.action-buttons .btn-glass { min-width: calc(50% - 4px); font-size: 14px; padding: 12px 10px; white-space: nowrap; }

.product-box { display: flex; gap: 12px; align-items: center; background: rgba(34, 197, 94, 0.06); border: 1px solid rgba(34, 197, 94, 0.2); border-radius: 12px; padding: 12px; margin-bottom: 16px; font-size: 14px; }
.product-box.muted { background: rgba(255,255,255,0.03); border-color: var(--glass-border); flex-direction: column; align-items: stretch; }
.product-box img { width: 56px; height: 56px; object-fit: contain; border-radius: 8px; background: #fff; flex-shrink: 0; }
.product-box .p-name { font-weight: 600; }
.product-box .p-meta { color: var(--text-secondary); font-size: 12px; margin-top: 2px; }
.product-box .p-src { color: var(--text-secondary); font-size: 11px; margin-top: 4px; }
.product-box form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.product-box input { width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--glass-border); background: rgba(0,0,0,0.35); color: var(--text-primary); font-size: 14px; }
.product-box input:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.2); border-top-color: #818cf8; border-radius: 50%; animation: spin 0.8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

.privacy-note { font-size: 11.5px; color: var(--text-secondary); line-height: 1.5; text-align: center; padding: 0 6px; opacity: 0.85; }
.privacy-note i { color: var(--ok); margin-right: 4px; }

.bottom-nav { display: flex; flex-shrink: 0; padding: 14px 20px 22px; padding-bottom: max(22px, calc(env(safe-area-inset-bottom, 0px) + 8px)); background: rgba(10, 10, 10, 0.8); backdrop-filter: blur(20px); border-top: 1px solid var(--glass-border); }
.nav-item { flex: 1; background: transparent; border: none; color: var(--text-secondary); display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; cursor: pointer; transition: color 0.2s; }
.nav-item i { font-size: 20px; }
.nav-item.active { color: var(--accent); }

.bottom-sheet { position: absolute; bottom: -100%; left: 0; width: 100%; height: 80%; border-radius: 24px 24px 0 0; padding: 20px; padding-bottom: max(20px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; transition: bottom 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.1); z-index: 100; background: rgba(18, 18, 20, 0.96); }
.bottom-sheet.open { bottom: 0; }
.sheet-drag-handle { width: 40px; height: 4px; background: var(--text-secondary); border-radius: 2px; margin: 0 auto 16px; opacity: 0.5; }
.sheet-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.sheet-header h2 { font-size: 20px; }
.btn-icon { background: transparent; border: none; color: var(--text-secondary); font-size: 20px; cursor: pointer; }
.sheet-content { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-bottom: 20px; scrollbar-width: none; }
.sheet-content::-webkit-scrollbar { display: none; }
.history-item { padding: 14px; border-radius: 12px; border-left: 3px solid var(--accent); position: relative; cursor: pointer; flex-shrink: 0; }
.history-item .type { font-size: 11px; color: var(--text-secondary); margin-bottom: 4px; }
.history-item .data { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 72px; }
.history-item .item-actions { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: flex; gap: 2px; }
.history-item .item-actions button { background: transparent; border: none; color: var(--text-secondary); cursor: pointer; padding: 8px; font-size: 14px; }
.history-item .item-actions button:hover { color: var(--text-primary); }
.empty-note { color: var(--text-secondary); text-align: center; margin-top: 20px; }
.sheet-footer { padding-top: 16px; border-top: 1px solid var(--glass-border); }

.toast { position: fixed; left: 50%; bottom: 110px; transform: translate(-50%, 20px); background: rgba(30, 30, 35, 0.96); color: var(--text-primary); border: 1px solid var(--glass-border); padding: 10px 16px; border-radius: 100px; font-size: 13px; opacity: 0; pointer-events: none; transition: all 0.25s; z-index: 1000; max-width: calc(100% - 32px); text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.hidden { display: none !important; }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Uygulamayı yükle penceresi ---------- */
.install-overlay { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, 0); transition: background 0.25s; padding: 0; }
.install-overlay.show { background: rgba(0, 0, 0, 0.6); }
.install-sheet { position: relative; width: 100%; max-width: 420px; background: #131317; border: 1px solid var(--glass-border); border-bottom: none; border-radius: 24px 24px 0 0; padding: 28px 22px; padding-bottom: max(22px, env(safe-area-inset-bottom)); text-align: center; transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.05); box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.5); max-height: 92dvh; overflow-y: auto; }
.install-overlay.show .install-sheet { transform: translateY(0); }
@media (min-width: 600px) {
    .install-overlay { align-items: center; padding: 16px; }
    .install-sheet { border-radius: 24px; border-bottom: 1px solid var(--glass-border); transform: translateY(24px) scale(0.98); opacity: 0; transition: transform 0.25s, opacity 0.25s; }
    .install-overlay.show .install-sheet { transform: none; opacity: 1; }
}
.install-close { position: absolute; top: 14px; right: 14px; }
.install-icon { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 10px 30px rgba(99, 102, 241, 0.35); margin-bottom: 14px; }
.install-sheet h2 { font-size: 21px; margin-bottom: 6px; }
.install-sub { color: var(--text-secondary); font-size: 14px; line-height: 1.5; margin-bottom: 18px; }
.install-perks { list-style: none; display: flex; flex-direction: column; gap: 10px; text-align: left; margin-bottom: 22px; }
.install-perks li { display: flex; align-items: center; gap: 12px; font-size: 14px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--glass-border); border-radius: 12px; padding: 11px 14px; }
.install-perks i { width: 18px; text-align: center; color: #a5b4fc; }
.install-steps { text-align: left; margin: 0 0 22px; padding: 0; list-style: none; counter-reset: adim; display: flex; flex-direction: column; gap: 10px; }
.install-steps li { counter-increment: adim; position: relative; padding: 12px 14px 12px 50px; font-size: 14px; line-height: 1.7; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--glass-border); border-radius: 12px; }
.install-steps li::before { content: counter(adim); position: absolute; left: 14px; top: 12px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.kbd { display: inline-flex; align-items: center; gap: 4px; background: rgba(99, 102, 241, 0.16); border: 1px solid rgba(99, 102, 241, 0.35); color: #c7d2fe; border-radius: 7px; padding: 1px 8px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.install-actions { display: flex; flex-direction: column; gap: 10px; }
.install-actions .btn-glass { flex: none; }
.install-actions .btn-glass:focus { outline: none; }
.install-actions .btn-glass:focus-visible { outline: 2px solid #a5b4fc; outline-offset: 2px; }

/* Yönetim düğmesi */
.admin-chip { grid-column: 1; grid-row: 1; justify-self: start; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--glass-border); text-decoration: none; font-size: 14px; }
.admin-chip:hover { color: #c7d2fe; border-color: rgba(99, 102, 241, 0.35); }

/* Seçilen resmin cihazdaki kopyası */
.result-image { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.result-image img { width: 100%; max-height: 220px; object-fit: contain; border-radius: 10px; background: rgba(0, 0, 0, 0.35); }
.result-image span { font-size: 11.5px; color: var(--text-secondary); }
.result-image span i { color: var(--ok); margin-right: 4px; }
.history-item.has-thumb { padding-left: 70px; min-height: 70px; }
.history-item .thumb { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; object-fit: cover; border-radius: 8px; background: rgba(0, 0, 0, 0.35); }

/* ---------- Güvenlik / uyarı paneli ---------- */
.result-alert { border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; font-size: 13px; line-height: 1.5; border: 1px solid; }
.result-alert.guvenli { background: rgba(34, 197, 94, 0.07); border-color: rgba(34, 197, 94, 0.3); }
.result-alert.dikkat { background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.35); }
.result-alert.tehlikeli { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.45); }
.result-alert.bilgi { background: rgba(99, 102, 241, 0.08); border-color: rgba(99, 102, 241, 0.3); }
.ra-title { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.result-alert.guvenli .ra-title { color: #86efac; }
.result-alert.dikkat .ra-title { color: #fcd34d; }
.result-alert.tehlikeli .ra-title { color: #fca5a5; }
.result-alert.bilgi .ra-title { color: #c7d2fe; }
.result-alert p { margin-top: 6px; color: var(--text-primary); }
.result-alert ul { margin: 8px 0 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.result-alert li.tehlikeli::marker { color: #f87171; }
.result-alert li.dikkat::marker { color: #fbbf24; }
.ra-host { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; padding: 8px 10px; background: rgba(0, 0, 0, 0.3); border-radius: 8px; }
.ra-host .k { color: var(--text-secondary); }
.ra-host b { font-size: 15px; word-break: break-all; text-align: right; }
.ra-target { font-size: 12px; color: var(--text-secondary); word-break: break-all; margin-top: 4px; }
.ra-good { margin-top: 6px; color: var(--text-secondary); font-size: 12px; }
.ra-sub { margin-top: 8px; font-size: 12.5px; }
.ra-sub.dikkat, .ra-sub.tehlikeli { color: #fcd34d; }
.ra-sub.bilgi { color: var(--text-primary); }
.ra-note { margin-top: 8px; font-size: 11px; color: var(--text-secondary); }
.ra-note i { color: var(--ok); }
.ra-expand { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.ra-expand .btn-glass { flex: none; align-self: flex-start; }
.ra-mini { font-size: 11px; color: var(--text-secondary); }
.btn-glass.small { flex: none; padding: 9px 12px; font-size: 13px; }
.btn-glass.danger-solid { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.5); color: #fecaca; }

/* ---------- İlaç kartı ---------- */
.product-box.drug { background: rgba(99, 102, 241, 0.07); border-color: rgba(99, 102, 241, 0.3); }
.drug-icon { width: 44px; height: 44px; border-radius: 10px; background: rgba(99, 102, 241, 0.18); color: #c7d2fe; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.skt-chip { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 100px; white-space: nowrap; border: 1px solid; }
.skt-chip.gecmis { color: #fecaca; background: rgba(239, 68, 68, 0.18); border-color: rgba(239, 68, 68, 0.5); }
.skt-chip.yakin { color: #fde68a; background: rgba(245, 158, 11, 0.15); border-color: rgba(245, 158, 11, 0.45); }
.skt-chip.yaklasiyor { color: #fde68a; background: transparent; border-color: rgba(245, 158, 11, 0.3); }
.skt-chip.iyi { color: #86efac; background: transparent; border-color: rgba(34, 197, 94, 0.35); }
.skt-chip.yok { color: var(--text-secondary); border-color: var(--glass-border); }

/* ---------- Alt menü rozeti ---------- */
.nav-icon { position: relative; display: inline-flex; }
.nav-badge { position: absolute; top: -6px; right: -12px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 100px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; font-style: normal; }

/* ---------- Ana ekran dolap uyarısı ---------- */
.cab-banner { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 12px 14px; border-radius: 12px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid; color: var(--text-primary); }
.cab-banner span { flex: 1; }
.cab-banner.gecmis { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.45); }
.cab-banner.gecmis i:first-child { color: #f87171; }
.cab-banner.yakin { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.4); }
.cab-banner.yakin i:first-child { color: #fbbf24; }

/* ---------- İlaç Dolabı ---------- */
.cab-form { display: flex; flex-direction: column; gap: 10px; padding: 14px; margin-bottom: 12px; border-radius: 14px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--glass-border); }
.cab-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.cab-form input { width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--glass-border); background: rgba(0, 0, 0, 0.35); color: var(--text-primary); font-size: 14px; color-scheme: dark; }
.cab-form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.sug-box { display: flex; flex-direction: column; gap: 4px; margin-top: -4px; }
.sug-box:empty { display: none; }
.sug { text-align: left; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--glass-border); background: rgba(255, 255, 255, 0.04); color: var(--text-primary); font-size: 12px; cursor: pointer; }
.med-item { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--glass-border); border-left: 3px solid var(--glass-border); cursor: pointer; flex-shrink: 0; }
.med-item.gecmis { border-left-color: #ef4444; }
.med-item.yakin { border-left-color: #f59e0b; }
.med-item.yaklasiyor { border-left-color: rgba(245, 158, 11, 0.5); }
.med-item.iyi { border-left-color: #22c55e; }
.med-main { flex: 1; min-width: 0; }
.med-name { font-size: 14px; font-weight: 600; line-height: 1.35; }
.med-meta { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }
.med-details { font-size: 12px; color: var(--text-secondary); margin-top: 8px; display: flex; flex-direction: column; gap: 3px; word-break: break-all; }
.med-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.med-del { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 13px; padding: 4px; }
.med-del.armed { color: #fca5a5; font-weight: 700; }
.empty-cab { text-align: center; color: var(--text-secondary); padding: 30px 16px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.empty-cab > i { font-size: 34px; color: #818cf8; opacity: 0.8; }
.empty-cab .small { font-size: 12.5px; line-height: 1.5; }
.cab-note { font-size: 11px; color: var(--text-secondary); line-height: 1.5; padding-top: 10px; border-top: 1px solid var(--glass-border); }
.cab-note i { color: var(--ok); margin-right: 4px; }

/* ---------- İmza: code by dagasan ---------- */
.signature { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 0 4px; flex-shrink: 0; user-select: none; }
.sig-line { width: 64px; height: 1px; background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.55), transparent); }
.sig-svg { display: block; height: 32px; width: auto; overflow: visible; opacity: 0.92; filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.22)); transition: filter 0.3s, opacity 0.3s; }
.signature:hover .sig-svg { opacity: 1; filter: drop-shadow(0 0 14px rgba(167, 139, 250, 0.45)); }
/* "Yazılıyor" animasyonu: soldan sağa açılır, ardından alt kuyruk çizilir */
.signature.bekle .sig-svg { clip-path: inset(-20% 100% -20% 0); }
.signature.bekle .sig-swoosh { stroke-dasharray: 1; stroke-dashoffset: 1; }
.signature.yaz .sig-svg { animation: imzaYaz 1.7s cubic-bezier(0.55, 0.1, 0.35, 1) forwards; }
.signature.yaz .sig-swoosh { stroke-dasharray: 1; stroke-dashoffset: 1; animation: imzaKuyruk 0.7s ease-out 1.45s forwards; }
@keyframes imzaYaz { from { clip-path: inset(-20% 100% -20% 0); } to { clip-path: inset(-20% -5% -20% 0); } }
@keyframes imzaKuyruk { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
    .signature.bekle .sig-svg, .signature.yaz .sig-svg { clip-path: none; animation: none; }
    .signature.bekle .sig-swoosh, .signature.yaz .sig-swoosh { stroke-dashoffset: 0; animation: none; }
}

/* ---------- İlaç Dolabı: ergonomik düzen (kaydırmasız araçlar, tek kaydırma alanı) ---------- */
#cabinet-sheet { height: 88%; padding-bottom: 0; }
.cab-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 12px; padding-bottom: max(16px, env(safe-area-inset-bottom)); margin: 0 -4px; padding-left: 4px; padding-right: 4px; }
.cab-tools { display: flex; flex-direction: column; gap: 10px; }
.cab-primary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cab-primary .btn-glass { padding: 12px 10px; font-size: 14px; }
.cab-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cab-tool { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 64px; padding: 10px 4px; border-radius: 12px; border: 1px solid var(--glass-border); background: rgba(255, 255, 255, 0.04); color: var(--text-primary); font-size: 11.5px; font-weight: 600; line-height: 1.2; text-align: center; cursor: pointer; transition: background 0.15s, border-color 0.15s, transform 0.1s; }
.cab-tool i { font-size: 17px; color: #a5b4fc; }
.cab-tool:hover { background: rgba(99, 102, 241, 0.12); border-color: rgba(99, 102, 241, 0.35); }
.cab-tool:active { transform: scale(0.97); }
.cab-tool:focus-visible, .sum-chip:focus-visible, .cab-primary .btn-glass:focus-visible { outline: 2px solid #a5b4fc; outline-offset: 2px; }
.cab-summary { display: flex; gap: 6px; flex-wrap: wrap; position: sticky; top: 0; z-index: 2; padding: 8px 0; background: #121214; box-shadow: 0 10px 12px -10px rgba(0, 0, 0, 0.8); }
.sum-chip { font-size: 12px; padding: 7px 12px; border-radius: 100px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--glass-border); color: var(--text-secondary); cursor: pointer; font-weight: 500; }
.sum-chip b { color: var(--text-primary); font-size: 13px; }
.sum-chip.zero:not(.tumu) { opacity: 0.45; cursor: default; }
.sum-chip.gecmis:not(.zero) { border-color: rgba(239, 68, 68, 0.5); color: #fecaca; }
.sum-chip.yakin:not(.zero) { border-color: rgba(245, 158, 11, 0.45); color: #fde68a; }
.sum-chip.active { background: rgba(99, 102, 241, 0.2); border-color: rgba(99, 102, 241, 0.6); color: #e0e7ff; }
.sum-chip.gecmis.active { background: rgba(239, 68, 68, 0.2); }
.sum-chip.yakin.active { background: rgba(245, 158, 11, 0.18); }
.cab-list { display: flex; flex-direction: column; gap: 10px; }
.cab-form { margin-bottom: 0; }
@media (max-width: 360px) { .cab-grid { grid-template-columns: repeat(2, 1fr); } }

/* Paneller: arka perde, tutamaçtan çekme, masaüstünde görünür kaydırma çubuğu */
.sheet-backdrop { position: absolute; inset: 0; z-index: 90; background: rgba(0, 0, 0, 0.45); opacity: 0; pointer-events: none; transition: opacity 0.25s; }
.sheet-backdrop.show { opacity: 1; pointer-events: auto; }
.sheet-drag-handle, .sheet-header { touch-action: none; }
.sheet-drag-handle { cursor: grab; padding: 6px 0; margin-top: -6px; background-clip: content-box; height: 16px; }
@media (hover: hover) and (pointer: fine) {
    .cab-body, .sheet-content, .main-content { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent; }
    .cab-body::-webkit-scrollbar, .sheet-content::-webkit-scrollbar, .main-content::-webkit-scrollbar { display: block; width: 8px; }
    .cab-body::-webkit-scrollbar-thumb, .sheet-content::-webkit-scrollbar-thumb, .main-content::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 8px; }
    .sheet-drag-handle { display: none; }
}

/* Kamera: görüntü gelmezse dokunma düğmesi; telefonda fotoğrafla okuma */
.play-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 6; display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 100px; border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(0, 0, 0, 0.75); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; }
.photo-btn { display: none; }
@media (pointer: coarse) { .photo-btn { display: flex; } }

.build-tag { font-size: 10px; color: var(--text-secondary); opacity: 0.55; letter-spacing: 0.3px; }
.build-tag b { font-weight: 600; }

/* Canlı durum, yakınlaştırma ve tanı paneli */
.scan-status { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 5; max-width: calc(100% - 20px); padding: 6px 12px; border-radius: 100px; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: rgba(0, 0, 0, 0.6); color: #e5e7eb; border: 1px solid rgba(255, 255, 255, 0.15); backdrop-filter: blur(6px); }
.scan-status.ara::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #a78bfa; margin-right: 7px; vertical-align: 1px; animation: nabiz 1.2s ease-in-out infinite; }
.scan-status.ipucu { background: rgba(120, 80, 0, 0.75); color: #fde68a; border-color: rgba(245, 158, 11, 0.5); white-space: normal; text-align: center; }
.scan-status.uyari { background: rgba(127, 29, 29, 0.8); color: #fecaca; }
.scan-status.ok { background: rgba(20, 83, 45, 0.85); color: #bbf7d0; border-color: rgba(34, 197, 94, 0.5); }
@keyframes nabiz { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
.tool-btn.zoom { font-size: 13px; font-weight: 700; }
.diag { position: absolute; top: 44px; left: 8px; right: 8px; z-index: 7; max-height: 70%; overflow: auto; padding: 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.82); border: 1px solid rgba(255, 255, 255, 0.15); font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace; color: #d1d5db; word-break: break-all; }
.diag b { color: #a5b4fc; }
.diag-copy { margin-top: 6px; padding: 6px 10px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.08); color: #fff; font-size: 12px; cursor: pointer; }
.build-tag { cursor: pointer; padding: 6px 10px; }
