/*
 * GIANO analyst workspace visual system.
 *
 * Design read: a dense, evidence-sensitive operating console for professional
 * analysts. Visual density remains high, but hierarchy is created with spacing,
 * typography and one-pixel structure rather than stacked generic cards.
 *
 * Dials: design variance 6, motion 3, density 8.
 * Keep selectors and element IDs stable: UI tests and analyst muscle memory rely
 * on the existing information architecture.
 */

:root {
  --bg: #060a11;
  --bg2: #09101a;
  --panel: #0c1420;
  --panel2: #101a28;
  --panel3: #162234;
  --line: #203047;
  --line2: #30445f;
  --txt: #edf3fb;
  --muted: #9aabc2;
  --faint: #64758e;
  --accent: #55c7d9;
  --accent-d: #10313a;
  --radius: 7px;
  --radius-s: 5px;
  --shadow: 0 24px 72px -28px rgba(0, 8, 18, .92);
  --shadow-s: 0 10px 28px -20px rgba(0, 8, 18, .9);
}

body {
  background: var(--bg);
  font-size: 13px;
}

button,
.button,
select,
input,
textarea,
summary {
  transition: border-color .16s ease, background-color .16s ease,
    color .16s ease, transform .12s ease;
}

button:active,
.button:active {
  transform: translateY(1px);
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Header and global command line */
.classbar {
  background: #1f7a66;
  color: #f2fff9;
  letter-spacing: 1.6px;
}

header.consoleHeader {
  background: #08101b;
  border-bottom-color: var(--line);
  box-shadow: none;
}

.brand {
  padding-right: 12px;
}

.brand > svg {
  width: 25px;
  height: 25px;
}

.logo {
  letter-spacing: 3.5px;
}

.logo small {
  color: #72839d;
  letter-spacing: 1.6px;
}

.omniShell {
  flex: 0 0 clamp(260px, 25vw, 420px);
  min-width: 260px;
  max-width: 420px;
}

#omni {
  height: 38px;
  border-radius: 6px;
  background-color: #0c1726;
  border-color: #2b3d58;
  box-shadow: none;
  font-weight: 500;
}

#omni:focus {
  box-shadow: 0 0 0 2px rgba(85, 199, 217, .16);
}

.actions button,
.actions select,
.headerMenu > summary {
  min-height: 36px;
}

.workspaceNav button,
.collectionControls button,
.headerMenu > summary {
  border-radius: 5px;
}

.workspaceNav button:not(.primary),
.headerMenu > summary {
  background: transparent;
  border-color: transparent;
}

.workspaceNav button:hover,
.headerMenu > summary:hover {
  background: #101c2c;
  border-color: var(--line);
}

#liveBtn,
#briefBtn {
  box-shadow: none;
}

.headerAccount {
  font-variant-numeric: tabular-nums;
}

.userchip {
  border-radius: 5px;
  background: #09131f;
}

/* Map workbench */
main[aria-label="GIANO operating picture"] {
  background: #050910;
}

#mapFilters {
  width: 360px;
  max-height: calc(100% - 20px);
  border: 1px solid #2a3c56;
  border-radius: 7px;
  background: rgba(7, 14, 24, .97);
  box-shadow: 0 20px 60px -32px rgba(0, 0, 0, .95);
}

#panelHead {
  min-height: 44px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.panelHeadActions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.panelClearButton {
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid #43536b;
  border-radius: 4px;
  background: transparent;
  color: #b8c5d7;
  font: 600 10px/1.2 var(--mono);
}

.panelClearButton:hover {
  border-color: var(--accent);
  color: var(--txt);
}

#panelHead .ph-title,
.filt-title {
  color: #a5b5cb;
  font: 600 10.5px/1.35 var(--mono);
  letter-spacing: .85px;
  text-transform: none;
}

.collapser {
  min-height: 36px;
  padding: 10px 12px;
}

#filtBody,
#mapToolsBody,
#layersBody {
  padding: 0 12px 12px;
}

.lensControl {
  margin: 0 0 10px;
  padding: 10px 0 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.lensControl label {
  color: var(--accent);
  font: 600 10px/1.35 var(--mono);
  letter-spacing: .65px;
  text-transform: none;
}

#mapFilters select,
#mapFilters input {
  min-height: 39px;
  border-radius: 5px;
  background: #09121e;
  border-color: #2a3d59;
}

