.xlr8-heading-row:has(.xlr8-deck-launch):not(:has(.xlr8-break-launch)) {
  grid-template-columns: 30px minmax(0, 1fr) auto auto;
}

.xlr8-heading-row:has(.xlr8-deck-launch):has(.xlr8-break-launch) {
  grid-template-columns: 30px minmax(0, 1fr) auto auto auto;
}

.xlr8-deck-launch {
  height: 25px;
  padding: 0 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line) 55%);
  border-radius: 6px;
  background: color-mix(in srgb, var(--foreground) 84%, var(--accent) 16%);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .08em;
}

.xlr8-deck-launch:active,
.xlr8-deck-back:active,
.xlr8-deck-add:active,
.xlr8-deck-app:active {
  transform: scale(.97);
}

.xlr8-deck-shell {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  color: var(--body-text);
  font-family: var(--mono);
}

.xlr8-deck-header {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: calc(7px + env(safe-area-inset-top)) 9px 7px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 93%, var(--foreground) 7%);
}

.xlr8-deck-back,
.xlr8-deck-add {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--foreground);
  color: var(--accent);
}

.xlr8-deck-back {
  padding: 0 1px 2px 0;
  font-size: 23px;
  line-height: 1;
}

.xlr8-deck-add {
  font-size: 20px;
  line-height: 1;
}

.xlr8-deck-title {
  min-width: 0;
}

.xlr8-deck-title strong,
.xlr8-deck-title span {
  display: block;
}

.xlr8-deck-title strong {
  color: var(--accent);
  font-size: 15px;
  line-height: 1;
  letter-spacing: .05em;
}

.xlr8-deck-title span {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xlr8-deck-main {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 18px 12px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.xlr8-deck-grid {
  display: grid;
  grid-template-columns: repeat(6, 52px);
  grid-template-rows: repeat(6, 65px);
  grid-auto-rows: 65px;
  gap: 10px 8px;
  width: max-content;
  min-height: max-content;
  margin: auto;
}

.xlr8-deck-app {
  position: relative;
  display: flex;
  width: 52px;
  height: 65px;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  border: 0;
  appearance: none;
  background: transparent;
  color: var(--body-text);
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.xlr8-deck-app-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line) 70%);
  border-radius: 12px;
  background:
    radial-gradient(circle at 30% 22%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 54%),
    var(--foreground);
  box-shadow: 0 3px 13px #0007;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.xlr8-deck-grid.is-deck-reordering .xlr8-deck-app {
  user-select: none;
  -webkit-user-select: none;
}

.xlr8-deck-app.is-deck-reorder-source {
  opacity: .16;
  pointer-events: none;
}

.xlr8-deck-app.xlr8-deck-drop-target .xlr8-deck-app-icon {
  outline: 2px solid color-mix(in srgb, var(--special) 86%, white 14%);
  outline-offset: 2px;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--special) 24%, transparent),
    0 0 18px color-mix(in srgb, var(--special) 18%, transparent),
    0 3px 13px #0007;
}

.xlr8-deck-empty-slot {
  width: 52px;
  height: 65px;
  box-sizing: border-box;
  border: 1px dashed color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--foreground) 34%, transparent);
  opacity: .22;
  transition: opacity 110ms ease, border-color 110ms ease, background 110ms ease, box-shadow 110ms ease;
}

.xlr8-deck-empty-slot.xlr8-deck-drop-target {
  opacity: .72;
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--foreground));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--special) 24%, transparent), inset 0 0 18px color-mix(in srgb, var(--special) 10%, transparent);
}

.xlr8-deck-reorder-ghost {
  --drag-x: 0px;
  --drag-y: 0px;
  position: fixed !important;
  left: 0;
  top: 0;
  z-index: 9999;
  margin: 0;
  pointer-events: none;
  transform: translate3d(var(--drag-x), var(--drag-y), 0) scale(1.035);
  transform-origin: center;
  will-change: transform;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .5));
  opacity: .97;
}

