/* ============ PlanetGarm design system ============ */

:root {
    --pg-red: #E63973;
    --pg-red-dark: #C92D61;
    --pg-red-soft: #FDECF2;
    --pg-ink: #202023;
    --pg-muted: #8C8C91;
    --pg-line: #E9E9E9;
    --pg-bg: #F7F7F7;
    --pg-panel: #FFFFFF;
    --pg-radius: 10px;
    --pg-shadow: 0 1px 3px rgba(20, 20, 25, .07), 0 8px 24px rgba(20, 20, 25, .05);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--pg-ink);
    background: var(--pg-bg);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

#app { height: 100%; }

button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }

h1:focus { outline: none; }

/* ---------- Shared bits ---------- */

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--pg-ink);
    color: #fff;
    font: bold italic 18px Georgia, serif;
    flex: none;
}

.logo-word {
    font-family: Georgia, serif;
    font-size: 21px;
    font-weight: 700;
    font-style: italic;
    letter-spacing: -1px;
}

.panel-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.4px;
    color: var(--pg-muted);
    margin: 18px 18px 10px;
}

.btn {
    border: none;
    border-radius: 9px;
    padding: 9px 16px;
    font-size: 13.5px;
    font-weight: 600;
    transition: background .12s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }

.btn-primary { background: var(--pg-red); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--pg-red-dark); }

