/* Simple photo editor: image above, tool tabs below. */
.student-guidance { display: none; }
.student-setup-bar { justify-content: center; }
.studio-workspace-grid { display: flex; flex-direction: column; gap: 0; padding: 0 12px 12px; min-height: 0; height: auto; }
.stage-main-wrapper { position: static; width: 100%; height: auto; min-height: 0; order: 0; border: 1px solid #dbe1e8; border-radius: 8px 8px 0 0; }
.stage-top-bar { padding: 5px 10px; min-height: 38px; }
.stage-viewport-box { flex: none; height: clamp(320px, 55vh, 700px); min-height: 0; padding: 18px; border: 0; border-radius: 0; background: #e9ecef; background-image: repeating-linear-gradient(135deg, #00000003 0, #00000003 1px, transparent 1px, transparent 4px); }
.student-output-footer.student-editor-status { display: block; padding: 4px 8px; order: 4; background: #f8fafc; border-top: 1px solid #dbe1e8; }
.student-editor-status .studio-stats-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.student-editor-status .studio-stat-item { flex-direction: row; gap: 5px; padding: 3px 8px; border-right: 1px solid #dbe1e8; border-radius: 0; background: transparent; }
.student-editor-status .studio-stat-label { font-size: 10px; }
.student-editor-status .studio-stat-val { font-size: 11px; }
.wa-stage-toolbar { padding: 5px; background: #f8fafc; border-top: 1px solid #dbe1e8; }
.student-editor-dock { order: 1; width: 100%; background: #fff; border: 1px solid #dbe1e8; border-top: 0; border-radius: 0 0 8px 8px; }
.student-editor-tabs { display: flex; gap: 4px; padding: 5px 8px 0; border-bottom: 1px solid #dbe1e8; background: #f8fafc; }
.student-editor-tabs button { border: 1px solid transparent; border-bottom: 0; background: transparent; color: #475569; padding: 9px 16px; font-size: 12px; font-weight: 700; border-radius: 5px 5px 0 0; cursor: pointer; }
.student-editor-tabs button[aria-selected="true"] { background: #fff; border-color: #dbe1e8; color: #ea580c; }
.student-editor-panel { padding: 10px; }
.student-editor-panel[hidden] { display: none !important; }
.student-editor-panel > .sidebar-card-box { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; gap: 10px 14px; padding: 0; border: 0; border-radius: 0; }
.student-editor-panel .sidebar-card-title { grid-column: 1 / -1; min-height: 0; margin: 0; padding: 0 0 6px; border: 0; }
.student-editor-panel .form-range { width: 100%; }
.student-editor-panel .form-select, .student-editor-panel .form-control { width: 100%; min-width: 0; }
#editorPanel2 .lighting-pills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#editorPanel2 > .sidebar-card-box > div:last-child { grid-column: span 3; display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: center; }
#editorPanel3 { display: grid; grid-template-columns: 1fr 1fr auto; gap: 20px; }
#editorPanel3 > .sidebar-card-box { display: flex; flex-direction: column; }
@media (max-width: 900px) {
  .student-editor-panel > .sidebar-card-box { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #editorPanel2 > .sidebar-card-box > div:last-child { grid-column: span 1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #editorPanel3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .studio-workspace-grid { padding: 0 6px 12px; }
  .stage-viewport-box { height: 42vh; min-height: 260px; padding: 12px; }
  .student-editor-tabs { gap: 0; padding: 4px 2px 0; }
  .student-editor-tabs button { flex: 1; padding: 8px 3px; min-height: 44px; font-size: 11px; }
  .student-editor-panel > .sidebar-card-box { grid-template-columns: minmax(0, 1fr); }
  #editorPanel3 { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .student-editor-panel .form-select, .student-editor-panel .form-control { font-size: 16px !important; min-height: 44px; }
  .student-editor-panel .btn, .student-editor-panel .scale-pill, .student-editor-panel .lighting-pill { min-height: 44px; }
  .student-editor-status .studio-stat-label { font-size: 9px; }
  .student-editor-status .studio-stat-item { padding: 2px 4px; }
}

/* Desktop keeps the tool dock in view; the image takes the remaining height. */
@media (min-width: 1100px) {
  body { height: 100dvh; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
  .gov-tricolor-strip, .student-clean-header, .student-setup-bar { flex-shrink: 0; }
  .studio-workspace-grid { flex: 1 1 0; min-height: 0; overflow: hidden; padding-bottom: 6px; }
  .stage-main-wrapper { flex: 1 1 0; min-height: 0; overflow: hidden; }
  .stage-top-bar, .wa-stage-toolbar, .student-editor-status { flex-shrink: 0; }
  .stage-viewport-box { flex: 1 1 0; height: auto; min-height: 0; padding: 12px; }
  .student-editor-dock { flex: 0 0 auto; max-height: 30vh; overflow-y: auto; }
  .student-editor-panel { padding: 7px 10px; }
  .student-editor-panel > .sidebar-card-box { gap: 6px 12px; }
  .student-editor-tabs button { padding: 6px 14px; }
  .std-dropzone-box { min-height: 0; padding: 18px !important; max-height: 80%; }
  #stdViewCropWrap { gap: 8px; }
  .student-sample { padding: 5px 10px; min-height: 30px; }
}
/* All editing controls stay in the left sidebar. */
.studio-workspace-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 14px; padding: 12px; align-items: stretch; }
.student-tools-sidebar { min-width: 0; min-height: 0; overflow-y: auto; background: #fff; border: 1px solid #dbe1e8; border-radius: 12px; }
.student-sidebar-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px; border-bottom: 1px solid #e2e8f0; }
.student-sidebar-actions .btn { min-height: 38px; font-size: 12px; margin: 0; text-align: center; cursor: pointer; }
.student-sidebar-actions #stdHeaderBtnDownload { grid-column: 1 / -1; }
.student-tools-sidebar .student-setup-bar { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 12px; }
.student-tools-sidebar .asset-pills { width: 100%; order: 0; }
.student-tools-sidebar .asset-pill { padding: 7px 2px; font-size: 11px; min-width: 0; }
.student-tools-sidebar .wa-stage-toolbar { display: grid; grid-template-columns: 1fr 1fr; position: static; width: 100%; max-width: none; margin: 0; padding: 12px; gap: 6px; border-top: 1px solid #e2e8f0; border-bottom: 1px solid #e2e8f0; }
.student-tools-sidebar .wa-toolbar-btn { min-height: 36px; white-space: normal; }
.student-editor-dock { width: 100%; max-height: none; overflow: visible; border: 0; border-radius: 0; }
.student-editor-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 10px; }
.student-editor-tabs button { padding: 9px 6px; border: 1px solid #e2e8f0; border-radius: 6px; }
.student-editor-tabs button[aria-selected="true"] { border-color: #fb923c; background: #fff7ed; }
.student-editor-panel { padding: 14px; }
.student-editor-panel > .sidebar-card-box { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.student-editor-panel > .sidebar-card-box > * { width: 100%; min-width: 0; }
#editorPanel2 > .sidebar-card-box > div:last-child { display: flex !important; flex-direction: column; align-items: stretch; }
#editorPanel3 { display: flex; flex-direction: column; gap: 16px; }
.stage-main-wrapper { order: 0; min-width: 0; border-radius: 12px; height: auto; }
.stage-viewport-box { border-radius: 0; }
.student-clean-header { justify-content: flex-start; padding-left: 18px; }
@media (min-width: 1100px) {
  .studio-workspace-grid { flex: 1 1 0; padding-bottom: 12px; }
  .student-editor-dock { max-height: none; overflow: visible; }
  .stage-main-wrapper { flex: none; }
  .student-editor-panel { padding: 14px; }
}
@media (min-width: 761px) and (max-width: 1099px) {
  .studio-workspace-grid { grid-template-columns: 310px minmax(0, 1fr); }
  .stage-main-wrapper { position: sticky; top: 12px; align-self: start; }
  .stage-viewport-box { height: 65vh; min-height: 320px; }
}
@media (max-width: 760px) {
  .studio-workspace-grid { grid-template-columns: minmax(0, 1fr); padding: 8px; gap: 12px; }
  .student-tools-sidebar { overflow: visible; }
  .student-sidebar-actions #stdHeaderBtnDownload { display: block; }
  .stage-viewport-box { height: 48vh; min-height: 280px; }
}
/* Refined sidebar and canvas surfaces. */
body { font-family: 'Inter', sans-serif; background: #f4f6fa; }
.student-clean-header { min-height: 56px; gap: 18px; border-bottom: 1px solid #e2e8f0; box-shadow: 0 2px 8px #0f172a04; }
.student-home { color: #64748b; font-size: 12px; }
.student-page-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 16px; letter-spacing: -.4px; }
.studio-workspace-grid { grid-template-columns: 360px minmax(0, 1fr); gap: 18px; padding: 16px; background: #f4f6fa; }
.student-tools-sidebar { border-color: #e2e8f0; border-radius: 16px; box-shadow: 0 4px 20px #0f172a05; scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
.student-tools-sidebar::-webkit-scrollbar { width: 5px; }
.student-tools-sidebar::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
.student-sidebar-actions { padding: 16px; gap: 9px; }
.student-sidebar-actions .btn { border-radius: 9px; min-height: 40px; font-weight: 600; }
.student-sidebar-actions .btn:disabled { opacity: .5; cursor: default; }
.student-tools-sidebar .student-setup-bar { padding: 14px 16px; border-bottom: 0; }
.student-tools-sidebar .asset-pills { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.student-tools-sidebar .asset-pill { display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 10px 2px; border: 1px solid #e2e8f0; border-radius: 9px; font-size: 11px; font-weight: 600; overflow: hidden; min-height: 58px; }
.student-tools-sidebar .asset-pill.active { background: #fff7ed; border-color: #fb923c; color: #c2410c; }
.student-tools-sidebar #stdBadgeAssetMode { align-self: flex-start; padding: 0; background: transparent; border: 0; font-size: 10px; color: #64748b; letter-spacing: .5px; }
.student-tools-sidebar .wa-stage-toolbar { padding: 14px 16px; border-color: #edf0f5; background: #fff; }
.student-tools-sidebar .wa-toolbar-btn { border-color: #e2e8f0; border-radius: 8px; padding: 9px 10px; font-weight: 600; font-size: 11px; text-align: center; justify-content: center; }
.student-tools-sidebar .wa-toolbar-btn:hover { border-color: #fb923c; background: #fff7ed; }
.student-tools-sidebar .wa-toolbar-btn.primary { color: #fff; border-color: #ea580c; background: #ea580c; }
.student-tools-sidebar .wa-toolbar-btn.primary:hover { background: #c2410c; }
.student-editor-tabs { padding: 12px 16px; gap: 7px; background: #f8fafc; border-color: #edf0f5; }
.student-editor-tabs button { min-height: 36px; font-size: 11px; color: #64748b; background: white; }
.student-editor-panel { padding: 18px 16px; }
.student-editor-panel .sidebar-card-title { font-size: 13px; font-weight: 700; margin-bottom: 4px; color: #1e293b; }
.student-editor-panel .sidebar-card-title > span:last-child:not(:first-child) { color: #ea580c; font-size: 11px; background: #fff7ed; padding: 4px 8px; border-radius: 6px; }
.student-editor-panel .form-label { color: #64748b; font-size: 11px !important; font-weight: 500 !important; margin-bottom: 6px !important; }
.student-editor-panel .form-control, .student-editor-panel .form-select { border: 1px solid #dce3ec; border-radius: 8px; min-height: 36px; padding: 7px 9px !important; font-size: 12px !important; box-shadow: none; }
.student-editor-panel .form-control:focus, .student-editor-panel .form-select:focus { outline: 2px solid #ffedd5; border-color: #fb923c; }
.student-editor-panel .sidebar-card-box { gap: 14px; }
.stage-main-wrapper { border: 1px solid #e2e8f0; border-radius: 16px; box-shadow: 0 4px 20px #0f172a04; overflow: hidden; }
.stage-top-bar { min-height: 58px; padding: 10px 16px; border-bottom: 1px solid #e2e8f0; }
.stage-step-pills { padding: 4px; gap: 4px; border-radius: 10px; background: #f1f5f9; }
.stage-step-pill { border-radius: 7px; font-size: 12px; min-height: 34px; }
.stage-live-badge { border-radius: 6px; }
.stage-viewport-box { background: radial-gradient(ellipse at center, #fff 0, #f3f5f9 75%); background-image: radial-gradient(ellipse at center, #fff 0, #f3f5f9 75%); padding: 24px; }
#stdDropZone.upload-empty-card { border: 2px dashed #cbd5e1 !important; border-radius: 20px !important; padding: 38px 28px !important; background: #ffffffeb !important; box-shadow: 0 12px 40px #0f172a06 !important; width: min(480px, 100%) !important; max-height: none; margin: 0 auto; }
#stdDropZone.upload-empty-card::before { display: block; content: '\2191'; width: 56px; height: 56px; margin: 0 auto 18px; font: 500 30px/56px 'Inter', sans-serif; color: #ea580c; border-radius: 16px; background: #fff7ed; }
#stdDropZone.upload-empty-card h4 { font-size: 20px !important; letter-spacing: -.5px; }
#stdDropZone.upload-empty-card p { font-size: 12px !important; }
#stdDropZone.upload-empty-card:hover { border-color: #fb923c !important; }
#stdViewCropWrap { gap: 18px; }
.student-sample { background: transparent; border: 0; color: #64748b; font-size: 12px; text-decoration: underline; text-underline-offset: 4px; }
.student-output-footer.student-editor-status { padding: 10px; background: #fff; border-color: #e2e8f0; }
.student-editor-status .studio-stats-bar { gap: 8px; }
.student-editor-status .studio-stat-label { color: #94a3b8; font-size: 9px; }
.student-editor-status .studio-stat-val { font-size: 10px; }
@media (min-width: 1100px) { .studio-workspace-grid { padding-bottom: 16px; } .student-editor-panel { padding: 18px 16px; } }
@media (min-width: 761px) and (max-width: 1099px) { .studio-workspace-grid { grid-template-columns: 320px minmax(0, 1fr); padding: 12px; gap: 12px; } .stage-top-bar { flex-wrap: wrap; } }
@media (max-width: 760px) { .studio-workspace-grid { grid-template-columns: minmax(0, 1fr); padding: 10px; gap: 12px; } .student-editor-panel .form-control, .student-editor-panel .form-select { font-size: 16px !important; min-height: 44px; } .student-editor-tabs button, .student-tools-sidebar .wa-toolbar-btn { min-height: 44px; } .stage-top-bar { flex-wrap: wrap; } #stdDropZone.upload-empty-card { padding: 24px 16px !important; } }
/* Header identity and preview navigation. */
.student-clean-header { padding: 10px 20px; gap: 20px; min-height: 68px; }
.student-home { padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc; }
.student-header-brand { display: flex; align-items: center; gap: 10px; }
.student-brand-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: #fff7ed; color: #ea580c; font-weight: 800; font-size: 13px; }
.student-header-brand > div { display: flex; flex-direction: column; gap: 3px; }
.student-page-title { margin: 0; line-height: 1.3; }
.student-header-subtitle { color: #94a3b8; font-size: 10px; }
.student-header-note { margin-left: auto; color: #64748b; font-size: 12px; }
.student-view-tools { padding: 14px 16px; border-bottom: 1px solid #edf0f5; }
.student-view-heading { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; margin-bottom: 10px; }
#stdZoomValue { font-size: 11px; color: #ea580c; font-variant-numeric: tabular-nums; }
.student-zoom-buttons { display: grid; grid-template-columns: 44px 1fr 44px; gap: 6px; }
.student-view-tools button { background: #fff; border: 1px solid #dce3ec; border-radius: 8px; min-height: 36px; font: 600 12px 'Inter', sans-serif; color: #475569; cursor: pointer; }
.student-view-tools button:hover { background: #fff7ed; border-color: #fb923c; }
#stdZoomIn, #stdZoomOut { font-size: 20px; }
#stdPanToggle { width: 100%; margin-top: 8px; }
#stdPanToggle[aria-pressed="true"] { background: #fff7ed; border-color: #fb923c; color: #c2410c; }
.student-view-tools p { font-size: 10px; line-height: 1.6; color: #94a3b8; margin: 8px 0 0; }
#stdCropCanvas, #stdOutputCanvas { transform-origin: center; }
#stdStageWrap.is-pan-mode, #stdStageWrap.is-pan-mode canvas { cursor: grab !important; touch-action: none; }
#stdStageWrap.is-panning, #stdStageWrap.is-panning canvas { cursor: grabbing !important; }
@media (max-width: 760px) { .student-header-note { display: none; } .student-clean-header { padding: 10px 12px; gap: 12px; } .student-view-tools button { min-height: 44px; } }
/* Compact reference-style preview toolbar. */
.student-preview-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 20px; min-height: 58px; background: #fff; border-bottom: 1px solid #edf0f5; flex-shrink: 0; }
.student-preview-toolbar button { border: 0; border-radius: 6px; background: transparent; padding: 8px 9px; color: #172033; font: 600 12px 'Inter', sans-serif; min-height: 32px; cursor: pointer; }
.student-preview-toolbar button:hover { background: #f1f5f9; }
.student-preview-toolbar button:focus-visible { outline: 2px solid #fb923c; outline-offset: 2px; }
.student-preview-toolbar button:disabled { opacity: .35; cursor: default; }
.student-preview-toolbar #stdZoomValue { font: 700 11px 'Inter', sans-serif; color: #64748b; min-width: 38px; text-align: center; }
.student-preview-toolbar #stdZoomIn, .student-preview-toolbar #stdZoomOut { font-size: 16px; padding: 6px 8px; }
.preview-toolbar-divider { width: 1px; height: 18px; background: #d7dee9; margin: 0 4px; }
#stdStageWrap { position: relative; }
#stdStageWrap.has-cut-guides::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 5; background-image: linear-gradient(to right, transparent calc(33.333% - .5px), #64748b55 33.333%, transparent calc(33.333% + .5px), transparent calc(66.666% - .5px), #64748b55 66.666%, transparent calc(66.666% + .5px)), linear-gradient(to bottom, transparent calc(33.333% - .5px), #64748b55 33.333%, transparent calc(33.333% + .5px), transparent calc(66.666% - .5px), #64748b55 66.666%, transparent calc(66.666% + .5px)); }
@media (max-width: 760px) { .student-preview-toolbar { padding: 8px; gap: 3px; } .student-preview-toolbar button { min-height: 44px; font-size: 11px; padding: 8px 6px; } }
/* Tabs and preview controls share a single scrolling row. */
.stage-main-wrapper .stage-top-bar { display: flex; flex-wrap: nowrap; justify-content: flex-start; align-items: center; gap: 12px; padding: 8px 12px; min-height: 58px; overflow-x: auto; scrollbar-width: thin; }
.stage-top-bar .stage-step-pills { flex: 0 0 auto; white-space: nowrap; }
.stage-top-bar .student-preview-toolbar { flex: 0 0 auto; flex-wrap: nowrap; gap: 5px; min-height: 0; padding: 0 0 0 10px; border: 0; border-left: 1px solid #e2e8f0; background: transparent; }
.stage-top-bar .student-preview-toolbar button { white-space: nowrap; }
.stage-top-bar > div:last-child { flex: 0 0 auto; flex-wrap: nowrap !important; margin-left: auto; white-space: nowrap; }
@media (max-width: 760px) { .stage-main-wrapper .stage-top-bar { gap: 8px; padding: 6px 8px; } }
/* Keep the preview focused on the photo and essential controls. */
#stdZoom100, #stdMagneticToggle, #stdGuidesToggle, #stdBadgeSource, #stdOutputFitNote, #stdViewOutputWrap > div:first-child { display: none !important; }
.stage-top-bar .student-preview-toolbar { gap: 6px; }
#stdViewOutputWrap { justify-content: center; }
.preview-box-container { display: flex; align-items: center; justify-content: center; padding: 24px; }
#stdOutputCanvas { box-shadow: 0 8px 28px #0f172a14; }
#stdGroupBorderCustomColor { padding-top: 8px; justify-content: space-between; }
#stdInpBorderCustom { width: 64px !important; height: 36px !important; border: 1px solid #dce3ec !important; border-radius: 6px; background: white; padding: 3px !important; }
.student-tools-sidebar .wa-stage-toolbar { display: grid !important; grid-template-columns: 1fr 1fr; }
.is-output ~ .student-tools-sidebar .wa-stage-toolbar { display: grid !important; }
#stdOriginalPreview[hidden] { display: none !important; }
#stdOriginalPreview { position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 44px 24px 24px; background: #f3f5f9; pointer-events: none; }
#stdOriginalPreview > span { position: absolute; top: 16px; left: 20px; font: 600 12px 'Inter', sans-serif; color: #64748b; }
#stdOriginalImage { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 8px 28px #0f172a14; }
#stdCompare[aria-pressed="true"] { background: #fff7ed; color: #c2410c; }
/* Verified desktop and mobile adjustments. */
.stage-top-bar .student-preview-toolbar { gap: 3px; padding-left: 6px; }
.stage-top-bar .student-preview-toolbar button { padding: 7px 6px; font-size: 11px; }
.stage-top-bar .stage-step-pill { padding: 8px 9px; font-size: 11px; }
.stage-main-wrapper .stage-top-bar { gap: 8px; }
@media (max-width: 760px) {
  .studio-workspace-grid > .stage-main-wrapper { order: -1; }
  .studio-workspace-grid { padding-bottom: 80px; }
}
