* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  /* Tema CONSOLE DARK — tecnológico, acento azul MedTech */
  --bg: #FAFAF8;
  --bg-2: #F1F1EC;
  --surface: #FFFFFF;
  --surface-2: #F1F1EC;
  --border: #E8E8E2;
  --border-2: #DDDDD5;
  --text: #23272E;
  --text-dim: #5E646B;
  --text-faint: #767C84;
  --accent: #4166D6;
  --accent-2: #3351AB;
  --accent-grad: linear-gradient(135deg, #4166D6 0%, #3351AB 100%);
  --glow: rgba(65,102,214,.42);
  --success: #1D7A46;
  --warning: #A3730A;
  --danger: #C6453D;
}
html { color-scheme: light; }
html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: var(--text); min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
body { background-color: #FAFAF8; background-image: radial-gradient(1100px 460px at 84% -10%, rgba(65,102,214,.12), transparent 60%), radial-gradient(840px 460px at 4% 110%, rgba(14,138,99,.06), transparent 55%), linear-gradient(rgba(140,160,185,.032) 1px, transparent 1px), linear-gradient(90deg, rgba(140,160,185,.032) 1px, transparent 1px); background-size: auto, auto, 34px 34px, 34px 34px; background-attachment: fixed; }
button { cursor: pointer; border: none; background: none; color: inherit; font-family: inherit; }
input, textarea, select { font-family: inherit; outline: none; }
h1, h2, h3, h4, h5 { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; }

.app { min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); }
.hidden { display: none !important; }

/* ===== Landing page (light clínico) ===== */
.landing {
  --land-bg: #FAFAF8;
  --land-bg-2: #F1F1EC;
  --land-surface: #FFFFFF;
  --land-border: #E8E8E2;
  --land-text: #23272E;
  --land-text-dim: #5E646B;
  --land-text-faint: #767C84;
  --land-blue: #4166D6;
  --land-blue-2: #3351AB;
  --land-blue-soft: rgba(65,102,214,.12);
  --land-grad: linear-gradient(135deg, #4166D6 0%, #3351AB 100%);
  background: var(--land-bg); color: var(--land-text);
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.landing a { color: var(--land-blue); text-decoration: none; }
.landing a:hover { text-decoration: underline; }

/* Topnav */
.land-nav {
  position: sticky; top: 0; z-index: 30;
  background: rgba(250, 250, 248, 0.82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--land-border);
  padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.land-brand { display: flex; align-items: center; gap: 10px; font-size: 20px; color: var(--land-text); }
.land-brand-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--land-grad); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.land-brand-text {
  font-family: 'Inter', -apple-system, sans-serif;
  font-weight: 800; letter-spacing: -1.2px;
  color: var(--land-text);
  line-height: 1;
}
.land-footer-wordmark {
  font-family: 'Inter', -apple-system, sans-serif;
  font-weight: 800; letter-spacing: -1px;
  color: var(--land-text);
}
.land-nav-actions { display: flex; gap: 10px; align-items: center; }
/* mobile/tablet: os 2 botões amassavam o logo (clipava ~700–760px); some o secundário e enxuga paddings */
@media (max-width: 760px) {
  .land-nav-actions #land-register { display: none; }
  .land-btn { padding: 9px 14px; }
  .land-nav { padding: 12px 16px; }
}
.land-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 8px; font-weight: 600; font-size: 14px; transition: all 0.15s; border: 1px solid transparent; font-family: inherit; cursor: pointer; }
.land-btn-primary { background: var(--land-grad); color: white; box-shadow: 0 4px 12px -2px rgba(65,102,214, 0.3); }
.land-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -4px rgba(65,102,214, 0.4); }
.land-btn-secondary { background: var(--land-surface); color: var(--land-text); border-color: var(--land-border); }
.land-btn-secondary:hover { border-color: var(--land-blue); color: var(--land-blue); }
.land-btn-lg { padding: 14px 26px; font-size: 15px; }

