/* Shared terminal layouts; language-specific text remains in i18n.css. */
html { scroll-padding-top: 128px; }
html[lang] body { min-width: 0; }
*, *::before, *::after { box-sizing: border-box; }
img { max-width: 100%; }
button, a, summary, select { touch-action: manipulation; }
:is(button,a,input,select,textarea,summary,[tabindex]):focus-visible { outline: 3px solid #188e79; outline-offset: 3px; }
.platform-mode :is(button,a,input,select,summary,[tabindex]):focus-visible { outline-color: #77e2d0; }
html[lang] :is(button,.primary-button,.ghost-button,.dialog-card menu button) { min-width: 44px; min-height: 44px; height: auto; white-space: normal; line-height: 1.4; }
html[lang] :is(.primary-button,.ghost-button) { padding: 10px 14px; }
html[lang] :is(.site-primary-button,.site-outline-button,.site-link-button,.member-tabs button) { min-height: 44px; }
html[lang] :is(input,select,textarea) { min-width: 0; max-width: 100%; }
html[lang] .language-picker select { min-height: 44px; }
.device-menu-toggle { display: none; width: 44px; flex: 0 0 44px; padding: 10px; border: 1px solid #cfdad7; border-radius: 6px; background: #fff; color: #263934; }
.menu-icon { display: block; width: 22px; height: 22px; background: currentColor; -webkit-mask: url('/assets/lucide-menu.svg') center / contain no-repeat; mask: url('/assets/lucide-menu.svg') center / contain no-repeat; }
.device-menu-toggle[aria-expanded="true"] { box-shadow: inset 0 0 0 2px currentColor; }
html[lang] .site-nav { padding-inline: max(24px,calc((100% - 1600px)/2)); }
.site-section { padding-inline: max(24px,calc((100% - 1440px)/2)); }
html[lang] .site-hero-copy { padding-left: max(24px,calc((100vw - 1440px)/2)); max-width: calc(1000px + max(0px,(100vw - 1440px)/2)); }
html[lang] .site-hero-stats { margin-inline: max(24px,calc((100% - 1440px)/2)); }
.site-hero-media img { object-position: 60% center; }
.app-shell { max-width: 2200px; margin-inline: auto; }
.main { min-width: 0; }
.sidebar { overflow-y: auto; }
.brand-mark { flex-shrink: 0; }
.system-left { flex-wrap: wrap; min-width: 0; }
.system-left small { overflow-wrap: anywhere; }
.platform-capabilities { margin-top: 24px; border-top: 1px solid #455468; padding-top: 16px; }
.platform-capabilities > summary { width: fit-content; min-height: 44px; padding: 10px 0; cursor: pointer; }
.platform-capabilities .command-deck { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
.platform-capabilities .deck-health { grid-column: 1/-1; }
.platform-capabilities .hero-strip { grid-template-columns: minmax(0,1fr) minmax(0,1.5fr); }
.platform-capabilities .hero-status { grid-column: 1/-1; }
.deck-visual { width: 100%; min-width: 0; aspect-ratio: 16/10; min-height: 0; align-self: start; }
.deck-visual img { position: absolute; inset: 0; }
.deck-floating-card { max-width: calc(100% - 32px); }
.deck-copy { padding: 12px; }
.overview-grid { grid-template-columns: minmax(0,1.5fr) minmax(260px,1fr); }
.panel-header, .section-heading { flex-wrap: wrap; }
.panel-header > div, .topbar > div { min-width: 0; }
.panel-header select { width: min(220px,100%); }
.table-wrap { overscroll-behavior-inline: contain; }
.table-wrap:focus-visible { outline-offset: 2px; }
.cell-value { min-width: 0; overflow-wrap: anywhere; }
html[lang] .section-toolbar { overflow: visible; flex-wrap: wrap; }
.section-toolbar input { min-width: 0; width: min(320px,100%); }
.segmented { flex-wrap: wrap; height: auto; }
html[lang] .topbar { flex-wrap: wrap; margin-bottom: 22px; }
.shell { max-width: 2048px; margin-inline: auto; }
.shell > aside { overflow-y: auto; }
.shell main > header { flex-wrap: wrap; }
.toolbar form { min-width: 0; max-width: 100%; }
.toolbar input { width: min(260px,100%); }
.status { max-width: 100%; white-space: normal; }
dialog { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow: auto; overscroll-behavior: contain; }
body:has(dialog[open]) { overflow: hidden; }
.dialog-card menu, dialog footer { position: sticky; bottom: -1px; background: #fff; padding: 12px 0 max(12px,env(safe-area-inset-bottom)); z-index: 1; }
.dialog-card label { line-height: 1.5; }
.inline-form-error { grid-column: 1/-1; padding: 10px 12px; margin: 0; border-left: 3px solid #b42318; background: #fff0ee; color: #9a2017; overflow-wrap: anywhere; }
.inline-form-error:empty { display: none; }
.contact-actions a, .contact-bottom a, .contact-details a, .member-settings summary { min-height: 44px; display: inline-flex; align-items: center; }
.checkbox-label { min-height: 44px; }
@media (min-width: 701px) and (max-width: 1200px) {
  .site-intro { grid-template-columns: 1fr; }
  .site-section .intro-flow { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .site-section :is(.product-grid,.solution-showcase,.site-case-grid,.membership-grid) { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .site-training { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 24px; }
  .site-section h2 { font-size: 30px; }
}
@media (max-width: 1300px) {
  .app-shell { grid-template-columns: 228px minmax(0,1fr); }
  .main { padding: 20px; }
  .overview-grid, .asset-layout, .ai-layout, .safety-layout, .reports-layout { grid-template-columns: minmax(0,1fr); }
  .platform-mode .brand strong { font-size: 17px; }
  .brand-mark { width: 48px; height: 48px; }
  .brand-mark img { width: 44px; height: 44px; }
  .topbar-actions { justify-content: flex-start; }
  .metrics, .capability-ribbon { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 1100px) {
  html { scroll-padding-top: 92px; }
  html[lang] :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea) { font-size: 16px; min-height: 44px; }
  html[lang] .site-nav { position: sticky; top: 0; display: grid; grid-template-columns: minmax(0,1fr) 44px; padding: 10px max(16px,env(safe-area-inset-right)) 10px max(16px,env(safe-area-inset-left)); gap: 12px; min-height: 64px; background: #fff; }
  html.device-ui .device-menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  html[lang] .site-brand { min-width: 0; }
  html[lang] .site-brand small { max-width: 100%; font-size: 11px; }
  html[lang] .site-nav nav { grid-column: 1/-1; grid-row: auto; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); justify-content: stretch; padding: 8px 0; gap: 4px 12px; }
  .site-nav nav a { display: flex; align-items: center; min-height: 44px; line-height: 1.45; }
  html[lang] .site-actions { grid-column: 1/-1; display: flex; justify-content: flex-start; flex-wrap: wrap; gap: 10px; padding-bottom: 8px; }
  html.device-ui .site-nav:not(.is-menu-open) :is(#siteNavigation,#siteActions) { display: none; }
  .site-nav.is-menu-open { max-height: 100vh; max-height: 100dvh; overflow-y: auto; }
  .app-shell, .shell { display: block; max-width: 100%; overflow: visible; }
  .sidebar, .shell > aside { position: sticky; top: 0; z-index: 10; display: grid; grid-template-columns: minmax(0,1fr) 44px; gap: 8px 12px; width: 100%; height: auto; min-height: 0; padding: 10px max(16px,env(safe-area-inset-left)); overflow: visible; }
  .sidebar .device-menu-toggle, .admin-sidebar .device-menu-toggle { grid-column: 2; grid-row: 1; background: transparent; color: #e8f7f2; border-color: #657f80; }
  .sidebar .brand, .admin-sidebar .brand { display: flex; grid-column: 1; grid-row: 1; padding: 0; border: 0; gap: 10px; min-width: 0; }
  .sidebar .brand-mark, .admin-sidebar .brand img { width: 40px; height: 40px; flex-shrink: 0; }
  .sidebar .brand-mark img { width: 36px; height: 36px; }
  .sidebar .brand strong, .admin-sidebar .brand span { font-size: 15px; }
  .sidebar .brand span, .admin-sidebar .brand small { font-size: 11px; }
  .platform-badge { display: none; }
  .sidebar .nav, .admin-sidebar #nav { grid-column: 1/-1; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); width: 100%; margin: 8px 0 0; overflow: visible; }
  html[lang] :is(.nav-item,#nav button) { width: 100%; min-width: 0; white-space: normal; text-align: left; padding: 10px 12px; }
  .platform-mode .sidebar-footer, .admin-sidebar .aside-bottom { grid-column: 1/-1; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0; padding: 12px 0 0; }
  .sidebar-footer > :is(span,strong,small) { display: none; }
  html.device-ui :is(.sidebar,.admin-sidebar):not(.is-menu-open) :is(nav,#nav,.sidebar-footer,.aside-bottom) { display: none; }
  :is(.sidebar,.admin-sidebar).is-menu-open { max-height: 100vh; max-height: 100dvh; overflow-y: auto; }
  .main, .shell main { width: 100%; max-width: 100%; padding: 20px max(16px,env(safe-area-inset-left)) 32px; }
  .platform-system-bar { align-items: flex-start; flex-direction: row; }
  html[lang] .system-right { width: auto; justify-content: flex-start; }
  .system-left small, .system-right > span:not(#platformMemberChip) { display: none; }
  .system-left { width: auto; }
  .topbar .eyebrow, .title-tags { display: none; }
  .topbar-actions { width: 100%; }
  .admin-language { margin-top: 0; }
  .scenario-grid, .case-grid, .ops-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .member-form-layout { grid-template-columns: minmax(0,1fr); }
  .member-benefits { display: none; }
  .member-center-grid { grid-template-columns: minmax(0,1fr); }
  .member-rights, .member-service-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 700px) {
  html[lang] .site-hero { min-height: 0; }
  html[lang] .site-hero-copy { padding: 36px 20px 0; max-width: 100%; }
  html[lang] .site-hero-copy h1 { font-size: 30px; }
  html[lang] .site-hero-copy p { font-size: 16px; line-height: 1.65; }
  html[lang] .site-hero-stats { margin: 28px 20px; }
  .site-hero-stats article { padding: 14px; min-height: 100px; }
  html[lang] .site-hero-stats strong { font-size: 22px; }
  .site-section, .site-training { padding: 40px 20px; }
  .site-section h2 { font-size: 28px; line-height: 1.3; }
  .site-cta h2 { font-size: 28px; }
  .site-cta { margin-inline: 20px; padding: 24px; }
  .contact-footer { padding-inline: max(20px,env(safe-area-inset-left)); }
  .topbar h1 { font-size: 26px; }
  .topbar-actions { gap: 8px; }
  .topbar-actions button { flex: 1 1 140px; }
  html[lang] .topbar-actions .icon-button { flex: 0 0 44px; }
  #newMissionBtn { flex-basis: 100%; }
  .metrics, .capability-ribbon { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .metrics article, .capability-ribbon article { min-width: 0; padding: 14px; }
  .metrics strong { font-size: 28px; }
  .metrics small { overflow-wrap: anywhere; }
  .platform-capabilities :is(.command-deck,.hero-strip) { grid-template-columns: minmax(0,1fr); padding: 12px; }
  .platform-capabilities .deck-visual { min-width: 0; aspect-ratio: 16/10; }
  .scenario-grid, .case-grid, .ops-grid, .member-service-list { grid-template-columns: minmax(0,1fr); }
  .panel { padding: 14px; }
  .map-canvas { height: 300px; }
  .section-toolbar input { width: 100%; }
  .segmented { display: flex; flex-wrap: wrap; gap: 6px; }
  .segmented button { flex: 1 1 auto; padding: 8px 12px; }
  .table-wrap:has(.responsive-table) { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .responsive-table, .responsive-table tbody { display: block; width: 100%; }
  .responsive-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .responsive-table tr { display: block; padding: 10px 14px; margin-bottom: 12px; border: 1px solid #dfe5e8; border-radius: 6px; background: #fff; }
  .platform-mode .responsive-table tr { border-color: #46576d; background: #15283e; }
  .responsive-table td { display: grid; grid-template-columns: minmax(78px,0.7fr) minmax(0,1.3fr); gap: 12px; width: 100%; max-width: none; padding: 10px 0; white-space: normal; text-align: left; }
  .responsive-table td::before { content: attr(data-label); color: #65747a; overflow-wrap: anywhere; }
  .platform-mode .responsive-table td::before { color: #b1c8de; }
  .responsive-table td[colspan] { display: block; }
  .responsive-table td[colspan]::before { content: none; }
  .responsive-table tr td:first-child { border-top: 0; }
  .responsive-table td button { margin: 3px 5px 3px 0; min-height: 44px; white-space: normal; }
  .editor-grid, .detail-grid { grid-template-columns: minmax(0,1fr); }
  .header-actions { flex-wrap: wrap; }
  .shell main > header { margin-bottom: 20px; gap: 12px; }
  dialog, #memberDialog, #memberCenterDialog { width: calc(100% - 24px); max-width: 100%; }
  .dialog-card { padding: 18px; }
  .dialog-card menu button { flex: 1 1 120px; }
  .dialog-header { gap: 12px; align-items: flex-start; }
  .dialog-header .icon-button { min-width: 44px; }
  dialog footer { flex-wrap: wrap; }
  .gate { padding: 84px 16px 24px; min-height: 100vh; min-height: 100dvh; }
  .gate-language { right: 16px; top: 16px; }
  .login-panel { padding: 24px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  html[lang] .site-nav, .sidebar, .shell > aside { position: relative; }
  .gate { place-items: start center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
@media (hover: none) {
  .scenario-card:hover .scenario-image img, .case-card:hover img, .dialog-card menu .primary-button:hover { transform: none; }
}