.xlr8-deck-reorder-ghost .xlr8-deck-shortcut {
  display: none;
}

.xlr8-deck-app-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.xlr8-deck-app-icon strong {
  color: var(--accent);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -.05em;
}

.xlr8-deck-shortcut {
  position: absolute;
  z-index: 2;
  top: 31px;
  right: -1px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 58%, var(--line) 42%);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg) 88%, var(--accent) 12%);
  box-shadow: 0 2px 8px #000b;
  color: var(--accent);
  font: 900 7px/1 var(--mono);
  letter-spacing: .05em;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.xlr8-deck-shortcut:active {
  transform: scale(.9);
}

.xlr8-deck-shortcut[hidden] {
  display: none;
}

.xlr8-deck-app-label {
  display: -webkit-box;
  width: 52px;
  max-height: 16px;
  margin-top: 3px;
  overflow: hidden;
  color: #9a9a9a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 7.5px;
  font-weight: 620;
  line-height: 1.12;
  text-align: center;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.xlr8-deck-add-tile {
  grid-column: 2;
  grid-row: 2;
}

.xlr8-deck-add-tile .xlr8-deck-app-icon {
  border-style: dashed;
  box-shadow: none;
}

.xlr8-deck-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 25px;
  padding: 6px 9px calc(6px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 94%, var(--foreground) 6%);
  color: var(--muted);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .07em;
}

.xlr8-deck-footer strong {
  color: var(--accent);
  font-weight: 900;
}

.xlr8-deck-editor[hidden] {
  display: none;
}

.xlr8-deck-editor {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.xlr8-deck-editor-shade {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, .72);
  opacity: 0;
  transition: opacity 150ms ease;
}

.xlr8-deck-editor-sheet {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  max-height: min(88dvh, 720px);
  overflow: auto;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  border: 1px solid #292929;
  border-bottom: 0;
  border-radius: 15px 15px 0 0;
  background: var(--foreground);
  transform: translateY(18px);
  opacity: 0;
  transition: transform 150ms ease, opacity 150ms ease;
}

.xlr8-deck-editor.is-open .xlr8-deck-editor-shade {
  opacity: 1;
}

.xlr8-deck-editor.is-open .xlr8-deck-editor-sheet {
  transform: translateY(0);
  opacity: 1;
}

.xlr8-deck-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.xlr8-deck-editor-head > div {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.xlr8-deck-editor-head span {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: .13em;
}

.xlr8-deck-editor-head strong {
  color: var(--accent);
  font-size: 14px;
}

.xlr8-deck-editor-close {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #090909;
  color: #777;
  font-size: 24px;
  line-height: 1;
}

.xlr8-deck-editor-preview {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  margin: 2px auto 10px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line) 70%);
  border-radius: 21px;
  background: #090909;
  color: var(--accent);
}

.xlr8-deck-editor-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.xlr8-deck-editor-preview strong {
  font-size: 23px;
  letter-spacing: -.05em;
}

.xlr8-deck-field,
.xlr8-deck-file-picker {
  display: block;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #090909;
}

.xlr8-deck-field {
  padding: 8px;
}

.xlr8-deck-field span,
.xlr8-deck-file-picker span {
  display: block;
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 7.5px;
  font-weight: 900;
  letter-spacing: .12em;
}

.xlr8-deck-field input {
  width: 100%;
  height: 36px;
  padding: 0 8px;
  border: 1px solid #292929;
  border-radius: 7px;
  outline: none;
  background: #111;
  color: #ddd;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}

.xlr8-deck-file-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 7px;
}

.xlr8-deck-file-picker {
  min-width: 0;
  min-height: 64px;
  padding: 8px;
}

.xlr8-deck-file-picker strong,
.xlr8-deck-file-picker small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xlr8-deck-file-picker strong {
  color: #999;
  font-size: 9px;
  font-weight: 700;
}

.xlr8-deck-file-picker small {
  margin-top: 5px;
  color: #444;
  font-size: 6.5px;
}

