/* Loaded only on screens wider than 900px (see the media attribute on its <link>).
   A full-screen editor: tool rail | tool panel | work area with the shirt.
   Every area has a fixed place in the grid, so nothing can wander to another row. */

:root { --workspace: #f1f1ef; }

body.designer-page {
    margin: 0;
    min-height: 0;
    height: var(--app-height, 100vh);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body.designer-page .site-nav { flex: 0 0 auto; }

/* body.designer-page .nav-inner {
    max-width: none;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
} */

body.designer-page .progress-steps,
body.designer-page footer.footer { display: none; }

body.designer-page .page-main {
    flex: 1 1 auto;
    min-height: 0;
    max-width: none;
    padding: 0;
    display: flex;
}

body.designer-page .designer-layout {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-columns: 104px 360px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "rail panel work";
    gap: 0;
    padding: 0;
}

/* ---------- Tool rail (left) ---------- */
body.designer-page .mobile-toolbar {
    grid-area: rail;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 14px 8px;
    background: var(--white);
    border-right: 1px solid var(--border);
    overflow-y: auto;
}

body.designer-page .tool-btn {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 92px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
}

body.designer-page .tool-btn:hover { background: var(--surface); color: var(--text); }

body.designer-page .tool-btn svg {
    width: 34px;
    height: 34px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: square;
    stroke-linejoin: miter;
}

body.designer-page .tool-btn.active {
    color: var(--black);
    background: var(--surface);
    box-shadow: inset 3px 0 0 var(--accent);
}

body.designer-page .tool-dot {
    display: none;
    position: absolute;
    top: 14px;
    right: 24px;
    width: 9px;
    height: 9px;
    background: var(--accent);
}

body.designer-page .tool-btn.has-selection .tool-dot { display: block; }
body.designer-page .tool-next { display: none; }

/* ---------- Tool panel ---------- */
body.designer-page .designer-sidebar {
    grid-area: panel;
    width: auto;
    min-height: 0;
    display: block;
    overflow-y: auto;
    padding: 1.5rem 1.25rem;
    border: 0;
    border-right: 1px solid var(--border);
    background: var(--white);
}

body.designer-page .designer-sidebar .panel { display: none; }
body.designer-page .designer-sidebar .panel.active { display: block; }
body.designer-page .designer-sidebar h3 { display: none; }

body.designer-page .sheet-title {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.1rem;
}

body.designer-page .m-label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 1.1rem 0 0.4rem;
}

/* Edit panel: a hint when nothing is selected, the controls when something is */
body.designer-page .edit-empty {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

body.designer-page .edit-fields { display: none; }
body.designer-page #editPanel.has-selection .edit-empty { display: none; }
body.designer-page #editPanel.has-selection .edit-fields { display: block; }

body.designer-page .edit-text-row { display: none; }
body.designer-page #editPanel.is-text .edit-text-row { display: block; }
body.designer-page .edit-text-row input[type="text"] { width: 100%; margin-top: 0.3rem; }

/* ---------- Work area ---------- */
body.designer-page .designer-canvas-area {
    grid-area: work;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    min-height: 0;
    background: var(--workspace);
}

/* Top bar: hint on the left, Front/Back + zoom in the middle, Next on the right */
body.designer-page .workspace-bar {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    padding: 12px 20px;
}

body.designer-page .bar-start { flex: 1 1 0; min-width: 0; }

body.designer-page .bar-start .canvas-hint {
    display: none;
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--text-muted);
}

body.designer-page .bar-end {
    flex: 1 1 0;
    display: flex;
    justify-content: flex-end;
}

body.designer-page .workspace-toolbar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    background: var(--white);
    border: 1px solid var(--border);
    white-space: nowrap;
}

body.designer-page .mobile-side-toggle { display: flex; padding: 0; }

body.designer-page .mobile-side-toggle .side-btn {
    flex: 0 0 auto;
    min-width: 92px;
    padding: 0.5rem 1rem;
}

body.designer-page .mobile-side-toggle .side-btn + .side-btn { margin-left: -1px; }

body.designer-page .workspace-toolbar .zoom-controls {
    margin: 0;
    padding-left: 10px;
    border-left: 1px solid var(--border);
}

body.designer-page .workspace-next {
    width: auto;
    margin: 0;
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* The canvas takes all the remaining space */
body.designer-page .canvas-stage {
    flex: 1 1 0;
    min-height: 0;
    align-items: center;
    justify-content: center;
    padding: 4px 24px 8px;
}

body.designer-page #canvasWrapper {
    background: var(--white);
    border-color: var(--border-strong);
}

@media (min-width: 1500px) {
    body.designer-page .bar-start .canvas-hint { display: block; }
}

/* Narrower computer windows: no hint, toolbar and Next button centered together */
@media (max-width: 1200px) {
    body.designer-page .bar-start { display: none; }
    body.designer-page .workspace-bar { justify-content: center; }
    body.designer-page .bar-end { flex: 0 0 auto; }
}

body.designer-page #textInput,
body.designer-page #editTextInput { font-size: 0.95rem; }

body.designer-page .work-footer {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    padding: 8px 24px 20px;
}