/* Commander Tracker — Alpha V0.0.1
   Rules remain in original cascade order to preserve the current UI. */
#commander-table {
  --ct-bg:light-dark(#e9e9e4,#141816);
  --ct-panel:light-dark(#fafbf7,#202723);
  --ct-ink:light-dark(#202d26,#edf3ec);
  --ct-muted:light-dark(#58655c,#afbeb2);
  --ct-line:light-dark(#d5ddd3,#3d4940);
  --ct-button:light-dark(#e9eee5,#303d33);
  --ct-gold:light-dark(#725516,#edcc7e);
  font-family:ui-sans-serif,system-ui,sans-serif;
  color:var(--ct-ink);
  background:var(--ct-bg);
  border-radius:0;
  overflow:hidden;
  position:relative;
  font-size:14px;
  line-height:1.4
}

    #commander-table * {
  box-sizing:border-box
}

    #commander-table button,#commander-table select {
  font:inherit;
  color:inherit;
  cursor:pointer
}

    #commander-table button {
  border:1px solid var(--ct-line);
  background:var(--ct-button);
  border-radius:10px;
  min-height:44px;
  padding:8px 12px;
  touch-action:manipulation
}

    #commander-table button:hover {
  filter:brightness(1.06)
}

    #commander-table button:disabled {
  opacity:.4;
  cursor:default
}

    #commander-table .ct-bar {
  display:flex;
  position:relative;
  isolation:isolate;
  align-items:center;
  justify-content:center;
  gap:6px;
  padding:4px 8px;
  min-height:52px;
  border-radius:8px;
  background:var(--ct-bg);
  color:var(--ct-ink)
}

    #commander-table .ct-bar button {
  min-width:44px;
  padding:8px;
  background:transparent;
  border-color:transparent;
  color:inherit;
  position:relative;
  z-index:1
}

    #commander-table .ct-bar button svg {
  width:19px;
  height:19px
}

    #commander-table .ct-day-picker {
  display:flex;
  align-items:center;
  gap:4px;
  z-index:1;
  font-size:12px
}

    #commander-table .ct-day-picker select {
  width:114px;
  min-height:44px;
  border:1px solid currentColor;
  border-radius:8px;
  background:transparent;
  color:inherit;
  padding:4px;
  font:inherit
}

    #commander-table .ct-day-picker option {
  background:var(--ct-panel);
  color:var(--ct-ink)
}

    #commander-table .ct-bar[data-phase=day] {
  background:linear-gradient(100deg,#f2dc94,#c5e4ed 60%,#f7e6b7);
  color:#273b43
}

    #commander-table .ct-bar[data-phase=night] {
  background:linear-gradient(100deg,#162337,#273153 65%,#172736);
  color:#edf1ff
}

    #commander-table .ct-sky {
  position:absolute;
  left:12px;
  top:50%;
  transform:translateY(-50%);
  pointer-events:none;
  opacity:.65
}

    #commander-table .ct-sky svg {
  width:32px;
  height:32px
}

    #commander-table .ct-bar[data-phase=night] .ct-sky:after {
  content:'✦ · ✧';
  position:absolute;
  left:40px;
  top:0;
  white-space:nowrap
}

    #commander-table .ct-bar.ct-phase-change .ct-sky {
  animation:ct-sky-rise .35s ease-out
}

    @keyframes ct-sky-rise {
  from {
  opacity:0;
  transform:translateY(0)
}
to {
  opacity:.65;
  transform:translateY(-50%)
}

}

    @media(prefers-reduced-motion:reduce) {
  #commander-table .ct-bar.ct-phase-change .ct-sky {
  animation:none
}

}

    #commander-table .ct-menu-heading {
  font-size:11px;
  letter-spacing:.08em;
  color:var(--ct-muted);
  margin:20px 0 6px
}

    #commander-table .ct-toggle {
  position:relative;
  appearance:none;
  width:48px;
  height:28px;
  border:1px solid var(--ct-line);
  border-radius:18px;
  background:var(--ct-bg);
  cursor:pointer;
  flex-shrink:0;
  margin:8px 0
}

    #commander-table .ct-toggle:before {
  content:'';
  position:absolute;
  width:20px;
  height:20px;
  left:3px;
  top:3px;
  border-radius:50%;
  background:var(--ct-muted)
}

    #commander-table .ct-toggle:checked {
  border-color:var(--ct-gold);
  background:var(--ct-button)
}

    #commander-table .ct-toggle:checked:before {
  left:23px;
  background:var(--ct-gold)
}

    #commander-table .ct-tools {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px
}

    #commander-table .ct-panel.ct-blessed {
  box-shadow:inset 0 0 0 2px var(--ct-gold),inset 0 0 14px light-dark(#b9993b18,#edcc7e12)
}

    #commander-table .ct-brand {
  font-size:13px;
  font-weight:650;
  letter-spacing:.14em;
  flex:1
}

    #commander-table .ct-meta {
  color:var(--ct-muted);
  font-size:12px;
  letter-spacing:0;
  font-weight:400;
  margin-top:3px
}

    #commander-table .ct-clock {
  font-variant-numeric:tabular-nums;
  padding:0 6px
}

    #commander-table .ct-grid {
  display:flex;
  flex-direction:column;
  gap:4px;
  padding:8px
}

    #commander-table .ct-bank {
  display:grid;
  grid-template-columns:repeat(var(--bank-cols,2),minmax(0,1fr));
  gap:4px
}

    #commander-table .ct-seat {
  position:relative;
  min-width:0
}

    #commander-table .ct-seat .ct-panel {
  height:100%
}

    #commander-table .ct-seat[data-side=true] {
  height:420px
}

    #commander-table .ct-seat[data-side=true] .ct-panel {
  position:absolute;
  left:50%;
  top:50%;
  width:420px;
  height:var(--side-height,360px);
  transform:translate(-50%,-50%) rotate(var(--orientation));
  padding:12px
}

    #commander-table .ct-seat[data-side=true] .ct-life {
  height:88px
}

    #commander-table .ct-seat[data-side=true] .ct-number {
  font-size:64px!important
}

    #commander-table .ct-compact .ct-panel {
  padding:10px
}

    #commander-table .ct-compact .ct-life {
  height:92px
}

    #commander-table .ct-compact .ct-number {
  font-size:64px!important
}

    #commander-table .ct-compact .ct-name {
  font-size:15px
}

    #commander-table .ct-compact .ct-damages {
  grid-template-columns:repeat(2,minmax(0,1fr))
}

    #commander-table .ct-panel {
  background:var(--ct-panel);
  padding:16px 20px;
  border-radius:15px;
  min-width:0;
  border-top:3px solid var(--seat-color)
}

    #commander-table .ct-head {
  display:flex;
  align-items:center;
  gap:9px
}

    #commander-table .ct-person {
  flex:1;
  min-width:0
}

    #commander-table .ct-name {
  font-size:18px;
  font-weight:600
}

    #commander-table .ct-commander {
  font-size:12px;
  color:var(--ct-muted);
  overflow-wrap:anywhere
}

    #commander-table .ct-handle {
  border:0;
  background:transparent;
  padding:4px;
  color:var(--ct-muted);
  min-width:32px;
  font-size:22px
}

    #commander-table .ct-tax {
  font-size:12px;
  white-space:nowrap
}

    #commander-table .ct-tax strong {
  display:block;
  font-size:17px;
  font-weight:500
}

    #commander-table .ct-life {
  position:relative;
  display:grid;
  grid-template-columns:1fr 1fr;
  height:137px;
  margin:4px 0
}

    #commander-table .ct-life button {
  background:transparent;
  border:0;
  font-size:23px;
  color:var(--ct-muted);
  border-radius:14px;
  text-align:left;
  user-select:none;
  -webkit-user-select:none
}

    #commander-table .ct-life button:last-of-type {
  text-align:right
}

    #commander-table .ct-number {
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  pointer-events:none;
  font-size:88px;
  letter-spacing:-.055em;
  font-weight:500;
  font-variant-numeric:tabular-nums
}

    #commander-table .ct-skull {
  display:block;
  width:1.15em;
  height:1.15em;
  object-fit:contain
}

    @media(prefers-color-scheme:dark) {
  #commander-table .ct-skull {
  filter:invert(1)
}

}

    #commander-table [data-life],#commander-table #ct-dminus,#commander-table #ct-dplus,#commander-table [data-counter-step] {
  touch-action:none
}

    #commander-table .ct-counter-row {
  display:grid;
  grid-template-columns:44px minmax(0,1fr) 44px 48px 44px 44px;
  align-items:center;
  gap:5px;
  padding:7px 0;
  border-bottom:1px solid var(--ct-line)
}

    #commander-table .ct-counter-name {
  min-width:0;
  overflow-wrap:anywhere
}

    #commander-table .ct-info {
  display:grid;
  place-items:center;
  flex:0 0 44px;
  width:44px;
  padding:8px;
  background:transparent;
  border-color:transparent;
  color:var(--ct-muted)
}

    #commander-table .ct-info svg {
  width:19px;
  height:19px
}

    #commander-table .ct-status-name {
  flex:1;
  min-width:0;
  overflow-wrap:anywhere
}

    #commander-table [data-pinned-counter],#commander-table [data-help] {
  touch-action:none
}

    #commander-table .ct-help-image {
  display:block;
  width:100%;
  max-width:310px;
  height:auto;
  margin:12px auto;
  border-radius:12px
}

    #commander-table .ct-help-text {
  font-size:14px;
  line-height:1.6
}

    #commander-table .ct-rule-source {
  font-size:12px;
  color:var(--ct-muted)
}

    #commander-table .ct-day-controls {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:12px 0
}

    #commander-table .ct-day-controls select {
  padding:10px;
  background:var(--ct-button);
  border:1px solid var(--ct-line);
  border-radius:8px;
  max-width:100%
}

    #commander-table .ct-counter-name small {
  display:block;
  color:var(--ct-muted);
  font-size:11px
}

    #commander-table .ct-counter-row output {
  text-align:center;
  font-size:21px;
  font-variant-numeric:tabular-nums
}

    #commander-table .ct-counter-row button {
  padding:6px;
  display:grid;
  place-items:center
}

    #commander-table .ct-pin {
  background:transparent;
  color:var(--ct-muted)
}

    #commander-table .ct-pin[aria-pressed=true] {
  color:var(--ct-gold);
  border-color:var(--ct-gold)
}

    #commander-table .ct-pinned {
  display:flex;
  align-items:center;
  gap:4px;
  flex-wrap:wrap;
  flex:1;
  min-width:0;
  margin:0
}

    #commander-table .ct-pinned:empty {
  display:none
}

    #commander-table .ct-pinned button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  font-size:17px;
  min-width:44px;
  min-height:44px;
  padding:6px 8px;
  background:transparent;
  max-width:100%;
  font-variant-numeric:tabular-nums
}

    #commander-table .ct-pinned svg {
  width:21px;
  height:21px;
  flex-shrink:0
}

    #commander-table .ct-pinned .ct-counter-value {
  overflow-wrap:anywhere;
  min-width:0
}

    #commander-table .ct-custom-form {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:18px
}

    #commander-table .ct-custom-form label {
  width:100%;
  font-size:12px;
  color:var(--ct-muted)
}

    #commander-table input[type=text] {
  font:inherit;
  font-size:16px;
  min-width:0;
  flex:1;
  width:130px;
  border:1px solid var(--ct-line);
  border-radius:9px;
  padding:10px;
  background:var(--ct-bg);
  color:var(--ct-ink)
}

    #commander-table .ct-counter-error {
  color:light-dark(#a32f27,#ffada4);
  font-size:12px;
  min-height:0
}

    #commander-table .ct-counter-toolbar {
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:space-between;
  margin:16px 0 6px
}

    #commander-table .ct-counter-toolbar span {
  font-size:12px;
  color:var(--ct-muted)
}

    #commander-table .ct-dialog.ct-counter-dialog {
  width:470px;
  padding:18px
}

    @media(max-width:440px) {
  #commander-table .ct-overlay {
  padding:8px
}
#commander-table .ct-dialog.ct-counter-dialog {
  padding:12px
}
#commander-table .ct-counter-row {
  grid-template-columns:44px minmax(0,1fr) 44px 44px 44px;
  gap:3px
}
#commander-table .ct-counter-row .ct-counter-name {
  grid-column:2/-1
}
#commander-table .ct-counter-row [data-counter-step="-1"] {
  grid-column:2
}
#commander-table .ct-counter-row output {
  grid-column:3
}
#commander-table .ct-counter-row [data-counter-step="1"] {
  grid-column:4
}
#commander-table .ct-counter-row .ct-pin {
  grid-column:5
}

}

    #commander-table .ct-more {
  display:flex;
  align-items:center;
  gap:8px
}

    #commander-table .ct-more span {
  font-size:12px
}

    #commander-table .ct-more b {
  font-size:32px;
  line-height:24px;
  letter-spacing:3px;
  font-weight:600
}

    #commander-table .ct-damages {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:7px
}

    #commander-table .ct-damage {
  min-width:0;
  text-align:left;
  padding:8px 10px;
  background:transparent
}

    #commander-table .ct-damage span {
  display:block;
  font-size:11px;
  color:var(--ct-muted);
  overflow-wrap:anywhere
}

    #commander-table .ct-damage b {
  font-weight:500;
  font-size:23px;
  display:block;
  font-variant-numeric:tabular-nums
}

    #commander-table .ct-foot {
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:8px;
  margin-top:12px
}

    #commander-table .ct-more {
  flex-shrink:0
}

    #commander-table .ct-monarch {
  background:transparent;
  border-color:transparent;
  color:var(--ct-muted)
}

    #commander-table .ct-pinned .ct-monarch svg {
  width:32px;
  height:32px
}

    #commander-table .ct-monarch[aria-pressed=true] {
  color:var(--ct-gold);
  border-color:var(--ct-gold)
}

    #commander-table .ct-status {
  color:var(--ct-muted);
  font-size:12px;
  padding:12px 20px;
  min-height:42px
}

    #commander-table .ct-panel {
  transform:rotate(var(--orientation,0deg))
}

    #commander-table .ct-overlay {
  position:absolute;
  left:0;
  right:0;
  top:0;
  z-index:4;
  background:light-dark(#e9e9e4ee,#141816ee);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:8px
}

    #commander-table .ct-overlay[hidden] {
  display:none
}

    #commander-table .ct-dialog-shell {
  position:relative;
  flex:none
}

    #commander-table .ct-dialog {
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%) rotate(var(--dialog-angle,0deg));
  background:var(--ct-panel);
  border:1px solid var(--ct-line);
  border-radius:18px;
  padding:20px;
  width:420px;
  overflow:auto;
  overscroll-behavior:contain;
  scrollbar-width:thin
}

    #commander-table .ct-dialog h3 {
  margin:0 0 16px;
  font-size:20px
}

    #commander-table .ct-dialog p {
  color:var(--ct-muted)
}

    #commander-table .ct-row {
  display:flex;
  align-items:center;
  gap:10px;
  margin:12px 0;
  flex-wrap:wrap
}

    #commander-table .ct-row label {
  flex:1
}

    #commander-table .ct-row output {
  min-width:28px;
  text-align:center;
  font-size:22px
}

    #commander-table .ct-close {
  float:right
}

    #commander-table .ct-menu-actions {
  float:right;
  display:flex;
  gap:6px;
  margin-left:8px
}

    #commander-table .ct-menu-actions .ct-close {
  float:none
}

    #commander-table .ct-menu-title {
  min-height:58px
}

    #commander-table .ct-menu-title>span {
  font-size:12px;
  color:var(--ct-muted)
}

    #commander-table .ct-menu-title h3 {
  margin:4px 0 14px
}

    #commander-table .ct-menu-title+.ct-menu-heading {
  clear:both
}

    #commander-table .ct-quick-resource {
  display:inline-flex;
  align-items:center;
  border:1px solid var(--ct-line);
  border-radius:10px;
  max-width:100%
}

    #commander-table .ct-quick-resource button {
  border:0;
  border-radius:8px;
  padding:4px;
  min-width:44px
}

    #commander-table [data-resource-step] {
  touch-action:none
}


    #commander-table .ct-panel.ct-picked {
  outline:3px solid var(--ct-gold);
  outline-offset:-4px
}

    @media(max-width:620px) {
  #commander-table .ct-panel {
  padding:12px
}
#commander-table .ct-bar {
  padding:12px
}
#commander-table .ct-brand {
  flex-basis:100%
}
#commander-table .ct-head {
  flex-wrap:wrap
}
#commander-table .ct-tax {
  margin-left:auto
}
#commander-table .ct-name {
  font-size:16px
}
#commander-table .ct-number {
  font-size:70px
}
#commander-table .ct-life {
  height:118px
}
#commander-table .ct-damages {
  gap:4px
}
#commander-table .ct-damage {
  padding:6px
}
#commander-table .ct-foot {
  flex-wrap:wrap
}

}

    @media(max-width:640px) {
  #commander-table .ct-bank {
  grid-template-columns:repeat(2,minmax(0,1fr))
}
#commander-table .ct-bank[data-count="1"] {
  grid-template-columns:1fr
}
#commander-table .ct-bar {
  padding:4px;
  gap:2px
}
#commander-table .ct-day-label {
  display:none
}
#commander-table .ct-sky {
  display:none
}

}

    @media(max-width:440px) {
  #commander-table .ct-bank {
  grid-template-columns:1fr
}
#commander-table .ct-bar {
  flex-wrap:nowrap
}
#commander-table .ct-day-picker select {
  width:98px
}
#commander-table .ct-clock {
  padding:0;
  font-size:12px
}
#commander-table .ct-bar .ct-info {
  min-width:32px;
  width:32px;
  flex-basis:32px
}

}


    #commander-table .ct-counter-name,#commander-table .ct-status-name {
  display:flex;
  align-items:center;
  gap:8px
}

    #commander-table .ct-menu-symbol {
  display:inline-flex;
  flex-shrink:0
}

    #commander-table .ct-menu-symbol svg,#commander-table .ct-tools svg {
  width:20px;
  height:20px;
  flex-shrink:0
}

    #commander-table .ct-tools {
  display:grid;
  grid-template-columns:1fr;
  gap:4px
}

    #commander-table .ct-tools button {
  display:flex;
  align-items:center;
  gap:12px;
  text-align:left;
  min-height:44px;
  background:transparent
}

    #commander-table .ct-phase-switch {
  position:relative;
  display:flex;
  align-items:center;
  justify-content:space-between;
  width:100px;
  min-width:100px;
  height:40px;
  padding:7px 9px;
  border-radius:24px;
  color:inherit;
  background:transparent
}

    #commander-table .ct-phase-switch svg {
  width:20px;
  height:20px;
  z-index:1
}

    #commander-table .ct-phase-thumb {
  position:absolute;
  left:34px;
  top:4px;
  width:30px;
  height:30px;
  border-radius:50%;
  background:currentColor;
  opacity:.22;
  transition:left .2s ease
}

    #commander-table .ct-phase-switch[data-state=day] .ct-phase-thumb {
  left:4px
}

    #commander-table .ct-phase-switch[data-state=night] .ct-phase-thumb {
  left:64px
}

    #commander-table .ct-seat {
  container-type:inline-size
}

    #commander-table .ct-foot {
  position:relative;
  display:block;
  height:188px;
  padding-bottom:48px
}

    #commander-table .ct-pinned {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  grid-auto-rows:44px;
  gap:4px;
  align-items:center
}

    #commander-table .ct-counter-slot {
  min-width:0;
  height:44px;
  display:flex;
  align-items:center
}

    #commander-table .ct-pinned>.ct-monarch {
  justify-self:start
}

    #commander-table .ct-foot>.ct-more {
  position:absolute;
  right:0;
  bottom:0
}

    #commander-table .ct-quick-resource {
  width:100px;
  max-width:100%;
  justify-content:space-between
}

    #commander-table .ct-quick-resource button {
  min-width:26px;
  padding:2px;
  gap:2px;
  font-size:15px
}

    #commander-table .ct-quick-resource [data-pinned-counter] {
  flex:1
}

    #commander-table .ct-quick-resource svg {
  width:17px;
  height:17px
}

    @container(max-width:350px) {
  #commander-table .ct-pinned {
  grid-template-columns:repeat(2,minmax(0,1fr))
}
#commander-table .ct-foot {
  height:284px
}

}

    @media(prefers-reduced-motion:reduce) {
  #commander-table .ct-phase-thumb {
  transition:none
}

}


    #commander-table .ct-seat .ct-panel {
  height:345px;
  display:grid;
  grid-template-rows:52px minmax(0,1fr) 66px 88px;
  gap:4px;
  padding:12px 16px
}

    #commander-table .ct-head {
  flex-wrap:nowrap;
  gap:6px;
  min-width:0
}

    #commander-table .ct-handle {
  min-width:20px;
  width:20px;
  padding:0
}

    #commander-table .ct-person {
  margin-right:6px;
  overflow:hidden
}

    #commander-table .ct-name {
  font-size:16px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis
}

    #commander-table .ct-commander {
  font-size:11px;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden
}

    #commander-table .ct-progress-tax {
  display:flex;
  align-items:center;
  gap:6px;
  flex-shrink:0
}

    #commander-table .ct-progress-tax button {
  height:44px;
  min-height:44px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  padding:4px
}

    #commander-table .ct-progress-tax [data-pinned-counter] {
  width:42px;
  min-width:42px;
  font-size:15px
}

    #commander-table .ct-progress-tax svg {
  width:17px;
  height:17px
}

    #commander-table .ct-progress-tax .ct-tax {
  margin:0;
  width:auto;
  min-width:64px;
  padding:4px 8px
}

    #commander-table .ct-life {
  height:auto!important;
  margin:0
}

    #commander-table .ct-damages {
  min-width:0;
  gap:5px
}

    #commander-table .ct-damage {
  padding:5px;
  overflow:hidden
}

    #commander-table .ct-damage span {
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden
}

    #commander-table .ct-foot {
  height:88px;
  margin:0;
  padding:0;
  min-width:0
}

    #commander-table .ct-pinned {
  display:flex;
  flex-wrap:nowrap;
  align-items:center;
  justify-content:flex-start;
  gap:3px;
  height:40px;
  min-width:0;
  width:100%
}

    #commander-table .ct-pinned>button {
  height:40px;
  min-height:40px;
  width:32px;
  min-width:0;
  flex:0 1 32px;
  padding:2px;
  gap:2px;
  font-size:13px
}

    #commander-table .ct-pinned svg {
  width:17px;
  height:17px
}

    #commander-table .ct-pinned .ct-monarch svg {
  width:26px;
  height:26px
}

    #commander-table .ct-pinned [data-pinned-counter=poison] {
  margin-left:6px
}

    #commander-table .ct-quick-resource {
  height:40px;
  flex:0 1 68px;
  width:68px;
  min-width:0;
  border-radius:8px
}

    #commander-table .ct-quick-resource:first-of-type {
  margin-left:6px
}

    #commander-table .ct-quick-resource button {
  min-height:38px;
  height:38px;
  min-width:0;
  padding:1px;
  font-size:12px;
  gap:1px
}

    #commander-table .ct-quick-resource [data-resource-step] {
  flex:0 0 16px;
  width:16px
}

    #commander-table .ct-quick-resource [data-pinned-counter] {
  flex:1;
  min-width:0
}

    #commander-table .ct-quick-resource svg {
  width:14px;
  height:14px
}

    #commander-table .ct-counter-value {
  white-space:nowrap
}

    #commander-table .ct-foot>.ct-more {
  height:40px;
  min-height:40px;
  padding:3px 10px
}

    #commander-table .ct-phase-switch {
  gap:3px;
  padding:0;
  border:0;
  border-radius:0;
  width:108px;
  min-width:108px
}

    #commander-table .ct-phase-position {
  height:34px;
  width:34px;
  border:1px solid currentColor;
  border-radius:7px;
  display:grid;
  place-items:center;
  opacity:.5
}

    #commander-table .ct-phase-switch[data-state=day] [data-phase-position=day],#commander-table .ct-phase-switch[data-state=night] [data-phase-position=night],#commander-table .ct-phase-switch[data-state=unset] [data-phase-position=unset] {
  opacity:1;
  box-shadow:inset 0 0 0 1px currentColor;
  background:light-dark(#ffffff33,#ffffff18)
}

    @container(max-width:380px) {
  #commander-table .ct-pinned {
  flex-wrap:wrap;
  height:80px;
  align-content:flex-start;
  padding-right:46px
}
#commander-table .ct-head {
  gap:4px
}
#commander-table .ct-person {
  margin-right:4px
}
#commander-table .ct-progress-tax {
  gap:4px
}
#commander-table .ct-progress-tax [data-pinned-counter] {
  width:34px;
  min-width:34px
}
#commander-table .ct-progress-tax .ct-tax {
  min-width:54px;
  padding:3px
}
#commander-table .ct-name {
  font-size:14px
}

}

    @container(max-width:270px) {
  #commander-table .ct-head {
  display:grid;
  grid-template-columns:20px minmax(0,1fr);
  grid-template-rows:28px 44px
}
#commander-table .ct-progress-tax {
  grid-column:2;
  justify-content:flex-end
}
#commander-table .ct-seat .ct-panel {
  grid-template-rows:76px minmax(0,1fr) 66px 88px
}
#commander-table .ct-pinned {
  padding-right:0;
  gap:2px
}
#commander-table .ct-quick-resource {
  flex-basis:58px
}
#commander-table .ct-foot>.ct-more {
  bottom:0;
  transform:translateY(2px)
}

}

    @container(max-width:270px) {
  #commander-table .ct-seat .ct-panel {
  grid-template-rows:76px minmax(0,1fr) 66px 124px
}
#commander-table .ct-foot {
  height:124px
}
#commander-table .ct-pinned {
  height:80px
}
#commander-table .ct-number {
  font-size:48px!important
}

}


    #commander-table .ct-seat .ct-panel {
  position:relative;
  padding-top:28px;
  grid-template-rows:52px minmax(0,1fr) 66px 44px
}

    #commander-table .ct-panel>.ct-handle {
  position:absolute;
  top:2px;
  left:50%;
  transform:translateX(-50%);
  width:80px;
  min-width:80px;
  height:24px;
  min-height:24px;
  display:grid;
  place-items:center;
  padding:0;
  cursor:grab
}

    #commander-table .ct-handle span {
  width:54px;
  height:5px;
  background:var(--ct-muted);
  border-radius:4px
}

    #commander-table .ct-head {
  display:flex;
  flex-wrap:nowrap;
  min-width:0
}

    #commander-table .ct-name-status {
  display:flex;
  align-items:center;
  gap:3px;
  flex:1;
  min-width:0
}

    #commander-table .ct-name-status>button,#commander-table .ct-initiative-slot {
  width:30px;
  min-width:30px;
  height:40px;
  flex:0 0 30px;
  padding:0
}

    #commander-table .ct-name-status .ct-monarch svg {
  width:26px;
  height:26px
}

    #commander-table .ct-initiative-slot {
  display:grid;
  place-items:center
}

    #commander-table .ct-initiative-slot button {
  width:30px;
  min-width:30px;
  height:40px;
  padding:0;
  background:transparent;
  border-color:transparent
}

    #commander-table .ct-initiative-slot svg {
  width:20px;
  height:20px
}

    #commander-table .ct-foot {
  display:flex;
  align-items:center;
  gap:4px;
  height:44px;
  padding:0;
  margin:0;
  width:100%
}

    #commander-table .ct-pinned {
  display:flex;
  flex-wrap:nowrap;
  flex:1;
  gap:4px;
  width:auto;
  min-width:0;
  height:44px;
  padding:0
}

    #commander-table .ct-pinned:empty {
  display:block
}

    #commander-table .ct-pinned [data-pinned-counter=poison] {
  margin:0;
  width:34px;
  flex:0 1 34px;
  height:44px;
  min-height:44px
}

    #commander-table .ct-quick-resource,#commander-table .ct-quick-resource:first-of-type {
  margin:0;
  flex:1 1 0;
  width:auto;
  min-width:0;
  height:44px
}

    #commander-table .ct-quick-resource button {
  height:42px;
  min-height:42px
}

    #commander-table .ct-foot>.ct-more {
  position:static;
  transform:none;
  flex:0 0 40px;
  width:40px;
  min-width:40px;
  height:44px;
  min-height:44px;
  padding:2px;
  justify-content:center
}

    #commander-table .ct-phase-switch {
  border:1px solid currentColor;
  border-radius:9px;
  padding:2px;
  gap:0
}

    #commander-table .ct-phase-position {
  border:0;
  box-shadow:none!important;
  border-radius:6px
}

    @container(max-width:380px) {
  #commander-table .ct-seat .ct-panel {
  grid-template-rows:88px minmax(0,1fr) 66px 44px
}
#commander-table .ct-head {
  display:flex;
  flex-wrap:wrap;
  gap:2px
}
#commander-table .ct-name-status {
  flex-basis:100%
}
#commander-table .ct-progress-tax {
  margin-left:auto
}
#commander-table .ct-quick-resource [data-pinned-counter] {
  flex-direction:column;
  gap:0;
  font-size:12px;
  line-height:13px
}
#commander-table .ct-quick-resource [data-resource-step] {
  flex-basis:12px;
  width:12px
}
#commander-table .ct-foot,#commander-table .ct-pinned {
  height:44px
}

}

    #commander-table .ct-bar .ct-phase-switch {
  border:1px solid currentColor;
  border-radius:9px
}

    #commander-table .ct-name-status>.ct-monarch,#commander-table .ct-initiative-slot {
  height:44px;
  min-height:44px;
  width:30px;
  min-width:30px;
  align-self:center
}

    #commander-table .ct-name-status>.ct-monarch,#commander-table .ct-initiative-slot button {
  display:grid;
  place-items:center;
  box-sizing:border-box;
  width:30px;
  min-width:30px;
  height:44px;
  min-height:44px;
  padding:0;
  line-height:1;
  border-width:1px;
  border-style:solid;
  border-radius:10px;
  background:transparent
}

    #commander-table .ct-name-status .ct-monarch svg,#commander-table .ct-initiative-slot svg {
  display:block;
  width:18px;
  height:18px;
  margin:0
}

    #commander-table .ct-initiative-slot button {
  color:light-dark(#2464ad,#79b7ff);
  border-color:currentColor
}

    #commander-table .ct-name-status .ct-person {
  display:grid;
  place-items:center;
  height:44px;
  margin:0;
  border:1px solid var(--ct-line);
  border-radius:9px;
  padding:0 4px
}

    #commander-table .ct-name-status .ct-name {
  width:100%;
  text-align:center
}

    #commander-table .ct-initiative-slot button[aria-pressed=false] {
  color:var(--ct-muted);
  border-color:var(--ct-line)
}

    #commander-table .ct-damage {
  position:relative;
  text-align:center
}

    #commander-table .ct-damage span {
  position:absolute;
  top:4px;
  left:4px;
  right:4px;
  text-align:center;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  display:block
}

    #commander-table .ct-damage b {
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  margin:0;
  line-height:1
}

    #commander-table .ct-name-status .ct-person {
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px
}

    #commander-table .ct-name-status .ct-commander {
  width:100%;
  text-align:center;
  font-size:11px;
  line-height:13px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  display:block
}

    #commander-table .ct-head {
  display:grid;
  grid-template-columns:minmax(0,1fr) 170px 63px;
  grid-template-rows:44px;
  gap:6px;
  align-items:center
}

    #commander-table .ct-head>.ct-person {
  width:100%;
  min-width:0;
  height:44px;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:flex-start;
  gap:2px;
  overflow:hidden
}

    #commander-table .ct-head>.ct-person .ct-name,#commander-table .ct-head>.ct-person .ct-commander {
  width:100%;
  text-align:left;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  display:block
}

    #commander-table .ct-head>.ct-person .ct-commander {
  font-size:11px;
  line-height:13px
}

    #commander-table .ct-head>.ct-progress-tax {
  width:170px;
  justify-content:flex-end;
  margin:0;
  grid-column:auto
}

    #commander-table .ct-head>.ct-name-status {
  width:63px;
  flex:none;
  gap:3px
}

    @container(max-width:380px) {
  #commander-table .ct-head {
  grid-template-columns:minmax(0,1fr) 63px;
  grid-template-rows:40px 44px;
  gap:2px 6px
}
#commander-table .ct-head>.ct-person {
  grid-column:1/-1;
  height:40px
}
#commander-table .ct-head>.ct-progress-tax {
  grid-column:1;
  width:100%
}
#commander-table .ct-head>.ct-name-status {
  grid-column:2
}

}

    #commander-table .ct-progress-tax [data-pinned-counter],#commander-table .ct-progress-tax .ct-tax {
  width:30px;
  min-width:30px;
  height:44px;
  min-height:44px;
  padding:2px;
  flex-direction:column;
  gap:1px;
  border-radius:10px;
  background:var(--ct-button);
  font-size:13px;
  line-height:15px
}

    #commander-table .ct-progress-tax svg {
  width:18px;
  height:18px
}

    #commander-table .ct-progress-tax .ct-tax strong {
  display:flex;
  flex-direction:column;
  align-items:center;
  font-size:13px;
  line-height:16px
}

    #commander-table .ct-progress-tax .ct-tax strong span:first-child {
  font-size:11px
}

    #commander-table .ct-name-status>.ct-monarch,#commander-table .ct-initiative-slot button {
  background:var(--ct-button)
}

    #commander-table .ct-quick-resource [data-resource-step="-1"] {
  position:relative
}

    #commander-table .ct-quick-resource [data-resource-step="-1"]::after {
  content:"";
  position:absolute;
  right:0;
  top:7px;
  bottom:7px;
  width:1px;
  background:var(--ct-line);
  pointer-events:none
}


    #commander-table:not([data-screen=tracker])>.ct-grid,#commander-table:not([data-screen=tracker])>.ct-status {
  display:none
}

    #commander-table[data-screen=tracker]>#ct-lobby {
  display:none
}

    #commander-table #ct-lobby {
  background:var(--ct-panel);
  border-radius:0;
  min-height:460px
}

    #commander-table .ct-welcome {
  padding:64px 24px;
  max-width:640px;
  margin:auto;
  text-align:center
}

    #commander-table .ct-welcome-icon {
  color:var(--ct-gold);
  margin:0 auto 24px;
  display:grid;
  place-items:center
}

    #commander-table .ct-welcome-icon svg {
  width:48px;
  height:48px
}

    #commander-table .ct-eyebrow {
  font-size:12px;
  letter-spacing:.15em;
  color:var(--ct-muted)
}

    #commander-table #ct-lobby h1 {
  font-size:30px;
  line-height:1.2;
  font-weight:600;
  margin:12px 0
}

    #commander-table #ct-lobby p {
  color:var(--ct-muted);
  font-size:14px;
  line-height:1.5
}

    #commander-table .ct-start-actions {
  display:flex;
  flex-direction:column;
  gap:12px;
  max-width:280px;
  margin:32px auto
}

    #commander-table #ct-lobby button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-height:44px
}

    #commander-table #ct-lobby .ct-primary {
  background:var(--ct-ink);
  color:var(--ct-panel);
  border-color:var(--ct-ink)
}

    #commander-table .ct-start-details {
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:16px;
  color:var(--ct-muted);
  font-size:12px
}

    #commander-table .ct-session-note {
  font-size:12px;
  color:var(--ct-muted)
}

    #commander-table .ct-setup {
  max-width:850px;
  margin:auto;
  padding:24px
}

    #commander-table .ct-back {
  background:transparent;
  border:0;
  padding-left:0
}

    #commander-table .ct-setup-heading {
  margin:24px 0
}

    #commander-table .ct-setup-options {
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:24px;
  flex-wrap:wrap;
  margin:24px 0
}

    #commander-table .ct-setup-options>.ct-primary {
  margin-left:auto
}

    #commander-table .ct-setup-options label {
  display:flex;
  align-items:center;
  gap:12px
}

    #commander-table .ct-setup-options select {
  font:inherit;
  padding:8px 16px;
  background:var(--ct-button);
  color:var(--ct-ink);
  border:1px solid var(--ct-line);
  border-radius:8px
}

    #commander-table .ct-setup-options>span,#commander-table .ct-setup-bottom>span {
  font-size:12px;
  color:var(--ct-muted)
}

    #commander-table .ct-setup-seats {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px
}

    #commander-table .ct-setup-player {
  position:relative;
  min-width:0;
  margin:0;
  padding:40px 16px 16px;
  border:1px solid var(--ct-line);
  border-radius:12px
}

    #commander-table .ct-setup-handle {
  position:absolute;
  top:0;
  left:50%;
  transform:translateX(-50%);
  width:80px;
  height:36px;
  min-height:0;
  padding:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:transparent;
  border:0;
  cursor:grab;
  touch-action:none
}

    #commander-table .ct-setup-handle span {
  width:54px;
  height:5px;
  border-radius:4px;
  background:var(--ct-muted);
  pointer-events:none
}

    #commander-table .ct-setup-player.ct-drag-picked {
  border-color:var(--ct-ink)
}

    #commander-table .ct-setup-player.ct-drag-target {
  background:var(--ct-button)
}

    #commander-table .ct-setup-handle:active {
  cursor:grabbing
}

    #commander-table .ct-setup-fields {
  display:flex;
  flex-direction:column;
  gap:12px
}

    #commander-table .ct-setup-fields label {
  display:flex;
  flex-direction:column;
  gap:6px;
  font-size:12px
}

    #commander-table .ct-setup-fields input {
  width:100%;
  flex:none
}


    #commander-table .ct-setup-bottom {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
  margin-top:24px
}

    #commander-table .ct-compact .ct-damages {
  grid-template-columns:repeat(4,minmax(0,1fr));
  grid-auto-rows:31px
}

    #commander-table .ct-compact .ct-damage span {
  font-size:10px;
  top:1px
}

    #commander-table .ct-compact .ct-damage b {
  font-size:15px;
  top:66%
}

    @media(max-width:560px) {
  #commander-table .ct-setup-seats {
  grid-template-columns:1fr
}
#commander-table .ct-setup {
  padding:16px
}
#commander-table .ct-welcome {
  padding:48px 16px
}

}

    #commander-table .ct-many-sources {
  grid-template-columns:repeat(4,minmax(0,1fr));
  grid-auto-rows:31px
}

    #commander-table .ct-many-sources .ct-damage span {
  font-size:10px;
  top:1px
}

    #commander-table .ct-many-sources .ct-damage b {
  font-size:15px;
  top:66%
}


    #commander-table .ct-planned {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  text-align:left;
  margin-top:32px
}

    #commander-table #ct-lobby .ct-planned button {
  justify-content:flex-start;
  text-align:left;
  opacity:.65;
  padding:14px;
  cursor:default
}

    #commander-table .ct-planned small {
  display:block;
  font-size:11px;
  color:var(--ct-muted);
  margin-top:4px
}

    #commander-table .ct-planned svg {
  width:22px;
  height:22px;
  flex-shrink:0
}

    #commander-table .ct-table-layout {
  display:grid;
  grid-template-columns:0 minmax(0,1fr) 210px;
  grid-template-rows:345px 52px 345px;
  gap:4px;
  transform-origin:top left
}

    #commander-table .ct-table-layout>.ct-bank {
  grid-column:2;
  grid-template-columns:repeat(var(--bank-cols),minmax(0,1fr))
}

    #commander-table .ct-table-layout>.ct-bank:first-child {
  grid-row:1
}

    #commander-table .ct-table-layout>.ct-bank:nth-of-type(2) {
  grid-row:3
}

    #commander-table .ct-table-layout>.ct-bar {
  grid-column:2;
  grid-row:2;
  min-width:0;
  gap:2px;
  padding:2px
}

    #commander-table .ct-table-layout .ct-day-label {
  display:none
}

    #commander-table .ct-table-layout>.ct-seat[data-place=left] {
  grid-column:1;
  grid-row:1/4
}

    #commander-table .ct-table-layout>.ct-seat[data-place=right] {
  grid-column:3;
  grid-row:1/4
}

    #commander-table .ct-table-layout>.ct-seat[data-side=true] {
  height:750px;
  container-type:normal
}

    #commander-table .ct-table-layout>.ct-seat[data-side=true] .ct-panel {
  width:750px;
  height:210px;
  grid-template-rows:44px minmax(0,1fr) 40px 44px;
  padding:20px 12px 8px;
  gap:3px
}

    #commander-table .ct-table-layout>.ct-seat[data-side=true] .ct-head {
  grid-template-columns:minmax(0,1fr) 170px 63px;
  grid-template-rows:44px
}

    #commander-table .ct-table-layout>.ct-seat[data-side=true] .ct-person {
  grid-column:auto
}

    #commander-table .ct-table-layout>.ct-seat[data-side=true] .ct-head>.ct-progress-tax {
  grid-column:2
}

    #commander-table .ct-table-layout>.ct-seat[data-side=true] .ct-head>.ct-name-status {
  grid-column:3
}

    #commander-table .ct-table-layout>.ct-seat[data-side=true] .ct-number {
  font-size:42px!important
}

    #commander-table .ct-table-layout>.ct-seat[data-side=true] .ct-damages {
  grid-template-columns:repeat(5,minmax(0,1fr));
  grid-auto-rows:40px
}

    #commander-table .ct-table-layout>.ct-seat[data-side=true] .ct-damage b {
  top:60%
}

    #commander-table .ct-table-layout .ct-number {
  line-height:1
}

    #commander-table .ct-table-layout>.ct-seat[data-side=true] .ct-number {
  font-size:34px!important;
  line-height:1
}

    #commander-table #ct-lobby .ct-planned button:not(:disabled) {
  opacity:1;
  cursor:pointer
}

    #commander-table .ct-profiles-page {
  max-width:850px;
  margin:auto;
  padding:24px
}

    #commander-table .ct-profile-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin:28px 0;
  flex-wrap:wrap
}

    #commander-table .ct-profile-heading h1 {
  margin:6px 0;
  font-size:28px;
  overflow-wrap:anywhere
}

    #commander-table .ct-profile-heading small,#commander-table .ct-profiles-page p {
  color:var(--ct-muted)
}

    #commander-table .ct-profile-tabs {
  display:flex;
  gap:8px;
  margin-bottom:20px;
  flex-wrap:wrap
}

    #commander-table .ct-profile-list {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px
}

    #commander-table #ct-lobby .ct-profile-entry {
  padding:18px 54px;
  position:relative;
  overflow:hidden;
  isolation:isolate;
  display:grid;
  grid-template-columns:minmax(0,1fr);
  align-items:center;
  min-height:86px;
  text-align:center;
  min-width:0
}
    #commander-table .ct-profile-entry::before {
  content:"";
  position:absolute;
  inset:0;
  background-image:var(--ct-profile-pattern);
  background-size:cover;
  background-repeat:no-repeat;
  background-position:center;
  opacity:.16;
  pointer-events:none
}
    #commander-table .ct-profile-entry>* {position:relative;z-index:1;}
    #commander-table .ct-profile-entry>svg {position:absolute;right:18px;top:50%;transform:translateY(-50%);}

    #commander-table .ct-avatar {
  display:flex;
  align-items:center;
  justify-content:center;
  width:48px;
  height:48px;
  border-radius:50%;
  background:var(--ct-button);
  flex-shrink:0
}

    #commander-table .ct-avatar svg {
  width:24px;
  height:24px
}

    #commander-table .ct-profile-entry-name {
  flex:1;
  min-width:0;
  overflow-wrap:anywhere;
  line-height:1.4
}

    #commander-table .ct-profile-entry small,#commander-table .ct-profile-commanders small {
  display:block;
  margin-top:5px;
  color:var(--ct-muted);
  font-size:12px
}

    #commander-table .ct-profile-identity {
  display:flex;
  align-items:center;
  gap:16px;
  min-width:0;
  flex:1
}

    #commander-table .ct-profile-identity>div {
  min-width:0
}

    #commander-table .ct-profile-metrics {
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:16px;
  padding:22px 0;
  border-top:1px solid var(--ct-line);
  border-bottom:1px solid var(--ct-line)
}

    #commander-table .ct-profile-metrics strong {
  font-size:26px;
  display:block
}

    #commander-table .ct-profile-metrics span {
  display:block;
  font-size:12px;
  color:var(--ct-muted);
  margin-top:6px
}

    #commander-table .ct-profile-empty {
  padding:16px 0;
  font-size:14px
}

    #commander-table .ct-profile-breakdown {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:20px;
  margin-bottom:28px
}

    #commander-table .ct-profiles-page h2 {
  font-size:16px;
  margin:12px 0
}

    #commander-table .ct-profile-commanders>div {
  display:flex;
  gap:14px;
  align-items:center;
  padding:16px 0;
  border-bottom:1px solid var(--ct-line);
  overflow-wrap:anywhere
}

    #commander-table #ct-lobby .ct-profile-commanders-heading {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
  align-items:center;
  gap:12px;
  margin-bottom:12px
}
    #commander-table #ct-lobby .ct-profile-commanders-heading>h2 {
  grid-column:2;
  margin:0;
  text-align:center
}
    #commander-table #ct-lobby :is(#ct-profile-add-commander,#ct-profile-add-deck) {
  grid-column:3;
  justify-self:end;
  margin:0
}
    @media(max-width:700px){
  #commander-table #ct-lobby .ct-profile-commanders-heading {grid-template-columns:minmax(0,1fr);}
  #commander-table #ct-lobby .ct-profile-commanders-heading>h2 {grid-column:1;}
  #commander-table #ct-lobby :is(#ct-profile-add-commander,#ct-profile-add-deck) {grid-column:1;}
}

    #commander-table .ct-profile-management {
  display:flex;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-top:24px;
  border-top:1px solid var(--ct-line);
  padding-top:20px
}

    #commander-table #ct-profile-form {
  max-width:520px
}

    #commander-table #ct-profile-form>label {
  display:flex;
  flex-direction:column;
  gap:10px
}

    #commander-table #ct-profile-name {
  width:100%
}

    #commander-table .ct-profile-avatars {
  border:0;
  padding:0;
  margin:24px 0;
  min-width:0;
  display:block
}

    #commander-table .ct-profile-avatars legend {
  margin-bottom:12px;
  color:var(--ct-muted)
}

    #commander-table .ct-profile-avatars button {
  width:100%;
  min-width:0;
  padding:10px;
  line-height:1.3
}

    #commander-table .ct-avatar-categories {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:6px;
  margin-bottom:14px
}
    #commander-table .ct-avatar-categories button {
  min-height:44px;
  font-size:13px;
  background:transparent
}
    #commander-table .ct-avatar-options {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px
}
    #commander-table .ct-avatar-options button {
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:98px;
  background:#303d3366;
  border:1px solid var(--ct-line);
  border-radius:12px;
  font-size:12px;
  color:var(--ct-ink)
}
    #commander-table .ct-avatar-options .ct-avatar-symbol {
  display:block;
  width:54px;
  height:54px;
  flex:none
}
    #commander-table .ct-avatar-check {
  display:none;
  position:absolute;
  top:5px;
  right:7px;
  font-size:13px;
  font-weight:700
}
    #commander-table .ct-avatar-options [aria-pressed=true] .ct-avatar-check {display:block;}
    #commander-table .ct-profile-avatars button[aria-pressed=true] {
  color:var(--ct-gold);
  background:#f1d56b16;
  border-color:var(--ct-gold)
}
    #commander-table .ct-profile-avatars button:hover {border-color:var(--ct-gold);}
    #commander-table .ct-profile-avatars button:focus-visible {
  outline:2px solid var(--ct-gold);
  outline-offset:3px
}
    #commander-table .ct-profile-avatars .ct-avatar-selection {
  margin:12px 0 0;
  font-size:13px;
  text-align:left;
  color:var(--ct-gold)
}
    #commander-table .ct-profile-avatars .ct-avatar-photo-hint {
  margin:6px 0 0;
  font-size:12px;
  text-align:left;
  color:var(--ct-muted)
}

    #commander-table .ct-profile-avatars [aria-pressed=true],#commander-table .ct-profile-tabs [aria-pressed=true] {
  border-color:var(--ct-ink);
  background:var(--ct-button)
}

    #commander-table .ct-profile-form-actions {
  display:flex;
  justify-content:flex-end;
  gap:12px;
  flex-wrap:wrap
}

    #commander-table .ct-setup-fields select {
  font:inherit;
  width:100%;
  padding:10px;
  background:var(--ct-button);
  color:var(--ct-ink);
  border:1px solid var(--ct-line);
  border-radius:8px
}

    @media(max-width:560px) {
  #commander-table .ct-profiles-page {
  padding:16px
}
#commander-table .ct-profile-list {
  grid-template-columns:1fr
}
#commander-table .ct-profile-metrics {
  grid-template-columns:repeat(3,minmax(0,1fr))
}
#commander-table .ct-profile-breakdown {
  grid-template-columns:1fr
}

}


    #commander-table[data-screen=setup] .ct-overlay {
  background:light-dark(#e9e9e499,#14181699);
  backdrop-filter:blur(4px)
}

    #commander-table .ct-setup-new-profile {
  justify-content:center;
  width:100%
}

    #commander-table .ct-dialog .ct-profile-heading {
  margin:12px 0 20px
}

    #commander-table .ct-dialog .ct-profile-heading h1 {
  font-size:22px
}

    #commander-table #ct-commander-form>label {
  display:flex;
  flex-direction:column;
  gap:10px
}

    #commander-table #ct-commander-name {
  width:100%
}

    #commander-table .ct-setup-profile-button {
  width:100%;
  display:flex;
  gap:10px;
  text-align:left;
  min-height:44px
}

    #commander-table .ct-setup-profile-button>span {
  flex:1;
  overflow-wrap:anywhere
}
    #commander-table .ct-setup-profile-button>.ct-avatar {
  flex:0 0 30px;
  width:30px;
  height:30px
}

    #commander-table .ct-profile-picker {
  display:flex;
  flex-direction:column;
  gap:8px;
  margin:16px 0
}

    #commander-table .ct-profile-picker>button {
  display:flex;
  gap:12px;
  width:100%;
  text-align:left;
  padding:10px
}

    #commander-table .ct-profile-picker>button>span:nth-child(2) {
  flex:1;
  min-width:0;
  overflow-wrap:anywhere
}

    #commander-table .ct-profile-picker small {
  display:block;
  color:var(--ct-muted);
  font-size:12px;
  margin-top:4px
}

    #commander-table .ct-profile-picker [aria-pressed=true] {
  border-color:var(--ct-ink)
}

    #commander-table .ct-setup-fields .ct-setup-profile-button {
  flex-direction:row;
  align-items:center;
  height:48px;
  min-height:48px;
  padding:6px 10px
}

    #commander-table .ct-pair-choice {
  display:block;
  font-size:11px;
  line-height:15px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis
}

    #commander-table .ct-profile-picker:has([data-pick-commander])>button {
  padding:5px 10px;
  min-height:38px
}

    #commander-table [data-pick-commander] .ct-avatar {
  height:28px;
  width:28px
}

    #commander-table .ct-partner-name {
  display:block;
  font-size:10px;
  line-height:12px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis
}

    #commander-table .ct-tax-pair {
  width:30px;
  height:44px;
  display:flex;
  flex-direction:column;
  flex:none
}

    #commander-table .ct-progress-tax .ct-tax-pair .ct-tax {
  width:30px;
  height:22px;
  min-height:22px;
  font-size:9px;
  line-height:10px;
  border-radius:4px;
  padding:0
}

    #commander-table .ct-damage-pair {
  display:grid;
  grid-template-columns:1fr 1fr;
  min-width:0;
  gap:0
}

    #commander-table .ct-damage-pair .ct-damage {
  width:100%;
  height:100%;
  border-radius:5px
}

    #commander-table .ct-damage em {
  position:absolute;
  inset:8px 0 0;
  font-size:48px;
  font-style:normal;
  opacity:.28;
  line-height:1
}

    #commander-table .ct-second-toggle {
  flex-direction:row!important;
  align-items:center;
  margin:16px 0
}

    #commander-table #ct-second-field[hidden] {
  display:none
}

    #commander-table #ct-second-name {
  width:100%
}

    #commander-table .ct-damages>.ct-damage-pair {
  padding:20px 0 0;
  border:1px solid var(--ct-line);
  border-radius:10px;
  overflow:hidden;
  position:relative;
  background:transparent
}

    #commander-table .ct-damage-pair .ct-damage {
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  min-height:0;
  position:relative
}

    #commander-table .ct-damage-pair .ct-damage+.ct-damage {
  border-left:1px solid var(--ct-line)
}

    #commander-table .ct-damage-pair .ct-pair-player {
  top:4px;
  left:4px;
  right:4px;
  font-size:11px
}

    #commander-table .ct-damage-pair .ct-damage em {
  inset:0;
  font-size:28px;
  line-height:1;
  display:flex;
  align-items:center;
  justify-content:center;
  opacity:.23
}

    #commander-table .ct-damage-pair .ct-damage b {
  top:50%
}

    #commander-table .ct-tax-pair {
  border:1px solid var(--ct-line);
  border-radius:10px;
  overflow:hidden;
  background:var(--ct-button)
}

    #commander-table .ct-progress-tax .ct-tax-pair .ct-tax {
  position:relative;
  width:28px;
  min-width:28px;
  height:21px;
  min-height:21px;
  border:0;
  border-radius:0;
  background:transparent
}

    #commander-table .ct-tax-pair .ct-tax+.ct-tax {
  border-top:1px solid var(--ct-line)!important
}

    #commander-table .ct-tax-pair em {
  position:absolute;
  inset:0;
  font-size:20px;
  line-height:20px;
  font-style:normal;
  opacity:.23;
  text-align:left;
  padding-left:2px
}

    #commander-table .ct-tax-pair strong>span {
  position:relative;
  font-size:10px
}

    #commander-table .ct-tax-pair em {
  padding-left:9px
}

    #commander-table .ct-damage-pair .ct-damage {
  container-type:size
}

    #commander-table .ct-damage-pair .ct-damage em {
  font-size:max(12px,calc(100cqh - 8px));
  line-height:1
}

    #commander-table .ct-damage-pair .ct-damage em {
  font-size:max(12px,calc(100cqh - 2px));
  line-height:1
}

    #commander-table .ct-commander[hidden] {
  display:none
}


/* Alpha V0.0.1: stable resource widths, packed left in menu order.
   Full row reserves 34px for Poison and four 4px gaps. */
#commander-table .ct-pinned {
  justify-content: flex-start;
}
#commander-table .ct-quick-resource,
#commander-table .ct-quick-resource:first-of-type {
  flex: 0 0 calc((100% - 50px) / 4);
  width: calc((100% - 50px) / 4);
}
/* Commander search and subdued artwork; controls retain their geometry. */
#commander-table .ct-card-suggestions { display:flex;flex-direction:column;gap:4px;max-height:200px;overflow:auto; }
#commander-table .ct-card-suggestions:empty { display:none; }
#commander-table .ct-card-suggestions button { text-align:left;justify-content:flex-start;padding:8px;min-height:36px; }
#commander-table .ct-artwork-choice { display:flex;flex-direction:column;gap:8px;margin:12px 0; }
#commander-table .ct-artwork-choice label { display:flex;align-items:center;gap:8px; }
#commander-table .ct-panel { isolation:isolate; }
#commander-table .ct-tableau-art { position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:.22;z-index:-1;pointer-events:none;border-radius:inherit; }
#commander-table .ct-art-credit { position:absolute;right:16px;top:90px;max-width:80%;font-size:9px;line-height:12px;opacity:.75;pointer-events:none; }
#commander-table #ct-art-edit { display:flex;flex-direction:column;gap:10px;border:0;margin:16px 0;padding:0; }
#commander-table #ct-art-edit label { display:flex;align-items:center;gap:8px; }
#commander-table .ct-profile-commanders>div>span { flex:1;min-width:0; }
#commander-table .ct-artwork-preview { width:100%;height:120px;object-fit:cover;border-radius:8px; }
#commander-table .ct-artwork-browser { display:flex;flex-direction:column;gap:8px;margin:8px 0; }
#commander-table .ct-artwork-options { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;max-height:230px;overflow:auto; }
#commander-table .ct-artwork-options:empty { display:none; }
#commander-table .ct-artwork-options button { padding:3px;min-width:0; }
#commander-table .ct-artwork-options img { width:100%;height:64px;object-fit:cover; }
#commander-table .ct-artwork-options [aria-pressed=true] { border-color:var(--ct-ink); }
#commander-table .ct-art-credit { top:auto;bottom:2px;left:8px;right:8px;max-width:none;text-align:center; }
#commander-table .ct-panel>.ct-damages,#commander-table .ct-panel>.ct-foot { transform:translateY(-4px); }
#commander-table .ct-artwork-preview { height:auto;aspect-ratio:450 / 345;object-fit:cover;touch-action:none;cursor:grab;user-select:none; }
#commander-table .ct-artwork-preview:active { cursor:grabbing; }
#commander-table .ct-crop-controls { display:flex;flex-wrap:wrap;gap:10px; }
#commander-table .ct-crop-controls label { flex:1;min-width:100px;display:flex;flex-direction:column;gap:4px;font-size:12px; }
#commander-table .ct-crop-controls input { width:100%; }
#commander-table .ct-commander-actions { justify-content:space-between;align-items:center; }
#commander-table .ct-commander-left { display:flex;gap:8px;flex-wrap:wrap; }
#commander-table #ct-commander-art-save { margin-left:auto; }
#commander-table .ct-crop-frame { display:grid;grid-template-columns:28px minmax(0,1fr);gap:8px;align-items:stretch; }
#commander-table .ct-crop-controls { display:block;min-width:0; }
#commander-table .ct-crop-controls label { min-width:0;height:100%; }
#commander-table .ct-crop-controls input { writing-mode:vertical-lr;direction:rtl;width:24px;height:100%;min-height:100px; }
#commander-table .ct-profile-commander-row { position:relative;isolation:isolate; }
#commander-table .ct-profile-commander-art { position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center;opacity:.22;z-index:-1;pointer-events:none; }
#commander-table .ct-profile-commanders .ct-profile-art-credit { position:absolute;bottom:1px;left:4px;right:4px;text-align:center;font-size:9px;line-height:11px;margin:0;pointer-events:none; }

/* Profile Commander artwork rows: inset content and subtle framing. */
#commander-table .ct-profile-commanders>.ct-profile-commander-row {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .45);
}
#commander-table .ct-profile-commander-row>span {
  padding-left: 14px;
}
#commander-table .ct-profile-commander-row>[data-manage-commander] {
  margin-right: 14px;
  background: color-mix(in srgb, var(--ct-button) 72%, transparent);
}
#commander-table .ct-profile-commander-art {
  border-radius: inherit;
}

/* Readable Commander captions over varying artwork. */
#commander-table .ct-profile-commanders>.ct-profile-commander-row>span {
  margin-left: 14px;
  padding: 5px 9px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--ct-panel) 82%, transparent);
  color: var(--ct-ink);
}

/* Caption background follows its content instead of filling the row. */
#commander-table .ct-profile-commanders>.ct-profile-commander-row>span {
  flex: 0 1 auto;
  min-width: 0;
}
#commander-table .ct-profile-commander-row>[data-manage-commander] {
  margin-left: auto;
  flex-shrink: 0;
}
#commander-table .ct-result-row { display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:16px 0; }
#commander-table .ct-result-row>span { grid-column:1/-1; }
#commander-table .ct-result-row select { min-width:0;width:100%;padding:8px;background:var(--ct-button);color:var(--ct-ink);border:1px solid var(--ct-line);border-radius:6px; }
#commander-table .ct-history-list { display:flex;flex-direction:column;gap:12px; }
#commander-table .ct-history-list button { display:flex;flex-direction:column;align-items:flex-start;padding:16px;text-align:left; }
#commander-table .ct-history-results>div { display:flex;flex-direction:column;gap:5px;padding:12px 0;border-bottom:1px solid var(--ct-line); }
#commander-table .ct-event-list { padding-left:20px;overflow-wrap:anywhere; }
#commander-table .ct-event-list li { margin:10px 0; }
#commander-table .ct-event-reverted { opacity:.6;text-decoration:line-through; }
#commander-table .ct-stats-list section { border-bottom:1px solid var(--ct-line);padding:12px 0; }

/* Tableau interaction revision. */
#commander-table .ct-crop-frame { grid-template-columns:minmax(0,1fr) 28px; }
#commander-table .ct-crop-frame>.ct-artwork-preview { grid-column:1;grid-row:1; }
#commander-table .ct-crop-controls { grid-column:2;grid-row:1; }
#commander-table .ct-head,#commander-table .ct-table-layout>.ct-seat[data-side=true] .ct-head { display:grid;grid-template-columns:30px minmax(0,1fr) 64px 63px;gap:6px; }
#commander-table .ct-head>.ct-shared-tax { grid-column:1;grid-row:1; }
#commander-table .ct-head>.ct-person { grid-column:2;grid-row:1;width:100%;margin:0;min-width:0; }
#commander-table .ct-head>.ct-progress-tax { grid-column:3;grid-row:1;gap:4px; }
#commander-table .ct-head>.ct-name-status { grid-column:4;grid-row:1; }
#commander-table .ct-shared-tax { display:flex;flex-direction:column;width:30px;height:44px;padding:1px;gap:0;position:relative;overflow:hidden; }
#commander-table .ct-tax-display { flex:1;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:10px;width:100%;line-height:12px; }
#commander-table .ct-tax-display+strong { border-top:1px solid var(--ct-line); }
#commander-table .ct-tax-display em { position:absolute;left:3px;font-size:18px;opacity:.25;font-style:normal; }
#commander-table .ct-quick-resource [data-resource-step="-1"] { flex:0 0 32px;width:32px; }
#commander-table .ct-handle { touch-action:none; }
#commander-table .ct-tax-chooser { padding:24px 4px 4px; }
#commander-table .ct-tax-choices { display:flex;flex-direction:column;height:100%;gap:3px; }
#commander-table .ct-tax-choices button { flex:1;font-size:28px; }
#commander-table .ct-visually-hidden { position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%); }
#commander-table .ct-life { position:relative; }
#commander-table .ct-live-delta { position:absolute;font-size:13px;line-height:16px;white-space:nowrap;pointer-events:none; }
#commander-table .ct-damage>.ct-live-delta { top:50%;transform:translateY(-50%);font-size:10px; }
#commander-table .ct-damage>.ct-delta-left { left:3px; }
#commander-table .ct-damage>.ct-delta-right { right:3px; }
#commander-table #ct-global-tools { display:flex;gap:2px;padding:5px; }
#commander-table #ct-global-tools svg { width:16px;height:16px; }
#commander-table .ct-shared-tax strong.ct-tax-display { display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:11px;line-height:13px; }
#commander-table .ct-shared-tax .ct-tax-display small { font-size:10px; }
/* Restore the earlier shallow artwork preview, retain right-hand vertical control. */
#commander-table .ct-artwork-preview { height:120px;aspect-ratio:auto!important; }
#commander-table .ct-crop-controls input { min-height:0; }
#commander-table .ct-bar>#ct-global-tools { align-self:center;align-items:center;justify-content:center;min-height:36px;height:36px;margin:0; }
#commander-table .ct-counter-dialog { padding:8px;overflow:hidden; }
#commander-table .ct-counter-dialog .ct-menu-title { margin:0;min-height:32px;padding-right:110px; }
#commander-table .ct-counter-dialog .ct-menu-title>span { font-size:10px; }
#commander-table .ct-counter-dialog .ct-menu-title h3 { font-size:16px;margin:0;line-height:18px; }
#commander-table .ct-counter-dialog .ct-menu-actions { position:absolute;top:6px;right:6px;gap:3px; }
#commander-table .ct-counter-dialog .ct-menu-actions button { min-height:28px;height:28px;padding:3px 6px; }
#commander-table .ct-menu-tabs { display:flex;gap:3px;margin:5px 0; }
#commander-table .ct-menu-tabs button { flex:1;min-width:0;padding:4px 2px;font-size:9px;min-height:26px; }
#commander-table .ct-menu-tabs [aria-selected=true] { border-color:var(--ct-ink);background:var(--ct-button); }
#commander-table .ct-menu-category[hidden] { display:none; }
#commander-table .ct-counter-dialog .ct-counter-row { display:grid;grid-template-columns:24px minmax(0,1fr) 28px 28px 28px 28px;gap:3px;margin:0;min-height:30px;padding:0; }
#commander-table .ct-counter-dialog .ct-counter-row>* { grid-column:auto; }
#commander-table .ct-counter-dialog .ct-counter-row button { height:28px;min-height:28px;padding:2px; }
#commander-table .ct-counter-dialog .ct-counter-name { font-size:12px; }
#commander-table .ct-counter-dialog .ct-counter-row output { font-size:14px; }
#commander-table .ct-counter-dialog .ct-menu-category>.ct-row { margin:0;min-height:32px; }
#commander-table .ct-counter-dialog .ct-menu-category .ct-row button { min-height:28px;height:28px;padding:3px; }
/* Keep the crop slider exactly aligned with the fixed artwork preview. */
#commander-table .ct-crop-frame { --ct-preview-height:120px; height:var(--ct-preview-height); }
#commander-table .ct-crop-frame>.ct-artwork-preview { height:var(--ct-preview-height); }
#commander-table .ct-crop-controls,
#commander-table .ct-crop-controls label { height:var(--ct-preview-height);min-height:0; }
#commander-table .ct-crop-controls input { height:var(--ct-preview-height);min-height:0;max-height:var(--ct-preview-height);margin:0;box-sizing:border-box; }
/* Match the slider position to the visible vertical crop: top is 0, bottom is 100. */
#commander-table .ct-crop-controls input { direction:ltr; }
/* All player actions remain visible together, grouped under static headings. */
#commander-table .ct-menu-categories { display:grid;grid-template-columns:1fr 1fr;grid-template-areas:"progress poison" "resources states" "exit exit";gap:8px 12px;margin-top:6px;transform-origin:top left; }
#commander-table .ct-menu-category { min-width:0; }
#commander-table .ct-menu-category[data-category="0"] { grid-area:progress; }
#commander-table .ct-menu-category[data-category="1"] { grid-area:resources; }
#commander-table .ct-menu-category[data-category="2"] { grid-area:poison; }
#commander-table .ct-menu-category[data-category="3"] { grid-area:states; }
#commander-table .ct-menu-category[data-category="4"] { grid-area:exit; }
#commander-table .ct-counter-dialog .ct-menu-heading { font-size:10px;line-height:14px;margin:0 0 3px;padding:0; }
#commander-table .ct-counter-dialog .ct-counter-row { grid-template-columns:20px minmax(0,1fr) 24px 24px 24px 24px;gap:2px;min-height:28px; }
#commander-table .ct-counter-dialog .ct-counter-row button { height:24px;min-height:24px; }
#commander-table .ct-counter-dialog .ct-counter-name { font-size:11px;gap:3px;line-height:13px; }
#commander-table .ct-counter-dialog .ct-menu-symbol svg { width:14px;height:14px; }
#commander-table .ct-counter-dialog .ct-menu-category>.ct-row { display:grid;grid-template-columns:20px minmax(0,1fr) 32px;gap:4px;min-height:28px;padding:0; }
#commander-table .ct-counter-dialog .ct-status-name { font-size:11px;line-height:13px;gap:3px; }
#commander-table .ct-counter-dialog .ct-tools { grid-template-columns:1fr 1fr;gap:8px; }
#commander-table .ct-counter-dialog .ct-tools button { min-height:28px;height:28px;padding:3px 8px;font-size:11px;gap:6px; }
#commander-table .ct-dialog.ct-counter-dialog { padding:8px; }
#commander-table .ct-counter-dialog .ct-menu-title { padding:0 110px 0 0;height:36px;min-height:36px; }
#commander-table .ct-counter-dialog .ct-menu-category .ct-info { width:20px;min-width:20px;height:24px;min-height:24px;padding:0; }
#commander-table .ct-counter-dialog .ct-menu-category .ct-info svg { width:16px;height:16px; }
#commander-table .ct-counter-dialog .ct-menu-category>.ct-row { height:28px; }
#commander-table .ct-counter-dialog .ct-menu-category>.ct-row label { margin:0;padding:0;min-height:0; }
#commander-table .ct-counter-dialog .ct-counter-row button { min-width:0;width:24px; }
#commander-table .ct-counter-dialog .ct-menu-category>.ct-row label,
#commander-table .ct-counter-dialog .ct-menu-category .ct-toggle { width:30px;min-width:0;max-width:30px; }
/* Identify the source opponent, retaining the shared frame for partner commanders. */
#commander-table .ct-damages>.ct-damage { border-color:color-mix(in srgb,var(--damage-source-color) 60%,var(--ct-border,#59635b)); }
/* Offline rule reference, independent of the tracker layout. */
#commander-table .ct-rules-page { max-width:1150px;margin:auto;text-align:left; }
#commander-table .ct-rules-top { padding:12px 0;border-bottom:1px solid var(--ct-border); }
#commander-table .ct-rules-top h1 { margin:8px 0; }
#commander-table .ct-rule-search-row { display:flex;gap:8px;margin-top:5px; }
#commander-table #ct-rule-search { width:100%;min-width:0;padding:12px;border-radius:10px; }
#commander-table #ct-rule-version,#commander-table .ct-rule-footer { font-size:12px;line-height:1.5; }
#commander-table .ct-rule-shortcuts { display:flex;flex-wrap:wrap;gap:6px; }
#commander-table .ct-rule-shortcuts button { padding:6px 10px;font-size:12px;min-height:32px; }
#commander-table .ct-rules-layout { display:grid;grid-template-columns:235px minmax(0,1fr);gap:24px;margin-top:18px; }
#commander-table .ct-rule-navigation details { border-bottom:1px solid var(--ct-border);padding:10px 0; }
#commander-table .ct-rule-navigation summary { cursor:pointer;font-weight:600;line-height:1.5; }
#commander-table .ct-rule-navigation button { display:block;width:100%;text-align:left;background:transparent;padding:7px;margin:4px 0;font-size:12px;line-height:1.4; }
#commander-table #ct-rule-content { min-width:0;outline:none; }
#commander-table #ct-rule-content h2 { font-size:21px;margin:0 0 12px; }
#commander-table .ct-rule-entry { margin:8px 0;padding:12px;border:1px solid var(--ct-border);border-radius:10px; }
#commander-table .ct-rule-entry summary { cursor:pointer;line-height:1.5; }
#commander-table .ct-rule-text { white-space:pre-wrap;line-height:1.65;overflow-wrap:anywhere;font-size:14px; }
#commander-table .ct-rule-reference { display:inline;padding:0 2px;border:0;background:transparent;text-decoration:underline;min-height:0;color:inherit;font:inherit; }
#commander-table .ct-rule-results { display:grid;gap:8px; }
#commander-table .ct-rule-results>button { display:flex;flex-direction:column;gap:5px;text-align:left;padding:12px;line-height:1.4; }
#commander-table .ct-rule-results span { font-size:12px;opacity:.8; }
#commander-table .ct-rule-result-active { outline:2px solid currentColor; }
#commander-table .ct-rule-footer { margin-top:24px;padding-top:12px;border-top:1px solid var(--ct-border); }
#commander-table .ct-rule-footer a { display:inline-block;margin:4px 12px 4px 0;color:inherit; }
@media(max-width:650px){#commander-table .ct-rules-layout { grid-template-columns:1fr;gap:16px; }#commander-table .ct-rule-navigation { max-height:210px;overflow:auto; } }
#commander-table .ct-rules-page .ct-rule-results>button { align-items:stretch;text-align:left; }
#commander-table .ct-rules-page .ct-rule-navigation button { justify-content:flex-start;text-align:left; }
@media(max-width:650px){#commander-table .ct-rules-searching #ct-rule-content { grid-row:1; } }
/* Fill the available tablet height; preserve a usable minimum on phones. */
#commander-table .ct-bank .ct-panel { height:var(--tableau-height,345px);min-height:var(--tableau-height,345px);max-height:none; }
#commander-table .ct-table-layout { grid-template-rows:var(--tableau-height,345px) 52px var(--tableau-height,345px); }
#commander-table .ct-table-layout>.ct-seat[data-side=true] { height:var(--table-total-height,750px); }
#commander-table .ct-table-layout>.ct-seat[data-side=true] .ct-panel { width:var(--table-total-height,750px); }
#commander-table .ct-head>.ct-progress-tax { width:64px;min-width:0;max-width:64px;justify-self:end;display:flex;justify-content:flex-end; }
#commander-table .ct-head>.ct-name-status { grid-column:4;grid-row:1; }
/* Opposite seats remain grouped at every viewport width. */
#commander-table .ct-grid>.ct-bank { grid-template-columns:repeat(var(--bank-cols,2),minmax(0,1fr)); }
#commander-table .ct-menu-categories { display:grid;grid-template-columns:1fr 1fr;grid-template-areas:none;gap:12px; }
#commander-table .ct-menu-column { display:flex;flex-direction:column;gap:8px;min-width:0; }
#commander-table .ct-counter-dialog .ct-menu-heading { height:16px;line-height:16px;margin:0 0 2px;font-size:11px; }
#commander-table .ct-counter-dialog .ct-counter-row { height:var(--menu-row-height);min-height:0;grid-template-columns:26px minmax(0,1fr) repeat(4,var(--menu-control-width));gap:2px;align-items:center; }
#commander-table .ct-counter-dialog .ct-counter-row button { height:calc(var(--menu-row-height) - 4px);min-height:0;width:100%;padding:2px; }
#commander-table .ct-counter-dialog .ct-menu-category .ct-info { width:26px;min-width:0;height:calc(var(--menu-row-height) - 4px);min-height:0; }
#commander-table .ct-counter-dialog .ct-counter-name,#commander-table .ct-counter-dialog .ct-status-name { font-size:12px; }
#commander-table .ct-counter-dialog .ct-menu-category>.ct-row { height:var(--menu-row-height);min-height:0;grid-template-columns:26px minmax(0,1fr) 44px;align-items:center;gap:4px; }
#commander-table .ct-counter-dialog .ct-menu-category>.ct-row label { width:44px;max-width:44px;height:var(--menu-row-height);display:flex;align-items:center;justify-content:center;margin:0; }
#commander-table .ct-counter-dialog .ct-menu-category .ct-toggle { -webkit-appearance:none;appearance:none;display:block;width:40px;min-width:40px;max-width:40px;height:24px;margin:0;padding:0;position:relative;border-radius:14px; }
#commander-table .ct-counter-dialog .ct-toggle:before { width:18px;height:18px;top:2px;left:2px; }
#commander-table .ct-counter-dialog .ct-toggle:checked:before { left:18px; }
#commander-table .ct-counter-dialog .ct-tools { grid-template-columns:1fr;gap:0; }
#commander-table .ct-counter-dialog .ct-tools button { height:calc(var(--menu-row-height) - 4px);min-height:0;margin:2px 0; }
/* Full-height pages and stable first-frame tracker sizing on iPad. */
html,body { min-height:100%;background:light-dark(#fafbf7,#202723); }
#commander-table { min-height:100vh;min-height:100dvh;touch-action:pan-x pan-y; }
#commander-table:not([data-screen=tracker]) #ct-lobby { min-height:100vh;min-height:100dvh; }
#commander-table #ct-lobby input,#commander-table #ct-lobby select { font-size:16px; }
#commander-table .ct-counter-dialog .ct-menu-category[data-category="3"]>.ct-row,
#commander-table .ct-counter-dialog .ct-menu-category[data-category="3"]>.ct-row label { height:calc(var(--menu-row-height) - 11.333333px); }
#commander-table .ct-counter-dialog .ct-menu-category[data-category="3"] .ct-info { height:calc(var(--menu-row-height) - 15.333333px); }
/* Local control revision: fixed centre, mirrored controls and gesture-only menu handle. */
#commander-table[data-screen=tracker] .ct-panel,#commander-table .ct-counter-dialog,#commander-table .ct-bar { -webkit-user-select:none;user-select:none;-webkit-touch-callout:none; }
#commander-table .ct-panel *,#commander-table .ct-counter-dialog button { -webkit-touch-callout:none; }
#commander-table>.ct-status { position:absolute!important;width:1px;height:1px;min-height:0;padding:0;overflow:hidden;clip-path:inset(50%); }
#commander-table .ct-grid .ct-bar { display:grid;grid-template-columns:minmax(0,1fr) 36px 44px 36px minmax(0,1fr);gap:4px;position:relative;height:52px;min-height:52px;padding:4px 6px;overflow:visible; }
#commander-table .ct-bar-left { grid-column:1;display:flex;align-items:center;gap:6px;min-width:0; }
#commander-table .ct-bar-right { grid-column:5;display:flex;align-items:center;gap:6px;min-width:0; }
#commander-table .ct-bar #ct-undo { grid-column:2; }
#commander-table .ct-bar #ct-home { grid-column:3;position:relative;border:1px solid var(--ct-line);border-radius:50%;width:44px;height:44px;min-height:44px;padding:2px;z-index:3; }
#commander-table .ct-bar #ct-pause { grid-column:4; }
#commander-table .ct-bar button { min-width:0;min-height:34px;height:34px;padding:4px;border-color:transparent;background:transparent; }
#commander-table .ct-bar .ct-day-picker { gap:0;padding:1px;border:1px solid currentColor;border-radius:10px;background:var(--ct-button);flex-shrink:0; }
#commander-table .ct-bar .ct-phase-switch { border:0;background:transparent; }
#commander-table .ct-bar #ct-day-info { padding:3px; }
#commander-table .ct-bar #ct-live-history { margin-left:auto;flex-shrink:0; }
#commander-table .ct-bar .ct-sky { position:relative;inset:auto;flex:0 0 26px;width:26px;height:28px;overflow:hidden;pointer-events:none; }
#commander-table .ct-bar .ct-sky svg { position:static;width:24px;height:24px; }
#commander-table .ct-bar #ct-global-tools { margin-left:auto;min-height:34px;height:34px;display:flex;align-items:center;gap:1px; }
#commander-table .ct-clock { border:0;background:none;padding:0;font-variant-numeric:tabular-nums; }
#commander-table .ct-dual-icon { width:24px;height:24px;position:relative;display:block; }
#commander-table #ct-finish .ct-dual-icon svg { position:absolute;width:16px;height:16px;left:0;top:0; }
#commander-table #ct-finish .ct-dual-icon svg+svg { left:8px;top:8px;transform:rotate(180deg); }
#commander-table #ct-finish { height:40px; }
#commander-table[data-bar-collapsed=true] .ct-grid .ct-bar { height:0;min-height:0;padding:0; }
#commander-table[data-bar-collapsed=true] .ct-bar>:not(#ct-home) { display:none; }
#commander-table[data-bar-collapsed=true] .ct-bar #ct-home { position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:24px;height:24px;min-height:24px;background:var(--ct-panel); }
#commander-table[data-bar-collapsed=true] #ct-home .ct-dual-icon { display:none; }
#commander-table[data-bar-collapsed=true] .ct-table-layout { grid-template-rows:var(--tableau-height) 0px var(--tableau-height); }
#commander-table .ct-menu-dismiss { position:absolute;bottom:2px;left:50%;transform:translateX(-50%);width:100px;height:28px;min-height:28px;padding:8px;background:transparent;border:0;touch-action:none; }
#commander-table .ct-menu-dismiss span { display:block;height:5px;width:64px;margin:auto;background:var(--ct-muted);border-radius:5px; }
#commander-table .ct-damage>.ct-delta-left { left:25%;transform:translate(-50%,-50%); }
#commander-table .ct-damage>.ct-delta-right { left:75%;right:auto;transform:translate(-50%,-50%); }
#commander-table[data-reduce-motion=true] *,#commander-table[data-reduce-motion=true] *:before { animation:none!important;transition:none!important; }
#commander-table .ct-settings-list { display:grid;gap:18px; }
#commander-table .ct-settings-list label { display:flex;align-items:center;justify-content:space-between;gap:16px; }
#commander-table .ct-settings-list small { display:block;font-size:12px;color:var(--ct-muted); }
#commander-table .ct-primary-profile { width:100%;border:1px solid var(--ct-gold);border-radius:14px;padding:18px;margin:14px 0 24px;background:var(--ct-button); }
#commander-table .ct-primary-option { display:block;width:100%;margin:8px 0; }
@media(max-width:620px){#commander-table .ct-grid .ct-bar { grid-template-columns:minmax(0,1fr) 28px 36px 28px minmax(0,1fr);height:86px;min-height:86px;gap:1px;padding:2px; }#commander-table .ct-bar #ct-home { width:36px;height:36px;min-height:36px; }#commander-table .ct-bar-left,#commander-table .ct-bar-right { flex-wrap:wrap;gap:2px; }#commander-table .ct-bar .ct-sky { display:none; }#commander-table .ct-clock { width:100%;font-size:11px; }#commander-table .ct-bar button { padding:2px; }}
#commander-table .ct-counter-dialog .ct-counter-name { white-space:nowrap; }
/* Equal square symbols, fitted to the selected player's tableau without scrolling. */
#commander-table .ct-dialog.ct-counter-dialog{
  --menu-square:64px;--menu-space:clamp(2px,calc(var(--menu-square)*.08),8px);--menu-gap:var(--menu-space);--menu-pad:var(--menu-space);
  --menu-font:clamp(8px,calc(var(--menu-square)*.18),14px);--menu-caption:calc(var(--menu-font)*2.3);--menu-heading:calc(var(--menu-font)*1.3);
  --menu-header:clamp(22px,calc(var(--menu-square)*.55),40px);--menu-footer:clamp(12px,calc(var(--menu-square)*.35),28px);--menu-action:clamp(20px,calc(var(--menu-square)*.55),44px);
  display:flex;flex-direction:column;padding:var(--menu-pad);overflow:hidden;background:var(--ct-panel);
}
#commander-table .ct-dialog.ct-counter-dialog .ct-menu-title{flex:none;display:flex;align-items:center;gap:var(--menu-space);height:var(--menu-header);min-height:0;min-width:0;margin:0;padding:0 78px 0 0;}
#commander-table .ct-dialog.ct-counter-dialog .ct-menu-title h3{min-width:0;margin:0;font-size:clamp(16px,calc(var(--menu-square)*.34),28px);line-height:1.1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
#commander-table .ct-dialog.ct-counter-dialog .ct-menu-title button{flex:none;display:flex;align-items:center;justify-content:center;width:var(--menu-header);height:var(--menu-header);min-width:0;min-height:0;padding:2px;}
#commander-table .ct-dialog.ct-counter-dialog .ct-menu-title button svg{width:65%;height:65%;}
#commander-table .ct-dialog.ct-counter-dialog .ct-player-name-form{flex:1;display:flex;align-items:center;gap:var(--menu-space);min-width:0;height:100%;margin:0;}
#commander-table .ct-dialog.ct-counter-dialog .ct-player-name-form input{flex:1;min-width:0;width:0;height:100%;min-height:0;margin:0;padding:0 var(--menu-space);font-size:clamp(16px,calc(var(--menu-square)*.34),28px);}
#commander-table .ct-dialog.ct-counter-dialog .ct-menu-title [hidden]{display:none;}
#commander-table .ct-dialog.ct-counter-dialog .ct-menu-actions{top:var(--menu-pad);right:var(--menu-pad);margin:0;}
#commander-table .ct-dialog.ct-counter-dialog .ct-menu-actions button{display:flex;align-items:center;justify-content:center;gap:4px;min-width:0;min-height:0;height:var(--menu-header);padding:2px 6px;font-size:var(--menu-font);}
#commander-table .ct-dialog.ct-counter-dialog .ct-menu-actions svg{width:clamp(12px,calc(var(--menu-square)*.3),24px);height:clamp(12px,calc(var(--menu-square)*.3),24px);}
#commander-table .ct-dialog.ct-counter-dialog .ct-menu-categories{flex:1;min-height:0;display:grid;grid-template-columns:1fr 2fr 1.5fr;grid-template-rows:repeat(2,minmax(0,1fr));grid-template-areas:"progress resources poison" "progress resources states";gap:var(--menu-gap);margin-top:var(--menu-gap);overflow:hidden;align-items:stretch;}
#commander-table .ct-dialog.ct-counter-dialog .ct-menu-category{display:grid;grid-template-rows:var(--menu-heading) minmax(0,1fr);min-width:0;min-height:0;gap:var(--menu-gap);padding:var(--menu-pad);border:1px solid var(--ct-line);border-radius:10px;}
#commander-table .ct-dialog.ct-counter-dialog .ct-menu-heading{height:auto;font-size:clamp(8px,calc(var(--menu-font)*.85),12px);line-height:var(--menu-heading);letter-spacing:.04em;margin:0;padding:0;white-space:nowrap;text-align:center;}
#commander-table .ct-dialog.ct-counter-dialog #ct-progress-list,#commander-table .ct-dialog.ct-counter-dialog #ct-counter-list{display:grid;grid-template-rows:repeat(2,minmax(0,1fr));gap:var(--menu-gap);min-height:0;}
#commander-table .ct-dialog.ct-counter-dialog #ct-counter-list{position:relative;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:calc(var(--menu-space)*2 + 1px);}
#commander-table .ct-dialog.ct-counter-dialog #ct-counter-list::before{content:"";position:absolute;top:0;bottom:0;left:calc(50% - .5px);width:1px;background:var(--ct-line);pointer-events:none;}
#commander-table .ct-dialog.ct-counter-dialog #ct-poison-list{display:grid;grid-row:2;min-height:0;}
#commander-table .ct-dialog.ct-counter-dialog .ct-counter-row{display:grid;grid-template-columns:calc(var(--menu-square)/2) var(--menu-square) calc(var(--menu-square)/2);grid-template-rows:var(--menu-caption) var(--menu-square);width:max-content;height:max-content;min-height:0;gap:2px;margin:0;padding:0;border:0;align-self:center;justify-self:center;align-items:center;}
#commander-table .ct-dialog.ct-counter-dialog .ct-counter-row>*{grid-column:auto;min-width:0;}
#commander-table .ct-dialog.ct-counter-dialog .ct-counter-caption{grid-column:1/-1;display:flex;align-items:center;justify-content:center;gap:4px;}
#commander-table .ct-dialog.ct-counter-dialog .ct-counter-name{white-space:nowrap;font-size:var(--menu-font);line-height:var(--menu-caption);}
#commander-table .ct-dialog.ct-counter-dialog .ct-counter-row button{min-width:0;min-height:0;width:100%;height:var(--menu-square);padding:0;border-radius:clamp(4px,calc(var(--menu-square)*.12),10px);}
#commander-table .ct-dialog.ct-counter-dialog .ct-counter-row [data-counter-step]{font-size:clamp(16px,calc(var(--menu-square)*.4),32px);font-weight:600;line-height:1;}
#commander-table .ct-dialog.ct-counter-dialog .ct-counter-symbol,#commander-table .ct-dialog.ct-counter-dialog .ct-menu-state{display:flex;justify-content:center;align-items:center;touch-action:none;}
#commander-table .ct-dialog.ct-counter-dialog .ct-counter-symbol svg,#commander-table .ct-dialog.ct-counter-dialog .ct-menu-state svg{flex:none;width:calc(var(--menu-square)*.72);height:calc(var(--menu-square)*.72);}
#commander-table .ct-dialog.ct-counter-dialog .ct-counter-row output{font-size:clamp(10px,calc(var(--menu-square)*.26),20px);line-height:var(--menu-caption);font-weight:700;font-variant-numeric:tabular-nums;text-align:center;}
#commander-table .ct-dialog.ct-counter-dialog .ct-menu-states{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--menu-gap);min-height:0;align-items:center;}
#commander-table .ct-dialog.ct-counter-dialog .ct-menu-status{display:grid;grid-template-rows:var(--menu-caption) var(--menu-square);justify-items:center;gap:2px;min-height:0;min-width:0;}
#commander-table .ct-dialog.ct-counter-dialog .ct-status-name{display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:var(--menu-font);line-height:1.1;text-align:center;}
#commander-table .ct-dialog.ct-counter-dialog .ct-menu-state{width:var(--menu-square);height:var(--menu-square);min-height:0;min-width:0;padding:0;border-radius:clamp(4px,calc(var(--menu-square)*.12),10px);}
#commander-table .ct-dialog.ct-counter-dialog .ct-counter-symbol[aria-pressed=true],#commander-table .ct-dialog.ct-counter-dialog .ct-menu-state[aria-pressed=true]{border-color:var(--ct-gold);color:var(--ct-gold);background:color-mix(in srgb,var(--ct-gold) 18%,var(--ct-button));}
#commander-table .ct-dialog.ct-counter-dialog .ct-tools{flex:none;display:flex;justify-content:space-between;width:100%;gap:var(--menu-space);margin:var(--menu-space) 0 0;min-height:0;padding:0;border:0;}
#commander-table .ct-dialog.ct-counter-dialog .ct-tools button{display:flex;justify-content:center;align-items:center;width:min(38%,256px);height:var(--menu-action);min-height:0;min-width:0;margin:0;padding:2px;font-size:var(--menu-font);gap:3px;white-space:nowrap;}
#commander-table .ct-dialog.ct-counter-dialog .ct-tools svg{width:clamp(10px,calc(var(--menu-square)*.3),24px);height:clamp(10px,calc(var(--menu-square)*.3),24px);}
#commander-table .ct-dialog.ct-counter-dialog .ct-menu-dismiss{bottom:var(--menu-space);width:clamp(36px,var(--menu-square),84px);height:var(--menu-action);min-height:0;padding:0;}
#commander-table .ct-dialog.ct-counter-dialog .ct-menu-dismiss span{height:4px;width:clamp(36px,var(--menu-square),84px);}
/* Two-row groups reserve the same heading/border space as the stacked groups beside them. */
#commander-table .ct-dialog.ct-counter-dialog:is([data-menu-layout=wide],[data-menu-layout=short]) :is(#ct-progress-list,#ct-counter-list){row-gap:calc(var(--menu-heading) + var(--menu-gap)*2 + var(--menu-pad)*2 + 2px);}
#commander-table .ct-dialog.ct-counter-dialog[data-menu-layout=narrow] .ct-menu-categories{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:minmax(0,2fr) minmax(0,2fr) minmax(0,1fr);grid-template-areas:"progress poison" "resources resources" "states states";}
#commander-table .ct-dialog.ct-counter-dialog[data-menu-layout=narrow] #ct-poison-list{grid-template-rows:repeat(2,minmax(0,1fr));gap:var(--menu-gap);}
#commander-table .ct-dialog.ct-counter-dialog[data-menu-layout=compact] .ct-menu-categories{grid-template-columns:1.06fr .94fr;grid-template-rows:minmax(0,1fr) minmax(0,2fr);grid-template-areas:"progress poison" "resources states";}
#commander-table .ct-dialog.ct-counter-dialog[data-menu-layout=compact] #ct-progress-list{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:minmax(0,1fr);}
#commander-table .ct-dialog.ct-counter-dialog[data-menu-layout=strip]{--menu-font:clamp(6px,calc(var(--menu-square)*.18),14px);--menu-header:clamp(18px,calc(var(--menu-square)*.5),40px);--menu-footer:clamp(10px,calc(var(--menu-square)*.3),28px);--menu-action:clamp(14px,calc(var(--menu-square)*.55),44px);}
#commander-table .ct-dialog.ct-counter-dialog[data-menu-layout=strip] .ct-menu-categories{grid-template-columns:2.2fr 4fr 2.2fr 3fr;grid-template-rows:minmax(0,1fr);grid-template-areas:"progress resources poison states";}
#commander-table .ct-dialog.ct-counter-dialog[data-menu-layout=strip] #ct-poison-list{grid-template-rows:repeat(2,minmax(0,1fr));gap:var(--menu-gap);}
#commander-table .ct-dialog.ct-counter-dialog[data-menu-layout=short]{--menu-font:clamp(6px,calc(var(--menu-square)*.18),14px);--menu-header:clamp(18px,calc(var(--menu-square)*.5),40px);--menu-action:clamp(14px,calc(var(--menu-square)*.55),44px);--menu-footer:12px;}
#commander-table .ct-dialog.ct-counter-dialog:is([data-menu-layout=strip],[data-menu-layout=short]) .ct-menu-heading{font-size:clamp(6px,calc(var(--menu-font)*.85),12px);letter-spacing:0;}
#commander-table .ct-dialog.ct-counter-dialog:is([data-menu-layout=strip],[data-menu-layout=short]) .ct-counter-row [data-counter-step]{font-size:clamp(10px,calc(var(--menu-square)*.4),32px);}
#commander-table .ct-dialog.ct-counter-dialog:is([data-menu-layout=strip],[data-menu-layout=short]) .ct-counter-row output{font-size:clamp(7px,calc(var(--menu-square)*.26),20px);}
#commander-table .ct-bar[data-phase=day] .ct-phase-switch { background:#fff8dd;color:#283d37;border-color:#6d765e; }
/* Rotationally symmetric home mark; the collapsed control remains above the tableaus. */
#commander-table #ct-home .ct-home-mark { display:block;width:32px;height:32px;margin:auto; }
#commander-table[data-bar-collapsed=true] .ct-grid .ct-bar { z-index:3; }
#commander-table[data-bar-collapsed=true] .ct-bar #ct-home { grid-column:auto;grid-row:auto;width:36px;height:36px;min-height:36px;border:2px solid var(--ct-muted);background:var(--ct-panel);box-shadow:0 0 0 3px var(--ct-bg); }
#commander-table[data-bar-collapsed=true] #ct-home .ct-home-mark { display:none; }

/* Quiet scenery stays behind the controls and reacts only to phase changes. */
#commander-table .ct-bar::before { content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;opacity:.38;background-repeat:no-repeat; }
#commander-table .ct-bar-left,#commander-table .ct-bar-right { position:relative;z-index:1; }
#commander-table .ct-bar[data-phase=night]::before { background-image:radial-gradient(circle at 8% 43%,#e2ecff 0 .65px,transparent 1.3px),radial-gradient(circle at 19% 43%,#e2ecff 0 .65px,transparent 1.3px),radial-gradient(circle at 24% 43%,#e2ecff 0 .65px,transparent 1.3px),radial-gradient(circle at 32% 43%,#e2ecff 0 .65px,transparent 1.3px),radial-gradient(circle at 42% 43%,#e2ecff 0 .65px,transparent 1.3px),radial-gradient(circle at 54% 43%,#e2ecff 0 .65px,transparent 1.3px),radial-gradient(circle at 63% 43%,#e2ecff 0 .65px,transparent 1.3px),radial-gradient(circle at 73% 43%,#e2ecff 0 .65px,transparent 1.3px),radial-gradient(circle at 85% 43%,#e2ecff 0 .65px,transparent 1.3px),radial-gradient(circle at 94% 43%,#e2ecff 0 .65px,transparent 1.3px),radial-gradient(circle at 5% 20%,#fff 0 1px,transparent 1.6px),radial-gradient(circle at 16% 80%,#fff 0 .8px,transparent 1.4px),radial-gradient(circle at 27% 15%,#fff 0 1px,transparent 1.6px),radial-gradient(circle at 37% 77%,#fff 0 .8px,transparent 1.4px),radial-gradient(circle at 47% 9%,#fff 0 1px,transparent 1.6px),radial-gradient(circle at 58% 85%,#fff 0 .8px,transparent 1.4px),radial-gradient(circle at 68% 18%,#fff 0 1px,transparent 1.6px),radial-gradient(circle at 79% 78%,#fff 0 1px,transparent 1.6px),radial-gradient(circle at 91% 12%,#fff 0 .8px,transparent 1.4px),radial-gradient(circle at 98% 74%,#fff 0 1px,transparent 1.6px); }
#commander-table .ct-bar[data-phase=day]::before { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 52'%3E%3Cg fill='none' stroke='%233e6270' stroke-width='1.4' stroke-linecap='round'%3E%3Cpath d='M180 38q4-3 7 2q3-5 7-2M245 18q4-3 7 2q3-5 7-2M275 10q5-3 9 3q4-6 9-3M365 38q4-3 7 2q3-5 7-2M445 9q4-3 7 2q3-5 7-2M665 12q4-3 7 2q3-5 7-2M705 39q4-3 7 2q3-5 7-2M805 10q5-3 9 3q4-6 9-3M945 39q4-3 7 2q3-5 7-2M1010 12q5-3 9 3q4-6 9-3M1090 40q4-3 7 2q3-5 7-2'/%3E%3C/g%3E%3C/svg%3E");background-size:100% 100%; }
#commander-table .ct-bar[data-phase=day].ct-phase-change::before { animation:ct-birds-drift 6s ease-out; }
#commander-table .ct-bar[data-phase=night].ct-phase-change::before { animation:ct-stars-appear 1.2s ease-out; }
@keyframes ct-birds-drift { from { background-position:-38px 3px;opacity:0; } 20% { opacity:.38; } to { background-position:0 0;opacity:.38; } }
@keyframes ct-stars-appear { from { opacity:0; } to { opacity:.38; } }
#commander-table .ct-bar[data-phase=night]::before { opacity:.82; }
#commander-table .ct-bar[data-phase=night].ct-phase-change::before { animation:ct-stars-release 1.2s ease-out; }
@keyframes ct-stars-release { from { opacity:0; } to { opacity:.82; } }
#commander-table[data-bar-collapsed=true] .ct-bar::before { display:none; }
#commander-table[data-reduce-motion=true] .ct-bar::before { animation:none!important; }
@media(prefers-reduced-motion:reduce) { #commander-table .ct-bar::before { animation:none!important; } }

/* Keep the info control legible and give the selected phase a solid thumb. */
#commander-table .ct-bar #ct-day-info { color:inherit;opacity:1; }
#commander-table .ct-bar[data-phase=day] .ct-day-picker { background:#fff8dd;color:#283d37;border-color:#6d765e; }
#commander-table .ct-bar[data-phase=night] .ct-day-picker { background:#172337;color:#edf1ff;border-color:#8495b3; }
#commander-table .ct-bar .ct-phase-position { opacity:.65; }
#commander-table .ct-bar .ct-phase-switch[data-state=day] [data-phase-position=day] { background:#f4c54e;color:#30260e;opacity:1;border:1px solid #795b13; }
#commander-table .ct-bar .ct-phase-switch[data-state=night] [data-phase-position=night] { background:#d3e2ff;color:#192a4a;opacity:1;border:1px solid #eef4ff; }
#commander-table .ct-bar .ct-phase-switch[data-state=unset] [data-phase-position=unset] { background:var(--ct-ink);color:var(--ct-bg);opacity:1;border:1px solid var(--ct-muted); }
#commander-table .ct-bar .ct-phase-switch[data-state=day] [data-phase-position=day] svg,#commander-table .ct-bar .ct-phase-switch[data-state=night] [data-phase-position=night] svg,#commander-table .ct-bar .ct-phase-switch[data-state=unset] [data-phase-position=unset] svg { stroke-width:2.5; }
/* V0.0.2a: fixed seat layouts, device orientation and readable controls. */
#commander-table .ct-grid { gap:4px;padding:0;margin:8px; }
#commander-table .ct-table-layout { grid-template-rows:var(--tableau-height) var(--central-height,52px) var(--tableau-height); }
#commander-table .ct-grid>.ct-bank { grid-template-columns:repeat(var(--bank-cols,2),minmax(0,1fr)); }
#commander-table .ct-grid .ct-bar { gap:8px; }
#commander-table .ct-bar-left,#commander-table .ct-bar-right { gap:12px; }
#commander-table .ct-bar button,#commander-table .ct-bar .ct-clock { background:var(--ct-button);color:var(--ct-ink);border:1px solid var(--ct-line);border-radius:9px; }
#commander-table .ct-bar .ct-clock { padding:6px;white-space:nowrap; }
#commander-table .ct-bar[data-phase=day] button,#commander-table .ct-bar[data-phase=day] .ct-clock { background:#fff8e7;color:#283d37;border-color:#899780; }
#commander-table .ct-bar[data-phase=night] button,#commander-table .ct-bar[data-phase=night] .ct-clock { background:#26364e;color:#f0f4ff;border-color:#7889a6; }
#commander-table .ct-bar .ct-day-picker { gap:0; }
#commander-table .ct-bar #ct-day-info,#commander-table .ct-bar #ct-daynight { border:0;background:transparent;color:inherit; }
#commander-table .ct-panel button:not(.ct-handle) { background:var(--ct-control-surface,var(--ct-button));color:var(--ct-ink); }
#commander-table .ct-panel .ct-damage { background:color-mix(in srgb,var(--ct-panel) 88%,transparent); }
#commander-table .ct-primary-profile { display:flex;flex-direction:column;align-items:flex-start;text-align:left;gap:8px; }
#commander-table .ct-primary-profile strong { font-size:24px; }
#commander-table .ct-onboarding { max-width:520px;margin:auto;padding:32px 16px; }
#commander-table .ct-onboarding form,#commander-table .ct-onboarding label { display:grid;gap:12px; }
#commander-table .ct-onboarding form { gap:24px; }
#commander-table .ct-onboarding input,#commander-table .ct-onboarding select { padding:12px;max-width:100%; }
#commander-table #ct-rotate-hint { position:fixed;inset:0;z-index:100;background:var(--ct-bg);color:var(--ct-ink);display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:24px; }
#commander-table #ct-rotate-hint>span { font-size:72px; }
#commander-table #ct-rotate-hint[hidden],#commander-table:not([data-screen=tracker]) #ct-rotate-hint { display:none; }
@media(max-width:620px){#commander-table .ct-bar-left,#commander-table .ct-bar-right { gap:4px; }#commander-table .ct-grid .ct-bar { gap:4px; } }
@media(max-width:620px){
 #commander-table .ct-grid .ct-bar { height:132px;min-height:132px;grid-template-rows:36px 44px 36px; }
 #commander-table .ct-bar-left { grid-column:1/-1;grid-row:1;flex-wrap:nowrap;gap:8px; }
 #commander-table .ct-bar-right { grid-column:1/-1;grid-row:3;flex-wrap:nowrap;gap:8px; }
 #commander-table .ct-bar #ct-undo,#commander-table .ct-bar #ct-home,#commander-table .ct-bar #ct-pause { grid-row:2; }
 #commander-table .ct-bar .ct-clock { width:auto; }
 #commander-table[data-bar-collapsed=true] .ct-grid .ct-bar { height:0;min-height:0;grid-template-rows:0; }
 #commander-table[data-bar-collapsed=true] .ct-bar #ct-home { grid-row:auto; }
}
#commander-table #ct-profile-archive[hidden] { display:none; }
/* Unified fantasy scenery and translucent tableau controls. */
#commander-table .ct-grid .ct-bar { container-type:inline-size; }
#commander-table .ct-bar::after { content:"";position:absolute;inset:0;z-index:0;pointer-events:none;border-radius:inherit;background-image:linear-gradient(#12251b44,#12251b44),url('../assets/images/phase-landscapes.png');background-size:100% 100%,100% auto;background-position:center,center calc(50% + 22.2222cqw);background-repeat:no-repeat; }
#commander-table .ct-bar[data-phase=day]::after { background-image:linear-gradient(#23331c22,#23331c22),url('../assets/images/phase-landscapes.png');background-position:center,center; }
#commander-table .ct-bar[data-phase=night]::after { background-image:linear-gradient(#09152622,#09152622),url('../assets/images/phase-landscapes.png');background-position:center,center calc(50% - 22.2222cqw); }
#commander-table .ct-bar::before { z-index:1; }
#commander-table .ct-bar-left,#commander-table .ct-bar-right,#commander-table .ct-bar>button { z-index:2; }
#commander-table[data-bar-collapsed=true] .ct-bar::after { display:none; }
#commander-table .ct-panel { --ct-control-surface:color-mix(in srgb,var(--ct-panel) 60%,transparent);--ct-marker-size:44px; }
#commander-table .ct-tableau-art { opacity:1;filter:none; }
#commander-table .ct-panel button:not(.ct-handle),#commander-table .ct-panel .ct-life,#commander-table .ct-panel .ct-damage-pair { background:var(--ct-control-surface); }
#commander-table .ct-panel .ct-life button,#commander-table .ct-panel .ct-damage-pair .ct-damage { background:transparent; }
#commander-table .ct-panel .ct-quick-resource { background:transparent; }
#commander-table .ct-panel .ct-life { border-radius:10px;background:transparent; }
#commander-table .ct-head,#commander-table .ct-table-layout>.ct-seat[data-side=true] .ct-head { grid-template-columns:30px minmax(0,1fr) calc(var(--ct-marker-size)*2 + 4px) calc(var(--ct-marker-size)*2 + 4px);gap:6px; }
#commander-table .ct-head>.ct-progress-tax,#commander-table .ct-head>.ct-name-status { width:calc(var(--ct-marker-size)*2 + 4px);max-width:none;min-width:0;display:flex;gap:4px; }
#commander-table .ct-head .ct-progress-tax [data-pinned-counter],#commander-table .ct-head .ct-monarch,#commander-table .ct-head .ct-initiative-slot,#commander-table .ct-head .ct-initiative-slot button { width:var(--ct-marker-size);min-width:var(--ct-marker-size);max-width:var(--ct-marker-size);height:var(--ct-marker-size);min-height:var(--ct-marker-size);flex:0 0 var(--ct-marker-size);border-radius:5px;padding:2px; }
@container(max-width:440px){#commander-table .ct-panel { --ct-marker-size:36px; }}
/* Legible identity, separated Poison and active status colours. */
#commander-table .ct-panel>.ct-handle { background:var(--ct-control-surface);border:1px solid var(--ct-line);border-radius:7px; }
#commander-table .ct-head>.ct-person { background:var(--ct-control-surface);padding:4px 7px;border-radius:6px; }
#commander-table .ct-head .ct-monarch[aria-pressed=true],#commander-table .ct-head .ct-monarch[aria-pressed=true] svg { color:#f6ce55;stroke:#f6ce55; }
#commander-table .ct-head [data-pinned-status=initiative][aria-pressed=true],#commander-table .ct-head [data-pinned-status=initiative][aria-pressed=true] svg { color:#70baff;stroke:#70baff; }
#commander-table .ct-quick-resource,#commander-table .ct-quick-resource:first-of-type { flex:0 0 calc((100% - 12px)/4);width:calc((100% - 12px)/4); }
#commander-table .ct-life:has(.ct-poison-slot) { padding-bottom:46px; }
#commander-table .ct-poison-slot { position:absolute;bottom:0;left:50%;transform:translateX(-50%);height:40px; }
#commander-table .ct-panel .ct-poison-slot [data-pinned-counter=poison] { width:68px;min-width:68px;height:40px;min-height:40px;display:flex;align-items:center;justify-content:center;gap:6px;font-size:17px;background:var(--ct-control-surface);border:1px solid var(--ct-line); }
#commander-table .ct-poison-slot svg { width:24px;height:24px; }
#commander-table .ct-table-layout>.ct-seat[data-side=true] .ct-life:has(.ct-poison-slot) { height:auto;min-height:0;padding-bottom:28px; }
#commander-table .ct-table-layout>.ct-seat[data-side=true] .ct-life:has(.ct-poison-slot) .ct-number { font-size:28px!important;line-height:1; }
#commander-table .ct-life:has(.ct-poison-slot) .ct-number { bottom:46px; }
#commander-table .ct-table-layout>.ct-seat[data-side=true] .ct-life:has(.ct-poison-slot) .ct-number { bottom:28px; }
/* Review revision: centred pickers, restrained surfaces, larger readable values. */
#commander-table #ct-picker-new,#commander-table #ct-picker-commander-new { display:flex;align-items:center;justify-content:center;gap:8px;width:100%; }
#commander-table [data-pick-commander] { position:relative;isolation:isolate;display:flex;justify-content:center;text-align:center;min-height:64px;overflow:hidden;padding:12px 32px; }
#commander-table [data-pick-commander]>span { flex:0 1 auto;text-align:center;background:var(--ct-control-surface,var(--ct-button));border-radius:6px;padding:4px 8px; }
#commander-table [data-pick-commander]>svg { position:absolute;right:10px;top:50%;transform:translateY(-50%); }
#commander-table .ct-grid .ct-bar { --bar-frame:color-mix(in srgb,var(--ct-ink) 60%,transparent);--bar-surface:color-mix(in srgb,var(--ct-button) 80%,transparent); }
#commander-table .ct-bar[data-phase=day] { --bar-frame:#6d765e;--bar-surface:#fff8e7cc; }
#commander-table .ct-bar[data-phase=night] { --bar-frame:#8495b3;--bar-surface:#26364ecc; }
#commander-table .ct-bar button:not(:is(#ct-home,#ct-daynight,#ct-day-info)),#commander-table .ct-bar .ct-clock { background:var(--bar-surface);border:1px solid var(--bar-frame);border-radius:10px;height:34px;min-height:34px; }
#commander-table .ct-bar button:not(:is(#ct-home,#ct-daynight)) { width:34px;min-width:34px;display:flex;justify-content:center;align-items:center;padding:4px; }
#commander-table .ct-bar .ct-day-picker { height:36px;background:var(--bar-surface);border-color:var(--bar-frame); }
#commander-table .ct-bar #ct-global-tools { position:relative;gap:0; }


#commander-table .ct-player-title { position:absolute;top:2px;left:12px;max-width:calc(50% - 56px);font-size:14px;line-height:20px;font-weight:650;background:var(--ct-control-surface);border-radius:5px;padding:1px 6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
#commander-table .ct-head>.ct-person { background:transparent;padding:0;align-self:center; }
#commander-table .ct-head .ct-commander { display:table;width:fit-content;max-width:100%;padding:4px 7px;background:var(--ct-control-surface);border-radius:6px;font-size:13px;line-height:16px; }
#commander-table .ct-head .ct-partner-name { font-size:inherit;line-height:inherit;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
#commander-table .ct-head .ct-commander[hidden] { display:none; }
#commander-table .ct-panel { --ct-marker-size:44px; }
#commander-table .ct-head>.ct-progress-tax,#commander-table .ct-head>.ct-name-status { align-items:center;align-self:center;height:44px; }
#commander-table .ct-head .ct-initiative-slot { order:0; }
#commander-table .ct-head .ct-monarch { order:1; }
#commander-table .ct-life,#commander-table .ct-life:has(.ct-poison-slot) { padding-bottom:46px; }
#commander-table .ct-life .ct-number,#commander-table .ct-life:has(.ct-poison-slot) .ct-number { bottom:46px;line-height:1; }
#commander-table .ct-panel .ct-damage b { font-size:36px; }
#commander-table .ct-panel .ct-damage>span,#commander-table .ct-panel .ct-pair-player { font-size:14.3px;line-height:17px; }
#commander-table .ct-panel .ct-damage-pair { padding-top:23px; }
#commander-table .ct-panel .ct-quick-resource { background:var(--ct-control-surface);overflow:hidden; }
#commander-table .ct-panel .ct-quick-resource button { background:transparent;border-radius:0; }
#commander-table .ct-quick-resource [data-resource-step="-1"] { width:48px;flex-basis:48px;font-size:24px; }
#commander-table .ct-quick-resource [data-resource-step="-1"]::after { top:6px;bottom:6px;border-right:2px solid var(--ct-muted);height:auto; }
#commander-table .ct-panel.ct-eliminated::after { content:"";position:absolute;inset:0;background:#0009;z-index:3;border-radius:inherit;pointer-events:none; }
#commander-table .ct-eliminated .ct-life { z-index:4; }
#commander-table .ct-eliminated .ct-skull { width:min(180px,90%);height:min(180px,90%);object-fit:contain; }
#commander-table .ct-overlay:has(.ct-counter-dialog) { background:transparent;overflow:hidden;border-radius:14px; }
#commander-table .ct-counter-dialog { background:color-mix(in srgb,var(--ct-panel) 95%,transparent); }
#commander-table .ct-finish-top { display:flex;justify-content:space-between;gap:12px;margin:16px 0; }
#commander-table .ct-finish-save { display:flex;flex-direction:column;align-items:center;gap:10px;margin-top:20px; }
#commander-table #ct-draw-game[aria-pressed=true] { border-color:var(--ct-gold);background:color-mix(in srgb,var(--ct-gold) 20%,var(--ct-button)); }
#commander-table .ct-counter-dialog { transform:translate(-50%,-50%) rotate(var(--dialog-angle,0deg)) translateY(var(--menu-slide,0px)); }
#commander-table .ct-quick-resource [data-resource-step="-1"] { width:min(48px,40%);flex-basis:min(48px,40%); }
#commander-table .ct-rules-top { position:relative; }
#commander-table #ct-rule-language { float:right;margin:0 0 8px 12px; }
#commander-table .ct-eliminated .ct-life { z-index:auto; }
#commander-table .ct-eliminated .ct-number { z-index:4; }
#commander-table .ct-damages>button.ct-damage b { top:calc(50% + 10px); }
#commander-table .ct-bar #ct-home { background:var(--bar-surface);border-color:var(--bar-frame); }
#commander-table .ct-head .ct-initiative-slot { padding:0; }
@media(max-width:620px){#commander-table .ct-grid .ct-bar { grid-template-columns:minmax(0,1fr) 34px 44px 34px minmax(0,1fr); }}
/* Corrections from the desktop acceptance checklist. */
#commander-table .ct-dialog>.ct-close { position:absolute;right:12px;top:12px;float:none;width:32px;min-width:32px;height:32px;min-height:32px;padding:0;display:grid;place-items:center;font-size:23px;line-height:1; }
#commander-table .ct-dialog>#ct-dialog-title { min-height:32px;padding-right:36px; }
#commander-table .ct-profile-picker>button[data-pick-commander] { display:flex;justify-content:center;align-items:center;padding:14px 32px 22px; }
#commander-table .ct-profile-picker>button[data-pick-commander]>span { width:fit-content;max-width:100%;flex:0 1 auto;text-align:center;background:color-mix(in srgb,var(--ct-panel) 50%,transparent); }
#commander-table [data-pick-commander] .ct-profile-art-credit { position:absolute;left:8px;right:8px;bottom:3px;max-width:calc(100% - 16px);font-size:9px;line-height:11px;text-align:center;pointer-events:none; }
#commander-table .ct-head>.ct-person .ct-commander { display:table;width:fit-content;max-width:100%;align-self:flex-start;font-size:13px;line-height:16px; }


#commander-table .ct-panel.ct-eliminated button:disabled { opacity:1;filter:none; }
#commander-table .ct-panel.ct-eliminated::after { z-index:10; }
#commander-table .ct-eliminated .ct-number { z-index:11; }
#commander-table .ct-result-row,#commander-table .ct-result-labels { display:grid;grid-template-columns:minmax(65px,1fr) 54px minmax(120px,1.65fr);gap:8px;align-items:center;margin:8px 0; }
#commander-table .ct-result-row>span { grid-column:auto;overflow-wrap:anywhere; }
#commander-table .ct-result-row [data-rank] { text-align:center;padding:8px 2px; }
#commander-table .ct-result-labels { font-size:12px;color:var(--ct-muted); }
#commander-table .ct-finish-section { margin:16px 0;padding-top:12px;border-top:1px solid var(--ct-line); }
#commander-table .ct-finish-section h4 { margin:0 0 10px;text-align:center; }
#commander-table .ct-finish-actions { display:grid;grid-template-columns:1fr 1fr;gap:10px; }
#commander-table .ct-finish-actions button { width:100%;min-width:0; }
#commander-table .ct-draw-row { display:flex;justify-content:center;margin:18px 0 12px; }
#commander-table #ct-finish-confirmation[hidden],#commander-table #ct-finish-form[hidden] { display:none; }
#commander-table .ct-head>.ct-person .ct-commander[hidden] { display:none; }

/* Quick-start artwork mirroring follows the seat, independently of player identity. */
#commander-table .ct-tableau-art.ct-art-flipped { transform:rotate(180deg) scaleY(-1); }
/* Collapsed controls must stay hidden regardless of individual button styles. */
#commander-table[data-bar-collapsed=true] .ct-bar button:not(#ct-home) { display:none!important; }

/* Follow-up acceptance: centred close marks and result visibility. */
#commander-table .ct-dialog>.ct-close,#commander-table #ct-rule-clear { font-size:0; }
#commander-table #ct-rule-clear { position:relative; }
#commander-table .ct-close::before,#commander-table .ct-close::after,#commander-table #ct-rule-clear::before,#commander-table #ct-rule-clear::after { content:"";position:absolute;left:50%;top:50%;width:15px;height:2px;background:currentColor;border-radius:1px;transform:translate(-50%,-50%) rotate(45deg);pointer-events:none; }
#commander-table .ct-close::after,#commander-table #ct-rule-clear::after { transform:translate(-50%,-50%) rotate(-45deg); }
#commander-table .ct-profile-picker>button[data-pick-commander]>span { font-size:1.5em; }
#commander-table #ct-finish-form>.ct-finish-section:first-child { border-top:0;padding-top:0;padding-bottom:16px;border-bottom:1px solid var(--ct-line); }
#commander-table .ct-result-row [data-reason][hidden] { display:block;visibility:hidden; }
#commander-table .ct-exit-reason { display:block;margin-bottom:8px; }
#commander-table #ct-exit-reason { width:100%;min-height:44px;padding:8px;background:var(--ct-button);color:var(--ct-ink);border:1px solid var(--ct-line);border-radius:6px; }
#commander-table .ct-result-labels>span:last-child { overflow-wrap:anywhere; }
#commander-table .ct-stat-table-wrap { overflow-x:auto; }
#commander-table .ct-commander-stats { width:100%;border-collapse:collapse; }
#commander-table .ct-commander-stats th,#commander-table .ct-commander-stats td { text-align:right;padding:12px 10px;border-bottom:1px solid var(--ct-line); }
#commander-table .ct-commander-stats th:first-child { text-align:left; }
#commander-table .ct-general-metrics { display:grid;grid-template-columns:repeat(auto-fit,minmax(155px,1fr));gap:12px;margin:16px 0 24px; }
#commander-table .ct-general-metrics>div { display:flex;flex-direction:column;gap:8px;padding:16px;border:1px solid var(--ct-line);border-radius:10px;background:var(--ct-panel); }
#commander-table .ct-general-metrics strong { font-size:22px; }
#commander-table .ct-general-metrics span { font-size:13px;color:var(--ct-muted); }
#commander-table .ct-general-breakdowns { display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:20px; }
#commander-table .ct-stat-breakdown dl>div { display:flex;justify-content:space-between;gap:12px;padding:8px 0;border-bottom:1px solid var(--ct-line); }
#commander-table .ct-stat-breakdown dd { margin:0;font-weight:600; }

/* Statistics: centred text within cards, table cells and breakdown columns. */
#commander-table .ct-statistics-page { text-align:center; }
#commander-table .ct-statistics-page .ct-general-metrics>div { align-items:center;justify-content:center;text-align:center; }
#commander-table .ct-statistics-page .ct-commander-stats th,#commander-table .ct-statistics-page .ct-commander-stats td { text-align:center;vertical-align:middle; }
#commander-table .ct-statistics-page .ct-stat-breakdown dl>div { display:grid;grid-template-columns:minmax(0,1fr) 64px;align-items:center;text-align:center; }
/* Format entry points and a dedicated non-Commander tableau layout. */
#commander-table .ct-start-actions { max-width:none; }
#commander-table .ct-format-start { position:relative;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;width:100%; }
#commander-table .ct-format-start::after { content:"";position:absolute;left:50%;top:0;bottom:0;width:1px;background:var(--ct-muted);transform:translateX(-50%);pointer-events:none; }
#commander-table .ct-format-start>section { display:flex;flex-direction:column;gap:12px;min-width:0; }
#commander-table .ct-format-start>section+section { border-left:0;padding-left:0; }
#commander-table .ct-format-start h2 { margin:4px 0;font-size:18px;text-align:center; }
#commander-table .ct-format-start button { width:100%;display:flex;align-items:center;justify-content:center;gap:8px; }
#commander-table #ct-other-formats { width:100%;max-width:280px;align-self:center;text-align:center;justify-content:center; }
#commander-table .ct-format-categories { display:grid;grid-template-columns:minmax(0,1fr);gap:16px; }
#commander-table .ct-format-categories section { display:flex;flex-direction:column;min-width:0;border:1px solid var(--ct-line);border-radius:14px;overflow:hidden; }
#commander-table .ct-format-categories button { text-align:center;display:flex;flex-direction:column;gap:6px;align-items:center; }
#commander-table .ct-format-categories small { font-size:12px;color:var(--ct-muted); }
#commander-table .ct-team-label { text-align:center;font-size:13px; }
#commander-table[data-commander-damage=false] .ct-seat .ct-panel { grid-template-rows:44px minmax(0,1fr) 44px; }
#commander-table[data-tableau=duel] .ct-head { grid-template-columns:minmax(0,1fr) 92px; }
#commander-table[data-tableau=duel] .ct-head>.ct-person { display:none; }
#commander-table[data-tableau=duel] .ct-head>.ct-progress-tax { grid-column:1;justify-self:start; }
#commander-table[data-tableau=duel] .ct-head>.ct-name-status { grid-column:2; }
#commander-table[data-commander-damage=false] .ct-life,#commander-table[data-commander-damage=false] .ct-life:has(.ct-poison-slot) { padding-bottom:0; }
#commander-table[data-commander-damage=false] .ct-life .ct-number,#commander-table[data-commander-damage=false] .ct-life:has(.ct-poison-slot) .ct-number { top:0;bottom:0; }
@media(max-width:500px){#commander-table .ct-format-start { gap:10px; }#commander-table .ct-format-start>section+section { padding-left:0; }#commander-table .ct-format-start button { padding:10px 4px;font-size:13px; } }

/* Format categories and scoped statistics share the existing page components. */
#commander-table .ct-format-categories h2,#commander-table .ct-format-categories h3,#commander-table .ct-format-recording {text-align:center;}
#commander-table .ct-format-recording {display:block;color:var(--ct-muted);margin:4px 0 12px;}
#commander-table .ct-format-categories h3 {margin:24px 0 6px;}
#commander-table .ct-stat-categories,#commander-table .ct-stat-formats {display:flex;justify-content:center;flex-wrap:wrap;gap:10px;margin:20px 0;}
#commander-table .ct-stat-categories button {flex:1;min-width:90px;}
#commander-table #ct-lobby .ct-profile-stat-categories {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));}
#commander-table #ct-lobby .ct-profile-stat-categories button {min-width:0;overflow-wrap:anywhere;}
@media(max-width:700px){#commander-table #ct-lobby .ct-profile-stat-categories {grid-template-columns:repeat(2,minmax(0,1fr));}}
#commander-table .ct-stat-categories [aria-pressed=true],#commander-table .ct-stat-formats [aria-pressed=true] {border-color:var(--ct-gold);background:color-mix(in srgb,var(--ct-gold) 18%,transparent);}
#commander-table .ct-selected-format {text-align:center;}
#commander-table .ct-stats-list[hidden] {display:none;}

#commander-table #ct-lobby .ct-format-categories h2 {margin:0;}
#commander-table #ct-lobby [data-format-toggle] {position:relative;width:100%;min-height:60px;margin:0;padding:14px 48px;border:0;border-radius:0;background:var(--ct-button);font-size:22px;font-weight:700;line-height:1.3;}
#commander-table [data-format-toggle] svg {position:absolute;right:18px;width:22px;height:22px;transform:rotate(-90deg);}
#commander-table [data-format-toggle][aria-expanded=true] {color:var(--ct-gold);}
#commander-table [data-format-toggle][aria-expanded=true] svg {transform:none;}
#commander-table [data-format-toggle] {scroll-margin-top:calc(12px + env(safe-area-inset-top,0px));}
#commander-table .ct-format-panel {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;padding:20px;border-top:1px solid var(--ct-line);}
#commander-table .ct-format-panel[hidden] {display:none;}
#commander-table .ct-format-panel .ct-format-group {min-width:0;}
#commander-table .ct-format-panel .ct-format-group>button,#commander-table .ct-format-panel .ct-format-subgroup>button {width:100%;margin:0;min-width:0;}
@media(max-width:600px){
  #commander-table .ct-format-panel {grid-template-columns:minmax(0,1fr);gap:16px;padding:16px;}
}
#commander-table .ct-format-recording {margin:0 0 5px;}
#commander-table .ct-format-categories h3 {margin-bottom:5px;}
#commander-table .ct-setup-rules,#commander-table .ct-setup-variants {border:1px solid var(--ct-muted);border-radius:12px;padding:12px 16px;margin:12px 0;text-align:center;}
#commander-table .ct-setup-rules h2,#commander-table .ct-setup-variants h2 {font-size:18px;margin:0 0 8px;}
#commander-table .ct-setup-variants select {margin-left:10px;min-height:44px;max-width:100%;}
#commander-table .ct-profile-commanders[hidden] {display:none;}

#commander-table .ct-format-group {display:flex;flex-direction:column;gap:10px;padding:12px;border:1px solid var(--ct-muted);border-radius:12px;min-width:0;}
#commander-table .ct-format-group h3 {margin:0;}
#commander-table .ct-format-group .ct-format-recording {margin:0 0 2px;}
#commander-table .ct-format-group button {width:100%;min-width:0;}

#commander-table .ct-format-subgroup {display:flex;flex-direction:column;gap:10px;min-width:0;}
#commander-table .ct-format-subgroup+.ct-format-subgroup {margin-top:10px;}

#commander-table .ct-setup-variants {padding:8px 12px;}
#commander-table .ct-setup-variants p:empty {display:none;}
#commander-table #ct-setup-rule-link {margin-top:18px;}
/* Collection and imported decks */
#commander-table .ct-decks-page {max-width:1200px;margin:auto;text-align:center;}
#commander-table .ct-library-action {display:flex;width:100%;margin:12px 0;padding:18px;}
#commander-table .ct-deck-folders {display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px;}
#commander-table .ct-deck-folders button {display:flex;flex-direction:column;padding:20px;gap:8px;}
#commander-table .ct-decks-page>label {display:flex;flex-direction:column;gap:8px;margin:14px 0;text-align:left;}
#commander-table .ct-decks-page input,#commander-table .ct-decks-page textarea,#commander-table .ct-decks-page select {width:100%;box-sizing:border-box;min-height:44px;padding:10px;border:1px solid var(--ct-muted);border-radius:8px;background:var(--ct-panel);color:var(--ct-ink);font:inherit;}
#commander-table .ct-decks-page textarea {resize:vertical;min-height:240px;line-height:1.5;}
#commander-table .ct-deck-controls {display:flex;flex-wrap:wrap;gap:12px;align-items:end;justify-content:center;margin:18px 0;}
#commander-table .ct-deck-controls label {display:flex;flex:1 1 160px;flex-direction:column;gap:6px;}
#commander-table .ct-deck-grid {display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:16px;}
#commander-table .ct-deck-group {margin:26px 0;}
#commander-table .ct-deck-group h2 {text-align:left;font-size:18px;}
#commander-table #ct-lobby .ct-deck-card {display:flex;flex-direction:column;justify-content:flex-start;gap:6px;padding:6px;min-width:0;overflow:hidden;}
#commander-table .ct-deck-card img {width:100%;aspect-ratio:63/88;object-fit:contain;border-radius:8px;}
#commander-table .ct-deck-card strong {font-size:13px;overflow-wrap:anywhere;}
#commander-table .ct-deck-card small {font-size:12px;}
#commander-table .ct-missing-card {display:grid;place-items:center;aspect-ratio:63/88;width:100%;font-size:13px;border:1px dashed var(--ct-muted);border-radius:8px;}
#commander-table .ct-curve-bars {display:flex;align-items:end;justify-content:center;gap:12px;min-height:150px;}
#commander-table .ct-curve-bars>div {display:flex;flex-direction:column;align-items:center;gap:5px;flex:1;max-width:70px;}
#commander-table .ct-curve-bars span {width:100%;border-radius:5px 5px 0 0;background:var(--ct-gold);}
.ct-card-dialog {position:fixed;max-width:min(460px,90vw);max-height:88dvh;padding:20px;border:1px solid #76847a;border-radius:16px;background:#202923;color:#f1f5ef;text-align:center;overflow:auto;}
.ct-card-dialog::backdrop {background:#000a;}
.ct-card-dialog img {max-width:100%;max-height:62dvh;object-fit:contain;border-radius:12px;}
.ct-card-dialog h2 {font-size:18px;padding:0 25px;}
.ct-card-dialog button {background:#35463c;color:#fff;border:1px solid #7a8b80;border-radius:8px;min-height:40px;min-width:40px;cursor:pointer;}
.ct-card-dialog .ct-card-close {position:absolute;right:8px;top:8px;font-size:24px;}
.ct-card-dialog small {display:block;margin:10px 0;}
@media(max-width:500px){#commander-table .ct-deck-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}#commander-table .ct-deck-controls {gap:8px;}#commander-table .ct-curve-bars {gap:6px;} }

/* Rule navigation at the bottom of preparation. */
#commander-table #ct-lobby #ct-setup-rule-link { display:block; width:fit-content; max-width:100%; margin:0; padding:9px 16px; font-size:.85rem; min-height:40px; }
#commander-table #ct-lobby #ct-setup-bans { display:block; width:fit-content; max-width:100%; margin:0; }
#commander-table #ct-pentagon-start-note { padding:12px; border:1px solid #d4b65c; border-radius:10px; background:#332e20; color:#fff4ce; }

#commander-table .ct-pentagon-notice {position:fixed;z-index:10000;top:max(12px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);width:min(440px,calc(100vw - 32px));box-sizing:border-box;padding:14px;border:1px solid #d4b65c;border-radius:12px;background:#252d27;color:#fff4ce;box-shadow:0 8px 28px #0008;text-align:center;}

#commander-table .ct-setup-rule-actions {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:end;gap:12px;margin-top:20px;}
#commander-table .ct-setup-rule-actions #ct-setup-bans {grid-column:1;grid-row:1;justify-self:start;}
#commander-table .ct-setup-rule-actions #ct-setup-rule-link {grid-column:2;grid-row:1;justify-self:end;white-space:normal;}

/* Shared card/list switch and collection folders. */
.ct-card-view-switch {display:inline-flex;gap:4px;border:1px solid #75877a;border-radius:10px;padding:3px;margin:8px 0;}
.ct-card-view-switch button[aria-pressed=true] {background:#617e69!important;color:#fff!important;box-shadow:inset 0 0 0 1px #a6c7af;}
/* Use the shared collection switch in deck controls as well. */
#commander-table .ct-deck-controls>.ct-view-toggle {flex:none;}
#commander-table #ct-lobby .ct-deck-legality{margin:16px 0 20px;padding:14px 18px;border:1px solid #759280;border-radius:12px;text-align:left;background:#29382d;}
#commander-table #ct-lobby .ct-deck-legality[data-state="invalid"]{border-color:#e47a79;background:#382725;}
#commander-table #ct-lobby .ct-deck-legality[data-state="incomplete"]{border-color:#c5ab60;background:#343329;}
#commander-table #ct-lobby .ct-deck-legality h2{font-size:18px;text-align:left;margin:0 0 8px;}
#commander-table #ct-lobby .ct-deck-legality p{font-size:13px;margin:6px 0;}
#commander-table #ct-lobby .ct-deck-legality ul{margin:0;padding-left:22px;font-size:14px;line-height:1.5;overflow-wrap:anywhere;}
#commander-table #ct-lobby .ct-deck-legality li+li{margin-top:4px;}
#commander-table #ct-lobby .ct-deck-color-choices label{display:flex;flex-direction:column;gap:6px;max-width:340px;margin:12px 0;}
#commander-table #ct-lobby .ct-deck-legality button{margin-top:10px;}
#commander-table #ct-lobby .ct-deck-card-invalid{border:2px solid #ff8383;background:#492e2e;box-shadow:0 0 0 1px #ff838355;}
#commander-table #ct-lobby .ct-deck-card-invalid:hover{background:#553332;}
#commander-table .ct-card-tile {min-width:0;}
#commander-table .ct-card-tile>.ct-deck-card {width:100%;}
#commander-table .ct-deck-grid.ct-card-list,.ct-collection-dialog .ct-deck-grid.ct-card-list {display:block;}
.ct-card-list-head,.ct-card-list-row {display:grid;grid-template-columns:minmax(0,1.6fr) minmax(65px,.6fr) minmax(0,1fr);gap:10px;align-items:center;padding:10px 8px;border-bottom:1px solid #75877a66;text-align:left;overflow-wrap:anywhere;}
.ct-card-list-head {font-weight:700;}
#commander-table #ct-lobby .ct-card-list-row>button,.ct-collection-dialog .ct-card-list-row>button {background:transparent;border:0;justify-content:flex-start;text-align:left;min-width:0;padding:4px;white-space:normal;overflow-wrap:anywhere;}
.ct-card-list-row>.ct-card-row-actions {grid-column:1/-1;}
#commander-table .ct-collection-heading {display:flex;align-items:center;justify-content:space-between;gap:16px;text-align:left;}
#commander-table .ct-collection-heading h1 {text-align:left;margin-right:auto;}
#commander-table .ct-collection-folders {border-block:1px solid var(--ct-border);padding:18px 0;margin:18px 0;text-align:left;}
#commander-table .ct-folder-grid {display:grid;grid-template-columns:repeat(auto-fill,minmax(145px,1fr));gap:22px 16px;margin-top:24px;}
#commander-table .ct-folder-entry {display:flex;flex-direction:column;align-items:center;min-width:0;}
#commander-table #ct-lobby .ct-folder-open {background:none;border:0;display:flex;flex-direction:column;gap:12px;width:100%;padding:8px;white-space:normal;}
#commander-table .ct-folder-icon {display:block;position:relative;width:125px;height:85px;background:var(--folder-color);border:1px solid #ffffff44;border-radius:3px 9px 9px 9px;box-shadow:0 7px 10px #0004,inset 0 -8px 12px #0002;isolation:isolate;}
#commander-table .ct-folder-icon::before {content:'';position:absolute;left:-1px;top:-12px;width:48px;height:16px;background:var(--folder-color);border:1px solid #ffffff44;border-bottom:0;border-radius:8px 12px 0 0;z-index:-1;}
#commander-table .ct-folder-icon img {width:100%;height:100%;object-fit:cover;border-radius:inherit;opacity:.9;}
#commander-table #ct-lobby .ct-folder-edit {font-size:12px;min-height:32px;padding:4px 8px;background:transparent;}
#commander-table .ct-collection-tools,.ct-stage-tools {display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:16px 0;}
.ct-card-row-actions {display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;padding:8px 0;font-size:12px;}
.ct-card-row-actions label {display:flex;align-items:center;gap:6px;}
#commander-table .ct-card-row-actions input,.ct-collection-dialog input[type=checkbox] {width:20px;height:20px;}
.ct-collection-dialog {width:min(560px,calc(100vw - 32px));max-width:calc(100vw - 32px);box-sizing:border-box;}
.ct-collection-dialog.ct-stage-dialog {width:min(1100px,calc(100vw - 32px));}
.ct-collection-dialog form,.ct-collection-dialog .ct-intake-options {display:flex;flex-direction:column;gap:14px;}
.ct-collection-dialog label {display:flex;flex-direction:column;text-align:left;gap:6px;margin:10px 0;min-width:0;}
.ct-collection-dialog input,.ct-collection-dialog select,.ct-collection-dialog textarea {box-sizing:border-box;max-width:100%;min-height:40px;padding:8px;border:1px solid #76847a;border-radius:7px;background:#303f35;color:#fff;font:inherit;}
.ct-collection-dialog input[type=checkbox] {min-height:20px;padding:0;}
.ct-collection-dialog .ct-card-row-actions label,.ct-stage-tools>label {flex-direction:row;align-items:center;}
.ct-collection-dialog input[type=color] {padding:3px;width:100%;}
.ct-collection-dialog button:disabled {opacity:.45;cursor:default;}
.ct-collection-dialog .ct-attribute-fields {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 12px;}
.ct-collection-dialog .ct-attribute-fields label:last-child {grid-column:1/-1;}
.ct-collection-dialog #ct-folder-art-preview {width:100%;max-height:160px;object-fit:cover;}
.ct-collection-dialog .ct-deck-grid {display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:14px;margin:12px 0;}
.ct-collection-dialog .ct-deck-card {display:flex;flex-direction:column;gap:8px;padding:6px;width:100%;}
.ct-collection-dialog .ct-deck-card strong {font-size:13px;overflow-wrap:anywhere;}
.ct-collection-dialog .ct-deck-card img {width:100%;aspect-ratio:63/88;max-height:none;object-fit:contain;}
.ct-collection-dialog .ct-missing-card {display:grid;place-items:center;aspect-ratio:63/88;font-size:13px;}
.ct-collection-dialog .ct-card-suggestions {display:flex;flex-direction:column;max-height:230px;overflow:auto;gap:6px;margin:10px 0;}
.ct-collection-dialog .ct-card-suggestions button {padding:10px;text-align:left;}
.ct-collection-dialog #ct-intake-preview,.ct-collection-dialog #ct-edit-card-preview {max-width:240px;margin-inline:auto;}
@media(max-width:500px){#commander-table .ct-collection-heading {align-items:flex-start;gap:8px;}#commander-table #ct-lobby .ct-collection-heading h1 {font-size:23px;}#commander-table #ct-lobby #ct-add-cards {font-size:13px;padding:8px;}.ct-collection-dialog {padding:16px;}.ct-card-list-head,.ct-card-list-row {font-size:12px;gap:6px;grid-template-columns:minmax(0,1.4fr) 82px minmax(0,1fr);} .ct-collection-dialog .ct-deck-grid {grid-template-columns:repeat(2,minmax(0,1fr));}}

#commander-table #ct-lobby .ct-collection-tools label {display:flex;flex-direction:row;align-items:center;gap:8px;flex-wrap:wrap;}
#commander-table #ct-lobby .ct-collection-tools input[type=checkbox] {width:20px;min-width:20px;max-width:20px;height:20px;min-height:20px;margin:0;padding:0;}
.ct-card-list-head>span:nth-child(2) {white-space:nowrap;}

/* Collection workflow: folder artwork covers the tab and body as one clipped image. */
#commander-table .ct-library-divider {border:0;border-top:1px solid var(--ct-border);margin:24px 0;}
#commander-table .ct-intake-heading-actions {display:flex;flex-direction:column;align-items:stretch;gap:8px;}
#commander-table .ct-intake-heading-actions #ct-resume-intake {font-size:12px;}
#commander-table .ct-collection-total {font-size:13px;}
#commander-table .ct-folder-icon {width:145px;height:102px;background:none;border:0;border-radius:0;box-shadow:none;filter:drop-shadow(0 6px 4px #0005);}
#commander-table .ct-folder-icon::before {display:none;}
#commander-table .ct-folder-icon svg {display:block;width:100%;height:100%;}
.ct-stage-add-actions,.ct-selection-tools {display:flex;align-items:center;flex-wrap:wrap;gap:10px;}
.ct-stage-add-actions>button {flex:1;min-height:46px;padding:10px;}
.ct-collection-dialog hr {border:0;border-top:1px solid #75877a;margin:18px 0;}
.ct-card-selected {outline:3px solid #d6b65f;outline-offset:2px;border-radius:8px;background:#d6b65f22;}
#commander-table .ct-selection-tools [hidden],.ct-collection-dialog [hidden],.ct-card-view-switch[hidden] {display:none!important;}
.ct-collection-dialog .ct-stage-tools .ct-select-all {display:flex;flex-direction:row;align-items:center;gap:8px;margin:0;}
.ct-collection-dialog .ct-card-tile {min-width:0;}
.ct-collection-dialog #ct-stage-save {display:block;margin:18px auto 0;min-width:160px;}
#commander-table .ct-folder-open:hover .ct-folder-icon {filter:drop-shadow(0 8px 5px #0006);}
@media(max-width:500px){#commander-table .ct-intake-heading-actions {max-width:48%;}.ct-stage-add-actions {gap:6px;}.ct-stage-add-actions>button {font-size:12px;padding:8px;min-width:0;}.ct-selection-tools {gap:8px;}}

/* Collection view toggle and a separate selection row. */
#commander-table .ct-collection-tools .ct-selection-tools {flex-basis:100%;display:flex;align-items:center;gap:12px;flex-wrap:wrap;}
.ct-card-edition {display:block;font-size:12px;line-height:1.4;text-align:center;overflow-wrap:anywhere;margin-top:5px;}

#commander-table .ct-collection-tools {display:grid;grid-template-columns:max-content minmax(0,1fr);align-items:center;}
#commander-table .ct-collection-tools>label {min-width:0;}
#commander-table .ct-collection-tools select {min-width:0;width:100%;}
#commander-table .ct-collection-tools>label:has(#ct-deck-card-filter),#commander-table .ct-collection-tools>.ct-selection-tools {grid-column:1/-1;}
#commander-table .ct-collection-tools>.ct-selection-tools {grid-row:2;}
#commander-table .ct-collection-tools>label:has(#ct-deck-card-filter) {grid-row:3;}

/* Anchor the thumb to the track, independent of shared button alignment. */
#commander-table #ct-lobby .ct-view-toggle {display:flex;align-items:center;gap:8px;white-space:nowrap;align-self:end;margin:0;min-height:44px;box-sizing:border-box;}
#commander-table #ct-lobby .ct-view-toggle button {position:relative;display:block;box-sizing:border-box;flex:none;width:52px;min-width:52px;max-width:52px;height:30px;min-height:30px;max-height:30px;padding:0;border:1px solid #829486;border-radius:18px;background:#82948655;}
#commander-table #ct-lobby .ct-view-toggle button span {position:absolute;display:block;box-sizing:border-box;left:3px;right:auto;top:3px;bottom:auto;width:22px;height:22px;min-width:0;margin:0;border-radius:50%;background:currentColor;transform:none;}
#commander-table #ct-lobby .ct-view-toggle button[aria-checked=true] span {left:auto;right:3px;transform:none;}

/* Keep the two collection filters side by side. */
#commander-table .ct-collection-tools:has(#ct-deck-card-filter) {grid-template-columns:max-content minmax(110px,160px) minmax(180px,260px);justify-content:start;}
#commander-table .ct-collection-tools>label:has(#ct-deck-card-filter) {grid-column:3;grid-row:1;}
#commander-table #ct-lobby .ct-collection-tools>label {display:flex;flex-direction:column;align-items:stretch;gap:6px;}
@media(max-width:600px){
#commander-table .ct-collection-tools:has(#ct-deck-card-filter) {grid-template-columns:minmax(0,1fr) minmax(0,1.5fr);}
#commander-table .ct-collection-tools:has(#ct-deck-card-filter)>.ct-view-toggle {grid-row:1;grid-column:1;justify-self:start;}
#commander-table .ct-collection-tools:has(#ct-deck-card-filter)>label:has(#ct-collection-sort) {grid-row:2;grid-column:1;}
#commander-table .ct-collection-tools>label:has(#ct-deck-card-filter) {grid-column:2;grid-row:2;}
#commander-table .ct-collection-tools:has(#ct-deck-card-filter)>.ct-selection-tools {grid-row:3;}
}

/* Shared content-page rhythm and bounded collection folder area. */
#commander-table #ct-lobby .ct-decks-page {width:100%;max-width:1120px;margin:0 auto;padding:8px 0 32px;box-sizing:border-box;}
#commander-table #ct-lobby .ct-decks-page>.ct-back {display:block;justify-self:start;margin:0 0 24px;padding:10px 14px;min-height:44px;}
#commander-table #ct-lobby .ct-decks-page h1 {font-size:28px;line-height:1.25;font-weight:700;margin:0 0 12px;}
#commander-table #ct-lobby .ct-decks-page h2 {font-size:21px;line-height:1.3;font-weight:650;margin:24px 0 12px;}
#commander-table #ct-lobby .ct-decks-page {font-size:15px;line-height:1.5;}
#commander-table .ct-collection-folders {border:1px solid #84988866;border-radius:14px;padding:20px;margin:24px 0;}
#commander-table .ct-folder-grid {grid-template-columns:repeat(5,minmax(0,1fr));gap:24px 16px;margin-top:20px;}
#commander-table .ct-folder-entry {min-width:0;}
#commander-table .ct-folder-count {display:block;margin-top:6px;font-size:13px;opacity:.8;}
#commander-table .ct-folder-icon {max-width:100%;}
.ct-collection-dialog #ct-folder-art-preview {aspect-ratio:160/112;height:auto;max-height:none;object-fit:cover;border-radius:10px;}
#commander-table .ct-decks-page:has(>.ct-library-collection-actions) {max-width:900px;}
#commander-table #ct-lobby .ct-decks-page>.ct-library-action {display:flex;align-items:center;justify-content:center;width:100%;min-height:72px;margin:12px 0;border-radius:12px;font-size:17px;}
#commander-table .ct-deck-folders {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;}
@media(max-width:800px){#commander-table .ct-folder-grid {grid-template-columns:repeat(3,minmax(0,1fr));}}
@media(max-width:500px){#commander-table .ct-folder-grid {grid-template-columns:repeat(2,minmax(0,1fr));}#commander-table .ct-collection-folders {padding:12px;}#commander-table .ct-deck-folders {grid-template-columns:repeat(2,minmax(0,1fr));}}

/* Adopted layout, 2026-09-15: common page geometry replaces draft translations. */
#commander-table #ct-lobby {--ct-page-width:1120px;--ct-title-size:28px;--ct-section-size:21px;--ct-copy-size:15px;}
#commander-table #ct-lobby :is(.ct-profiles-page,.ct-setup,.ct-decks-page,.ct-rules-page) {box-sizing:border-box;width:100%;max-width:var(--ct-page-width);padding:16px 0 32px;margin:0 auto;font-size:var(--ct-copy-size);line-height:1.5;}
#commander-table #ct-lobby :is(.ct-profiles-page,.ct-setup,.ct-decks-page,.ct-rules-page) h1 {font-size:var(--ct-title-size);line-height:1.25;font-weight:700;margin:0 0 16px;font-family:inherit;}
#commander-table #ct-lobby :is(.ct-profiles-page,.ct-setup,.ct-decks-page,.ct-rules-page) h2 {font-size:var(--ct-section-size);line-height:1.3;font-weight:650;font-family:inherit;}
#commander-table #ct-lobby :is(.ct-profiles-page,.ct-setup,.ct-decks-page,.ct-rules-page) .ct-back {display:flex;align-items:center;justify-content:center;gap:8px;width:max-content;max-width:100%;min-height:44px;margin:0 auto 24px 0;padding:10px 14px;font:inherit;float:none;}
#commander-table #ct-lobby :is(.ct-profile-heading,.ct-setup-heading,.ct-collection-heading) {margin:0 0 20px;align-items:center;}
#commander-table #ct-lobby .ct-profile-heading h1,#commander-table #ct-lobby .ct-collection-heading h1 {margin:0;}
#commander-table #ct-lobby .ct-profiles-page:has(#ct-open-primary) {display:flex;flex-direction:column;gap:0;}
#commander-table #ct-lobby .ct-profiles-page:has(#ct-open-primary)>.ct-profile-heading {display:contents;}
#commander-table #ct-lobby .ct-profiles-page:has(#ct-open-primary)>.ct-profile-heading>div {order:1;margin-bottom:20px;}
#commander-table #ct-lobby #ct-profile-home {order:0;}
#commander-table #ct-lobby #ct-open-primary {order:2;margin:0 0 24px;width:100%;}
#commander-table #ct-lobby .ct-profiles-page:has(#ct-open-primary)>.ct-profile-tabs {order:3;margin:0 0 16px;}
#commander-table #ct-lobby .ct-profiles-page:has(#ct-open-primary)>.ct-profile-list {order:4;}
#commander-table #ct-lobby #ct-profile-add {order:5;align-self:flex-end;margin-top:20px;}
#commander-table #ct-lobby .ct-collection-folders {margin:16px 0 24px;padding:16px;display:flex;flex-direction:column;gap:16px;}
#commander-table #ct-lobby #ct-create-folder {align-self:flex-end;margin:0;min-height:44px;}
#commander-table #ct-lobby .ct-folder-grid {margin:0;}
#commander-table #ct-lobby .ct-collection-section-heading {display:flex;align-items:center;justify-content:flex-start;gap:16px;flex-wrap:wrap;margin:0 0 16px;}
#commander-table #ct-lobby .ct-collection-section-heading h2,#commander-table #ct-lobby #ct-visible-card-count {margin:0;}
#commander-table #ct-lobby #ct-visible-card-count {font-size:var(--ct-copy-size);color:var(--ct-muted);}
#commander-table #ct-lobby .ct-collection-tools {margin:0 0 20px;}
#commander-table #ct-lobby .ct-decks-page:has(>.ct-library-collection-actions) {max-width:var(--ct-page-width);display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:24px;align-content:start;}
#commander-table #ct-lobby .ct-decks-page:has(>.ct-library-collection-actions)>* {grid-column:1/-1;}
#commander-table #ct-lobby .ct-decks-page:has(>.ct-library-collection-actions)>.ct-library-action {min-height:80px;margin:0;padding:20px;font-size:17px;}
#commander-table #ct-lobby .ct-decks-page:has(>.ct-library-collection-actions)>.ct-library-divider {width:100%;margin:24px 0;}
#commander-table #ct-lobby .ct-decks-page:has(>.ct-library-collection-actions)>h2 {margin:0 0 16px;}
#commander-table #ct-lobby .ct-decks-page:has(>.ct-library-collection-actions)>.ct-deck-folders {margin:20px 0 0;}
#commander-table #ct-lobby .ct-setup-options {margin:16px 0 24px;gap:16px;}
#commander-table #ct-lobby .ct-setup-heading {display:flex;flex-direction:column;align-items:flex-start;gap:8px;}
#commander-table #ct-lobby .ct-setup-heading h1 {order:0;margin:0;}
#commander-table #ct-lobby .ct-setup-heading .ct-eyebrow {order:1;}
#commander-table #ct-lobby .ct-setup-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-setup-toolbar>.ct-back{margin:0;flex:none;}
#commander-table #ct-lobby #ct-setup-start{margin:0 0 0 auto;min-height:44px;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-setup-title{margin:24px 0;text-align:center;font-size:clamp(22px,3vw,30px);line-height:1.3;}
#commander-table #ct-lobby .ct-setup-options:empty{display:none;}
#commander-table #ct-lobby #ct-setup-rules-open{display:flex;width:100%;min-height:60px;margin:16px 0 0;justify-content:center;gap:12px;font-size:20px;font-weight:700;}
#commander-table #ct-special-variant{background:var(--ct-button);color:var(--ct-ink);border:1px solid var(--ct-line);border-radius:10px;padding:8px 12px;}
#commander-table .ct-overlay:has(.ct-dialog>.ct-setup-rules){z-index:40;background:#000a;}
#commander-table .ct-dialog:has(>.ct-setup-rules)>.ct-close{position:sticky;top:0;float:right;right:auto;width:44px;height:44px;z-index:1;background:var(--ct-panel);}
#commander-table .ct-dialog>.ct-setup-rules{border:0;margin:0;padding:0;text-align:left;}
#commander-table .ct-dialog>.ct-setup-rules>h2{min-height:44px;margin:0 52px 16px 0;font-size:22px;display:flex;align-items:center;}
#commander-table .ct-dialog>.ct-setup-rules p{line-height:1.5;}
#commander-table .ct-dialog>.ct-setup-rules a{color:var(--ct-gold);overflow-wrap:anywhere;}
@media(max-width:600px){#commander-table #ct-lobby {--ct-title-size:24px;--ct-section-size:20px;}#commander-table #ct-lobby .ct-collection-heading {flex-wrap:wrap;gap:12px;}#commander-table #ct-lobby .ct-intake-heading-actions {max-width:100%;margin-left:auto;}}

#commander-table #ct-lobby :is(.ct-profiles-page,.ct-setup,.ct-decks-page,.ct-rules-page) h1 {text-align:left;}

/* Illustrated binders: artwork belongs to the cover, not the spine or pages. */
#commander-table .ct-folder-icon.ct-binder-icon,.ct-collection-dialog .ct-binder-icon {display:block;width:160px;height:auto;aspect-ratio:180/220;max-width:100%;background:none;border:0;border-radius:0;box-shadow:none;filter:none;margin:auto;}
#commander-table .ct-folder-icon.ct-binder-icon:before,.ct-collection-dialog .ct-binder-icon:before {display:none;}
#commander-table .ct-binder-icon svg,.ct-collection-dialog .ct-binder-icon svg {display:block;width:100%;height:100%;max-width:none;}
#commander-table .ct-folder-open:hover .ct-binder-icon {filter:drop-shadow(0 4px 3px #0002);}
.ct-collection-dialog #ct-folder-art-preview {width:100%;height:auto;max-height:none;aspect-ratio:auto;margin:16px auto;}
.ct-collection-dialog #ct-folder-art-preview .ct-binder-icon {width:220px;}

/* Collection landing, deckboxes and shared binder sorting controls. */
#commander-table #ct-lobby #ct-library-add-cards {justify-self:end;margin:0 0 12px;}
#commander-table #ct-lobby #ct-collection.ct-collection-banner {background:linear-gradient(#0003,#0005),url('../assets/collection/cards-collage.png') center 48%/cover;min-height:154px;border:1px solid #879589;}
#commander-table #ct-lobby .ct-collection-banner>span {background:#14231de0;color:#fff;padding:12px 24px;border-radius:9px;font-weight:650;}
#commander-table #ct-lobby #ct-deck-folder-settings {justify-self:end;margin:16px 0 0;}
#commander-table .ct-empty-deck-folder {opacity:.58;filter:saturate(.45);}
#commander-table .ct-empty-deck-folder:hover {opacity:.85;}
#commander-table .ct-deckbox {display:block;width:180px;max-width:100%;margin:0 auto 8px;filter:drop-shadow(0 6px 3px #0003);}
#commander-table .ct-deckbox svg {display:block;width:100%;height:auto;max-width:none;}
#commander-table .ct-deck-box-grid{grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch;}
#commander-table .ct-deck-entry{position:relative;min-width:0;}
#commander-table #ct-lobby .ct-deck-entry>[data-open-deck]{width:100%;height:100%;align-items:center;justify-content:center;padding:16px 10px;user-select:none;-webkit-touch-callout:none;touch-action:pan-y;}
#commander-table .ct-deck-entry strong{font-size:16px;overflow-wrap:anywhere;}
#commander-table .ct-deck-card-count-badge{position:absolute;top:10px;right:12px;font-size:12px;font-weight:400;color:var(--ct-muted);white-space:nowrap;pointer-events:none;}
#commander-table .ct-deck-entry:has(.ct-deck-trash:not([hidden])) .ct-deck-card-count-badge{right:60px;}
#commander-table #ct-lobby .ct-deck-delete-button,.ct-deck-delete-dialog .ct-deck-delete-button{background:#682c2c;border:1px solid #e47a79;color:#fff;}
#commander-table #ct-lobby .ct-deck-trash{position:absolute;top:8px;right:8px;width:44px;height:44px;min-height:44px;padding:10px;display:grid;place-items:center;}
#commander-table #ct-lobby .ct-deck-trash[hidden]{display:none;}
#commander-table .ct-deck-trash svg{width:22px;height:22px;}
#commander-table .ct-deck-detail-footer{display:flex;justify-content:flex-end;margin-top:28px;}
.ct-deck-delete-dialog{max-width:420px;}
.ct-deck-delete-dialog h2{padding:0;text-align:center;}
.ct-delete-dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:20px;}
.ct-delete-dialog-actions button{min-height:44px;padding:10px 14px;border-radius:10px;cursor:pointer;}
@media(min-width:761px){#commander-table .ct-deck-box-grid{grid-template-columns:repeat(3,minmax(0,1fr));}}
@media(min-width:1100px){#commander-table .ct-deck-box-grid{grid-template-columns:repeat(4,minmax(0,1fr));}}
#commander-table [data-open-deck] {display:flex;flex-direction:column;align-items:center;gap:6px;}
.ct-deck-visibility {display:flex;align-items:center;gap:10px;margin:12px 0;}.ct-deck-visibility input {width:20px;height:20px;}
#commander-table .ct-folder-actions {display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;}
.ct-folder-picker {display:grid;gap:10px;}
#commander-table #ct-lobby .ct-collection-tools {grid-template-columns:max-content 208px;justify-content:start;}
#commander-table #ct-lobby .ct-collection-tools:has(#ct-deck-card-filter) {grid-template-columns:max-content 208px minmax(180px,260px);}
#commander-table #ct-lobby .ct-sort-pair {display:flex;align-items:flex-end;gap:8px;width:208px;max-width:100%;}
#commander-table #ct-lobby .ct-sort-pair label {display:flex;flex-direction:column;gap:6px;min-width:0;width:160px;}
#commander-table #ct-lobby #ct-sort-reverse {width:40px;min-width:40px;height:44px;min-height:44px;padding:0;font-size:22px;}
#commander-table #ct-sort-reverse[aria-pressed=true] {background:#54745c;color:white;}
@media(max-width:600px){
#commander-table #ct-lobby .ct-collection-tools,#commander-table #ct-lobby .ct-collection-tools:has(#ct-deck-card-filter) {grid-template-columns:minmax(0,1fr) minmax(0,1fr);}
#commander-table #ct-lobby .ct-sort-pair {grid-column:1;grid-row:2;width:208px;max-width:100%;}
#commander-table #ct-lobby .ct-collection-tools>.ct-view-toggle {grid-row:1;grid-column:1/-1;}
#commander-table #ct-lobby .ct-collection-tools>.ct-selection-tools {grid-row:3;}
#commander-table #ct-lobby .ct-sort-pair label {flex:1;}
}

#commander-table #ct-lobby #ct-collection.ct-collection-banner {background-image:linear-gradient(#0001,#0003),url('../assets/collection/cards-illustration.svg');}
#commander-table #ct-lobby #ct-deck-folder-settings {margin:0 0 12px;justify-self:end;}
#commander-table .ct-deck-add-actions {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;}
#commander-table #ct-lobby .ct-deck-add-actions>.ct-library-action {width:100%;min-height:64px;margin:0;padding:14px;border-radius:12px;}
.ct-deck-visibility-dialog {width:340px;max-width:calc(100vw - 32px);}
.ct-deck-visibility-row {display:flex;align-items:center;gap:8px;border-bottom:1px solid #81928444;min-height:40px;}
.ct-deck-visibility-row .ct-deck-visibility {display:flex;align-items:center;flex:1;gap:10px;margin:0;padding:6px 0;}
.ct-deck-visibility-row .ct-deck-visibility input {width:18px;height:18px;min-width:18px;margin:0;}
.ct-deck-visibility-row>button {width:32px;height:32px;min-height:32px;padding:0;font-size:20px;background:transparent;border:0;}

#commander-table #ct-lobby .ct-library-decks {box-sizing:border-box;border:1px solid #84988866;border-radius:14px;padding:20px;display:flex;flex-direction:column;gap:20px;min-width:0;}
#commander-table #ct-lobby .ct-library-decks-heading {display:flex;align-items:center;justify-content:space-between;gap:16px;}
#commander-table #ct-lobby .ct-library-decks-heading h2,#commander-table #ct-lobby .ct-library-decks-heading #ct-deck-folder-settings {margin:0;}
#commander-table #ct-lobby .ct-library-decks .ct-deck-folders {margin:0;}
#commander-table #ct-lobby .ct-library-decks .ct-deck-folders:empty {display:none;}
@media(max-width:500px){#commander-table #ct-lobby .ct-library-decks {padding:14px;gap:16px;}#commander-table #ct-lobby .ct-library-decks-heading {gap:8px;}#commander-table #ct-lobby .ct-library-decks-heading #ct-deck-folder-settings {font-size:13px;padding:8px;}}

#commander-table #ct-lobby .ct-library-decks-heading {display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;}
#commander-table #ct-lobby .ct-library-decks-heading h2 {grid-column:2;grid-row:1;text-align:center;}
#commander-table #ct-lobby .ct-library-decks-heading #ct-deck-folder-settings {grid-column:3;grid-row:1;justify-self:end;max-width:100%;white-space:normal;}

/* Collection overview: binder heading above, pool controls together below. */
#commander-table #ct-lobby .ct-collection-overview .ct-folder-actions {display:flex;align-items:center;justify-content:flex-end;gap:12px;}
#commander-table #ct-lobby .ct-collection-overview .ct-folder-actions h1 {margin:0 auto 0 0;}
#commander-table #ct-lobby .ct-collection-overview .ct-folder-actions #ct-create-folder {align-self:auto;}
#commander-table #ct-lobby .ct-collection-overview .ct-collection-tools {display:grid;grid-template-columns:208px minmax(180px,1fr) max-content max-content;align-items:end;gap:12px;}
#commander-table #ct-lobby .ct-collection-overview .ct-pool-identity {grid-column:1/-1;grid-row:1;display:flex;align-items:center;gap:20px;flex-wrap:wrap;margin-bottom:4px;}
#commander-table #ct-lobby .ct-pool-identity .ct-collection-section-heading {margin:0;}
#commander-table #ct-lobby .ct-pool-identity .ct-view-toggle {align-self:center;}
#commander-table #ct-lobby .ct-collection-overview .ct-sort-pair {grid-column:1;grid-row:2;}
#commander-table #ct-lobby .ct-collection-overview label:has(>#ct-deck-card-filter) {grid-column:2;grid-row:2;}
#commander-table #ct-lobby .ct-collection-overview #ct-add-cards {grid-column:3;grid-row:2;min-height:44px;margin:0;}
#commander-table #ct-lobby .ct-collection-overview .ct-selection-tools {display:contents;}
#commander-table #ct-lobby .ct-collection-overview #ct-owned-select {grid-column:4;grid-row:2;min-height:44px;}
#commander-table #ct-lobby .ct-collection-overview .ct-select-all {grid-column:3;grid-row:3;}
#commander-table #ct-lobby .ct-collection-overview #ct-owned-edit {grid-column:4;grid-row:3;}
#commander-table #ct-lobby .ct-collection-overview #ct-resume-intake {grid-column:1/3;grid-row:3;justify-self:start;}
@media(max-width:800px){
#commander-table #ct-lobby .ct-collection-overview .ct-collection-tools {grid-template-columns:minmax(0,1fr) minmax(0,1fr);}
#commander-table #ct-lobby .ct-collection-overview #ct-add-cards {grid-column:1;grid-row:3;}
#commander-table #ct-lobby .ct-collection-overview #ct-owned-select {grid-column:2;grid-row:3;}
#commander-table #ct-lobby .ct-collection-overview .ct-select-all {grid-column:1;grid-row:4;}
#commander-table #ct-lobby .ct-collection-overview #ct-owned-edit {grid-column:2;grid-row:4;}
#commander-table #ct-lobby .ct-collection-overview #ct-resume-intake {grid-column:1/-1;grid-row:5;}
#commander-table #ct-lobby .ct-collection-overview .ct-folder-actions h1 {flex-basis:100%;}
}

#commander-table #ct-lobby .ct-collection-overview .ct-folder-actions {display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:12px;align-items:center;}
#commander-table #ct-lobby .ct-collection-overview .ct-folder-actions h1 {grid-column:2;margin:0;text-align:center;}
#commander-table #ct-lobby .ct-folder-action-buttons {grid-column:3;justify-self:end;display:flex;gap:8px;}
#commander-table #ct-lobby .ct-collection-overview .ct-pool-identity {justify-content:center;}
#commander-table #ct-lobby .ct-pool-identity .ct-collection-section-heading {justify-content:center;text-align:center;}
#commander-table #ct-lobby .ct-collection-overview .ct-collection-tools {grid-template-columns:360px minmax(170px,1fr) max-content max-content;}
#commander-table #ct-lobby .ct-collection-overview .ct-sort-pair {width:360px;gap:10px;align-items:flex-end;}
#commander-table #ct-lobby .ct-collection-overview .ct-sort-pair .ct-view-toggle {align-self:flex-end;flex-shrink:0;}
#commander-table #ct-lobby .ct-collection-overview .ct-collection-folders {padding:12px 16px;gap:10px;margin:8px 0 18px;}
#commander-table #ct-lobby .ct-collection-overview .ct-folder-grid {gap:10px 16px;}
#commander-table #ct-lobby .ct-collection-overview .ct-folder-open {gap:3px;padding:4px;align-items:center;}
#commander-table #ct-lobby .ct-collection-overview .ct-binder-icon {width:130px;margin:0 auto;flex:none;}
#commander-table #ct-lobby .ct-collection-overview .ct-folder-open strong {font-size:14px;line-height:1.25;margin:0;}
#commander-table #ct-lobby .ct-collection-overview .ct-folder-count {font-size:12px;line-height:1.2;margin:0;}
@media(max-width:1000px){
#commander-table #ct-lobby .ct-collection-overview .ct-folder-actions {grid-template-columns:1fr;}
#commander-table #ct-lobby .ct-collection-overview .ct-folder-actions h1 {grid-column:1;}
#commander-table #ct-lobby .ct-folder-action-buttons {grid-column:1;}
#commander-table #ct-lobby .ct-collection-overview .ct-collection-tools {grid-template-columns:minmax(0,1fr) minmax(0,1fr);}
#commander-table #ct-lobby .ct-collection-overview .ct-sort-pair {grid-column:1/-1;grid-row:2;max-width:100%;}
#commander-table #ct-lobby .ct-collection-overview label:has(>#ct-deck-card-filter) {grid-column:1;grid-row:3;}
#commander-table #ct-lobby .ct-collection-overview #ct-add-cards {grid-column:2;grid-row:3;}
#commander-table #ct-lobby .ct-collection-overview #ct-owned-select {grid-column:2;grid-row:4;}
#commander-table #ct-lobby .ct-collection-overview .ct-select-all {grid-column:1;grid-row:5;}
#commander-table #ct-lobby .ct-collection-overview #ct-owned-edit {grid-column:2;grid-row:5;}
#commander-table #ct-lobby .ct-collection-overview #ct-resume-intake {grid-column:1/-1;grid-row:6;}
}

#commander-table #ct-lobby .ct-collection-overview .ct-pool-identity {width:100%;}
#commander-table #ct-lobby .ct-pool-identity .ct-collection-section-heading {display:grid;width:100%;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:12px;}
#commander-table #ct-lobby .ct-pool-identity h2 {grid-column:2;grid-row:1;text-align:center;}
#commander-table #ct-lobby .ct-pool-identity #ct-visible-card-count {grid-column:3;grid-row:1;justify-self:start;}
#commander-table #ct-lobby .ct-collection-overview #ct-add-cards,#commander-table #ct-lobby .ct-collection-overview #ct-owned-select {justify-self:end;width:max-content;max-width:100%;}
.ct-collection-dialog #ct-folder-delete,.ct-collection-dialog #ct-folder-delete-confirm {color:#b44343;border-color:#b44343;margin-top:12px;}
@media(max-width:500px){#commander-table #ct-lobby .ct-pool-identity .ct-collection-section-heading {grid-template-columns:1fr;gap:4px;}#commander-table #ct-lobby .ct-pool-identity h2 {grid-column:1;}#commander-table #ct-lobby .ct-pool-identity #ct-visible-card-count {grid-column:1;grid-row:2;justify-self:center;}}

/* Override the older :has(filter) column rule as well: use all available width. */
#commander-table #ct-lobby .ct-collection-overview .ct-collection-tools:has(#ct-deck-card-filter) {width:100%;max-width:none;box-sizing:border-box;grid-template-columns:360px minmax(180px,1fr) max-content max-content;justify-content:stretch;}
#commander-table #ct-lobby .ct-collection-overview .ct-pool-identity .ct-collection-section-heading {grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);width:100%;}
#commander-table #ct-lobby #ct-pool-title {grid-column:2;grid-row:1;justify-self:center;text-align:center;}
@media(max-width:1000px){#commander-table #ct-lobby .ct-collection-overview .ct-collection-tools:has(#ct-deck-card-filter) {grid-template-columns:minmax(0,1fr) minmax(0,1fr);}}
@media(max-width:500px){#commander-table #ct-lobby .ct-collection-overview .ct-pool-identity .ct-collection-section-heading {grid-template-columns:1fr;}#commander-table #ct-lobby #ct-pool-title {grid-column:1;}}

#commander-table #ct-lobby .ct-collection-overview label:has(>#ct-deck-card-filter) {width:max-content;max-width:100%;justify-self:start;}
#commander-table #ct-lobby #ct-deck-card-filter {width:24ch;max-width:100%;min-width:0;}
#commander-table #ct-lobby #ct-collection-pages {display:flex;justify-content:center;align-items:center;gap:8px;flex-wrap:wrap;margin:24px 0 8px;}
#commander-table #ct-lobby #ct-collection-pages[hidden] {display:none;}
#commander-table #ct-lobby #ct-collection-pages button {min-width:40px;min-height:40px;padding:8px;}
#commander-table #ct-lobby #ct-collection-pages [aria-current=page] {background:#58765f;color:white;border-color:#8db597;}


/* Quantity belongs to each card; the overall count stays beside the heading. */
.ct-card-quantity {display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:calc(2ch + 12px);width:max-content;height:26px;padding:3px 5px;border:1px solid #9caf9e;border-radius:5px;background:#21362ded;color:#f4fff5;font-size:13px;line-height:1;font-variant-numeric:tabular-nums;white-space:nowrap;flex-shrink:0;}
.ct-deck-card>strong:has(.ct-card-quantity) {position:relative;box-sizing:border-box;display:block;width:100%;min-height:28px;padding:4px 2px 4px 40px;}
.ct-deck-card>strong>.ct-card-quantity {position:absolute;left:0;top:0;}
.ct-card-list-row>button:has(.ct-card-quantity) {display:flex;align-items:center;gap:8px;}

/* Card quantity and name share one normal-weight, left-aligned text row. */
#commander-table #ct-lobby .ct-deck-card>strong,.ct-collection-dialog .ct-deck-card>strong {font-weight:400;text-align:left;}
#commander-table #ct-lobby .ct-deck-card>strong:has(.ct-card-quantity),.ct-collection-dialog .ct-deck-card>strong:has(.ct-card-quantity) {display:flex;align-items:flex-start;gap:6px;min-height:0;padding:0;line-height:1.4;font-size:13px;}
.ct-deck-card>strong>.ct-card-quantity {position:static;}
.ct-card-quantity {font-weight:400;font-size:inherit;line-height:1.4;height:1.4em;min-width:calc(3ch + 6px);padding:0 3px;border-radius:4px;}

#commander-table #ct-lobby .ct-deck-card>strong,.ct-collection-dialog .ct-deck-card>strong {display:flex;align-items:center;width:100%;min-width:0;max-width:100%;box-sizing:border-box;gap:6px;font-weight:400;overflow:hidden;}
#commander-table #ct-lobby .ct-deck-card>strong:has(.ct-card-quantity),.ct-collection-dialog .ct-deck-card>strong:has(.ct-card-quantity) {align-items:center;}
.ct-deck-card .ct-card-name {display:block;flex:1;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center;}
.ct-deck-card .ct-card-quantity {flex:0 0 auto;}

#commander-table #ct-lobby .ct-deck-card,.ct-collection-dialog .ct-deck-card {padding:6px;gap:6px;}
#commander-table #ct-lobby .ct-deck-card>strong,.ct-collection-dialog .ct-deck-card>strong {padding:0;margin:0;min-height:20px;line-height:20px;}
.ct-deck-card .ct-card-footer {display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:6px;width:100%;min-width:0;min-height:20px;line-height:20px;}
.ct-deck-card .ct-card-footer .ct-card-edition {grid-column:2;margin:0;padding:0;font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:20px;}
.ct-deck-card .ct-card-footer .ct-card-quantity {margin:0;height:20px;line-height:18px;}

.ct-deck-card .ct-card-footer>.ct-card-quantity {grid-column:3;grid-row:1;justify-self:end;}
.ct-deck-card .ct-card-footer>.ct-card-edition {grid-row:1;}
/* Cardmarket reference values and consistent collection folder controls. */
.ct-deck-card .ct-card-price {justify-self:end;white-space:nowrap;font-size:12px;font-weight:400;}
.ct-deck-card .ct-card-footer {grid-template-columns:minmax(0,1fr) auto;}
.ct-deck-card .ct-card-footer>.ct-card-edition {grid-column:1;text-align:left;}
.ct-deck-card .ct-card-footer>.ct-card-price {grid-column:2;grid-row:1;}
.ct-deck-card>strong>.ct-card-quantity {position:static;margin-left:auto;}
.ct-card-list .ct-card-list-head,.ct-card-list .ct-card-list-row {display:grid;grid-template-columns:minmax(120px,2fr) 65px minmax(100px,2fr) minmax(90px,1fr);gap:10px;align-items:center;}
.ct-card-list-row>.ct-card-price {text-align:right;}
#commander-table #ct-lobby .ct-collection-overview .ct-pool-identity {display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:12px;}
#commander-table #ct-lobby .ct-collection-overview .ct-pool-identity .ct-collection-section-heading {grid-column:2;display:flex;width:auto;align-items:center;justify-content:center;gap:10px;}
#commander-table #ct-lobby .ct-pool-identity h1,#commander-table #ct-lobby .ct-pool-identity h2,#commander-table #ct-lobby .ct-pool-identity p {margin:0;}
#commander-table #ct-lobby .ct-folder-value {grid-column:3;justify-self:end;text-align:right;font-size:13px;}
#commander-table #ct-lobby .ct-folder-detail .ct-collection-tools {grid-template-columns:360px minmax(0,1fr) max-content max-content;width:100%;}
@media(max-width:1000px){#commander-table #ct-lobby .ct-folder-detail .ct-collection-tools {grid-template-columns:minmax(0,1fr) minmax(0,1fr);}}
@media(max-width:650px){#commander-table #ct-lobby .ct-collection-overview .ct-pool-identity {grid-template-columns:minmax(0,1fr);}
#commander-table #ct-lobby .ct-collection-overview .ct-pool-identity .ct-collection-section-heading {grid-column:1;flex-wrap:wrap;}
#commander-table #ct-lobby .ct-folder-value {grid-column:1;}
.ct-card-list .ct-card-list-head,.ct-card-list .ct-card-list-row {grid-template-columns:minmax(90px,2fr) 40px minmax(75px,1fr) 80px;gap:5px;font-size:12px;}}
/* Collection quantities sit on the artwork; the name keeps the full centred row. */
.ct-collection-cards .ct-collection-card-image{position:relative;display:block;width:100%;line-height:0;}
.ct-collection-cards .ct-collection-card-image>img{display:block;}
.ct-collection-cards .ct-collection-card-image>.ct-card-quantity{position:absolute;right:6px;bottom:6px;min-width:32px;height:24px;margin:0;padding:2px 5px;line-height:18px;font-size:13px;background:#18271ff2;box-shadow:0 1px 4px #0008;}
#commander-table #ct-lobby .ct-collection-cards .ct-deck-card>strong{justify-content:center;text-align:center;}
.ct-collection-cards.ct-card-list>.ct-card-list-head,.ct-collection-cards.ct-card-list>.ct-card-list-row{grid-template-columns:44px minmax(0,1fr) 60px 60px 80px;gap:8px;}
.ct-collection-cards.ct-card-list .ct-list-quantity{white-space:nowrap;font-variant-numeric:tabular-nums;}
.ct-collection-cards.ct-card-list>.ct-card-list-head>span:last-child{text-align:right;}
@media(max-width:650px){
  .ct-collection-cards.ct-card-list>.ct-card-list-head,.ct-collection-cards.ct-card-list>.ct-card-list-row{grid-template-columns:44px minmax(0,1fr) 42px 34px 60px;gap:4px;padding:8px 4px;font-size:12px;}
}
/* Scanner: two modes, a touch crop surface and explicit candidate selection. */
.ct-scanner-dialog {width:min(94vw,820px);max-height:92dvh;overflow:auto;box-sizing:border-box;}
.ct-scan-modes {display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;border:1px solid #8da593;border-radius:12px;}
.ct-scan-modes button {min-height:44px;border:0;background:transparent;}
.ct-scan-modes button[aria-pressed=true] {background:#47674f;color:#fff;box-shadow:inset 0 0 0 1px #aec5ab;}
.ct-scan-inputs,.ct-scan-photo-actions {display:flex;flex-wrap:wrap;gap:10px;margin:12px 0;align-items:center;}
.ct-scanner-dialog button,.ct-scan-file {min-height:44px;padding:9px 13px;}
.ct-scan-file {position:relative;display:inline-flex;align-items:center;box-sizing:border-box;border:1px solid #7a8f7d;border-radius:9px;cursor:pointer;}
.ct-scan-file input {position:absolute;opacity:0;width:100%;height:100%;inset:0;cursor:pointer;}
.ct-scan-file:focus-within {outline:2px solid #e4c36a;outline-offset:2px;}
.ct-scan-camera {position:relative;width:min(100%,280px);aspect-ratio:5/7;margin:0 auto;overflow:hidden;border:2px solid #e7c773;border-radius:10px;}
.ct-scan-camera video {width:100%;height:100%;object-fit:cover;}
#ct-scan-preview {display:block;max-width:100%;max-height:360px;width:auto;height:auto;margin:12px auto;touch-action:none;border-radius:6px;cursor:crosshair;}
.ct-scanner-dialog [hidden] {display:none!important;}
.ct-scan-fields {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:12px 0;}
.ct-scan-fields label {display:grid;gap:6px;min-width:0;}
.ct-scan-fields input,.ct-scan-fields select {width:100%;min-width:0;box-sizing:border-box;font-size:16px;padding:10px;}
.ct-scan-fields button {grid-column:1/-1;}
.ct-scan-match {display:flex;align-items:center;gap:16px;width:100%;text-align:left;}
.ct-scan-match img {width:110px;max-width:32%;border-radius:7px;}
.ct-scan-candidates {grid-template-columns:repeat(auto-fill,minmax(130px,1fr));}
.ct-scan-status {min-height:1.5em;font-size:14px;}
@media(max-width:500px){.ct-scanner-dialog {padding:16px;}#ct-scan-preview {max-height:290px;}.ct-scan-candidates {grid-template-columns:repeat(2,minmax(0,1fr));}}
/* Continuous scanner, with its own visible destination for each captured card. */
.ct-live-layout {display:grid;grid-template-columns:minmax(0,1fr) 145px;gap:16px;align-items:start;}
.ct-live-scanner .ct-scan-camera {width:min(100%,330px);}
.ct-live-guide {position:absolute;left:1.5%;top:85%;width:80%;height:14.5%;border:2px solid #ffe496;box-sizing:border-box;pointer-events:none;}
.ct-live-scanner[data-mode=art] .ct-live-guide {left:8%;top:13%;width:84%;height:40%;}
.ct-live-preview {position:sticky;top:8px;padding:10px;border:1px solid #718473;border-radius:10px;background:#233229;min-width:0;color:#f5fff5;}
.ct-live-preview h3 {margin:0 0 8px;text-align:center;font-size:16px;}
#ct-live-count {font-variant-numeric:tabular-nums;}
#ct-live-thumbs {display:flex;flex-direction:column;align-items:center;gap:6px;max-height:310px;overflow:auto;min-height:64px;}
.ct-live-scanner #ct-live-thumbs img {width:62px;height:87px;object-fit:cover;border-radius:5px;margin:0;}
.ct-live-preview button {width:100%;font-size:13px;margin-top:8px;}
.ct-live-confirm {position:absolute;inset:0;display:grid;place-items:center;color:#ecfff0;background:#345c4338;font-size:70px;opacity:0;pointer-events:none;}
.ct-scan-success .ct-live-confirm {opacity:1;}
.ct-scanner-dialog .ct-scan-flying-card {max-width:none;max-height:none;object-fit:fill;transform-origin:top left;z-index:10;pointer-events:none;border-radius:8px;margin:0;box-shadow:0 10px 30px #0007;}
.ct-scan-help {font-size:13px;opacity:.85;}
@media(max-width:520px){.ct-live-layout {grid-template-columns:minmax(0,1fr) 92px;gap:8px;}.ct-live-preview {padding:6px;}.ct-live-preview button {padding:8px 4px;font-size:12px;}.ct-live-scanner .ct-scan-camera {width:100%;}#ct-live-thumbs {max-height:210px;}.ct-live-scanner #ct-live-thumbs img {width:48px;height:67px;}}
@media(prefers-reduced-motion:reduce){.ct-scan-flying-card {display:none;}}

/* AP05: collection dialogs retain their existing structure and actions. */
.ct-collection-dialog {overscroll-behavior:contain;scroll-padding-block:56px 16px;}
.ct-collection-dialog button {min-width:44px;min-height:44px;touch-action:manipulation;}
.ct-collection-dialog :is(input:not([type=checkbox]),select,textarea) {min-height:44px;font-size:16px;}
.ct-collection-dialog :is(button,input,select,textarea,a):focus-visible {outline:3px solid #efce80;outline-offset:2px;}
.ct-collection-dialog .ct-card-close {position:sticky;float:right;top:0;right:auto;margin:-12px -12px 0 8px;z-index:3;background:#35463c;}
.ct-collection-dialog h2 {min-height:44px;display:flex;align-items:center;justify-content:center;overflow-wrap:anywhere;}
@media(max-width:420px){
 .ct-collection-dialog .ct-attribute-fields {grid-template-columns:minmax(0,1fr);}
 .ct-collection-dialog {padding:16px;}
 .ct-collection-dialog .ct-card-close {margin:-8px -8px 0 8px;}
}

/* Two device views: smartphone in both orientations; shared tablet/PC view. */
#commander-table[data-device-view="smartphone"] #ct-lobby {--ct-title-size:24px;--ct-section-size:20px;}
#commander-table[data-device-view="smartphone"] .ct-deck-add-actions {grid-template-columns:minmax(0,1fr);gap:10px;}
#commander-table[data-device-view="smartphone"] #ct-lobby .ct-back {min-height:44px;margin-bottom:16px;}
html[data-device-view="smartphone"] .ct-collection-dialog {width:min(560px,calc(100vw - 16px));max-width:calc(100vw - 16px);padding:16px;}
html[data-device-view="smartphone"] .ct-collection-dialog .ct-attribute-fields {grid-template-columns:minmax(0,1fr);}
html[data-device-view="tablet-pc"] .ct-collection-dialog .ct-attribute-fields {grid-template-columns:repeat(2,minmax(0,1fr));}
/* AP05 application shell: shared data, distinct desktop/tablet and phone navigation. */
#commander-table:has(.ct-app-nav) {--ct-nav-width:112px;border-radius:0;min-height:100dvh;}
#commander-table:has(.ct-app-nav):not([data-screen="tracker"]) {padding-left:var(--ct-nav-width);}
#commander-table .ct-app-nav {position:fixed;inset:0 auto 0 0;width:var(--ct-nav-width);height:100dvh;z-index:30;display:flex;flex-direction:column;justify-content:center;background:var(--ct-panel);border-right:1px solid var(--ct-line);padding:16px 10px;}
#commander-table .ct-nav-brand {position:absolute;top:28px;left:0;width:100%;text-align:center;font-weight:800;font-size:30px;letter-spacing:-2px;color:var(--ct-gold);}
#commander-table .ct-nav-brand>span {display:block;font-size:9px;letter-spacing:2px;color:var(--ct-muted);}
#commander-table .ct-nav-items {display:grid;gap:12px;}
#commander-table .ct-app-nav button {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;min-height:72px;padding:10px 4px;background:transparent;border:1px solid transparent;border-radius:14px;font-size:11px;font-weight:600;line-height:1.25;}
#commander-table .ct-app-nav svg {width:24px;height:24px;flex:none;}
#commander-table .ct-app-nav button[aria-current="page"] {background:var(--ct-button);border-color:var(--ct-line);color:var(--ct-gold);}
#commander-table .ct-app-nav #ct-nav-play {background:var(--ct-ink);color:var(--ct-panel);}
#commander-table .ct-app-nav #ct-nav-play[aria-current="page"] {box-shadow:0 0 0 2px var(--ct-gold);}
#commander-table[data-screen="tracker"] .ct-app-nav {display:none;}
#commander-table:has(.ct-app-nav) #ct-lobby {padding:clamp(20px,3vw,48px);}
#commander-table:has(.ct-app-nav) #ct-lobby :is(.ct-profiles-page,.ct-decks-page,.ct-rules-page) {width:100%;max-width:1280px;margin:0 auto;}
#commander-table:has(.ct-app-nav) #ct-lobby h1 {font-size:clamp(26px,3vw,36px);font-weight:700;letter-spacing:-.8px;line-height:1.2;margin:8px 0 24px;}
#commander-table:has(.ct-app-nav) #ct-lobby h2 {font-size:22px;line-height:1.3;letter-spacing:-.3px;}
#commander-table:has(.ct-app-nav) #ct-lobby :is(input:not([type=checkbox]):not([type=range]):not([type=color]),select,textarea) {font-family:inherit;font-size:16px;min-height:44px;border-radius:10px;}
#commander-table:has(.ct-app-nav) :is(button,a,input,select,textarea):focus-visible {outline:3px solid var(--ct-gold);outline-offset:3px;}
#commander-table:has(.ct-app-nav) .ct-welcome {width:min(100%,980px);margin:0 auto;padding:clamp(12px,3vh,36px) 0;text-align:left;}
#commander-table:has(.ct-app-nav) .ct-welcome-icon {display:none;}
#commander-table:has(.ct-app-nav) .ct-welcome>h1 {text-align:left;}
#commander-table:has(.ct-app-nav) .ct-welcome>p {text-align:left;color:var(--ct-muted);font-size:17px;margin-bottom:32px;}
#commander-table:has(.ct-app-nav) .ct-start-actions {width:100%;max-width:none;gap:20px;}
#commander-table:has(.ct-app-nav) .ct-format-start {gap:24px;}
#commander-table:has(.ct-app-nav) .ct-format-start::after {display:none;}
#commander-table:has(.ct-app-nav) .ct-format-start>section {background:var(--ct-panel);border:1px solid var(--ct-line);padding:28px;border-radius:20px;gap:14px;}
#commander-table:has(.ct-app-nav) .ct-format-start h2 {text-align:left;margin:0 0 20px;}
#commander-table:has(.ct-app-nav) .ct-format-start button {min-height:54px;justify-content:flex-start;padding:14px 16px;font-size:15px;}
#commander-table:has(.ct-app-nav) #ct-other-formats {min-height:58px;border-style:dashed;background:transparent;}
#commander-table .ct-page-heading p {color:var(--ct-muted);font-size:16px;margin-bottom:28px;}
#commander-table .ct-tool-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;}
#commander-table .ct-tool-grid>button {display:grid;justify-items:start;gap:12px;padding:24px;text-align:left;min-height:156px;background:var(--ct-panel);border-radius:18px;}
#commander-table .ct-tool-grid svg {width:28px;height:28px;color:var(--ct-gold);}
#commander-table .ct-tool-grid strong {font-size:19px;}
#commander-table .ct-tool-grid small {color:var(--ct-muted);font-size:14px;}
#commander-table #ct-lobby .ct-history-tabs {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:8px 0 24px;}
#commander-table #ct-lobby .ct-history-tabs>button {min-width:0;min-height:64px;padding:14px 20px;border:1px solid var(--ct-line);border-radius:12px;background:var(--ct-button);color:var(--ct-ink);font-size:22px;font-weight:700;line-height:1.25;}
#commander-table #ct-lobby .ct-history-tabs>button[aria-pressed=true] {background:var(--ct-gold);border-color:var(--ct-gold);color:var(--ct-panel);}
#commander-table #ct-lobby .ct-history-tabs>button:focus-visible {outline:2px solid var(--ct-gold);outline-offset:3px;}
@media(max-width:500px){#commander-table #ct-lobby .ct-history-tabs{gap:10px;}#commander-table #ct-lobby .ct-history-tabs>button{font-size:16px;padding:12px 8px;}}
#commander-table[data-device-view="smartphone"]:has(.ct-app-nav):not([data-screen="tracker"]) {padding-left:0;padding-bottom:calc(82px + env(safe-area-inset-bottom));}
#commander-table[data-device-view="smartphone"] .ct-app-nav {inset:auto 0 0;width:100%;height:calc(76px + env(safe-area-inset-bottom));padding:6px 6px calc(6px + env(safe-area-inset-bottom));border-right:0;border-top:1px solid var(--ct-line);}
#commander-table[data-device-view="smartphone"] .ct-nav-brand {display:none;}
#commander-table[data-device-view="smartphone"] .ct-nav-items {display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:3px;}
#commander-table[data-device-view="smartphone"] .ct-app-nav button {min-height:62px;min-width:0;font-size:9px;gap:4px;padding:5px 2px;border-radius:12px;}
#commander-table[data-device-view="smartphone"]:has(.ct-app-nav) #ct-lobby {padding:24px 16px;}
#commander-table[data-device-view="smartphone"]:has(.ct-app-nav) .ct-format-start {grid-template-columns:minmax(0,1fr);gap:16px;}
#commander-table[data-device-view="smartphone"]:has(.ct-app-nav) .ct-format-start>section {padding:20px;}
#commander-table[data-device-view="smartphone"] .ct-tool-grid {grid-template-columns:minmax(0,1fr);gap:12px;}
#commander-table[data-device-view="smartphone"] .ct-tool-grid>button {min-height:120px;padding:20px;}
@media(max-height:540px){#commander-table[data-device-view="tablet-pc"] .ct-nav-brand{display:none;}#commander-table .ct-nav-items{gap:4px;}}

/* Native dialogs live outside the app root and use the same UI typography. */
.ct-card-dialog{font:15px/1.5 ui-sans-serif,system-ui,sans-serif;}
/* Shared dark grey-green shell; game artwork and game-state colours remain independent. */
#commander-table:has(.ct-app-nav):not([data-screen="tracker"]){--ct-bg:#141816;--ct-panel:#202723;--ct-button:#303d33;--ct-ink:#fff;--ct-muted:#ccd0c3;--ct-line:#3d4940;--ct-gold:#f1d56b;background:var(--ct-bg);color:var(--ct-ink);}
#commander-table .ct-app-nav{overflow:visible;background:var(--ct-panel);box-shadow:6px 0 18px rgb(0 0 0 / 18%);}
#commander-table .ct-app-nav #ct-nav-play{position:relative;isolation:isolate;width:92px;height:92px;min-height:92px;justify-self:center;transform:translateX(14px);border-radius:50%;background:#f1d56b;color:#202723;box-shadow:none;border:6px solid #202723;gap:3px;padding:8px 2px;}
#commander-table .ct-app-nav #ct-nav-play::before{content:"";position:absolute;inset:-13px;border-radius:50%;background:var(--ct-panel);border:0;z-index:-2;}
#commander-table .ct-app-nav #ct-nav-play::after{content:"";position:absolute;inset:0;border-radius:50%;background:#f1d56b;z-index:-1;}
#commander-table .ct-app-nav #ct-nav-play[aria-current="page"]{box-shadow:none;}
#commander-table .ct-app-nav #ct-nav-play svg{width:48px;height:40px;color:#fff;}
#commander-table .ct-fanned-cards rect{fill:#f1d56b;}
#commander-table .ct-app-nav #ct-nav-play:hover::after{background:#ffe58a;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-back{display:inline-flex;align-items:center;justify-content:center;width:44px;min-width:44px;height:44px;padding:0;font-size:25px;line-height:1;border:1px solid var(--ct-line);border-radius:12px;margin-bottom:20px;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-back[hidden]{display:none!important;}
#commander-table[data-device-view="tablet-pc"]:has(.ct-app-nav) #ct-lobby{padding:32px 40px 48px;}
#commander-table[data-device-view="tablet-pc"]:has(.ct-app-nav) #ct-lobby>:is(.ct-welcome,.ct-profiles-page,.ct-setup){width:100%;max-width:1120px;margin-inline:auto;}
#commander-table[data-device-view="tablet-pc"]:has(.ct-app-nav) #ct-lobby :is(.ct-decks-page,.ct-rules-page){max-width:1120px;}
#commander-table[data-device-view="tablet-pc"]:has(.ct-app-nav) #ct-lobby :is(h1,h2,.ct-page-heading,.ct-welcome,.ct-welcome>p){text-align:center;}
#commander-table[data-device-view="tablet-pc"]:has(.ct-app-nav) .ct-format-start button{justify-content:center;}
#commander-table[data-device-view="tablet-pc"] .ct-tool-grid>button{justify-items:center;text-align:center;}
#commander-table[data-device-view="smartphone"] .ct-app-nav #ct-nav-play{width:68px;height:68px;min-height:68px;transform:translateY(-18px);border-width:4px;font-size:9px;gap:1px;}
#commander-table[data-device-view="smartphone"] .ct-app-nav #ct-nav-play::before{inset:-9px;}
#commander-table[data-device-view="smartphone"] .ct-app-nav #ct-nav-play svg{width:38px;height:32px;}
#commander-table[data-device-view="smartphone"]:has(.ct-app-nav):not([data-screen="tracker"]){padding-bottom:calc(106px + env(safe-area-inset-bottom));}
@media(max-height:600px){#commander-table[data-device-view="tablet-pc"] .ct-nav-brand{display:none;}#commander-table[data-device-view="tablet-pc"] .ct-nav-items{gap:6px;}#commander-table[data-device-view="tablet-pc"] .ct-app-nav button{min-height:60px;}}
#commander-table:has(.ct-app-nav):not([data-screen="tracker"]){font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;}
#commander-table:has(.ct-app-nav) :is(button,input,select,textarea){font-family:inherit;}
#commander-table[data-device-view="tablet-pc"]:has(.ct-app-nav) .ct-profile-heading{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:16px;}
#commander-table[data-device-view="tablet-pc"]:has(.ct-app-nav) .ct-profile-heading>div:first-child{grid-column:2;}
#commander-table[data-device-view="tablet-pc"]:has(.ct-app-nav) .ct-profile-heading>button{grid-column:3;justify-self:end;}
#commander-table[data-device-view="tablet-pc"]:has(.ct-app-nav) .ct-profile-heading h1{margin-bottom:8px;}
#commander-table[data-device-view="tablet-pc"]:has(.ct-app-nav) .ct-page-heading{text-align:center;}

#commander-table[data-device-view="smartphone"] .ct-app-nav{box-shadow:0 -6px 18px rgb(0 0 0 / 18%);}
#commander-table .ct-app-nav #ct-nav-play:hover .ct-fanned-cards rect{fill:#ffe58a;}
/* Continuous navigation surface and a separator that follows the central bulge. */
#commander-table .ct-app-nav{border-right:0;box-shadow:none;}
#commander-table .ct-nav-items{position:relative;isolation:isolate;background:var(--ct-button);border-radius:40px;padding-block:12px;}
#commander-table .ct-app-nav button{color:#fff;}
#commander-table .ct-app-nav button[aria-current="page"]{border-color:transparent;background:transparent;color:var(--ct-gold);}
#commander-table .ct-app-nav #ct-nav-play{background:var(--ct-button);color:#fff;border:0;}
#commander-table .ct-app-nav #ct-nav-play::before{background:var(--ct-button);inset:-6px;}
#commander-table .ct-app-nav #ct-nav-play::after{display:none;}
#commander-table .ct-app-nav #ct-nav-play svg{color:var(--ct-gold);}
#commander-table .ct-fanned-cards rect,#commander-table .ct-app-nav #ct-nav-play:hover .ct-fanned-cards rect{fill:var(--ct-button);}
#commander-table[data-device-view="smartphone"] .ct-nav-items{padding-block:0;border-radius:24px;}
#commander-table[data-device-view="smartphone"] .ct-app-nav #ct-nav-play{border:0;}
#commander-table[data-device-view="smartphone"] .ct-app-nav #ct-nav-play::before{inset:-5px;}
/* Narrow desktop rail: one shared icon axis and a contour-aligned separator. */
#commander-table[data-device-view="tablet-pc"]:has(.ct-app-nav){--ct-nav-width:88px;}
#commander-table[data-device-view="tablet-pc"] .ct-app-nav{padding-inline:0;}
#commander-table[data-device-view="tablet-pc"] .ct-nav-items{width:100%;border-radius:36px;}
#commander-table[data-device-view="tablet-pc"] .ct-app-nav button{width:100%;font-size:10px;}
#commander-table[data-device-view="tablet-pc"] .ct-app-nav #ct-nav-play{width:100%;transform:none;background:transparent;}
#commander-table[data-device-view="tablet-pc"] .ct-app-nav #ct-nav-play::before{display:none;}
#commander-table[data-device-view="tablet-pc"] .ct-app-nav #ct-nav-play svg{width:40px;height:34px;}

/* A single SVG stroke joins the straight edge and rounded bulge without seams. */
#commander-table .ct-app-nav .ct-nav-contour{display:none;pointer-events:none;}
#commander-table[data-device-view="tablet-pc"] .ct-app-nav .ct-nav-contour{display:block;position:absolute;left:0;top:0;width:calc(100% + 20px);height:100%;z-index:0;overflow:visible;filter:none;}
#commander-table[data-device-view="tablet-pc"] .ct-app-nav #ct-nav-play{width:106px;justify-self:start;}
#commander-table[data-device-view="tablet-pc"] .ct-app-nav #ct-nav-play svg{width:50px;height:41px;}
#commander-table[data-device-view="tablet-pc"] .ct-nav-items{grid-template-columns:minmax(0,1fr);}
#commander-table[data-device-view="tablet-pc"] .ct-app-nav .ct-nav-contour{z-index:2;}
#commander-table[data-device-view="smartphone"] .ct-app-nav{border-top:0;}
#commander-table[data-device-view="smartphone"] .ct-app-nav .ct-nav-contour{display:block;position:absolute;inset:0;width:100%;height:100%;z-index:2;overflow:visible;}
/* Current destination is indicated by its icon, while labels stay white. */
#commander-table .ct-app-nav button,#commander-table .ct-app-nav button[aria-current="page"],#commander-table .ct-app-nav #ct-nav-play{color:#fff;}
#commander-table .ct-app-nav button>svg,#commander-table .ct-app-nav #ct-nav-play>svg{color:#fff;}
#commander-table .ct-app-nav button[aria-current="page"]>svg,#commander-table .ct-app-nav #ct-nav-play[aria-current="page"]>svg{color:var(--ct-gold);}
#commander-table .ct-app-nav{box-shadow:8px 0 22px rgb(0 0 0 / 24%);}
#commander-table .ct-app-nav #ct-nav-play{--ct-play-surface:#435044;}
#commander-table .ct-app-nav #ct-nav-play::after{display:block;inset:auto;left:50%;top:50%;width:92px;height:92px;transform:translate(-50%,-50%);border-radius:50%;background:var(--ct-play-surface);box-shadow:inset 0 1px 0 rgb(255 255 255 / 7%),0 3px 8px rgb(0 0 0 / 16%);}
#commander-table .ct-app-nav #ct-nav-play:hover::after{background:var(--ct-play-surface);}
#commander-table .ct-fanned-cards rect,#commander-table .ct-app-nav #ct-nav-play:hover .ct-fanned-cards rect{fill:var(--ct-play-surface);}
#commander-table[data-device-view="tablet-pc"] .ct-app-nav #ct-nav-play svg{width:56px;height:46px;}
#commander-table[data-device-view="smartphone"] .ct-app-nav{box-shadow:0 -8px 22px rgb(0 0 0 / 24%);}
#commander-table[data-device-view="smartphone"] .ct-app-nav #ct-nav-play::after{width:64px;height:64px;}
#commander-table[data-device-view="smartphone"] .ct-app-nav #ct-nav-play svg{width:42px;height:35px;}
#commander-table[data-device-view="smartphone"]{--ct-menu-bottom-gap:min(6px,env(safe-area-inset-bottom,0px));}
#commander-table[data-device-view="smartphone"] .ct-app-nav{height:calc(76px + var(--ct-menu-bottom-gap));padding:6px 6px 0;justify-content:flex-end;}
#commander-table[data-device-view="smartphone"] .ct-nav-items{height:100%;width:100%;grid-template-rows:68px;align-items:start;padding:0 0 var(--ct-menu-bottom-gap);border-radius:24px 24px 0 0;}
#commander-table[data-device-view="smartphone"] .ct-app-nav button:not(#ct-nav-play){height:68px;display:grid;grid-template-rows:26px 24px;justify-items:center;align-items:center;align-content:center;gap:4px;padding:6px 2px;}
#commander-table[data-device-view="smartphone"] .ct-app-nav button:not(#ct-nav-play)>span{width:100%;text-align:center;align-self:start;line-height:12px;}
#commander-table[data-device-view="tablet-pc"] .ct-nav-items{width:calc(100% - 1px);z-index:3;}
/* Centre the new-game landing page within the space beside the desktop rail. */
#commander-table[data-device-view="tablet-pc"][data-screen="home"]:has(.ct-app-nav) #ct-lobby:has(>.ct-welcome){display:flex;flex-direction:column;min-height:100dvh;padding-block:32px;}
#commander-table[data-device-view="tablet-pc"][data-screen="home"]:has(.ct-app-nav) #ct-lobby>.ct-welcome{flex:none;margin:auto;padding-block:0;}
/* Black page canvas, including the safe area; framed contents keep their panel colour. */
html:has(#commander-table),body:has(#commander-table){background:#000;}
#commander-table:not([data-screen="tracker"]){background:#000;}
#commander-table #ct-lobby,#commander-table .ct-app-nav{background:#000;}
#commander-table[data-device-view="smartphone"] .ct-app-nav{background:transparent;box-shadow:none;}
/* Keep scrolling panels below the black camera/status area. */
body:has(#commander-table[data-device-view="smartphone"] .ct-app-nav){--ct-menu-safe-top:env(safe-area-inset-top,0px);}
body:has(#commander-table[data-device-view="smartphone"]:not([data-screen="tracker"]) .ct-app-nav)::before{content:"";position:fixed;inset:0 0 auto;height:var(--ct-menu-safe-top);background:#000;z-index:100;pointer-events:none;}
#commander-table #ct-lobby :is(.ct-collection-folders,.ct-format-categories>section,.ct-format-group,.ct-setup-player,.ct-setup-rules,.ct-setup-variants,.ct-rule-entry,.ct-missing-card){background:var(--ct-panel);}
#commander-table:has(.ct-app-nav):not([data-screen="tracker"]){background:#000;padding-top:env(safe-area-inset-top,0px);}
#commander-table:has(.ct-app-nav) #ct-lobby :is(h1,h2){text-align:center;}
#commander-table[data-device-view="smartphone"]:has(.ct-app-nav):not([data-screen="tracker"]){padding-bottom:calc(100px + var(--ct-menu-bottom-gap));}
#commander-table[data-device-view="smartphone"]:has(.ct-app-nav) #ct-lobby{padding-top:8px;}
#commander-table[data-device-view="smartphone"]:has(.ct-app-nav) #ct-lobby :is(.ct-profiles-page,.ct-setup,.ct-decks-page,.ct-rules-page){padding-top:0;}
#commander-table[data-device-view="smartphone"] #ct-lobby #ct-open-primary{margin-top:0;}
/* Centre the visible start actions without stretching their fixed-height rows. */
html:has(#commander-table[data-screen="home"] .ct-welcome),body:has(#commander-table[data-screen="home"] .ct-welcome){overflow:hidden;overscroll-behavior:none;}
#commander-table[data-screen="home"]:has(.ct-welcome){box-sizing:border-box;height:100dvh;min-height:0;--ct-start-gap:26px;--ct-start-row:48px;--ct-start-heading:22px;--ct-start-inset:14px;--ct-start-inner-gap:14px;}
#commander-table[data-screen="home"]:has(.ct-app-nav) #ct-lobby:has(>.ct-welcome){display:flex;height:100%;min-height:0;padding-block:clamp(8px,2dvh,20px);}
#commander-table[data-screen="home"]:has(.ct-app-nav) #ct-lobby>.ct-welcome{display:flex;flex:none;width:100%;max-width:840px;min-height:0;height:auto;max-height:none;padding:0;margin:auto;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-start-actions{display:grid;grid-template-rows:auto var(--ct-start-row);grid-auto-rows:66px;flex:none;min-height:0;margin:0;gap:var(--ct-start-gap);}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-resume-session{display:grid;grid-template-rows:44px 18px;gap:4px;text-align:center;}
#commander-table:has(.ct-app-nav) #ct-lobby #ct-resume{width:100%;height:44px;min-height:44px;margin:0;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-session-note{font-size:12px;line-height:18px;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-format-start{flex:none;min-height:0;gap:var(--ct-start-gap);}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-format-start>section{display:grid;grid-template-rows:calc(var(--ct-start-heading) * 1.3) repeat(2,var(--ct-start-row));min-height:0;padding:var(--ct-start-inset);gap:var(--ct-start-inner-gap);border-radius:16px;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-format-start h2{margin:0;font-size:var(--ct-start-heading);line-height:1.3;font-weight:650;text-align:center;color:var(--ct-gold);}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-format-start button{height:var(--ct-start-row);min-height:44px;min-width:0;padding:8px;font-size:16px;justify-content:center;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-format-start button svg{flex:none;width:20px;height:20px;}
#commander-table:has(.ct-app-nav) #ct-lobby #ct-other-formats{flex:none;align-self:stretch;width:100%;max-width:none;height:var(--ct-start-row);min-height:44px;margin:0;padding:6px 12px;font-size:var(--ct-start-heading);line-height:1.3;letter-spacing:-.3px;font-weight:650;border-radius:14px;background:var(--ct-panel);}
@media(max-height:700px){
  #commander-table[data-screen="home"]:has(.ct-welcome){--ct-start-gap:14px;--ct-start-row:44px;--ct-start-heading:20px;--ct-start-inset:4px;--ct-start-inner-gap:6px;}
  #commander-table:has(.ct-app-nav) #ct-lobby .ct-format-start button{gap:5px;font-size:14px;padding:6px;}
}
@media(max-height:600px){
  #commander-table[data-screen="home"]:has(.ct-welcome){--ct-start-gap:10px;}
}
@media(max-height:450px){
  #commander-table[data-screen="home"]:has(.ct-welcome){--ct-start-gap:6px;}
  #commander-table[data-screen="home"]:has(.ct-app-nav) #ct-lobby:has(>.ct-welcome){padding-block:0;}
  #commander-table[data-device-view="smartphone"]:has(.ct-app-nav) #ct-lobby .ct-format-start{grid-template-columns:repeat(2,minmax(0,1fr));}
}
/* Back controls share the title's centre line; SVG avoids font baseline offsets. */
#commander-table:has(.ct-app-nav) #ct-lobby .ct-page-title-row{position:relative;width:fit-content;max-width:calc(100% - 120px);margin:8px auto 28px;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-page-title-row>h1{margin:0;text-align:center;overflow-wrap:anywhere;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-page-title-row>.ct-back{position:absolute;right:calc(100% + 18px);top:50%;transform:translateY(-50%);display:grid;place-items:center;margin:0;padding:0;line-height:0;width:44px;height:44px;min-height:44px;}
/* Format folders offer import on the left and creation on the right. */
#commander-table #ct-lobby .ct-deck-folder-heading{display:grid;grid-template-columns:minmax(0,1fr);align-items:center;gap:32px;margin:8px 0 16px;min-height:44px;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-deck-folder-heading>.ct-page-title-row{grid-column:1;grid-row:1;justify-self:center;width:auto;max-width:calc(100% - 124px);margin:0;}
#commander-table #ct-lobby .ct-deck-folder-actions{display:flex;justify-content:space-between;gap:8px;grid-column:1;grid-row:2;min-width:0;}
#commander-table #ct-lobby .ct-deck-folder-actions>button{min-width:0;min-height:44px;margin:0;white-space:nowrap;}
#commander-table[data-device-view="smartphone"] #ct-lobby .ct-deck-folder-heading{gap:24px;margin-bottom:12px;}
#commander-table[data-device-view="smartphone"] #ct-lobby .ct-deck-folder-actions>button{flex:1;padding:10px 8px;font-size:clamp(12px,3.5vw,14px);}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-back>svg{display:block;width:22px;height:22px;margin:0;flex:none;}
/* Keep the deck edit action at the right edge of the title row. */
#commander-table #ct-lobby .ct-deck-detail-heading{display:grid;grid-template-columns:minmax(140px,1fr) minmax(0,auto) minmax(140px,1fr);align-items:center;gap:16px;margin:8px 0 28px;min-height:44px;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-deck-detail-heading>.ct-page-title-row{grid-column:2;grid-row:1;width:auto;max-width:none;margin:0;}
#commander-table #ct-lobby .ct-deck-detail-heading>#ct-deck-edit{grid-column:3;grid-row:1;justify-self:end;margin:0;min-height:44px;white-space:nowrap;}
@media(max-width:760px){#commander-table #ct-lobby .ct-deck-detail-heading{grid-template-columns:minmax(0,1fr);gap:12px;margin-bottom:16px;}#commander-table:has(.ct-app-nav) #ct-lobby .ct-deck-detail-heading>.ct-page-title-row{grid-column:1;justify-self:center;max-width:calc(100% - 124px);}#commander-table #ct-lobby .ct-deck-detail-heading>#ct-deck-edit{grid-column:1;grid-row:2;}}
/* Detail-page back controls do not use the standard page-title wrapper. */
#commander-table:has(.ct-app-nav) #ct-lobby .ct-back-top-left{position:static;transform:none;display:grid;place-items:center;margin:0 auto 20px 0;padding:0;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-profile-identity h1{word-break:normal;overflow-wrap:break-word;}
/* Compact folder visibility list, with one full-row checkbox target per format. */
dialog.ct-deck-visibility-dialog{width:300px;max-width:calc(100vw - 24px);height:auto;min-height:0;padding:16px;}
dialog.ct-deck-visibility-dialog h2{font-size:18px;margin:0 0 12px;}
dialog.ct-deck-visibility-dialog form{display:grid;gap:0;clear:both;}
dialog.ct-deck-visibility-dialog .ct-deck-visibility-row{min-height:44px;}
dialog.ct-deck-visibility-dialog .ct-deck-visibility{display:flex;flex-direction:row;justify-content:space-between;align-items:center;width:100%;min-height:44px;padding:6px 2px;margin:0;cursor:pointer;}
dialog.ct-deck-visibility-dialog .ct-deck-visibility span{text-align:left;}
dialog.ct-deck-visibility-dialog .ct-deck-visibility input{width:18px;height:18px;min-height:18px;min-width:18px;margin:0;flex:none;accent-color:#edcc7e;}
dialog.ct-deck-visibility-dialog [role=status]:empty{display:none;}
dialog.ct-deck-visibility-dialog button[type=submit]{margin-top:16px;min-height:44px;}
/* Collection title and folder actions share the framed binder header. */
#commander-table:has(.ct-app-nav) #ct-lobby .ct-collection-page-header{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;gap:16px;margin:0 0 28px;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-collection-page-header>h1{grid-column:2;margin:0;text-align:center;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-collection-page-header>.ct-back{grid-column:1;margin:0;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-collection-folders .ct-folder-actions{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:16px;min-height:44px;}
dialog.ct-deck-visibility-dialog{width:340px;height:fit-content;block-size:fit-content;min-height:0;max-height:calc(100dvh - 24px);margin:auto;}
dialog.ct-deck-visibility-dialog h2{padding:0;margin:0 48px 12px 0;min-height:44px;white-space:nowrap;overflow-wrap:normal;font-size:18px;}
dialog.ct-deck-visibility-dialog .ct-card-close{position:absolute;float:none;top:12px;right:12px;margin:0;}
dialog.ct-deck-visibility-dialog .ct-deck-visibility{box-sizing:border-box;height:44px;}
/* Match the shared title/back spacing used by Weitere Formate. */
#commander-table:has(.ct-app-nav) #ct-lobby .ct-collection-page-header{display:block;position:relative;width:fit-content;max-width:calc(100% - 120px);margin:8px auto 28px;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-collection-page-header>h1{margin:0;text-align:center;overflow-wrap:anywhere;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-collection-page-header>.ct-back{position:absolute;right:calc(100% + 18px);left:auto;top:50%;transform:translateY(-50%);margin:0;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-folder-actions>.ct-collection-page-header{grid-column:2;grid-row:1;min-width:0;max-width:100%;margin:0;}
#commander-table #ct-lobby .ct-folder-actions>.ct-folder-action-buttons{grid-column:3;grid-row:1;max-width:100%;}
@media(max-width:1000px){#commander-table:has(.ct-app-nav) #ct-lobby .ct-collection-folders .ct-folder-actions{grid-template-columns:minmax(0,1fr);gap:16px;}#commander-table:has(.ct-app-nav) #ct-lobby .ct-folder-actions>.ct-collection-page-header{grid-column:1;justify-self:center;max-width:calc(100% - 124px);}#commander-table #ct-lobby .ct-folder-actions>.ct-folder-action-buttons{grid-column:1;grid-row:2;flex-wrap:wrap;justify-content:flex-end;}}
/* Folder titles use the same back-arrow spacing as the collection heading. */
#commander-table #ct-lobby .ct-collection-folder-title{position:relative;min-width:0;}
#commander-table #ct-lobby .ct-collection-folder-title>h1{margin:0;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-collection-folder-title>#ct-collection-back{position:absolute;right:calc(100% + 18px);left:auto;top:50%;transform:translateY(-50%);margin:0;}
#commander-table #ct-lobby .ct-collection-overview .ct-sort-pair{display:grid;grid-template-columns:minmax(120px,240px) max-content minmax(100px,160px) 40px;gap:10px;min-width:0;width:620px;max-width:100%;}
#commander-table #ct-lobby .ct-collection-overview .ct-sort-pair>.ct-collection-search{grid-column:1;grid-row:1;position:relative;display:block;width:100%;min-width:0;margin:0;}
#commander-table #ct-lobby .ct-collection-search>svg{position:absolute;left:12px;top:50%;transform:translateY(-50%);width:18px;height:18px;color:var(--ct-muted);pointer-events:none;}
#commander-table #ct-lobby #ct-collection-search{height:44px;padding-left:38px;}
#commander-table #ct-lobby .ct-collection-overview .ct-sort-pair>.ct-view-toggle{grid-column:2;grid-row:1;}
#commander-table #ct-lobby .ct-collection-overview .ct-sort-pair>label:has(#ct-collection-sort){grid-column:3;grid-row:1;min-width:0;width:100%;}
#commander-table #ct-lobby .ct-collection-overview .ct-sort-pair>#ct-sort-reverse{grid-column:4;grid-row:1;}
#commander-table #ct-lobby .ct-folder-detail .ct-folder-value{min-width:0;max-width:100%;overflow-wrap:anywhere;}
/* Leave room for search beside the view switch in the unsorted-card toolbar. */
#commander-table #ct-lobby .ct-collection-overview .ct-collection-tools:has(#ct-deck-card-filter){grid-template-columns:minmax(0,1fr) minmax(150px,190px) max-content max-content;}
@media(max-width:1200px){
#commander-table #ct-lobby .ct-collection-overview .ct-collection-tools:has(#ct-deck-card-filter){grid-template-columns:repeat(2,minmax(0,1fr));}
#commander-table #ct-lobby .ct-collection-overview:not(.ct-folder-detail) .ct-sort-pair{grid-column:1/-1;}
#commander-table #ct-lobby .ct-collection-overview label:has(>#ct-deck-card-filter){grid-column:1;grid-row:3;}
#commander-table #ct-lobby .ct-collection-overview:not(.ct-folder-detail) #ct-add-cards{grid-column:2;grid-row:3;}
#commander-table #ct-lobby .ct-collection-overview:not(.ct-folder-detail) #ct-owned-select{grid-column:2;grid-row:4;}
#commander-table #ct-lobby .ct-collection-overview:not(.ct-folder-detail) .ct-select-all{grid-column:1;grid-row:5;}
#commander-table #ct-lobby .ct-collection-overview:not(.ct-folder-detail) #ct-owned-edit{grid-column:2;grid-row:5;}
#commander-table #ct-lobby .ct-collection-overview:not(.ct-folder-detail) #ct-resume-intake{grid-column:1/-1;grid-row:6;}
}
@media(min-width:1001px){#commander-table #ct-lobby .ct-folder-detail .ct-collection-tools{grid-template-columns:minmax(0,1fr) max-content max-content;}#commander-table #ct-lobby .ct-folder-detail #ct-add-cards,#commander-table #ct-lobby .ct-folder-detail .ct-select-all{grid-column:2;}#commander-table #ct-lobby .ct-folder-detail #ct-owned-select,#commander-table #ct-lobby .ct-folder-detail #ct-owned-edit{grid-column:3;}#commander-table #ct-lobby .ct-folder-detail #ct-resume-intake{grid-column:1;}}
@media(min-width:1001px){#commander-table #ct-lobby .ct-folder-detail .ct-collection-tools:not(:has(#ct-owned-select)){grid-template-columns:minmax(0,1fr) max-content;}}
@media(max-width:700px){#commander-table #ct-lobby .ct-collection-overview .ct-sort-pair{grid-template-columns:minmax(0,1fr) max-content;}#commander-table #ct-lobby .ct-collection-overview .ct-sort-pair>label:has(#ct-collection-sort){grid-column:1;grid-row:2;}#commander-table #ct-lobby .ct-collection-overview .ct-sort-pair>#ct-sort-reverse{grid-column:2;grid-row:2;justify-self:start;}}
@media(max-width:650px){#commander-table #ct-lobby .ct-folder-detail .ct-pool-identity .ct-collection-section-heading{justify-self:center;max-width:calc(100% - 124px);}#commander-table #ct-lobby .ct-folder-detail .ct-collection-tools{grid-template-columns:minmax(0,1fr) minmax(0,1fr);}}
/* A round, translucent yellow accent marks the selected navigation destination. */
/* Collection controls follow the same centred order on phones and larger screens. */
#commander-table:has(.ct-app-nav) #ct-lobby .ct-collection-overview .ct-folder-actions{grid-template-columns:minmax(0,1fr);gap:12px;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-folder-actions>.ct-collection-page-header{grid-column:1;grid-row:1;position:relative;justify-self:stretch;width:100%;max-width:none;min-height:44px;display:grid;grid-template-columns:minmax(0,1fr);place-items:center;padding-inline:52px;gap:0;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-collection-page-header>h1{grid-column:1;font-size:clamp(20px,5.1vw,30px);letter-spacing:-.6px;overflow-wrap:normal;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-folder-actions>.ct-collection-page-header>.ct-back{position:absolute;grid-area:auto;left:0;right:auto;top:50%;transform:translateY(-50%);}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-folder-actions>.ct-folder-action-buttons{grid-column:1;grid-row:2;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;width:min(100%,440px);justify-self:center;}
#commander-table #ct-lobby .ct-folder-action-buttons>button{width:100%;min-width:0;min-height:44px;padding:8px;font-size:14px;line-height:1.25;}
#commander-table #ct-lobby .ct-collection-overview .ct-collection-tools.ct-collection-controls{display:flex;flex-direction:column;align-items:stretch;gap:14px;width:100%;}
#commander-table #ct-lobby .ct-collection-controls>.ct-pool-identity{display:flex;flex-direction:column;align-items:center;gap:6px;margin:0;}
#commander-table #ct-lobby .ct-collection-controls .ct-collection-totals{display:flex;flex-wrap:wrap;justify-content:center;align-items:baseline;gap:4px 8px;width:100%;text-align:center;font-size:13px;}
#commander-table #ct-lobby .ct-collection-totals :is(#ct-visible-card-count,.ct-folder-value){margin:0;font-size:inherit;text-align:center;}
#commander-table #ct-lobby .ct-collection-totals .ct-folder-value:not(:empty)::before{content:'·';margin-right:8px;}
#commander-table #ct-lobby .ct-collection-overview .ct-collection-controls>.ct-sort-pair{display:grid;grid-template-columns:minmax(0,1fr) minmax(100px,140px) 44px;align-items:end;gap:8px;width:100%;max-width:620px;margin-inline:auto;}
#commander-table #ct-lobby .ct-collection-controls>.ct-sort-pair>.ct-collection-search{grid-column:1;grid-row:1;}
#commander-table #ct-lobby .ct-collection-controls>.ct-sort-pair>label:has(#ct-collection-sort){grid-column:2;grid-row:1;font-size:12px;text-align:center;}
#commander-table #ct-lobby .ct-collection-controls>.ct-sort-pair>#ct-sort-reverse{grid-column:3;grid-row:1;width:44px;height:44px;min-height:44px;padding:0;justify-self:stretch;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-collection-controls :is(#ct-collection-sort,#ct-collection-search){height:44px;min-height:44px;width:100%;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-collection-controls #ct-collection-sort{padding:8px;font-size:14px;}
#commander-table #ct-lobby .ct-collection-controls>.ct-collection-display-controls{display:grid;grid-template-columns:minmax(0,1fr) 140px;align-items:end;gap:8px;width:min(100%,440px);align-self:center;}
#commander-table #ct-lobby .ct-collection-controls .ct-collection-display-controls>label:has(#ct-deck-card-filter){display:flex;flex-direction:column;gap:6px;width:100%;min-width:0;margin:0;text-align:center;font-size:14px;grid-column:1;grid-row:1;}
#commander-table #ct-lobby .ct-collection-controls #ct-deck-card-filter{width:100%;min-width:0;max-width:100%;height:44px;min-height:44px;padding:8px;font-size:14px;}
#commander-table #ct-lobby .ct-collection-controls .ct-view-toggle{grid-column:2;grid-row:1;height:44px;min-height:44px;min-width:0;align-self:end;justify-content:center;gap:5px;margin:0;font-size:13px;}
#commander-table #ct-lobby .ct-collection-controls .ct-view-toggle button{width:44px;min-width:44px;max-width:44px;}
#commander-table #ct-lobby .ct-collection-display-controls:has(>.ct-view-toggle:only-child){grid-template-columns:140px;justify-content:center;}
#commander-table #ct-lobby .ct-collection-display-controls>.ct-view-toggle:only-child{grid-column:1;}
#commander-table #ct-lobby .ct-collection-controls>.ct-collection-card-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;width:min(100%,440px);align-self:center;}
#commander-table #ct-lobby .ct-collection-controls .ct-collection-card-actions>:is(#ct-add-cards,#ct-owned-select){grid-column:auto;grid-row:auto;justify-self:stretch;align-self:stretch;width:100%;max-width:none;min-width:0;min-height:44px;margin:0;padding:8px;font-size:14px;line-height:1.25;}
#commander-table #ct-lobby .ct-collection-card-actions>button:only-child{grid-column:1/-1;}
#commander-table #ct-lobby .ct-collection-overview .ct-collection-controls>.ct-selection-tools{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;order:1;}
#commander-table #ct-lobby .ct-collection-controls>.ct-selection-tools:not(:has(>:not([hidden]))){display:none;}
#commander-table #ct-lobby .ct-collection-controls>#ct-resume-intake{align-self:center;order:2;}
#commander-table #ct-lobby .ct-collection-feedback:empty{display:none;}
/* Larger devices keep the collection toolbar in one left-to-right row. */
#commander-table #ct-lobby .ct-collection-filter-separator{display:none;}
#commander-table[data-device-view="smartphone"] #ct-lobby .ct-collection-controls>.ct-collection-filter-separator{display:block;flex:none;width:100%;height:0;margin:0;padding:0;border:0;border-top:1px solid var(--ct-muted);opacity:.55;}
#commander-table[data-device-view="smartphone"] #ct-lobby .ct-collection-controls>.ct-collection-filter-separator+.ct-collection-card-actions{margin-top:14px;}
#commander-table[data-device-view="smartphone"] #ct-lobby .ct-collection-controls .ct-collection-control-caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;}
#commander-table[data-device-view="tablet-pc"] #ct-lobby .ct-collection-overview .ct-collection-tools.ct-collection-controls,
#commander-table[data-device-view="tablet-pc"] #ct-lobby .ct-collection-overview .ct-collection-tools.ct-collection-controls:has(#ct-deck-card-filter){display:grid;grid-template-columns:minmax(0,1fr) max-content max-content;align-items:end;gap:14px 10px;}
#commander-table[data-device-view="tablet-pc"] #ct-lobby .ct-collection-controls>.ct-pool-identity{grid-column:1/-1;grid-row:1;}
#commander-table[data-device-view="tablet-pc"] #ct-lobby .ct-collection-overview .ct-collection-controls>.ct-sort-pair{grid-column:1;grid-row:2;grid-template-columns:minmax(0,1fr) clamp(86px,9vw,140px) 44px;width:100%;max-width:none;margin:0;}
#commander-table[data-device-view="tablet-pc"] #ct-lobby .ct-collection-controls>.ct-collection-display-controls{grid-column:2;grid-row:2;grid-template-columns:190px 140px;width:max-content;align-self:end;}
#commander-table[data-device-view="tablet-pc"] #ct-lobby .ct-collection-controls>.ct-collection-card-actions{grid-column:3;grid-row:2;grid-template-columns:repeat(2,minmax(max-content,1fr));width:max-content;align-self:end;}
#commander-table[data-device-view="tablet-pc"] #ct-lobby .ct-collection-controls .ct-collection-card-actions>:is(#ct-add-cards,#ct-owned-select){white-space:nowrap;}
#commander-table[data-device-view="tablet-pc"] #ct-lobby .ct-collection-controls>.ct-selection-tools{grid-column:1/-1;grid-row:3;}
#commander-table[data-device-view="tablet-pc"] #ct-lobby .ct-collection-controls>#ct-resume-intake{grid-column:1/-1;grid-row:4;justify-self:center;}
@media(max-width:1000px){
  #commander-table[data-device-view="tablet-pc"]:has(.ct-app-nav) #ct-lobby:has(.ct-collection-overview){padding-inline:12px;}
  #commander-table[data-device-view="tablet-pc"] #ct-lobby .ct-collection-overview .ct-collection-tools.ct-collection-controls,
#commander-table[data-device-view="tablet-pc"] #ct-lobby .ct-collection-overview .ct-collection-tools.ct-collection-controls:has(#ct-deck-card-filter){grid-template-columns:minmax(0,1fr) max-content max-content;column-gap:6px;}
  #commander-table[data-device-view="tablet-pc"] #ct-lobby .ct-collection-overview .ct-collection-controls>.ct-sort-pair{grid-template-columns:minmax(0,1fr) 74px 44px;gap:4px;}
  #commander-table[data-device-view="tablet-pc"] #ct-lobby .ct-collection-controls>.ct-collection-display-controls{grid-template-columns:100px 112px;gap:4px;}
  #commander-table[data-device-view="tablet-pc"] #ct-lobby .ct-collection-controls .ct-view-toggle{font-size:11px;gap:3px;}
  #commander-table[data-device-view="tablet-pc"] #ct-lobby .ct-collection-controls .ct-collection-search>svg{display:none;}
  #commander-table[data-device-view="tablet-pc"]:has(.ct-app-nav) #ct-lobby .ct-collection-controls #ct-collection-search{padding-inline:8px;font-size:13px;}
  #commander-table[data-device-view="tablet-pc"] #ct-lobby .ct-collection-controls .ct-collection-card-actions>:is(#ct-add-cards,#ct-owned-select){font-size:12px;padding:6px;}
}
@media(max-width:359px){
  #commander-table:has(.ct-app-nav) #ct-lobby .ct-folder-actions>.ct-collection-page-header{padding:0;}
  #commander-table:has(.ct-app-nav) #ct-lobby .ct-folder-actions>.ct-collection-page-header>.ct-back{position:static;transform:none;justify-self:start;margin-bottom:8px;}
  #commander-table #ct-lobby .ct-collection-overview .ct-collection-controls>.ct-sort-pair{grid-template-columns:minmax(0,1fr) 104px 44px;gap:6px;}
  #commander-table #ct-lobby .ct-collection-search>svg{display:none;}
  #commander-table:has(.ct-app-nav) #ct-lobby .ct-collection-controls #ct-collection-search{padding-left:8px;}
}
#commander-table .ct-app-nav{--ct-nav-highlight:rgb(241 213 107 / 22%);}
#commander-table .ct-app-nav button:not(#ct-nav-play)[aria-current="page"]>svg{border-radius:50%;background:var(--ct-nav-highlight);box-shadow:0 0 0 5px var(--ct-nav-highlight);}
#commander-table .ct-app-nav #ct-nav-play[aria-current="page"]{--ct-play-surface:var(--ct-nav-highlight);--ct-play-card-fill:color-mix(in srgb,#f1d56b 22%,#303d33);}
#commander-table .ct-app-nav #ct-nav-play .ct-fanned-cards rect,#commander-table .ct-app-nav #ct-nav-play:hover .ct-fanned-cards rect{fill:var(--ct-play-card-fill,var(--ct-play-surface));}
#commander-table #ct-lobby .ct-profile-tabs{align-items:center;}
#commander-table #ct-lobby .ct-profile-tabs>#ct-profile-add{order:0;align-self:center;margin:0 0 0 auto;}
#commander-table #ct-lobby .ct-profile-section-tabs{order:3;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0 0 20px;}
#commander-table #ct-lobby .ct-profile-section-tabs button{min-height:48px;padding:12px;}
#commander-table #ct-lobby .ct-profile-section-tabs [aria-selected=true]{border-color:var(--ct-gold);background:color-mix(in srgb,var(--ct-gold) 13%,var(--ct-button));}
#commander-table #ct-lobby .ct-profile-directory-panel{order:4;min-width:0;}
#commander-table #ct-lobby .ct-profile-directory-panel[hidden]{display:none;}
#commander-table #ct-lobby .ct-profile-tabs>#ct-friend-add{align-self:center;margin:0 0 0 auto;}
#commander-table #ct-lobby #ct-friend-search{width:220px;max-width:100%;height:44px;box-sizing:border-box;background:#202723;color:#fff;border:1px solid #657269;padding:10px 12px;border-radius:10px;}
/* Deck connections belong to the main profile, outside the game tableaus. */
#commander-table #ct-lobby .ct-profile-commander-open{position:relative;z-index:1;display:flex;align-items:center;justify-content:flex-start;min-width:0;flex:1;align-self:stretch;border:0;background:transparent;padding:12px 16px;text-align:left;}
#commander-table #ct-lobby .ct-profile-commander-open>span{display:flex;flex-direction:column;gap:6px;padding:5px 9px;border-radius:8px;background:color-mix(in srgb,var(--ct-panel) 82%,transparent);overflow-wrap:anywhere;}
#commander-table #ct-lobby .ct-profile-commander-open small{font-size:13px;color:var(--ct-muted);}
#commander-table #ct-lobby .ct-profile-commander-open{gap:12px;}
#commander-table .ct-profile-commander-chevron{flex:none;margin-left:auto;}
#commander-table [data-profile-commander][aria-expanded=true] .ct-profile-commander-chevron{transform:rotate(180deg);}
#commander-table .ct-profile-commander-decks{padding:12px 16px 20px;border-left:2px solid var(--ct-line);margin:0 12px 12px;}
#commander-table .ct-profile-commander-decks[hidden]{display:none;}
#commander-table .ct-profile-commander-decks>p{margin:4px 0;}
#commander-table .ct-profile-deck-list{display:grid;gap:12px;margin:0;padding:0;list-style:none;}
#commander-table .ct-profile-deck-row{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:76px;padding:12px 16px;box-sizing:border-box;border:1px solid var(--ct-line);border-radius:12px;background:var(--ct-button);text-align:left;}
#commander-table .ct-profile-deck-summary{display:grid;gap:8px;min-width:0;overflow-wrap:anywhere;}
#commander-table #ct-lobby .ct-profile-deck-open{display:grid;place-items:center;flex:none;width:44px;min-height:44px;margin:0;padding:0;}
#commander-table .ct-profile-deck-list small{color:var(--ct-muted);}
#commander-table .ct-profile-deck-list svg{flex:none;}
#commander-table .ct-profile-deck-actions{display:grid;gap:12px;}
#commander-table .ct-profile-deck-actions button{min-height:48px;}
/* Profile identity banner and centred profile editor. */
#commander-table:has(.ct-app-nav) #ct-lobby .ct-profile-heading:has(.ct-profile-identity){display:flex;flex-wrap:nowrap;align-items:center;justify-content:space-between;gap:24px;padding:28px;border:1px solid var(--ct-line);border-radius:20px;background:linear-gradient(110deg,#354537,#202723);margin-bottom:24px;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-profile-heading>#ct-profile-back{position:static;transform:none;margin:0;align-self:center;flex:none;background:var(--ct-button);}
#commander-table .ct-profile-heading>#ct-profile-edit{flex:none;}
#commander-table .ct-profile-heading .ct-profile-identity{min-width:0;flex:1;justify-content:center;}
#commander-table .ct-profile-heading .ct-profile-identity>div{min-width:0;}
#commander-table .ct-profile-identity .ct-avatar,#commander-table .ct-profile-photo-editor .ct-avatar{width:96px;height:96px;flex:none;border-radius:50%;background:#303d33;border:2px solid #657269;overflow:hidden;display:grid;place-items:center;}
#commander-table .ct-avatar .ct-avatar-symbol{display:block;width:90%;height:90%;}
#commander-table .ct-profile-identity .ct-avatar:has(.ct-avatar-symbol),#commander-table .ct-profile-photo-editor .ct-avatar:has(.ct-avatar-symbol){border-color:transparent;}
#commander-table .ct-avatar img{display:block;width:100%;height:100%;object-fit:cover;border-radius:50%;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-profile-form-heading{display:block;width:100%;margin:0 auto;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-profile-form-heading .ct-page-title-row{max-width:calc(100% - 120px);width:max-content;}
#commander-table #ct-profile-form{width:100%;max-width:560px;margin:0 auto;padding:24px;box-sizing:border-box;background:var(--ct-panel);border:1px solid var(--ct-line);border-radius:18px;}
#commander-table .ct-profile-photo-editor{display:flex;align-items:center;gap:20px;margin-bottom:24px;}
#commander-table .ct-profile-photo-editor>div{display:grid;gap:8px;min-width:0;}
#commander-table .ct-photo-upload{display:grid;gap:8px;}
#commander-table #ct-profile-photo{max-width:100%;width:100%;font-size:13px;}
#commander-table #ct-photo-remove[hidden]{display:none;}
#commander-table #ct-profile-form .ct-profile-avatars{margin-top:24px;}
@media(max-width:500px){#commander-table .ct-profile-photo-editor{flex-direction:column;}#commander-table:has(.ct-app-nav) #ct-lobby .ct-profile-heading:has(.ct-profile-identity){padding:16px;gap:12px;}#commander-table .ct-profile-identity .ct-avatar{width:64px;height:64px;}}
/* Creation date is anchored to the lower right of the profile banner. */
#commander-table:has(.ct-app-nav) #ct-lobby .ct-profile-heading:has(.ct-profile-identity){position:relative;padding-bottom:48px;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-profile-heading .ct-profile-identity>div>small{position:absolute;right:24px;bottom:16px;margin:0;text-align:right;}
/* Retain the centred portrait/name group; align the name vertically to its portrait. */
#commander-table:has(.ct-app-nav) #ct-lobby .ct-profile-heading .ct-profile-identity{align-items:center;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-profile-heading .ct-profile-identity h1{margin:0;}
#commander-table[data-device-view="tablet-pc"] .ct-profile-metrics{grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;text-align:center;}
#commander-table[data-device-view="tablet-pc"] .ct-profile-metrics>div{min-width:0;}
#commander-table[data-device-view="tablet-pc"] .ct-profile-metrics span{overflow-wrap:anywhere;}
/* Profile results: one calm surface, two aligned statistical lists. */
#commander-table #ct-lobby .ct-profile-breakdown{background:#202723;border:1px solid #3d4940;border-radius:18px;padding:24px;gap:28px;margin:24px 0 32px;}
#commander-table #ct-lobby .ct-profile-breakdown>section{min-width:0;}
#commander-table #ct-lobby .ct-profile-breakdown>section+section{border-left:1px solid #3d4940;padding-left:28px;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-profile-breakdown h2{font-size:20px;line-height:1.3;color:#fff;text-align:left;margin:0 0 18px;}
#commander-table #ct-lobby .ct-profile-breakdown dl{margin:0;}
#commander-table #ct-lobby .ct-breakdown-row,#commander-table #ct-lobby .ct-breakdown-total{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:10px 0;border-bottom:1px solid #3d4940;font-size:15px;line-height:1.4;}
#commander-table #ct-lobby .ct-breakdown-row dt{color:#edf3ec;}
#commander-table #ct-lobby .ct-breakdown-row dd,#commander-table #ct-lobby .ct-breakdown-total strong{margin:0;color:#f1d56b;font-size:19px;font-weight:600;font-variant-numeric:tabular-nums;}
#commander-table #ct-lobby .ct-breakdown-row:last-child{border-bottom:0;}
#commander-table #ct-lobby .ct-breakdown-total{border-top:1px solid #3d4940;border-bottom:0;margin-top:12px;color:#ccd0c3;}
#commander-table #ct-lobby .ct-breakdown-empty{font-size:14px;margin:0;color:#ccd0c3;}
@media(max-width:600px){#commander-table #ct-lobby .ct-profile-breakdown{grid-template-columns:1fr;padding:20px;gap:24px;}#commander-table #ct-lobby .ct-profile-breakdown>section+section{border-left:0;border-top:1px solid #3d4940;padding:24px 0 0;}}
/* Profile breakdown: highlight headings only; keep the result rows unfilled. */
#commander-table:has(.ct-app-nav) #ct-lobby .ct-profile-breakdown h2{color:#f1d56b;background:#303d33;border:1px solid #3d4940;border-radius:10px;padding:12px 16px;}
#commander-table #ct-lobby .ct-breakdown-row dd,#commander-table #ct-lobby .ct-breakdown-total strong{color:#fff;}
#commander-table #ct-lobby .ct-profile-breakdown{background:transparent;border:0;padding:0;}
/* Centre portrait and name together, preserving banner height and date placement. */
#commander-table:has(.ct-app-nav) #ct-lobby .ct-profile-heading:has(.ct-profile-identity){padding-top:38px;padding-bottom:38px;}
@media(max-width:500px){#commander-table:has(.ct-app-nav) #ct-lobby .ct-profile-heading:has(.ct-profile-identity){padding-top:32px;padding-bottom:32px;}}

/* Collection entry and intake share a single, equally tall row. */
#commander-table #ct-lobby .ct-library-collection-actions{display:grid;grid-template-columns:minmax(0,3fr) minmax(180px,1fr);gap:16px;align-items:stretch;}
#commander-table #ct-lobby .ct-library-collection-actions>#ct-collection,#commander-table #ct-lobby .ct-library-collection-actions>#ct-library-add-cards{width:100%;height:100%;min-height:92px;margin:0;padding:16px;justify-self:stretch;display:flex;align-items:center;justify-content:center;border-radius:12px;font-size:15px;box-sizing:border-box;}
@media(max-width:500px){#commander-table #ct-lobby .ct-library-collection-actions{grid-template-columns:minmax(0,2fr) minmax(110px,1fr);gap:10px;}#commander-table #ct-lobby .ct-library-collection-actions>#ct-collection>span{padding:8px;}}
/* Match the collection area's 3:1 split: folders left, deck actions right. */
#commander-table #ct-lobby .ct-library-decks{display:grid;grid-template-columns:minmax(0,3fr) minmax(180px,1fr);column-gap:16px;row-gap:20px;align-items:start;}
#commander-table #ct-lobby .ct-library-decks>.ct-library-decks-heading{grid-column:1/-1;grid-row:1;}
#commander-table #ct-lobby .ct-library-decks .ct-deck-folders{grid-column:1;grid-row:2;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;}
#commander-table #ct-lobby .ct-library-decks>.ct-deck-add-actions{grid-column:2;grid-row:2;grid-template-columns:minmax(0,1fr);gap:16px;}
#commander-table #ct-lobby .ct-library-decks .ct-deck-add-actions>.ct-library-action,#commander-table #ct-lobby .ct-library-decks .ct-deck-folders>button{min-height:98px;box-sizing:border-box;justify-content:center;border-radius:12px;}
@media(max-width:500px){#commander-table #ct-lobby .ct-library-decks{grid-template-columns:minmax(0,2fr) minmax(110px,1fr);gap:12px;}#commander-table #ct-lobby .ct-library-decks .ct-deck-folders{gap:10px;}#commander-table #ct-lobby .ct-library-decks .ct-deck-folders>button{padding:10px 5px;overflow-wrap:anywhere;}}
/* Deck heading mirrors the collection banner; actions share its 92px height. */
#commander-table #ct-lobby .ct-library-decks{border:0;border-radius:0;padding:0;grid-template-columns:minmax(0,3fr) minmax(180px,1fr);gap:16px;}
#commander-table #ct-lobby .ct-library-decks>.ct-library-decks-heading{display:contents;}
#commander-table #ct-lobby .ct-library-decks-heading>h2{grid-column:1;grid-row:1;display:flex;align-items:center;justify-content:center;box-sizing:border-box;height:92px;margin:0;padding:16px;background:var(--ct-button);border:1px solid var(--ct-line);border-radius:12px;}
#commander-table #ct-lobby .ct-library-decks>.ct-deck-add-actions{grid-column:2;grid-row:1;grid-template-rows:repeat(2,minmax(0,1fr));height:92px;gap:8px;}
#commander-table #ct-lobby .ct-library-decks .ct-deck-add-actions>.ct-library-action{min-height:0;height:42px;padding:8px 12px;}
#commander-table #ct-lobby .ct-library-decks-heading>#ct-deck-folder-settings{grid-column:2;grid-row:2;justify-self:end;margin:0;}
#commander-table #ct-lobby .ct-library-decks .ct-deck-folders{grid-column:1;grid-row:2;}
@media(max-width:500px){#commander-table #ct-lobby .ct-library-decks{grid-template-columns:minmax(0,2fr) minmax(110px,1fr);}}
/* Folder visibility lives inside the right side of the Decks banner. */
#commander-table #ct-lobby .ct-library-decks>.ct-library-decks-heading{display:grid;grid-column:1;grid-row:1;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:12px;height:92px;box-sizing:border-box;padding:12px 16px;background:var(--ct-button);border:1px solid var(--ct-line);border-radius:12px;}
#commander-table #ct-lobby .ct-library-decks-heading>h2{grid-column:2;grid-row:1;height:auto;min-height:0;padding:0;border:0;background:transparent;}
#commander-table #ct-lobby .ct-library-decks-heading>#ct-deck-folder-settings{grid-column:3;grid-row:1;justify-self:end;margin:0;font-size:13px;padding:8px 10px;background:#202723;}
/* Illustrated deckboxes echo the schematic cards in the collection banner. */
#commander-table #ct-lobby .ct-library-decks>.ct-library-decks-heading{background:linear-gradient(#0001,#0003),url('../assets/collection/deckboxes-illustration.svg') center 48%/cover;border-color:#879589;}
#commander-table #ct-lobby .ct-library-decks-heading>h2{background:#14231de0;color:#fff;padding:12px 24px;border-radius:9px;}
#commander-table #ct-lobby .ct-library-decks-heading>#ct-deck-folder-settings{background:#202723ed;}
#commander-table #ct-lobby #ct-collection.ct-collection-banner>span{font-size:22px;line-height:1.3;letter-spacing:-.3px;color:#f1d56b;}
#commander-table #ct-lobby .ct-library-decks-heading>h2{color:#f1d56b;}
/* Match the main-user card's fine yellow frame on both library banners. */
#commander-table #ct-lobby #ct-collection.ct-collection-banner,#commander-table #ct-lobby .ct-library-decks>.ct-library-decks-heading{border:1px solid var(--ct-gold);border-radius:14px;}
#commander-table #ct-lobby #ct-collection.ct-collection-banner>span,#commander-table #ct-lobby .ct-library-decks-heading>h2{color:#fff;}
/* Direct profile search in the overview and game setup picker. */
#commander-table #ct-lobby #ct-profile-search{width:220px;max-width:100%;height:44px;box-sizing:border-box;background:#202723;color:#fff;border:1px solid #657269;padding:10px 12px;border-radius:10px;}
#commander-table #ct-lobby .ct-profile-directory-tools{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:stretch;gap:8px;width:100%;}
#commander-table #ct-lobby .ct-profile-directory-tools>:is(#ct-profile-search,#ct-friend-search){width:100%;min-width:0;height:100%;min-height:48px;margin:0;}
#commander-table #ct-lobby .ct-profile-directory-tools>:is(#ct-profile-add,#ct-friend-add){align-self:stretch;min-width:0;max-width:min(180px,44vw);min-height:48px;margin:0;padding:8px 10px;gap:6px;font-size:14px;line-height:1.25;}
#commander-table .ct-profile-directory-tools button svg{flex:none;width:18px;height:18px;}
#commander-table .ct-profile-directory-footer{margin-top:24px;padding-top:16px;border-top:1px solid var(--ct-line);}
#commander-table #ct-lobby #ct-archived-profiles{display:flex;width:100%;min-height:48px;justify-content:center;gap:10px;}
#commander-table #ct-lobby #ct-profile-archive-search{width:100%;min-width:0;min-height:48px;background:var(--ct-panel);color:var(--ct-ink);border:1px solid #657269;border-radius:10px;padding:10px 12px;}
#commander-table #ct-picker-profile-search{display:block;width:100%;box-sizing:border-box;min-height:44px;margin:0 0 12px;padding:10px 12px;border-radius:10px;border:1px solid #657269;background:#202723;color:#fff;font:inherit;}
#commander-table :is([data-profile-open],[data-pick-profile],.ct-profile-search-empty)[hidden]{display:none!important;}
#commander-table .ct-profile-search-empty{grid-column:1/-1;color:#ccd0c3;text-align:center;padding:12px;}
#commander-table #ct-open-primary{position:relative;isolation:isolate;overflow:hidden;}

/* Upright crowns scattered across the full main-user banner. */
#commander-table #ct-lobby #ct-open-primary{background-color:var(--ct-button);background-image:url('../assets/collection/crowns-illustration.svg');background-position:center;background-size:cover;}
#commander-table #ct-lobby #ct-open-primary{min-height:136px;align-items:center;justify-content:center;text-align:center;gap:10px;padding:24px 64px;}
#commander-table #ct-open-primary>.ct-eyebrow{font-size:15px;line-height:1.3;letter-spacing:1.8px;}
#commander-table #ct-open-primary .ct-primary-name{position:relative;display:block;max-width:100%;}
#commander-table #ct-open-primary .ct-primary-name>strong,#commander-table #ct-lobby .ct-profile-entry-name>strong{font-size:30px;line-height:1.25;overflow-wrap:anywhere;}
#commander-table #ct-open-primary .ct-primary-chevron{position:absolute;left:calc(100% + 18px);top:50%;transform:translateY(-50%);width:30px;height:30px;color:#fff;}
#commander-table #ct-lobby #ct-collection.ct-collection-banner>span{display:inline-flex;align-items:center;justify-content:center;gap:18px;}
#commander-table #ct-lobby #ct-collection .ct-collection-chevron{display:block;width:30px;height:30px;flex:none;color:inherit;}
/* Open storage boxes replace the format-folder tiles. */
#commander-table #ct-lobby .ct-library-decks .ct-deck-folders>.ct-storage-folder{background:transparent;border:1px solid transparent;box-shadow:none;padding:4px 8px 12px;gap:0;min-height:0;align-items:center;}
#commander-table #ct-lobby .ct-library-decks .ct-deck-folders>.ct-storage-folder:hover{background:#303d333d;border-color:#657269;}
#commander-table .ct-storage-box{position:relative;display:block;width:100%;max-width:360px;}
#commander-table .ct-storage-box-art{display:block;width:100%;height:auto;}
#commander-table .ct-storage-box-count{font-size:14px;line-height:1.4;color:#edf3ec;font-variant-numeric:tabular-nums;}
/* Keep the entire library inside the same width as the two-column folder area. */
#commander-table:has(.ct-app-nav) #ct-lobby .ct-decks-page:has(>.ct-library-collection-actions){width:100%;max-width:840px;margin-left:auto;margin-right:auto;}
#commander-table #ct-lobby .ct-library-decks .ct-deck-folders{grid-column:1/-1;}
/* Full-width illustrated banners include the transparent action buttons. */
#commander-table #ct-lobby .ct-library-collection-actions{height:92px;box-sizing:border-box;border:1px solid var(--ct-gold);border-radius:14px;background:linear-gradient(#0001,#0003),url('../assets/collection/cards-illustration.svg') center 48%/cover;overflow:hidden;}
#commander-table #ct-lobby .ct-library-collection-actions>#ct-collection{background:transparent;border:0;border-radius:0;min-height:0;}
#commander-table #ct-lobby .ct-library-collection-actions>#ct-library-add-cards{background:transparent;border:0;border-left:1px solid #edcc7e66;border-radius:0;min-height:0;color:#fff;text-shadow:0 1px 3px #000;}
#commander-table #ct-lobby .ct-library-decks{isolation:isolate;}
#commander-table #ct-lobby .ct-library-decks::before{content:"";grid-column:1/-1;grid-row:1;align-self:stretch;min-height:92px;box-sizing:border-box;border:1px solid var(--ct-gold);border-radius:14px;background:linear-gradient(#0001,#0003),url('../assets/collection/deckboxes-illustration.svg') center 48%/cover;z-index:-1;}
#commander-table #ct-lobby .ct-library-decks>.ct-library-decks-heading{background:transparent;border:0;}
#commander-table #ct-lobby .ct-library-decks>.ct-deck-add-actions{gap:0;border-left:1px solid #edcc7e66;}
#commander-table #ct-lobby .ct-library-decks .ct-deck-add-actions>.ct-library-action{height:46px;background:transparent;border:0;border-radius:0;color:#fff;text-shadow:0 1px 3px #000;}
#commander-table #ct-lobby .ct-library-decks .ct-deck-add-actions>.ct-library-action+button{border-top:1px solid #edcc7e66;}
#commander-table #ct-lobby .ct-library-decks .ct-deck-add-actions>.ct-library-action:disabled{opacity:.5;}
/* Match the translucent dark backing used by the banner titles. */
#commander-table #ct-lobby .ct-library-collection-actions>#ct-library-add-cards,#commander-table #ct-lobby .ct-library-decks .ct-deck-add-actions>.ct-library-action{background:#14231de0;text-shadow:none;}
/* Place folder visibility below the banner, aligned with the deck list. */
#commander-table #ct-lobby .ct-library-decks>.ct-library-decks-heading{display:contents;}
#commander-table #ct-lobby .ct-library-decks-heading>h2{grid-column:1;grid-row:1;align-self:center;justify-self:center;margin:0;}
#commander-table #ct-lobby .ct-library-decks-heading>#ct-deck-folder-settings{grid-column:1/-1;grid-row:2;justify-self:start;margin:0;min-height:44px;padding:10px 14px;background:var(--ct-button);}
#commander-table #ct-lobby .ct-library-decks .ct-deck-folders{grid-row:3;}
/* Distinct inset controls stay readable over the continuous artwork. */
#commander-table #ct-lobby .ct-library-collection-actions>#ct-library-add-cards{align-self:center;justify-self:stretch;width:auto;height:68px;min-height:0;margin:0 10px 0 0;border:1px solid #95a28a;border-radius:10px;box-shadow:0 2px 5px #0003;}
#commander-table #ct-lobby .ct-library-decks>.ct-deck-add-actions{height:92px;box-sizing:border-box;padding:5px 10px 5px 0;gap:6px;border:0;}
#commander-table #ct-lobby .ct-library-decks .ct-deck-add-actions>.ct-library-action{height:38px;min-height:0;padding:4px 6px;font-size:13px;line-height:1.15;border:1px solid #95a28a;border-radius:9px;box-shadow:0 2px 5px #0003;}
#commander-table #ct-lobby .ct-library-decks .ct-deck-add-actions>.ct-library-action+button{border:1px solid #95a28a;}
@media(max-width:500px){
  #commander-table #ct-lobby .ct-library-collection-actions>#ct-collection{padding:8px;}
  #commander-table #ct-lobby #ct-collection.ct-collection-banner>span{font-size:clamp(16px,5vw,22px);gap:6px;padding:6px;}
  #commander-table #ct-lobby #ct-collection .ct-collection-chevron{width:20px;height:20px;flex:none;}
}
#commander-table #ct-lobby .ct-library-collection-actions>#ct-library-add-cards:hover,#commander-table #ct-lobby .ct-library-decks .ct-deck-add-actions>.ct-library-action:hover{background:#35463ced;border-color:var(--ct-gold);}

/* Centre the two library banners; the same transition lifts them and opens the folders. */
#commander-table:has(.ct-decks-page>.ct-library-collection-actions){box-sizing:border-box;}
#commander-table:has(.ct-app-nav) #ct-lobby:has(.ct-decks-page>.ct-library-collection-actions){--ct-library-viewport:calc(100dvh - env(safe-area-inset-top,0px));min-height:0;padding-block:0;overflow-anchor:none;}
#commander-table[data-device-view="smartphone"]:has(.ct-app-nav) #ct-lobby:has(.ct-decks-page>.ct-library-collection-actions){--ct-library-viewport:calc(100dvh - env(safe-area-inset-top,0px) - 100px - var(--ct-menu-bottom-gap));}
#commander-table #ct-lobby>.ct-profiles-page:has(>.ct-decks-page>.ct-library-collection-actions){padding-block:0;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-decks-page:has(>.ct-library-collection-actions){--ct-library-duration:380ms;--ct-library-easing:cubic-bezier(.22,.61,.36,1);--ct-library-banner-size:92px;--ct-library-banner-gap:48px;min-height:var(--ct-library-viewport);padding:max(8px,calc((var(--ct-library-viewport) - var(--ct-library-banner-size) * 2 - var(--ct-library-banner-gap)) / 2)) 0 8px;transition:padding-top var(--ct-library-duration) var(--ct-library-easing);}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-decks-page:has(>.ct-library-decks[data-deck-boxes-expanded=true]){padding-top:16px;}
#commander-table #ct-lobby .ct-decks-page:has(>.ct-library-collection-actions)>.ct-library-divider{height:0;padding:0;border:0;margin-block:calc(var(--ct-library-banner-gap) / 2);}
#commander-table #ct-lobby .ct-library-collection-actions,#commander-table #ct-lobby .ct-library-decks>.ct-deck-add-actions{height:var(--ct-library-banner-size,92px);}
#commander-table #ct-lobby .ct-library-decks::before{min-height:var(--ct-library-banner-size,92px);}
#commander-table #ct-lobby .ct-library-decks{row-gap:0;}
#commander-table #ct-lobby .ct-library-decks-heading>h2{width:100%;height:var(--ct-library-banner-size,92px);padding:0;align-self:stretch;justify-self:stretch;background:transparent;border-radius:14px 0 0 14px;}
#commander-table #ct-lobby #ct-toggle-deck-folders{display:flex;align-items:center;justify-content:center;width:100%;height:100%;margin:0;padding:12px;border:0;background:transparent;border-radius:inherit;color:#fff;}
#commander-table #ct-lobby #ct-toggle-deck-folders>span{display:inline-flex;align-items:center;justify-content:center;gap:18px;background:#14231de0;border-radius:9px;padding:12px 24px;font-size:22px;line-height:1.3;letter-spacing:-.3px;font-weight:700;}
#commander-table #ct-lobby #ct-toggle-deck-folders:hover>span{background:#35463ced;}
#commander-table #ct-lobby #ct-toggle-deck-folders:focus-visible{outline:2px solid var(--ct-gold);outline-offset:-5px;}
#commander-table .ct-deck-folders-chevron{display:block;width:30px;height:30px;flex:none;transform:rotate(0deg);transition:transform var(--ct-library-duration,380ms) var(--ct-library-easing,cubic-bezier(.22,.61,.36,1));}
#commander-table #ct-lobby .ct-deck-folder-panel{grid-column:1/-1;grid-row:2;display:grid;grid-template-rows:0fr;min-width:0;transition:grid-template-rows var(--ct-library-duration,380ms) var(--ct-library-easing,cubic-bezier(.22,.61,.36,1));}
#commander-table .ct-deck-folder-panel-inner{min-height:0;overflow:hidden;}
#commander-table .ct-deck-folder-content{padding-top:16px;text-align:left;opacity:0;transform:translateY(-24px);transition:transform var(--ct-library-duration,380ms) var(--ct-library-easing,cubic-bezier(.22,.61,.36,1)),opacity var(--ct-library-duration,380ms) var(--ct-library-easing,cubic-bezier(.22,.61,.36,1));}
#commander-table #ct-lobby .ct-deck-folder-content>#ct-deck-folder-settings{margin:0;min-height:44px;padding:10px 14px;background:var(--ct-button);}
#commander-table #ct-lobby .ct-deck-folder-content>.ct-deck-folders{margin:16px 0 0;grid-template-columns:repeat(2,minmax(0,1fr));}
#commander-table .ct-library-decks[data-deck-boxes-expanded=true] .ct-deck-folders-chevron{transform:rotate(90deg);}
#commander-table #ct-lobby .ct-library-decks[data-deck-boxes-expanded=true]>.ct-deck-folder-panel{grid-template-rows:1fr;}
#commander-table .ct-library-decks[data-deck-boxes-expanded=true] .ct-deck-folder-content{opacity:1;transform:translateY(0);}
@media(max-width:500px){#commander-table #ct-lobby #ct-toggle-deck-folders{padding:8px;}#commander-table #ct-lobby #ct-toggle-deck-folders>span{padding:10px;gap:10px;}#commander-table .ct-deck-folders-chevron{width:24px;height:24px;}}
@media(prefers-reduced-motion:reduce){#commander-table:has(.ct-app-nav) #ct-lobby .ct-decks-page:has(>.ct-library-collection-actions),#commander-table .ct-deck-folders-chevron,#commander-table #ct-lobby .ct-deck-folder-panel,#commander-table .ct-deck-folder-content{transition:none;}}

/* Card search reuses the application palette, controls and card renderer. */
#commander-table .ct-type-picker {position:relative;min-width:0;}
#commander-table .ct-type-picker>label {margin-bottom:6px!important;}
#commander-table .ct-type-input {position:relative;}
#commander-table #ct-lobby .ct-card-search .ct-type-input>input {padding-right:44px;}
#commander-table #ct-lobby #ct-types-toggle {position:absolute;right:1px;top:1px;width:42px;min-height:42px;height:42px;padding:8px;border:0;background:transparent;display:grid;place-items:center;}
#commander-table #ct-types-toggle svg {width:22px;height:22px;}
#commander-table #ct-types-toggle[aria-expanded=true] svg {transform:rotate(180deg);}
#commander-table .ct-type-popup {position:absolute;z-index:30;top:100%;right:0;box-sizing:border-box;width:max(100%,320px);max-width:calc(100vw - 32px);margin-top:6px;padding:8px;border:1px solid var(--ct-muted);border-radius:12px;background:var(--ct-panel);box-shadow:0 8px 22px #0006;}
#commander-table #ct-search-types {max-height:320px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;}
#commander-table .ct-type-popup>small {display:block;padding:4px 8px;color:var(--ct-muted);font-size:12px;line-height:1.4;}
#commander-table .ct-type-group-label {display:flex;justify-content:space-between;gap:8px;padding:10px 8px 6px;color:var(--ct-gold);font-size:13px;font-weight:650;}
#commander-table #ct-lobby #ct-search-types [role=option] {display:block;width:100%;min-height:44px;margin:0;padding:10px 12px;border:0;border-radius:7px;background:transparent;text-align:left;font-size:14px;}
#commander-table #ct-lobby #ct-search-types [role=option]:is(:hover,[aria-selected=true]) {background:var(--ct-button);outline:1px solid var(--ct-gold);outline-offset:-1px;}
#commander-table #ct-lobby .ct-card-search {text-align:left;min-width:0;}
#commander-table #ct-lobby .ct-card-search label {display:flex;flex-direction:column;gap:6px;min-width:0;margin:0;font-size:14px;text-align:left;}
#commander-table #ct-lobby .ct-card-search :is(input,select) {box-sizing:border-box;min-width:0;width:100%;min-height:44px;margin:0;padding:10px 12px;border:1px solid var(--ct-muted);border-radius:10px;background:var(--ct-panel);color:var(--ct-ink);font:inherit;}
#commander-table #ct-lobby .ct-card-search button:where(:not([role=switch])) {min-height:44px;}
#commander-table #ct-lobby .ct-card-search :is(fieldset,legend) {min-width:0;margin:0;padding:0;border:0;font-size:14px;text-align:left;}
#commander-table #ct-lobby .ct-card-search legend {margin-bottom:6px;font-weight:600;}
#commander-table .ct-search-context {text-align:center;color:var(--ct-muted);margin:0 0 20px;}
#commander-table .ct-search-name {display:flex;align-items:end;gap:12px;}
#commander-table .ct-search-name>label {flex:1;}
#commander-table .ct-search-name>button {display:flex;align-items:center;gap:8px;flex-shrink:0;white-space:nowrap;}
#commander-table .ct-search-name svg {width:18px;height:18px;}
#commander-table .ct-search-chips {display:flex;flex-wrap:wrap;gap:8px;margin:12px 0;}
#commander-table #ct-lobby .ct-search-chips>button,#commander-table #ct-lobby .ct-search-type-chips>button {padding:6px 12px;border-color:var(--ct-gold);background:color-mix(in srgb,var(--ct-gold) 12%,var(--ct-panel));font-size:13px;max-width:100%;overflow-wrap:anywhere;}
#commander-table .ct-search-type-chips {display:flex;flex-wrap:wrap;align-items:center;gap:8px;max-width:100%;font-size:14px;}
#commander-table #ct-lobby .ct-search-chips>[data-reset] {background:transparent;border-color:var(--ct-line);}
#commander-table .ct-search-quick {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:24px 0 20px;padding-top:24px;border-top:1px solid var(--ct-line);align-items:start;}
#commander-table .ct-search-color-settings {display:grid;grid-template-columns:minmax(0,1fr) 132px minmax(0,1fr);gap:8px;align-items:center;}
#commander-table .ct-search-color-settings>select {height:46px;}
#commander-table .ct-search-color-buttons {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:4px;height:46px;}
#commander-table #ct-lobby .ct-search-color-buttons>button {display:grid;place-items:center;min-height:0;height:100%;padding:0 6px;border-radius:6px;font-size:12px;line-height:1;}
#commander-table .ct-search-mana-symbol {display:inline-block;flex:none;width:18px;height:18px;vertical-align:middle;}
#commander-table .ct-search-commander-colors {width:264px;max-width:100%;}
#commander-table #ct-lobby .ct-card-search .ct-search-commander-colors>legend {width:132px;margin-left:calc(100% - 132px);}
#commander-table .ct-search-commander-row {display:grid;grid-template-columns:minmax(0,1fr) 132px;align-items:center;gap:12px;}
#commander-table .ct-search-commander-row>.ct-search-color-buttons {grid-column:2;grid-row:1;justify-self:start;width:132px;}
#commander-table #ct-lobby .ct-search-commander-row>.ct-search-help {margin:0;font-size:12px;line-height:18px;}
#commander-table .ct-search-chips [data-chip]:has(.ct-search-mana-symbol) {display:inline-flex;align-items:center;flex-wrap:wrap;gap:6px;}
#commander-table #ct-lobby .ct-search-color-buttons>[aria-pressed=true] {border-color:var(--ct-gold);background:var(--ct-gold);color:var(--ct-panel);}
#commander-table .ct-search-number {display:grid;grid-template-columns:minmax(74px,1fr) minmax(58px,1fr);gap:8px;align-items:end;min-width:0;}
#commander-table .ct-search-number:has(input:not([hidden])[data-field$=".max"]) {grid-template-columns:minmax(76px,1fr) minmax(48px,1fr) minmax(48px,1fr);}
#commander-table .ct-search-advanced {display:grid;grid-template-columns:repeat(6,minmax(0,1fr));align-items:start;gap:8px;margin-bottom:24px;}
#commander-table #ct-lobby .ct-search-filter-tab {display:flex;align-items:center;justify-content:flex-start;gap:7px;box-sizing:border-box;min-width:0;min-height:46px;padding:10px;background:var(--ct-button);border:1px solid var(--ct-line);border-radius:10px;font-size:13px;text-align:left;}
#commander-table #ct-lobby .ct-search-filter-tab[aria-expanded=true] {border-color:var(--ct-gold);background:color-mix(in srgb,var(--ct-gold) 12%,var(--ct-panel));}
#commander-table .ct-search-filter-tab>svg {display:block;flex:none;width:14px;height:14px;transform:rotate(0deg);transition:transform .18s ease;}
#commander-table .ct-search-filter-tab[aria-expanded=true]>svg {transform:rotate(90deg);}
#commander-table .ct-search-filter-tab:focus-visible {outline:2px solid var(--ct-gold);outline-offset:2px;}
#commander-table .ct-search-filter-panel {grid-column:1 / -1;order:1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:24px;box-sizing:border-box;min-width:0;padding:20px;border:1px solid var(--ct-line);border-radius:12px;background:var(--ct-panel);overflow-wrap:anywhere;}
#commander-table .ct-search-filter-panel.ct-search-values {grid-template-columns:minmax(0,1fr) 1px minmax(0,1fr) 1px minmax(0,1fr) 1px minmax(0,1fr);column-gap:16px;}
#commander-table #ct-lobby .ct-card-search .ct-search-values label {text-align:center;}
#commander-table #ct-lobby .ct-card-search .ct-search-values :is(input,select) {text-align:left;}
#commander-table .ct-search-filter-panel.ct-search-extra {grid-template-columns:minmax(0,1fr) 1px minmax(0,1fr) 1px minmax(0,1fr);column-gap:16px;}
#commander-table .ct-search-filter-stack {display:grid;gap:20px;min-width:0;}
#commander-table #ct-search-artist-status:empty {display:none;}
#commander-table .ct-search-filter-panel:is([data-filter-panel=colors],[data-filter-panel=text],[data-filter-panel=sets],[data-filter-panel=print]) {grid-template-columns:minmax(0,1fr) 1px minmax(0,1fr);column-gap:16px;}
#commander-table .ct-condition-divider {align-self:stretch;min-height:1px;background:var(--ct-line);}
#commander-table .ct-search-filter-panel fieldset>select {margin-bottom:12px;}
#commander-table .ct-search-filter-panel .ct-search-number,#commander-table .ct-search-filter-panel .ct-search-number:has(input:not([hidden])[data-field$=".max"]) {grid-template-columns:repeat(2,minmax(0,1fr));}
#commander-table .ct-search-filter-panel .ct-search-number>label:last-child {grid-column:1 / -1;}
#commander-table .ct-search-condition-group {--ct-condition-remove-size:28px;--ct-condition-gap:6px;--ct-condition-symbol-size:clamp(112px,30vw,148px);}
#commander-table .ct-condition-settings {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:end;}
#commander-table [data-condition-field=oracleText]>.ct-condition-settings {grid-template-columns:minmax(0,1fr);}
#commander-table .ct-condition-comparison>label {grid-column:2;}
#commander-table #ct-lobby .ct-card-search .ct-search-condition-group :is(label,input,select) {font-size:13px;}
#commander-table #ct-lobby .ct-card-search .ct-search-advanced .ct-search-filter-panel .ct-search-condition-group :is(input,select) {height:44px;padding:10px 8px;font-size:13px;}
#commander-table .ct-search-condition {display:grid;grid-template-columns:minmax(0,1fr) var(--ct-condition-symbol-size) var(--ct-condition-remove-size);align-items:end;gap:var(--ct-condition-gap);margin:12px 0;}
#commander-table .ct-search-condition>label {grid-column:1;grid-row:1;}
#commander-table .ct-search-condition>[data-remove-condition] {grid-column:3;grid-row:1;}
#commander-table #ct-lobby .ct-search-condition>button {box-sizing:border-box;width:var(--ct-condition-remove-size);height:28px;min-height:28px;margin-bottom:8px;padding:0;border-radius:7px;font-size:16px;line-height:1;}
#commander-table #ct-lobby .ct-search-condition-group>[data-add-condition] {box-sizing:border-box;width:calc(100% - var(--ct-condition-symbol-size) - var(--ct-condition-remove-size) - 2 * var(--ct-condition-gap));height:44px;min-height:44px;padding:8px 6px;font-size:13px;}
#commander-table .ct-symbol-picker,#commander-table .ct-search-symbol-preview {grid-column:1 / -1;min-width:0;}
#commander-table .ct-search-symbol-preview {display:flex;flex-wrap:wrap;gap:5px;align-items:center;}
#commander-table .ct-search-symbol-glyph {position:relative;display:inline-grid;place-items:center;flex:none;width:24px;height:24px;border-radius:50%;background:#d5d2c5;color:#202723;font-size:9px;line-height:1;vertical-align:middle;}
#commander-table .ct-search-symbol-glyph img {position:absolute;inset:0;width:24px;height:24px;object-fit:contain;}
#commander-table #ct-lobby .ct-symbol-picker>[data-symbol-toggle] {display:flex;align-items:center;justify-content:space-between;gap:4px;box-sizing:border-box;width:calc(100% - var(--ct-condition-remove-size) - var(--ct-condition-gap));min-height:34px;padding:6px 8px;background:transparent;font-size:12px;text-align:left;}
#commander-table .ct-search-condition>.ct-symbol-picker {display:contents;}
#commander-table #ct-lobby .ct-search-condition>.ct-symbol-picker>[data-symbol-toggle] {grid-column:2;grid-row:1;width:100%;height:44px;min-height:44px;line-height:1.2;white-space:normal;}
#commander-table .ct-search-condition>.ct-symbol-picker>.ct-symbol-panel {grid-column:1 / -1;}
#commander-table .ct-symbol-picker>[aria-expanded=true] {border-color:var(--ct-gold);}
#commander-table .ct-symbol-panel {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;box-sizing:border-box;margin-top:8px;padding:12px;border:1px solid var(--ct-muted);border-radius:10px;background:var(--ct-panel);}
#commander-table .ct-symbol-panel>:not(label) {grid-column:1 / -1;}
#commander-table .ct-symbol-panel .ct-symbol-count {margin:0;font-size:12px;color:var(--ct-muted);}
#commander-table .ct-symbol-options {max-height:280px;min-width:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;}
#commander-table .ct-symbol-options>div {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,150px),1fr));gap:4px;}
#commander-table .ct-symbol-options .ct-symbol-heading {grid-column:1 / -1;}
#commander-table .ct-symbol-heading {padding:8px 2px 5px;font-size:12px;font-weight:650;color:var(--ct-gold);}
#commander-table #ct-lobby .ct-symbol-options [data-insert-symbol] {display:grid;grid-template-columns:24px minmax(0,1fr);align-items:center;gap:8px;box-sizing:border-box;width:100%;min-height:44px;margin:0;padding:8px 4px;background:transparent;border:0;border-radius:6px;text-align:left;font-size:12px;line-height:1.35;}
#commander-table #ct-lobby .ct-symbol-options [data-insert-symbol]:is(:hover,:focus-visible) {background:var(--ct-button);outline:1px solid var(--ct-gold);outline-offset:-1px;}
#commander-table .ct-symbol-options small {display:block;margin-top:3px;color:var(--ct-muted);font-size:11px;}
#commander-table .ct-symbol-panel .ct-search-help {margin:0;line-height:1.5;}
#commander-table #ct-lobby .ct-symbol-panel>[data-symbol-done] {width:100%;padding:8px;font-size:13px;}
#commander-table .ct-search-choices {display:flex;gap:8px;flex-wrap:wrap;}
#commander-table #ct-lobby .ct-search-choices>label {position:relative;display:flex;flex-direction:row;align-items:center;gap:8px;padding:8px 12px;min-height:44px;box-sizing:border-box;border:1px solid var(--ct-line);border-radius:10px;background:var(--ct-button);cursor:pointer;}
#commander-table #ct-lobby .ct-search-choices input {width:16px;min-height:16px;height:16px;accent-color:var(--ct-gold);}
#commander-table .ct-search-choices>label:has(:checked) {border-color:var(--ct-gold);}
#commander-table .ct-search-filter-panel .ct-search-choices {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,140px),1fr));}
#commander-table .ct-search-filter-panel[data-filter-panel=sets] .ct-search-choices {grid-template-columns:minmax(0,1fr);}
#commander-table .ct-search-set-entry {display:grid;grid-template-columns:minmax(0,1fr);gap:8px;}
#commander-table #ct-search-selected-sets {display:flex;flex-wrap:wrap;gap:8px;}
#commander-table #ct-search-selected-sets>button {max-width:100%;overflow-wrap:anywhere;}
#commander-table .ct-search-help {font-size:12px;color:var(--ct-muted);}
#commander-table .ct-search-price {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:8px;}
#commander-table #ct-lobby [data-filter-panel=print] .ct-search-choices>label {min-height:46px;}
@media(min-width:761px){#commander-table [data-filter-panel=print] .ct-search-choices{padding-top:calc(1lh + 6px);}}
#commander-table .ct-search-result-tools {display:flex;align-items:center;flex-wrap:wrap;gap:12px;border-top:1px solid var(--ct-line);padding-top:20px;}
#commander-table #ct-lobby .ct-search-result-tools h2 {flex:1 1 auto;text-align:left;margin:0;scroll-margin-top:24px;}
#commander-table #ct-lobby .ct-search-result-tools>label {flex-direction:row;align-items:center;}
#commander-table #ct-search-status {margin:12px 0;color:var(--ct-muted);}
#commander-table #ct-search-added:empty {display:none;}
#commander-table #ct-lobby .ct-search-add {width:100%;padding:8px;font-size:12px;}
#commander-table .ct-search-pagination {display:flex;gap:16px;justify-content:center;align-items:center;margin:24px 0;}
#commander-table .ct-card-search [hidden] {display:none!important;}
#commander-table .ct-search-credit {display:block;color:var(--ct-muted);margin-top:24px;}
#commander-table .ct-search-credit a {color:inherit;}
#commander-table .ct-card-search .ct-card-list-row {grid-template-columns:minmax(150px,2fr) 40px minmax(90px,1fr) 70px;}
#commander-table .ct-card-search .ct-card-list-row>.ct-search-add {grid-column:-2;}
@media(max-width:1250px){#commander-table .ct-search-advanced{grid-template-columns:repeat(3,minmax(0,1fr));}}
@media(max-width:1150px){#commander-table .ct-search-filter-panel[data-filter-panel=colors]{grid-template-columns:minmax(0,1fr);}#commander-table .ct-search-filter-panel.ct-search-values{grid-template-columns:minmax(0,1fr) 1px minmax(0,1fr);}#commander-table .ct-search-values>.ct-condition-divider:nth-child(4){grid-column:1 / -1;height:1px;}#commander-table .ct-symbol-panel{grid-template-columns:minmax(0,1fr);}}
@media(max-width:760px){#commander-table .ct-search-advanced{grid-template-columns:repeat(2,minmax(0,1fr));}#commander-table .ct-search-filter-panel,#commander-table .ct-search-filter-panel.ct-search-extra,#commander-table .ct-search-filter-panel.ct-search-values,#commander-table .ct-search-filter-panel:is([data-filter-panel=colors],[data-filter-panel=text],[data-filter-panel=sets],[data-filter-panel=print]){grid-template-columns:minmax(0,1fr);gap:20px;padding:16px;}}
@media(max-width:600px){#commander-table .ct-search-quick{grid-template-columns:minmax(0,1fr);}#commander-table .ct-search-color-settings{grid-template-columns:repeat(2,minmax(0,1fr));}#commander-table .ct-search-color-buttons{grid-column:1 / -1;grid-row:2;justify-self:center;width:132px;}#commander-table .ct-search-result-tools{align-items:end;}#commander-table #ct-lobby .ct-search-result-tools h2{flex-basis:100%;}#commander-table #ct-lobby .ct-search-result-tools>label{flex:1;flex-direction:column;align-items:stretch;}#commander-table .ct-card-search .ct-card-list-row{grid-template-columns:minmax(0,1fr) 36px;}#commander-table .ct-card-search .ct-card-list-row>.ct-search-add{grid-column:1 / -1;}#commander-table .ct-search-name>button{padding:10px;}#commander-table .ct-search-name svg{display:none;}}
@media(max-width:480px){#commander-table .ct-search-advanced,#commander-table .ct-search-filter-panel.ct-search-values{grid-template-columns:minmax(0,1fr);}}
@media(prefers-reduced-motion:reduce){#commander-table .ct-search-filter-tab>svg{transition:none;}}

/* Deck tabs, quantity-weighted statistics and linked game pieces. */
#commander-table #ct-lobby .ct-deck-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:20px 0;}
#commander-table #ct-lobby .ct-deck-tabs button{min-width:0;min-height:44px;padding:10px 12px;}
#commander-table #ct-lobby .ct-deck-tabs [aria-selected=true]{background:#f1d56b22;border-color:#f1d56b;}
#commander-table #ct-lobby [id^=ct-deck-panel-][hidden]{display:none!important;}
#commander-table .ct-deck-insights{margin:20px 0 28px;text-align:left;min-width:0;}
#commander-table #ct-lobby .ct-deck-insights .ct-insight-title{font-size:23px;margin:0 0 8px;text-align:center;}
#commander-table .ct-insight-scope{text-align:center;}
#commander-table .ct-deck-insights p{font-size:13px;line-height:1.6;margin:8px 0 16px;}
#commander-table .ct-insight-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:20px 0;}
#commander-table .ct-insight-metrics>div{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:18px 8px;border:1px solid var(--ct-line);border-radius:12px;background:#303d3355;}
#commander-table .ct-insight-metrics strong{font-size:27px;line-height:1.2;color:var(--ct-gold);}
#commander-table .ct-insight-metrics span{font-size:13px;text-align:center;}
#commander-table .ct-insight-charts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:stretch;}
#commander-table .ct-insight-chart{padding:20px;border:1px solid var(--ct-line);border-radius:12px;min-width:0;}
#commander-table #ct-lobby .ct-insight-chart h3{margin:0 0 16px;font-size:18px;text-align:left;}
#commander-table .ct-insight-chart p:last-child{margin-bottom:0;color:var(--ct-muted);}
#commander-table .ct-insight-columns{display:flex;align-items:end;gap:10px;height:210px;border-bottom:1px solid var(--ct-line);padding:0 6px 8px;}
#commander-table .ct-insight-columns>div{display:flex;flex:1;min-width:0;flex-direction:column;align-items:center;gap:6px;}
#commander-table .ct-insight-columns strong,#commander-table .ct-insight-columns small{font-size:13px;}
#commander-table .ct-insight-stack{display:flex;flex-direction:column-reverse;width:100%;max-width:48px;overflow:hidden;border-radius:5px 5px 0 0;}
#commander-table .ct-insight-stack>span{min-height:0;}
#commander-table .ct-insight-inline-legend{display:flex;flex-wrap:wrap;gap:8px 16px;margin:12px 0;font-size:12px;}
#commander-table .ct-insight-inline-legend>span{display:flex;align-items:center;gap:6px;}
#commander-table .ct-insight-dot{display:inline-block;flex:none;width:10px;height:10px;border-radius:50%;}
#commander-table .ct-insight-distribution{display:flex;align-items:center;gap:24px;min-height:200px;margin:14px 0;}
#commander-table .ct-insight-donut{width:160px;height:160px;border-radius:50%;flex:none;display:grid;place-items:center;}
#commander-table .ct-insight-donut>span{width:112px;height:112px;border-radius:50%;background:var(--ct-panel);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;}
#commander-table .ct-insight-donut strong{font-size:24px;}
#commander-table .ct-insight-donut small{font-size:12px;}
#commander-table .ct-insight-legend{list-style:none;padding:0;margin:0;display:grid;gap:10px;min-width:0;flex:1;font-size:13px;}
#commander-table .ct-insight-legend li{display:grid;grid-template-columns:10px minmax(0,1fr) auto auto;gap:8px;align-items:center;}
#commander-table .ct-insight-legend li>span:nth-child(2){overflow-wrap:anywhere;}
#commander-table .ct-insight-legend small{font-size:11px;min-width:40px;text-align:right;white-space:nowrap;}
#commander-table #ct-lobby .ct-insight-check{display:flex;align-items:center;gap:8px;min-height:44px;font-size:13px;}
#commander-table #ct-lobby .ct-insight-check input{width:18px;height:18px;min-height:18px;margin:0;accent-color:var(--ct-gold);}
#commander-table .ct-insight-bars{list-style:none;padding:0;margin:20px 0;display:grid;gap:16px;font-size:13px;}
#commander-table .ct-insight-bars li{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:6px 12px;}
#commander-table .ct-insight-bars li>span{display:flex;align-items:center;gap:8px;overflow-wrap:anywhere;}
#commander-table .ct-insight-mana{width:20px;height:20px;flex:none;}
#commander-table .ct-insight-bars li>div{grid-column:1/-1;background:#303d33;border-radius:4px;overflow:hidden;height:7px;}
#commander-table .ct-insight-bars li>div>span{display:block;height:100%;border-radius:4px;}
#commander-table .ct-insight-bars strong small{font-weight:400;color:var(--ct-muted);}
#commander-table .ct-insight-subtype{display:flex;align-items:center;gap:12px;font-size:13px;}
#commander-table .ct-insight-subtype select{flex:1;min-width:0;}
#commander-table .ct-insight-value>strong{display:block;font-size:34px;color:var(--ct-gold);margin:32px 0 20px;overflow-wrap:anywhere;}
#commander-table .ct-deck-insights .ct-insight-notice{background:#f1d56b10;border:1px solid #f1d56b66;border-radius:8px;padding:12px;overflow-wrap:anywhere;color:var(--ct-ink);font-size:13px;}
#commander-table .ct-insight-empty{padding:24px 0;color:var(--ct-muted);}
#commander-table .ct-token-sources{font-size:12px;text-align:left;padding:10px 4px;overflow-wrap:anywhere;line-height:1.5;}
#commander-table .ct-token-sources>strong{color:var(--ct-muted);font-weight:400;}
#commander-table .ct-token-sources ul{margin:4px 0 0;padding-left:16px;}
#commander-table .ct-token-sources li+li{margin-top:5px;}
#commander-table .ct-token-grid .ct-card-price{display:none;}
#commander-table .ct-token-pages{display:flex;justify-content:center;align-items:center;gap:12px;margin:20px 0;font-size:13px;}
#commander-table .ct-token-copies{margin:20px 0;}
#commander-table .ct-insight-source{color:var(--ct-muted);}
@media(max-width:1100px){#commander-table .ct-insight-distribution{flex-direction:column;align-items:stretch;gap:20px;}#commander-table .ct-insight-donut{align-self:center;}}
@media(max-width:700px){#commander-table .ct-insight-charts{grid-template-columns:minmax(0,1fr);}#commander-table .ct-insight-chart{padding:16px;}#commander-table .ct-insight-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}#commander-table .ct-insight-columns{gap:6px;}#commander-table #ct-lobby .ct-deck-tabs{gap:6px;}#commander-table #ct-lobby .ct-deck-tabs button{padding:10px 6px;font-size:14px;}#commander-table .ct-token-pages{gap:8px;}}
/* Manual deck builder */
#commander-table .ct-builder{max-width:1440px;text-align:left;}
#commander-table #ct-lobby .ct-builder-heading{display:flex;align-items:center;gap:16px;margin-bottom:20px;}
#commander-table #ct-lobby .ct-builder-heading h1{flex:1;text-align:center;margin:0;}
#commander-table #ct-lobby .ct-builder-heading .ct-page-title-row{margin:0 auto;}
#commander-table .ct-builder-sticky{position:static;background:var(--ct-panel);padding:14px;border:1px solid var(--ct-line);border-radius:18px;box-shadow:0 10px 20px -12px #000b;}
#commander-table .ct-builder-title{display:flex;align-items:center;gap:12px;min-width:0;margin-bottom:14px;font-size:13px;}
#commander-table .ct-builder-name{display:flex;align-items:center;gap:8px;min-width:0;max-width:100%;margin:0;}
#commander-table .ct-builder-name strong{font-size:18px;overflow-wrap:anywhere;min-width:0;}
#commander-table .ct-builder-name.is-editing{width:460px;}
#commander-table #ct-lobby .ct-builder-name button{display:inline-flex;align-items:center;justify-content:center;flex:none;width:34px;min-width:34px;height:34px;min-height:34px;padding:6px;}
#commander-table .ct-builder-name svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}
#commander-table #ct-lobby #ct-builder-name-input{flex:1;width:0;min-width:0;height:36px;min-height:36px;padding:4px 8px;font-size:18px;}
#commander-table .ct-builder-title>span{color:var(--ct-muted);}
#commander-table .ct-builder-nav{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;}
#commander-table #ct-lobby .ct-builder-nav button{min-width:0;padding:10px 6px;white-space:normal;}
#commander-table #ct-lobby .ct-builder-nav [aria-selected=true]{background:#f1d56b22;border-color:var(--ct-gold);}
#commander-table .ct-builder-status{font-size:12px;margin:8px 0 0;}
#commander-table .ct-builder-status:empty{display:none;}
#commander-table .ct-builder-recovery{display:flex;gap:8px;margin-top:8px;}
#commander-table .ct-builder [hidden]{display:none!important;}
#commander-table [id^=ct-build-page-]{margin-top:22px;min-width:0;}
#commander-table .ct-builder-workspace{display:block;}
#commander-table .ct-builder-main{min-width:0;}
#commander-table #ct-lobby .ct-builder h2{font-size:22px;text-align:left;margin:12px 0 16px;}
#commander-table #ct-lobby .ct-builder h3{font-size:16px;text-align:left;margin:16px 0 10px;}
#commander-table .ct-builder label,#commander-table #ct-create-deck-form label{display:flex;flex-direction:column;gap:6px;font-size:13px;min-width:0;}
#commander-table .ct-builder input,#commander-table .ct-builder select{min-width:0;}
#commander-table .ct-builder-commanders:not(:empty){margin-bottom:20px;}
#commander-table .ct-builder-commanders .ct-card-list-head{display:none;}
#commander-table .ct-builder-commanders p{font-size:13px;}
#commander-table .ct-builder-actions{display:flex;flex-wrap:wrap;gap:8px;}
#commander-table .ct-builder-commander-heading{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:12px;margin-bottom:14px;}
#commander-table #ct-lobby .ct-builder-commander-heading>h2{grid-column:2;margin:0;text-align:center;font-size:22px;line-height:1.3;}
#commander-table .ct-builder-commander-heading>.ct-builder-actions{grid-column:3;justify-self:end;flex-wrap:nowrap;}
#commander-table #ct-lobby .ct-builder-commander-heading .ct-builder-actions button{font-size:12px;line-height:1.3;min-height:40px;padding:8px 10px;white-space:nowrap;}
#commander-table .ct-builder-color-choices{display:grid;gap:8px;margin-top:10px;}
#commander-table .ct-builder-color-choices:empty{display:none;}
#commander-table .ct-builder-commander-overview.has-help.has-commanders{display:grid;grid-template-columns:minmax(0,var(--ct-commander-width)) minmax(0,1fr);gap:24px;align-items:start;}
#commander-table .ct-builder-commander-deck{min-width:0;}
#commander-table .has-help .ct-builder-commander-cards{grid-template-columns:repeat(var(--ct-commander-columns),minmax(0,1fr));max-width:min(100%,var(--ct-commander-width));}
#commander-table .ct-builder-card-help{min-width:0;}
#commander-table .has-commanders>.ct-builder-card-help{border-left:1px solid var(--ct-line);padding-left:24px;}
#commander-table .ct-build-card-help-heading{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;}
#commander-table #ct-lobby .ct-build-card-help-heading>h3{font-size:18px;margin:0;}
#commander-table #ct-lobby [data-open-build-help]{font-size:12px;min-height:36px;padding:6px 10px;}
#commander-table .ct-builder-commanders .ct-build-card-help-summary{margin:10px 0 18px;font-size:12px;line-height:1.6;color:var(--ct-muted);}
#commander-table .ct-build-card-help-summary strong{color:var(--ct-ink);}
#commander-table .ct-build-card-help-roles{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:16px 24px;}
#commander-table .ct-build-card-help-role{min-width:0;}
#commander-table .ct-build-card-help-role>div:first-child{display:flex;align-items:baseline;justify-content:space-between;gap:8px;font-size:13px;}
#commander-table .ct-build-card-help-role>div:first-child>span{min-width:0;overflow-wrap:anywhere;}
#commander-table .ct-build-card-help-role strong{flex:none;font-variant-numeric:tabular-nums;}
#commander-table .ct-build-card-help-role small{display:block;font-size:11px;line-height:1.4;color:var(--ct-muted);}
#commander-table .ct-build-card-help-role.is-notice small{color:var(--ct-gold);}
#commander-table .ct-build-card-help-role.is-notice .ct-build-meter span{background:#cfb96c;}
@media(max-width:800px){
  #commander-table .ct-builder-commander-overview.has-help.has-commanders{grid-template-columns:minmax(0,1fr);gap:20px;}
  #commander-table .has-commanders>.ct-builder-card-help{border-left:0;border-top:1px solid var(--ct-line);padding:18px 0 0;}
  #commander-table .ct-build-card-help-roles{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 16px;}
}
@media(max-width:1050px){
  #commander-table .ct-builder-commander-overview.has-help.has-partners{grid-template-columns:minmax(0,1fr);gap:20px;}
  #commander-table .has-partners>.ct-builder-card-help{border-left:0;border-top:1px solid var(--ct-line);padding:18px 0 0;}
  #commander-table .ct-builder-commander-heading{grid-template-columns:minmax(0,1fr);gap:10px;}
  #commander-table #ct-lobby .ct-builder-commander-heading>h2{grid-column:1;}
  #commander-table .ct-builder-commander-heading>.ct-builder-actions{grid-column:1;}
}
@media(max-width:600px){
  #commander-table .ct-builder-commander-heading>.ct-builder-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));justify-self:stretch;}
  #commander-table #ct-lobby .ct-builder-commander-heading .ct-builder-actions button{min-width:0;min-height:44px;white-space:normal;}
  #commander-table .ct-builder-commander-heading>.ct-builder-actions>button:only-child{grid-column:1/-1;justify-self:end;}
}
#commander-table .ct-builder-deck-tools{display:flex;align-items:end;flex-wrap:wrap;gap:12px;margin-bottom:16px;}
#commander-table .ct-builder-card-tools{display:flex;align-items:center;gap:8px;margin-left:auto;}
#commander-table #ct-lobby [data-builder-lock]{display:inline-flex;align-items:center;justify-content:center;width:44px;min-width:44px;height:44px;padding:9px;}
#commander-table [data-builder-lock] svg{width:22px;height:22px;}
#commander-table #ct-lobby [data-builder-lock][aria-pressed=true]{border-color:var(--ct-gold);color:var(--ct-gold);background:#eed66a1a;}
#commander-table .ct-builder-sort-tools{display:grid;grid-template-columns:minmax(140px,240px) minmax(130px,180px) minmax(150px,210px) max-content;align-items:end;gap:10px;min-width:0;width:100%;}
#commander-table #ct-lobby .ct-builder-sort-tools label{display:flex;flex-direction:column;min-width:0;margin:0;}
#commander-table #ct-lobby .ct-builder-sort-tools>.ct-collection-search{position:relative;display:block;}
#commander-table #ct-lobby #ct-builder-filter{height:44px;padding-left:38px;}
#commander-table .ct-builder-sort-options{display:flex;gap:6px;min-width:0;}
#commander-table .ct-builder-sort-options>label{flex:1;}
#commander-table .ct-builder-view-toggle{display:flex;align-items:end;justify-content:start;min-width:0;}
#commander-table #ct-lobby #ct-builder-sort-reverse{width:36px;min-width:36px;height:44px;min-height:44px;padding:0;font-size:22px;}
#commander-table #ct-builder-sort-reverse[aria-pressed=true]{background:#54745c;color:white;}
@media(max-width:700px){
  #commander-table .ct-builder-sort-tools{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
  #commander-table .ct-builder-view-toggle>.ct-view-toggle{width:100%;justify-content:center;}
}
#commander-table[data-device-view="smartphone"] .ct-builder-sort-tools{border-block:1px solid color-mix(in srgb,var(--ct-muted) 55%,transparent);padding-block:14px;}
#commander-table .ct-builder-deck-content>p{font-size:13px;}
#commander-table .ct-builder-card-group+.ct-builder-card-group{margin-top:26px;}
#commander-table #ct-lobby .ct-builder-card-group>h3{font-size:18px;text-align:left;margin:18px 0 12px;padding-bottom:8px;border-bottom:1px solid var(--ct-line);}
#commander-table .ct-builder-card-group>h3>span,#commander-table [data-unassigned-toggle]>span{font-size:14px;font-weight:400;color:var(--ct-muted);}
#commander-table .ct-builder-card-group.has-card-tools{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:12px;}
#commander-table #ct-lobby .ct-builder-card-group.has-card-tools>h3{grid-column:1;grid-row:1;margin:12px 0;padding:0;border:0;}
#commander-table .ct-builder-card-group.has-card-tools>.ct-builder-card-tools{grid-column:2;grid-row:1;margin:0 0 10px;}
#commander-table .ct-builder-card-group.has-card-tools>.ct-builder-group-cards{grid-column:1/-1;min-width:0;border-top:1px solid var(--ct-line);padding-top:12px;}
#commander-table .ct-builder-card-tools.is-empty-toolbar{justify-content:flex-end;width:100%;padding-bottom:12px;margin-bottom:12px;border-bottom:1px solid var(--ct-line);}
#commander-table #ct-lobby .ct-commander-placeholder{display:flex;align-items:center;justify-content:center;width:176px;max-width:100%;aspect-ratio:63/88;min-height:0;margin:0 auto 24px;padding:16px;border:1px dashed var(--ct-gold);border-radius:12px;background:var(--ct-panel);color:var(--ct-ink);text-align:center;font-size:16px;line-height:1.5;box-shadow:inset 0 0 0 7px #ffffff05;}
#commander-table .ct-builder-commander-heading>.ct-builder-actions:empty{display:none;}
#commander-table #ct-lobby [data-unassigned-toggle]{display:flex;align-items:center;gap:6px;width:100%;min-height:36px;padding:0;border:0;border-radius:4px;background:transparent;font:inherit;text-align:left;}
#commander-table [data-unassigned-toggle] svg{width:18px;height:18px;flex:none;}
#commander-table [data-unassigned-toggle][aria-expanded=false] svg{transform:rotate(-90deg);}
#commander-table .ct-builder-group-note{color:var(--ct-muted);line-height:1.5;}
#commander-table .ct-build-row-actions{display:flex;align-items:center;flex-wrap:wrap;gap:4px;margin:6px 0 12px;}
#commander-table #ct-lobby .ct-build-row-actions button{font-size:11px;min-height:36px;min-width:32px;padding:6px;}
#commander-table .ct-builder-grid .ct-card-list-row .ct-build-row-actions{grid-column:1/-1;}
#commander-table .ct-builder-grid .ct-deck-card-invalid{border-radius:10px;padding:3px;}
#commander-table #ct-build-page-help{padding:16px;border:1px solid var(--ct-line);border-radius:12px;font-size:13px;line-height:1.5;}
#commander-table .ct-build-rule-status{margin:16px 0;padding:12px;border:1px solid #759280;border-radius:10px;background:#29382d;}
#commander-table .ct-build-rule-status.is-error{background:#382725;border-color:#e47a79;}
#commander-table .ct-build-rule-status.is-notice{background:#343329;border-color:#c5ab60;}
#commander-table .ct-build-rule-status li.is-error{color:#ffb1ae;}
#commander-table .ct-build-rule-status li.is-notice{color:#f1d56b;}
#commander-table .ct-build-rule-status ul{padding-left:18px;overflow-wrap:anywhere;}
#commander-table .ct-build-rule-status button{width:100%;}
#commander-table .ct-build-guidelines{display:grid;gap:14px;margin:16px 0;}
#commander-table .ct-build-guideline details summary{cursor:pointer;}
#commander-table .ct-build-guideline details summary strong{float:right;}
#commander-table .ct-build-guideline p{font-size:12px;color:var(--ct-muted);}
#commander-table .ct-build-guideline small{font-size:11px;}
#commander-table .ct-build-guideline.is-notice small{color:var(--ct-gold);}
#commander-table .ct-build-meter{height:6px;border-radius:6px;background:#303d33;overflow:hidden;margin:7px 0;}
#commander-table .ct-build-meter span{display:block;height:100%;background:#86ad8e;}
#commander-table .ct-build-guideline.is-notice .ct-build-meter span{background:#cfb96c;}
#commander-table .ct-build-mini-curve{border-top:1px solid var(--ct-line);margin-top:20px;padding-top:6px;}
#commander-table .ct-build-curve{display:flex;align-items:end;gap:6px;height:140px;margin:10px 0;border-bottom:1px solid var(--ct-line);padding-bottom:6px;}
#commander-table .ct-build-curve>div{flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;gap:5px;font-size:12px;}
#commander-table .ct-build-curve>div>div{display:flex;flex-direction:column-reverse;width:100%;overflow:hidden;border-radius:4px 4px 0 0;}
#commander-table .ct-build-curve-legend{display:flex;flex-wrap:wrap;gap:6px 12px;font-size:11px;}
#commander-table .ct-build-curve-legend i{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:4px;}
#commander-table .ct-builder-search-options{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-bottom:16px;padding:16px;border:1px solid var(--ct-line);border-radius:12px;}
#commander-table .ct-builder-search-options>label{flex:1 1 230px;}
#commander-table .ct-build-search-note{flex-basis:100%;font-size:13px;margin:0;}
#commander-table #ct-lobby .ct-build-check{display:flex;flex-direction:row;align-items:center;gap:8px;min-height:44px;}
#commander-table #ct-lobby .ct-build-check input,#commander-table #ct-lobby .ct-build-checks input{width:18px;height:18px;min-height:18px;flex:none;accent-color:var(--ct-gold);margin:0;}
#commander-table .ct-build-field-pair,.ct-builder-dialog .ct-build-field-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;}
#commander-table #ct-builder-plan-form,#commander-table #ct-create-deck-form{display:grid;gap:18px;max-width:900px;margin:20px auto;}
#commander-table .ct-builder-plan-tools{display:flex;justify-content:center;max-width:900px;margin:0 auto 20px;}
#commander-table #ct-builder-plan-form textarea{min-height:110px;}
#commander-table .ct-builder fieldset,.ct-builder-dialog fieldset{min-width:0;border:1px solid #75877a66;border-radius:8px;margin:0;padding:12px;}
#commander-table .ct-build-checks,.ct-builder-dialog .ct-build-checks{display:grid;grid-template-columns:repeat(auto-fit,minmax(155px,1fr));gap:8px;}
#commander-table .ct-build-checks label{display:flex;flex-direction:row;align-items:center;gap:8px;padding:8px;background:#303d3355;border-radius:6px;}
#commander-table .ct-build-mana-table>div{display:grid;grid-template-columns:40px repeat(2,minmax(0,1fr));gap:10px;padding:8px 0;border-bottom:1px solid var(--ct-line);font-size:12px;}
#commander-table .ct-build-mana-table i{display:block;height:5px;border-radius:3px;margin-top:5px;}
#commander-table #ct-build-page-help>section{margin-bottom:20px;}
.ct-builder-dialog{width:min(800px,calc(100vw - 32px));max-width:calc(100vw - 32px);box-sizing:border-box;text-align:left;}
.ct-builder-dialog>h2{margin:0 32px 18px 0;padding:0;text-align:left;}
.ct-builder-dialog form{display:grid;gap:14px;}
.ct-builder-dialog label{display:flex;flex-direction:column;gap:6px;font-size:13px;min-width:0;}
.ct-builder-dialog input,.ct-builder-dialog select{box-sizing:border-box;width:100%;min-width:0;background:#202723;border:1px solid #afbeb2;border-radius:8px;color:#fff;padding:10px;min-height:44px;font:inherit;}
.ct-builder-dialog .ct-build-check,.ct-builder-dialog .ct-build-checks label{display:flex;flex-direction:row;align-items:center;gap:8px;min-height:36px;}
.ct-builder-dialog input[type=checkbox]{width:18px;height:18px;min-height:18px;flex:none;margin:0;accent-color:#f1d56b;}
.ct-builder-dialog details{font-size:13px;margin:8px 0;}
.ct-builder-dialog summary{cursor:pointer;padding:8px 0;}
.ct-builder-dialog .ct-build-targets{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;}
.ct-builder-dialog .ct-build-card-info{display:grid;grid-template-columns:180px minmax(0,1fr);gap:20px;font-size:13px;line-height:1.5;margin-bottom:16px;}
.ct-builder-dialog .ct-build-card-info>img{width:100%;max-height:none;}
.ct-builder-dialog .ct-build-card-info .ct-insight-mana{width:20px;height:20px;vertical-align:middle;}
.ct-builder-dialog .ct-build-oracle{white-space:pre-line;}
.ct-builder-dialog .ct-build-printings{margin-bottom:16px;}
.ct-builder-dialog [data-printing-options]{display:grid;gap:8px;margin-top:10px;}
.ct-builder-dialog [data-printing-options] select{max-width:100%;}
.ct-builder-dialog .ct-build-dialog-message{color:#f1d56b;overflow-wrap:anywhere;}
.ct-builder-quick-add{width:min(560px,calc(100vw - 32px));}
.ct-builder-quick-add .ct-build-quick-hint{font-size:13px;color:#c4cec7;margin:0 0 18px;}
.ct-builder-quick-add .ct-build-quick-state{font-size:13px;color:#c4cec7;margin:12px 0;overflow-wrap:anywhere;}
.ct-builder-quick-add .ct-build-quick-state:empty,.ct-builder-quick-add .ct-build-dialog-message:empty{display:none;}
.ct-build-quick-results{display:grid;gap:8px;list-style:none;padding:0;margin:14px 0 0;max-height:min(360px,46dvh);overflow:auto;overscroll-behavior:contain;}
.ct-build-quick-results>li{min-width:0;}
.ct-builder-quick-add .ct-build-quick-result{display:flex;align-items:center;gap:12px;width:100%;min-height:54px;padding:10px 12px;text-align:left;font:inherit;border-color:#75877a66;}
.ct-builder-quick-add .ct-build-quick-result:hover{background:#425647;border-color:#f1d56b;}
.ct-builder-quick-add :is(input,button):focus-visible{outline:2px solid #f1d56b;outline-offset:2px;}
.ct-builder-quick-add button:disabled{opacity:.6;cursor:wait;}
.ct-build-quick-name{flex:1;min-width:0;overflow-wrap:anywhere;font-size:14px;}
.ct-build-quick-name small{font-size:12px;color:#c4cec7;margin:4px 0 0;}
.ct-build-quick-mana{display:flex;flex-wrap:wrap;gap:2px;justify-content:flex-end;max-width:96px;}
.ct-build-quick-mana img{width:18px;height:18px;}
.ct-build-quick-plus{flex:none;font-size:20px;color:#f1d56b;}
@media(max-width:400px){.ct-builder-quick-add .ct-build-quick-result{gap:8px;padding:10px 8px;}.ct-build-quick-mana{max-width:60px;}}
@media(max-width:700px){#commander-table .ct-builder-nav{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;}#commander-table #ct-lobby .ct-builder-nav button{font-size:12px;min-height:40px;padding:6px;}#commander-table .ct-builder-title{flex-wrap:wrap;gap:4px 10px;}#commander-table .ct-builder-sticky{padding:10px;border-radius:16px;}#commander-table .ct-builder-deck-tools{grid-template-columns:repeat(2,minmax(0,1fr));}#commander-table .ct-build-field-pair{grid-template-columns:minmax(0,1fr);}#commander-table #ct-lobby .ct-builder-heading{flex-wrap:wrap;}#commander-table #ct-lobby .ct-builder-heading>#ct-builder-view{margin-left:auto;}#commander-table .ct-builder-commanders .ct-card-list-row{grid-template-columns:minmax(0,1fr) 38px;}#commander-table .ct-builder-commanders .ct-card-list-row>:nth-child(n+3){display:none;}}
@media(max-width:500px){.ct-builder-dialog{padding:16px;}.ct-builder-dialog .ct-build-card-info{grid-template-columns:minmax(0,1fr);}.ct-builder-dialog .ct-build-card-info>img{max-width:180px;justify-self:center;}.ct-builder-dialog .ct-build-targets{grid-template-columns:repeat(2,minmax(0,1fr));}.ct-builder-dialog .ct-build-checks{grid-template-columns:repeat(2,minmax(0,1fr));}.ct-builder-dialog .ct-build-checks label{font-size:12px;overflow-wrap:anywhere;}}
#commander-table #ct-lobby .ct-builder-heading{display:grid;grid-template-columns:minmax(0,1fr) auto;}
#commander-table #ct-lobby .ct-builder-heading>.ct-page-title-row{justify-self:center;max-width:calc(100% - 110px);margin:0;}
#commander-table #ct-lobby .ct-builder-commanders .ct-build-remove-commander{display:block;grid-column:1/-1;font-size:12px;min-height:36px;justify-self:end;}
@media(max-width:700px){#commander-table #ct-lobby .ct-builder-heading{grid-template-columns:minmax(0,1fr);}#commander-table #ct-lobby .ct-builder-heading>#ct-builder-view{grid-row:2;justify-self:end;}#commander-table #ct-lobby .ct-build-row-actions button{min-height:44px;font-size:12px;}}
/* Clip the builder shell without creating a separate scrolling container. */
#commander-table:has(.ct-builder){overflow:clip;}
#commander-table .ct-builder .ct-deck-insights{scroll-margin-top:calc(var(--ct-menu-safe-top,0px) + 16px);}
/* Deck-specific board navigation and compact artwork list. */
#commander-table .ct-builder-boards{display:block;width:220px;max-width:100%;margin:0 0 18px;}
#commander-table #ct-lobby .ct-builder-boards select{width:100%;min-width:0;min-height:44px;font-size:14px;}
#commander-table .ct-builder-sort-tools>.ct-builder-boards{width:100%;min-width:0;margin:0;}
#commander-table .ct-deck-controls>.ct-builder-boards{flex:0 1 180px;width:180px;margin:0;}
#commander-table #ct-deck-load-status:empty{display:none;}
#commander-table[data-device-view="smartphone"] .ct-deck-controls{
  border-block:1px solid color-mix(in srgb,var(--ct-muted) 55%,transparent);
  padding-block:14px;
}
@media(max-width:600px){
  #commander-table .ct-deck-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));}
  #commander-table .ct-deck-controls>.ct-builder-boards{width:100%;}
  #commander-table .ct-deck-controls>label{min-width:0;}
}
#commander-table .ct-build-cards:not(.ct-build-list)>.ct-card-tile{background:#303d33;border:1px solid var(--ct-line);border-radius:10px;overflow:hidden;align-self:start;}
#commander-table #ct-lobby .ct-build-cards:not(.ct-build-list) .ct-deck-card{border:0;background:transparent;border-radius:0;box-shadow:none;width:100%;}
#commander-table .ct-build-cards .ct-build-row-actions{display:flex;align-items:center;justify-content:space-between;gap:6px;margin:0;padding:6px;}
#commander-table .ct-build-quantity{display:flex;align-items:center;justify-content:center;gap:4px;flex:none;}
#commander-table .ct-build-quantity>span{min-width:20px;text-align:center;font-variant-numeric:tabular-nums;font-size:14px;}
#commander-table .ct-build-edit-actions{display:flex;gap:4px;flex-wrap:wrap;}
#commander-table .ct-build-card-visual{position:relative;}
#commander-table .ct-build-card-visual>.ct-build-quantity{position:absolute;left:12px;right:12px;bottom:38px;justify-content:space-between;gap:4px;padding:4px;background:#18221cee;border:1px solid #829486;border-radius:8px;}
#commander-table #ct-lobby .ct-build-card-visual .ct-build-quantity button{width:32px;min-width:32px;min-height:32px;height:32px;padding:0;font-size:20px;}
#commander-table .ct-build-cards:not(.ct-build-list) .ct-build-edit-actions{width:100%;}
#commander-table .ct-build-cards:not(.ct-build-list) .ct-build-edit-actions button{flex:1;}
#commander-table .ct-deck-grid.ct-build-list,#commander-table .ct-builder-search-host .ct-deck-grid.ct-card-list{display:flex;flex-direction:column;gap:6px;}
#commander-table .ct-build-list-row{display:flex;align-items:center;gap:16px;border:1px solid var(--ct-line);border-radius:8px;background:#303d3366;padding:6px;min-width:0;}
#commander-table #ct-lobby .ct-build-list-card{display:grid;grid-template-columns:84px minmax(100px,min(22%,200px)) minmax(0,1fr);flex:1;align-items:center;gap:16px;min-width:0;min-height:58px;height:58px;padding:0;border:0;border-radius:4px;background:transparent;text-align:left;white-space:normal;justify-content:start;overflow:hidden;}
#commander-table .ct-build-art{display:flex;align-items:center;justify-content:center;width:84px;height:58px;flex:none;border-radius:4px;overflow:hidden;background:#18221c;color:var(--ct-muted);font-size:10px;}
#commander-table .ct-build-art img{display:block;width:100%;height:100%;max-height:none;object-fit:contain;}
#commander-table .ct-build-list-info{display:grid;gap:4px;min-width:0;max-height:58px;overflow:hidden;}
#commander-table .ct-build-list-info>strong{font-size:14px;line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
#commander-table .ct-build-list-info>small{font-size:10px;line-height:1.3;color:var(--ct-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
#commander-table .ct-build-list-info>.ct-build-mana{flex-wrap:nowrap;overflow:hidden;}
#commander-table .ct-build-list-description{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;min-width:0;max-height:51px;overflow:hidden;white-space:pre-line;overflow-wrap:anywhere;font-size:12px;line-height:17px;color:var(--ct-muted);}
#commander-table .ct-builder-search-host .ct-card-tile{position:relative;}
#commander-table #ct-lobby .ct-builder-search-host .ct-search-add-icon{position:absolute;right:12px;bottom:38px;width:44px;min-width:44px;height:44px;min-height:44px;padding:0;border-color:#b5c5b8;background:#203a2bee;font-size:32px;line-height:1;border-radius:10px;box-shadow:0 2px 8px #0006;}
#commander-table .ct-builder-search-host .ct-build-list-row{flex-wrap:nowrap;}
#commander-table #ct-lobby .ct-builder-search-host .ct-build-list-row>.ct-search-add-icon{position:static;flex:none;margin:0;align-self:end;}
#commander-table .ct-build-mana{display:flex;flex-wrap:wrap;align-items:center;gap:2px;font-size:12px;min-height:18px;}
#commander-table .ct-build-mana img{width:18px;height:18px;max-height:18px;object-fit:contain;}
#commander-table .ct-build-mana-symbol{position:relative;display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;border-radius:50%;background:#cac5c0;color:#181818;font-size:12px;line-height:1;}
#commander-table .ct-build-mana-symbol img{position:absolute;inset:0;visibility:hidden;}
#commander-table .ct-build-mana-symbol.is-loaded img{visibility:visible;}
#commander-table .ct-build-mana-symbol.is-loaded>span{visibility:hidden;}
#commander-table .ct-build-list .ct-build-row-actions{flex:none;padding:0;justify-content:end;flex-wrap:nowrap;}
#commander-table #ct-lobby .ct-build-list .ct-build-row-actions button{min-width:32px;width:32px;min-height:36px;font-size:16px;padding:0;}
#commander-table .ct-builder-search-options{border:0;border-radius:0;padding:0;gap:8px 20px;margin-bottom:12px;}
#commander-table .ct-builder-search-options>label{flex:none;}
.ct-builder-dialog [hidden]{display:none!important;}
.ct-builder-dialog .ct-build-commander-target{align-self:center;font-size:13px;}
@media(max-width:700px){
  #commander-table .ct-build-list-row{flex-wrap:wrap;gap:6px;}
  #commander-table #ct-lobby .ct-build-list-card{grid-template-columns:72px minmax(90px,.7fr) minmax(0,1.3fr);gap:8px;}
  #commander-table .ct-build-art{width:72px;height:50px;}
  #commander-table .ct-build-list-info>strong{font-size:13px;}
  #commander-table .ct-build-list .ct-build-row-actions{width:100%;justify-content:space-between;}
  #commander-table #ct-lobby .ct-build-list .ct-build-row-actions button{min-width:44px;width:44px;min-height:44px;}
}
@media(max-width:500px){
  #commander-table #ct-lobby .ct-build-list-card{grid-template-columns:72px minmax(0,1fr);grid-template-rows:40px 16px;gap:2px 8px;}
  #commander-table .ct-build-list-card>.ct-build-art{grid-row:1/3;}
  #commander-table .ct-build-list-info{grid-column:2;grid-row:1;gap:2px;max-height:40px;}
  #commander-table .ct-build-list-info>small{display:none;}
  #commander-table .ct-build-list-description{grid-column:2;grid-row:2;-webkit-line-clamp:1;max-height:16px;line-height:16px;font-size:11px;}
}


/* Seat-based damage quadrants and permanently assigned resource positions. */
#commander-table .ct-seat .ct-panel{--ct-damage-height:66px;--ct-tableau-marker-size:88px;--ct-control-radius:8px;grid-template-rows:minmax(0,1fr) auto;padding-top:28px;}
#commander-table .ct-table-layout>.ct-seat[data-side=true] .ct-panel{--ct-damage-height:40px;grid-template-rows:minmax(0,1fr) auto;}
#commander-table .ct-panel>.ct-head{position:absolute;top:28px;left:16px;right:16px;height:88px;display:grid;grid-template-columns:60px minmax(0,1fr) 88px;grid-template-rows:88px;align-items:start;gap:4px;pointer-events:none;z-index:2;}
#commander-table .ct-panel>.ct-head button{pointer-events:auto;}
#commander-table .ct-panel>.ct-head>.ct-shared-tax{width:60px;min-width:60px;height:88px;min-height:88px;padding:2px;}
#commander-table .ct-panel .ct-shared-tax strong.ct-tax-display{font-size:22px;line-height:26px;}
#commander-table .ct-panel .ct-shared-tax .ct-tax-display small{font-size:20px;}
#commander-table .ct-tableau-statuses>.ct-name-status{width:calc(var(--ct-tableau-marker-size)*2 + 4px);height:var(--ct-tableau-marker-size);align-self:start;}
#commander-table .ct-tableau-statuses .ct-monarch,#commander-table .ct-tableau-statuses .ct-initiative-slot,#commander-table .ct-tableau-statuses .ct-initiative-slot button{width:var(--ct-tableau-marker-size);min-width:var(--ct-tableau-marker-size);max-width:var(--ct-tableau-marker-size);height:var(--ct-tableau-marker-size);min-height:var(--ct-tableau-marker-size);flex-basis:var(--ct-tableau-marker-size);}
#commander-table .ct-tableau-statuses .ct-monarch svg,#commander-table .ct-tableau-statuses .ct-initiative-slot svg{width:36px;height:36px;}
#commander-table .ct-tableau-statuses>.ct-progress-tax{width:var(--ct-tableau-marker-size);max-width:var(--ct-tableau-marker-size);height:var(--ct-tableau-marker-size);align-self:start;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;}
#commander-table .ct-tableau-statuses>.ct-progress-tax [data-pinned-counter]{width:calc((var(--ct-tableau-marker-size) - 4px)/2);min-width:0;max-width:calc((var(--ct-tableau-marker-size) - 4px)/2);height:var(--ct-tableau-marker-size);min-height:var(--ct-tableau-marker-size);grid-row:1;gap:6px;font-size:18px;}
#commander-table .ct-tableau-statuses>.ct-progress-tax [data-pinned-counter=ring]{grid-column:1;}
#commander-table .ct-tableau-statuses>.ct-progress-tax [data-pinned-counter=speed]{grid-column:2;}
#commander-table .ct-tableau-statuses>.ct-progress-tax svg{width:26px;height:26px;}
#commander-table .ct-panel>.ct-head>.ct-person{align-self:start;}
#commander-table .ct-panel>.ct-life{grid-row:1;min-height:0;padding-bottom:0;}
#commander-table .ct-panel>.ct-life .ct-number{left:15%;right:15%;bottom:0;letter-spacing:.02em;}
#commander-table .ct-panel>.ct-life>[data-life]{padding-top:88px;}
#commander-table .ct-panel:has(.ct-commander:not([hidden]))>.ct-life .ct-number{top:34px;}
#commander-table .ct-panel>.ct-tableau-bottom{position:relative;grid-row:2;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr) minmax(0,1fr);gap:8px;min-height:max(92px,calc(var(--ct-damage-height)*2 - 8px));height:calc(var(--ct-damage-height)*var(--damage-rows) + 4px*(var(--damage-rows) - 1));min-width:0;}
#commander-table .ct-tableau-bottom>.ct-seat-damages{grid-column:2;grid-row:1;display:grid;grid-template-columns:repeat(var(--damage-columns,2),minmax(0,1fr));grid-template-rows:repeat(var(--damage-rows),var(--ct-damage-height));grid-auto-rows:var(--ct-damage-height);width:100%;gap:4px;min-height:0;margin:0;transform:none;}
#commander-table .ct-damage-seat{min-width:0;min-height:0;}
#commander-table .ct-damage-seat>.ct-damage,#commander-table .ct-damage-seat>.ct-damage-self,#commander-table .ct-damage-seat>.ct-damage-ally{display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-width:0;min-height:0;padding:0;margin:0;border:1px solid color-mix(in srgb,var(--damage-source-color,var(--ct-muted)) 60%,var(--ct-line));border-radius:8px;overflow:hidden;}
#commander-table .ct-damage-seat>.ct-damage-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));padding:0;}
#commander-table .ct-damage-seat>.ct-damage-pair>.ct-damage{height:100%;min-height:0;padding:0;}
#commander-table .ct-damage-seat .ct-damage b{top:50%;}
#commander-table .ct-damage-seat .ct-damage em{top:2px;left:4px;right:auto;bottom:auto;font-size:12px;opacity:.75;}
#commander-table .ct-damage-self svg,#commander-table .ct-damage-ally svg{width:30px;height:30px;}
#commander-table .ct-tableau-bottom>.ct-foot{position:static;width:86%;justify-self:start;grid-column:1;grid-row:1;inset:auto;height:100%;min-width:0;margin:0;padding:0;transform:none;pointer-events:none;}
#commander-table .ct-tableau-bottom .ct-pinned{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:8px;width:100%;height:100%;min-height:0;padding:0;margin:0;}
#commander-table .ct-tableau-bottom .ct-quick-resource{display:flex;align-self:center;width:100%;max-width:100%;height:min(100%,calc(var(--ct-damage-height) - 2px));min-width:0;flex:none;margin:0;pointer-events:auto;}
#commander-table .ct-tableau-bottom .ct-quick-resource button{height:100%;min-height:0;}
#commander-table .ct-tableau-bottom [data-resource-slot="0"]{grid-column:1;grid-row:1;}
#commander-table .ct-tableau-bottom [data-resource-slot="1"]{grid-column:2;grid-row:1;}
#commander-table .ct-tableau-bottom [data-resource-slot="2"]{grid-column:3;grid-row:1;}
#commander-table .ct-tableau-bottom [data-resource-slot="3"]{grid-column:4;grid-row:1;}
#commander-table[data-tableau=duel] .ct-panel>.ct-head{grid-template-columns:minmax(0,1fr) 88px;}

#commander-table[data-commander-damage=false] .ct-panel>.ct-tableau-bottom{height:calc(var(--ct-damage-height)*2 + 4px);}
#commander-table[data-commander-damage=false] .ct-seat .ct-panel{grid-template-rows:minmax(0,1fr) auto;}
#commander-table[data-commander-damage=false] .ct-panel>.ct-life .ct-number{bottom:0;}
#commander-table .ct-damage-editor{display:grid;grid-template-columns:repeat(auto-fit,minmax(165px,1fr));gap:12px;margin:16px 0;}
#commander-table .ct-damage-editor section{min-width:0;padding:10px;border:1px solid var(--ct-line);border-radius:10px;}
#commander-table .ct-damage-editor h4{margin:0 0 8px;text-align:center;}
#commander-table .ct-damage-correction+ .ct-damage-correction{margin-top:10px;}
#commander-table .ct-damage-correction>span{display:block;font-size:12px;overflow-wrap:anywhere;text-align:center;}
#commander-table .ct-damage-correction>div{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;gap:4px;margin-top:4px;}
#commander-table .ct-damage-correction output{text-align:center;font-size:24px;font-variant-numeric:tabular-nums;}
#commander-table .ct-damage-correction button{height:44px;min-height:44px;padding:0;font-size:22px;}
#commander-table .ct-damage-coupling{display:flex;align-items:center;gap:8px;}

#commander-table .ct-table-layout>.ct-seat[data-side=true] .ct-panel>.ct-head{top:20px;grid-template-columns:60px minmax(0,1fr) 88px;grid-template-rows:88px;}

/* One radius for all tableau control surfaces, including composite counters. */
#commander-table .ct-panel>.ct-head :is(button,.ct-initiative-slot),
#commander-table .ct-panel .ct-tableau-statuses :is(button,.ct-initiative-slot),
#commander-table .ct-panel>.ct-handle,
#commander-table .ct-panel .ct-damage-seat>*,
#commander-table .ct-panel .ct-quick-resource,
#commander-table .ct-panel .ct-poison-slot [data-pinned-counter=poison]{border-radius:var(--ct-control-radius);}
#commander-table .ct-panel .ct-poison-slot [data-pinned-counter=poison]{width:100%;min-width:0;height:100%;min-height:0;font-size:26px;}
#commander-table .ct-panel .ct-poison-slot svg{width:36px;height:36px;}

/* The damage column stays unchanged; side controls use only the surrounding columns. */
#commander-table .ct-panel>.ct-head>.ct-poison-slot{position:static;grid-column:3;grid-row:1;width:88px;height:88px;min-height:0;transform:none;}
#commander-table[data-tableau=duel] .ct-panel>.ct-head>.ct-person{grid-column:1;}
#commander-table[data-tableau=duel] .ct-panel>.ct-head>.ct-poison-slot{grid-column:2;}
#commander-table .ct-tableau-statuses{--ct-status-row-height:calc((var(--ct-status-stack-height) - 4px)/2);--ct-status-stack-height:calc(var(--ct-damage-height)*var(--damage-rows) + 4px*(var(--damage-rows) - 1));grid-column:3;grid-row:1;align-self:start;justify-self:center;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:repeat(2,minmax(0,1fr));gap:4px;width:min(180px,100%);height:var(--ct-status-stack-height);min-width:0;}
#commander-table .ct-tableau-statuses>.ct-progress-tax,#commander-table .ct-tableau-statuses>.ct-name-status{grid-column:1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;align-items:stretch;width:100%;max-width:none;height:100%;min-width:0;}
#commander-table .ct-tableau-statuses>.ct-progress-tax{grid-row:1;}
#commander-table .ct-tableau-statuses>.ct-name-status{grid-row:2;}
#commander-table .ct-tableau-statuses .ct-monarch,#commander-table .ct-tableau-statuses .ct-initiative-slot,#commander-table .ct-tableau-statuses .ct-initiative-slot button,#commander-table .ct-tableau-statuses>.ct-progress-tax [data-pinned-counter]{width:100%;min-width:0;max-width:none;height:100%;min-height:0;flex-basis:auto;}
#commander-table[data-resources-centered=true] .ct-tableau-bottom>.ct-foot{grid-column:2;justify-self:center;}
#commander-table .ct-tableau-statuses .ct-initiative-slot{display:flex;order:0;}
#commander-table .ct-tableau-statuses .ct-monarch{order:1;}
#commander-table .ct-tableau-statuses .ct-initiative-slot button{padding:2px;}
#commander-table .ct-tableau-statuses .ct-monarch[aria-pressed=true],#commander-table .ct-tableau-statuses .ct-monarch[aria-pressed=true] svg{color:#f6ce55;stroke:#f6ce55;}
#commander-table .ct-tableau-statuses [data-pinned-status=initiative][aria-pressed=true],#commander-table .ct-tableau-statuses [data-pinned-status=initiative][aria-pressed=true] svg{color:#70baff;stroke:#70baff;}
#commander-table .ct-tableau-statuses>.ct-progress-tax [data-pinned-counter]{font-size:clamp(10px,calc(var(--ct-status-row-height)*.3),18px);gap:2px;padding:2px;}
#commander-table .ct-tableau-statuses>.ct-progress-tax svg{width:min(26px,calc(var(--ct-status-row-height)*.42));height:min(26px,calc(var(--ct-status-row-height)*.42));}
#commander-table .ct-tableau-statuses .ct-monarch svg,#commander-table .ct-tableau-statuses .ct-initiative-slot svg{width:min(36px,calc(var(--ct-status-row-height)*.6));height:min(36px,calc(var(--ct-status-row-height)*.6));}

/* Damage positions follow the table; all values face the tableau's owner. */
#commander-table .ct-tableau-bottom>.ct-seat-damages[data-seat-map=true]{grid-template-columns:var(--damage-map-columns);grid-template-rows:var(--damage-map-rows);height:calc(var(--ct-damage-height)*2 + 4px);}
#commander-table .ct-seat-damages[data-seat-map=true]>.ct-damage-seat{position:relative;}

/* Shared symbol sizes and readable, separated counter feedback. */
#commander-table .ct-panel .ct-tableau-bottom [data-pinned-counter] svg,
#commander-table .ct-panel .ct-tableau-statuses :is(.ct-monarch,.ct-initiative-slot) svg,
#commander-table .ct-panel .ct-poison-slot svg,
#commander-table .ct-panel :is(.ct-damage-self,.ct-damage-ally) svg{width:var(--ct-tableau-icon-size,32px);height:var(--ct-tableau-icon-size,32px);flex-shrink:0;}
#commander-table .ct-panel .ct-tableau-bottom .ct-quick-resource [data-pinned-counter]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:2px;font-size:var(--ct-resource-label-height,16px);line-height:var(--ct-resource-label-height,16px);}
#commander-table .ct-panel[data-compact-status=true] .ct-tableau-statuses>.ct-progress-tax [data-pinned-counter]{flex-direction:row;gap:3px;}
#commander-table .ct-panel .ct-damage-seat .ct-damage b{left:50%;right:auto;top:calc(50% - var(--damage-ink-offset,0px));bottom:auto;transform:translate(-50%,-50%);text-align:center;line-height:1;}
#commander-table .ct-panel .ct-damage>.ct-live-delta{font-weight:500;}
#commander-table .ct-panel>.ct-head>.ct-person>.ct-commander{font-size:17px;line-height:21px;}
#commander-table .ct-panel>.ct-head>.ct-person:has(.ct-commander-pair:not([hidden])){height:88px;}
#commander-table .ct-panel>.ct-head>.ct-person>.ct-commander-pair:not([hidden]){display:grid;grid-template-rows:repeat(2,minmax(0,1fr));height:88px;width:100%;padding:3px 0;flex-shrink:0;background:transparent;}
#commander-table .ct-commander-pair .ct-partner-name{display:flex;align-items:center;min-width:0;height:100%;overflow:hidden;}
#commander-table .ct-commander-pair .ct-partner-name>span{display:block;max-width:100%;padding:4px 7px;border-radius:8px;background:var(--ct-control-surface);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
#commander-table .ct-panel .ct-shared-tax-paired strong.ct-tax-display{font-size:22px;line-height:24px;}
#commander-table .ct-panel .ct-shared-tax-paired .ct-tax-display small{font-size:13px;line-height:15px;}

/* Keep bright artwork readable and let the permanently visible blessed frame swell gently. */
#commander-table .ct-panel .ct-number{-webkit-text-stroke:1px #000;paint-order:stroke fill;}
#commander-table .ct-panel.ct-blessed:not(.ct-eliminated){border-color:var(--ct-gold);}
#commander-table .ct-panel.ct-blessed:not(.ct-eliminated)::before{
  content:"";position:absolute;inset:0;z-index:12;border-radius:inherit;pointer-events:none;
  box-shadow:inset 0 0 0 3px #f3cf64,inset 0 0 15px 4px #efc34c80;
  animation:ct-blessing-glow 4s ease-in-out infinite;
}
@keyframes ct-blessing-glow{
  0%,100%{box-shadow:inset 0 0 0 3px #f3cf64,inset 0 0 15px 4px #efc34c80;}
  50%{box-shadow:inset 0 0 0 5px #ffe8a2,inset 0 0 28px 8px #f5cf66b3;}
}
#commander-table[data-reduce-motion=true] .ct-panel.ct-blessed:not(.ct-eliminated)::before{animation:none;}
@media(prefers-reduced-motion:reduce){#commander-table .ct-panel.ct-blessed:not(.ct-eliminated)::before{animation:none;}}
#commander-table .ct-tableau-statuses>.ct-progress-tax:not(:has([data-pinned-counter=speed])) [data-pinned-counter=ring]{grid-column:2;}

/* Seat-sized player menu: tall wheels above large state and exit surfaces. */
#commander-table .ct-dialog.ct-counter-dialog{
  --menu-space:clamp(calc(2px*var(--menu-unit)),min(calc(var(--menu-height)*.015),calc(var(--menu-width)*.008)),8px);--menu-gap:var(--menu-space);--menu-pad:var(--menu-space);
  --menu-header:clamp(calc(28px*var(--menu-unit)),calc(var(--menu-height)*.1),44px);--menu-footer:clamp(calc(52px*var(--menu-unit)),calc(var(--menu-height)*.25),124px);
  --menu-font:clamp(calc(11px*var(--menu-unit)),calc(var(--menu-width)*.016),17px);--menu-caption:clamp(calc(22px*var(--menu-unit)),calc(var(--menu-height)*.09),38px);--menu-heading:clamp(6px,min(calc(var(--menu-height)*.035),calc(var(--menu-width)*.02)),14px);
  display:grid;grid-template-rows:var(--menu-header) minmax(0,1fr) var(--menu-footer);gap:var(--menu-gap);padding:var(--menu-pad);overflow:hidden;
}
#commander-table .ct-dialog.ct-counter-dialog .ct-menu-title{padding-right:calc(var(--menu-header) + var(--menu-gap));}
#commander-table .ct-dialog.ct-counter-dialog .ct-menu-title h3{font-size:clamp(calc(16px*var(--menu-unit)),calc(var(--menu-height)*.06),28px);}
#commander-table .ct-dialog.ct-counter-dialog .ct-menu-actions .ct-menu-dismiss{position:static;transform:none;width:var(--menu-header);height:var(--menu-header);min-height:0;padding:3px;background:var(--ct-button);border:1px solid var(--ct-line);border-radius:8px;}
#commander-table .ct-dialog.ct-counter-dialog .ct-menu-actions .ct-menu-dismiss svg{width:75%;height:75%;}
#commander-table .ct-dialog.ct-counter-dialog[data-menu-layout=wide] .ct-menu-categories{grid-template-columns:2fr 4fr 1fr;grid-template-rows:minmax(0,1fr);grid-template-areas:"progress resources poison";}
#commander-table .ct-dialog.ct-counter-dialog .ct-menu-categories{margin:0;overflow:visible;}
#commander-table .ct-dialog.ct-counter-dialog .ct-menu-category{position:relative;grid-template-rows:minmax(0,1fr);gap:0;padding:var(--menu-pad);padding-top:calc(var(--menu-heading)*.5 + var(--menu-pad));}
#commander-table .ct-dialog.ct-counter-dialog .ct-menu-heading{position:absolute;top:calc(var(--menu-heading)*-.5);left:50%;transform:translateX(-50%);padding:0 4px;background:var(--ct-panel);font-size:var(--menu-heading);line-height:1;}
#commander-table .ct-dialog.ct-counter-dialog #ct-progress-list,
#commander-table .ct-dialog.ct-counter-dialog #ct-counter-list,
#commander-table .ct-dialog.ct-counter-dialog #ct-poison-list{grid-template-rows:minmax(0,1fr);grid-row:1;gap:var(--menu-gap);min-width:0;}
#commander-table .ct-dialog.ct-counter-dialog #ct-progress-list{grid-template-columns:repeat(2,minmax(0,1fr));}
#commander-table .ct-dialog.ct-counter-dialog #ct-counter-list{grid-template-columns:repeat(4,minmax(0,1fr));column-gap:calc(var(--menu-space)*2 + 1px);}
#commander-table .ct-dialog.ct-counter-dialog .ct-counter-row{grid-template-columns:minmax(0,1fr);grid-template-rows:var(--menu-caption) minmax(0,1fr);gap:2px;width:100%;height:100%;min-width:0;align-self:stretch;justify-self:stretch;}
#commander-table .ct-dialog.ct-counter-dialog .ct-counter-caption{height:100%;gap:2px;}
#commander-table .ct-dialog.ct-counter-dialog .ct-counter-caption .ct-counter-symbol{width:var(--menu-caption);height:var(--menu-caption);min-height:0;border:1px solid transparent;background:transparent;border-radius:6px;flex:none;}
#commander-table .ct-dialog.ct-counter-dialog .ct-counter-caption .ct-counter-symbol[aria-pressed=true]{border-color:var(--ct-gold);color:var(--ct-gold);background:color-mix(in srgb,var(--ct-gold) 18%,var(--ct-button));}
#commander-table .ct-dialog.ct-counter-dialog .ct-counter-symbol svg{width:80%;height:80%;}
#commander-table .ct-dialog.ct-counter-dialog .ct-counter-name{font-size:var(--menu-font);line-height:1.1;white-space:normal;overflow-wrap:anywhere;}
#commander-table .ct-dialog.ct-counter-dialog .ct-counter-wheel{position:relative;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) minmax(0,1.4fr) minmax(0,1fr);align-items:center;justify-items:center;width:100%;height:100%;min-height:0;border:1px solid var(--ct-line);border-radius:10px;background:linear-gradient(var(--ct-panel),var(--ct-button) 38%,var(--ct-button) 62%,var(--ct-panel));touch-action:none;user-select:none;-webkit-user-select:none;cursor:ns-resize;overflow:hidden;padding:2px 0;outline-offset:0;container-type:size;}
#commander-table .ct-dialog.ct-counter-dialog .ct-counter-wheel output{display:block;grid-column:1;grid-row:2;width:100%;font-size:clamp(12px,min(65cqw,38cqh),76px);line-height:1.1;pointer-events:none;border-block:1px solid var(--ct-line);}
#commander-table .ct-dialog.ct-counter-dialog .ct-counter-wheel>[data-wheel-before]{grid-column:1;grid-row:1;}
#commander-table .ct-dialog.ct-counter-dialog .ct-counter-wheel>[data-wheel-after]{grid-column:1;grid-row:3;}
#commander-table .ct-dialog.ct-counter-dialog .ct-wheel-neighbor{font-size:clamp(6px,min(26cqw,18cqh),36px);line-height:1;opacity:.85;pointer-events:none;font-variant-numeric:tabular-nums;}
#commander-table .ct-dialog.ct-counter-dialog .ct-wheel-neighbor[data-disabled]{opacity:.25;}
#commander-table .ct-dialog.ct-counter-dialog .ct-counter-wheel[data-pinned=true]{border-color:var(--ct-gold);}
#commander-table .ct-dialog.ct-counter-dialog .ct-counter-wheel[data-dragging=true],#commander-table .ct-dialog.ct-counter-dialog .ct-counter-wheel:focus-visible{outline:2px solid var(--ct-gold);}
#commander-table .ct-dialog.ct-counter-dialog .ct-tools{display:grid;grid-template-columns:1fr 2.2fr 1fr;grid-template-rows:minmax(0,1fr);gap:var(--menu-gap);margin:0;align-items:stretch;}
#commander-table .ct-dialog.ct-counter-dialog .ct-tools>.ct-menu-category{grid-area:auto;}
#commander-table .ct-dialog.ct-counter-dialog .ct-tools>button{width:100%;height:100%;min-height:0;flex-direction:column;font-size:clamp(calc(11px*var(--menu-unit)),calc(var(--menu-width)*.018),20px);gap:4px;}
#commander-table .ct-dialog.ct-counter-dialog .ct-tools>button svg{width:clamp(calc(20px*var(--menu-unit)),calc(var(--menu-height)*.07),38px);height:clamp(calc(20px*var(--menu-unit)),calc(var(--menu-height)*.07),38px);}
#commander-table .ct-dialog.ct-counter-dialog .ct-menu-states{align-items:stretch;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:minmax(0,1fr);}
#commander-table .ct-dialog.ct-counter-dialog .ct-menu-status{display:block;min-height:0;height:100%;}
#commander-table .ct-dialog.ct-counter-dialog .ct-tools .ct-menu-state{display:flex;flex-direction:column;width:100%;height:100%;min-height:0;gap:3px;padding:2px;white-space:normal;}
#commander-table .ct-dialog.ct-counter-dialog .ct-menu-state svg{width:clamp(calc(20px*var(--menu-unit)),calc(var(--menu-height)*.12),68px);height:clamp(calc(20px*var(--menu-unit)),calc(var(--menu-height)*.12),68px);max-width:80%;max-height:60%;flex-shrink:1;}
#commander-table .ct-dialog.ct-counter-dialog .ct-status-name{width:100%;height:auto;font-size:var(--menu-font);line-height:1.1;}
#commander-table .ct-dialog.ct-counter-dialog[data-menu-layout=narrow]{--menu-footer:clamp(112px,calc(var(--menu-height)*.32),208px);}
#commander-table .ct-dialog.ct-counter-dialog[data-menu-layout=narrow] .ct-menu-categories{grid-template-columns:2fr 1fr;grid-template-rows:repeat(2,minmax(0,1fr));grid-template-areas:"progress poison" "resources resources";gap:calc(var(--menu-gap) + var(--menu-heading)*.5);}
#commander-table .ct-dialog.ct-counter-dialog[data-menu-layout=narrow] #ct-poison-list{grid-template-rows:minmax(0,1fr);}
#commander-table .ct-dialog.ct-counter-dialog[data-menu-layout=narrow] .ct-tools{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:minmax(0,1.5fr) minmax(0,1fr);gap:calc(var(--menu-gap) + 4px);}
#commander-table .ct-dialog.ct-counter-dialog[data-menu-layout=narrow] .ct-tools>.ct-menu-category{grid-column:1/-1;grid-row:1;}
#commander-table .ct-dialog.ct-counter-dialog[data-menu-layout=narrow] .ct-tools>button{grid-row:2;flex-direction:row;}

#commander-table .ct-dialog.ct-counter-dialog[data-menu-dense=true] .ct-counter-name{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);}
#commander-table .ct-dialog.ct-counter-dialog[data-menu-dense=true] .ct-counter-caption .ct-counter-symbol{width:100%;height:100%;}
#commander-table .ct-dialog.ct-counter-dialog[data-menu-dense=true] .ct-counter-symbol svg{width:var(--menu-caption);height:var(--menu-caption);max-width:100%;}

/* The free halves change life; explicit actions and damage fields stay above them. */
#commander-table .ct-panel>.ct-life-hitareas{position:absolute;inset:0;display:grid;grid-template-columns:1fr 1fr;z-index:1;}
#commander-table .ct-panel>.ct-life-hitareas>[data-life]{width:100%;height:100%;min-width:0;min-height:0;padding:0 24px;background:transparent;border:0;border-radius:0;text-align:left;font-size:24px;touch-action:none;}
#commander-table .ct-panel>.ct-life-hitareas>[data-d="1"]{text-align:right;}
#commander-table .ct-panel>.ct-life{pointer-events:none;z-index:2;}
#commander-table .ct-panel>.ct-handle{z-index:4;}
#commander-table .ct-panel>.ct-tableau-bottom{pointer-events:none;z-index:2;}
#commander-table .ct-panel .ct-seat-damages{pointer-events:auto;}
#commander-table .ct-panel>.ct-head,#commander-table .ct-table-layout>.ct-seat[data-side=true] .ct-panel>.ct-head{grid-template-columns:60px minmax(0,1fr) 180px;}
#commander-table .ct-panel>.ct-head>.ct-name-status{position:static;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-column:3;grid-row:1;width:180px;height:88px;min-width:0;gap:4px;align-self:start;margin:0;}
#commander-table .ct-panel>.ct-head .ct-monarch,#commander-table .ct-panel>.ct-head .ct-initiative-slot,#commander-table .ct-panel>.ct-head .ct-initiative-slot button{width:88px;min-width:0;max-width:none;height:88px;min-height:0;padding:2px;flex-basis:auto;}
#commander-table .ct-panel>.ct-head .ct-monarch{grid-column:2;grid-row:1;}
#commander-table .ct-panel>.ct-head .ct-initiative-slot{grid-column:1;grid-row:1;}
#commander-table .ct-panel>.ct-head .ct-name-status svg{width:44px;height:44px;}
#commander-table[data-tableau=duel] .ct-panel>.ct-head{grid-template-columns:minmax(0,1fr) 180px;}
#commander-table[data-tableau=duel] .ct-panel>.ct-head>.ct-name-status{grid-column:2;}
#commander-table .ct-panel .ct-tableau-bottom>.ct-foot{height:36px;width:min(224px,100%);align-self:end;pointer-events:none;}
#commander-table .ct-panel .ct-tableau-bottom .ct-pinned{grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:36px;gap:4px;}
#commander-table .ct-panel .ct-tableau-bottom .ct-quick-resource{height:36px;pointer-events:none;align-self:end;border:0;border-radius:8px;container-type:inline-size;}
#commander-table .ct-panel .ct-counter-indicator{display:flex;justify-content:center;align-items:center;gap:5px;min-width:0;height:36px;padding:4px;font-size:16px;line-height:1;pointer-events:none;background:var(--ct-control-surface);border-radius:8px;}
#commander-table .ct-panel .ct-counter-indicator svg{width:22px;height:22px;flex:none;}
#commander-table .ct-panel .ct-quick-resource .ct-counter-indicator{width:100%;}
@container (max-width:48px){
  #commander-table .ct-panel .ct-quick-resource .ct-counter-indicator{flex-direction:column;gap:0;padding:1px;font-size:12px;}
  #commander-table .ct-panel .ct-quick-resource .ct-counter-indicator svg{width:min(22px,calc(100cqw - 2px));height:min(22px,calc(100cqw - 2px));}
}
#commander-table .ct-panel .ct-tableau-statuses{height:36px;width:min(120px,100%);align-self:end;justify-self:end;display:block;pointer-events:none;}
#commander-table .ct-panel .ct-tableau-statuses>.ct-progress-tax{display:flex;justify-content:flex-end;gap:4px;height:36px;}

/* Phone game board stays attached to the physical camera/home ends. */
#commander-table .ct-safe-area{position:absolute;visibility:hidden;pointer-events:none;width:0;height:0;padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px);}
#commander-table[data-phone-table][data-screen=tracker]{height:var(--phone-viewport-height,100dvh);min-height:0;border-radius:0;}
#commander-table .ct-phone-table{position:absolute;transform:translate(-50%,-50%) rotate(var(--phone-angle));transform-origin:center;}
#commander-table:not([data-screen=tracker]) .ct-phone-table{display:none;}
#commander-table[data-phone-table] .ct-phone-table>.ct-grid{position:absolute;margin:0;padding:0;gap:4px;transform:none;}
#commander-table[data-phone-table] .ct-table-layout{grid-template-rows:var(--tableau-height) var(--tableau-height);}
#commander-table[data-phone-table] .ct-table-layout>.ct-bank:nth-of-type(2){grid-row:2;}
#commander-table[data-phone-table] .ct-table-layout>.ct-seat[data-side=true]{grid-row:1/3;}
#commander-table[data-phone-table] .ct-phone-table>.ct-bar{
  position:absolute;left:calc(var(--phone-home) + 2px + var(--phone-menu-size)/2);top:50%;transform:translate(-50%,-50%) rotate(90deg);
  display:grid;grid-template-columns:repeat(5,minmax(0,1fr));grid-template-rows:minmax(0,1fr);gap:3px;
  width:calc(var(--phone-height) - 8px);height:var(--phone-menu-size);min-height:0;padding:4px;margin:0;border-radius:0;overflow:visible;
}
#commander-table[data-phone-table=duel] .ct-phone-table>.ct-bar{left:50%;top:calc(100% - var(--phone-home) - 2px - var(--phone-menu-size)/2);transform:translate(-50%,-50%);width:calc(var(--phone-width) - 8px);}
#commander-table[data-phone-table] .ct-phone-table>.ct-bar .ct-bar-left,
#commander-table[data-phone-table] .ct-phone-table>.ct-bar .ct-bar-right,
#commander-table[data-phone-table] .ct-phone-table>.ct-bar .ct-day-picker{display:contents;}
#commander-table[data-phone-table] .ct-phone-table>.ct-bar button,
#commander-table[data-phone-table] .ct-phone-table>.ct-bar .ct-clock{
  position:relative!important;grid-column:var(--phone-action)!important;grid-row:1!important;display:flex;align-items:center;justify-content:center;
  width:100%!important;min-width:0!important;height:100%!important;min-height:0!important;padding:2px!important;margin:0!important;transform:none!important;border-radius:8px!important;flex:none;
  background:var(--bar-surface,var(--ct-button))!important;border:1px solid var(--bar-frame,var(--ct-line))!important;
}
#commander-table[data-phone-table] #ct-live-history{--phone-action:1;}
#commander-table[data-phone-table] #ct-undo{--phone-action:1;}
#commander-table[data-phone-table] #ct-pause{--phone-action:2;}
#commander-table[data-phone-table] .ct-clock{--phone-action:2;}
#commander-table[data-phone-table] #ct-home{--phone-action:3;}
#commander-table[data-phone-table] #ct-global-tools{--phone-action:4;}
#commander-table[data-phone-table] #ct-finish{--phone-action:6;}
#commander-table[data-phone-table] #ct-settings{--phone-action:5;}
#commander-table[data-phone-table] .ct-phone-table>.ct-bar button svg{width:32px;height:32px;max-width:100%;max-height:100%;}
#commander-table[data-phone-table] .ct-phone-table>.ct-bar .ct-clock{height:14px!important;align-self:end;bottom:3px;padding:0!important;z-index:3;border:0!important;background:transparent!important;pointer-events:none;font-size:11px;line-height:14px;letter-spacing:0;}
#commander-table[data-phone-table] .ct-phone-table>.ct-bar #ct-pause svg{width:28px;height:28px;margin-bottom:14px;}
#commander-table[data-phone-table] .ct-phone-table>.ct-bar .ct-phase-switch .ct-phase-position{display:none;position:static;width:100%;height:100%;padding:0;background:transparent;color:inherit;border:0;}
#commander-table[data-phone-table] .ct-phone-table>.ct-bar .ct-phase-switch[data-state=day] [data-phase-position=day],
#commander-table[data-phone-table] .ct-phone-table>.ct-bar .ct-phase-switch[data-state=night] [data-phase-position=night],
#commander-table[data-phone-table] .ct-phone-table>.ct-bar .ct-phase-switch[data-state=unset] [data-phase-position=unset]{display:flex;align-items:center;justify-content:center;}
#commander-table[data-phone-table] .ct-phone-table>.ct-bar .ct-phase-switch::before{display:none;}


#commander-table[data-phone-table] .ct-phone-table>.ct-bar #ct-finish svg{width:18px;height:18px;}
#commander-table[data-phone-table][data-bar-collapsed=true] .ct-phone-table>.ct-bar{grid-template-columns:44px;justify-content:center;}
#commander-table[data-phone-table][data-bar-collapsed=true] .ct-phone-table>.ct-bar>:not(#ct-home){display:none;}
#commander-table[data-phone-table][data-bar-collapsed=true] .ct-phone-table>.ct-bar #ct-home{--phone-action:1;left:auto;top:auto;box-shadow:none;}
#commander-table[data-phone-table][data-bar-collapsed=true] #ct-home .ct-home-mark{display:block;}

/* Keep the game and its navigation black, including the iPhone system margins. */
html:has(#commander-table[data-screen=tracker]),body:has(#commander-table[data-screen=tracker]){background:#000;}
#commander-table[data-screen=tracker]{background:#000;--ct-bg:#000;color-scheme:dark!important;}
#commander-table .ct-bar{background:#000;color:#edf3ec;--bar-surface:#000;--bar-frame:#56615a;}
#commander-table .ct-grid .ct-bar{--bar-surface:#000;--bar-frame:#56615a;}
#commander-table .ct-bar::before,#commander-table .ct-bar::after{display:none;background:none;animation:none;}

/* Tableau markers use two thirds of their former dimensions. */
#commander-table .ct-panel{--ct-tableau-marker-size:58.667px;}
#commander-table .ct-panel>.ct-head,#commander-table .ct-table-layout>.ct-seat[data-side=true] .ct-panel>.ct-head{top:16px;height:70.667px;grid-template-columns:58.667px minmax(0,1fr) 121.334px;grid-template-rows:58.667px;}
#commander-table .ct-panel>.ct-head>.ct-shared-tax{width:58.667px;min-width:58.667px;height:58.667px;min-height:58.667px;margin-top:0;}
#commander-table .ct-panel>.ct-head>.ct-person{margin-top:12px;}
#commander-table .ct-panel[data-status-edge=left]>.ct-head{grid-template-columns:121.334px minmax(0,1fr) 58.667px;}
#commander-table .ct-panel[data-status-edge=left]>.ct-head>.ct-shared-tax{grid-column:3;}
#commander-table .ct-panel[data-status-edge=left]>.ct-head>.ct-name-status{grid-column:1;}
#commander-table .ct-panel[data-status-edge=left]>.ct-head .ct-monarch{grid-column:1;}
#commander-table .ct-panel[data-status-edge=left]>.ct-head .ct-initiative-slot{grid-column:2;}
#commander-table .ct-panel[data-status-edge=left]>.ct-head .ct-commander{text-align:right;}
#commander-table .ct-panel .ct-shared-tax strong.ct-tax-display{font-size:14.667px;line-height:17.333px;}
#commander-table .ct-panel .ct-shared-tax .ct-tax-display small{font-size:13.333px;}
#commander-table .ct-panel .ct-shared-tax-paired strong.ct-tax-display{font-size:14.667px;line-height:15px;min-height:0;}
#commander-table .ct-panel .ct-shared-tax-paired .ct-tax-display small{font-size:9px;line-height:10px;}
#commander-table .ct-panel>.ct-head>.ct-name-status{width:121.334px;height:58.667px;}
#commander-table .ct-panel>.ct-head .ct-monarch,#commander-table .ct-panel>.ct-head .ct-initiative-slot,#commander-table .ct-panel>.ct-head .ct-initiative-slot button{width:58.667px;height:58.667px;min-height:0;}
#commander-table .ct-panel>.ct-head .ct-name-status svg{width:29.333px;height:29.333px;}
#commander-table .ct-panel>.ct-head .ct-initiative-slot{padding:0;}
#commander-table[data-tableau=duel] .ct-panel>.ct-head{grid-template-columns:minmax(0,1fr) 121.334px;}
#commander-table[data-tableau=duel] .ct-panel[data-status-edge=left]>.ct-head{grid-template-columns:121.334px minmax(0,1fr);}
#commander-table .ct-panel>.ct-head>.ct-person:has(.ct-commander-pair:not([hidden])),#commander-table .ct-panel>.ct-head>.ct-person>.ct-commander-pair:not([hidden]){height:58.667px;}
#commander-table .ct-panel>.ct-head>.ct-person>.ct-commander-pair:not([hidden]){padding:3px 0;}
#commander-table .ct-commander-pair .ct-partner-name>span{padding:2px 7px;}

/* Poison owns the lower right corner; progress stays beside commander damage. */
#commander-table .ct-panel .ct-tableau-statuses{position:relative;container-type:inline-size;display:grid;grid-template-columns:minmax(0,1fr) 58.667px;grid-template-rows:minmax(0,1fr);align-items:end;gap:8px;width:100%;height:58.667px;}
#commander-table .ct-panel .ct-tableau-statuses:not(:has(.ct-tableau-poison)){grid-template-columns:minmax(0,1fr);}
#commander-table .ct-panel .ct-tableau-statuses>.ct-progress-tax{grid-column:1;grid-row:1;align-self:end;width:100%;max-width:100%;height:36px;display:flex;align-items:end;justify-content:flex-start;gap:4px;}
#commander-table .ct-panel .ct-tableau-statuses .ct-counter-indicator{flex:1;min-width:0;max-width:50px;padding:2px;font-size:14px;gap:2px;}
#commander-table .ct-panel .ct-tableau-statuses .ct-counter-indicator svg{width:18px;height:18px;flex-shrink:1;}
#commander-table .ct-panel .ct-tableau-poison{grid-column:2;grid-row:1;align-self:end;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;width:58.667px;height:58.667px;min-height:58.667px;padding:4px;pointer-events:auto;border:1px solid var(--ct-line);border-radius:8px;background:var(--ct-control-surface);color:var(--ct-ink);font-size:18px;line-height:1;touch-action:none;}
#commander-table .ct-panel .ct-tableau-poison svg{width:27px;height:27px;}
@container (max-width:125px){
  #commander-table .ct-panel .ct-tableau-statuses:has(.ct-tableau-poison)>.ct-progress-tax{position:absolute;left:0;bottom:calc(58.667px + 4px);width:min(64px,100%);height:32px;}
  #commander-table .ct-panel .ct-tableau-statuses .ct-counter-indicator{flex-direction:column;height:32px;gap:0;padding:0;font-size:11px;}
  #commander-table .ct-panel .ct-tableau-statuses .ct-counter-indicator svg{width:18px;height:18px;flex:none;}
}

/* Five direct game actions, with the home button at the centre. */
#commander-table:not([data-phone-table]):not([data-bar-collapsed=true]) .ct-bar{display:grid;grid-template-columns:repeat(5,minmax(44px,70px));grid-template-rows:44px;justify-content:center;gap:6px;}
#commander-table:not([data-phone-table]):not([data-bar-collapsed=true]) .ct-bar>:is(#ct-undo,#ct-pause,#ct-home,#ct-global-tools,#ct-settings){grid-row:1;width:100%;height:44px;min-height:44px;margin:0;padding:4px;display:flex;align-items:center;justify-content:center;border-radius:8px;}
#commander-table:not([data-phone-table]):not([data-bar-collapsed=true]) .ct-bar #ct-home{width:100%;border-radius:8px;}
#commander-table:not([data-phone-table]) .ct-bar #ct-undo{grid-column:1;}
#commander-table:not([data-phone-table]) .ct-bar #ct-pause{grid-column:2;}
#commander-table:not([data-phone-table]) .ct-bar #ct-global-tools{grid-column:4;}
#commander-table:not([data-phone-table]) .ct-bar #ct-settings{grid-column:5;}
#commander-table:not([data-phone-table]):not([data-bar-collapsed=true]) .ct-bar .ct-clock{grid-column:2;grid-row:1;position:relative;align-self:end;justify-self:center;bottom:2px;z-index:4;width:auto;height:12px;min-height:0;padding:0;margin:0;border:0;background:transparent;pointer-events:none;font-size:11px;line-height:12px;}
#commander-table:not([data-phone-table]) .ct-bar #ct-pause svg{width:24px;height:24px;margin-bottom:12px;}
#commander-table .ct-bar #ct-global-tools .ct-random-icon{position:relative;display:block;width:36px;height:36px;max-width:100%;max-height:100%;flex:none;}
#commander-table .ct-bar #ct-global-tools .ct-random-icon>svg{display:block;position:absolute;left:50%;top:50%;right:auto;bottom:auto;transform:translate(-50%,-50%);margin:0;}
#commander-table .ct-bar #ct-global-tools .ct-random-icon>svg.ct-random-icon-back{width:36px;height:36px;opacity:.32;stroke-width:1.5;}
#commander-table .ct-bar #ct-global-tools .ct-random-icon>svg.ct-random-icon-front{width:26px;height:26px;opacity:1;filter:drop-shadow(0 0 2px #000);}
#commander-table[data-phone-table] .ct-bar #ct-global-tools .ct-random-icon{width:40px;height:40px;}
#commander-table[data-phone-table] .ct-bar #ct-global-tools .ct-random-icon>svg.ct-random-icon-back{width:40px;height:40px;}
#commander-table[data-phone-table] .ct-bar #ct-global-tools .ct-random-icon>svg.ct-random-icon-front{width:30px;height:30px;}
#commander-table .ct-settings-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0 0 20px;}
#commander-table .ct-settings-actions button{min-height:48px;padding:10px;}

/* Commander with two seats: one damage row at the tableau's lower edge. */
#commander-table .ct-panel:has(.ct-tableau-art){overflow:hidden;}
#commander-table[data-duel-commander=true] .ct-panel>.ct-tableau-bottom{height:var(--ct-damage-height);min-height:var(--ct-damage-height);}
#commander-table[data-duel-commander=true] .ct-tableau-bottom>.ct-seat-damages{align-self:end;}
#commander-table[data-duel-commander=true] .ct-panel>.ct-life .ct-number{display:flex;align-items:center;justify-content:center;}

/* Three seats, with extra space at the end and equally sized self controls. */
#commander-table .ct-table-layout.ct-three-player{grid-template-columns:0 minmax(0,1fr) var(--three-seat-width,33%);}
#commander-table .ct-table-layout.ct-three-player>.ct-seat[data-side=true] .ct-panel{height:var(--three-seat-width,33%);--ct-damage-height:66px;}
#commander-table .ct-three-player .ct-panel>.ct-life .ct-number{display:flex;align-items:center;justify-content:center;}
#commander-table .ct-three-player .ct-tableau-bottom>.ct-seat-damages[data-seat-map=true]{grid-template-columns:var(--damage-map-columns);grid-template-rows:var(--damage-map-rows);}
#commander-table .ct-three-player>.ct-seat[data-side=true] .ct-panel>.ct-tableau-bottom{grid-template-columns:minmax(0,1fr) var(--three-damage-self-width,1.2fr) minmax(0,1fr);}

/* Five seats give the end tableau a third more height (210 -> 280). */
#commander-table .ct-table-layout.ct-five-player{grid-template-columns:0 minmax(0,1fr) 280px;}
#commander-table .ct-table-layout.ct-five-player>.ct-seat[data-side=true] .ct-panel{height:280px;}

/* From five seats onward, the half-size map opens one shared damage editor. */
#commander-table[data-damage-overview=true] .ct-panel>.ct-tableau-bottom{height:max(58.667px,calc((var(--ct-damage-height)*var(--damage-rows) + 4px*(var(--damage-rows) - 1))/2));min-height:0;}
#commander-table[data-damage-overview=true] .ct-panel>.ct-life .ct-number{display:flex;align-items:center;justify-content:center;}
#commander-table .ct-panel>.ct-tableau-bottom>.ct-seat-damages[data-damage-overview=true]{position:relative;width:50%;height:calc((var(--ct-damage-height)*var(--damage-rows) + 4px*(var(--damage-rows) - 1))/2);justify-self:center;align-self:end;gap:2px;grid-template-columns:repeat(var(--damage-columns),minmax(0,1fr));grid-template-rows:repeat(var(--damage-rows),minmax(0,1fr));}
#commander-table .ct-panel>.ct-tableau-bottom>.ct-seat-damages[data-damage-overview=true][data-seat-map=true]{height:calc(var(--ct-damage-height) + 2px);grid-template-columns:var(--damage-map-columns);grid-template-rows:var(--damage-map-rows);}
#commander-table [data-damage-overview=true]>.ct-damage-seat{pointer-events:none;}
#commander-table [data-damage-overview=true] .ct-damage,#commander-table [data-damage-overview=true] .ct-damage-self{background:var(--ct-control-surface);color:var(--ct-ink);pointer-events:none;}
#commander-table [data-damage-overview=true] .ct-damage b{pointer-events:none;}
#commander-table [data-damage-overview=true] .ct-damage em{font-size:7px;top:1px;left:2px;}
#commander-table [data-damage-overview=true] .ct-damage-self svg,#commander-table [data-damage-overview=true] .ct-damage-ally svg{width:15px;height:15px;}
#commander-table .ct-panel .ct-damage-open{position:absolute;inset:0;z-index:3;width:100%;height:100%;min-width:0;min-height:0;margin:0;padding:0;border:0;border-radius:0;background:transparent;pointer-events:auto;}
#commander-table .ct-panel .ct-damage-open:focus-visible{outline:2px solid var(--ct-accent);outline-offset:3px;}
/* Anchor progress to the actual miniature, including when Poison is pinned. */
#commander-table[data-damage-overview=true] .ct-panel .ct-tableau-statuses{position:absolute;grid-column:auto;grid-row:auto;left:var(--ct-overview-right);right:0;bottom:0;width:auto;height:var(--ct-overview-height);gap:4px;align-items:center;justify-self:stretch;}
#commander-table[data-damage-overview=true] .ct-panel .ct-tableau-statuses>.ct-progress-tax{position:static;left:auto;right:auto;bottom:auto;width:100%;height:32px;align-self:center;align-items:center;justify-content:flex-start;}
#commander-table[data-damage-overview=true] .ct-panel .ct-tableau-statuses .ct-counter-indicator{flex:1;width:0;max-width:28px;height:32px;flex-direction:column;gap:0;padding:0;font-size:11px;}
#commander-table[data-damage-overview=true] .ct-panel .ct-tableau-statuses .ct-counter-indicator svg{width:min(18px,100%);height:18px;flex:none;}
@container (max-width:145px){
  #commander-table[data-duel-commander=true] .ct-panel .ct-tableau-statuses:has(.ct-tableau-poison)>.ct-progress-tax{position:absolute;left:auto;right:0;bottom:calc(58.667px + 4px);width:58.667px;height:32px;}
  #commander-table[data-duel-commander=true] .ct-panel .ct-tableau-statuses:has(.ct-tableau-poison) .ct-counter-indicator{flex-direction:column;height:32px;gap:0;padding:0;font-size:11px;}
  #commander-table[data-duel-commander=true] .ct-panel .ct-tableau-statuses:has(.ct-tableau-poison) .ct-counter-indicator svg{width:18px;height:18px;flex:none;}
}

/* Non-Commander boards: upper statuses, centred life and one lower indicator row. */
#commander-table[data-tableau=duel] .ct-panel>.ct-life{position:absolute;grid-area:auto;inset:0;display:flex;height:auto;margin:0;padding:0;}
#commander-table[data-tableau=duel] .ct-panel>.ct-life .ct-number{display:flex;align-items:center;justify-content:center;top:0;bottom:0;}
#commander-table[data-tableau=duel] .ct-panel>.ct-noncommander-bottom{position:absolute;grid-area:auto;left:16px;right:16px;bottom:16px;display:block;height:58.667px;min-height:0;margin:0;padding:0;}
#commander-table .ct-noncommander-icons{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);display:flex;flex-wrap:nowrap;align-items:center;gap:4px;height:44px;width:max-content;}
#commander-table .ct-noncommander-icons :is(.ct-quick-resource,.ct-progress-tax){display:contents;}
#commander-table .ct-panel .ct-noncommander-bottom .ct-counter-indicator{position:relative;inset:auto;display:grid;grid-template-rows:26px 12px;justify-items:center;align-items:center;gap:2px;flex:none;width:var(--ct-duel-icon-width,44px);min-width:0;max-width:none;height:44px;min-height:44px;padding:2px 0;margin:0;border-radius:8px;font-size:12px;line-height:12px;box-sizing:border-box;}
#commander-table .ct-panel .ct-noncommander-bottom .ct-counter-indicator>svg{grid-row:1;width:min(26px,calc(var(--ct-duel-icon-width,44px) - 4px));height:26px;max-width:100%;margin:0;}
#commander-table .ct-noncommander-bottom .ct-counter-value{grid-row:2;}
#commander-table .ct-panel .ct-noncommander-bottom button{pointer-events:auto;}
#commander-table .ct-panel .ct-noncommander-bottom>button.ct-tableau-poison{position:absolute;left:auto;right:0;top:0;bottom:auto;padding:2px;}
#commander-table .ct-panel .ct-noncommander-bottom>.ct-tableau-poison svg{width:29.333px;height:29.333px;flex:none;}

/* Compact rule warnings link to the detailed building help. */
#commander-table #ct-lobby .ct-deck-heading-actions{display:flex;align-items:stretch;justify-content:flex-end;gap:8px;min-width:0;}
#commander-table #ct-lobby .ct-deck-heading-actions>button{margin:0;min-height:44px;}
#commander-table #ct-lobby .ct-legality-shortcut{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:5px 14px;font-size:14px;line-height:1.15;text-align:center;min-width:110px;}
#commander-table #ct-lobby .ct-legality-shortcut[hidden]{display:none;}
#commander-table #ct-lobby .ct-legality-shortcut>small{font-size:11px;line-height:1.1;}
#commander-table #ct-lobby :is(.ct-deck-detail-heading,.ct-builder-heading){position:relative;display:grid;grid-template-columns:minmax(252px,1fr) minmax(0,1.5fr) minmax(252px,1fr);align-items:center;gap:16px;min-height:44px;}
#commander-table:has(.ct-app-nav) #ct-lobby :is(.ct-deck-detail-heading,.ct-builder-heading)>.ct-page-title-row{position:static;grid-column:2;grid-row:1;justify-self:center;width:100%;max-width:none;margin:0;}
#commander-table:has(.ct-app-nav) #ct-lobby :is(.ct-deck-detail-heading,.ct-builder-heading)>.ct-page-title-row>.ct-back{left:0;right:auto;}
#commander-table #ct-lobby :is(.ct-deck-detail-heading,.ct-builder-heading)>.ct-deck-heading-actions{grid-column:3;grid-row:1;}
@media(min-width:761px) and (max-width:1100px){
  #commander-table #ct-lobby :is(.ct-deck-detail-heading,.ct-builder-heading){grid-template-columns:minmax(200px,1fr) minmax(0,1.5fr) minmax(200px,1fr);gap:12px;}
  #commander-table #ct-lobby .ct-deck-heading-actions>button{padding-inline:8px;font-size:12px;white-space:nowrap;}
  #commander-table #ct-lobby .ct-deck-heading-actions>.ct-legality-shortcut{min-width:80px;}
}
@media(max-width:760px){
  #commander-table #ct-lobby .ct-deck-heading-actions>button{flex:1;min-width:0;max-width:220px;padding-inline:8px;font-size:14px;}
  #commander-table #ct-lobby :is(.ct-deck-detail-heading,.ct-builder-heading){grid-template-columns:minmax(0,1fr);gap:12px;}
  #commander-table:has(.ct-app-nav) #ct-lobby :is(.ct-deck-detail-heading,.ct-builder-heading)>.ct-page-title-row{position:relative;grid-column:1;width:calc(100% - 124px);min-height:44px;display:grid;align-items:center;}
  #commander-table:has(.ct-app-nav) #ct-lobby :is(.ct-deck-detail-heading,.ct-builder-heading)>.ct-page-title-row>.ct-back{left:-62px;}
  #commander-table #ct-lobby :is(.ct-deck-detail-heading,.ct-builder-heading)>.ct-deck-heading-actions{grid-column:1;grid-row:2;width:100%;}
}
/* Rules: direct search, compact topics and a distraction-free reading column. */
#commander-table #ct-lobby .ct-rules-top{padding:0 0 16px;border-bottom:1px solid var(--ct-line);}
#commander-table .ct-rules-heading{position:relative;min-height:44px;margin:8px 0 20px;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-rules-heading>.ct-page-title-row{width:calc(100% - 124px);max-width:none;min-height:44px;margin:0 auto;display:grid;place-items:center;}
#commander-table:has(.ct-app-nav) #ct-lobby .ct-rules-heading .ct-back{left:-62px;right:auto;}
#commander-table #ct-lobby #ct-rule-language{position:absolute;right:0;top:0;float:none;width:44px;height:44px;min-height:44px;margin:0;padding:0;font-size:13px;}
#commander-table .ct-rule-search-row{position:relative;display:block;margin:0;}
#commander-table #ct-lobby #ct-rule-search{height:48px;padding:10px 48px 10px 12px;font-size:16px;background:var(--ct-panel);border:1px solid var(--ct-muted);}
#commander-table #ct-lobby #ct-rule-clear{position:absolute;right:2px;top:2px;width:44px;height:44px;min-height:44px;margin:0;padding:0;background:transparent;border:0;}
#commander-table .ct-rule-shortcuts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin-top:10px;}
#commander-table #ct-lobby .ct-rule-shortcuts button{min-width:0;min-height:44px;padding:8px 4px;font-size:13px;}
#commander-table .ct-rules-layout{margin-top:14px;gap:20px;align-items:start;}
#commander-table .ct-rules-layout:has(#ct-rule-content[hidden]){grid-template-columns:minmax(0,1fr);}
#commander-table .ct-rule-topics{min-width:0;}
#commander-table .ct-rule-topics>summary,#commander-table .ct-rule-source-details>summary{min-height:44px;padding:10px 0;cursor:pointer;font-weight:600;box-sizing:border-box;}
#commander-table .ct-rule-navigation{max-height:none;overflow:visible;}
#commander-table .ct-rule-navigation details{border-bottom:1px solid var(--ct-line);padding:0;}
#commander-table .ct-rule-navigation summary{padding:12px 0;font-size:15px;}
#commander-table #ct-lobby .ct-rule-navigation button{min-height:44px;margin:0;padding:10px 8px;font-size:14px;border:0;border-radius:8px;}
#commander-table .ct-rule-navigation button:hover{background:var(--ct-button);}
#commander-table .ct-rule-letters{display:grid;grid-template-columns:repeat(auto-fit,minmax(44px,1fr));gap:4px;padding-bottom:8px;}
#commander-table #ct-lobby .ct-rule-letters button{padding:8px;text-align:center;background:var(--ct-panel);}
#commander-table #ct-lobby #ct-rule-content h2{font-size:22px;text-align:left;margin-bottom:14px;}
#commander-table #ct-rule-content{scroll-margin-top:calc(var(--ct-menu-safe-top,0px) + 12px);}
#commander-table #ct-rule-content[hidden]{display:none;}
#commander-table .ct-rule-text{font-size:16px;line-height:1.6;}
#commander-table .ct-rule-entry{padding:12px;margin:8px 0;border-color:var(--ct-line);}
#commander-table .ct-rule-entry summary{font-size:15px;line-height:1.5;}
#commander-table .ct-rule-results{gap:6px;}
#commander-table .ct-rule-results>button{padding:12px;gap:4px;}
#commander-table .ct-rule-results strong{font-size:15px;line-height:1.4;}
#commander-table .ct-rule-results span{font-size:14px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
#commander-table .ct-rule-result-count{font-size:13px;margin:0 0 10px;color:var(--ct-muted);}
#commander-table .ct-rule-source-details{margin-top:20px;border-top:1px solid var(--ct-line);color:var(--ct-muted);font-size:12px;}
#commander-table .ct-rule-footer{margin-top:0;padding-top:0;border:0;}
@media(max-width:760px){
 #commander-table .ct-rules-layout{grid-template-columns:minmax(0,1fr);gap:10px;}
 #commander-table .ct-rules-searching #ct-rule-content{grid-row:auto;}
 #commander-table #ct-lobby .ct-rule-shortcuts button{font-size:12px;}
 #commander-table #ct-lobby #ct-rule-content h2{font-size:20px;}
 #commander-table .ct-rule-topics>summary{padding-block:8px;}
}

/* Compact deck lifecycle controls and immutable historical lists. */
#commander-table .ct-deck-detail-footer{flex-wrap:wrap;gap:12px;}
#commander-table .ct-deck-management{display:flex;flex-wrap:wrap;gap:8px;margin-right:auto;}
#commander-table .ct-deck-management-status:empty{display:none;}
#commander-table .ct-decks-page>#ct-deck-archive{margin-top:20px;}
.ct-deck-version-dialog{width:min(720px,calc(100vw - 32px));text-align:left;box-sizing:border-box;}
.ct-deck-version-dialog h2{padding-right:32px;text-align:center;}
.ct-version-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin:16px 0;}
.ct-version-list{display:grid;gap:8px;}
.ct-version-list button{display:grid;gap:4px;text-align:left;min-height:64px;}
.ct-version-rows{padding:0;list-style:none;}
.ct-version-rows li{display:grid;grid-template-columns:3ch minmax(0,1fr) auto;gap:10px;padding:8px 0;border-bottom:1px solid #76847a55;overflow-wrap:anywhere;}
.ct-version-rows small{font-size:12px;max-width:14ch;}
@media(max-width:600px){#commander-table .ct-deck-management{display:grid;grid-template-columns:1fr 1fr;width:100%;}#commander-table .ct-deck-management button{min-height:44px;}.ct-deck-version-dialog{padding:16px;}}

/* AP08: compact, shared statistics; board layouts are unaffected. */
#commander-table .ct-evaluation{margin:24px 0;border:1px solid var(--ct-line);border-radius:16px;padding:16px;background:var(--ct-panel);}
#commander-table .ct-evaluation summary{cursor:pointer;min-height:36px;font-weight:650;}
#commander-table .ct-evaluation-controls{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;margin:12px 0;}
#commander-table .ct-evaluation-controls label{display:grid;gap:6px;min-width:0;}
#commander-table .ct-evaluation select,#commander-table .ct-evaluation input{width:100%;min-width:0;box-sizing:border-box;background:var(--ct-panel);color:var(--ct-ink);border:1px solid var(--ct-line);border-radius:10px;padding:10px;min-height:44px;font:inherit;}
#commander-table .ct-evaluation h3{text-align:center;}
#commander-table .ct-stat-basis{font-size:14px;line-height:1.5;color:var(--ct-muted);}
#commander-table .ct-evaluation-group ul{list-style:none;margin:0;padding:0;}
#commander-table .ct-evaluation-group li{display:flex;gap:10px;align-items:center;padding:12px 0;border-bottom:1px solid var(--ct-line);}
#commander-table .ct-evaluation-group li>div{flex:1;min-width:0;overflow-wrap:anywhere;}
#commander-table .ct-evaluation-group small{display:block;font-size:14px;line-height:1.5;margin-top:4px;}
#commander-table .ct-evaluation-group button{min-width:44px;min-height:44px;}
#commander-table .ct-match-links,.ct-match-games{display:grid;gap:10px;margin:16px 0;}
.ct-match-dialog{width:min(680px,calc(100vw - 32px));box-sizing:border-box;}
.ct-match-dialog h2{text-align:center;padding-right:24px;}
.ct-match-dialog form>label{display:grid;gap:8px;}
.ct-match-dialog select{max-width:100%;background:#202b25;color:#eef4ef;border:1px solid #76847a;border-radius:10px;padding:10px;min-height:44px;font:inherit;}
.ct-match-games label{display:flex;gap:12px;align-items:center;min-height:44px;}
.ct-match-games input{width:22px;height:22px;flex-shrink:0;}
@media(max-width:600px){#commander-table .ct-evaluation{padding:12px;}#commander-table .ct-evaluation-controls{grid-template-columns:1fr 1fr;gap:8px;}#commander-table .ct-evaluation select{font-size:14px;}.ct-match-dialog{padding:18px;}#commander-table .ct-evaluation-summary p{overflow-wrap:anywhere;}}
/* AP09/AP10: compact provenance and session editing controls; board layouts unchanged. */
#commander-table .ct-format-basis,#commander-table .ct-format-matrix{margin-block:1rem;border:1px solid var(--ct-line);border-radius:16px;padding:12px 16px;background:var(--ct-panel);overflow-wrap:anywhere}
#commander-table .ct-format-basis summary,#commander-table .ct-format-matrix summary{cursor:pointer;min-height:28px;line-height:1.5;font-weight:600}
#commander-table .ct-format-basis p,#commander-table .ct-format-matrix p{font-size:.9rem;line-height:1.5}
#commander-table .ct-format-basis a,#commander-table .ct-format-matrix a{color:var(--ct-ink);text-decoration:underline}
#commander-table .ct-format-matrix article{padding-block:12px;border-top:1px solid var(--ct-line)}
#commander-table .ct-format-matrix h3{text-align:left;margin:0;font-size:1rem}
#commander-table .ct-builder-history{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin-top:10px}
#commander-table .ct-builder-history button{min-height:44px;padding:8px 12px;font-size:.875rem;border-radius:12px}
@media(max-width:600px){#commander-table .ct-builder-history button{flex:1;min-width:0}#commander-table .ct-format-basis,#commander-table .ct-format-matrix{padding:12px}}
/* Deck search on phones: expand each filter beneath its own heading. */
#commander-table[data-device-view=smartphone] .ct-builder .ct-search-advanced{grid-template-columns:minmax(0,1fr);}
#commander-table[data-device-view=smartphone] .ct-builder .ct-search-filter-panel{order:0;}
#commander-table[data-device-view=smartphone] .ct-builder .ct-search-filter-tab{scroll-margin-top:calc(var(--ct-menu-safe-top,0px) + 16px);}

/* Keep browser scroll anchoring from fighting coordinated disclosure motion. */
html:has(.ct-disclosure-moving),.ct-disclosure-moving,.ct-disclosure-moving *{overflow-anchor:none;}
#commander-table [data-format-toggle] svg{transition:transform .4s ease;}
@media(prefers-reduced-motion:reduce){#commander-table [data-format-toggle] svg,#commander-table .ct-search-filter-tab>svg{transition:none;}}
/* Physical collection and explicit deck assignments. */
.ct-inventory-dialog{width:min(680px,calc(100vw - 24px));max-height:85dvh;overflow:auto;}
.ct-inventory summary,.ct-stock-tools>summary{cursor:pointer;padding:14px 0;min-height:44px;box-sizing:border-box;}
.ct-inventory summary strong,.ct-inventory summary span{display:block;}
.ct-inventory summary span,.ct-inventory small,.ct-inventory-note{font-size:13px;color:var(--ct-muted,#bdc7be);}
.ct-inventory-group{border-bottom:1px solid var(--ct-line,#435044);}
.ct-inventory form{display:flex;align-items:end;gap:10px;margin:12px 0;}
.ct-inventory form label{flex:1;min-width:0;}.ct-inventory small{display:block;margin:4px 0;}
.ct-inventory input{box-sizing:border-box;width:100%;min-height:44px;}
.ct-inventory button,.ct-stock-tools button{min-height:44px;}
.ct-stock-tools{margin-top:24px;}.ct-stock-actions{display:flex;flex-wrap:wrap;gap:10px;}
.ct-stock-import{display:flex;flex-direction:column;gap:6px;max-width:100%;}.ct-stock-import input{max-width:100%;}
.ct-stock-reservation{display:flex;justify-content:space-between;gap:10px;align-items:center;margin:12px 0;}
@media(min-width:701px){#commander-table .ct-builder-nav{grid-template-columns:repeat(6,minmax(0,1fr));}}
.ct-offline-page{max-width:760px;margin:auto;}.ct-offline-page header{display:grid;grid-template-columns:44px 1fr 44px;align-items:center;gap:10px;}.ct-offline-page h1{text-align:center;}
.ct-offline-card{background:var(--ct-panel,#202b25);border:1px solid var(--ct-line,#435044);border-radius:14px;padding:16px;margin:16px 0;}.ct-offline-card h2{margin:0 0 8px;text-align:center;}.ct-offline-card p{font-size:14px;line-height:1.5;}.ct-offline-card button{min-height:44px;margin:4px;}.ct-offline-note{font-size:13px;color:var(--ct-muted,#bdc7be);}
.ct-inventory h2{text-align:center;}.ct-inventory-group>summary{display:grid;grid-template-columns:14px minmax(0,1fr);gap:4px 8px;list-style:none;}.ct-inventory-group>summary::-webkit-details-marker{display:none;}.ct-inventory-group>summary::before{content:'›';grid-column:1;grid-row:1/3;align-self:center;font-size:22px;transition:transform .4s ease;}.ct-inventory-group[open]>summary::before{transform:rotate(90deg);}.ct-inventory-group>summary>strong,.ct-inventory-group>summary>span{grid-column:2;}
@media(max-width:700px){#commander-table .ct-builder-nav{grid-template-columns:repeat(3,minmax(0,1fr));}#commander-table #ct-lobby .ct-builder-nav button{padding:6px 3px;min-height:44px;}}
@media(max-width:350px){#commander-table #ct-lobby .ct-builder-nav button{font-size:11px;}}
@media(prefers-reduced-motion:reduce){.ct-inventory-group>summary::before{transition:none;}}

.ct-inventory-actions{display:flex;flex-wrap:wrap;gap:10px;margin:18px 0;} .ct-inventory-actions button{flex:1 1 180px;} .ct-inventory-dialog h2{text-align:center;} .ct-deck-delete-dialog select{box-sizing:border-box;width:100%;min-height:44px;margin:8px 0 18px;}
