/* Buyer-show presentation only. Load after next-ui.css and mobile-actions.css.
   Next gets the complete filled-state theme; classic desktop remains unchanged. */
html[data-ui=next] #view-buyershow :is(.buyer-reference-card,.buyer-script-card,.buyer-allocation-row) {
  border-color:var(--line);border-radius:14px;background:#fff;
}
html[data-ui=next] #view-buyershow :is(.buyer-reference-info h4,.buyer-result-body h4) {
  font-size:15px;line-height:1.5;color:var(--ink);
}
html[data-ui=next] #view-buyershow :is(.buyer-reference-info>p,.buyer-reference-info li,.buyer-save-status,.buyer-result-body small) {
  font-size:12px;line-height:1.6;
}
html[data-ui=next] #view-buyershow .buyer-reference-card {
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:20px;padding:16px;background:#f5f5f7;
}
html[data-ui=next] #view-buyershow .buyer-reference-info h4 {overflow-wrap:anywhere}
html[data-ui=next] #view-buyershow .buyer-reference-info>div {flex-wrap:wrap}
html[data-ui=next] #view-buyershow .buyer-reference-empty {
  padding:24px;gap:6px;border-color:var(--line-dark);background:#fafafa;border-radius:14px;
}
html[data-ui=next] #view-buyershow .buyer-reference-empty>strong {font-size:16px}
html[data-ui=next] #view-buyershow .buyer-reference-empty>small {font-size:12px;line-height:1.65}
html[data-ui=next] #view-buyershow .buyer-upload-mark {background:var(--ink);color:#fff}
html[data-ui=next] #view-buyershow .buyer-form-subhead {
  gap:6px 12px;flex-wrap:wrap;padding:14px 16px;background:#f5f5f7;border-left-color:var(--blue);border-radius:10px;
}
html[data-ui=next] #view-buyershow .buyer-form-subhead strong {font-size:14px}
html[data-ui=next] #view-buyershow .buyer-form-subhead small {font-size:12px;line-height:1.6}
html[data-ui=next] #view-buyershow .buyer-authentic-note {
  align-items:flex-start;padding:14px 16px;background:#f4f8ff;border-color:#dceaff;border-radius:12px;
}
html[data-ui=next] #view-buyershow .buyer-authentic-note>span {color:var(--blue);background:#e5efff}
html[data-ui=next] #view-buyershow .buyer-authentic-note p {font-size:12px;line-height:1.7;color:#515154}
html[data-ui=next] #view-buyershow .buyer-authentic-note strong {font-size:13px}
html[data-ui=next] #view-buyershow .buyer-script-list {gap:16px}
html[data-ui=next] #view-buyershow .buyer-script-card-head {
  grid-template-columns:36px minmax(0,1fr) auto;gap:10px;padding:12px;background:#f5f5f7;border-color:var(--line);
}
html[data-ui=next] #view-buyershow .buyer-script-index {width:36px;height:36px;font-size:12px;background:#eaf3ff;color:var(--blue)}
html[data-ui=next] #view-buyershow .buyer-script-card-head input {
  min-width:0;min-height:44px;font-size:15px;padding:8px;background:#fff;border-color:var(--line-dark);border-radius:10px;
}
html[data-ui=next] #view-buyershow .buyer-script-card-tools {gap:8px}
html[data-ui=next] #view-buyershow .buyer-script-card-tools button {
  min-width:44px;min-height:44px;height:auto;padding:8px;border-radius:10px;font-size:13px;
}
html[data-ui=next] #view-buyershow .buyer-script-card-head .ai-script-revise-trigger {
  min-width:96px;background:#eaf3ff;border-color:#dceaff;color:var(--blue);
}
html[data-ui=next] #view-buyershow .ai-script-revise-trigger span {color:inherit}
html[data-ui=next] #view-buyershow .buyer-script-fields {
  grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;padding:16px;
}
html[data-ui=next] #view-buyershow .buyer-script-fields label {min-width:0;font-size:13px;color:var(--ink-2)}
html[data-ui=next] #view-buyershow .buyer-script-fields :is(input,textarea) {
  min-width:0;min-height:44px;border-radius:10px;font-size:14px;line-height:1.6;padding:10px 12px;border-color:var(--line-dark);
}
html[data-ui=next] #view-buyershow .buyer-script-fields textarea {min-height:90px}
html[data-ui=next] #view-buyershow .buyer-quantity-bar {
  padding:16px;gap:12px;border:1px solid var(--line);border-radius:14px;background:#f5f5f7;color:var(--ink);flex-wrap:wrap;
}
html[data-ui=next] #view-buyershow .buyer-quantity-bar>div {flex:1 1 180px;min-width:0}
html[data-ui=next] #view-buyershow .buyer-quantity-bar span {font-size:14px;font-weight:600}
html[data-ui=next] #view-buyershow .buyer-quantity-bar small {font-size:12px;line-height:1.6;color:var(--muted)}
html[data-ui=next] #view-buyershow .buyer-quantity-bar input {
  min-width:0;height:44px;width:76px;border-radius:10px;border-color:var(--line-dark);background:#fff;color:var(--ink);font-size:16px;
}
html[data-ui=next] #view-buyershow .buyer-quantity-bar .ghost-button {background:#fff;border-color:var(--line-dark);color:var(--ink)}
html[data-ui=next] #view-buyershow .buyer-allocation-row {
  grid-template-columns:32px minmax(0,1fr) auto;padding:12px;gap:10px;
}
html[data-ui=next] #view-buyershow .buyer-allocation-row>span {background:#f5f5f7;color:var(--muted);font-size:11px}
html[data-ui=next] #view-buyershow .buyer-allocation-row strong {font-size:14px;line-height:1.5;overflow-wrap:anywhere}
html[data-ui=next] #view-buyershow .buyer-allocation-row small {font-size:12px;line-height:1.6;overflow-wrap:anywhere}
html[data-ui=next] #view-buyershow .buyer-allocation-control {font-size:13px}
html[data-ui=next] #view-buyershow .buyer-allocation-control input {height:44px;width:72px;font-size:16px;border-radius:10px}
html[data-ui=next] #view-buyershow .buyer-result-head-actions {flex:1 1 100%;justify-content:flex-start}
html[data-ui=next] #view-buyershow .buyer-result-head-actions button {height:auto;white-space:normal;line-height:1.5}
html[data-ui=next] #view-buyershow .buyer-result-toolbar {flex-wrap:wrap;gap:12px}
html[data-ui=next] #view-buyershow .buyer-result-toolbar>div {gap:6px;flex-wrap:wrap}
html[data-ui=next] #view-buyershow .buyer-result-toolbar button {
  min-height:40px;height:auto;padding:8px 14px;border-radius:980px;font-size:13px;background:#f5f5f7;color:var(--ink-2);
}
html[data-ui=next] #view-buyershow .buyer-result-toolbar button.active {background:var(--ink);color:#fff}
html[data-ui=next] #view-buyershow .buyer-result-toolbar>span {font-size:12px}
html[data-ui=next] #view-buyershow .buyer-result-grid {
  grid-template-columns:repeat(auto-fill,minmax(min(100%,260px),1fr));gap:16px;
}
html[data-ui=next] #view-buyershow .buyer-result-body {padding:12px}
html[data-ui=next] #view-buyershow .buyer-result-body h4 {white-space:normal;overflow-wrap:anywhere}
html[data-ui=next] #view-buyershow :is(.buyer-result-state,.buyer-result-parent) {font-size:11px;line-height:1.4}
html[data-ui=next] #view-buyershow .buyer-result-state.kept {background:#267052e8}
/* The source DOM is keep / continuation / delete. Give continuation its own row;
   optional download actions use a third column without changing the DOM order. */
