/* User portal generator, preview, progress, and history surfaces. */

body.mode-user .app-shell {
  grid-template-columns: minmax(0, 1fr);
  height: var(--portal-viewport-height, 100svh);
}

body.mode-user .sidebar,
body.mode-user .topbar,
body.mode-user .topbar-actions,
body.mode-user .eyebrow,
body.mode-user #pageSubtitle {
  display: none;
}

body.mode-user .workspace {
  grid-template-rows: minmax(0, 1fr);
}

body.mode-user.portal-input-focused {
  overflow: hidden;
}

body.mode-user .view {
  padding: 0;
}

body.mode-user .creator-user-select {
  display: none;
}

body.mode-admin .creator-user-badge {
  display: none;
}

.creator-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: var(--portal-viewport-height, 100%);
  overflow: hidden;
  background: #fff;
}

.creator-topbar,
.creator-layout,
.creator-compose,
.creator-preview {
  min-width: 0;
}

.creator-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  border-bottom: 1px solid #f2f2f2;
}

.creator-brand,
.creator-brand-nav {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.creator-brand-nav {
  align-items: center;
  min-width: 0;
  gap: 24px;
}

.creator-product-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid #ececec;
  border-radius: 7px;
  background: #fafafa;
}

.creator-product-switch a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 5px;
  color: #6b6b68;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.creator-product-switch a:hover {
  color: #171717;
  background: #f1f1ef;
}

.creator-product-switch a.is-active {
  background: #171717;
  color: #fff;
}

.creator-topbar span {
  color: #777;
  font-size: 13px;
}

.creator-user-select {
  width: 260px;
}

.creator-user-badge {
  display: grid;
  gap: 2px;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid #f0d9de;
  border-radius: 8px;
  background: #fff8f9;
  color: var(--creator-red);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

.creator-user-badge strong {
  font-size: 13px;
}

.creator-user-badge span {
  color: #8b5b63;
  font-size: 12px;
  font-weight: 600;
}

.creator-user-badge.is-expired {
  border-color: #f2b8b5;
  background: #fff4f2;
  color: var(--danger);
}

.creator-user-badge.is-expired span {
  color: var(--danger);
}

.creator-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.creator-layout {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  overflow: hidden;
  background: #fff;
}

.creator-compose,
.creator-preview {
  min-height: 0;
  padding: 0;
}

.creator-compose {
  display: grid;
  align-content: start;
  gap: 18px;
  overflow: auto;
  border-right: 1px solid #eeeeee;
  padding: 28px 26px;
  background: #fffafa;
}

.creator-preview {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  padding: 26px 30px;
  background: #fff;
}

.creator-heading span {
  color: var(--creator-red);
  font-size: 13px;
  font-weight: 700;
}

.creator-heading h2 {
  margin: 6px 0 0;
  max-width: 320px;
  font-size: 28px;
  line-height: 1.12;
}

.creator-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: stretch;
  margin-top: 0;
  max-width: 100%;
}

.creator-form label {
  min-width: 0;
}

.portal-payment-panel {
  display: grid;
  gap: 10px;
  border: 1px solid #f0e1e4;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.creator-user-badge strong {
  display: flex;
  align-items: center;
  gap: 8px;
}

.portal-credit-recharge {
  min-height: 24px;
  border: 1px solid #f1cbd1;
  border-radius: 999px;
  padding: 0 9px;
  background: #fff8f8;
  color: #9f1d35;
  font-size: 12px;
  font-weight: 700;
}

.portal-credit-recharge:hover {
  background: #fff0f1;
}

.portal-payment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.portal-payment-head strong {
  font-size: 14px;
}

.portal-payment-head span {
  color: #8b5b63;
  font-weight: 700;
}

.portal-payment-list {
  display: grid;
  gap: 8px;
}

.portal-payment-list.is-membership {
  grid-template-columns: 1fr 1fr;
}

.portal-payment-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
}

.portal-payment-tabs button {
  min-height: 36px;
  border: 1px solid #ead6da;
  border-radius: 7px;
  background: #fff;
  color: #5f2f38;
  font-weight: 700;
}

.portal-payment-tabs button.is-active {
  border-color: #111827;
  background: #111827;
  color: #fff;
}

.portal-payment-current {
  margin-bottom: 10px;
  border: 1px solid #f2f2f2;
  border-radius: 8px;
  padding: 10px;
  background: #fbfbfc;
  color: #667085;
  font-size: 13px;
}

.portal-payment-current strong {
  color: #111827;
}

.portal-payment-package {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  border: 1px solid #f2f2f2;
  border-radius: 8px;
  padding: 10px;
  background: #fffafa;
  text-align: left;
}

