/* =============================================================================
   Tailor Book design system — shared by the web PWA and the MAUI (Android/iOS/Windows) app.
   Neutral tokens are fixed; brand colors come from the business's branding as CSS variables
   (--tb-primary, --tb-accent, ... set by BrandingState on the app root).
   ============================================================================= */

@font-face {
    font-family: "Ionicons";
    src: url("fonts/Ionicons.ttf") format("truetype");
    font-display: block;
}

:root {
    --tb-primary: #111827;
    --tb-primary-soft: #1118271f;
    --tb-secondary: #374151;
    --tb-accent: #D4AF37;
    --tb-accent-soft: #D4AF3726;
    --tb-bg: #FFFFFF;

    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    --success: #15803D;
    --success-bg: #DCFCE7;
    --danger: #DC2626;
    --danger-bg: #FEE2E2;
    --warning: #B45309;
    --warning-bg: #FEF3C7;
    --info: #1D4ED8;
    --info-bg: #DBEAFE;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;

    --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 6px 16px rgba(15, 23, 42, 0.10);
    --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.14);

    --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, "Noto Naskh Arabic", sans-serif;
    --surface: #F6F7F9;
    --nav-width: 248px;
    --tabbar-height: 64px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font);
    color: var(--gray-900);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

a { color: var(--tb-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; }
button { font-family: inherit; }

.tb-icon {
    font-family: "Ionicons";
    font-style: normal;
    font-weight: normal;
    line-height: 1;
    display: inline-block;
    vertical-align: middle;
    speak: never;
}

/* ---------- typography ---------- */
.tb-h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.3px; }
.tb-h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.2px; }
.tb-h3 { font-size: 16px; font-weight: 700; }
.tb-body { font-size: 15px; }
.tb-small { font-size: 13px; }
.tb-muted { color: var(--gray-500); }
.tb-faint { color: var(--gray-400); }
.tb-bold { font-weight: 700; }
.tb-right { text-align: end; }
.tb-center { text-align: center; }
.tb-italic { font-style: italic; }
.tb-success { color: var(--success); }
.tb-danger { color: var(--danger); }
.tb-warning { color: var(--warning); }
.tb-accent { color: var(--tb-accent); }
.tb-primary { color: var(--tb-primary); }

