.deck-page-heading{display:flex;align-items:center;justify-content:space-between;gap:24px;margin:22px 0 12px}.deck-page-heading h1{font-size:clamp(26px,3vw,36px);letter-spacing:-.04em;margin:4px 0 10px;line-height:1.2}.deck-eyebrow{font-size:10px;letter-spacing:.2em;font-weight:700;color:var(--accent);margin:0}.deck-muted{color:var(--muted);font-size:13px;line-height:1.6}.deck-actions{display:flex;gap:9px;align-items:center;flex-wrap:wrap}.deck-save-status{font-size:12px;color:var(--muted);margin:8px 0 22px}.deck-save-status:before{content:'●';font-size:8px;color:var(--accent);margin-right:7px}.deck-save-status.has-error,.deck-form-error{color:var(--danger,#a64038)}.deck-save-status.has-error:before{color:var(--danger,#a64038)}.deck-library-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(265px,1fr));gap:20px}.deck-tile{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius,12px);overflow:hidden;transition:transform .18s,box-shadow .18s}.deck-tile:hover{transform:translateY(-3px);box-shadow:0 10px 22px #153d2910}.deck-tile-art{height:110px;background:linear-gradient(120deg,#304d40,#7c8b66);position:relative;overflow:hidden;color:#d4dec6;display:flex;align-items:center;justify-content:center;font-size:48px}.deck-tile-art img{width:100%;height:100%;object-fit:cover;object-position:center 28%;opacity:.72}.deck-tile-body{padding:20px}.deck-title-button{padding:0;border:0;background:none;color:var(--ink,var(--text));font:inherit;font-size:20px;font-weight:700;text-align:left;cursor:pointer;word-break:break-word}.deck-title-button:hover,.deck-card-link:hover{text-decoration:underline;text-underline-offset:4px}.deck-tile-body p{margin:8px 0}.deck-tile-count{font-size:12px;color:var(--accent);font-weight:600}.deck-tile-footer{display:flex;justify-content:space-between;align-items:center;border-top:1px solid var(--line);padding-top:14px;margin-top:18px}.deck-tile-footer>span{font-size:11px}.deck-clamp{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.deck-empty{padding:65px 25px;text-align:center;border:1px dashed #bcc9b8;border-radius:var(--radius,12px);background:var(--surface);margin:20px 0}.deck-empty h2{font-size:23px}.deck-empty .deck-muted{max-width:450px;margin:12px auto 24px}.deck-empty-mark{color:var(--accent);font-size:48px}.deck-empty-small{padding:30px 20px}.deck-storage-note{font-size:12px;color:var(--muted);margin:30px 0;line-height:1.7}.deck-trash{border:1px solid var(--line);border-radius:10px;padding:16px;margin-top:24px;font-size:13px}.deck-trash summary,.deck-metadata summary,.deck-checks summary,.deck-entry-details summary{cursor:pointer;min-height:24px}.deck-trash-row{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-top:10px}.deck-metadata{border:1px solid var(--line);border-radius:10px;padding:16px;background:var(--surface);font-size:13px}.deck-metadata[open]>summary{margin-bottom:18px}.deck-field{display:flex;flex-direction:column;gap:7px;margin:0 0 15px;font-size:12px;color:var(--muted)}.deck-input{font:inherit;color:var(--ink,var(--text));background:var(--surface);border:1px solid var(--line);border-radius:7px;min-height:40px;padding:9px 11px;width:100%;box-sizing:border-box;transition:border-color .15s}.deck-input:focus{outline:2px solid #346b4930;outline-offset:1px;border-color:var(--accent)}textarea.deck-input{resize:vertical;line-height:1.6}.deck-input[type=checkbox]{min-height:18px;width:18px;accent-color:var(--accent)}.deck-stats{display:grid;grid-template-columns:repeat(4,1fr);border:1px solid var(--line);border-radius:10px;background:var(--surface);margin:20px 0}.deck-stats>div{display:flex;flex-direction:column;gap:8px;padding:21px 24px;border-right:1px solid var(--line)}.deck-stats>div:last-child{border:0}.deck-stats strong{font-size:23px;font-weight:600;letter-spacing:-.04em;color:var(--accent)}.deck-stats span{color:var(--muted);font-size:11px}.deck-checks{border:1px solid var(--line);border-radius:9px;padding:15px 18px;font-size:13px;background:#eaf0e5;margin-bottom:24px}.deck-checks.has-issues{background:#f4efe2;border-color:#e3d9be}.deck-checks ul{padding-left:22px;line-height:1.8;margin:14px 0}.deck-check-error{color:#84502f}.deck-check-warning{color:#71674e}.deck-add-section{padding:20px;background:var(--surface);border:1px solid var(--line);border-radius:10px;margin:24px 0}.deck-add-section h2,.deck-list-heading h2{font-size:17px;margin:0 0 14px}.deck-add-form{display:flex;gap:10px}.deck-add-form>.deck-input{flex:1;min-width:0}.deck-add-form .button{white-space:nowrap}.deck-add-results{max-height:350px;overflow:auto}.deck-search-result{display:flex;justify-content:space-between;align-items:center;gap:14px;border-top:1px solid var(--line);padding:12px 0}.deck-search-result:first-child{margin-top:14px}.deck-search-result small{display:block}.deck-list-heading{display:flex;justify-content:space-between;align-items:center;margin:30px 0 20px;gap:20px}.deck-list-heading h2{margin:0}.deck-list-heading select{width:175px}.deck-zone{margin:25px 0}.deck-zone-title{font-size:17px;border-bottom:2px solid var(--ink,var(--text));padding-bottom:11px}.deck-group-title{font-size:12px;letter-spacing:.04em;color:var(--muted);margin:20px 0 9px;font-weight:500}.deck-entry{border:1px solid var(--line);background:var(--surface);border-radius:8px;overflow:hidden;margin-bottom:7px}.deck-entry-main{display:grid;grid-template-columns:minmax(170px,1fr) 68px 90px 160px 62px;gap:10px;align-items:center;padding:12px 14px}.deck-entry-title{min-width:0}.deck-entry-title small{display:block;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:4px}.deck-card-link{border:0;padding:0;background:none;font:inherit;font-size:13px;font-weight:600;color:var(--ink,var(--text));text-align:left;cursor:pointer;line-height:1.5}.deck-entry-main .deck-input{min-height:36px;font-size:11px;padding:7px}.deck-entry-details{font-size:11px;color:var(--muted);padding:0 14px 7px}.deck-entry-details summary{min-height:20px}.deck-entry-details[open]{padding-bottom:15px}.deck-entry-details[open] summary{margin-bottom:12px}.deck-entry-details .deck-field{max-width:700px}.deck-danger{color:var(--danger,#a64038);border:1px solid #cfb6ae;background:transparent;min-height:38px;border-radius:7px;padding:8px 14px;font:inherit;font-size:12px;cursor:pointer}.deck-danger:hover{background:#a6403810}.deck-modal-overlay{position:fixed;inset:0;z-index:1200;background:#12261db3;backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;padding:24px;overflow:auto;box-sizing:border-box}.deck-modal{width:460px;max-width:100%;max-height:90dvh;overflow:auto;background:var(--surface,#fffefa);color:var(--ink,var(--text,#253b33));border-radius:14px;padding:25px;box-sizing:border-box;box-shadow:0 30px 90px #0004}.deck-modal-wide{width:800px}.deck-modal-header{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:22px}.deck-modal h2{font-size:22px;letter-spacing:-.02em;margin:0}.deck-modal h3{font-size:15px}.deck-stack{display:flex;flex-direction:column;gap:4px}.deck-form-error{font-size:12px;line-height:1.7;padding:10px;background:#a640380c;border-radius:6px;overflow-wrap:anywhere}.deck-code{font-family:ui-monospace,Consolas,monospace;font-size:12px;tab-size:2}.deck-modal textarea{margin-bottom:17px}.deck-import-preview{margin-top:22px}.deck-import-row{padding:12px;border:1px solid var(--line);border-radius:8px;margin-bottom:9px;background:var(--bg)}.deck-import-row.has-error{border-color:#ca9988}.deck-import-row-heading{display:flex;justify-content:space-between;gap:12px;font-size:11px;margin-bottom:9px;line-height:1.5}.deck-import-row-heading span{color:var(--muted)}.deck-import-row .deck-actions{margin-top:9px}.deck-import-row .button{font-size:11px;min-height:32px}.deck-check-label{display:flex;align-items:center;gap:7px;font-size:11px;cursor:pointer}.deck-import-row .deck-input{font-size:11px}.deck-modal button:disabled{opacity:.4;cursor:not-allowed}.deck-modal :focus-visible,.deck-title-button:focus-visible,.deck-card-link:focus-visible{outline:2px solid var(--accent);outline-offset:3px}.deck-modal [hidden],#deck-view [hidden]{display:none!important}
@media(max-width:850px){.deck-entry-main{grid-template-columns:minmax(145px,1fr) 64px 88px 125px}.deck-entry-main>.button:last-child{grid-column:4;justify-self:end;padding:3px 8px;min-height:28px}.deck-entry-main .deck-entry-title{grid-row:span 2}.deck-page-heading{align-items:flex-start}.deck-page-heading>.deck-actions{justify-content:flex-end;max-width:240px}.deck-stats>div{padding:18px}.deck-stats strong{font-size:20px}}
@media(max-width:600px){.deck-page-heading{flex-direction:column;gap:10px}.deck-page-heading>.deck-actions{justify-content:flex-start;max-width:100%}.deck-page-heading h1{font-size:29px}.deck-library-grid{grid-template-columns:1fr}.deck-stats{grid-template-columns:repeat(2,1fr)}.deck-stats>div:nth-child(2){border-right:0}.deck-stats>div:nth-child(-n+2){border-bottom:1px solid var(--line)}.deck-stats>div{padding:18px}.deck-entry-main{grid-template-columns:60px 1fr 1fr;gap:9px;padding:13px}.deck-entry-main .deck-entry-title{grid-column:1/-1;grid-row:auto}.deck-entry-main .deck-entry-title small{white-space:normal}.deck-entry-main>select:nth-of-type(2){grid-column:2/3}.deck-entry-main>.button:last-child{grid-column:3;justify-self:end}.deck-entry-main>.deck-input{min-height:40px}.deck-entry-details{padding-left:13px}.deck-add-section{padding:15px}.deck-add-form{flex-wrap:wrap}.deck-add-form>.deck-input{flex:1 1 100%}.deck-add-form>.button{width:100%}.deck-modal-overlay{padding:12px}.deck-modal{padding:20px;max-height:94dvh}.deck-modal-header h2{font-size:19px}.deck-modal .button,.deck-modal .deck-danger{min-height:40px}.deck-modal .deck-input{font-size:16px}.deck-modal .deck-code{font-size:13px}.deck-import-row-heading{flex-direction:column;gap:4px}.deck-list-heading select{width:152px}.deck-storage-note{font-size:11px}.deck-empty{padding:40px 18px}}
.deck-recovery{padding:20px;border:1px solid #ca9988;border-radius:10px;background:#f8eee6;margin:18px 0}.deck-recovery>.button{margin-right:10px;margin-bottom:5px}.deck-recovery strong{font-size:14px}

.deck-add-form{display:grid;grid-template-columns:minmax(0,1fr) auto}
.deck-sync-status{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.deck-sync-status .deck-save-status{margin-block:3px}
.deck-sync-status .button{min-height:28px;padding:4px 8px;font-size:12px}

.deck-search-result > .deck-candidate-drag {
  flex: 1;
  min-width: 0;
  cursor: grab;
  user-select: none;
}

.deck-candidate-drag.is-drag-source,
.deck-candidate-drag.is-drag-source .deck-card-link {
  cursor: grabbing;
}

.deck-search-result > :is(.deck-candidate-add, .deck-candidate-added) {
  flex: 0 0 auto;
  margin-inline-start: auto;
  white-space: nowrap;
}

.deck-search-result > .deck-candidate-add {
  min-width: 36px;
  min-height: 34px;
}

.deck-candidate-added {
  color: var(--muted);
  font-size: 12px;
  padding-inline: 5px;
}
@media(max-width:700px){.deck-add-form{grid-template-columns:minmax(0,1fr) auto;align-items:start}.deck-add-form .button{font-size:11px;padding:9px 10px}}

/* Keep the workshop usable with touch controls and a narrow on-screen keyboard. */
@media(max-width:700px){
  #deck-view{min-width:0;overflow-wrap:anywhere;padding:18px max(12px,env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left))}
  #deck-view .button,#deck-view .deck-danger,.deck-modal .button,.deck-modal .deck-danger{min-height:44px;font-size:13px}
  #deck-view .deck-input:not([type=checkbox]),.deck-modal .deck-input:not([type=checkbox]){min-height:44px;min-width:0;font-size:16px}
  #deck-view textarea.deck-input,.deck-modal textarea.deck-input{line-height:1.6}
  #deck-view .deck-card-link,.deck-title-button{min-height:44px;display:inline-flex;align-items:center;max-width:100%;overflow-wrap:anywhere}
  #deck-view .deck-card-link{font-size:14px}
  .deck-page-heading{flex-direction:column;align-items:stretch;gap:12px;margin-top:20px}
  .deck-page-heading>div{min-width:0}
  .deck-page-heading h1{font-size:28px;overflow-wrap:anywhere}
  .deck-page-heading>.deck-actions{justify-content:flex-start;max-width:none;width:100%;gap:8px}
  .deck-page-heading>.deck-actions>.button{flex:1 1 auto;padding:9px 10px}
  .deck-page-heading>.deck-actions>.button-primary:first-child{flex-basis:100%}
  .deck-save-status{line-height:1.7;margin-bottom:20px}
  .deck-library-grid{grid-template-columns:minmax(0,1fr);gap:16px}
  .deck-tile-body{padding:18px;min-width:0;overflow-wrap:anywhere}
  .deck-tile-footer{gap:12px}
  .deck-tile-footer>.button{flex-shrink:0}
  .deck-trash-row{align-items:flex-start;gap:10px}
  .deck-trash-row>span{min-width:0;align-self:center;overflow-wrap:anywhere}
  .deck-trash-row>.button{flex-shrink:0}
  .deck-trash summary,.deck-metadata summary,.deck-checks summary,.deck-entry-details summary{min-height:44px;padding-top:10px;padding-bottom:10px;line-height:24px;overflow-wrap:anywhere}
  .deck-metadata,.deck-checks{padding:12px 15px}
  .deck-metadata[open]>summary{margin-bottom:12px}
  .deck-stats{grid-template-columns:repeat(2,minmax(0,1fr));margin:18px 0}
  .deck-stats>div{min-width:0;padding:17px 15px}
  .deck-stats>div:nth-child(2){border-right:0}
  .deck-stats>div:nth-child(-n+2){border-bottom:1px solid var(--line)}
  .deck-stats strong{font-size:21px;overflow-wrap:anywhere}
  .deck-add-section{padding:15px}
  .deck-add-form{grid-template-columns:minmax(0,1fr);gap:8px}
  .deck-add-form>.deck-input{width:100%}
  #deck-view .deck-add-form>.button{justify-self:end;width:auto;padding:9px 12px;font-size:13px}
  .deck-check-label{min-height:44px;font-size:13px;line-height:1.6;gap:10px}
  .deck-check-label .deck-input[type=checkbox]{flex:0 0 18px;margin:0}
  .deck-add-section>.deck-muted{font-size:12px}
  .deck-add-results{max-height:350px;overscroll-behavior:contain}
  .deck-search-result{gap:10px;align-items:center}
  .deck-search-result>div{flex:1;min-width:0;overflow-wrap:anywhere}
  .deck-search-result small{font-size:11px;overflow-wrap:anywhere}
  .deck-search-result>.button{flex:0 0 auto;white-space:nowrap;padding:9px 10px}
  .deck-list-heading{gap:12px;align-items:center}
  .deck-list-heading h2{font-size:17px;min-width:0}
  .deck-list-heading select{width:55%;max-width:190px}
  .deck-entry-main{grid-template-columns:64px minmax(0,1fr) 64px;gap:8px;padding:12px}
  .deck-entry-main .deck-entry-title{grid-column:1/-1;grid-row:1;min-width:0}
  .deck-entry-main .deck-entry-title small{white-space:normal;font-size:11px;overflow-wrap:anywhere}
  .deck-entry-main>input[type=number]{grid-column:1;grid-row:2}
  .deck-entry-main>select:nth-of-type(1){grid-column:2;grid-row:2}
  .deck-entry-main>select:nth-of-type(2){grid-column:1/-1;grid-row:3}
  .deck-entry-main>.button:last-child{grid-column:3;grid-row:2;justify-self:stretch;padding:9px 6px;min-height:44px}
  .deck-entry-details{padding-left:12px;padding-right:12px;font-size:12px}
  .deck-entry-details[open] summary{margin-bottom:8px}
  .deck-storage-note{font-size:12px}
  .deck-modal-overlay{--deck-safe-top:max(12px,env(safe-area-inset-top));--deck-safe-bottom:max(12px,env(safe-area-inset-bottom));padding:var(--deck-safe-top) 12px var(--deck-safe-bottom);overscroll-behavior:contain}
  .deck-modal{width:100%;max-height:calc(100dvh - var(--deck-safe-top) - var(--deck-safe-bottom));padding:18px;overscroll-behavior:contain;scroll-padding-bottom:20px}
  .deck-modal-header{gap:12px;align-items:flex-start;margin-bottom:18px}
  .deck-modal-header h2{min-width:0;font-size:20px;line-height:1.4;overflow-wrap:anywhere}
  .deck-modal-header>.button{flex-shrink:0}
  .deck-modal .deck-code{font-size:16px;line-height:1.5}
  .deck-modal .deck-actions{gap:8px;align-items:stretch}
  .deck-modal .deck-actions>.button{flex:1 1 auto}
  .deck-modal input[type=file]::file-selector-button{min-height:44px;max-width:100%;font:inherit}
  .deck-import-row-heading{flex-direction:column;gap:4px;overflow-wrap:anywhere}
  .deck-import-row .deck-actions>.deck-input{flex-basis:100%}
  .deck-import-row .deck-actions>.deck-check-label{padding:0 4px}
  .deck-empty{padding:36px 18px}
}

.deck-check-jump {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: .18em;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.deck-check-jump:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.deck-entry-card,.deck-entry-issues {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}
.deck-entry-issue {
  border-radius: 4px;
  padding: 2px 6px;
  background: #f4e7d1;
  color: #774a2c;
  font-size: 11px;
  line-height: 1.4;
}
.deck-entry.is-highlighted {
  border-color: #b27b3e;
  background: #fff5dd;
  box-shadow: inset 0 0 0 1px #b27b3e;
}
.deck-import-completed {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
}
.deck-import-completed > summary {
  padding: 10px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  cursor: pointer;
}
@media(max-width: 600px) {
  .deck-check-jump,.deck-import-completed > summary {
    min-height: 44px;
  }
}
