/* Shared device layout. Loaded after the legacy visual styles. */
.auth-recovery-page .login-footer { position: relative; z-index: 1; border-color: #263247; color: #94a3b8; }
.auth-recovery-page .login-footer a { border-color: #334155; color: #67e8f9; }
.auth-recovery-page .login-footer a:hover { background: #172033; }
.auth-recovery-page .login-footer-platform { color: #cbd5e1; }
.login-brand .login-brand-logo {
  padding: 0;
  overflow: hidden;
  background: #fff;
  border: 2px solid #67e8f9;
  border-radius: 18px;
}
.login-brand-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.login-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin: 0 clamp(16px, 5vw, 80px);
  padding: 20px 0 28px;
  border-top: 1px solid #cbd5e1;
  color: #475569;
  font-size: .85rem;
}
.login-footer > span { font-weight: 700; letter-spacing: .03em; }
.login-footer a {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #0f766e;
  text-decoration: none;
}
.login-footer a:hover { background: #e2e8f0; }
.login-footer-platform { color: #475569; }
body.dark-mode .login-footer { border-color: #263247; color: #94a3b8; }
body.dark-mode .login-footer a { border-color: #334155; color: #67e8f9; }
body.dark-mode .login-footer a:hover { background: #172033; }
body.dark-mode .login-footer-platform { color: #cbd5e1; }
@media screen and (max-width: 600px) {
  .login-footer { flex-direction: column; justify-content: center; text-align: center; }
}
.history-actions-under {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 235px));
  grid-auto-rows: 1fr;
  align-items: stretch;
  gap: 12px;
}
.history-actions-under > :is(.print-btn, .btn) {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 60px;
  margin: 0;
  padding: 12px 20px;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}
@media screen and (max-width: 600px) {
  .history-actions-under { grid-template-columns: minmax(0, 1fr); }
}
.history-print-context { display: none; }
@page history-report {
  size: A4 landscape;
  margin: 15mm 13mm 18mm;
  @bottom-left { content: "RaptorScanner | Scan history"; font: 9pt Arial, sans-serif; color: #475569; }
  @bottom-right { content: "Page " counter(page) " / " counter(pages); font: 9pt Arial, sans-serif; color: #475569; }
}
@media print {
  body.printable-history { page: history-report; background: #fff !important; color: #111827 !important; }
  body.printable-history :is(.navbar, .history-tabs, .datatable-top, .datatable-bottom, .history-actions) { display: none !important; }
  body.printable-history :is(.history-container, .history-card, .table-wrapper, .history-tab-content) {
    width: 100% !important; min-width: 0 !important; max-width: none !important;
    height: auto !important; max-height: none !important; overflow: visible !important;
    padding: 0 !important; margin: 0 !important; border: 0 !important; border-radius: 0 !important;
    box-shadow: none !important; background: #fff !important;
  }
  body.printable-history .history-header { margin: 0 0 7mm; padding-bottom: 5mm; border-bottom: 2pt solid #0f766e; }
  body.printable-history .history-header::before { content: 'RAPTORSCANNER / ACTIVITY REPORT'; display: block; font: bold 9pt Arial, sans-serif; letter-spacing: 1pt; margin-bottom: 3mm; }
  body.printable-history .history-header h1 { font: bold 24pt/1.2 Arial, sans-serif !important; margin: 0 0 3mm; }
  body.printable-history .history-header > p:not(.history-print-context) { display: none; }
  body.printable-history .history-print-context { display: block; margin: 0; font: 10pt/1.5 Arial, sans-serif; overflow-wrap: anywhere; }
  body.printable-history .history-tab-content:not(.active) { display: none !important; }
  body.printable-history .history-tab-content.active { display: block !important; }
  body.printable-history .history-data-row { display: none !important; }
  body.printable-history .history-data-row.history-print-match { display: table-row !important; }
  body.printable-history .history-table {
    width: 100% !important; min-width: 0 !important; table-layout: fixed;
    border-collapse: collapse !important; border: 1px solid #cbd5e1; font: 9pt/1.45 Arial, sans-serif;
  }
  body.printable-history .history-table :is(th, td) {
    width: auto !important; min-width: 0 !important; max-width: none !important;
    padding: 3mm 2.5mm !important; font: 9pt/1.45 Arial, sans-serif !important;
    white-space: normal !important; overflow-wrap: anywhere; word-break: normal;
    vertical-align: top; border: 1px solid #cbd5e1 !important;
  }
  body.printable-history .history-table th { font-weight: 700 !important; background: #eef2f6 !important; }
  body.printable-history .history-table tbody tr:nth-child(even) { background: #f8fafc !important; }
  body.printable-history .history-table tr { break-inside: avoid; }
  body.printable-history .history-table thead { display: table-header-group; }
  body.printable-history .history-table :is(th,td):first-child { width: 5% !important; }
  body.printable-history .history-table th:last-child,
  body.printable-history .history-table td:last-child:not([colspan]) { display: none !important; }
  body.printable-history #fileHistoryTable :is(th,td):nth-child(2) { width: 28% !important; }
  body.printable-history #fileHistoryTable :is(th,td):nth-child(3) { width: 10% !important; }
  body.printable-history #fileHistoryTable :is(th,td):nth-child(4) { width: 27% !important; }
  body.printable-history #fileHistoryTable :is(th,td):nth-child(5) { width: 10% !important; }
  body.printable-history :is(h1,p,th,td,span,strong,a) { color: #111827 !important; opacity: 1 !important; text-shadow: none !important; }
  body.printable-history .badge { display: inline-block; font: bold 9pt/1.3 Arial, sans-serif !important; padding: 1mm 2mm; background: #fff !important; border: 1px solid #94a3b8; }
}
@page file-report {
  size: A4;
  margin: 18mm 16mm 20mm;
  @bottom-left { content: "RaptorScanner | File analysis report"; font: 9pt Arial, sans-serif; color: #64748b; }
  @bottom-right { content: "Page " counter(page) " / " counter(pages); font: 9pt Arial, sans-serif; color: #64748b; }
}
@media print {
  body.printable-scan .scan-result-page { page: file-report; }
  body.printable-scan .scan-report-card {
    display: block !important; padding: 0 !important; margin: 0 !important;
    border: 0 !important; border-radius: 0 !important; overflow: visible !important;
    font: 11pt/1.55 Arial, sans-serif;
    counter-reset: report-section;
  }
  body.printable-scan .scan-report-header,
  body.printable-scan .hash-copy-row button { display: none !important; }
  body.printable-scan .scan-report-card > .report-section {
    break-before: page; break-inside: auto;
    margin: 0 !important; padding: 0 !important;
    border: 0 !important; border-radius: 0 !important; overflow: visible !important;
    counter-increment: report-section;
  }
  body.printable-scan .scan-report-header + .report-section { break-before: auto; }
  body.printable-scan .scan-report-card > .report-section::before {
    content: "RAPTORSCANNER  /  FILE ANALYSIS";
    display: block; padding: 0 0 5mm; margin-bottom: 9mm;
    border-bottom: 2pt solid #0f766e;
    color: #0f766e; font: bold 10pt/1.4 Arial, sans-serif; letter-spacing: 1pt;
  }
  body.printable-scan .report-section h2 {
    font-size: 23pt !important; line-height: 1.2; margin: 0 0 9mm;
    padding: 0; break-after: avoid;
  }
  body.printable-scan .report-section h2::before {
    content: counter(report-section, decimal-leading-zero) "  "; color: #64748b;
  }
  body.printable-scan .report-section :is(p, li, td, th, span, strong, small, code, label) {
    font-size: 11pt; line-height: 1.55;
  }
  body.printable-scan .report-section p { margin: 0 0 5mm; orphans: 3; widows: 3; }
  body.printable-scan .report-row {
    display: grid; grid-template-columns: 48mm minmax(0, 1fr); gap: 5mm;
    padding: 5mm 0; margin: 0; border-bottom: 1px solid #cbd5e1; break-inside: avoid;
  }
  body.printable-scan .report-row :is(strong, span) { width: auto; overflow-wrap: anywhere; }
  body.printable-scan .metadata-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5mm; }
  body.printable-scan .metadata-grid > div {
    padding: 5mm; border: 1px solid #cbd5e1; background: #fff !important; break-inside: avoid;
  }
  body.printable-scan .hash-box { margin: 0 0 8mm; padding: 5mm; border: 1px solid #cbd5e1; break-inside: avoid; }
  body.printable-scan .hash-copy-row { display: block; }
  body.printable-scan .hash-copy-row code { display: block; padding: 3mm 0; white-space: normal; overflow-wrap: anywhere; font: 10pt/1.6 monospace; background: #fff !important; color: #111827 !important; }
  body.printable-scan .vt-score-panel { padding: 6mm; margin-bottom: 5mm; border: 1px solid #cbd5e1; background: #fff !important; break-inside: avoid; }
  body.printable-scan .vt-score-panel strong { display: block; font-size: 30pt; }
  body.printable-scan .report-section table { table-layout: fixed; border-collapse: collapse; min-width: 0 !important; }
  body.printable-scan .report-section :is(th, td) { padding: 3mm; font-size: 9pt; overflow-wrap: anywhere; border-bottom: 1px solid #cbd5e1; }
  body.printable-scan .report-section thead { display: table-header-group; }
  body.printable-scan .report-section tr { break-inside: avoid; }
  body.printable-scan .report-section :is(h3, h4) { break-after: avoid; }
}
.scan-result-page .report-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 235px));
  grid-auto-rows: 1fr;
  align-items: stretch;
  gap: 12px;
}
.scan-result-page .report-actions :is(.btn, .scan-print-button) {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 68px;
  margin: 0;
  padding: 12px 20px;
  border: 0;
  border-radius: 9px;
  font: inherit;
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
}
@media screen and (max-width: 768px) {
  .scan-result-page .report-actions { grid-template-columns: minmax(0, 1fr); }
}
.pe-inspection { min-width: 0; }
.pe-inspection details { margin-top: 20px; }
.pe-inspection summary { cursor: pointer; min-height: 44px; padding: 10px 0; font-weight: 700; }
.pe-capability, .pe-string { display: grid; gap: 6px; margin: 12px 0; padding: 14px; border: 1px solid #64748b; border-radius: 10px; }
.pe-capability code, .pe-string code, .pe-imports { white-space: pre-wrap; overflow-wrap: anywhere; }
.pe-string small { opacity: .8; }
html, body { min-width: 0; }
img { max-width: 100%; }
main, section, article, aside, form { min-width: 0; }
input, select, textarea { max-width: 100%; min-width: 0; }
p, dd, .break-text { overflow-wrap: anywhere; }
.logo small { font-size: .65rem; letter-spacing: .08em; }
.navbar .logo, .home-navbar .home-logo { flex-shrink: 0; }
.navbar .nav-links { min-width: 0; }
.table-wrapper { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.dashboard-workspace, .admin-page, .profile-v2-page { min-width: 0; }
.dashboard-heading h1 { overflow-wrap: normal; }
.recovery-shell { width: 100%; padding: clamp(20px, 5vh, 64px) 16px; min-height: 100svh; }
.recovery-card { width: min(100%, 560px); margin: auto; padding: clamp(24px, 4vw, 40px); }
.recovery-card h1 { font-size: clamp(1.65rem, 4vw, 2.3rem); line-height: 1.2; }
.nav-profile-dropdown { max-height: calc(100dvh - 100px); overflow-y: auto; }

@media screen and (max-width: 1100px) {
  .navbar, .home-navbar {
    display: flex !important; flex-wrap: wrap; justify-content: space-between;
    align-items: center; gap: 12px; height: auto !important; min-height: 72px !important;
    padding: 12px 20px !important;
  }
  .navbar .logo, .home-navbar .home-logo { font-size: 1.25rem !important; gap: 9px; }
  .navbar .nav-toggle, .home-navbar .home-nav-toggle {
    display: flex !important; align-items: center; justify-content: center;
    flex: 0 0 44px; width: 44px !important; height: 44px !important;
    min-height: 44px; padding: 9px; margin: 0 0 0 auto;
    border: 1px solid #475569 !important; border-radius: 10px !important;
    background: #1e293b !important; color: #fff; font-size: 24px !important;
  }
  .navbar .nav-links, .home-navbar .home-nav-center, .home-navbar .home-nav-right {
    display: none !important; position: static !important; inset: auto !important;
    transform: none !important; flex: 0 0 100%; width: 100% !important;
    margin: 0 !important; padding: 8px 0 !important; gap: 6px !important;
    align-items: stretch !important; flex-direction: column !important;
    border-radius: 0 !important; background: transparent !important; box-shadow: none !important;
  }
  .navbar.active .nav-links, .home-navbar.active .home-nav-center,
  .home-navbar.active .home-nav-right { display: flex !important; }
  .navbar .nav-links > a, .home-navbar .home-nav-center a, .home-navbar .home-nav-right a {
    display: flex; align-items: center; min-height: 44px; padding: 10px 12px !important;
    font-size: .95rem !important; text-align: left !important; border-radius: 8px;
  }
  .nav-links a::after, .home-nav-center a::after { display: none; }
  .nav-profile-menu { align-self: flex-start; }
  .nav-profile-dropdown { left: 0; right: auto; width: min(340px, calc(100vw - 40px)); }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .dashboard-workspace .dashboard-heading { gap: 20px; flex-wrap: wrap; }
}

@media screen and (max-width: 768px) {
  .vt-page { padding: 28px 16px; }
  .dashboard-workspace .dashboard-heading h1 { font-size: clamp(1.9rem, 6vw, 2.8rem); line-height: 1.12; }
  .dashboard-grid .tab-content { padding: 28px 20px; min-height: 0; }
  .dashboard-grid .tab-content h2 { font-size: 1.5rem; }
  .dashboard-grid .vt-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-grid .tab-btn { justify-content: center; padding: 14px 8px; text-align: center; gap: 0; }
  .dashboard-grid .tab-btn .tab-number, .dashboard-grid .tab-btn small { display: none; }
  .dashboard-grid .tab-btn strong { font-size: .85rem; line-height: 1.3; }
  .dashboard-grid .tab-btn.active { box-shadow: inset 0 -3px 0 #0f766e; }
  .dashboard-side-panel { padding: 24px 20px; }
  .admin-page, .profile-v2-page { width: auto; max-width: 100%; margin: 0; padding: 28px 16px; }
  .admin-header, .admin-table-heading { flex-wrap: wrap; gap: 12px; }
  .admin-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-search-form { flex-wrap: wrap; }
  .admin-search-form input { flex: 1 1 180px; }
  .login-box input { font-size: max(16px, 1rem) !important; }
  .login-brand { min-height: 180px !important; padding: 24px 20px !important; }
  .login-brand h1 { font-size: clamp(1.6rem, 6vw, 2rem) !important; overflow-wrap: anywhere; }
  .login-brand .logo-badge { display: none; }
  .login-brand p { margin-bottom: 0; }
  .home-navbar.active .home-nav-center { border-top: 1px solid #334155; }
  .home-navbar.active .home-nav-right { padding-top: 0 !important; }
}

@media screen and (max-width: 480px) {
  .navbar, .home-navbar { padding: 10px 12px !important; gap: 8px; }
  .navbar .logo, .home-navbar .home-logo { font-size: 1.05rem !important; gap: 8px; }
  .brand-logo-image { width: 30px; height: 30px; flex-basis: 30px; }
  .logo small { font-size: .55rem; padding: 3px; }
  .navbar .nav-toggle, .home-navbar .home-nav-toggle { flex-basis: 44px; }
  .nav-profile-dropdown { width: calc(100vw - 24px); }
  .dashboard-grid .tab-content form { margin-top: 24px; }
  .dashboard-grid .tab-content input[type=file] { padding: 10px; font-size: .85rem; }
  .dashboard-grid .tab-content input[type=file]::file-selector-button { padding: 10px; margin-right: 8px; }
  .recovery-shell { padding: 20px 12px; }
  .recovery-card { padding: 24px 20px; }
  .recovery-icon { width: 60px; height: 60px; margin-bottom: 20px; }
  .recovery-card p { font-size: 1rem; }
  .hero-text h1 { font-size: clamp(1.8rem, 8vw, 2.3rem) !important; overflow-wrap: anywhere; }
  .profile-v2-hero h1 { overflow-wrap: anywhere; }
}