#mapFilters select:hover,
#mapFilters input:hover {
  border-color: #3b526f;
}

#lensPlanMeta {
  color: #8294ad;
  line-height: 1.5;
}

.lensScope {
  display: none;
  margin-top: 9px;
  border-top: 1px solid var(--line);
}

.lensScope.show {
  display: block;
}

.lensScopeRow {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(32, 48, 71, .62);
  color: #aebccd;
  font-size: 10.5px;
  line-height: 1.4;
}

.lensScopeRow:last-child {
  border-bottom: 0;
}

.lensScopeRow b {
  color: #7488a3;
  font: 600 9.5px/1.4 var(--mono);
  text-transform: uppercase;
}

.lensScopeCount {
  color: var(--accent);
  font-weight: 700;
}

.mapFilterGroup {
  margin: 0;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.mapFilterGroup h4 {
  margin: 0 0 7px;
  color: #8192aa;
  font: 600 9.5px/1.3 var(--mono);
  letter-spacing: .45px;
  text-transform: uppercase;
}

.mapFilterGroup select,
.mapFilterGroup input {
  width: 100%;
  margin: 0 0 6px;
}

.mapFilterGroup > :last-child {
  margin-bottom: 0;
}

.activeFilterSummary {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 9px 0 4px;
}

.activeFilterSummary:empty {
  display: none;
}

.activeFilterChip {
  min-height: 26px;
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid #30445f;
  border-radius: 4px;
  background: #0b1624;
  color: #b6c5d8;
  font: 600 9.5px/1.2 var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activeFilterChip:hover {
  border-color: var(--accent);
  color: var(--txt);
}

.contextNavigator {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.contextNavigator button {
  min-height: 32px;
  border-radius: 4px;
  background: transparent;
  color: #aab8cc;
}

.mapToolGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.mapToolGrid button {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 9px;
  justify-content: flex-start;
  border-radius: 4px;
  background: #0d1725;
  color: #c3d0df;
  font: 500 11px/1.2 var(--sans);
}

.mapToolGrid button:hover {
  background: #142237;
}

#layerToggles label {
  min-height: 31px;
  padding: 5px 1px;
  border-bottom: 1px solid rgba(32, 48, 71, .62);
}

#panelShow {
  border-radius: 0 6px 6px 0;
  background: #0c1725;
}

#analystRail {
  width: 380px;
  background: rgba(7, 14, 24, .98);
  border-left: 1px solid #263851;
}

.railIntro {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.railIntro h2 {
  margin: 3px 0 2px;
  font: 650 20px/1.15 var(--display);
  letter-spacing: -.25px;
}

.railIntro p {
  max-width: 34ch;
  color: #8192aa;
}

.railScroll {
  padding: 2px 16px 28px;
}

#analystRail h3,
.feedTitle {
  margin: 16px 0 8px;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--line);
  color: #b7c4d5;
  font: 600 10.5px/1.3 var(--mono);
  letter-spacing: .65px;
  text-transform: none;
}

.feedTitle::before,
#analystRail h3::before {
  display: none !important;
}

.feedrow {
  margin: 0;
  padding: 11px 2px 12px 10px !important;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-left: 2px solid var(--line2) !important;
  border-radius: 0;
  background: transparent;
}

.feedrow:hover,
.feedrow:focus-visible {
  background: #0e1928;
}

.feedrow .ft {
  margin-top: 5px;
  color: #edf3fb;
  font: 600 13.5px/1.42 var(--sans);
}

.evtag,
.metaPill,
.productBadge,
.sourceModeBadge {
  border-radius: 3px !important;
  box-shadow: none !important;
  letter-spacing: .2px;
}

.metaStrip {
  gap: 4px;
}

.fusionProvenance {
  margin-top: 7px;
}

.argusContextButton {
  border-radius: 4px;
  background: transparent;
}

.feedPagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0 2px;
  padding: 9px 0 3px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font: 500 10.5px/1.35 var(--mono);
}

.feedPagination button {
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 4px;
  background: #0f1a29;
  color: var(--accent);
}