/* Hero */
.land-hero {
  padding: 80px 24px 60px;
  text-align: center;
  background: radial-gradient(ellipse at top, rgba(65,102,214, 0.08), transparent 60%), radial-gradient(ellipse at bottom, rgba(65,102,214, 0.05), transparent 60%);
}
.land-hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; background: var(--land-blue-soft); border-radius: 999px;
  color: var(--land-blue); font-size: 12px; font-weight: 600; margin-bottom: 20px;
}
.land-hero h1 {
  font-size: clamp(32px, 5vw, 54px); font-weight: 800;
  letter-spacing: -1.5px; line-height: 1.1; margin: 0 auto 18px;
  max-width: 800px; color: var(--land-text);
}
.land-hero h1 .grad { color: var(--land-blue); }
.land-hero p.lead {
  font-size: clamp(15px, 2vw, 18px); color: var(--land-text-dim);
  max-width: 620px; margin: 0 auto 32px; line-height: 1.6;
}
.land-hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.land-hero-note { font-size: 12px; color: var(--land-text-faint); margin-top: 14px; }
.land-hero-mock {
  margin: 56px auto 0; max-width: 760px;
  background: var(--land-surface); border-radius: 18px;
  border: 1px solid var(--land-border); box-shadow: 0 20px 60px -20px rgba(65,102,214, 0.25);
  padding: 18px; text-align: left;
}
.land-mock-header { display: flex; gap: 6px; margin-bottom: 14px; }
.land-mock-header span { width: 10px; height: 10px; border-radius: 50%; background: #e2e8f0; }
.land-mock-content { background: var(--land-bg-2); border-radius: 10px; padding: 18px; font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace; font-size: 12px; color: var(--land-text-dim); line-height: 1.7; }
.land-mock-content strong { color: var(--land-blue); }

/* Section base */
.land-section { padding: 80px 24px; max-width: 1200px; margin: 0 auto; }
.land-section h2 { font-size: clamp(26px, 3.5vw, 36px); font-weight: 800; text-align: center; letter-spacing: -1px; margin-bottom: 14px; color: var(--land-text); }
.land-section .land-section-sub { font-size: 16px; color: var(--land-text-dim); text-align: center; max-width: 580px; margin: 0 auto 50px; line-height: 1.6; }

/* How it works */
.land-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 900px) { .land-steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .land-steps { grid-template-columns: 1fr; } }
.land-step {
  background: var(--land-bg-2); border: 1px solid var(--land-border);
  border-radius: 14px; padding: 24px; text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.land-step:hover { transform: translateY(-4px); box-shadow: 0 12px 24px -8px rgba(65,102,214, 0.15); border-color: var(--land-blue-2); }
.land-step-num {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--land-grad); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; margin: 0 auto 14px;
}
.land-step-icon { font-size: 32px; margin-bottom: 12px; }
.land-step h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; color: var(--land-text); }
.land-step p { font-size: 13px; color: var(--land-text-dim); line-height: 1.5; }

/* Tipos de exame */
.land-exams { background: var(--land-bg-2); }
.land-exams-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 800px) { .land-exams-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .land-exams-grid { grid-template-columns: 1fr; } }
.land-exam-card {
  background: var(--land-surface); border: 1px solid var(--land-border);
  border-radius: 12px; padding: 20px;
  display: flex; align-items: flex-start; gap: 14px;
  transition: all 0.2s;
}
.land-exam-card:hover { border-color: var(--land-blue-2); box-shadow: 0 8px 16px -4px rgba(65,102,214, 0.1); }
.land-exam-icon { font-size: 28px; flex-shrink: 0; }
.land-exam-card h4 { font-size: 15px; font-weight: 700; margin-bottom: 4px; color: var(--land-text); }
.land-exam-card p { font-size: 13px; color: var(--land-text-dim); line-height: 1.5; }

/* Pricing */
.land-pricing { text-align: center; }
.land-price-card {
  background: var(--land-surface); border: 2px solid var(--land-blue);
  border-radius: 20px; padding: 40px 30px;
  max-width: 420px; margin: 0 auto;
  box-shadow: 0 24px 60px -20px rgba(65,102,214, 0.3);
  position: relative;
}
.land-price-badge { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: var(--land-grad); color: white; font-size: 11px; font-weight: 700; padding: 5px 14px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.5px; }
.land-price-name { font-size: 18px; font-weight: 700; color: var(--land-text); margin-bottom: 10px; }
.land-price-value { font-size: 48px; font-weight: 800; color: var(--land-text); letter-spacing: -2px; }
.land-price-value .currency { font-size: 24px; vertical-align: top; }
.land-price-value .period { font-size: 16px; font-weight: 500; color: var(--land-text-dim); }
.land-price-features { list-style: none; padding: 0; margin: 24px 0; text-align: left; }
.land-price-features li { padding: 8px 0; font-size: 14px; color: var(--land-text); display: flex; align-items: flex-start; gap: 10px; }
.land-price-features li::before { content: "✓"; color: var(--land-blue); font-weight: 700; flex-shrink: 0; }
.land-price-trial { font-size: 13px; color: var(--land-text-dim); margin-top: 14px; }

