/* ToteCraft sub-brand theme — tokens and .tc-* live only under .totecraft-theme. */

.totecraft-theme {
    --totecraft-green: #2E614E;
    --totecraft-green-hover: #245041;
    --totecraft-cream: #F5F0E8;
    --totecraft-warning: #E8A045;
    background: var(--totecraft-cream);
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding-left: calc(50vw - 50%);
    padding-right: calc(50vw - 50%);
    min-height: 60vh;
}

.totecraft-theme .tc-display {
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.totecraft-theme .tc-display-sm {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.totecraft-theme .tc-kicker {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--totecraft-green);
}

.totecraft-theme .tc-lead {
    font-size: 1.125rem;
    color: #444;
}

.totecraft-theme .tc-btn-primary {
    background: var(--totecraft-green);
    border-color: var(--totecraft-green);
    color: #fff;
    border-radius: 9999px;
    font-weight: 600;
}

.totecraft-theme .tc-btn-primary:hover,
.totecraft-theme .tc-btn-primary:focus {
    background: var(--totecraft-green-hover);
    border-color: var(--totecraft-green-hover);
    color: #fff;
}

.totecraft-theme .tc-btn-primary:disabled {
    opacity: 0.55;
}

.totecraft-theme .tc-btn-ghost {
    background: transparent;
    border: 1px solid var(--totecraft-green);
    color: var(--totecraft-green);
    border-radius: 9999px;
    font-weight: 600;
}

.totecraft-theme .tc-btn-ghost:hover,
.totecraft-theme .tc-btn-ghost:focus {
    background: rgba(46, 97, 78, 0.08);
    border-color: var(--totecraft-green-hover);
    color: var(--totecraft-green-hover);
}

.totecraft-theme .tc-breadcrumb .breadcrumb {
    background: transparent;
    padding: 0;
    font-size: 0.875rem;
}

.totecraft-theme .tc-breadcrumb .breadcrumb-item a {
    color: var(--totecraft-green);
    text-decoration: none;
    font-weight: 600;
}

.totecraft-theme .tc-breadcrumb .breadcrumb-item a:hover,
.totecraft-theme .tc-breadcrumb .breadcrumb-item a:focus {
    color: var(--totecraft-green-hover);
    text-decoration: underline;
}

.totecraft-theme .tc-breadcrumb .breadcrumb-item.active {
    color: #6b7280;
}

.totecraft-theme .tc-inline-link {
    color: var(--totecraft-green);
    font-weight: 600;
    text-decoration: none;
}

.totecraft-theme .tc-inline-link:hover,
.totecraft-theme .tc-inline-link:focus {
    color: var(--totecraft-green-hover);
    text-decoration: underline;
}

.totecraft-theme .tc-asis-link:disabled {
    opacity: 0.45;
    pointer-events: none;
    text-decoration: none;
}

.totecraft-theme .tc-legal {
    font-size: 0.8125rem;
    color: #6b7280;
}

.totecraft-theme .tc-hero-card {
    position: relative;
    overflow: visible;
    min-height: 220px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    /* Figure-2 style: no card chrome — bags sit on page cream. */
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0.5rem 0.35rem 1.75rem;
}

.totecraft-theme .tc-hero-card__img {
    display: block;
    width: 100%;
    height: auto;
    max-height: min(52vh, 420px);
    object-fit: contain;
    object-position: center bottom;
    /* Soft ground shadow (works best with transparent hero WebP/PNG). */
    filter: drop-shadow(0 14px 18px rgba(55, 45, 35, 0.18))
            drop-shadow(0 4px 6px rgba(55, 45, 35, 0.08));
}

/* Legacy modifiers no longer used; keep inert for any cached markup. */
.totecraft-theme .tc-hero-card--accent,
.totecraft-theme .tc-hero-card--warm {
    background: transparent;
}

.totecraft-theme .tc-feature-card__icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    background: rgba(46, 97, 78, 0.12);
    color: var(--totecraft-green);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.totecraft-theme .tc-step-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.25rem 1.35rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.totecraft-theme .tc-step-card__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 9999px;
    background: var(--totecraft-green);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.totecraft-theme .tc-cta-band {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem 1.75rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.totecraft-theme .tc-accordion .accordion-item {
    background: #fff;
    border: 0;
    border-radius: 12px !important;
    margin-bottom: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.totecraft-theme .tc-accordion .accordion-button {
    background: #fff;
    color: #111;
    font-weight: 600;
    box-shadow: none;
}

.totecraft-theme .tc-accordion .accordion-button:not(.collapsed) {
    background: #fff;
    color: var(--totecraft-green);
}

.totecraft-theme .tc-accordion .accordion-button:focus {
    box-shadow: none;
    border-color: transparent;
}

.totecraft-theme .tc-accordion .accordion-body {
    color: #555;
}

.totecraft-theme .tc-hero-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    min-height: 280px;
    align-items: end;
}

.totecraft-theme .tc-feature-card,
.totecraft-theme .tc-product-card,
.totecraft-theme .tc-panel {
    background: #fff;
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.totecraft-theme .tc-product-card__visual {
    /* Match master/list preview aspect (1760×2400 ≈ 11:15). */
    aspect-ratio: 11 / 15;
    min-height: 0;
    background: var(--totecraft-cream, #F5F0E8);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.totecraft-theme .tc-product-card__img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: cover;
    object-position: center center;
}

/* Size picker: image is context, chips + CTA stay above the fold. */
.totecraft-theme .tc-style-card__layout {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 1rem;
}

.totecraft-theme .tc-style-card .tc-product-card__visual {
    width: auto;
    max-width: 9.5rem;
    max-height: min(28vh, 12.5rem);
    margin-inline: auto;
}

.totecraft-theme .tc-style-card__meta {
    min-width: 0;
    width: 100%;
}

.totecraft-theme .tc-pill {
    border: none;
    background: #fff;
    color: #333;
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.totecraft-theme .tc-pill.is-active {
    background: var(--totecraft-green);
    color: #fff;
}

.totecraft-theme .tc-pill:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.totecraft-theme .tc-pill--action {
    border: 1px solid var(--totecraft-green);
    background: transparent;
    color: var(--totecraft-green);
}

.totecraft-theme .tc-tabs .nav-link {
    border-radius: 9999px;
    color: #555;
    font-size: 0.875rem;
}

.totecraft-theme .tc-tabs .nav-link.active {
    background: var(--totecraft-green);
    color: #fff;
}

.totecraft-theme .tc-tabs .nav-link:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.totecraft-theme .tc-color-chip {
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 9999px;
    border: 2px solid #d9d3c8;
    padding: 0;
    cursor: pointer;
}

.totecraft-theme .tc-color-chip.is-active {
    border-color: var(--totecraft-green);
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--totecraft-green);
}

.totecraft-theme .tc-color-chip[data-bag-text-color="#FFFFFF"],
.totecraft-theme .tc-color-chip[data-bag-text-color="#F5F0E8"] {
    border-color: #c9c2b6;
}

.totecraft-theme .tc-mockup-host {
    background: #f0ebe3;
    border-radius: 12px;
    min-height: 420px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.totecraft-theme .tc-mockup-view {
    width: 100%;
}

.totecraft-theme .tc-mockup-view__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    width: 100%;
}

.totecraft-theme .tc-mockup-view__frame {
    margin: 0;
    text-align: center;
}

.totecraft-theme .tc-mockup-view__img {
    display: block;
    width: 100%;
    max-width: 560px;
    height: auto;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.totecraft-theme .tc-mockup-view__caption {
    margin-top: 0.5rem;
}

.totecraft-theme .tc-mockup-view__rotate {
    width: 100%;
    text-align: center;
}

.totecraft-theme .tc-mockup-view__frame--rotate {
    position: relative;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    outline: none;
}

.totecraft-theme .tc-mockup-view__frame--rotate .tc-mockup-view__img {
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
}

/* O2-P1a crossfade: overlay layer stacked over the committed frame image. */
.totecraft-theme .tc-mockup-view__stage {
    position: relative;
    background: #ffffff;
}

.totecraft-theme .tc-mockup-view__img--over {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    transform: none;
    object-fit: contain;
    object-position: center center;
    opacity: 0;
    transition: opacity 220ms ease;
}

.totecraft-theme .tc-mockup-view__img--over.is-tracking {
    transition: none;
}

.totecraft-theme .tc-mockup-view__frame--rotate.is-dragging {
    cursor: grabbing;
}

.totecraft-theme .tc-mockup-view__frame--rotate.is-dragging .tc-mockup-view__rotate-hint {
    opacity: 0;
}

.totecraft-theme .tc-mockup-view__rotate-hint {
    position: absolute;
    left: 50%;
    bottom: 2.75rem;
    transform: translateX(-50%);
    margin: 0;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #f7f3ec;
    background: rgba(26, 61, 50, 0.72);
    pointer-events: none;
    opacity: 0.92;
}

.totecraft-theme .tc-mockup-view__dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.65rem;
}

.totecraft-theme .tc-mockup-view__dot {
    width: 0.55rem;
    height: 0.55rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #c8c0b4;
    cursor: pointer;
}

.totecraft-theme .tc-mockup-view__dot.is-active {
    background: var(--totecraft-green, #1a3d32);
    transform: scale(1.15);
}

.totecraft-theme .tc-mockup-view__dot:focus-visible {
    outline: 2px solid var(--totecraft-green, #1a3d32);
    outline-offset: 2px;
}

.totecraft-theme .tc-mockup-view__angles {
    width: 100%;
    text-align: center;
}

.totecraft-theme .tc-mockup-view__angles-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    width: 100%;
    margin-top: 1rem;
}

.totecraft-theme .tc-mockup-view__angles-toggle {
    font-size: 0.875rem;
    font-weight: 600;
}

.totecraft-theme .tc-mockup-view__empty {
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    color: #6b6560;
    background: rgba(255, 255, 255, 0.55);
    border-radius: 8px;
}

.totecraft-theme .tc-preview-heading {
    font-weight: 600;
    letter-spacing: 0.01em;
}

.totecraft-theme .tc-preview-mode-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0;
}

.totecraft-theme .tc-preview-mode-bar__label {
    font-size: 0.8125rem;
    color: #6b6560;
    white-space: nowrap;
}

.totecraft-theme .tc-preview-mode-bar__slider {
    flex: 1 1 auto;
    margin: 0;
    accent-color: var(--totecraft-green);
}

.totecraft-theme .tc-preview-mode-bar.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.totecraft-theme .tc-canvas-host {
    background: #f0ebe3;
    border-radius: 12px;
    min-height: 420px;
    position: relative;
    overflow: hidden;
}

.totecraft-theme .tc-canvas-host .tc-three-canvas {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 420px;
    border-radius: 12px;
}

.totecraft-theme .tc-print-host {
    background: #f0ebe3;
    border-radius: 12px;
    min-height: 420px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.totecraft-theme .tc-print-view {
    width: 100%;
    max-width: 720px;
}

.totecraft-theme .tc-print-view__canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.totecraft-theme .tc-design-history {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.totecraft-theme .tc-design-history__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
}

.totecraft-theme .tc-design-history__row.is-selected .tc-design-history__item {
    border-color: var(--totecraft-green);
    background: rgba(46, 97, 78, 0.08);
    font-weight: 600;
}

.totecraft-theme .tc-design-brief {
    border: 1px solid rgba(46, 97, 78, 0.2);
    border-radius: 0.5rem;
    padding: 0.65rem 0.75rem;
    background: rgba(255, 255, 255, 0.55);
}

.totecraft-theme .tc-design-brief .form-label {
    margin-bottom: 0.25rem;
}

.totecraft-theme .tc-design-brief [role="group"][data-brief-field] {
    margin-bottom: 0.45rem !important;
}

.totecraft-theme .tc-design-brief .form-check {
    margin-bottom: 0.35rem;
}

.totecraft-theme .tc-design-history__item {
    border: 1px solid #e5e0d8;
    background: #faf8f4;
    border-radius: 9999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.8125rem;
    text-align: left;
    flex: 1 1 auto;
    min-width: 0;
}

.totecraft-theme .tc-design-history__edit {
    border: none;
    background: transparent;
    color: var(--totecraft-green);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.35rem;
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
    cursor: pointer;
}

.totecraft-theme .tc-design-history__edit:hover {
    color: #1f4d3a;
}

.totecraft-theme .tc-design-history__item.is-selected {
    border-color: var(--totecraft-green);
    background: rgba(46, 97, 78, 0.08);
    font-weight: 600;
}

.totecraft-theme .tc-design-history__item:disabled {
    opacity: 0.55;
}

.totecraft-theme .tc-print-size {
    border: 1px solid rgba(46, 97, 78, 0.18);
    border-radius: 0.5rem;
    padding: 0.75rem 0.85rem;
    background: rgba(255, 255, 255, 0.6);
}

.totecraft-theme .tc-print-size__row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.totecraft-theme .tc-print-size__slider {
    flex: 1 1 auto;
    margin: 0;
}

.totecraft-theme .tc-print-size__hint {
    flex: 0 0 auto;
    min-width: 2.5rem;
}

.totecraft-theme .tc-btn-secondary {
    border: 1px solid rgba(46, 97, 78, 0.35);
    background: #fff;
    color: var(--totecraft-green, #2e614e);
}

.totecraft-theme .tc-btn-secondary:hover {
    background: rgba(46, 97, 78, 0.08);
}

.totecraft-theme .tc-margin-warning {
    background: rgba(232, 160, 69, 0.15);
    color: #7a4e12;
    border-radius: 8px;
    padding: 0.65rem 1rem;
    font-size: 0.875rem;
}

.totecraft-theme .tc-studio-toolbar {
    background: #fff;
    border-radius: 16px;
    padding: 1rem 1.25rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

/* Studio one-screen workspace — see doc/bag/06 · column/fill: doc/bag/13 */
.totecraft-theme .tc-studio-shell {
    --tc-studio-chrome: 8.25rem;
    /* head + meta + checkout + rotate chrome under the bag image */
    --tc-mockup-chrome: 12.75rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.totecraft-theme .tc-studio-shell .tc-breadcrumb {
    padding-top: 0.65rem;
    padding-bottom: 0.35rem;
    flex-shrink: 0;
}

.totecraft-theme .tc-studio-container {
    padding-top: 0.35rem;
    padding-bottom: 0.75rem;
    flex: 1 1 auto;
    min-height: 0;
}

.totecraft-theme .tc-studio-workspace {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    align-items: stretch;
}

.totecraft-theme .tc-studio-controls {
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.totecraft-theme .tc-studio-controls__cta {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.35rem;
    margin-bottom: 0.25rem;
    padding-top: 0.65rem;
    padding-bottom: 0.15rem;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 0.55rem);
}

.totecraft-theme .tc-idea-card {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.7rem 0.8rem 0.6rem;
    border: 1px solid rgba(46, 97, 78, 0.16);
    border-radius: 14px;
    background: #faf7f2;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.totecraft-theme .tc-idea-card:focus-within,
.totecraft-theme .tc-idea-card.is-dragover {
    border-color: var(--totecraft-green);
    box-shadow: 0 0 0 3px rgba(46, 97, 78, 0.12);
}

.totecraft-theme .tc-idea-card.is-dragover {
    background: rgba(46, 97, 78, 0.06);
}

.totecraft-theme .tc-idea-card__photo {
    display: none;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid rgba(46, 97, 78, 0.1);
}

.totecraft-theme [data-bag-pane="generate"].has-photo .tc-idea-card__photo {
    display: flex;
}

.totecraft-theme .tc-idea-card__thumb {
    flex: 0 0 3rem;
    width: 3rem;
    height: 3rem;
    object-fit: cover;
    border-radius: 8px;
    background: #fff;
}

.totecraft-theme .tc-idea-card__photo-meta {
    flex: 1 1 auto;
    min-width: 0;
}

.totecraft-theme .tc-idea-card__filename {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1f2937;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.totecraft-theme .tc-idea-card__hint {
    font-size: 0.75rem;
    line-height: 1.4;
    color: #6b7280;
}

.totecraft-theme .tc-idea-card__remove {
    flex: 0 0 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: 9999px;
    background: transparent;
    color: #6b7280;
    font-size: 1.35rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.totecraft-theme .tc-idea-card__remove:hover,
.totecraft-theme .tc-idea-card__remove:focus {
    background: rgba(46, 97, 78, 0.08);
    color: var(--totecraft-green-hover);
}

.totecraft-theme .tc-idea-card__input {
    display: block;
    width: 100%;
    min-height: 4.5rem;
    margin: 0;
    padding: 0.15rem 0.1rem;
    border: 0;
    resize: vertical;
    background: transparent;
    color: #1a1a1a;
    font-size: 0.9375rem;
    line-height: 1.45;
    box-shadow: none;
}

.totecraft-theme .tc-idea-card__input:focus {
    outline: none;
    box-shadow: none;
}

.totecraft-theme .tc-idea-card__input::placeholder {
    color: #9ca3af;
}

.totecraft-theme .tc-idea-card__bar {
    display: flex;
    justify-content: flex-start;
}

.totecraft-theme .tc-idea-card__attach {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.5rem;
    padding: 0.3rem 0.75rem;
    border: 0;
    border-radius: 9999px;
    background: #fff;
    color: var(--totecraft-green);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}

.totecraft-theme .tc-idea-card__attach:hover,
.totecraft-theme .tc-idea-card__attach:focus {
    background: rgba(46, 97, 78, 0.08);
    color: var(--totecraft-green-hover);
}

.totecraft-theme .tc-idea-card__attach-replace {
    display: none;
}

.totecraft-theme [data-bag-pane="generate"].has-photo .tc-idea-card__attach-add {
    display: none;
}

.totecraft-theme [data-bag-pane="generate"].has-photo .tc-idea-card__attach-replace {
    display: inline;
}

.totecraft-theme .tc-idea-card__error {
    color: #b42318;
    font-size: 0.8125rem;
}

.totecraft-theme .tc-idea-card__error[hidden] {
    display: none !important;
}

.totecraft-theme [data-bag-pane="generate"].has-photo .tc-idea-empty-hint {
    display: none;
}

.totecraft-theme .tc-idea-styles .tc-pill {
    background: var(--totecraft-cream);
}

.totecraft-theme .tc-idea-styles .tc-pill.is-active {
    background: var(--totecraft-green);
    color: #fff;
}

.totecraft-theme .tc-idea-rights,
.totecraft-theme .tc-asis-block {
    display: none;
}

.totecraft-theme [data-bag-pane="generate"].has-photo .tc-idea-rights,
.totecraft-theme [data-bag-pane="generate"].has-photo .tc-asis-block {
    display: block;
}

.totecraft-theme .tc-asis-block {
    margin-top: 0.5rem;
}

.totecraft-theme .tc-idea-quota {
    text-align: center;
}

.totecraft-theme .tc-studio-stage {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
}

.totecraft-theme .tc-preview-panel {
    display: flex;
    flex-direction: column;
    flex: 1 1 0%;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    padding-bottom: 0.85rem;
}

.totecraft-theme .tc-preview-panel__head {
    flex-shrink: 0;
    margin-bottom: 0.5rem;
}

.totecraft-theme .tc-preview-panel__head-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
}

.totecraft-theme .tc-preview-panel__copy-status:empty {
    display: none;
}

.totecraft-theme .tc-preview-panel__copy-status:not(:empty) {
    margin-top: 0.35rem;
}

.totecraft-theme .tc-preview-panel__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
    flex-shrink: 0;
    margin-top: 0.5rem;
    padding-top: 0.35rem;
    border-top: 1px solid #ece7df;
}

.totecraft-theme .tc-preview-panel__meta .tc-preview-mode-bar {
    flex: 1 1 220px;
    min-width: 0;
}

.totecraft-theme .tc-preview-panel__checkout {
    flex-shrink: 0;
    margin-top: 0.65rem;
    padding-top: 0.85rem;
    border-top: 1px solid #ece7df;
    border-radius: 0 0 16px 16px;
    box-shadow: none;
}

.totecraft-theme .tc-margin-warning--inline {
    background: transparent;
    color: #7a4e12;
    padding: 0;
    font-size: 0.8125rem;
    flex: 0 1 auto;
}

.totecraft-theme .tc-design-history-panel {
    border-top: 1px solid #ece7df;
    padding-top: 0.65rem;
}

.totecraft-theme .tc-design-history-panel__summary {
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    list-style: none;
}

.totecraft-theme .tc-design-history-panel__summary::-webkit-details-marker {
    display: none;
}

.totecraft-theme .tc-design-history-panel__summary::before {
    content: '▸';
    display: inline-block;
    margin-right: 0.35rem;
    transition: transform 0.15s ease;
}

.totecraft-theme .tc-design-history-panel[open] .tc-design-history-panel__summary::before {
    transform: rotate(90deg);
}

.totecraft-theme .tc-studio-shell .tc-mockup-host {
    flex: 1 1 0%;
    min-height: 12rem;
    max-height: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    overflow: hidden;
}

.totecraft-theme .tc-studio-shell .tc-preview-stage {
    position: relative;
    flex: 1 1 0%;
    min-height: 12rem;
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.totecraft-theme .tc-studio-shell .tc-preview-stage .tc-mockup-host {
    flex: 1 1 0%;
    width: 100%;
    min-width: 0;
    min-height: 12rem;
}

.totecraft-theme .tc-studio-shell .tc-mockup-host:has(.tc-mockup-view__grid),
.totecraft-theme .tc-studio-shell .tc-mockup-host:has(.tc-mockup-view__angles-grid) {
    overflow-x: hidden;
    overflow-y: auto;
}

.totecraft-theme .tc-studio-busy-overlay {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1.25rem;
    text-align: center;
    background: rgba(245, 240, 232, 0.92);
    border-radius: 12px;
    backdrop-filter: blur(3px);
}

.totecraft-theme .tc-studio-busy-overlay.d-none {
    display: none;
}

.totecraft-theme .tc-studio-busy-overlay .spinner-border {
    color: var(--totecraft-green);
    width: 2.25rem;
    height: 2.25rem;
    border-width: 0.22rem;
}

.totecraft-theme .tc-studio-busy-overlay__title {
    margin: 1rem 0 0.35rem;
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
}

.totecraft-theme .tc-studio-busy-overlay__detail {
    max-width: 22rem;
    font-size: 0.875rem;
    color: #666;
}

.totecraft-theme .tc-studio-shell.is-busy {
    cursor: progress;
}

.totecraft-theme .tc-studio-shell.is-busy .tc-studio-controls,
.totecraft-theme .tc-studio-shell.is-busy .tc-preview-panel__head,
.totecraft-theme .tc-studio-shell.is-busy .tc-preview-panel__meta,
.totecraft-theme .tc-studio-shell.is-busy .tc-preview-panel__checkout {
    pointer-events: none;
}

.totecraft-theme .tc-confirm-modal {
    border: 1px solid rgba(46, 97, 78, 0.12);
    border-radius: 16px;
}

.totecraft-theme .tc-confirm-modal .modal-title {
    color: #1a1a1a;
}

.totecraft-theme .tc-confirm-modal .btn-outline-secondary {
    border-radius: 9999px;
}

.totecraft-theme .tc-studio-controls__cta .btn .spinner-border {
    vertical-align: -0.1em;
}

.totecraft-theme .tc-studio-shell .tc-mockup-view {
    flex: 1 1 0%;
    min-height: 0;
    min-width: 0;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
}

.totecraft-theme .tc-studio-shell .tc-mockup-view__rotate {
    flex: 1 1 0%;
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
}

.totecraft-theme .tc-studio-shell .tc-mockup-view__frame--rotate,
.totecraft-theme .tc-studio-shell .tc-mockup-view__frame--hero {
    flex: 1 1 0%;
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
}

.totecraft-theme .tc-studio-shell .tc-mockup-view__stage {
    flex: 1 1 0%;
    min-height: 0;
    min-width: 0;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Caption + angle dots must not be flex-squashed by an oversized stage/img. */
.totecraft-theme .tc-studio-shell .tc-mockup-view__caption,
.totecraft-theme .tc-studio-shell .tc-mockup-view__dots,
.totecraft-theme .tc-studio-shell .tc-mockup-view__angles {
    flex-shrink: 0;
}

.totecraft-theme .tc-studio-shell .tc-mockup-view__img {
    /* Stacked / no height lock: cap by viewport so the bag cannot open host scroll. */
    max-width: min(100%, 92%);
    max-height: min(52vh, 520px);
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    object-fit: contain;
    object-position: center center;
}

.totecraft-theme .tc-studio-shell .tc-mockup-view__grid .tc-mockup-view__img {
    max-width: 100%;
    max-height: min(42vh, 360px);
}

.totecraft-theme .tc-studio-shell .tc-mockup-view__angles-grid .tc-mockup-view__img {
    max-width: 100%;
    max-height: min(30vh, 240px);
}

.totecraft-theme .tc-studio-shell .tc-mockup-view__empty {
    min-height: 12rem;
    width: 100%;
}

.totecraft-theme .tc-badge {
    background: var(--totecraft-green);
    color: #fff;
}

.totecraft-theme #faq {
    scroll-margin-top: 5rem;
}

@media (max-width: 991.98px) {
    .totecraft-theme .tc-preview-panel__checkout {
        position: sticky;
        bottom: 0;
        z-index: 5;
        margin-left: -1.25rem;
        margin-right: -1.25rem;
        margin-bottom: -0.85rem;
        padding-left: 1.25rem;
        padding-right: 1.25rem;
        padding-bottom: 1rem;
        background: #fff;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
    }

    .totecraft-theme .tc-preview-panel__divider {
        display: none;
    }

    .totecraft-theme .tc-preview-panel__cart {
        width: 100%;
        text-align: left !important;
    }
}

@media (min-width: 992px) {
    /* One viewport: header + breadcrumb + shell. Footer is off-canvas on Studio. */
    html:has(#bag-studio-app),
    html:has(#bag-studio-app) body {
        overflow: hidden;
        height: 100%;
    }

    html:has(#bag-studio-app) .site-footer {
        display: none;
    }

    .totecraft-theme:has(#bag-studio-app) {
        min-height: 0;
    }

    .totecraft-theme .tc-studio-shell {
        height: calc(100svh - var(--tc-studio-chrome));
        max-height: calc(100svh - var(--tc-studio-chrome));
        overflow: hidden;
    }

    .totecraft-theme .tc-studio-container {
        display: flex;
        flex-direction: column;
        flex: 1 1 0%;
        min-height: 0;
    }

    .totecraft-theme .tc-studio-workspace {
        /* Phase 13.4: right sized to bag + checkout; leftover goes to left */
        grid-template-columns: minmax(380px, 720px) minmax(520px, 640px);
        justify-content: center;
        gap: 1rem;
        flex: 1 1 0%;
        min-height: 0;
        min-width: 0;
        width: 100%;
        height: auto;
        max-height: none;
        overflow: hidden;
    }

    .totecraft-theme .tc-studio-controls {
        overflow-y: auto;
        overscroll-behavior: contain;
        min-width: 0;
    }

    .totecraft-theme .tc-studio-stage {
        min-width: 0;
    }

    .totecraft-theme .tc-preview-panel__cart {
        min-width: 0;
    }

    .totecraft-theme .tc-studio-shell .tc-preview-stage,
    .totecraft-theme .tc-studio-shell .tc-preview-stage .tc-mockup-host {
        min-height: 0;
    }

    /*
     * Hero / Product view: take the bag out of flow so intrinsic pixels cannot
     * grow preview-stage / host. Stage height comes from flex leftover.
     */
    .totecraft-theme .tc-studio-shell .tc-mockup-view__stage > .tc-mockup-view__img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        object-fit: contain;
        object-position: center center;
    }
}

@media (max-width: 767.98px) {
    .totecraft-theme .tc-hero-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        min-height: auto;
    }

    .totecraft-theme .tc-hero-card {
        min-height: 140px;
        padding-bottom: 1.25rem;
    }

    .totecraft-theme .tc-hero-card__img {
        max-height: min(36vh, 220px);
        filter: drop-shadow(0 10px 12px rgba(55, 45, 35, 0.16))
                drop-shadow(0 3px 4px rgba(55, 45, 35, 0.08));
    }

    .totecraft-theme .tc-mockup-host {
        min-height: 280px;
    }

    .totecraft-theme .tc-studio-shell .tc-mockup-view__img {
        max-height: min(42vh, 360px);
    }

    .totecraft-theme .tc-mockup-view__grid {
        grid-template-columns: 1fr;
    }

    .totecraft-theme .tc-mockup-view__angles-grid {
        grid-template-columns: 1fr;
    }

    .totecraft-theme .tc-canvas-host {
        min-height: 280px;
    }

    .totecraft-theme .tc-display {
        font-size: clamp(1.75rem, 8vw, 2.25rem);
    }

    .totecraft-theme .tc-idea-card {
        padding: 0.75rem 0.8rem 0.7rem;
    }

    .totecraft-theme .tc-idea-card__photo {
        align-items: flex-start;
    }

    .totecraft-theme .tc-idea-card__thumb {
        flex-basis: 3.5rem;
        width: 3.5rem;
        height: 3.5rem;
    }

    .totecraft-theme .tc-idea-card__input {
        min-height: 5rem;
        font-size: 1rem;
    }

    .totecraft-theme .tc-idea-card__attach {
        min-height: 2.75rem;
        width: 100%;
        justify-content: center;
    }

    .totecraft-theme .tc-idea-card__remove {
        width: 2.75rem;
        height: 2.75rem;
        flex-basis: 2.75rem;
    }
}

@media (min-width: 768px) {
    .totecraft-theme .tc-hero-card {
        min-height: 280px;
    }

    .totecraft-theme .tc-idea-card__input {
        min-height: 5.25rem;
    }

    .totecraft-theme .tc-style-card__layout {
        grid-template-columns: minmax(14rem, 17.5rem) minmax(0, 1fr);
        justify-items: stretch;
        align-items: center;
        gap: 1.5rem 2rem;
    }

    .totecraft-theme .tc-style-card .tc-product-card__visual {
        width: 100%;
        max-width: none;
        max-height: min(52vh, 25rem);
        margin-inline: 0;
    }
}