.portal-payment-list.is-membership .portal-payment-package {
  display: grid;
  align-content: space-between;
  min-height: 118px;
}

.portal-payment-package strong,
.portal-payment-package small {
  display: block;
}

.portal-payment-package small {
  margin-top: 2px;
  color: #777;
  font-size: 12px;
}

.portal-payment-package b,
.portal-payment-open,
.portal-payment-custom button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  padding: 0 12px;
  background: var(--creator-red);
  color: #fff;
  font-weight: 700;
}

.portal-payment-package:disabled,
.portal-payment-open:disabled,
.portal-payment-custom button:disabled {
  background: #d1d5db;
  cursor: not-allowed;
}

.portal-payment-package:disabled {
  border-color: #f2f2f2;
  background: #fffafa;
  color: inherit;
}

.portal-payment-package:disabled b {
  background: #d1d5db;
}

.portal-payment-open {
  width: 100%;
  min-height: 42px;
}

.portal-payment-note {
  color: #777;
  font-size: 12px;
  line-height: 1.45;
}

.portal-payment-note.is-error {
  margin-bottom: 10px;
  color: #b42318;
}

.portal-payment-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.portal-payment-modal.is-open {
  display: flex;
}

.portal-payment-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.32);
}

.portal-payment-dialog {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  border-radius: 8px;
  border: 1px solid #f0e1e4;
  background: #fff;
  padding: 16px;
  box-shadow: 0 18px 44px rgba(17, 24, 39, 0.18);
}

.portal-payment-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.portal-payment-dialog-head strong,
.portal-payment-dialog-head span {
  display: block;
}

.portal-payment-dialog-head strong {
  font-size: 18px;
}

.portal-payment-dialog-head span {
  margin-top: 3px;
  color: #8b5b63;
  font-size: 13px;
}

.portal-payment-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #f8f1f2;
  color: #5f2f38;
  font-size: 20px;
  line-height: 1;
}

.portal-payment-custom {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f2f2f2;
}

.portal-payment-custom label {
  display: grid;
  gap: 6px;
  color: #5f2f38;
  font-size: 13px;
  font-weight: 700;
}

.portal-payment-custom input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #ead6da;
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
}

.portal-payment-custom-preview {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.portal-payment-custom-preview span {
  color: #777;
  font-size: 12px;
}

.portal-payment-custom-submit {
  width: 100%;
  min-height: 42px;
}

.portal-payment-success-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.portal-payment-success-modal.is-open {
  display: flex;
}

.portal-payment-success-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.38);
}

.portal-payment-success-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  width: min(380px, 100%);
  border-radius: 8px;
  border: 1px solid #f2d5d9;
  background: #fff;
  padding: 24px 22px 20px;
  text-align: center;
  box-shadow: 0 22px 56px rgba(17, 24, 39, 0.2);
}

.portal-payment-success-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #fff1f2;
  color: var(--creator-red);
  font-size: 30px;
  font-weight: 900;
}