.xlr8-deck-editor-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 7px;
  margin-top: 7px;
}

.xlr8-deck-editor-actions button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #090909;
  color: #666;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .08em;
}

.xlr8-deck-editor-actions .xlr8-deck-save {
  border-color: color-mix(in srgb, var(--accent) 56%, var(--line));
  color: var(--accent);
}

.xlr8-deck-editor-actions button:disabled {
  opacity: .35;
}

.xlr8-deck-editor-status {
  min-height: 12px;
  margin: 7px 1px 0;
  color: #555;
  font-size: 8px;
  line-height: 1.2;
}

@media (max-width: 360px) {
  .xlr8-deck-grid {
    grid-template-columns: repeat(6, 46px);
    grid-template-rows: repeat(6, 59px);
    grid-auto-rows: 59px;
    gap: 8px 6px;
  }

  .xlr8-deck-app,
  .xlr8-deck-empty-slot {
    width: 46px;
    height: 59px;
  }

  .xlr8-deck-app-icon {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    border-radius: 10px;
  }

  .xlr8-deck-shortcut {
    top: 27px;
    right: -1px;
  }

  .xlr8-deck-app-label {
    width: 46px;
    font-size: 7px;
  }
}


/* Excel Web stage */
.xlr8-deck-main{display:block;overflow-y:auto;overflow-x:hidden;padding:0;scroll-behavior:smooth}
.xlr8-deck-launchpad{display:grid;place-items:center;box-sizing:border-box;min-height:100%;padding:18px 12px}
.xlr8-deck-main.has-excel .xlr8-deck-launchpad{min-height:46dvh}
.xlr8-deck-grid{margin:0 auto}
.xlr8-deck-app{touch-action:manipulation;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.xlr8-deck-app *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.xlr8-deck-excel-stage[hidden]{display:none}
.xlr8-deck-excel-stage{display:flex;width:100%;height:100dvh;min-height:100dvh;flex-direction:column;border-top:1px solid color-mix(in srgb,var(--accent) 36%,var(--line));background:#fff}
.xlr8-deck-excel-head{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;flex:0 0 auto;min-height:38px;padding:5px 8px;border-bottom:1px solid var(--line);background:var(--foreground)}
.xlr8-deck-excel-head>div:first-child{min-width:0}
.xlr8-deck-excel-head strong,.xlr8-deck-excel-head span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.xlr8-deck-excel-head strong{color:var(--accent);font-size:9px;line-height:1.1}
.xlr8-deck-excel-head span{margin-top:2px;color:var(--muted);font-size:6.5px;letter-spacing:.06em}
.xlr8-deck-excel-actions{display:flex;align-items:center;gap:5px}
.xlr8-deck-excel-actions a,.xlr8-deck-excel-actions button{display:grid;place-items:center;height:27px;padding:0 7px;border:1px solid var(--line);border-radius:6px;background:#090909;color:var(--accent);font-family:var(--mono);font-size:7px;font-weight:900;text-decoration:none}
.xlr8-deck-excel-actions button{width:28px;padding:0;color:#777;font-size:18px}
.xlr8-deck-excel-frame-wrap{position:relative;flex:1 1 auto;min-width:0;min-height:0;overflow:hidden;background:#fff}
.xlr8-deck-excel-frame-wrap iframe{display:block;width:100%;height:100%;border:0;background:#fff}
.xlr8-deck-excel-loader{position:absolute;inset:0;z-index:1;display:grid;place-items:center;padding:18px;background:var(--bg);color:var(--accent);font-family:var(--mono);font-size:8px;font-weight:900;letter-spacing:.06em;text-align:center}
.xlr8-deck-excel-loader[hidden]{display:none}


.xlr8-deck-urlbar{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) 42px 34px;
  align-items:center;
  gap:5px;
  flex:0 0 auto;
  min-height:34px;
  padding:4px 6px;
  border-bottom:1px solid var(--line);
  background:color-mix(in srgb,var(--foreground) 94%,var(--accent) 6%);
}
.xlr8-deck-url-lock{
  display:grid;
  place-items:center;
  height:25px;
  padding:0 6px;
  border:1px solid var(--line);
  border-radius:5px;
  background:#090909;
  color:#666;
  font:700 7px/1 var(--mono);
  letter-spacing:.05em;
}
.xlr8-deck-urlbar input{
  min-width:0;
  width:100%;
  height:26px;
  padding:0 7px;
  border:1px solid #2a2a2a;
  border-radius:5px;
  outline:none;
  background:#0a0a0a;
  color:#9a9a9a;
  font:10px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
.xlr8-deck-urlbar input:focus{
  border-color:color-mix(in srgb,var(--accent) 58%,#2a2a2a);
  color:#c0c0c0;
}
.xlr8-deck-urlbar button{
  height:26px;
  padding:0;
  border:1px solid color-mix(in srgb,var(--accent) 48%,var(--line));
  border-radius:5px;
  background:#090909;
  color:var(--accent);
  font:900 7px/1 var(--mono);
  letter-spacing:.05em;
}

.xlr8-deck-excel-frame-wrap iframe.xlr8-deck-desktop-frame{
  position:absolute;
  top:0;
  left:0;
  max-width:none;
  max-height:none;
  margin:0;
  transform-origin:top left;
  will-change:transform;
}

.xlr8-deck-excel-frame-wrap.is-full-size{overflow:auto;-webkit-overflow-scrolling:touch}
.xlr8-deck-excel-frame-wrap.is-full-size iframe.xlr8-deck-desktop-frame{position:relative}
.xlr8-deck-excel-actions button[data-deck-excel-scale]{width:30px;font-size:8px;color:var(--accent)}


/* DECK local UI tuning */
.xlr8-deck-shell{
  --deck-icon-size:62px;
  --deck-cell-width:62px;
  --deck-cell-height:81px;
  --deck-gap:6px;
  --deck-margin:6px;
  --deck-top-margin:6px;
}
.xlr8-deck-header{
  grid-template-columns:32px minmax(0,1fr) 32px 32px;
}
.xlr8-deck-ui-button{
  width:32px;
  height:32px;
  padding:0;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--foreground);
  color:var(--accent);
  font:900 8px/1 var(--mono);
  letter-spacing:.05em;
}
.xlr8-deck-launchpad{
  box-sizing:border-box;
  min-width:max-content;
  padding:var(--deck-top-margin) var(--deck-margin) var(--deck-margin)!important;
}
.xlr8-deck-grid{
  gap:var(--deck-gap)!important;
}
.xlr8-deck-app,
.xlr8-deck-empty-slot{
  width:var(--deck-cell-width)!important;
  height:var(--deck-cell-height)!important;
}
.xlr8-deck-app-icon{
  width:var(--deck-icon-size)!important;
  height:var(--deck-icon-size)!important;
  flex-basis:var(--deck-icon-size)!important;
  border-radius:calc(var(--deck-icon-size) * .23)!important;
}
.xlr8-deck-app-label{
  width:var(--deck-cell-width)!important;
  font-size:clamp(7px,calc(var(--deck-icon-size) * .14),10px)!important;
}
.xlr8-deck-shortcut{
  top:calc(var(--deck-icon-size) - 15px)!important;
  right:-1px!important;
}
.xlr8-deck-main{
  overflow-x:auto!important;
}

.xlr8-deck-ui-panel[hidden]{display:none}
.xlr8-deck-ui-panel{
  position:fixed;
  inset:0;
  z-index:80;
  display:flex;
  align-items:flex-end;
  justify-content:center;
}
.xlr8-deck-ui-shade{
  position:absolute;
  inset:0;
  border:0;
  background:#000b;
  opacity:0;
  transition:opacity 140ms ease;
}
.xlr8-deck-ui-sheet{
  position:relative;
  z-index:1;
  width:min(100%,520px);
  padding:11px 11px calc(11px + env(safe-area-inset-bottom));
  border:1px solid #292929;
  border-bottom:0;
  border-radius:14px 14px 0 0;
  background:var(--foreground);
  transform:translateY(14px);
  opacity:0;
  transition:transform 140ms ease,opacity 140ms ease;
}
.xlr8-deck-ui-panel.is-open .xlr8-deck-ui-shade{opacity:1}
.xlr8-deck-ui-panel.is-open .xlr8-deck-ui-sheet{transform:translateY(0);opacity:1}
.xlr8-deck-ui-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:8px;
}
.xlr8-deck-ui-head>div{display:flex;align-items:baseline;gap:7px}
.xlr8-deck-ui-head span{color:var(--muted);font-size:8px;letter-spacing:.12em}
.xlr8-deck-ui-head strong{color:var(--accent);font-size:14px}
.xlr8-deck-ui-head button{
  width:30px;height:30px;padding:0;border:1px solid var(--line);border-radius:8px;
  background:#090909;color:#777;font-size:20px;line-height:1;
}
.xlr8-deck-ui-controls{display:grid;gap:5px}
.xlr8-deck-ui-controls label{
  display:grid;
  grid-template-columns:72px minmax(0,1fr) 42px;
  align-items:center;
  gap:7px;
  min-height:31px;
  padding:4px 7px;
  border:1px solid var(--line);
  border-radius:7px;
  background:#090909;
}
.xlr8-deck-ui-controls span{
  color:#777;
  font-size:7px;
  font-weight:900;
  letter-spacing:.08em;
}
.xlr8-deck-ui-controls input{width:100%;accent-color:var(--accent)}
.xlr8-deck-ui-controls output{
  color:var(--accent);
  font-size:8px;
  font-weight:900;
  text-align:right;
}
.xlr8-deck-ui-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:6px;
  margin-top:7px;
}
.xlr8-deck-ui-actions button{
  min-height:34px;
  border:1px solid var(--line);
  border-radius:7px;
  background:#090909;
  color:#666;
  font:900 8px/1 var(--mono);
}
.xlr8-deck-ui-actions button:last-child{
  border-color:color-mix(in srgb,var(--accent) 54%,var(--line));
  color:var(--accent);
}
.xlr8-deck-ui-sheet>p{
  min-height:10px;
  margin:6px 1px 0;
  color:#555;
  font-size:7px;
}


/* DECK drag ghost sizing + icon cropper */
.xlr8-deck-reorder-ghost{
  width:var(--deck-cell-width)!important;
  height:var(--deck-cell-height)!important;
}
.xlr8-deck-reorder-ghost .xlr8-deck-app-icon{
  width:var(--deck-icon-size)!important;
  height:var(--deck-icon-size)!important;
  flex-basis:var(--deck-icon-size)!important;
}

.xlr8-deck-cropper[hidden]{display:none}
.xlr8-deck-cropper{
  position:fixed;
  inset:0;
  z-index:90;
  display:flex;
  align-items:flex-end;
  justify-content:center;
}
.xlr8-deck-cropper-shade{
  position:absolute;
  inset:0;
  border:0;
  background:#000c;
  opacity:0;
  transition:opacity 140ms ease;
}
.xlr8-deck-cropper-sheet{
  position:relative;
  z-index:1;
  width:min(100%,520px);
  padding:12px 12px calc(12px + env(safe-area-inset-bottom));
  border:1px solid #292929;
  border-bottom:0;
  border-radius:15px 15px 0 0;
  background:var(--foreground);
  transform:translateY(14px);
  opacity:0;
  transition:transform 140ms ease,opacity 140ms ease;
}
.xlr8-deck-cropper.is-open .xlr8-deck-cropper-shade{opacity:1}
.xlr8-deck-cropper.is-open .xlr8-deck-cropper-sheet{transform:translateY(0);opacity:1}
.xlr8-deck-cropper-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:10px;
}
.xlr8-deck-cropper-head>div{display:flex;align-items:baseline;gap:7px}
.xlr8-deck-cropper-head span{color:var(--muted);font-size:8px;letter-spacing:.12em}
.xlr8-deck-cropper-head strong{color:var(--accent);font-size:14px}
.xlr8-deck-cropper-head button{
  width:30px;
  height:30px;
  padding:0;
  border:1px solid var(--line);
  border-radius:8px;
  background:#090909;
  color:#777;
  font-size:20px;
  line-height:1;
}
.xlr8-deck-crop-box{
  position:relative;
  width:min(78vw,320px);
  aspect-ratio:1;
  margin:0 auto 10px;
  overflow:hidden;
  border:1px solid color-mix(in srgb,var(--accent) 38%,var(--line));
  border-radius:18px;
  background:#070707;
  touch-action:none;
  user-select:none;
  -webkit-user-select:none;
  -webkit-touch-callout:none;
}
.xlr8-deck-crop-box img{
  position:absolute;
  transform:translate(-50%,-50%);
  max-width:none;
  max-height:none;
  object-fit:fill;
  pointer-events:none;
  user-select:none;
  -webkit-user-drag:none;
}
.xlr8-deck-crop-frame{
  position:absolute;
  inset:0;
  pointer-events:none;
  border-radius:inherit;
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 62%,transparent), inset 0 0 28px #0005;
}
.xlr8-deck-crop-zoom{
  display:grid;
  grid-template-columns:46px minmax(0,1fr) 44px;
  align-items:center;
  gap:7px;
  padding:6px 7px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#090909;
}
.xlr8-deck-crop-zoom span{
  color:#777;
  font:900 7px/1 var(--mono);
  letter-spacing:.08em;
}
.xlr8-deck-crop-zoom input{width:100%;accent-color:var(--accent)}
.xlr8-deck-crop-zoom output{
  color:var(--accent);
  font:900 8px/1 var(--mono);
  text-align:right;
}
.xlr8-deck-crop-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:7px;
  margin-top:8px;
}
.xlr8-deck-crop-actions button{
  min-height:38px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#090909;
  color:#666;
  font:900 8px/1 var(--mono);
}
.xlr8-deck-crop-actions button:last-child{
  border-color:color-mix(in srgb,var(--accent) 58%,var(--line));
  color:var(--accent);
}


/* DECK grid alignment refinement */
.xlr8-deck-launchpad{
  place-items:start center!important;
  align-content:start!important;
  justify-content:center!important;
}


/* DECK add-type chooser */
.xlr8-deck-add-menu[hidden]{display:none}
.xlr8-deck-add-menu{
  position:fixed;inset:0;z-index:86;display:flex;align-items:flex-end;justify-content:center;
}
.xlr8-deck-add-menu-shade{
  position:absolute;inset:0;border:0;background:#000b;opacity:0;transition:opacity 140ms ease;
}
.xlr8-deck-add-menu-sheet{
  position:relative;z-index:1;width:min(100%,520px);
  padding:12px 12px calc(12px + env(safe-area-inset-bottom));
  border:1px solid #292929;border-bottom:0;border-radius:15px 15px 0 0;
  background:var(--foreground);transform:translateY(14px);opacity:0;
  transition:transform 140ms ease,opacity 140ms ease;
}
.xlr8-deck-add-menu.is-open .xlr8-deck-add-menu-shade{opacity:1}
.xlr8-deck-add-menu.is-open .xlr8-deck-add-menu-sheet{transform:translateY(0);opacity:1}
.xlr8-deck-add-menu-head{
  display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px;
}
.xlr8-deck-add-menu-head>div{display:flex;align-items:baseline;gap:7px}
.xlr8-deck-add-menu-head span{color:var(--muted);font-size:8px;letter-spacing:.12em}
.xlr8-deck-add-menu-head strong{color:var(--accent);font-size:14px}
.xlr8-deck-add-menu-head>button{
  width:30px;height:30px;padding:0;border:1px solid var(--line);border-radius:8px;
  background:#090909;color:#777;font-size:20px;line-height:1;
}
.xlr8-deck-add-options{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.xlr8-deck-add-options>button{
  display:grid;grid-template-columns:40px minmax(0,1fr);grid-template-rows:auto auto;
  align-items:center;column-gap:9px;min-height:72px;padding:9px;
  border:1px solid var(--line);border-radius:10px;background:#090909;color:#888;text-align:left;
}
.xlr8-deck-add-options>button>strong{
  grid-row:1 / 3;display:grid;place-items:center;width:40px;height:40px;
  border:1px solid color-mix(in srgb,var(--accent) 48%,var(--line));border-radius:10px;
  color:var(--accent);font:900 13px/1 var(--mono);
}
.xlr8-deck-add-options>button>span{
  color:var(--accent);font:900 9px/1 var(--mono);letter-spacing:.06em;
}
.xlr8-deck-add-options>button>small{
  margin-top:5px;color:#555;font:7px/1.2 var(--mono);
}


/* DECK edit/delete + empty-slot add */
.xlr8-deck-editor-actions{
  grid-template-columns:auto 1fr 1fr;
}
.xlr8-deck-delete{
  border-color:#5a1d2d!important;
  color:#a84b68!important;
}
.xlr8-deck-delete:disabled{
  opacity:.45;
}
.xlr8-deck-empty-slot{
  touch-action:manipulation;
  -webkit-user-select:none;
  user-select:none;
  -webkit-touch-callout:none;
}
.xlr8-deck-empty-slot:active{
  opacity:.48;
}


/* DECK badge chooser */
.xlr8-deck-badge-field{
  display:grid;
  gap:5px;
}
.xlr8-deck-badge-field>span{
  color:#777;
  font:900 7px/1 var(--mono);
  letter-spacing:.08em;
}
.xlr8-deck-badge-options{
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:5px;
}
.xlr8-deck-badge-options button{
  min-height:30px;
  padding:0 4px;
  border:1px solid var(--line);
  border-radius:7px;
  background:#090909;
  color:#666;
  font:900 8px/1 var(--mono);
}
.xlr8-deck-badge-options button.is-active{
  border-color:color-mix(in srgb,var(--accent) 64%,var(--line));
  color:var(--accent);
  background:color-mix(in srgb,var(--accent) 8%,#090909);
}


/* DECK is a full inline Home section; standalone XLR8R DECK retains its
   full-screen overlay. Scope every override to the Home instance. */
.xlr8-deck-shell.is-home-embedded {
  position: relative;
  inset: auto;
  z-index: auto;
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 0;
  overflow: visible;
  flex: none;
}
.xlr8-deck-shell.is-home-embedded .xlr8-deck-header {
  grid-template-columns: minmax(0,1fr) 32px 32px;
  padding: 7px 9px;
}
.xlr8-deck-shell.is-home-embedded .xlr8-deck-back { display: none; }
.xlr8-deck-shell.is-home-embedded .xlr8-deck-main {
  display: block;
  flex: none;
  width: 100%;
  min-height: 0;
  overflow: visible !important;
}
.xlr8-deck-shell.is-home-embedded .xlr8-deck-launchpad,
.xlr8-deck-shell.is-home-embedded .xlr8-deck-main.has-excel .xlr8-deck-launchpad {
  display: grid;
  justify-content: safe center !important;
  align-content: start !important;
  place-items: start center !important;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: var(--deck-top-margin) var(--deck-margin) var(--deck-margin) !important;
  -webkit-overflow-scrolling: touch;
}
.xlr8-deck-shell.is-home-embedded .xlr8-deck-grid { width: max-content; margin: 0 auto; }
.xlr8-deck-shell.is-home-embedded .xlr8-deck-footer { padding-bottom: 7px; }
.xlr8-deck-shell.is-home-embedded .xlr8-deck-excel-stage {
  height: 78dvh;
  min-height: 68dvh;
}