.leaflet-bottom.leaflet-right {
  right: 8px;
  bottom: 24px;
}

.leaflet-bottom.leaflet-right .leaflet-control-zoom {
  margin: 0;
}

/* Event and source inspection */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #0b1421;
  color: var(--txt);
}

.leaflet-popup-content-wrapper {
  border: 1px solid #344a67;
  border-radius: 7px;
  box-shadow: 0 26px 72px -28px rgba(0, 0, 0, .96);
}

.leaflet-popup-content {
  min-width: min(292px, calc(100vw - 42px));
  max-width: min(320px, calc(100vw - 42px));
  max-height: min(58vh, 520px);
  margin: 11px 12px 10px;
  overflow-y: auto;
  font: 12px/1.44 var(--sans);
}

.leaflet-popup-close-button {
  top: 7px !important;
  right: 8px !important;
  color: #9aabc2 !important;
}

.aftitle {
  display: block;
  max-width: 31ch;
  padding-right: 18px;
  color: #f1f5fb;
  font: 650 15.5px/1.28 var(--display);
  letter-spacing: -.2px;
}

.eventPopupHead {
  display: block;
  padding: 0 0 7px;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.eventPopupMeta,
.eventPopupPosture {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
}

.eventPopupPosture:empty {
  display: none;
}

.eventPopupSummary {
  color: #dce5f1;
  font-size: 12.25px;
  line-height: 1.48;
}

.eventSourceName {
  margin-top: 8px;
  color: var(--muted);
  font: 500 11px/1.4 var(--mono);
}

.eventPrimarySource {
  display: inline-block;
  margin-top: 8px;
  font-weight: 600;
}

.selectedSource,
.caveatbox {
  margin-top: 10px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.caveatbox summary {
  padding: 9px 0 4px;
  color: #d5a94f;
}

.cvrow {
  padding: 7px 0;
  border-bottom: 1px solid rgba(32, 48, 71, .66);
}

.triagebar {
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.triagebar button {
  min-height: 27px;
  padding: 4px 6px;
  border-radius: 4px;
  background: #0f1a29;
  font-size: 9.5px;
}

/* Modal and drawer grammar */
.sheet,
.sheet.wide {
  border: 1px solid #2b3e59;
  border-radius: 8px;
  background: #0a121e;
  box-shadow: var(--shadow);
}

.sheet .bar,
.drawerBar {
  min-height: 50px;
  border-bottom: 1px solid var(--line);
  background: #0c1624;
}

.sheet .bar b,
.drawerTitle {
  font: 650 14px/1.2 var(--display);
  letter-spacing: .1px;
}

#briefView,
#productView,
#morningBoardView,
#alertsView,
#pirView,
#sourceSettings,
#toolsView {
  background: rgba(3, 7, 13, .76);
  backdrop-filter: blur(3px);
}

#briefView .sheet {
  width: min(1260px, calc(100vw - 40px));
  max-width: 1260px;
  max-height: calc(100vh - 42px);
}

#briefView .sheet > div:last-child {
  padding: 16px 20px 24px !important;
}

#briefView .bar {
  position: sticky;
  top: 0;
  z-index: 3;
}

.briefcfg {
  display: grid;
  grid-template-columns: minmax(240px, .7fr) minmax(0, 1.3fr);
  gap: 0;
  margin: 14px 0 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.briefcfg .grp {
  min-width: 0;
  padding: 14px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #0c1522;
}

.briefcfg .grp:last-child {
  border-right: 0;
}

.premiumPreflight {
  margin: 12px 0;
  border-radius: 5px;
  background: #0b1420;
}

.premiumProductStack {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
}

.premiumProductStack > .grp,
.localProductGrid > .grp {
  position: relative;
  min-width: 0;
  padding: 14px 14px 15px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0c1522;
}

#premiumDailyPanel {
  grid-column: span 4;
}

#securityAnalysisPanel {
  grid-column: span 8;
  border-color: #31566a;
}

#premiumRussianPanel,
#premiumChinesePanel {
  grid-column: span 6;
}

.briefcfg .lab,
.premiumProductStack .lab,
.localProductGrid .lab {
  color: #b6c5d8;
  font: 600 10.5px/1.3 var(--mono);
  letter-spacing: .55px;
  text-transform: none;
}