/* ---------- layout helpers ---------- */
.tb-row { display: flex; align-items: center; gap: 12px; }
.tb-row.top { align-items: flex-start; }
.tb-row.between { justify-content: space-between; }
.tb-row.wrap { flex-wrap: wrap; }
.tb-col { display: flex; flex-direction: column; gap: 4px; }
.tb-grow { flex: 1; min-width: 0; }
.tb-stack > * + * { margin-top: 12px; }
.tb-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tb-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tb-gap-sm { gap: 8px; }
.tb-mt { margin-top: 16px; }
.tb-mt-sm { margin-top: 8px; }
.tb-mb { margin-bottom: 16px; }
.tb-hidden { display: none !important; }
.tb-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 560px) {
    .tb-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- card ---------- */
.tb-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(17, 24, 39, 0.04);
}
.tb-card + .tb-card { margin-top: 12px; }
/* ...but not between cards laid out side by side: it pushed every card after the first one down. */
:is(.tb-grid-2, .tb-grid-3) > .tb-card { margin-top: 0; }
.tb-card-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.tb-card-subtitle { font-size: 13px; color: var(--gray-500); margin-bottom: 12px; }
.tb-card.flush { padding: 0; overflow: hidden; }
.tb-card.clickable { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.tb-card.clickable:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

/* ---------- buttons ---------- */
.tb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 20px;
    border-radius: var(--radius-md);
    border: 1.5px solid transparent;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .12s ease, transform .12s ease, background .12s ease;
    white-space: nowrap;
}
.tb-btn:active:not(:disabled) { transform: scale(0.99); }
.tb-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.tb-btn.block { width: 100%; }
.tb-btn.small { min-height: 36px; padding: 0 14px; font-size: 13px; border-radius: var(--radius-sm); }
.tb-btn.primary { background: var(--tb-primary); color: #fff; }
.tb-btn.primary:hover:not(:disabled) { opacity: 0.92; }
.tb-btn.accent { background: var(--tb-accent); color: #fff; }
.tb-btn.outline { background: transparent; color: var(--tb-primary); border-color: var(--tb-primary); }
.tb-btn.outline:hover:not(:disabled) { background: var(--tb-primary-soft); }
.tb-btn.ghost { background: transparent; color: var(--tb-primary); }
.tb-btn.ghost:hover:not(:disabled) { background: var(--tb-primary-soft); }
.tb-btn.danger { background: var(--danger); color: #fff; }
.tb-btn .tb-spinner { width: 18px; height: 18px; border-width: 2px; border-color: currentColor; border-right-color: transparent; }

.tb-link-btn {
    background: none;
    border: 0;
    padding: 4px 0;
    color: var(--tb-primary);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tb-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 0;
    background: transparent;
    color: var(--tb-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.tb-icon-btn:hover { background: var(--tb-primary-soft); }

/* ---------- form fields ---------- */
.tb-field { margin-bottom: 16px; }
.tb-label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.tb-input-wrap {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    min-height: 48px;
    padding: 0 14px;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.tb-input-wrap:focus-within { border-color: var(--tb-primary); box-shadow: 0 0 0 3px var(--tb-primary-soft); }
.tb-input-wrap.invalid { border-color: var(--danger); }
.tb-input-wrap .tb-icon { color: var(--gray-400); margin-inline-end: 10px; font-size: 19px; }
.tb-input {
    flex: 1;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 15px;
    font-family: inherit;
    color: var(--gray-900);
    padding: 12px 0;
    min-width: 0;
}
textarea.tb-input { resize: vertical; min-height: 84px; }
.tb-hint { font-size: 12.5px; color: var(--gray-500); margin-top: 6px; }
.tb-error { font-size: 13px; color: var(--danger); margin-top: 6px; }
.tb-check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; padding: 6px 0; user-select: none; }
.tb-check .tb-icon { font-size: 22px; color: var(--gray-400); }
.tb-check.checked .tb-icon { color: var(--tb-primary); }
.tb-check-label { font-weight: 600; color: var(--gray-800); }
.tb-check-hint { font-size: 13px; color: var(--gray-500); margin-top: 2px; }

/* ---------- chips ---------- */
.tb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tb-chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.tb-chips.scroll::-webkit-scrollbar { display: none; }
.tb-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--gray-300);
    background: #fff;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
    color: var(--gray-700);
    cursor: pointer;
    white-space: nowrap;
}
.tb-chip.selected { background: var(--tb-primary); border-color: var(--tb-primary); color: #fff; }
.tb-chip:disabled { cursor: default; }

/* ---------- badges ---------- */
.tb-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}
.tb-badge.gray { background: var(--gray-100); color: var(--gray-700); }
.tb-badge.info { background: var(--info-bg); color: var(--info); }
.tb-badge.warning { background: var(--warning-bg); color: var(--warning); }
.tb-badge.success { background: var(--success-bg); color: var(--success); }
.tb-badge.danger { background: var(--danger-bg); color: var(--danger); }
.tb-badge.purple { background: #EDE9FE; color: #6D28D9; }

/* ---------- avatar ---------- */
.tb-avatar {
    flex-shrink: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--tb-primary);
    background: var(--tb-primary-soft);
}

/* ---------- lists ---------- */
.tb-list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: box-shadow .12s ease;
    color: inherit;
    text-decoration: none;
}
.tb-list-row:hover { box-shadow: var(--shadow-md); text-decoration: none; }
.tb-divider { height: 1px; background: var(--gray-100); margin: 10px 0; }
.tb-totals-row { display: flex; justify-content: space-between; padding: 3px 0; font-size: 15px; color: var(--gray-600); }
.tb-totals-row span:last-child { color: var(--gray-900); }
.tb-totals-row.bold, .tb-totals-row.bold span { font-weight: 700; color: var(--gray-900); }

/* ---------- empty state / notices ---------- */
.tb-empty { text-align: center; padding: 48px 16px; }
.tb-empty .tb-icon { font-size: 44px; color: var(--gray-300); }
.tb-empty-title { font-size: 18px; font-weight: 700; margin-top: 12px; }
.tb-empty-detail { color: var(--gray-500); margin: 6px auto 20px; max-width: 340px; }
.tb-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 12px;
}
.tb-notice .tb-icon { font-size: 16px; }
.tb-notice.info { background: var(--info-bg); color: var(--info); }
.tb-notice.warning { background: var(--warning-bg); color: var(--warning); }
.tb-notice.danger { background: var(--danger-bg); color: var(--danger); }
.tb-notice.success { background: var(--success-bg); color: var(--success); }
.tb-notice .tb-grow { line-height: 1.4; }

.tb-spinner {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 3px solid var(--tb-primary);
    border-right-color: transparent;
    animation: tb-spin .8s linear infinite;
    display: inline-block;
}
.tb-loading { display: flex; justify-content: center; padding: 48px 0; }
@keyframes tb-spin { to { transform: rotate(360deg); } }

/* ---------- portal shell ---------- */
.tb-app { min-height: 100vh; background: var(--surface); }
.tb-sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: var(--nav-width);
    background: #fff;
    border-inline-end: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    z-index: 20;
}
.tb-sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; }
.tb-sidebar-brand img { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; }
.tb-sidebar-brand-name { font-weight: 800; font-size: 16px; color: var(--tb-primary); line-height: 1.2; }
.tb-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    color: var(--gray-600);
    font-weight: 600;
    font-size: 14.5px;
    margin-bottom: 2px;
}
.tb-nav-link .tb-icon { font-size: 20px; }
.tb-nav-link:hover { background: var(--gray-100); text-decoration: none; color: var(--gray-900); }
.tb-nav-link.active { background: var(--tb-primary-soft); color: var(--tb-primary); }
.tb-sidebar-footer { margin-top: auto; font-size: 12px; color: var(--gray-400); padding: 8px; }

