/* v1.9 squad screen: roster + operator detail (bottom sheet on phones), traits, loadout bars, identity, emblem editor */
.ic-bandage { width: 16px; height: 16px; vertical-align: -3px; flex: 0 0 auto; }
.ic-lock { width: 10px; height: 10px; vertical-align: -1px; margin-right: 4px; opacity: 0.8; }
.r-top b .ic-bandage { width: 13px; height: 13px; vertical-align: -2px; }

/* identity bar: emblem + camo */
.sq-ident { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 12px 14px; background: var(--panel-solid); border: 1px solid var(--line); }
.sq-em { display: flex; align-items: center; gap: 12px; padding: 4px 14px 4px 4px; background: transparent; border: 1px solid #2B3A2F; color: var(--text); text-align: left; }
.sq-em:hover { border-color: var(--green); }
.sq-em img { width: 64px; height: 64px; display: block; }
.sq-em span { display: flex; flex-direction: column; gap: 4px; }
.sq-em b { font-family: var(--display); font-size: 20px; letter-spacing: 0.08em; }
.sq-em small { font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; color: var(--green); }
.sq-ident .camo-row { flex: 1; min-width: 260px; }

/* layout */
.sq-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 440px); gap: 16px; align-items: start; }
.sq-roster { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sq-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; margin-bottom: 8px; }
.sq-card { position: relative; display: flex; align-items: stretch; background: #0F1612; border: 1px solid var(--line); min-width: 0; }
.sq-card.in { background: var(--sel); border-color: #24563A; }
.sq-card.focus { border-color: var(--green); box-shadow: inset 3px 0 0 var(--green); }
.sq-card.hire { border-style: dashed; }
.sq-card.kia { opacity: 0.45; filter: grayscale(1); }
.sq-card-main { flex: 1; display: flex; gap: 10px; align-items: center; padding: 7px 8px; background: transparent; border: none; color: var(--text); text-align: left; min-width: 0; }
.sq-card-main img { width: 46px; height: 54px; object-fit: cover; border: 1px solid var(--line2); flex: 0 0 auto; }
.sq-c-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sq-c-body b { font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: 0.04em; line-height: 1; }
.sq-c-body b em.lvl { font-style: normal; font-family: var(--mono); font-size: 9px; color: var(--amber); margin-left: 6px; vertical-align: 2px; }
.sq-c-role { font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sq-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-flex; align-items: center; gap: 3px; height: 17px; padding: 0 5px; font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.1em; border: 1px solid var(--line2); color: var(--muted); }
.chip .ic-bandage { width: 12px; height: 12px; }
.chip.inj { color: #F0D9C8; border-color: #6A3A2E; background: rgba(120, 40, 30, 0.25); }
.chip.trait { color: var(--amber); border-color: #5A4A1E; background: rgba(60, 48, 14, 0.35); }
.chip.kia { color: var(--red); border-color: #5A2A22; }
.chip.hire { color: var(--amber); border-style: dashed; }
.sq-toggle { flex: 0 0 40px; display: flex; align-items: center; justify-content: center; background: transparent; border: none; border-left: 1px solid var(--line); color: var(--green); font-family: var(--display); font-size: 26px; font-weight: 700; }
.sq-toggle:hover:not(:disabled) { background: rgba(124, 255, 154, 0.08); }
.sq-toggle.out { color: var(--amber); }
.sq-toggle:disabled { color: var(--dim); cursor: default; }
.sq-toggle.you { font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; color: var(--muted); }

/* detail panel */
.sq-detail-wrap { position: sticky; top: 8px; }
.sq-scrim { display: none; }
.sq-detail { background: var(--panel-solid); border: 1px solid #24563A; padding: 16px; display: flex; flex-direction: column; gap: 14px; max-height: calc(var(--vh, 100vh) - 2 * var(--ad-h) - 40px); overflow: auto; }
.sq-detail section { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.sq-detail .panel-title { padding: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sq-detail .panel-title small { font-size: 9px; letter-spacing: 0.1em; color: var(--dim); text-transform: uppercase; }
.sq-pend { font-style: normal; color: var(--amber); }
.sq-d-head { display: flex; gap: 14px; align-items: flex-start; }
.sq-d-face { width: 96px; height: 112px; object-fit: cover; border: 1px solid var(--line2); flex: 0 0 auto; }
.sq-d-id { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.sq-d-id h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 40px; line-height: 0.95; color: #F3F6F2; }
.sq-d-id .sub { font-size: 13px; color: var(--muted); }
.sq-xp { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; margin-top: 8px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; color: var(--amber); }
.sq-xp .sq-bar .fill { background: var(--amber); }
.sq-close { display: none; width: 36px; height: 36px; background: transparent; border: 1px solid #2B3A2F; color: var(--muted); font-size: 20px; flex: 0 0 auto; }
.sq-bio { margin: 0; font-size: 14px; color: #B4C0B6; line-height: 1.45; }
.sq-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; color: var(--muted); }
.sq-status .good { color: var(--green); } .sq-status .bad { color: var(--red); } .sq-status .amber { color: var(--amber); }
.sq-act { height: 40px; font-size: 16px; padding: 0 16px; }
.sq-act.primary { font-size: 17px; padding: 0 18px; }
.sq-inj { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid #6A3A2E; background: rgba(120, 40, 30, 0.2); }
.sq-inj .ic-bandage { width: 26px; height: 26px; }
.sq-inj div { display: flex; flex-direction: column; gap: 3px; }
.sq-inj b { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; color: #F0D9C8; }
.sq-inj span { font-size: 13px; color: #CDB8AA; line-height: 1.4; }

/* traits */
.sq-tier { display: grid; grid-template-columns: 44px 1fr 1fr; gap: 6px; align-items: stretch; }
.sq-tier-lv { display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; color: var(--amber); border: 1px solid #3A3418; }
.sq-tier.locked .sq-tier-lv { color: var(--dim); border-color: var(--line); }
.sq-trait { display: flex; flex-direction: column; gap: 3px; padding: 8px 9px; background: #0F1612; border: 1px solid var(--line2); color: var(--text); text-align: left; min-height: 64px; }
.sq-trait b { font-family: var(--display); font-size: 16px; letter-spacing: 0.06em; }
.sq-trait span { font-size: 12px; line-height: 1.3; color: #9FB0A2; }
.sq-trait:not(:disabled):hover { border-color: var(--amber); background: rgba(60, 48, 14, 0.3); }
.sq-trait:not(:disabled) { border-color: #5A4A1E; box-shadow: inset 0 0 0 1px rgba(242, 181, 68, 0.15); }
.sq-trait:disabled { cursor: default; }
.sq-trait.picked { border-color: var(--green); background: var(--sel); }
.sq-trait.picked b { color: var(--green); }
.sq-trait.other, .sq-tier.locked .sq-trait { opacity: 0.42; }

/* loadout */
.sq-lo { display: grid; grid-template-columns: 92px 1fr; gap: 8px; align-items: center; }
.sq-lo .k, .sq-stat .k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; color: var(--muted); }
.sq-na { font-size: 12px; color: var(--dim); }
.sq-seg { display: flex; border: 1px solid #2B3A2F; }
.sq-seg button { flex: 1; height: 34px; padding: 0 6px; background: transparent; border: none; border-left: 1px solid #2B3A2F; color: #B4C0B6; font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; white-space: nowrap; }
.sq-seg button:first-child { border-left: none; }
.sq-seg button.on { background: var(--green); color: #0B0F0C; font-weight: 500; }
.sq-seg button:disabled { color: var(--dim); cursor: default; }
.sq-seg button:not(.on):not(:disabled):hover { background: rgba(124, 255, 154, 0.08); }
.sq-stats { display: flex; flex-direction: column; gap: 7px; padding: 10px 12px; background: #0A100C; border: 1px solid var(--line); }
.sq-stat { display: grid; grid-template-columns: 92px 1fr 84px; gap: 10px; align-items: center; }
.sq-stat .v { font-family: var(--mono); font-size: 11px; color: var(--text); text-align: right; white-space: nowrap; }
.sq-bar { position: relative; display: block; height: 8px; background: #18231C; }
.sq-bar .fill { display: block; height: 100%; background: var(--green); transition: width 0.25s ease; }
.sq-bar .fill.up { background: linear-gradient(90deg, var(--green), #B6FFC8); }
.sq-bar .fill.down { background: #B9C7BC; }
.sq-stat.noise .fill { background: var(--green); }
.sq-stat.noise .fill.up { background: var(--red); }
.sq-stat.noise .fill.down { background: linear-gradient(90deg, var(--green), #B6FFC8); }
.sq-bar .base { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--amber); }
.sq-legend { font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em; color: var(--dim); display: flex; align-items: center; gap: 6px; }
.sq-legend .tick { display: inline-block; width: 2px; height: 10px; background: var(--amber); }

/* identity pickers */
.sq-paints { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.sq-paint { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px; background: transparent; border: 1px solid var(--line2); color: var(--muted); font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.1em; }
.sq-paint img { width: 100%; aspect-ratio: 120 / 140; object-fit: cover; display: block; }
.sq-paint.on { border-color: var(--green); color: var(--green); }
.sq-patches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.sq-patch { padding: 6px 2px; background: transparent; border: 1px solid var(--line2); display: flex; align-items: center; justify-content: center; }
.sq-patch img { width: 100%; max-width: 44px; display: block; }
.sq-patch.on { border-color: var(--green); background: var(--sel); }

/* emblem editor */
.em-modal { z-index: 30; padding: 16px; }
.em-card { width: min(560px, 100%); max-height: calc(100% - 8px); overflow: auto; background: var(--panel-solid); border: 1px solid #2E7A47; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.em-top { display: flex; gap: 16px; align-items: center; }
.em-top > div { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.em-top h2 { margin: 0; font-family: var(--display); font-size: 28px; color: #F3F6F2; }
.em-top p { margin: 0; font-size: 13px; color: var(--muted); }
.em-top .sq-close { display: inline-block; align-self: flex-start; }
.em-preview { width: 120px; height: 120px; }
.em-row { display: flex; flex-wrap: wrap; gap: 6px; }
.em-opt { width: 50px; height: 50px; padding: 4px; background: #0F1612; border: 1px solid var(--line2); display: flex; align-items: center; justify-content: center; }
.em-opt img { width: 40px; height: 40px; }
.em-opt i { width: 30px; height: 30px; border: 1px solid rgba(255, 255, 255, 0.2); display: block; }
.em-opt.on { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.em-card .actions { margin-top: 6px; }

/* briefing / debrief */
.b-op.inj { border-color: #6A3A2E; }
.b-op .b-inj { font-style: normal; color: #F0B8A8; }
.db-medals span.inj { border-color: #6A3A2E; color: #F0D9C8; background: rgba(120, 40, 30, 0.25); display: inline-flex; align-items: center; gap: 6px; }
.db-trait { padding: 6px 10px; border: 1px solid var(--amber); color: #0B0F0C; background: var(--amber); font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; }
.db-emblem { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; color: var(--muted); }
.db-emblem img { width: 48px; height: 48px; }

/* phones: one column, the detail opens as a bottom sheet */
@media (max-width: 900px) {
  .sq-layout { grid-template-columns: 1fr; }
  .sq-list { grid-template-columns: 1fr; }
  .sq-ident { padding: 10px; gap: 12px; }
  .sq-ident { flex-direction: column; align-items: stretch; }
  .sq-ident .camo-row { min-width: 0; width: 100%; }
  .sq-ident .sq-em img { width: 52px; height: 52px; }
  .sq-ident .camo { height: 30px; padding: 0 8px; font-size: 9px; }
  .sq-detail-wrap { position: fixed; inset: 0; z-index: 25; pointer-events: none; }
  .sq-detail-wrap .sq-scrim { display: block; position: absolute; inset: 0; background: rgba(3, 5, 4, 0.7); opacity: 0; transition: opacity 0.2s; }
  .sq-detail { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88%; max-height: 88dvh; border: none; border-top: 2px solid var(--green); padding: 14px 14px calc(18px + env(safe-area-inset-bottom)); transform: translateY(105%); transition: transform 0.25s ease; box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.6); }
  .sq-detail-wrap.open { pointer-events: auto; }
  .sq-detail-wrap.open .sq-scrim { opacity: 1; }
  .sq-detail-wrap.open .sq-detail { transform: none; }
  .sq-close { display: inline-block; }
  .sq-d-face { width: 76px; height: 89px; }
  .sq-d-id h2 { font-size: 32px; }
  .sq-tier { grid-template-columns: 1fr 1fr; }
  .sq-tier-lv { grid-column: 1 / -1; justify-content: flex-start; padding: 3px 6px; border: none; border-bottom: 1px solid #3A3418; }
  .sq-lo { grid-template-columns: 1fr; gap: 4px; }
  .sq-stat { grid-template-columns: 78px 1fr 96px; gap: 8px; }
  .sq-seg button { height: 40px; }
  .sq-patches { grid-template-columns: repeat(4, 1fr); }
  .em-opt { width: 46px; height: 46px; }
  .em-preview { width: 84px; height: 84px; }
  body.sq-sheet-open #lobbybar { visibility: hidden; }
}