.btn-secondary {
    background: var(--pg-panel);
    color: var(--pg-ink);
    border: 1px solid var(--pg-line);
}
.btn-secondary:hover:not(:disabled) { background: #faf9f7; }

.btn-ghost { background: transparent; color: var(--pg-ink); }
.btn-ghost:hover { background: #efedea; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--pg-line);
    border-radius: 9px;
    background: var(--pg-panel);
    color: var(--pg-ink);
    padding: 0;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover:not(:disabled) { background: #faf9f7; }
.icon-btn:disabled { opacity: .4; cursor: default; }
.icon-btn-danger { color: var(--pg-red); border-color: #F6CFDD; background: var(--pg-red-soft); }
.icon-btn-danger:hover:not(:disabled) { background: #FBDBE7; }

/* ---------- Login ---------- */

.login-screen {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 20% 15%, rgba(232, 56, 46, .06), transparent 40%),
        var(--pg-bg);
}

.login-card {
    width: 360px;
    background: var(--pg-panel);
    border: 1px solid var(--pg-line);
    border-radius: 16px;
    box-shadow: var(--pg-shadow);
    padding: 34px 32px 26px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-logo { display: flex; align-items: center; gap: 10px; }
.login-tag { margin: 2px 0 14px; color: var(--pg-muted); font-size: 13.5px; }

.login-input {
    border: 1px solid var(--pg-line);
    border-radius: 9px;
    padding: 11px 13px;
    font-size: 14px;
    background: #fbfaf9;
    outline: none;
}
.login-input:focus { border-color: var(--pg-red); background: #fff; }

.login-submit { margin-top: 8px; padding: 12px; font-size: 14px; }

.login-switch {
    background: none;
    border: none;
    color: var(--pg-muted);
    font-size: 13px;
    margin-top: 4px;
    text-decoration: underline;
}
.login-switch:hover { color: var(--pg-ink); }

.login-error {
    background: var(--pg-red-soft);
    color: var(--pg-red-dark);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
}

.login-warn {
    background: #FFF6E5;
    color: #8A6116;
    border: 1px solid #F2DFB6;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 12.5px;
    line-height: 1.5;
}
.login-warn code { font-size: 11.5px; }

/* ---------- Editor frame ---------- */

.editor-loading {
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
    justify-content: center;
    color: var(--pg-muted);
    padding: 24px;
    text-align: center;
}
.editor-loading .login-error { max-width: 420px; }

.editor-root {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.editor-main {
    flex: 1;
    display: flex;
    min-height: 0;
}

/* ---------- Top bar ---------- */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--pg-panel);
    border-bottom: 1px solid var(--pg-line);
    padding: 10px 16px;
    flex: none;
}

.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-sep { color: #C9C7C2; font-size: 18px; }

.set-name {
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 6px 9px;
    font-size: 15px;
    font-weight: 600;
    background: transparent;
    min-width: 60px;
    max-width: 240px;
    outline: none;
}
.set-name:hover { border-color: var(--pg-line); }
.set-name:focus { border-color: var(--pg-red); background: #fff; }

.draft-badge {
    font-size: 12px;
    color: var(--pg-muted);
    background: #F1EFEC;
    border-radius: 999px;
    padding: 5px 11px;
    white-space: nowrap;
}

.save-error {
    font-size: 12px;
    font-weight: 600;
    color: var(--pg-red-dark);
    background: var(--pg-red-soft);
    border-radius: 999px;
    padding: 5px 11px;
    white-space: nowrap;
}

.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-divider { width: 1px; height: 22px; background: var(--pg-line); margin: 0 4px; }
.zoom-label { font-size: 13px; font-weight: 600; padding: 8px 10px; }

/* ---------- Closet panel ---------- */

.closet-panel {
    width: 340px;
    flex: none;
    background: var(--pg-panel);
    border-right: 1px solid var(--pg-line);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.closet-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 18px 12px;
    border: 1px solid var(--pg-line);
    border-radius: 9px;
    padding: 9px 12px;
    background: #fbfaf9;
    color: var(--pg-muted);
}
.closet-search svg { width: 15px; height: 15px; flex: none; }
.closet-search input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 13.5px;
    width: 100%;
    color: var(--pg-ink);
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0 18px 14px;
}

.chip {
    border: 1px solid var(--pg-line);
    background: var(--pg-panel);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--pg-ink);
}
.chip:hover { background: #faf9f7; }
.chip-active { background: var(--pg-ink); border-color: var(--pg-ink); color: #fff; }
.chip-active:hover { background: var(--pg-ink); }

.closet-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 18px;
}

.closet-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    border: 1px solid var(--pg-line);
    border-radius: 12px;
    background: var(--pg-panel);
    padding: 12px 12px 12px;
    text-align: left;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.closet-card:hover { border-color: #C9C7C2; box-shadow: var(--pg-shadow); }
.closet-card-active { border-color: var(--pg-red); }

.on-canvas-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--pg-red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 999px;
    padding: 3px 8px;
    z-index: 1;
}

.closet-art {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
}
.closet-art svg, .closet-art img {
    width: 82%;
    height: 82%;
    object-fit: contain;
}

.closet-name { font-size: 13px; font-weight: 700; }
.closet-meta { font-size: 12px; color: var(--pg-muted); }

.clip-btn {
    margin: 16px 18px 20px;
    border: 1.5px dashed #C9C7C2;
    border-radius: 12px;
    background: transparent;
    color: var(--pg-ink);
    font-size: 13.5px;
    font-weight: 600;
    padding: 13px;
}
.clip-btn:hover { border-color: var(--pg-red); color: var(--pg-red); }

.clip-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 18px 20px;
    border: 1px solid var(--pg-line);
    border-radius: 12px;
    padding: 14px;
    background: #fbfaf9;
}
.clip-form input, .clip-form select {
    border: 1px solid var(--pg-line);
    border-radius: 8px;
    padding: 9px 11px;
    font-size: 13px;
    background: #fff;
    outline: none;
    width: 100%;
}
.clip-form input:focus { border-color: var(--pg-red); }
.clip-form-row { display: flex; gap: 8px; }
.clip-form-row .btn { flex: 1; }

/* ---------- Wardrobe upload ---------- */

.clip-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 18px 20px;
}
.clip-actions .clip-btn { margin: 0; }

.upload-btn {
    position: relative;
    display: block;
    text-align: center;
    cursor: pointer;
}
.upload-btn input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.clip-upload-inline {
    border: 1.5px dashed #C9C7C2;
    border-radius: 10px;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--pg-muted);
    transition: border-color .12s ease, color .12s ease;
}
.clip-upload-inline:hover { border-color: var(--pg-red); color: var(--pg-red); }

.clip-preview {
    display: flex;
    align-items: center;
    gap: 10px;
}
.clip-preview img {
    width: 64px;
    height: 64px;
    flex: none;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--pg-line);
    border-radius: 10px;
}
.clip-preview .btn { flex: 1; }

/* ---------- Canvas ---------- */

.canvas-area {
    flex: 1;
    min-width: 0;
    position: relative;
    display: flex;
    flex-direction: column;
}

.canvas-viewport {
    flex: 1;
    min-height: 0;
    overflow: auto;
    display: flex;
    padding: 40px;
    background-image: radial-gradient(#D9D7D2 1px, transparent 1px);
    background-size: 22px 22px;
    touch-action: none;
}

.canvas-scaler {
    position: relative;
    flex: none;
    /* margin:auto = overflow-safe centering in a flex scroll container */
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.canvas-board {
    position: relative;
    flex: none;
    background: #fff;
    box-shadow: var(--pg-shadow);
    transform-origin: center center;
    user-select: none;
}

.set-item {
    position: absolute;
    transform-origin: center center;
    cursor: grab;
}
.set-item:active { cursor: grabbing; }

.item-art { width: 100%; height: 100%; pointer-events: none; }
.item-art svg, .item-art img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.set-item-selected { outline: 2px solid var(--pg-red); outline-offset: 0; }

.handle {
    position: absolute;
    width: 11px;
    height: 11px;
    background: #fff;
    border: 2px solid var(--pg-red);
    border-radius: 3px;
    z-index: 5;
}
.handle-nw { left: -6px;  top: -6px;    cursor: nwse-resize; }
.handle-ne { right: -6px; top: -6px;    cursor: nesw-resize; }
.handle-sw { left: -6px;  bottom: -6px; cursor: nesw-resize; }
.handle-se { right: -6px; bottom: -6px; cursor: nwse-resize; }

/* edge handles: stretch one axis (Canva-style pills) */
.handle-n, .handle-s {
    width: 20px;
    height: 8px;
    border-radius: 5px;
    left: 50%;
    margin-left: -10px;
    cursor: ns-resize;
}
.handle-n { top: -5px; }
.handle-s { bottom: -5px; }

.handle-w, .handle-e {
    width: 8px;
    height: 20px;
    border-radius: 5px;
    top: 50%;
    margin-top: -10px;
    cursor: ew-resize;
}
.handle-w { left: -5px; }
.handle-e { right: -5px; }

/* stretched frames: let content fill instead of letterboxing */
.item-stretched img { object-fit: fill; }

.rotate-stem {
    position: absolute;
    left: 50%;
    top: -22px;
    width: 2px;
    height: 22px;
    margin-left: -1px;
    background: var(--pg-red);
}

.handle-rotate {
    left: 50%;
    top: -34px;
    margin-left: -6px;
    border-radius: 50%;
    cursor: grab;
}

.transform-badge {
    position: absolute;
    top: -14px;
    right: -14px;
    transform: translateX(100%);
    background: var(--pg-red);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 8px;
    white-space: nowrap;
    z-index: 6;
    pointer-events: none;
}

.guide {
    position: absolute;
    z-index: 100;
    pointer-events: none;
}
.guide-v {
    left: 50%;
    top: 0;
    bottom: 0;
    border-left: 1.5px dashed var(--pg-red);
}
.guide-h {
    top: 50%;
    left: 0;
    right: 0;
    border-top: 1.5px dashed var(--pg-red);
}

.zoom-pill {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--pg-panel);
    border: 1px solid var(--pg-line);
    border-radius: 12px;
    box-shadow: var(--pg-shadow);
    padding: 4px 6px;
    z-index: 50;
}
.zoom-pill button {
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 600;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: var(--pg-ink);
}
.zoom-pill button:hover { background: #f1efec; }
.zoom-pill > span { font-size: 13px; font-weight: 600; min-width: 44px; text-align: center; }
.zoom-pill-sep { width: 1px; height: 18px; background: var(--pg-line); margin: 0 4px; min-width: 0 !important; }
.zoom-fit { width: auto !important; padding: 0 10px; font-size: 13px !important; }

/* ---------- Right panel ---------- */

.right-panel {
    width: 320px;
    flex: none;
    background: var(--pg-panel);
    border-left: 1px solid var(--pg-line);
    overflow-y: auto;
    padding-bottom: 24px;
}

.layers-empty {
    margin: 0 18px;
    font-size: 12.5px;
    color: var(--pg-muted);
    line-height: 1.5;
}

.layers-list { display: flex; flex-direction: column; gap: 6px; padding: 0 14px; }

.layer-row {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 7px 8px;
    cursor: pointer;
}
.layer-row:hover { background: #faf9f7; }
.layer-row-selected {
    border-color: var(--pg-red);
    background: var(--pg-red-soft);
}
.layer-row-selected .layer-name { color: var(--pg-red-dark); font-weight: 700; }

.layer-grip { color: #C9C7C2; display: inline-flex; }
.layer-grip svg { width: 15px; height: 15px; }

.layer-thumb {
    width: 30px;
    height: 30px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.layer-thumb svg, .layer-thumb img { width: 100%; height: 100%; object-fit: contain; }

.layer-name {
    flex: 1;
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.layer-eye {
    border: none;
    background: transparent;
    color: var(--pg-muted);
    display: inline-flex;
    padding: 4px;
    border-radius: 6px;
}
.layer-eye:hover { background: rgba(0,0,0,.05); color: var(--pg-ink); }
.layer-eye svg { width: 16px; height: 16px; }
.layer-eye-off { color: #C9C7C2; }

.selected-label { color: var(--pg-red-dark); }

.prop-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 18px;
}

.prop-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    border: 1px solid var(--pg-line);
    border-radius: 10px;
    padding: 9px 12px 8px;
    background: #fbfaf9;
}
.prop-field span {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: var(--pg-muted);
}
.prop-field input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 15px;
    font-weight: 600;
    width: 100%;
    color: var(--pg-ink);
}
.prop-field:focus-within { border-color: var(--pg-red); background: #fff; }

.prop-actions {
    display: flex;
    gap: 8px;
    padding: 14px 18px 0;
}

.canvas-options { padding: 0 18px; }

.swatch-row { display: flex; gap: 10px; align-items: center; }

.swatch {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--pg-line);
    padding: 0;
}
.swatch-active {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--pg-red);
    border-color: transparent;
}

.canvas-size-label {
    display: inline-block;
    margin-top: 12px;
    font-size: 12px;
    color: var(--pg-muted);
}

/* ---------- Admin console shell (light premium theme) ---------- */

.adm-shell {
    --a-bg: #f6f7f9;
    --a-panel: #ffffff;
    --a-line: #e7e9ee;
    --a-line2: #eef0f4;
    --a-ink: #101828;
    --a-muted: #667085;
    --a-faint: #98a2b3;
    --a-sh: 0 1px 2px rgba(16, 24, 40, .05);

    display: flex;
    height: 100%;
    background: var(--a-bg);
    color: var(--a-ink);
    font-family: 'Inter', 'Segoe UI', -apple-system, sans-serif;
    font-size: 13.5px;
}

/* ----- sidebar (light) ----- */

.adm-side {
    width: 226px;
    flex: none;
    background: var(--a-panel);
    border-right: 1px solid var(--a-line);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.adm-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 18px 12px;
    cursor: pointer;
}
.adm-brand-mark {
    width: 32px;
    height: 32px;
    flex: none;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--pg-red), #f0728f);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
}
.adm-brand-word {
    font-weight: 700;
    font-size: 14.5px;
    letter-spacing: -.2px;
    color: var(--a-ink);
}
.adm-brand-sub {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 1.6px;
    color: var(--a-faint);
    margin-top: 1px;
}

.adm-nav-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 2px 10px 16px;
    flex: 1;
}
.adm-nav-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.3px;
    color: var(--a-faint);
    padding: 14px 10px 5px;
}

.adm-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7.5px 10px;
    border-radius: 8px;
    color: #3f4654;
    font-size: 13px;
    font-weight: 550;
    text-decoration: none;
    transition: background .12s ease, color .12s ease;
}
.adm-nav:hover { background: #f3f4f7; color: var(--a-ink); }
.adm-nav.active { background: var(--pg-red-soft); color: var(--pg-red-dark); font-weight: 650; }
.adm-nav.active svg { color: var(--pg-red); }
.adm-nav svg { width: 16px; height: 16px; flex: none; color: var(--a-faint); }

.adm-side-foot {
    padding: 13px 18px;
    font-size: 12px;
    color: #067647;
    border-top: 1px solid var(--a-line2);
    display: flex;
    align-items: center;
    gap: 8px;
}
.adm-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #12b76a; display: inline-block; }

/* ----- topbar ----- */

.adm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.adm-top {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--a-panel);
    border-bottom: 1px solid var(--a-line);
    padding: 10px 20px;
    flex: none;
}

.adm-search-wrap { position: relative; flex: 1; max-width: 420px; }

.adm-search {
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid var(--a-line);
    border-radius: 9px;
    padding: 8px 12px;
    background: #fafbfc;
    color: var(--a-faint);
    font-size: 13px;
}
.adm-search svg { width: 14px; height: 14px; flex: none; }
.adm-search input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    padding: 0;
    font-size: 13px;
    color: var(--a-ink);
}
.adm-search input:focus { outline: none; }
.adm-search input::placeholder { color: var(--a-faint); }
.adm-search kbd {
    margin-left: auto;
    border: 1px solid var(--a-line);
    border-radius: 5px;
    padding: 1px 6px;
    font-size: 10.5px;
    background: #fff;
    color: var(--a-faint);
    font-family: inherit;
    flex: none;
}