.briefcfg .cfghint,
.premiumProductStack .cfghint,
.localProductGrid .cfghint {
  color: #8495ad;
  line-height: 1.48;
}

.briefJobSlot:not(:empty),
.securityCandidateTelemetry:not(:empty) {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.securityCandidateCard,
.securityCandidateReviewCard {
  margin: 0;
  padding: 11px 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.securityCandidateCard:hover {
  background: #101b2a;
}

.argusPanel {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid #31566a;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: #091522;
  box-shadow: none;
}

.argusHead {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.argusControls {
  display: grid;
  grid-template-columns: minmax(190px, .8fr) minmax(220px, 1.2fr) auto auto;
  gap: 7px;
}

#argusQuestion {
  min-height: 92px;
  border-radius: 5px;
  background: #070e18;
}

.argusResult {
  border: 0;
  background: transparent;
}

.argusEventCard {
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.argusEventCard:last-child {
  border-bottom: 0;
}

.argusThreadBox,
.argusBudgetEditor,
.argusEvidenceBox,
.argusEvalBox {
  border-top: 1px solid var(--line);
}

.argusVoicePopover {
  width: min(540px, calc(100vw - 24px));
  top: 70px;
  left: 18px;
  border-radius: 7px;
  background: #091522;
  box-shadow: var(--shadow);
}

.argusVoiceHead {
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.argusVoiceControls {
  gap: 6px;
}

.localProductGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

#briefJobs,
#briefHistory,
#briefBody {
  margin-top: 12px;
}

#productView .sheet {
  width: min(1180px, calc(100vw - 40px));
  max-width: 1180px;
}

#productBody {
  padding: 20px 24px 32px;
}

.premiumQualityRail {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #09131f;
}

.premiumQualityCell {
  background: transparent;
}

#pirView .sheet,
#morningBoardView .sheet {
  width: min(1320px, calc(100vw - 32px));
  max-width: 1320px;
}

#claimDetailDrawer,
#morningDecisionWorkspace,
#countryDossierDrawer,
#pirMatchDrawer,
#iwMatchDrawer {
  border-left: 1px solid #31465f;
  background: #09121d;
  box-shadow: -24px 0 70px -40px rgba(0, 0, 0, .95);
}

.drawerBody {
  padding: 16px 18px 28px;
}

.morningPanel,
.sourceSettingsCard,
.claimDetailSection {
  border-radius: 5px;
  background: #0c1623;
}

/* Copy and glyph cleanup for operational controls */
.hint {
  color: #8495ad;
}

@media (max-width: 1100px) {
  body {
    height: auto;
    overflow: auto;
  }

  main[aria-label="GIANO operating picture"] {
    display: block;
    height: auto;
    overflow: visible;
  }

  #leafmap {
    height: 62vh;
    min-height: 410px;
  }

  #analystRail {
    width: 100%;
    height: auto;
    max-height: none;
    border-left: 0;
    border-top: 1px solid #263851;
  }

  .railScroll {
    overflow: visible;
  }

  #mapFilters {
    width: 330px;
    max-height: min(56vh, 520px);
  }

  #premiumDailyPanel,
  #securityAnalysisPanel,
  #premiumRussianPanel,
  #premiumChinesePanel {
    grid-column: 1 / -1;
  }

  .argusControls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .omniShell {
    min-width: 0;
    max-width: none;
  }

  #mapFilters {
    width: min(338px, calc(100vw - 16px));
  }

  #analystRail {
    width: 100%;
  }

  #briefView .sheet,
  #productView .sheet,
  #pirView .sheet,
  #morningBoardView .sheet {
    width: 100vw;
    max-width: 100vw;
  }

  .briefcfg,
  .localProductGrid,
  .argusControls {
    grid-template-columns: 1fr;
  }

  .briefcfg .grp {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .briefcfg .grp:last-child {
    border-bottom: 0;
  }

  .premiumProductStack {
    display: block;
  }

  .premiumProductStack > .grp {
    margin-bottom: 9px;
  }

  .argusVoicePopover {
    top: var(--header-h, 104px);
    left: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  button,
  .button,
  select,
  input,
  textarea,
  summary {
    transition: none !important;
  }
}
