/* Campaign UI adds no extra bar to the fixed cutting workspace. */
.cut-modal [hidden] {display:none!important;}
.sr-only {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip-path:inset(50%);
  white-space:nowrap;
  border:0;
}

/* One large level picker includes its metadata in the existing header. */
.workbench-header .header-progress {align-self:stretch; justify-content:center; gap:0;}
.workbench-header .level-picker {
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:2px;
  min-height:44px;
  padding:2px 6px;
  text-align:right;
}
.workbench-header .level-name {max-width:340px; font-size:15px; line-height:19px;}
.workbench-header .header-meta {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:nowrap;
  gap:10px;
  min-width:0;
  font-size:14px;
  line-height:18px;
  color:#c7d4b8;
}
.workbench-header .sheet-number {font-size:14px; line-height:18px;}
.header-meta .difficulty-rating {font-size:14px; line-height:18px;}
.header-meta .difficulty-stars {font-size:14px;}

/* Gold stars describe the puzzle; checks describe completed levels. */
.difficulty-rating {
  display:inline-flex;
  align-items:center;
  justify-content:flex-start;
  gap:6px;
  min-width:0;
  font-size:14px;
  line-height:20px;
  font-weight:650;
  white-space:nowrap;
  color:#e9d18b;
}
.difficulty-stars {display:inline-flex; gap:1px; font-size:17px; line-height:1; letter-spacing:0;}
.difficulty-stars .star {display:inline-block; color:#e5c77c;}
.difficulty-stars .star.empty {color:#71816c;}
.difficulty-stars .star.half {
  color:transparent;
  background:linear-gradient(90deg,#e5c77c 50%,#71816c 50%);
  background-clip:text;
  -webkit-background-clip:text;
}

/* The complete map stays in a scrollable dialog, never over the active board. */
.cut-modal:has(.campaign-chapters) {width:min(1040px,100%);}
.cut-modal .campaign-progress {
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:8px 16px;
  margin:0 0 16px;
  font-size:16px;
  line-height:1.4;
}
.campaign-progress strong {color:#e9ecd8;}
.campaign-chapters {display:grid; gap:22px;}
.campaign-chapter {min-width:0;}
.chapter-heading {
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  flex-wrap:wrap;
  gap:4px 12px;
  margin-bottom:10px;
  padding-bottom:8px;
  border-bottom:1px solid #46583d;
}
.chapter-heading h3 {font-size:19px; line-height:1.3; margin:0; font-weight:750; color:#e4e8d5;}
.chapter-count {font-size:14px; line-height:20px; color:#c0cfb3;}
.campaign-chapter.is-locked .chapter-heading {color:#b7c0af; border-color:#39483a;}
.campaign-chapter.is-locked .chapter-heading h3 {color:#bdc6b5;}
.campaign-chapter .chapter-levels {
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:9px;
}
.cut-modal .chapter-levels button {
  position:relative;
  display:grid;
  grid-template-columns:32px minmax(0,1fr);
  grid-template-rows:36px auto auto auto;
  align-content:start;
  align-items:center;
  gap:7px 4px;
  min-width:0;
  min-height:158px;
  padding:12px;
  border:1px solid #5c704c;
  border-radius:12px;
  background:#17261c;
  text-align:left;
}
.chapter-levels button:hover:not(:disabled) {background:#263d29; border-color:#b0cb8c;}
.chapter-levels button:disabled {opacity:1; background:#19241d; border-color:#384739; color:#aab6a5;}
.chapter-levels button:disabled > * {opacity:.74;}
.chapter-levels button > b {font-size:17px; line-height:22px; color:#e6d39d;}
.chapter-levels button > svg {justify-self:end; width:48px; max-width:100%; height:36px;}
.cut-modal .chapter-levels button > span {
  grid-column:1/-1;
  font-size:15px;
  line-height:20px;
  font-weight:700;
  text-align:left;
  overflow-wrap:anywhere;
}
.cut-modal .chapter-levels button > small {
  grid-column:1/-1;
  font-size:14px;
  line-height:19px;
  font-weight:450;
  color:#c0cfb3;
}
.chapter-levels .level-difficulty {grid-column:1/-1; min-width:0;}
.chapter-levels .level-difficulty .difficulty-stars {font-size:16px;}
.chapter-levels .level-difficulty .difficulty-rating {gap:5px; font-size:14px;}
.chapter-levels .level-optional {color:#dfcc93!important; font-size:14px!important; line-height:19px!important;}
.chapter-levels .is-complete {border-color:#97b77a; background:#243522;}
.chapter-levels .is-current {outline:2px solid #e4d18a; outline-offset:2px;}

/* All ordinary earnings are kept whether an optional ad succeeds or not. */
.reward-offer {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:8px 14px;
  margin:0 0 18px;
  padding:14px;
  border:1px solid #657e50;
  border-radius:12px;
  background:#253824;
  font-size:16px;
  line-height:1.4;
}
.reward-offer > div {min-width:0;}
.reward-offer > p {grid-column:1/-1;}
.reward-offer > button {grid-column:2; grid-row:1; min-height:48px; max-width:100%; white-space:normal;}
.reward-amount {grid-column:1; grid-row:1; font-size:19px; line-height:1.25; font-weight:800; color:#e6d28c;}
.cut-modal .reward-message,.reward-message {font-size:14px; line-height:1.45; color:#c4d4b4; margin:5px 0 0;}
.reward-offer [role="status"] {grid-column:1/-1; font-size:15px; line-height:1.4; color:#e0e6cd;}
.reward-offer button:disabled {opacity:1; background:#2b352b; border-color:#56634d; color:#adb6a4;}

.heckler-line {color:#e5d6a4; font-style:italic;}
.chain-win .heckler-line,.chain-win .heckler-comment {display:block; margin-top:3px; color:#e5d6a4; font-style:italic;}
.cut-modal .settings-row {font-size:16px; line-height:1.4;}
.cut-modal .settings-row button {min-width:76px; min-height:48px; flex:none;}

@media (max-width:900px) and (min-width:701px) {
  .workbench-header .level-name {max-width:225px;}
  .workbench-header .header-meta {gap:6px;}
  .chapter-levels .difficulty-stars {font-size:15px;}
}
@media (max-width:700px) {
  .workbench-header .level-picker {text-align:left; padding-inline:0; align-items:flex-start;}
  .workbench-header .header-meta {justify-content:flex-start; gap:7px;}
  .workbench-header .level-name {max-width:100%; width:100%; font-size:15px; line-height:19px;}
  .workbench-header .header-meta .difficulty-stars {display:none;}
  .cut-modal:has(.campaign-chapters) {width:100%;}
  .campaign-chapters {gap:20px;}
  .chapter-heading {gap:4px 8px;}
  .chapter-heading h3 {font-size:18px;}
  .campaign-chapter .chapter-levels {grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px;}
  .cut-modal .chapter-levels button {min-height:150px; padding:11px; gap:6px 4px;}
  .cut-modal .chapter-levels button > span {font-size:15px; line-height:20px;}
  .reward-offer {grid-template-columns:minmax(0,1fr); gap:8px; padding:12px;}
  .reward-offer > button {grid-column:1; grid-row:auto; width:100%;}
  .reward-offer .reward-amount {grid-column:1; grid-row:auto;}
  /* Keep both next actions visible even if an optional comment needs to scroll. */
}
@media (max-width:420px) {
  .modal-shade {padding:10px;}
  .cut-modal {max-height:calc(100vh - 20px);max-height:calc(100svh - 20px); padding:15px; border-radius:16px;}
  .cut-modal .modal-head {gap:8px; margin-bottom:14px;}
  .cut-modal .modal-head h2 {font-size:22px;}
  .cut-modal .modal-head button {flex:none; width:48px; min-width:48px; padding:6px;}
  .chapter-heading {align-items:flex-start; flex-direction:column;}
  .chapter-levels .level-difficulty .difficulty-rating {gap:4px;}
  .chapter-levels .level-difficulty .difficulty-stars {font-size:14px; gap:0;}
  .cut-modal .chapter-levels button {padding:10px;}
  .cut-modal .chapter-levels button > small {font-size:14px; line-height:18px;}
}
@media (min-width:560px) and (max-height:470px) {
  .workbench-header .level-picker {text-align:left; align-items:flex-start;}
  .workbench-header .header-meta {justify-content:flex-start;}
  .workbench-header .level-name {max-width:290px;}
  .workbench-header .header-meta .difficulty-stars {display:none;}
  .modal-shade {padding:8px 16px;}
  .cut-modal {max-height:calc(100vh - 16px);max-height:calc(100svh - 16px);}
}
@media (prefers-contrast:more) {
  .difficulty-stars .star.empty {color:#9caa94;}
  .difficulty-stars .star.half {background-image:linear-gradient(90deg,#ffe5a1 50%,#9caa94 50%);}
  .chapter-levels button:disabled > * {opacity:1;}
}