.adm-search-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--a-line);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(16, 24, 40, .14);
    padding: 6px;
    z-index: 40;
    max-height: 360px;
    overflow-y: auto;
}
.adm-search-empty { padding: 12px 10px; font-size: 12.5px; color: var(--a-muted); }
.adm-search-hit {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}
.adm-search-hit:hover { background: #f5f6f8; }
.adm-search-type {
    flex: none;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--pg-red-dark);
    background: var(--pg-red-soft);
    border-radius: 5px;
    padding: 2px 6px;
}
.adm-search-label { font-weight: 600; color: var(--a-ink); }
.adm-search-sub { margin-left: auto; font-size: 12px; color: var(--a-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }

.adm-icbtn {
    width: 34px;
    height: 34px;
    flex: none;
    border: 1px solid var(--a-line);
    background: #fff;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--a-muted);
    box-shadow: var(--a-sh);
}
.adm-icbtn svg { width: 16px; height: 16px; }
.adm-icbtn:hover { background: #fafbfc; }

.adm-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid var(--a-line);
    border-radius: 99px;
    padding: 4px 13px 4px 4px;
    background: #fff;
    box-shadow: var(--a-sh);
}
.adm-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--pg-red);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}
.adm-user-info { display: flex; flex-direction: column; line-height: 1.15; }
.adm-user-info b { font-size: 12.5px; }
.adm-user-info small { font-size: 10.5px; color: var(--a-faint); font-weight: 500; }

.adm-content { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 24px 70px; }

/* ----- page chrome ----- */

.adm-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.adm-page-head h2 { margin: 0; font-size: 20px; letter-spacing: -.3px; }
.adm-crumb { font-size: 12px; color: var(--a-faint); margin-top: 3px; }
.adm-actions { display: flex; gap: 8px; }

/* buttons inside the admin pick up crisper neutrals */
.adm-shell .btn {
    border-radius: 9px;
    box-shadow: var(--a-sh);
    font-size: 12.5px;
    padding: 8px 14px;
}
.adm-shell .btn-secondary { border-color: var(--a-line); }

/* ----- cards / rows / forms (scoped refinements) ----- */