.portal-payment-success-copy {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.portal-payment-success-copy strong {
  color: #111827;
  font-size: 21px;
}

.portal-payment-success-copy p,
.portal-payment-success-detail {
  margin: 0;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.55;
}

.portal-payment-success-detail {
  margin-top: 12px;
  border-radius: 8px;
  background: #fff8f8;
  padding: 10px 12px;
  color: #7f1d1d;
  font-weight: 700;
}

.portal-payment-success-confirm {
  width: 100%;
  min-height: 42px;
  margin-top: 18px;
  border: 0;
  border-radius: 8px;
  background: var(--creator-red);
  color: #fff;
  font-weight: 800;
}

.creator-primary {
  min-height: 52px;
  width: 100%;
  grid-column: 1;
  border: 0;
  border-radius: 8px;
  background: var(--creator-red);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.creator-primary:disabled {
  background: #d1d5db;
  cursor: not-allowed;
}

.creator-submit-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(132px, 0.58fr);
  gap: 10px;
}

.creator-submit-row .secondary-button,
.creator-submit-row .creator-primary {
  width: 100%;
}

.generation-pause-notice {
  margin: 0;
  border-left: 3px solid #ff2442;
  padding: 8px 10px;
  background: #fff5f6;
  color: #8f1d2f;
  font-size: 13px;
  line-height: 1.5;
}

.creator-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.creator-preview-head strong {
  font-size: 16px;
}

.portal-history-retention-note {
  color: #777;
  font-size: 12px;
  line-height: 1.5;
  text-align: right;
}

.portal-tabs {
  display: flex;
  gap: 18px;
  border-bottom: 1px solid #ececec;
}

.portal-tabs button {
  min-height: 40px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 0 2px;
  background: transparent;
  color: #777;
  font-weight: 700;
}

.portal-tabs button.is-active {
  border-bottom-color: var(--creator-red);
  color: var(--ink);
}

.portal-tab-panel {
  display: none;
  margin-top: 14px;
  min-height: 0;
  overflow: auto;
}

.portal-tab-panel.is-active {
  display: block;
}

.portal-tab-panel[data-portal-panel="history"].is-active {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.portal-tab-panel[data-portal-panel="current"].is-active {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.creator-mockup {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  margin-top: 16px;
}

.creator-sample-summary {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
}

.creator-sample-summary strong {
  font-size: 15px;
}

.creator-sample-summary span {
  color: #666;
  font-size: 13px;
}

.creator-sample-image {
  display: block;
  width: 100%;
  max-height: min(68vh, 720px);
  overflow: hidden;
  border: 1px solid #eeeeee;
  border-radius: 8px;
  padding: 0;
  background: #fafafa;
  cursor: zoom-in;
}

.creator-sample-image img {
  display: block;
  width: 100%;
  max-height: min(68vh, 720px);
  object-fit: contain;
  object-position: top center;
}

.sample-image-field {
  display: grid;
  gap: 10px;
}

.image-drop-zone {
  border: 1px dashed transparent;
  border-radius: 8px;
  padding: 8px;
  transition: border-color 120ms ease, background 120ms ease;
}

.image-drop-zone:focus-visible,
.image-drop-zone.is-drag-over {
  outline: none;
  border-color: #111111;
  background: #f7f7f7;
}

.upload-hint {
  color: #777;
  font-size: 12px;
  line-height: 1.5;
}

.sample-image-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sample-image-head span {
  color: #555;
  font-size: 13px;
  font-weight: 700;
}

.sample-image-head .secondary-button {
  min-height: 32px;
  padding: 0 12px;
}

.sample-image-field img,
.sample-image-empty {
  width: 100%;
  max-height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
}

.sample-image-field img {
  object-fit: contain;
}

.reference-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 240px));
  gap: 12px;
  align-items: start;
}

.reference-image-slot {
  max-width: 240px;
}

.reference-image-slot img,
.reference-image-slot .sample-image-empty {
  width: 100%;
  height: 120px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
}

.reference-image-slot img {
  display: block;
  object-fit: contain;
}

.reference-image-slot input {
  min-height: 34px;
  font-size: 12px;
}

.sample-image-empty {
  display: grid;
  min-height: 96px;
  place-items: center;
  color: #777;
  font-size: 13px;
}

.portal-result {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 120px;
  max-height: none;
  overflow: hidden;
  border: 1px solid #eeeeee;
  border-radius: 8px;
  background: #fff;
}

.portal-result-body {
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

.portal-result-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px;
  border-top: 1px solid #eeeeee;
  background: #fff;
}

.running-copy-preview {
  margin-top: 14px;
}

.portal-result:empty {
  display: none;
}

.result-state {
  display: grid;
  gap: 6px;
}

.result-state.is-error span {
  color: var(--danger);
}

.result-state span {
  color: var(--creator-red);
  font-size: 12px;
  font-weight: 700;
}

.result-state p {
  color: #666;
  line-height: 1.55;
}

.result-state .result-hint {
  color: #9f1239;
  font-size: 13px;
}

.result-ready-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.result-ready-head strong {
  min-width: 0;
  font-size: 16px;
  line-height: 1.35;
}

.result-ready-head span {
  flex: 0 0 auto;
  color: var(--creator-red);
  font-size: 12px;
  font-weight: 700;
}

.result-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.result-steps span {
  padding: 8px 0;
  border-bottom: 2px solid #f0f0f0;
  color: #555;
  font-size: 12px;
  text-align: center;
}

.result-steps span.is-active {
  border-bottom-color: #111;
  color: #111;
  font-weight: 700;
}

.portal-task-progress {
  height: 8px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #ffe5ea;
}

.portal-task-progress span {
  display: block;
  height: 100%;
  min-width: 8px;
  border-radius: inherit;
  background: var(--creator-red);
  transition: width 220ms ease;
}

.portal-progress-meta {
  margin-top: 12px;
  color: #555;
  font-size: 12px;
}

.portal-history {
  background: transparent;
}

.portal-history-shell {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}

.portal-history-frame {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #eeeeee;
  border-radius: 8px;
  background: #fff;
}

.portal-history-table {
  min-height: 0;
  min-width: 0;
  overflow: auto;
}

