.deck-page button, .deck-page input, .deck-page select, .deck-page textarea, :is(#deck-detail, #deck-gallery) button {
  min-height: 44px;
  color: inherit;
  font: inherit;
}
.deck-page input, .deck-page select, .deck-page textarea, .deck-page button:not(.release-primary), :is(#deck-detail, #deck-gallery) button {
  padding: .45rem .55rem;
  border: 1px solid var(--release-line);
  border-radius: 6px;
  background: #122334;
}
.deck-page button:disabled { opacity: .48; }
.deck-page button:not(:disabled), .deck-page summary { cursor: pointer; }
.deck-saved, .deck-actions, .deck-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem .7rem;
}
.deck-saved select { max-width: 100%; }
.deck-presets {
  margin-block: 1rem;
  padding: clamp(.75rem, 2vw, 1rem);
  border: 1px solid var(--release-line);
  border-radius: 12px;
  background: #0c1825;
}
#deck-preset-description { margin: .5rem 0 0; color: var(--release-muted); }
.deck-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 34%);
  align-items: start;
  gap: 1rem;
  margin-top: 1rem;
}
.deck-current, .deck-catalog {
  padding: clamp(.75rem, 2vw, 1.25rem);
  border: 1px solid var(--release-line);
  border-radius: 12px;
  background: #0c1825;
}
.deck-current { grid-column: 2; grid-row: 1; position: sticky; top: .65rem; }
.deck-catalog { grid-column: 1; grid-row: 1; }
.deck-heading { justify-content: space-between; }
.deck-heading h2, .deck-catalog h2 { margin: 0 0 .45rem; font-size: 1.2rem; }
#deck-count { color: #ffdda2; font-weight: 800; font-size: 1.12rem; }
.deck-current input, .deck-recipes textarea { display: block; width: 100%; }
#deck-summary, #deck-issue { margin-block: .5rem; color: var(--release-muted); }
.deck-selected {
  display: grid;
  gap: .35rem;
  max-height: 32vh;
  overflow: auto;
  padding: 0;
  list-style: none;
}
.deck-selected li { display: flex; justify-content: space-between; align-items: center; gap: .35rem; }
.deck-selected li span { overflow-wrap: anywhere; }
.deck-recipes label { display: block; margin-top: .5rem; }
.deck-recipes textarea { margin: .3rem 0 .5rem; resize: vertical; }
.deck-filters, #deck-ranges { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .55rem; }
.deck-filters label, #deck-ranges label { display: grid; gap: .15rem; min-width: 0; }
.deck-filters input, .deck-filters select { max-width: 100%; }
#deck-ranges { padding-block: .4rem; }
#deck-ranges fieldset { display: flex; gap: .35rem; margin: 0; border: 1px solid var(--release-line); }
#deck-ranges input { width: 4.6rem; }
#deck-filters [type="reset"] { margin-top: .5rem; }
.deck-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(115px, 100%), 1fr)); gap: .55rem; }
.deck-card { min-width: 0; display: grid; grid-template-rows: 1fr auto; gap: .25rem; }
.deck-card-info { display: flex; flex-direction: column; align-items: stretch; gap: .25rem; text-align: start; }
.deck-card-image { position: relative; }
.deck-card img { width: 100%; height: auto; aspect-ratio: 5 / 7; object-fit: contain; }
.deck-card-image img { display: block; }
.deck-card span { font-size: .85rem; overflow-wrap: anywhere; }
.deck-copy-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.deck-page .deck-copy-controls button:not(.release-primary) {
  padding: 0;
  color: #b9e4ff;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
}
.deck-copy-controls button:not(:disabled):hover { border-color: var(--release-blue); }
:is(#deck-detail, #deck-gallery) {
  width: min(620px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  background: #0c1825;
  color: #eef6ff;
  border: 1px solid var(--release-line);
  border-radius: 12px;
}
:is(#deck-detail, #deck-gallery)::backdrop { background: #02070bd9; }
#deck-detail-body img { max-width: min(190px, 100%); height: auto; }
#deck-gallery { width: min(860px, calc(100% - 20px)); padding-block-start: 0; }
.deck-gallery-header {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: .75rem;
  padding: .75rem 0;
  background: #0c1825;
  border-bottom: 1px solid var(--release-line);
}
.deck-gallery-header h2 { margin: 0; font-size: 1.2rem; overflow-wrap: anywhere; }
#deck-gallery-total { margin: .2rem 0 0; color: #ffdda2; }
.deck-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100px, 100%), 1fr));
  gap: .5rem;
  padding: 0;
  list-style: none;
}
.deck-gallery-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  width: 100%;
  height: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: start;
  line-height: 1.4;
}
.deck-gallery-card img { width: 100%; height: auto; aspect-ratio: 5 / 7; object-fit: contain; }
button.deck-gallery-card { cursor: pointer; }
.deck-gallery-copies {
  position: absolute;
  inset: .45rem .45rem auto auto;
  padding: .12rem .4rem;
  color: #111923;
  background: #ffdda2;
  border-radius: 5px;
  font-weight: 800;
}
.deck-gallery-card:not(:has(img)) .deck-gallery-copies { position: static; align-self: start; }
.deck-dock { display: none; }
@media (max-width: 750px) {
  .deck-workspace { grid-template-columns: minmax(0, 1fr); }
  .deck-current, .deck-catalog { grid-column: 1; grid-row: auto; position: static; }
  .deck-cards { grid-template-columns: repeat(auto-fill, minmax(min(96px, 100%), 1fr)); }
  .deck-page { padding-bottom: 4.5rem; }
  .deck-dock {
    position: fixed;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    inset-inline: .75rem;
    bottom: max(.5rem, env(safe-area-inset-bottom));
    padding: .5rem .75rem;
    border: 1px solid var(--release-blue);
    border-radius: 8px;
    background: #122334;
  }
  #deck-dock-count { color: #ffdda2; font-weight: 800; }
}