.adm-shell .admin-card {
    background: var(--a-panel);
    border: 1px solid var(--a-line);
    border-radius: 12px;
    box-shadow: var(--a-sh);
    padding: 18px;
}
.adm-shell .admin-card h3 { margin: 0 0 12px; font-size: 15px; letter-spacing: -.2px; }
.adm-shell .admin-note { color: var(--a-muted); font-size: 13px; line-height: 1.55; }
.adm-shell .admin-note code { background: #f2f4f7; border-radius: 5px; padding: 1px 5px; font-size: 11.5px; }

.adm-shell .admin-row {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--a-line);
    border-radius: 10px;
    padding: 9px 11px;
    margin-bottom: 8px;
    background: #fff;
}
.adm-shell .admin-row-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.adm-shell .admin-row-info strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-shell .admin-row-info span { font-size: 11.5px; color: var(--a-muted); }
.adm-shell .admin-thumb { border-color: var(--a-line2); background: #fafbfc; border-radius: 8px; }

.adm-shell .admin-form { border-top: 1px dashed var(--a-line); }
.adm-shell .admin-form input,
.adm-shell .admin-form select,
.adm-shell .admin-select,
.adm-shell .adm-list-search {
    border: 1px solid var(--a-line);
    border-radius: 9px;
    background: #fafbfc;
    font-size: 13px;
}
.adm-shell .admin-form input:focus,
.adm-shell .adm-list-search:focus { border-color: var(--pg-red); background: #fff; }

/* ----- shops master-detail ----- */

.adm-split {
    display: grid;
    grid-template-columns: 296px 1fr;
    gap: 16px;
    align-items: start;
}

.adm-list-search {
    width: 100%;
    padding: 9px 12px;
    outline: none;
    margin-bottom: 10px;
}

.adm-shop-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    border: 1px solid var(--a-line);
    border-radius: 10px;
    background: #fff;
    padding: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.adm-shop-row:hover { border-color: #d0d5dd; box-shadow: var(--a-sh); }
.adm-shop-row-active { border-color: var(--pg-red); background: var(--pg-red-soft); }

.adm-shop-row-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.adm-shop-row-info strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-shop-row-info span { font-size: 11px; color: var(--a-faint); }

.adm-avatar {
    width: 36px;
    height: 36px;
    flex: none;
    border-radius: 10px;
    background: var(--a-ink);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}
.adm-avatar-lg { width: 52px; height: 52px; border-radius: 14px; font-size: 18px; }

.adm-detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.adm-detail-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.adm-detail-title strong { font-size: 18px; letter-spacing: -.2px; margin-right: 8px; }
.adm-detail-meta { font-size: 12.5px; color: var(--a-muted); }
.adm-detail-meta a { color: var(--pg-red-dark); text-decoration: underline; }
.adm-detail-actions { display: flex; gap: 8px; }

/* ----- KPI tiles ----- */

.adm-tiles {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.adm-tiles-4 { grid-template-columns: repeat(4, 1fr); }
.adm-tile {
    border: 1px solid var(--a-line);
    border-radius: 12px;
    background: var(--a-panel);
    box-shadow: var(--a-sh);
    padding: 14px 15px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.adm-tile strong { font-size: 20px; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.adm-tile span { font-size: 11.5px; color: var(--a-muted); font-weight: 550; }
.adm-tile-click { cursor: pointer; transition: border-color .12s ease, box-shadow .12s ease; }
.adm-tile-click:hover { border-color: var(--pg-red); box-shadow: 0 4px 16px rgba(16, 24, 40, .08); }

/* ----- tabs / tables ----- */

.adm-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--a-line);
    margin-bottom: 14px;
    overflow-x: auto;
}
.adm-tabs button {
    border: none;
    background: none;
    padding: 9px 13px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--a-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
}
.adm-tabs button:disabled { opacity: .45; cursor: default; }
.adm-tabs button:hover:not(:disabled) { color: var(--a-ink); }
.adm-tabs .adm-tab-active { color: var(--pg-red-dark); border-bottom-color: var(--pg-red); }

.adm-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.adm-table th {
    text-align: left;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--a-faint);
    padding: 8px 10px;
    border-bottom: 1px solid var(--a-line2);
    white-space: nowrap;
}
.adm-table td { padding: 9px 10px; border-bottom: 1px solid var(--a-line2); vertical-align: middle; }
.adm-table tr:last-child td { border-bottom: none; }
.adm-table tr:hover td { background: #fafbfc; }

/* status pills inside the admin get the cooler neutrals */
.adm-shell .status-pill { background: #f2f4f7; color: var(--a-muted); }
.adm-shell .status-pill-published { background: #e7f8f0; color: #067647; }
.adm-shell .status-pill-cat { background: var(--pg-red-soft); color: var(--pg-red-dark); }

@media (max-width: 900px) {
    .adm-side { width: 62px; }
    .adm-brand { padding: 14px 0 8px; justify-content: center; }
    .adm-brand > div, .adm-nav span, .adm-side-foot, .adm-nav-label { display: none; }
    .adm-nav { justify-content: center; padding: 11px 0; }
    .adm-search span, .adm-search kbd { display: none; }
    .adm-user-info { display: none; }
    .adm-split { grid-template-columns: 1fr; }
    .adm-tiles { grid-template-columns: repeat(2, 1fr); }
    .adm-content { padding: 14px 12px 70px; }
}

/* ---------- Admin console (shared bits) ---------- */

.admin-root {
    height: 100%;
    overflow-y: auto;
    padding: 22px 26px 60px;
    max-width: 1100px;
    margin: 0 auto;
}

.admin-head {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
}

.admin-logo {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 26px;
    letter-spacing: -.5px;
    cursor: pointer;
}
.admin-logo span { color: var(--pg-red); }

.admin-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--pg-muted);
}

.admin-note { color: var(--pg-muted); font-size: 13.5px; line-height: 1.5; }
.admin-note code { background: #f1efec; border-radius: 5px; padding: 1px 5px; font-size: 12px; }

.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 18px;
    align-items: start;
}
@media (max-width: 820px) {
    .admin-grid { grid-template-columns: 1fr; }
    .admin-root { padding: 16px 14px 60px; }
}

.admin-card {
    background: var(--pg-panel);
    border: 1px solid var(--pg-line);
    border-radius: 14px;
    padding: 18px;
}
.admin-card h3 { margin: 0 0 12px; font-size: 17px; }

.admin-row {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--pg-line);
    border-radius: 10px;
    padding: 8px 10px;
    margin-bottom: 8px;
}
.admin-row-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.admin-row-info strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-row-info span { font-size: 12px; color: var(--pg-muted); }

.admin-thumb {
    width: 38px;
    height: 38px;
    flex: none;
    object-fit: contain;
    background: #fbfaf9;
    border: 1px solid var(--pg-line);
    border-radius: 8px;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
    border-top: 1px dashed var(--pg-line);
    padding-top: 14px;
}
.admin-form input,
.admin-form select,
.admin-select {
    border: 1px solid var(--pg-line);
    border-radius: 9px;
    padding: 10px 12px;
    font-size: 13.5px;
    background: #fbfaf9;
    outline: none;
    width: 100%;
}
.admin-form input:focus, .admin-select:focus { border-color: var(--pg-red); background: #fff; }
.admin-form-row { display: flex; gap: 8px; }
.admin-select { margin-bottom: 12px; }

/* ---------- Blazor error UI (kept from template) ---------- */

#blazor-error-ui {
    background: #FFF6E5;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.status-bar-safe-area { display: none; }

@supports (-webkit-touch-callout: none) {
    .status-bar-safe-area {
        display: flex;
        position: sticky;
        top: 0;
        height: env(safe-area-inset-top);
        background-color: #fff;
        width: 100%;
        z-index: 1;
    }
    .flex-column, .navbar-brand { padding-left: env(safe-area-inset-left); }
}

/* ---------- Left rail (Canva-style) ---------- */

.left-rail {
    flex: none;
    width: 74px;
    background: var(--pg-panel);
    border-right: 1px solid var(--pg-line);
    display: flex;
    flex-direction: column;
    padding: 8px 6px;
    gap: 4px;
    overflow-y: auto;
}

.rail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    border-radius: 10px;
    padding: 10px 2px 8px;
    color: var(--pg-muted);
    transition: background .12s ease, color .12s ease;
}
.rail-item:hover { background: #f1efec; color: var(--pg-ink); }
.rail-item svg { width: 21px; height: 21px; }
.rail-label { font-size: 10.5px; font-weight: 600; }
.rail-active, .rail-active:hover { color: var(--pg-red); background: var(--pg-red-soft); }

/* ---------- Templates panel ---------- */

.template-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 18px;
}

.template-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    padding: 0;
    text-align: left;
}

.template-prev {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    width: 100%;
    border: 1px solid var(--pg-line);
    border-radius: 12px;
    transition: box-shadow .12s ease, border-color .12s ease;
}
.template-card:hover .template-prev { border-color: #C9C7C2; box-shadow: var(--pg-shadow); }
.template-card-active .template-prev { border-color: var(--pg-red); box-shadow: 0 0 0 2px var(--pg-red-soft); }
.template-dot { width: 34%; aspect-ratio: 1; border-radius: 50%; background: rgba(0, 0, 0, .08); }
.template-name { font-size: 12.5px; font-weight: 600; color: var(--pg-ink); }

/* ---------- Text panel ---------- */

.text-styles { display: flex; flex-direction: column; gap: 10px; padding: 0 18px; }

.text-add {
    border: 1px solid var(--pg-line);
    border-radius: 12px;
    background: var(--pg-panel);
    padding: 14px;
    text-align: left;
    color: var(--pg-ink);
    transition: border-color .12s ease, box-shadow .12s ease;
}
.text-add:hover { border-color: #C9C7C2; box-shadow: var(--pg-shadow); }
.text-add-h1 { font-size: 22px; font-weight: 800; }
.text-add-h2 { font-size: 17px; font-weight: 700; }
.text-add-body { font-size: 13px; font-weight: 500; }

/* ---------- Text items & text toolbar ---------- */

.item-text {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.15;
    word-break: break-word;
    overflow: visible;
    white-space: pre-wrap;
}

.layer-thumb-text {
    font-weight: 800;
    font-size: 17px;
    color: var(--pg-muted);
}

.text-toolbar {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--pg-panel);
    border: 1px solid var(--pg-line);
    border-radius: 12px;
    box-shadow: var(--pg-shadow);
    padding: 6px 8px;
    z-index: 60;
    max-width: calc(100% - 24px);
    overflow-x: auto;
}

.tt-font-btn {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--pg-line);
    border-radius: 8px;
    background: #fff;
    height: 30px;
    padding: 0 10px;
    font-size: 13px;
    color: var(--pg-ink);
    max-width: 170px;
    cursor: pointer;
}
.tt-font-btn:hover { background: #faf9f7; }
.tt-font-btn span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tt-font-btn svg { width: 12px; height: 12px; flex: none; color: var(--pg-muted); }

.font-pop {
    position: absolute;
    top: 62px;
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    background: var(--pg-panel);
    border: 1px solid var(--pg-line);
    border-radius: 12px;
    box-shadow: var(--pg-shadow);
    z-index: 70;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.font-search {
    width: 100%;
    border: 1px solid var(--pg-line);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    outline: none;
    background: #fbfaf9;
}
.font-search:focus { border-color: var(--pg-red); background: #fff; }

.font-list {
    height: 320px;
    overflow-y: auto;
}

.font-row {
    display: flex;
    align-items: center;
    width: 100%;
    height: 30px;
    padding: 2px 8px;
    border: none;
    background: none;
    border-radius: 7px;
    text-align: left;
    cursor: pointer;
}
.font-row:hover { background: #f5f3f0; }
.font-row img { height: 18px; max-width: 100%; }
.font-row-name { font-size: 13.5px; font-weight: 600; color: var(--pg-ink); }

.font-loading {
    margin: 12px 8px;
    font-size: 12.5px;
    color: var(--pg-muted);
}

.tt-size {
    flex: none;
    display: flex;
    align-items: center;
    border: 1px solid var(--pg-line);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.tt-size button {
    border: none;
    background: none;
    width: 26px;
    height: 30px;
    font-size: 15px;
    color: var(--pg-ink);
}
.tt-size button:hover { background: #f1efec; }
.tt-size input {
    width: 42px;
    border: none;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    outline: none;
    background: transparent;
    -moz-appearance: textfield;
    appearance: textfield;
}
.tt-size input::-webkit-outer-spin-button,
.tt-size input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.tt-color {
    position: relative;
    flex: none;
    width: 30px;
    height: 30px;
    border: 1px solid var(--pg-line);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #fff;
}
.tt-color input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.tt-color span {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, .15);
    pointer-events: none;
}

.item-text-editing {
    pointer-events: auto;
    cursor: text;
    outline: none;
    user-select: text;
    -webkit-user-select: text;
    caret-color: var(--pg-red);
}
.item-text-editing:empty::before {
    content: "Type…";
    color: rgba(0, 0, 0, .25);
}

.tt-edit {
    width: auto !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    font-weight: 600;
    font-size: 13px;
}
.tt-edit svg { width: 14px; height: 14px; }

.tt-btn {
    flex: none;
    width: 30px;
    height: 30px;
    border: 1px solid var(--pg-line);
    border-radius: 8px;
    background: var(--pg-panel);
    font-size: 13.5px;
    color: var(--pg-ink);
}
.tt-btn:hover { background: #f1efec; }
.tt-active,
.tt-active:hover {
    background: var(--pg-red-soft);
    border-color: var(--pg-red);
    color: var(--pg-red-dark);
}

/* ---------- Backgrounds panel + canvas background ---------- */

.canvas-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.canvas-bg svg {
    width: 100%;
    height: 100%;
    display: block;
}

.bg-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 18px;
}

.bg-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    padding: 0;
    text-align: left;
    cursor: pointer;
}

.bg-prev {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid var(--pg-line);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.bg-prev svg {
    width: 100%;
    height: 100%;
    display: block;
}
.bg-card:hover .bg-prev,
.bg-card:hover .bg-none-swatch { border-color: #C9C7C2; box-shadow: var(--pg-shadow); }
.bg-card-active .bg-prev,
.bg-card-active .bg-none-swatch { border-color: var(--pg-red); box-shadow: 0 0 0 2px var(--pg-red-soft); }

.bg-none-swatch {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1;
    border: 1px dashed #C9C7C2;
    border-radius: 12px;
    transition: border-color .12s ease, box-shadow .12s ease;
}

.bg-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--pg-ink);
}

.set-mini-bg {
    position: absolute;
    inset: 0;
}
.set-mini-bg svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ---------- Layers multi-select ---------- */

.layers-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
}

.multi-toggle {
    border: 1px solid var(--pg-line);
    background: var(--pg-panel);
    border-radius: 999px;
    padding: 5px 11px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--pg-muted);
    transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.multi-toggle:hover { background: #faf9f7; }
.multi-toggle-on {
    background: var(--pg-red-soft);
    border-color: var(--pg-red);
    color: var(--pg-red-dark);
}

/* ---------- Text templates (Text panel) ---------- */

.tpl-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 18px 20px;
}

.tpl-card {
    border: 1px solid var(--pg-line);
    border-radius: 10px;
    background: #fff;
    padding: 6px;
    cursor: pointer;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.tpl-card:hover:not(:disabled) { border-color: #C9C7C2; box-shadow: var(--pg-shadow); }
.tpl-card:disabled { cursor: default; }
.tpl-card.tpl-busy { border-color: var(--pg-red); opacity: .7; }

.tpl-card img {
    width: 100%;
    display: block;
    border-radius: 6px;
}

/* ---------- Set details (right panel) ---------- */

.set-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 18px 4px;
}

.set-details .prop-field select {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    font-weight: 600;
    width: 100%;
    color: var(--pg-ink);
    padding: 0;
}

/* ---------- Category autocomplete ---------- */

.prop-combo { position: relative; }

.combo-pop {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--pg-panel);
    border: 1px solid var(--pg-line);
    border-radius: 10px;
    box-shadow: var(--pg-shadow);
    z-index: 80;
    max-height: 210px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 4px;
}

.combo-opt {
    border: none;
    background: none;
    text-align: left;
    padding: 8px 10px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 7px;
    color: var(--pg-ink);
    cursor: pointer;
}
.combo-opt:hover { background: #f5f3f0; }
.combo-add { color: var(--pg-red-dark); }

/* ---------- Sets panel ---------- */

.sets-actions {
    display: flex;
    gap: 8px;
    margin: 0 18px 14px;
}
.sets-actions .btn { flex: 1; }

.sets-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 18px;
}

.set-row {
    display: flex;
    gap: 12px;
    align-items: center;
    border: 1px solid var(--pg-line);
    border-radius: 12px;
    padding: 10px;
    background: var(--pg-panel);
    text-align: left;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.set-row:hover { border-color: #C9C7C2; box-shadow: var(--pg-shadow); }
.set-row-active { border-color: var(--pg-red); }

.set-mini {
    position: relative;
    width: 64px;
    height: 64px;
    flex: none;
    border-radius: 8px;
    border: 1px solid var(--pg-line);
    overflow: hidden;
}

.set-mini-item { position: absolute; }
.set-mini-item svg,
.set-mini-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.set-mini-text {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 2px;
    background: rgba(0, 0, 0, .12);
}

.set-row-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    min-width: 0;
}

.set-row-name {
    font-size: 13.5px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.set-row-meta { font-size: 12px; color: var(--pg-muted); }

.status-pill {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .5px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #F1EFEC;
    color: var(--pg-muted);
}
.status-pill-published { background: #E6F4EA; color: #2E7D32; }
.status-pill-cat { background: var(--pg-red-soft); color: var(--pg-red-dark); }

.set-row-pills { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Editor responsive (small screens) ---------- */

/* Desktop: wrappers are transparent to the flex layout; tab bar hidden. */
.panel-wrap { display: contents; }
.mobile-tabs { display: none; }

.editor-root { height: 100dvh; }

@media (max-width: 820px) {

    /* --- top bar: compact --- */
    .topbar { padding: 8px 10px; gap: 8px; }
    .topbar .logo-word,
    .topbar-sep,
    .draft-badge,
    .topbar-divider,
    .zoom-label { display: none; }
    .topbar-left { flex: 1; }
    .set-name { flex: 1; min-width: 40px; max-width: 150px; font-size: 14px; }
    .topbar .btn { padding: 8px 11px; font-size: 12.5px; }

    /* --- canvas --- */
    .canvas-viewport { padding: 14px; }

    /* --- side panels become bottom sheets --- */
    .panel-wrap {
        display: flex;
        flex-direction: column;
        position: fixed;
        left: 0;
        right: 0;
        bottom: calc(53px + env(safe-area-inset-bottom, 0px));
        height: 62dvh;
        z-index: 120;
        transform: translateY(115%);
        transition: transform .22s ease;
        pointer-events: none;
        background: var(--pg-panel);
        border-top: 1px solid var(--pg-line);
        border-radius: 16px 16px 0 0;
        overflow: hidden;
        box-shadow: 0 -12px 40px rgba(20, 20, 25, .18);
    }
    .panel-wrap.panel-open {
        transform: none;
        pointer-events: auto;
    }
    .panel-wrap .closet-panel,
    .panel-wrap .right-panel {
        flex: 1;
        min-height: 0;
        width: 100%;
        height: auto;
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding-bottom: 24px;
    }

    /* rail sits horizontally at the top of the sheet */
    .panel-wrap .left-rail {
        flex: none;
        flex-direction: row;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--pg-line);
        padding: 2px 6px;
        gap: 2px;
        overflow: visible;
    }
    .panel-wrap .rail-item { flex: 1; padding: 7px 2px 6px; }
    .closet-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

    /* --- bottom tab bar --- */
    .mobile-tabs {
        display: flex;
        flex: none;
        background: var(--pg-panel);
        border-top: 1px solid var(--pg-line);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        z-index: 130;
    }
    .mobile-tabs button {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        background: none;
        border: none;
        padding: 7px 0 8px;
        font-size: 11px;
        font-weight: 600;
        color: var(--pg-muted);
    }
    .mobile-tabs button svg { width: 20px; height: 20px; }
    .mobile-tabs button.active { color: var(--pg-red); }

    /* --- bigger touch targets for canvas handles --- */
    .handle { width: 16px; height: 16px; }
    .handle-nw { left: -8px;  top: -8px; }
    .handle-ne { right: -8px; top: -8px; }
    .handle-sw { left: -8px;  bottom: -8px; }
    .handle-se { right: -8px; bottom: -8px; }

    .handle-n, .handle-s { width: 28px; height: 11px; margin-left: -14px; }
    .handle-n { top: -6px; }
    .handle-s { bottom: -6px; }
    .handle-w, .handle-e { width: 11px; height: 28px; margin-top: -14px; }
    .handle-w { left: -6px; }
    .handle-e { right: -6px; }

    .handle-rotate { top: -37px; margin-left: -8px; }

    .zoom-pill { bottom: 12px; }

    .text-toolbar { top: 8px; padding: 5px 6px; gap: 5px; }
    .tt-font-btn { max-width: 110px; }
    .font-pop { width: calc(100% - 16px); max-width: 280px; }
}

/* ---------- published-set preview (Discover cards) ---------- */

.pgprev {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    container-type: inline-size; /* enables cqw font sizing in previews */
}

.pgprev-bg { position: absolute; inset: 0; pointer-events: none; }
.pgprev-bg svg { width: 100%; height: 100%; display: block; }

.pgprev-item { position: absolute; pointer-events: none; }

.pgprev-art { width: 100%; height: 100%; }

.pgprev-art svg,
.pgprev-art img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    user-select: none;
}

.pgprev-text {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.15;
    overflow: hidden;
}

/* ============ Site pages — "Social Edit" style ============
   Shared by SiteHeader, Discover, Feed, People, Profile and Competitions.
   White canvas, Georgia display type over Arial text, hairline dividers,
   ink-black buttons and a rose accent. */

.home-root {
    --s-ink: #202023;
    --s-muted: #8c8c91;
    --s-faint: #b0b0b0;
    --s-line: #ededed;
    --s-line-strong: #e4e4e4;
    --s-chip: #f7f7f7;
    --s-paper: #f1efea;
    --s-rose: #e63973;
    --s-rose-text: #d83e77;
    --s-blush: #f9f6f8;
    --s-blush-line: #eee7ec;
    --s-plum: #b2728b;
    --s-serif: Georgia, 'Times New Roman', serif;
    --s-rail: 244px;

    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    background: #fff;
    color: var(--s-ink);
    font: 14px Arial, Helvetica, sans-serif;
    padding-left: var(--s-rail);
}

.home-root button { border: 0; background: none; color: inherit; font: inherit; cursor: pointer; padding: 0; }
.home-root button:hover { opacity: .75; }

.home-root svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: middle;
    flex: none;
}

/* ---------- maintenance banner ---------- */

.pg-maintenance-banner {
    background: var(--s-ink);
    color: #fff;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    padding: 9px 16px;
}

/* ---------- left rail ---------- */

.pg-rail {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--s-rail);
    border-right: 1px solid #e9e9e9;
    padding: 40px 24px 28px;
    display: flex;
    flex-direction: column;
    background: #fff;
    z-index: 40;
}

.pg-brand {
    font: bold italic 31px var(--s-serif);
    letter-spacing: -2px;
    margin: 0 0 43px 6px;
    cursor: pointer;
    white-space: nowrap;
}

.pg-brand span { color: var(--s-rose); }

.pg-rail nav { display: flex; flex-direction: column; gap: 6px; }

.home-root .pg-navitem {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 12px 11px;
    text-align: left;
    font-size: 15px;
    border-radius: 8px;
    white-space: nowrap;
    width: 100%;
}

.home-root .pg-navitem:hover { opacity: 1; background: #fafafa; }
.pg-navitem.active { font-weight: bold; background: var(--s-chip); }
.home-root .pg-navitem.active svg { stroke-width: 2.5; }
.pg-navitem.soon { color: var(--s-faint); cursor: default; }
.pg-navitem span { overflow: hidden; text-overflow: ellipsis; }

.home-root .pg-create {
    margin-top: 29px;
    background: var(--s-ink);
    color: #fff;
    border-radius: 9px;
    padding: 14px;
    font-weight: bold;
}

.pg-rail-bottom { margin-top: auto; }

.pg-mobilehead,
.pg-mobile-nav { display: none; }

/* ---------- page body ---------- */

.home-body {
    max-width: 1180px;
    margin: 0 auto;
    padding: 34px 48px 64px;
}

/* ---------- featured competition hero (light editorial card) ---------- */

.hero {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    background: var(--s-blush);
    border: 1px solid var(--s-blush-line);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 52px;
}

.hero-copy {
    padding: 44px 44px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}

.hero-live {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    font-size: 10px;
    letter-spacing: 1.8px;
    color: var(--s-plum);
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--s-rose);
    display: inline-block;
}

.hero-title {
    font: 52px/1.02 var(--s-serif);
    letter-spacing: -1px;
}

.hero-blurb {
    font-size: 13px;
    line-height: 1.7;
    color: #8b7e87;
    margin: 0;
    max-width: 420px;
}

.hero-stats { display: flex; gap: 34px; margin-top: 4px; }

.stat-val { font: 24px var(--s-serif); }
.stat-val.accent { color: var(--s-rose); }

.stat-label {
    font-size: 9px;
    font-weight: bold;
    color: var(--s-muted);
    letter-spacing: 1.6px;
    margin-top: 2px;
}

.home-root .hero-cta { align-self: flex-start; margin-top: 10px; padding: 14px 26px; }

.hero-art {
    position: relative;
    background: var(--s-paper);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 380px;
}

.hero-art span {
    font: italic 26px var(--s-serif);
    color: #625d56;
    transform: rotate(-8deg);
}

/* ---------- section headings ---------- */

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding-bottom: 16px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--s-line);
}

.section-head.spaced { margin-top: 52px; }

.section-title { font: 26px var(--s-serif); }

.section-sub {
    color: #999;
    font-size: 10px;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    margin-top: 6px;
}

.see-all {
    font-weight: bold;
    color: var(--s-rose-text);
    font-size: 11px;
    cursor: pointer;
}

/* ---------- trending sets (masonry) ---------- */

.masonry {
    column-count: 4;
    column-gap: 16px;
}

.set-card {
    break-inside: avoid;
    margin-bottom: 16px;
    position: relative;
    border-radius: 3px;
    overflow: hidden;
    background: #f5f3ef;
    cursor: pointer;
}

.set-art {
    background: var(--s-paper);
    display: flex;
    align-items: center;
    justify-content: center;
}

.set-art span {
    font: italic 20px var(--s-serif);
    color: #625d56;
    transform: rotate(-8deg);
}

.set-overlay {
    position: absolute;
    inset: 0;
    opacity: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,.62));
    transition: opacity .2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 14px;
}

.set-card:hover .set-overlay { opacity: 1; }

.set-overlay-top { display: flex; justify-content: flex-end; }

.save-chip {
    background: #fff;
    color: var(--s-ink);
    font-size: 11px;
    padding: 9px 14px;
    border-radius: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
}

.set-overlay-info { color: #fff; }

.set-title {
    font: 20px/1.15 var(--s-serif);
}

.set-author {
    font-size: 11px;
    color: rgba(255,255,255,.82);
    margin-top: 4px;
}

.set-counts {
    display: flex;
    gap: 14px;
    margin-top: 8px;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ---------- celebrity looks ---------- */

.celeb-row {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.celeb-card {
    flex: 0 0 240px;
    cursor: pointer;
}

.celeb-art {
    height: 300px;
    border-radius: 9px;
    overflow: hidden;
    background: #3a3733;
    position: relative;
    display: flex;
    align-items: flex-end;
}

.celeb-tag {
    position: absolute;
    top: 14px;
    left: 16px;
    font-size: 8px;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,.55);
}

.celeb-caption {
    width: 100%;
    padding: 18px 17px;
    color: #fff;
}

.celeb-name { font: 23px/1.05 var(--s-serif); }

.celeb-event {
    font-size: 8px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-top: 7px;
    color: rgba(255,255,255,.75);
}

.celeb-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 2px;
}

.celeb-looks { font-size: 11px; color: var(--s-muted); }

.celeb-recreate {
    font-weight: bold;
    font-size: 11px;
    color: var(--s-rose-text);
}

/* ---------- people to follow ---------- */

.people-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.person-card {
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 24px 18px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
}

.person-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(35deg, #facd6a, #f03d68, #ba44bb);
    box-shadow: inset 0 0 0 6px #fff;
}

.person-name {
    font-weight: bold;
    font-size: 13px;
    margin-top: 10px;
}

.person-handle { font-size: 11px; color: var(--s-muted); }

.person-meta { font-size: 10px; color: var(--s-faint); margin-top: 2px; }

.home-root .follow-btn {
    margin-top: 12px;
    width: 100%;
    background: var(--s-ink);
    color: #fff;
    font-weight: bold;
    font-size: 11px;
    padding: 10px;
    border-radius: 7px;
    border: 1px solid var(--s-ink);
}

.home-root .follow-btn.on { background: #fff; color: var(--s-ink); border-color: #e8e8e8; }
.home-root .follow-btn:disabled { opacity: .55; cursor: default; }

/* ---------- open competitions ---------- */

.comp-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.comp-card {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
}

.comp-art {
    height: 150px;
    background: var(--s-paper);
    display: flex;
    align-items: center;
    justify-content: center;
}

.comp-art span {
    font: italic 20px var(--s-serif);
    color: #625d56;
    transform: rotate(-6deg);
}

.comp-body { padding: 18px 18px 20px; }

.comp-theme { font: 22px/1.1 var(--s-serif); }

.comp-stats { display: flex; gap: 18px; margin-top: 14px; }

.comp-val { font-weight: bold; font-size: 13px; }
.comp-val.accent { color: var(--s-rose); }

.comp-label { font-size: 10px; color: var(--s-muted); margin-top: 2px; }

.home-root .comp-enter { margin-top: 16px; width: 100%; padding: 11px; }

/* ---------- buttons ---------- */

.home-root .pill-btn {
    background: var(--s-ink);
    color: #fff;
    font-weight: bold;
    font-size: 12px;
    padding: 12px 18px;
    border-radius: 7px;
    border: 1px solid var(--s-ink);
    white-space: nowrap;
}

.home-root .pill-btn.ghost {
    background: #fff;
    color: var(--s-ink);
    border-color: #e8e8e8;
}

.home-root .pill-btn.ghost:hover { border-color: var(--s-ink); opacity: 1; }
.home-root .pill-btn:disabled { opacity: .55; cursor: default; }

.home-root .pink-link {
    font-size: 11px;
    color: var(--s-rose-text);
    font-weight: bold;
    margin-left: auto;
    flex: none;
}

/* ---------- social: avatars ---------- */

.pg-avatar {
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: .5px;
    user-select: none;
    flex-shrink: 0;
}

/* ---------- social: profile page ---------- */

.profile-head {
    display: flex;
    gap: 34px;
    align-items: flex-start;
    padding: 12px 0 26px;
    border-bottom: 1px solid var(--s-line);
}

.profile-id { flex: 1; min-width: 0; }

.profile-name { font: 30px/1.1 var(--s-serif); }

.profile-handle { color: var(--s-muted); font-size: 12px; margin-top: 6px; }

.profile-bio { margin: 12px 0 0; max-width: 560px; color: #55555a; font-size: 13px; line-height: 1.7; }

.profile-stats { display: flex; gap: 24px; margin-top: 16px; flex-wrap: wrap; }

.profile-stat {
    cursor: pointer;
    font-size: 12px;
    color: var(--s-muted);
    padding-bottom: 6px;
    border-bottom: 2px solid transparent;
}

.profile-stat b { color: var(--s-ink); font-size: 14px; margin-right: 4px; }
.profile-stat:hover { color: var(--s-ink); }
.profile-stat-on { border-bottom-color: var(--s-ink); color: var(--s-ink); }

.profile-actions { display: flex; gap: 10px; flex-shrink: 0; flex-wrap: wrap; }

.profile-edit {
    background: var(--s-blush);
    border: 1px solid var(--s-blush-line);
    border-radius: 12px;
    padding: 20px;
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 560px;
}

.profile-edit label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 9px;
    font-weight: bold;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--s-plum);
}

.profile-edit input,
.profile-edit textarea,
.people-search {
    font: 13px Arial, Helvetica, sans-serif;
    letter-spacing: 0;
    text-transform: none;
    color: var(--s-ink);
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    resize: vertical;
    outline: none;
}

.profile-edit input:focus,
.profile-edit textarea:focus,
.people-search:focus { border-color: var(--s-ink); }

.people-search { min-width: 260px; }

.swatch-row { display: flex; gap: 8px; flex-wrap: wrap; }

.swatch {
    width: 26px; height: 26px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px #e8e8e8;
    display: inline-block;
}
.swatch-on { box-shadow: 0 0 0 2px var(--s-ink); }

.pg-error { color: #c02a50; font-size: 12px; margin-left: 10px; }

.pg-empty {
    padding: 70px 15px;
    text-align: center;
    color: #888;
    font-size: 13px;
    line-height: 1.7;
}

/* ---------- social: requests + people rows ---------- */

.requests-box {
    background: var(--s-blush);
    border: 1px solid var(--s-blush-line);
    border-radius: 12px;
    padding: 18px 20px;
    margin-top: 22px;
}

.person-list { margin-top: 12px; display: flex; flex-direction: column; }

.person-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--s-line);
}
.person-row:last-child { border-bottom: none; }

.person-row-id { display: flex; align-items: center; gap: 10px; cursor: pointer; min-width: 0; }
.person-row-name { display: block; font-weight: bold; font-size: 12px; }
.person-row-handle { display: block; font-size: 10px; color: var(--s-muted); margin-top: 4px; }
.person-row-actions { display: flex; gap: 8px; flex-shrink: 0; }

.person-row .follow-btn { width: auto; margin-top: 0; padding: 9px 16px; }

/* ---------- social: like chip on set cards ---------- */

.like-chip { cursor: pointer; user-select: none; }
.like-chip.liked { color: var(--s-rose); }

.set-author-link { cursor: pointer; }
.set-author-link:hover { text-decoration: underline; }

/* ---------- signed-in home feed (/home) ---------- */

.home-body:has(.feed-shell) { max-width: none; padding: 0 35px 40px; }

.feed-shell {
    display: grid;
    grid-template-columns: minmax(440px, 600px) 280px;
    gap: 55px;
    justify-content: center;
}

.feed-main { min-width: 0; }

.feed-topbar {
    height: 89px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--s-line);
}