html[data-ui=next] #view-buyershow .buyer-result-actions {
  grid-template-columns:minmax(0,1fr) 44px!important;gap:8px;
}
html[data-ui=next] #view-buyershow .buyer-result-actions:has(>button.download) {
  grid-template-columns:minmax(0,1fr) minmax(0,1fr) 44px!important;
}
html[data-ui=next] #view-buyershow .buyer-result-actions>button {
  min-width:0;min-height:44px;height:auto;padding:8px;border-radius:10px;font-size:13px;line-height:1.5;white-space:normal;
  background:#f5f5f7;border-color:var(--line);color:var(--ink-2);
}
html[data-ui=next] #view-buyershow .buyer-result-actions>button.keep-on {background:#edf7f0;border-color:#d6eade;color:#267052}
html[data-ui=next] #view-buyershow .buyer-result-actions>button.delete {grid-column:-2;width:44px;color:#b5473c}
html[data-ui=next] #view-buyershow .buyer-result-actions>.buyer-extend-control {
  grid-column:1/-1;grid-row:2;min-width:0;min-height:54px;height:auto;
  grid-template-columns:auto minmax(44px,1fr) auto 68px;gap:8px;padding:4px 8px;
  background:#f5f5f7;border-color:var(--line);border-radius:10px;font-size:13px;
}
html[data-ui=next] #view-buyershow .buyer-extend-control input {
  width:100%;min-width:0;height:44px;padding:0 4px;font-size:16px;border-radius:8px;border-color:var(--line-dark);
}
html[data-ui=next] #view-buyershow .buyer-extend-control button {
  width:68px;min-width:0;min-height:44px;height:auto;padding:6px 4px;font-size:13px;border-radius:8px;background:var(--blue);color:#fff;
}
html[data-ui=next] #view-buyershow .buyer-extend-control :disabled {cursor:not-allowed;opacity:.65}
html[data-ui=next] #view-buyershow :is(.buyer-script-empty,.buyer-result-empty) {
  min-width:0;padding:24px;border-radius:14px;border-color:var(--line-dark);background:#fafafa;line-height:1.6;
}
html[data-ui=next] #view-buyershow :is(.buyer-script-empty,.buyer-result-empty) strong {font-size:14px}
html[data-ui=next] #view-buyershow :is(.buyer-script-empty,.buyer-result-empty) small {font-size:12px}
html[data-ui=next] #view-buyershow .buyer-guide-card li {font-size:12px;line-height:1.7}
html[data-ui=next] #view-buyershow .buyer-guide-card li b {font-size:13px}