.tb-main {
    /* Content fills the window up to this width, then centres, so wide screens don't leave a blank strip. */
    --content-max: 1440px;
    margin-inline-start: var(--nav-width);
    min-height: 100vh;
}
.tb-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 60px;
    padding: 8px 24px;
    /* Keep the title aligned with the centred content below it. */
    padding-inline: max(24px, calc((100% - var(--content-max)) / 2 + 24px));
    background: rgba(246, 247, 249, 0.86);
    backdrop-filter: blur(10px);
}
.tb-topbar-title { font-size: 20px; font-weight: 800; flex: 1; min-width: 0; }
.tb-content { padding: 8px 24px 40px; max-width: var(--content-max); margin-inline: auto; box-sizing: border-box; }
/* Forms read best narrow; they stay left-aligned under the title rather than floating in the middle. */
.tb-content.narrow > * { max-width: 720px; }

.tb-tabbar { display: none; }

@media (max-width: 860px) {
    .tb-sidebar { display: none; }
    .tb-main { margin-inline-start: 0; padding-bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom)); }
    .tb-topbar { padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top)); }
    .tb-content { padding: 4px 16px 32px; }
    .tb-tabbar {
        display: flex;
        position: fixed;
        inset-inline: 0;
        bottom: 0;
        height: calc(var(--tabbar-height) + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        background: #fff;
        border-top: 1px solid var(--gray-100);
        z-index: 20;
    }
    .tb-tab {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        font-size: 10.5px;
        font-weight: 600;
        color: var(--gray-400);
    }
    .tb-tab .tb-icon { font-size: 22px; }
    .tb-tab:hover { text-decoration: none; }
    .tb-tab.active { color: var(--tb-primary); }
}

/* ---------- auth screens ---------- */
.tb-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    background:
        radial-gradient(1200px 500px at 10% -10%, var(--tb-primary-soft), transparent 60%),
        radial-gradient(900px 400px at 110% 110%, var(--tb-accent-soft), transparent 60%),
        var(--surface);
}
.tb-auth-card { width: 100%; max-width: 440px; background: #fff; border-radius: var(--radius-xl); padding: 32px 28px; box-shadow: var(--shadow-lg); }
.tb-auth-hero { text-align: center; margin-bottom: 28px; }
.tb-auth-app { font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--gray-500); margin-top: 12px; }
.tb-auth-title { font-size: 26px; font-weight: 800; margin-top: 4px; }
.tb-auth-subtitle { color: var(--gray-500); margin-top: 6px; }
.tb-auth-footer { text-align: center; margin-top: 20px; color: var(--gray-500); font-size: 14px; }

/* ---------- stats & chart ---------- */
.tb-stat { display: flex; flex-direction: column; gap: 4px; }
.tb-stat-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.tb-stat-icon .tb-icon { font-size: 18px; }
.tb-stat-label { font-size: 13px; color: var(--gray-500); }
.tb-stat-value { font-size: 21px; font-weight: 800; }
.tb-chart { display: flex; align-items: flex-end; height: 130px; gap: 10px; margin-top: 16px; }
.tb-chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.tb-chart-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.tb-bar { width: 12px; min-height: 2px; border-radius: 4px 4px 0 0; }
.tb-chart-label { font-size: 11px; color: var(--gray-500); margin-top: 6px; }
.tb-legend { display: flex; gap: 16px; align-items: center; margin-top: 12px; font-size: 13px; color: var(--gray-600); }
.tb-legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-inline-end: 6px; }