.feed-wordmark { font: normal 25px var(--s-serif); margin: 0; }

.feed-topbar small {
    display: block;
    font-size: 10px;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: #999;
    margin-top: 4px;
}

.view-tabs { display: flex; gap: 22px; }
.home-root .view-tabs button { font-size: 13px; padding: 15px 0; color: #999; }
.home-root .view-tabs .selected { color: #222; font-weight: bold; border-bottom: 2px solid; }

.stories {
    display: flex;
    gap: 20px;
    padding: 26px 0 24px;
    overflow-x: auto;
    border-bottom: 1px solid var(--s-line);
}

.home-root .story {
    width: 64px;
    flex-shrink: 0;
    font-size: 10px;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.story .ring {
    width: 64px;
    height: 64px;
    padding: 3px;
    border-radius: 50%;
    background: linear-gradient(35deg, #facd6a, #f03d68, #ba44bb);
    margin-bottom: 9px;
    display: block;
}

.story .ring-inner {
    display: flex;
    width: 100%;
    height: 100%;
    border: 3px solid #fff;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
}

.story .ring-inner .pg-avatar { width: 100% !important; height: 100% !important; }

.story.add .ring {
    background: #efefef;
    display: grid;
    place-items: center;
    font-size: 24px;
    border: 2px dashed #ccc;
}

.story-name { max-width: 64px; overflow: hidden; text-overflow: ellipsis; }

.post {
    border-bottom: 1px solid var(--s-line-strong);
    padding-bottom: 22px;
    margin-bottom: 10px;
}

.posthead { display: flex; align-items: center; padding: 17px 0; gap: 10px; }

.username { display: block; font-size: 12px; font-weight: bold; }

.sub { display: block; font-size: 10px; color: var(--s-muted); margin-top: 4px; }

.postimage {
    position: relative;
    overflow: hidden;
    background: #f5f3ef;
    border-radius: 3px;
}

.actions { display: flex; align-items: center; gap: 16px; padding-top: 16px; }

.home-root .actions .liked { color: #ed376a; opacity: 1; }
.home-root .actions .liked svg { fill: #ed376a; }

.likes { font-size: 11px; font-weight: bold; margin: 12px 0 9px; }

.caption { font-size: 12px; line-height: 1.7; }
.caption strong { margin-right: 6px; }

.feed-right { padding-top: 34px; }

.feed-me { display: flex; gap: 12px; align-items: center; }
.feed-me-id { cursor: pointer; min-width: 0; }

.feed-me-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 16px;
    font-size: 11px;
    color: var(--s-muted);
}

.feed-me-stats span { cursor: pointer; }
.feed-me-stats b { color: var(--s-ink); }

.feed-requests {
    margin-top: 18px;
    background: #fdecf2;
    border: 1px solid #f6cfdd;
    border-radius: 9px;
    padding: 12px 14px;
    font-size: 11px;
    color: #a3305b;
    cursor: pointer;
}

.welcome {
    background: var(--s-blush);
    border: 1px solid var(--s-blush-line);
    border-radius: 12px;
    padding: 20px;
    margin: 29px 0;
}

.label {
    font-size: 9px;
    font-weight: bold;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--s-plum);
}

.welcome h2 { font: normal 27px/1.15 var(--s-serif); margin: 13px 0; }
.welcome p { font-size: 11px; color: #8b7e87; line-height: 1.7; }

.home-root .welcome button {
    background: #222;
    color: #fff;
    padding: 12px 16px;
    width: 100%;
    border-radius: 7px;
    font-size: 11px;
    font-weight: bold;
    margin-top: 5px;
}

.sectionhead {
    display: flex;
    justify-content: space-between;
    margin: 26px 0 19px;
    font-size: 11px;
    color: #999;
}

.home-root .sectionhead button { font-size: 10px; font-weight: bold; color: var(--s-ink); }

.suggestion { display: flex; align-items: center; gap: 10px; margin: 17px 0; }

.pg-footer { color: var(--s-faint); font-size: 9px; line-height: 2; margin-top: 27px; }

/* ---------- challenges ---------- */

.chal-head { padding-top: 6px; }
.chal-head .hero-title { max-width: 720px; }

.chal-mine,
.chal-winner-banner {
    margin-top: 22px;
    background: var(--s-blush);
    border: 1px solid var(--s-blush-line);
    border-radius: 12px;
    padding: 14px 18px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
}

.chal-picker {
    background: var(--s-blush);
    border: 1px solid var(--s-blush-line);
    border-radius: 12px;
    padding: 20px;
    margin-top: 24px;
}

.chal-picker .set-card { border: 3px solid transparent; }
.chal-picker .set-card.chal-picked { border-color: var(--s-rose); }

.chal-pick-label {
    padding: 8px 12px;
    font-weight: bold;
    font-size: 12px;
    background: #fff;
}

.chal-rank {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 5;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    font-size: 10px;
    padding: 6px 10px;
    border-radius: 15px;
}

/* ---------- responsive ---------- */

@media (min-width: 1450px) {
    .feed-shell { gap: 75px; }
}

@media (max-width: 1200px) {
    .home-root { --s-rail: 82px; }
    .pg-rail { padding: 35px 15px 24px; align-items: center; }
    .pg-brand { font-size: 0; letter-spacing: 0; margin: 0 0 40px; }
    .pg-brand::after { content: 'pg.'; font: bold italic 36px var(--s-serif); letter-spacing: -1px; }
    .pg-brand span { display: none; }
    .home-root .pg-navitem { padding: 13px; width: auto; }
    .pg-navitem span, .home-root .pg-create { display: none; }
    .masonry { column-count: 3; }
    .people-grid { grid-template-columns: repeat(2, 1fr); }
    .comp-grid { grid-template-columns: repeat(2, 1fr); }
    .feed-shell { gap: 32px; grid-template-columns: minmax(400px, 580px) 245px; }
}

@media (max-width: 1000px) {
    .feed-right { display: none; }
    .feed-shell { grid-template-columns: minmax(0, 600px); }
    .hero { grid-template-columns: 1fr; }
    .hero-art { min-height: 220px; }
    .hero-title { font-size: 42px; }
    .masonry { column-count: 2; }
    .home-body { padding: 26px 30px 56px; }
}

@media (max-width: 650px) {
    .home-root { padding-left: 0; padding-bottom: 60px; }
    .pg-rail { display: none; }
    .pg-mobilehead {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 60px;
        padding: 0 17px;
        border-bottom: 1px solid var(--s-line);
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 40;
    }
    .pg-mobilehead .pg-brand { margin: 0; font-size: 30px; letter-spacing: -1px; }
    .pg-mobilehead .pg-brand::after { content: none; }
    .pg-mobilehead .pg-brand span { display: inline; }
    .home-root .pg-mobile-create { font-size: 11px; font-weight: bold; color: var(--s-rose-text); }
    .pg-mobile-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        border-top: 1px solid #eee;
        background: #fff;
        display: flex;
        justify-content: space-around;
        align-items: center;
        padding: 11px 0;
        z-index: 40;
    }
    .home-root .pg-mobile-nav button { color: #999; }
    .home-root .pg-mobile-nav button.active { color: var(--s-ink); }
    .home-root .pg-mobile-nav button.active svg { stroke-width: 2.5; }
    .home-body { padding: 20px 15px 40px; }
    .home-body:has(.feed-shell) { padding: 0; }
    .feed-topbar { padding: 0 15px; height: 70px; }
    .feed-wordmark { font-size: 21px; }
    .feed-topbar small { display: none; }
    .stories { padding: 18px 15px; gap: 18px; }
    .posthead { padding: 15px; }
    .actions, .likes, .caption { margin-left: 15px; margin-right: 15px; }
    .postimage { border-radius: 0; }
    .hero-copy { padding: 28px 22px; }
    .hero-title { font-size: 34px; }
    .hero-stats { gap: 22px; }
    .people-grid { gap: 10px; }
    .comp-grid { grid-template-columns: 1fr; }
    .profile-head { flex-wrap: wrap; gap: 18px; }
    .section-head { flex-wrap: wrap; align-items: flex-start; gap: 14px; }
    .people-search { min-width: 0; width: 100%; }
}

/* ---------- Import Centre (admin/imports) ---------- */

.adm-import-drop {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border: 1px dashed var(--a-line);
    border-radius: 10px;
    background: #fafbfc;
}

.adm-import-paste {
    width: 100%;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    padding: 10px 12px;
    border: 1px solid var(--a-line);
    border-radius: 10px;
    background: #fff;
    color: var(--a-ink);
}
.adm-import-paste:focus { border-color: var(--pg-red); outline: none; }

.adm-map-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.adm-map-row { display: flex; flex-direction: column; gap: 5px; }
.adm-map-row label { font-size: 12px; font-weight: 650; color: var(--a-muted); }
.adm-map-row select {
    padding: 8px 10px;
    border: 1px solid var(--a-line);
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
}

.adm-truncate {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.adm-shell .status-pill-error { background: #FDECEC; color: #B42318; }
.status-pill-error { background: #FDECEC; color: #B42318; }

.adm-bar-row {
    display: grid;
    grid-template-columns: 120px 1fr 56px;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
}
.adm-bar-label { font-size: 12.5px; font-weight: 600; color: var(--a-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-bar-track { height: 8px; border-radius: 99px; background: #f1f2f5; overflow: hidden; }
.adm-bar-fill { height: 100%; border-radius: 99px; background: var(--pg-red); }
.adm-bar-value { font-size: 12.5px; font-weight: 650; color: var(--a-muted); text-align: right; font-variant-numeric: tabular-nums; }

.chal-rank-1 { background: #e0426a; }