/* A 768px tablet still has a desktop sidebar in the base shell. Use the compact
   buyer layout up to 900px so its inner content is not squeezed into desktop rows. */
@media (max-width:900px) {
  html body .view#view-buyershow :is(.buyer-main,.buyer-section,.buyer-script-list,.buyer-script-card,.buyer-script-fields,.buyer-allocation-list,.buyer-result-grid,.buyer-reference-info) {
    min-width:0;max-width:100%;
  }
  html body .view#view-buyershow .buyer-layout {grid-template-columns:minmax(0,1fr)}
  html body .view#view-buyershow .field :is(input,select,textarea) {font-size:16px;min-width:0;max-width:100%}
  html body .view#view-buyershow .buyer-stepper {
    display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:10px;overflow:visible;
  }
  html body .view#view-buyershow .buyer-stepper>i {display:none}
  html body .view#view-buyershow .buyer-stepper button {min-width:0;min-height:60px;padding:6px;gap:7px;align-items:flex-start}
  html body .view#view-buyershow .buyer-stepper button>span {min-width:0;font-size:12px;line-height:1.5}
  html body .view#view-buyershow .buyer-stepper button small {font-size:11px;line-height:1.5;overflow-wrap:anywhere}
  html body .view#view-buyershow .buyer-reference-card {grid-template-columns:minmax(0,1fr);gap:12px;padding:12px}
  html body .view#view-buyershow .buyer-reference-preview {width:100%;max-width:100%;aspect-ratio:4/3}
  html body .view#view-buyershow .buyer-reference-preview span {opacity:1;font-size:12px}
  html body .view#view-buyershow .buyer-reference-info h4 {overflow-wrap:anywhere;font-size:15px}
  html body .view#view-buyershow .buyer-reference-info :is(p,li) {font-size:12px;line-height:1.6;overflow-wrap:anywhere}
  html body .view#view-buyershow .buyer-reference-info>div {display:flex;gap:8px;flex-wrap:wrap}
  html body .view#view-buyershow .buyer-reference-info>div>button {flex:1;min-width:0;white-space:normal}
  html body .view#view-buyershow .buyer-reference-empty {padding:16px;min-width:0}
  html body .view#view-buyershow .buyer-reference-empty>strong {font-size:14px}
  html body .view#view-buyershow .buyer-reference-empty>small {font-size:12px;line-height:1.6;overflow-wrap:anywhere}
  html body .view#view-buyershow .buyer-reference-empty>div:last-child {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;width:100%}
  html body .view#view-buyershow .buyer-reference-empty button {min-width:0;min-height:44px;white-space:normal;padding:10px 8px;font-size:13px;line-height:1.5}
  html body .view#view-buyershow .buyer-form-subhead {flex-wrap:wrap;align-items:flex-start;gap:6px}
  html body .view#view-buyershow .buyer-form-subhead small {font-size:12px;line-height:1.6}
  html body .view#view-buyershow .buyer-authentic-note {align-items:flex-start;padding:12px}
  html body .view#view-buyershow .buyer-authentic-note p {font-size:12px;line-height:1.65}
  html body .view#view-buyershow .buyer-authentic-note strong {font-size:13px}
  html body .view#view-buyershow .buyer-script-card-head {
    grid-template-columns:32px minmax(0,1fr);gap:8px;padding:10px;
  }
  html body .view#view-buyershow .buyer-script-card-head input {
    min-width:0;min-height:44px;height:auto;padding:8px;font-size:16px;
  }
  html body .view#view-buyershow .buyer-script-card-tools {grid-column:1/-1;display:flex;gap:8px;width:100%;min-width:0}
  html body .view#view-buyershow .buyer-script-card-tools button {min-width:44px;min-height:44px;height:auto;font-size:13px}
  html body .view#view-buyershow .buyer-script-card-tools .ai-script-revise-trigger {flex:1;min-width:0;white-space:normal;padding:10px}
  html body .view#view-buyershow .buyer-script-fields {grid-template-columns:minmax(0,1fr);gap:12px;padding:12px}
  html body .view#view-buyershow .buyer-script-fields label {min-width:0;font-size:13px}
  html body .view#view-buyershow .buyer-script-fields :is(input,textarea) {
    min-width:0;max-width:100%;min-height:44px;font-size:16px;line-height:1.6;padding:10px;
  }
  html body .view#view-buyershow .buyer-script-fields textarea {min-height:96px}
  html body .view#view-buyershow .buyer-quantity-bar {
    display:grid;grid-template-columns:minmax(64px,.4fr) minmax(0,1fr);padding:12px;gap:10px;
  }
  html body .view#view-buyershow .buyer-quantity-bar>div {grid-column:1/-1;min-width:0;margin:0}
  html body .view#view-buyershow .buyer-quantity-bar span {font-size:14px}
  html body .view#view-buyershow .buyer-quantity-bar small {font-size:12px;line-height:1.6}
  html body .view#view-buyershow .buyer-quantity-bar input {width:100%;min-width:0;min-height:44px;font-size:16px}
  html body .view#view-buyershow .buyer-quantity-bar button {width:100%;min-width:0;min-height:44px;white-space:normal;font-size:13px;padding:8px;line-height:1.5}
  html body .view#view-buyershow .buyer-allocation-row {grid-template-columns:32px minmax(0,1fr);gap:8px;padding:12px}
  html body .view#view-buyershow .buyer-allocation-row>div {min-width:0}
  html body .view#view-buyershow .buyer-allocation-row strong {font-size:14px;line-height:1.5;overflow-wrap:anywhere}
  html body .view#view-buyershow .buyer-allocation-row small {font-size:12px;line-height:1.6;overflow-wrap:anywhere}
  html body .view#view-buyershow .buyer-allocation-control {grid-column:1/-1;justify-content:flex-end;gap:10px;font-size:13px}
  html body .view#view-buyershow .buyer-allocation-control input {width:88px;min-width:0;height:44px;font-size:16px}
  html body .view#view-buyershow .buyer-result-head-actions {flex:1 1 100%;display:flex;flex-wrap:wrap;gap:8px;width:100%}
  html body .view#view-buyershow .buyer-result-head-actions>button {
    flex:1 1 100%;min-width:0;min-height:44px;height:auto;padding:10px 8px;white-space:normal;font-size:13px;line-height:1.5;
  }
  html body .view#view-buyershow .buyer-result-toolbar {flex-wrap:wrap;gap:10px}
  html body .view#view-buyershow .buyer-result-toolbar>div {display:flex;flex-wrap:wrap;gap:6px;width:100%}
  html body .view#view-buyershow .buyer-result-toolbar button {flex:1;min-width:0;min-height:44px;height:auto;font-size:13px;padding:8px;white-space:normal}
  html body .view#view-buyershow .buyer-result-toolbar>span {font-size:12px}
  html body .view#view-buyershow .buyer-result-grid {grid-template-columns:repeat(auto-fill,minmax(min(100%,260px),1fr));gap:12px}
  html body .view#view-buyershow .buyer-result-body h4 {font-size:14px;line-height:1.5;white-space:normal;overflow-wrap:anywhere}
  html body .view#view-buyershow .buyer-result-body small {font-size:12px;line-height:1.6}
  html body .view#view-buyershow :is(.buyer-result-state,.buyer-result-parent) {font-size:11px;line-height:1.4}
  html body .view#view-buyershow .buyer-result-actions {grid-template-columns:minmax(0,1fr) 44px!important;gap:8px}
  html body .view#view-buyershow .buyer-result-actions:has(>button.download) {grid-template-columns:minmax(0,1fr) minmax(0,1fr) 44px!important}
  html body .view#view-buyershow .buyer-result-actions>button {
    min-width:0;min-height:44px;height:auto;font-size:13px;line-height:1.5;white-space:normal;padding:8px;
  }
  html body .view#view-buyershow .buyer-result-actions>button.delete {grid-column:-2;width:44px;min-height:44px}
  html body .view#view-buyershow .buyer-result-actions>.buyer-extend-control {
    grid-column:1/-1;grid-row:2;min-width:0;min-height:54px;height:auto;
    grid-template-columns:auto minmax(44px,1fr) auto 68px;gap:8px;padding:4px 8px;font-size:13px;
  }
  html body .view#view-buyershow .buyer-extend-control input {width:100%;min-width:0;height:44px;font-size:16px;padding:0 4px}
  html body .view#view-buyershow .buyer-extend-control button {width:68px;min-width:0;min-height:44px;height:auto;padding:6px 4px;font-size:13px}
  html body .view#view-buyershow :is(.buyer-script-empty,.buyer-result-empty) {padding:16px;min-width:0;line-height:1.6}
  html body .view#view-buyershow :is(.buyer-script-empty,.buyer-result-empty) strong {font-size:14px}
  html body .view#view-buyershow :is(.buyer-script-empty,.buyer-result-empty) small {font-size:12px}
  html body .view#view-buyershow .buyer-progress {flex-wrap:wrap;gap:8px}
  html body .view#view-buyershow .buyer-progress>div {flex:1 1 100%}
  html body .view#view-buyershow .buyer-progress>span {min-width:0;font-size:12px;line-height:1.6;overflow-wrap:anywhere}
  html body .view#view-buyershow .buyer-side {display:flex;flex-direction:column;position:static;width:100%}
  html body .view#view-buyershow .buyer-guide-card li {font-size:12px;line-height:1.7}
  html body .view#view-buyershow .buyer-guide-card li b {font-size:13px}
  /* Existing confirmation/AI-revision dialogs are shared. Scope these mobile
     changes to the active buyer view so other workspaces keep their own styling. */
  html body:has(#view-buyershow.active) :is(#actionConfirmModal,#aiScriptRevisionModal) {padding:8px}
  html body:has(#view-buyershow.active) :is(.action-confirm-card,.ai-script-revision-card) {
    width:min(660px,100%);max-width:100%;max-height:calc(100dvh - 16px);padding:16px;overflow-y:auto;overscroll-behavior:contain;
  }
  html body:has(#view-buyershow.active) :is(.action-confirm-message,.action-confirm-note p,.ai-script-revision-impact p) {font-size:13px;line-height:1.7;overflow-wrap:anywhere}
  html body:has(#view-buyershow.active) :is(.action-confirm-facts span,.ai-script-revision-summary small) {font-size:12px;line-height:1.6}
  html body:has(#view-buyershow.active) :is(.action-confirm-facts strong,.ai-script-revision-summary strong) {min-width:0;font-size:14px;overflow-wrap:anywhere}
  html body:has(#view-buyershow.active) :is(.action-confirm-actions,.ai-script-revision-actions) {display:flex;flex-wrap:wrap;gap:8px}
  html body:has(#view-buyershow.active) :is(.action-confirm-actions,.ai-script-revision-actions)>button {flex:1;min-width:0;min-height:44px;height:auto;padding:10px;white-space:normal;font-size:13px;line-height:1.5}
  html body:has(#view-buyershow.active) .action-confirm-actions>.ai-model-fields {flex:1 1 100%;min-width:0;margin:0;flex-wrap:wrap}
  html body:has(#view-buyershow.active) .ai-model-fields select {max-width:100%;min-width:0;min-height:44px;font-size:16px}
  html body:has(#view-buyershow.active) #aiScriptRevisionDirection {font-size:16px}
  html body:has(#view-buyershow.active) .buyer-library-modal {width:min(720px,100%);max-width:100%;max-height:calc(100dvh - 16px);padding:16px;overflow-y:auto}
  html body:has(#view-buyershow.active) :is(.buyer-library-grid:not(.grouped),.buyer-library-group-grid) {grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  html body:has(#view-buyershow.active) .buyer-library-project-head {flex-wrap:wrap;gap:6px}
  html body:has(#view-buyershow.active) .buyer-library-project-head strong {min-width:0;overflow-wrap:anywhere;font-size:13px}
  html body:has(#view-buyershow.active) :is(.buyer-library-modal>p,.buyer-library-module-head,.buyer-library-project-head span,.buyer-library-item span) {font-size:12px;line-height:1.6}
}
@media (max-width:600px) {
  html body:has(#view-buyershow.active) .action-confirm-facts {grid-template-columns:minmax(0,1fr)}
  html body:has(#view-buyershow.active) .ai-script-revision-summary {grid-template-columns:minmax(0,1fr)}
}