/* FAQ */
.land-faq-grid { max-width: 760px; margin: 0 auto; }
.land-faq-item {
  background: var(--land-surface); border: 1px solid var(--land-border);
  border-radius: 12px; padding: 18px 22px; margin-bottom: 10px;
  cursor: pointer; transition: all 0.2s;
}
.land-faq-item summary { font-weight: 600; font-size: 15px; color: var(--land-text); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.land-faq-item summary::-webkit-details-marker { display: none; }
.land-faq-item summary::after { content: "+"; font-size: 22px; color: var(--land-blue); transition: transform 0.2s; }
.land-faq-item[open] summary::after { transform: rotate(45deg); }
.land-faq-item p { font-size: 14px; color: var(--land-text-dim); line-height: 1.7; margin-top: 12px; }
.land-faq-item:hover { border-color: var(--land-blue-2); }

/* CTA final */
.land-cta {
  background: var(--land-grad); color: white; text-align: center;
  padding: 70px 24px; border-radius: 20px; margin: 40px 24px;
  position: relative; overflow: hidden;
}
.land-cta::before { content: ''; position: absolute; top: -50%; right: -10%; width: 400px; height: 400px; background: rgba(255,255,255,0.1); border-radius: 50%; }
.land-cta h2 { font-size: clamp(24px, 3.5vw, 34px); font-weight: 800; margin-bottom: 12px; color: white; letter-spacing: -1px; position: relative; }
.land-cta p { font-size: 16px; opacity: 0.95; margin-bottom: 24px; position: relative; }
.land-cta .land-btn { background: white; color: var(--land-blue); border-color: white; position: relative; }
.land-cta .land-btn:hover { background: rgba(255,255,255,0.95); transform: translateY(-1px); box-shadow: 0 12px 32px -8px rgba(0,0,0,0.2); }

/* Footer */
.land-footer { background: #F1F1EC; color: #5E646B; padding: 50px 24px 30px; border-top: 1px solid var(--land-border); }
.land-footer-content { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
@media (max-width: 700px) { .land-footer-content { grid-template-columns: 1fr; } }
.land-footer h5 { color: #23272E; font-size: 14px; font-weight: 700; margin-bottom: 14px; }
.land-footer ul { list-style: none; padding: 0; }
.land-footer li { padding: 5px 0; font-size: 13px; }
.land-footer a { color: #5E646B; text-decoration: none; }
.land-footer a:hover { color: #23272E; }
.land-footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: #23272E; margin-bottom: 12px; }
.land-footer-tagline { font-size: 13px; color: #5E646B; line-height: 1.6; margin-bottom: 14px; max-width: 320px; }
.land-footer-disclaimer { background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.3); border-radius: 8px; padding: 12px 14px; font-size: 11px; color: #7E5708; line-height: 1.5; margin-top: 18px; }
.land-footer-bottom { max-width: 1200px; margin: 36px auto 0; padding-top: 24px; border-top: 1px solid #E5E5DF; font-size: 12px; color: #5E646B; text-align: center; }

/* ===== Auth screen ===== */
.auth-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-brand { text-align: center; margin-bottom: 28px; }
.auth-brand .logo-big {
  width: 72px; height: 72px; border-radius: 20px; background: var(--accent-grad);
  display: inline-flex; align-items: center; justify-content: center; color: white;
  box-shadow: 0 16px 40px -12px rgba(15, 23, 42, 0.5); margin-bottom: 14px;
}
.auth-brand h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; }
.auth-brand p { font-size: 13px; color: var(--text-faint); margin-top: 4px; }
.auth-form { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 24px; }
.auth-form h2 { font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.auth-form input { width: 100%; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; color: var(--text); font-size: 14px; margin-bottom: 12px; }
.auth-form input:focus { border-color: var(--accent); }
.auth-form .auth-error { color: var(--danger); font-size: 13px; margin-bottom: 12px; min-height: 18px; }
.auth-form .primary { width: 100%; background: var(--accent-grad); color: white; padding: 13px; border-radius: 10px; font-weight: 600; font-size: 14px; box-shadow: 0 8px 24px -10px rgba(15, 23, 42, 0.5); }
.auth-form .primary:hover { transform: translateY(-1px); }
.auth-form .primary:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-form .link { display: block; width: 100%; text-align: center; color: var(--accent); padding: 12px 0 0; font-size: 13px; }
.auth-form .link:hover { text-decoration: underline; }

/* ===== Topbar ===== */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(10, 14, 20, 0.72); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px; padding-top: calc(14px + env(safe-area-inset-top));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-grad); display: flex; align-items: center; justify-content: center; color: white; box-shadow: 0 8px 24px -8px rgba(15, 23, 42, 0.6); }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -0.2px; }
.brand-wordmark {
  font-family: 'Inter', -apple-system, sans-serif;
  font-weight: 800; letter-spacing: -0.8px; font-size: 18px;
  color: var(--text);
  line-height: 1.1;
}
.brand-sub { font-size: 11px; color: var(--text-faint); margin-top: -2px; }
.top-actions { display: flex; gap: 8px; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--text-dim); transition: all 0.15s; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-2); }
.subscription-badge { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; font-size: 12px; font-weight: 600; color: var(--text-dim); cursor: pointer; transition: all 0.15s; }
.subscription-badge:hover { background: var(--surface-2); border-color: var(--border-2); color: var(--text); }
.subscription-badge .sub-icon { font-size: 14px; }
.subscription-badge.pro { color: var(--success); border-color: rgba(16, 185, 129, 0.4); background: rgba(16, 185, 129, 0.08); }
.subscription-badge.pro:hover { background: rgba(16, 185, 129, 0.15); }
.subscription-badge.trial { color: var(--accent); border-color: rgba(65,102,214, 0.4); background: rgba(65,102,214, 0.08); }
.subscription-badge.trial.empty { color: var(--warning); border-color: rgba(245, 158, 11, 0.4); background: rgba(245, 158, 11, 0.08); }
.subscription-badge.byok { color: var(--accent-2); border-color: rgba(15, 23, 42, 0.4); background: rgba(15, 23, 42, 0.08); }

.paywall-hero { background: var(--bg-2); border: 1px solid var(--border); border-radius: 14px; padding: 20px; margin-bottom: 18px; text-align: center; }
.paywall-price { font-size: 32px; font-weight: 800; color: var(--accent); margin-bottom: 14px; letter-spacing: -1px; }
.paywall-features { list-style: none; padding: 0; margin: 0; text-align: left; font-size: 13px; color: var(--text); line-height: 2; }
.paywall-features li { padding-left: 4px; }

.user-chip { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; font-size: 12px; color: var(--text-dim); }
.user-chip .avatar { width: 22px; height: 22px; border-radius: 50%; background: var(--accent-grad); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11px; }
.user-chip .email { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) { .user-chip .email { display: none; } }

/* ===== Layout ===== */
.container { max-width: 1280px; margin: 0 auto; padding: 24px 20px 80px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 960px) { .grid { grid-template-columns: 1fr; } }

/* ===== Card ===== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; position: relative; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); }
.card-title { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; margin-bottom: 14px; color: var(--text); }
.card-title .num { width: 22px; height: 22px; border-radius: 6px; background: var(--accent-grad); color: white; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.card-title .opt { margin-left: auto; font-size: 11px; color: var(--text-faint); font-weight: 500; }

/* ===== Uploader ===== */
.uploader { border: 2px dashed var(--border-2); border-radius: 14px; padding: 28px 20px; text-align: center; cursor: pointer; transition: all 0.2s; background: var(--surface-2); }
.uploader:hover, .uploader.dragover { border-color: var(--accent); background: rgba(65,102,214, 0.05); }
.uploader-icon { width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 12px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--accent); }
.uploader-title { font-weight: 600; font-size: 14px; }
.uploader-hint { font-size: 12px; color: var(--text-faint); margin-top: 4px; }
.uploader-formats { font-size: 11px; color: var(--text-faint); margin-top: 8px; }

/* ===== URL input ===== */
.url-section { margin-top: 12px; }
.url-row { display: flex; gap: 8px; }
.url-row .input { flex: 1; }
.url-row .btn { padding: 10px 16px; font-size: 13px; flex-shrink: 0; }
.url-hint { font-size: 11px; color: var(--text-faint); margin-top: 6px; line-height: 1.5; }
.link-btn { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 11px; padding: 0; font-family: inherit; text-decoration: underline; }
.link-btn:hover { color: var(--text); }

/* ===== Tip ===== */
.tip { margin-top: 12px; padding: 10px 12px; background: rgba(65,102,214, 0.06); border: 1px solid rgba(65,102,214, 0.2); border-radius: 10px; font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.tip strong { color: var(--accent); font-weight: 600; }

/* ===== Thumbs ===== */
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 14px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #000; border: 1px solid var(--border); cursor: pointer; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb .badge { position: absolute; top: 6px; left: 6px; background: rgba(0,0,0,0.7); color: white; font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.thumb .badge.video { background: var(--accent-2); }
.thumb .badge.dicom { background: var(--accent); }
.thumb .remove { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; background: rgba(0,0,0,0.7); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.thumb .remove:hover { background: var(--danger); }
.thumb .size { position: absolute; bottom: 6px; right: 6px; background: rgba(0,0,0,0.7); color: white; font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.thumb .play-ic { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: white; opacity: 0.85; pointer-events: none; }
.thumb .footer { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(to top, rgba(0,0,0,0.85), transparent); color: white; font-size: 10px; padding: 6px 8px; }

/* ===== Form ===== */
.field { margin-bottom: 14px; }
.field-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; letter-spacing: 0.2px; }
.field-label .req { color: var(--accent); }
.input, .textarea, .select { width: 100%; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px; color: var(--text); font-size: 14px; transition: border-color 0.15s; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); }

/* Remove o fundo branco/azul que o Chrome força em campos autofilled — mantém o tema dark */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--bg-2) inset !important;
  caret-color: var(--text);
  transition: background-color 5000s ease-in-out 0s;
}
.textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 10px; font-weight: 600; font-size: 14px; transition: all 0.15s; border: 1px solid transparent; }
.btn-primary { background: var(--accent-grad); color: white; box-shadow: 0 8px 24px -10px rgba(15, 23, 42, 0.5); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 28px -8px rgba(15, 23, 42, 0.6); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface); border-color: var(--border-2); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 12px; }