/* ---------- order item editor ---------- */
.tb-item-card { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-md); padding: 12px; margin-bottom: 8px; }
.tb-item-desc { flex: 1; border: 0; background: transparent; font-weight: 600; font-size: 15px; outline: none; padding: 4px 0; font-family: inherit; min-width: 0; }
.tb-item-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.tb-item-fields label { font-size: 11px; font-weight: 700; color: var(--gray-400); display: block; margin-bottom: 2px; }
.tb-item-fields input { width: 100%; border: 1px solid var(--gray-300); border-radius: var(--radius-sm); padding: 8px; font-size: 14px; background: #fff; font-family: inherit; }
.tb-suggestions { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); overflow: hidden; margin-top: 6px; }
.tb-option { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--gray-100); cursor: pointer; background: #fff; width: 100%; border-inline: 0; border-bottom: 0; text-align: start; font-family: inherit; font-size: 14.5px; color: var(--gray-900); }
.tb-option:first-child { border-top: 0; }
.tb-option:hover { background: var(--gray-50); }

/* ---------- receipt preview ---------- */
.tb-receipt { background: #fff; border: 1px solid var(--gray-200); border-radius: 14px; padding: 18px; box-shadow: var(--shadow-sm); position: relative; }
.tb-receipt-rule { height: 2px; border-radius: 1px; margin: 8px 0; }
.tb-receipt-meta { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 2px; }
.tb-receipt-meta span:first-child { color: var(--gray-500); }
.tb-receipt-meta span:last-child { font-weight: 600; }
.tb-receipt-items th { font-size: 11px; color: var(--gray-400); text-transform: uppercase; font-weight: 700; text-align: start; padding-bottom: 4px; }
.tb-receipt-items td { font-size: 13px; padding: 2px 0; }
.tb-receipt-items { width: 100%; border-collapse: collapse; }

/* ---------- lock overlay ---------- */
.tb-lock {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: var(--tb-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    text-align: center;
}

/* ---------- misc ---------- */
.tb-swatch { width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--gray-200); flex-shrink: 0; }
.tb-logo-preview { width: 64px; height: 64px; border-radius: var(--radius-md); background: var(--gray-100); object-fit: contain; display: flex; align-items: center; justify-content: center; }
input[type="color"].tb-color { width: 44px; height: 44px; border: 0; padding: 0; background: none; cursor: pointer; }
.tb-table { width: 100%; border-collapse: collapse; }
.tb-table th { text-align: start; font-size: 12px; color: var(--gray-500); font-weight: 700; padding: 8px; border-bottom: 1px solid var(--gray-200); }
.tb-table td { padding: 10px 8px; border-bottom: 1px solid var(--gray-100); font-size: 14px; }

[dir="rtl"] .tb-flip { transform: scaleX(-1); }

/* ---------------------------------------------------------------- settings */
.tb-block { display: block; }
.tb-mb-sm { margin-bottom: 8px; }
.tb-menu-row {
    display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 16px;
    background: none; border: 0; border-top: 1px solid var(--gray-100); color: inherit; text-align: start;
    font: inherit; text-decoration: none; cursor: pointer;
}
.tb-menu-row:first-child { border-top: 0; }
div.tb-menu-row { cursor: default; }
a.tb-menu-row:hover, button.tb-menu-row:hover { background: var(--gray-50); }
.tb-menu-icon {
    width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--gray-100); color: var(--gray-600);
}
.tb-switch { position: relative; display: inline-block; width: 44px; height: 26px; flex-shrink: 0; }
.tb-switch input { opacity: 0; width: 0; height: 0; }
.tb-switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--gray-300); transition: background .15s; cursor: pointer; }
.tb-switch span::before {
    content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s;
}
.tb-switch input:checked + span { background: var(--tb-primary); }
.tb-switch input:checked + span::before { transform: translateX(18px); }
[dir="rtl"] .tb-switch input:checked + span::before { transform: translateX(-18px); }
.tb-switch input:disabled + span { opacity: .5; cursor: not-allowed; }
.tb-switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--tb-primary-soft); }
.tb-color-swatch {
    width: 28px; height: 28px; padding: 0; margin-inline-end: 10px; border: 1px solid var(--gray-200);
    border-radius: 8px; background: none; cursor: pointer; flex-shrink: 0;
}
.tb-color-swatch::-webkit-color-swatch-wrapper { padding: 2px; }
.tb-color-swatch::-webkit-color-swatch { border: 0; border-radius: 5px; }
.tb-unit-field { width: 110px; flex-shrink: 0; }
.tb-color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); column-gap: 12px; }
.tb-logo-pick {
    position: relative; width: 64px; height: 64px; flex-shrink: 0; border-radius: 12px; overflow: hidden; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    background: var(--gray-50); border: 1.5px dashed var(--gray-200);
}
.tb-logo-pick img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.tb-logo-busy { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.35); }
/* Form beside a live preview on wide screens; stacked on phones. */
.tb-split { display: grid; gap: 20px; }
@media (min-width: 1180px) {
    .tb-split { grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); align-items: start; }
    .tb-sticky { position: sticky; top: 20px; }
}