body.mode-user.portal-current-active .portal-result,
body.mode-user.portal-history-active .portal-history-shell {
  max-height: min(40vh, 440px);
}

body.mode-user.portal-current-active .portal-result {
  height: 100%;
  max-height: none;
}

body.mode-user.portal-history-active .creator-preview {
  padding-bottom: 22px;
}

body.mode-user.portal-history-active .portal-tab-panel[data-portal-panel="history"].is-active {
  min-height: 0;
  overflow: hidden;
}

body.mode-user.portal-history-active .portal-history-shell {
  height: 100%;
  max-height: none;
}

.portal-task-table-head,
.portal-task-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(190px, 0.9fr) minmax(72px, 0.36fr) minmax(110px, 0.45fr) minmax(150px, 0.65fr) 112px;
  min-width: 860px;
}

.portal-task-table-head {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid #eeeeee;
  background: #fafafa;
  color: #666;
  font-size: 12px;
  font-weight: 700;
}

.portal-task-table-head span {
  padding: 10px;
  border-right: 1px solid #eeeeee;
}

.portal-task-table-head span:last-child {
  border-right: 0;
}

.portal-task-row {
  border-bottom: 1px solid #eeeeee;
}

.portal-task-row:last-child {
  border-bottom: 0;
}

.portal-task-row:hover {
  background: #fafafa;
}

.portal-task-row-main {
  grid-column: 1 / 6;
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(190px, 0.9fr) minmax(72px, 0.36fr) minmax(110px, 0.45fr) minmax(150px, 0.65fr);
  align-items: center;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.portal-task-row-main > span,
.portal-task-row-actions {
  min-height: 52px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 9px 10px;
  border-right: 1px solid #eeeeee;
  color: #555;
  font-size: 12px;
}

.portal-task-row-main > span {
  overflow: hidden;
}

.portal-task-row-main > span:not(.task-title-cell) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-task-row-main:hover .task-title-cell strong {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.portal-task-row-actions {
  border-right: 0;
  justify-items: start;
}

.portal-task-row-actions button {
  position: relative;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  background: #fff;
  color: #333;
  font-size: 13px;
  font-weight: 700;
}

.portal-task-row-actions .trash-action {
  border-color: #fecaca;
  color: #dc2626;
  font-size: 0;
}

.portal-task-row-actions .trash-action::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 10px;
  width: 10px;
  height: 12px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 1px 1px 3px 3px;
}

.portal-task-row-actions .trash-action::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 7px;
  width: 12px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 3px -3px 0 -1px currentColor;
}

.portal-task-row-actions button + button {
  margin-top: 4px;
}

.portal-task-row .task-progress {
  width: 84px;
}

.task-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 2px;
  background: transparent;
  color: #555;
  font-size: 13px;
}

.task-pagination span {
  margin-right: auto;
  white-space: nowrap;
}

.draft-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border-bottom: 1px solid #eeeeee;
  color: #666;
  font-size: 13px;
}

.draft-schedule-note {
  padding: 9px 10px;
  border-bottom: 1px solid #eeeeee;
  background: #fafafa;
  color: #666;
  font-size: 12px;
}

.draft-table-head,
.draft-row {
  grid-template-columns: 54px minmax(280px, 1fr) minmax(180px, 0.6fr) minmax(150px, 0.5fr) 96px;
}

.draft-table-head.has-schedule,
.draft-row.has-schedule {
  grid-template-columns: 54px minmax(260px, 1fr) minmax(160px, 0.55fr) minmax(140px, 0.45fr) 88px 96px;
}

.draft-row-main {
  grid-column: 2 / 5;
  grid-template-columns: minmax(260px, 1fr) minmax(160px, 0.55fr) minmax(140px, 0.45fr);
}

.draft-check {
  min-height: 52px;
  display: grid;
  place-items: center;
  border-right: 1px solid #eeeeee;
}

.draft-check input {
  width: 16px;
  height: 16px;
}

.draft-schedule-switch {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-right: 1px solid #eeeeee;
  color: #555;
  font-size: 12px;
  font-weight: 700;
}

.draft-schedule-switch input {
  width: 15px;
  height: 15px;
  accent-color: #111;
}