/* ===== Disclaimer ===== */
.warn-ribbon { background: linear-gradient(90deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.04)); border: 1px solid rgba(245, 158, 11, 0.3); border-radius: 12px; padding: 12px 14px; margin-bottom: 20px; display: flex; gap: 10px; align-items: flex-start; }
.warn-ribbon .ic { color: var(--warning); flex-shrink: 0; margin-top: 1px; }
.warn-ribbon .txt { font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.warn-ribbon strong { color: var(--warning); }

.fb-warn { background: linear-gradient(90deg, rgba(239, 68, 68, 0.12), rgba(239, 68, 68, 0.04)); border: 1px solid rgba(239, 68, 68, 0.3); border-radius: 12px; padding: 12px 14px; margin-bottom: 20px; font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.fb-warn strong { color: var(--danger); }

/* ===== Output ===== */
.output-empty { text-align: center; padding: 60px 20px; color: var(--text-faint); }
.output-empty .ic { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 18px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--text-faint); }
.output-empty h3 { color: var(--text-dim); font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.output-empty p { font-size: 13px; }

.laudo { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.laudo-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.tag { font-size: 11px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-dim); font-weight: 600; }
.tag.ok { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.tag.warn { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.tag.crit { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.laudo-content h2 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--accent); margin: 18px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.laudo-content h2:first-child { margin-top: 0; }
.laudo-content h3 { font-size: 13px; font-weight: 600; color: var(--text); margin: 12px 0 4px; }
.laudo-content p { font-size: 13.5px; line-height: 1.65; color: var(--text); margin-bottom: 8px; }
.laudo-content ul, .laudo-content ol { font-size: 13.5px; line-height: 1.65; padding-left: 22px; margin-bottom: 8px; }
.laudo-content li { margin-bottom: 3px; }
.laudo-content strong { color: var(--text); font-weight: 600; }
.laudo-content em { color: var(--text-dim); font-style: italic; }

.output-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.output-actions .btn { padding: 9px 14px; font-size: 13px; }

/* ===== Loader ===== */
.loader { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 50px 20px; gap: 16px; }
.spinner { width: 44px; height: 44px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { font-size: 12px; color: var(--text-faint); text-align: center; max-width: 360px; line-height: 1.5; }
.loader-step { font-size: 13px; color: var(--accent); font-weight: 600; }
.loader-bar { width: 100%; max-width: 320px; height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.loader-bar-fill { height: 100%; background: var(--accent-grad); border-radius: 999px; transition: width 0.4s; width: 0%; }

/* ===== Modal ===== */
.modal-bg { position: fixed; inset: 0; background: rgba(5, 8, 16, 0.8); backdrop-filter: blur(8px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; max-width: 480px; width: 100%; max-height: 88vh; overflow-y: auto; }
.modal.wide { max-width: 920px; }
.modal-header { padding: 20px 20px 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.modal-title { font-weight: 700; font-size: 18px; }
.modal-sub { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.modal-close { color: var(--text-dim); padding: 4px; border-radius: 6px; }
.modal-close:hover { color: var(--text); background: var(--surface-2); }
.modal-body { padding: 16px 20px 20px; }
.modal-footer { padding: 0 20px 20px; display: flex; gap: 8px; }
.modal-list { padding: 16px 20px; max-height: 60vh; overflow-y: auto; }
.modal-list-item { padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; cursor: pointer; transition: all 0.15s; }
.modal-list-item:hover { border-color: var(--accent); }
.modal-list-item-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.modal-list-item-title { font-weight: 600; font-size: 13px; }
.modal-list-item-date { font-size: 11px; color: var(--text-faint); }
.modal-list-item-sub { font-size: 12px; color: var(--text-dim); }

/* ===== DICOM viewer modal ===== */
.dicom-viewer { display: grid; grid-template-columns: 1fr 280px; gap: 16px; padding: 16px 20px 20px; }
@media (max-width: 760px) { .dicom-viewer { grid-template-columns: 1fr; } }
.dv-canvas-wrap { background: #000; border-radius: 12px; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; border: 1px solid var(--border); }
.dv-canvas { max-width: 100%; max-height: 100%; image-rendering: pixelated; }
.dv-overlay { position: absolute; top: 8px; left: 10px; color: white; font-size: 11px; line-height: 1.4; text-shadow: 0 1px 2px rgba(0,0,0,0.8); pointer-events: none; }
.dv-overlay-right { position: absolute; top: 8px; right: 10px; color: white; font-size: 11px; line-height: 1.4; text-shadow: 0 1px 2px rgba(0,0,0,0.8); pointer-events: none; text-align: right; }
.dv-controls { display: flex; flex-direction: column; gap: 14px; }
.dv-section-title { font-size: 11px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.dv-presets { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.dv-preset { padding: 8px 10px; font-size: 12px; font-weight: 500; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--border); color: var(--text-dim); transition: all 0.15s; text-align: center; }
.dv-preset:hover, .dv-preset.active { border-color: var(--accent); color: var(--text); background: var(--surface-2); }
.dv-slider { display: flex; flex-direction: column; gap: 4px; }
.dv-slider-row { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-dim); }
.dv-slider-row strong { color: var(--text); }
.dv-slider input[type="range"] { width: 100%; accent-color: var(--accent); }
.dv-slice-info { font-size: 12px; color: var(--text-dim); display: flex; justify-content: space-between; align-items: center; }
.dv-slice-info strong { color: var(--text); }
.dv-range { display: flex; gap: 6px; align-items: center; font-size: 11px; color: var(--text-dim); }
.dv-range input[type="number"] { width: 60px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; color: var(--text); font-size: 12px; }
.dv-footer { display: flex; gap: 8px; padding: 0 20px 20px; }
.dv-footer .btn { flex: 1; }

/* ===== Link ===== */
.link { color: var(--accent); text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ===== Toast ===== */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--border-2); color: var(--text); padding: 12px 18px; border-radius: 12px; font-size: 13px; z-index: 200; box-shadow: 0 12px 32px -8px rgba(0,0,0,0.5); animation: toast-in 0.2s ease-out; max-width: calc(100vw - 40px); }
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ===== Print ===== */
@media print {
  body { background: white; color: black; }
  .topbar, .grid > section:first-child, .output-actions, .warn-ribbon, .fb-warn, .icon-btn { display: none !important; }
  .container { padding: 0; max-width: 100%; }
  .grid { grid-template-columns: 1fr; }
  .card { border: none; padding: 0; background: white; box-shadow: none; }
  .laudo { background: white; border: none; padding: 0; color: black; }
  .laudo-content h2 { color: #1e40af; }
  .laudo-content p, .laudo-content li, .laudo-content strong { color: black; }
}

/* mt-a11y-16px */
@media(max-width:680px){input,select,textarea{font-size:16px}}