.task-title-cell small {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #777;
  font-size: 12px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-history-empty {
  padding: 12px;
  border: 1px dashed #e8c3ca;
  border-radius: 8px;
  color: #777;
  font-size: 13px;
}

@media (max-width: 1180px) {
  .creator-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-auto-rows: max-content;
    justify-content: stretch;
    background: #fff;
    overflow: auto;
    overscroll-behavior: contain;
    scroll-padding: 18px 0 140px;
  }

  .creator-compose {
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid #f2f2f2;
    padding: 20px 26px;
  }

  .creator-preview {
    overflow: visible;
  }

  .creator-heading h2 {
    max-width: 680px;
    font-size: 24px;
  }

  .creator-mockup {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .creator-layout {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-auto-rows: max-content;
    align-content: start;
  }
}

@media (max-width: 720px) {
  body.mode-user .app-shell {
    overflow: hidden;
  }

  body.mode-user:not(.auth-user) .role-gate {
    right: 8px;
    left: auto;
  }

  body.mode-user:not(.auth-user) .creator-topbar {
    padding-top: 64px;
  }

  .creator-topbar {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 18px;
  }

  .creator-brand-nav {
    display: grid;
    gap: 8px;
    min-width: 0;
  }

  .creator-brand {
    display: grid;
    gap: 3px;
  }

  .creator-product-switch {
    width: max-content;
  }

  .creator-topbar strong,
  .creator-topbar span {
    white-space: nowrap;
  }

  .creator-actions {
    align-items: stretch;
    justify-content: flex-end;
    flex-wrap: wrap;
    min-width: 0;
  }

  .creator-actions .secondary-button,
  .creator-actions .ghost-button {
    min-height: 40px;
    padding: 0 12px;
  }

  .creator-actions .admin-return-link {
    display: none;
  }

  .creator-user-badge {
    max-width: 100%;
    min-height: 34px;
    padding: 7px 10px;
  }

  .creator-topbar .creator-user-badge {
    display: grid;
  }

  .creator-compose,
  .creator-preview {
    padding: 18px;
  }

  .creator-compose {
    gap: 12px;
  }

  .creator-form {
    gap: 12px;
  }

  .creator-heading h2 {
    max-width: 100%;
    font-size: 22px;
    line-height: 1.18;
  }

  #portalInput {
    min-height: 96px;
  }

  #portalInput.is-multiline {
    min-height: 132px;
    max-height: min(34vh, 156px);
  }

  .portal-tabs {
    width: 100%;
    gap: 12px;
  }

  .portal-tabs button {
    flex: 1 1 0;
    padding: 0;
  }

  .portal-history-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .portal-history-retention-note {
    text-align: left;
  }

  .creator-sample-summary {
    display: grid;
  }

  .portal-task-table-head {
    display: none;
  }

  .portal-history-shell {
    min-height: 360px;
    gap: 10px;
  }

  .portal-result {
    min-height: 420px;
  }

  .portal-result-actions {
    position: sticky;
    bottom: 0;
    z-index: 3;
    flex-wrap: wrap;
  }

  .portal-task-row {
    grid-template-columns: minmax(0, 1fr) auto;
    min-width: 0;
  }

  .draft-row {
    grid-template-columns: 42px minmax(0, 1fr) auto;
  }

  .draft-row.has-schedule {
    grid-template-columns: 42px minmax(0, 1fr) 68px auto;
  }

  .draft-table-head.has-schedule {
    grid-template-columns: 42px minmax(0, 1fr) 68px auto;
  }

  .portal-task-row-main {
    grid-column: auto;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .draft-row-main {
    grid-column: auto;
    grid-template-columns: minmax(0, 1fr);
  }

  .portal-task-row-main > span,
  .portal-task-row-actions {
    min-height: 48px;
    border-right: 0;
    padding: 10px;
  }

  .portal-task-row-main > span:nth-child(2),
  .portal-task-row-main > span:nth-child(4),
  .portal-task-row-main > span:nth-child(5) {
    display: none;
  }

  .draft-row-main > span:nth-child(2),
  .draft-row-main > span:nth-child(3) {
    display: none;
  }

  .draft-schedule-switch {
    min-height: 48px;
    border-right: 0;
  }

  .portal-task-row-actions {
    min-width: 74px;
  }

  .task-pagination {
    flex-wrap: wrap;
    padding: 0;
  }

  .task-pagination span {
    flex: 1 0 100%;
    margin-right: 0;
  }
}

@media (max-width: 720px) and (max-height: 620px) {
  .creator-layout {
    scroll-padding-bottom: 180px;
  }

  .creator-topbar {
    padding: 10px 16px;
  }

  .creator-brand > span {
    display: none;
  }

  .creator-actions .admin-return-link {
    display: none;
  }

  .creator-compose,
  .creator-preview {
    padding: 14px 18px;
  }

  .creator-heading {
    display: none;
  }

  .creator-submit-row {
    grid-template-columns: 1fr 0.7fr;
  }

  .creator-primary,
  .creator-submit-row .secondary-button {
    min-height: 48px;
  }
}
