/* =============================================================================
   CAFMRING Member Area – Vue App Styles
   ============================================================================= */

/* Fullscreen body (no theme) */

body.cafmring-fs-body {
    margin: 0;
    padding: 0;
    background: #f7f7f9;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    color: #222;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.cafmring-fs-body #cafmring-app {
    flex: 1;
    display: flex;
    flex-direction: column;
}

body.cafmring-fs-body .cr-app {
    flex: 1;
    border-radius: 0;
    border: none;
    min-height: 100vh;
}

/* Login gate (shown when not logged in) */

.cafmring-login-gate {
    display: flex;
    justify-content: center;
    padding: 3rem 1rem;
}

.cafmring-login-gate__inner {
    width: 100%;
    max-width: 420px;
}

.cafmring-login-gate__title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 1.5rem;
    text-align: center;
}

/* App shell */

#cafmring-app {
    min-height: 70vh;
}

.cr-app {
    display: flex;
    min-height: 70vh;
    background: #f7f7f9;
    border-radius: 0;
    overflow: hidden;
    border: 1px solid #e5e5e8;
}

/* Sidebar */

.cr-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #1a1a2e;
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.cr-sidebar__brand {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    min-height: 56px;
    text-decoration: none;
}

.cr-sidebar__logo {
    max-width: 140px;
    max-height: 40px;
    object-fit: contain;
    display: block;
    /* Make dark logos visible on dark background */
    filter: brightness(0) invert(1);
}

.cr-sidebar__brand span {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
}

/* Nav */

.cr-nav {
    flex: 1;
    padding: 0.5rem 0;
}

.cr-nav__item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    color: rgba(255,255,255,0.65);
    font-size: 0.9rem;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
    line-height: 1.3;
}

.cr-nav__item:hover {
    background: rgba(255,255,255,0.07);
    color: #fff;
}

.cr-nav__item.is-active {
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-weight: 600;
    border-left-color: #6c8fff;
}

/* Sidebar footer */

.cr-sidebar__footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.cr-sidebar__user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.65rem;
}

.cr-avatar {
    width: 30px;
    height: 30px;
    background: rgba(255,255,255,0.15);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.cr-sidebar__username {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.75);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cr-logout {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
    text-decoration: none;
    transition: color 0.15s;
}

.cr-logout:hover {
    color: rgba(255,255,255,0.75);
}

/* Main content area */

.cr-main {
    flex: 1;
    overflow-y: auto;
    min-width: 0;
    background: #f4f4f7;
}

/* Section */

.cr-section {
    padding: 2rem 2.25rem;
    max-width: 680px;
}

.cr-section__title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 1.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e5e8;
}

/* Feedback alerts */

.cr-alert {
    padding: 0.75rem 1rem;
    border-radius: 0;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.cr-alert--success {
    background: #eafaf0;
    border: 1px solid #b2dfcc;
    color: #1e7b46;
}

.cr-alert--error {
    background: #fdf3f3;
    border: 1px solid #f5c5c5;
    color: #b02020;
}

/* Form */

.cr-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cr-field {
    margin-bottom: 1.35rem;
}

.cr-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 0.35rem;
}

.cr-input,
.cr-textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid #d5d5d8;
    border-radius: 0;
    font-size: 0.93rem;
    color: #222;
    background: #ffffff;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

.cr-input:focus,
.cr-textarea:focus {
    border-color: #1a1a2e;
    outline: none;
    box-shadow: 0 0 0 3px rgba(26,26,46,0.08);
}

.cr-textarea {
    resize: vertical;
    min-height: 130px;
    line-height: 1.55;
}

/* Logo area */

.cr-logo-area {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.cr-logo-preview {
    width: 100px;
    height: 80px;
    border: 1px solid #e0e0e3;
    border-radius: 0;
    overflow: hidden;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cr-logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.cr-logo-empty {
    font-size: 0.78rem;
    color: #bbb;
    text-align: center;
}

.cr-logo-upload-btn {
    cursor: pointer;
    user-select: none;
}

/* Buttons */

.cr-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    border-radius: 0;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    border: 1.5px solid transparent;
    line-height: 1;
}

.cr-btn--primary {
    background: #1a1a2e;
    color: #fff;
    border-color: #1a1a2e;
}

.cr-btn--primary:hover:not(:disabled) {
    background: #2d2d50;
    border-color: #2d2d50;
}

.cr-btn--primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cr-btn--ghost {
    background: transparent;
    color: #1a1a2e;
    border-color: #1a1a2e;
}

.cr-btn--ghost:hover {
    background: #1a1a2e;
    color: #fff;
}

.cr-field--actions {
    margin-top: 0.5rem;
}

/* Spinner */

.cr-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 0;
    animation: cr-spin 0.6s linear infinite;
    flex-shrink: 0;
}

@keyframes cr-spin {
    to { transform: rotate(360deg); }
}

/* Notice (no company) */

.cr-notice {
    padding: 1rem 1.25rem;
    background: #fffbea;
    border: 1px solid #ffe082;
    border-radius: 0;
    color: #7a5f00;
    font-size: 0.92rem;
}

/* Profil tab bar */

.cr-tabbar {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e4e4e8;
    margin-bottom: 1.75rem;
}

.cr-tabbar__tab {
    background: none;
    border: none;
    padding: 0.6rem 1.1rem;
    font-size: 0.92rem;
    font-weight: 500;
    color: #888;
    cursor: pointer;
    position: relative;
    transition: color 0.15s;
}

.cr-tabbar__tab:hover {
    color: #333;
}

.cr-tabbar__tab.is-active {
    color: #1a1a2e;
    font-weight: 600;
}

.cr-tabbar__tab.is-active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #1a1a2e;
    border-radius: 0;
}

/* Section header row (label + inline button) */

.cr-field--section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #eee;
}

.cr-field--section-header .cr-label {
    margin-bottom: 0;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #555;
}

.cr-label--sub {
    font-weight: 500;
    color: #666;
}

/* Collapsible card */

.cr-card-collapse {
    border: 1px solid #e4e4e8;
    border-radius: 0;
    padding: 0.75rem 1rem;
    background: #fafafa;
}

.cr-card-collapse .cr-address-fields {
    border-top: 1px solid #e4e4e8;
    padding-top: 0.75rem;
}

/* Type pills */

.cr-type-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.cr-type-pill {
    background: #fff;
    border: 1.5px solid #d0d0da;
    border-radius: 0;
    padding: 0.3rem 0.85rem;
    font-size: 0.83rem;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.cr-type-pill:hover {
    border-color: #1a1a2e;
    color: #1a1a2e;
}

.cr-type-pill.is-active {
    background: #1a1a2e;
    border-color: #1a1a2e;
    color: #fff;
    font-weight: 600;
}

/* Address collapsible */

.cr-address-toggle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-align: left;
    margin-bottom: 0;
}

.cr-address-toggle .cr-label {
    margin-bottom: 0;
    flex-shrink: 0;
}

.cr-address-toggle__summary {
    flex: 1;
    font-size: 0.88rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cr-address-toggle__chevron {
    font-size: 1.1rem;
    color: #aaa;
    line-height: 1;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.cr-address-toggle__chevron.is-open {
    transform: rotate(180deg);
}

.cr-address-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 0.75rem;
}


/* Locked input (synced from BIMSwarm) */

.cr-input--locked,
.cr-input--locked:disabled,
.cr-textarea.cr-input--locked,
.cr-textarea.cr-input--locked:disabled {
    background: #ffffff !important;
    color: #aaa;
    cursor: not-allowed;
    border-color: #e8e8eb;
}

.cr-locked-hint {
    font-size: 0.8rem;
    color: #aaa;
    font-style: italic;
    align-self: center;
}

/* BIMSwarm sync banner */

.cr-bs-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    background: #eef4ff;
    border: 1px solid #c0d4f5;
    border-radius: 0;
    margin-bottom: 1.5rem;
}

.cr-bs-banner__info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #1a3a6c;
}

.cr-bs-banner--unlinked {
    background: #f5f5f7;
    border-color: #e0e0e3;
}

.cr-bs-banner--unlinked .cr-bs-banner__info {
    color: #888;
    font-weight: 500;
}

.cr-bs-dot {
    width: 8px;
    height: 8px;
    border-radius: 0;
    background: #2e7de9;
    flex-shrink: 0;
    animation: cr-pulse 2s infinite;
}

.cr-bs-dot--grey {
    background: #bbb;
    animation: none;
}

@keyframes cr-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

.cr-bs-banner__actions {
    display: flex;
    gap: 0.5rem;
}

/* Small button variant */

.cr-btn--sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
}

.cr-btn--danger-ghost {
    background: transparent;
    color: #b02020;
    border-color: #b02020;
}

.cr-btn--danger-ghost:hover {
    background: #b02020;
    color: #fff;
}

/* BIMSwarm verknüpfen section */

.cr-bs-section {
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e5e8;
}

/* BIMSwarm Modal */

.cr-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: cr-overlay-in 0.15s ease;
}

.cr-modal {
    background: #fff;
    border-radius: 0;
    width: 100%;
    max-width: 560px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    animation: cr-modal-in 0.18s ease;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

@keyframes cr-overlay-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes cr-modal-in {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.cr-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.cr-modal__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

.cr-modal__close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #aaa;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
}

.cr-modal__close:hover { color: #333; }

.cr-modal__body {
    padding: 1.25rem 1.5rem 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.cr-modal__hint {
    font-size: 0.875rem;
    color: #777;
    margin: 0 0 1.25rem;
    line-height: 1.5;
}

.cr-bs-search__bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.cr-bs-search__bar .cr-input {
    flex: 1;
    min-width: 0;
}

.cr-bs-results {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 360px;
    overflow-y: auto;
}

.cr-bs-result {
    padding: 0.85rem 1rem;
    border: 1px solid #e0e0e3;
    border-radius: 0;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.cr-bs-result:hover {
    border-color: #1a1a2e;
    background: #f7f7fb;
}

.cr-bs-result__name {
    font-weight: 600;
    font-size: 0.93rem;
    color: #1a1a2e;
    margin-bottom: 0.2rem;
}

.cr-bs-result__desc {
    font-size: 0.82rem;
    color: #777;
    line-height: 1.45;
    margin-bottom: 0.3rem;
}

.cr-bs-result__id {
    font-size: 0.75rem;
    color: #bbb;
}

.cr-bs-empty {
    color: #999;
    font-size: 0.88rem;
    font-style: italic;
}

.cr-bs-linking {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 0;
    color: #555;
    font-size: 0.9rem;
}

/* Section description */

.cr-section__desc {
    font-size: 0.88rem;
    color: #777;
    margin: -1rem 0 1.75rem;
    line-height: 1.55;
}

.cr-section__desc code {
    background: #ebebef;
    padding: 0.1em 0.35em;
    font-size: 0.82em;
    border-radius: 0;
}

/* Label hint */

.cr-label__hint {
    font-size: 0.78rem;
    font-weight: 400;
    color: #aaa;
    margin-left: 0.35rem;
}

/* Toggle switch */

.cr-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.cr-toggle input[type="checkbox"] {
    display: none;
}

.cr-toggle__slider {
    width: 40px;
    height: 22px;
    background: #d0d0da;
    border-radius: 0;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}

.cr-toggle__slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 0;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.cr-toggle input:checked + .cr-toggle__slider {
    background: #1a1a2e;
}

.cr-toggle input:checked + .cr-toggle__slider::after {
    transform: translateX(18px);
}

.cr-toggle__label {
    font-size: 0.9rem;
    color: #555;
}

/* Color picker row */

.cr-color-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cr-color-swatch {
    width: 44px;
    height: 38px;
    padding: 2px;
    border: 1px solid #d5d5d8;
    border-radius: 0;
    background: #fff;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-appearance: none;
    appearance: none;
}

.cr-color-swatch::-webkit-color-swatch-wrapper { padding: 0; }
.cr-color-swatch::-webkit-color-swatch         { border: none; border-radius: 0; }

.cr-input--hex {
    width: 110px;
    font-family: monospace;
    letter-spacing: 0.04em;
}

/* Char count */

.cr-char-count {
    display: block;
    font-size: 0.78rem;
    color: #bbb;
    margin-top: 0.3rem;
    text-align: right;
}

/* Stand editor wrapper */

.cr-stand-wrap {
    max-width: 100%;
}

/* 3D Viewer */

.cr-stand-viewer {
    border: 1px solid #e0e0e3;
    background: #0d0d14;
    margin-bottom: 1.5rem;
    position: relative;
}

.cr-stand-viewer__status-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.85rem;
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.cr-stand-viewer__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #555;
}
.cr-stand-viewer__dot--loading { background: #f5a623; animation: cr-pulse 1.2s infinite; }
.cr-stand-viewer__dot--loaded  { background: #3dd68c; animation: none; }
.cr-stand-viewer__dot--error   { background: #ff6b6b; animation: none; }
.cr-stand-viewer__dot--idle    { background: #555; }

.cr-stand-viewer__status-text {
    flex: 1;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.45);
    font-family: monospace;
}

.cr-stand-viewer__log-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.5);
    font-size: 0.72rem;
    padding: 0.25rem 0.65rem;
    cursor: pointer;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: background 0.15s, color 0.15s;
}
.cr-stand-viewer__log-btn:hover {
    background: rgba(255,255,255,0.14);
    color: rgba(255,255,255,0.85);
}

.cr-stand-viewer__err-badge {
    background: #ff6b6b;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.1em 0.45em;
    border-radius: 0;
    line-height: 1.4;
}

.cr-stand-viewer__frame {
    display: block;
    width: 100%;
    height: 300px;
    border: none;
}

.cr-stand-viewer__no-url {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.3);
    font-size: 0.85rem;
    font-family: monospace;
}

/* Log panel */

.cr-stand-log {
    border: 1px solid #e0e0e3;
    background: #0d0d14;
    margin-bottom: 1.5rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.75rem;
}

.cr-stand-log__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.85rem;
    color: rgba(255,255,255,0.4);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.cr-stand-log__clear {
    background: none;
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.35);
    font-size: 0.7rem;
    padding: 0.2rem 0.55rem;
    cursor: pointer;
    border-radius: 0;
}
.cr-stand-log__clear:hover { color: rgba(255,255,255,0.7); }

.cr-stand-log__body {
    max-height: 220px;
    overflow-y: auto;
    padding: 0.4rem 0;
}

.cr-stand-log__empty {
    padding: 0.75rem 0.85rem;
    color: rgba(255,255,255,0.2);
    font-style: italic;
}

.cr-stand-log__entry {
    display: grid;
    grid-template-columns: 60px 60px 1fr;
    gap: 0 0.6rem;
    padding: 0.25rem 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    align-items: baseline;
}
.cr-stand-log__entry:last-child { border-bottom: none; }

.cr-stand-log__entry--error   { background: rgba(255,107,107,0.08); }
.cr-stand-log__entry--warn    { background: rgba(245,166,35,0.06); }
.cr-stand-log__entry--loaded  { background: rgba(61,214,140,0.06); }

.cr-stand-log__time  { color: rgba(255,255,255,0.25); font-size: 0.68rem; }
.cr-stand-log__type  { font-size: 0.68rem; font-weight: 600; }
.cr-stand-log__entry--log     .cr-stand-log__type { color: rgba(255,255,255,0.35); }
.cr-stand-log__entry--progress .cr-stand-log__type { color: #89b4ff; }
.cr-stand-log__entry--loaded  .cr-stand-log__type { color: #3dd68c; }
.cr-stand-log__entry--warn    .cr-stand-log__type { color: #f5a623; }
.cr-stand-log__entry--error   .cr-stand-log__type { color: #ff6b6b; }

.cr-stand-log__msg   { color: rgba(255,255,255,0.65); word-break: break-all; }
.cr-stand-log__data  {
    grid-column: 1 / -1;
    color: rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.03);
    padding: 0.4rem 0.6rem;
    margin-top: 0.25rem;
    font-size: 0.68rem;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 120px;
    overflow-y: auto;
    border-left: 2px solid rgba(255,255,255,0.08);
}

/* Stand controls bar */

.cr-stand-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.65rem 0;
    border-top: 1px solid #f0f0f3;
    border-bottom: 1px solid #f0f0f3;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.cr-stand-controls .cr-color-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cr-stand-controls__color-label {
    font-size: 0.8rem;
    color: #666;
    white-space: nowrap;
}

/* Compact image upload rows */

.cr-stand-images {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.cr-stand-image-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #f4f4f6;
}
.cr-stand-image-row:last-child { border-bottom: none; }

.cr-stand-image-row__label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    min-width: 72px;
}

.cr-stand-image-row__filename {
    flex: 1;
    font-size: 0.78rem;
    color: #bbb;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cr-stand-image-row--has-image .cr-stand-image-row__filename {
    color: #444;
}

.cr-stand-image-row__upload {
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}
.cr-stand-image-row__upload.is-uploading {
    pointer-events: none;
    opacity: 0.6;
}

.cr-stand-image-row__clear {
    width: 24px;
    height: 24px;
    background: none;
    border: 1px solid #d0d0da;
    color: #999;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    transition: border-color 0.15s, color 0.15s;
}
.cr-stand-image-row__clear:hover {
    border-color: #e55;
    color: #e55;
}

/* viewer status dot – ready state */
.cr-stand-viewer__dot--ready { background: #89b4ff; animation: cr-pulse 1.5s infinite; }

/* Placeholder sections */

.cr-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.cr-placeholder__graphic {
    width: 64px;
    height: 64px;
    border-radius: 0;
    background: #ebebef;
    margin-bottom: 1.25rem;
}

.cr-placeholder__text {
    color: #999;
    font-size: 0.95rem;
}

/* Responsive – bottom tab bar on mobile/tablet */

@media (max-width: 900px) {
    .cr-app {
        flex-direction: column;
        border-radius: 0;
        border: none;
        min-height: 100vh;
        padding-bottom: 64px; /* space for the fixed tab bar */
    }

    /* Hide sidebar entirely */
    .cr-sidebar {
        display: none;
    }

    /* Main fills viewport */
    .cr-main {
        flex: 1;
    }

    .cr-section {
        padding: 1.5rem 1.25rem;
        max-width: 100%;
    }

    /* Fixed bottom tab bar */
    .cr-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 64px;
        background: #1a1a2e;
        border-top: 1px solid rgba(255,255,255,0.1);
        z-index: 1000;
    }

    .cr-bottom-nav__item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        background: none;
        border: none;
        color: rgba(255,255,255,0.5);
        font-size: 0.68rem;
        font-weight: 500;
        cursor: pointer;
        padding: 0.5rem 0.25rem;
        border-top: 2px solid transparent;
        transition: color 0.15s, border-color 0.15s;
        line-height: 1.2;
    }

    .cr-bottom-nav__item.is-active {
        color: #fff;
        border-top-color: #6c8fff;
    }

    .cr-bottom-nav__icon {
        width: 22px;
        height: 22px;
        display: block;
    }
}

@media (min-width: 901px) {
    .cr-bottom-nav {
        display: none;
    }
}

/* =============================================================================
   ShareKit
   ============================================================================= */

.cr-section--sharekit {
    max-width: 680px;
}

/* Ranking widget */

.cr-sk-ranking {
    border: 1px solid #e4e4e8;
    background: #fafafa;
    padding: 1rem 1.25rem;
    margin-bottom: 1.75rem;
}

.cr-sk-ranking__title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #aaa;
    margin-bottom: 0.75rem;
}

.cr-sk-ranking__list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.cr-sk-ranking__row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.88rem;
    padding: 0.35rem 0.6rem;
}

.cr-sk-ranking__row--me {
    background: #eef4ff;
    border: 1px solid #c0d4f5;
    font-weight: 600;
}

.cr-sk-ranking__pos   { color: #aaa; font-size: 0.82rem; width: 20px; flex-shrink: 0; }
.cr-sk-ranking__name  { flex: 1; color: #333; }
.cr-sk-ranking__clicks { color: #1a1a2e; font-weight: 600; font-size: 0.85rem; }

.cr-sk-ranking__me {
    font-size: 0.85rem;
    color: #555;
    border-top: 1px solid #e4e4e8;
    padding-top: 0.65rem;
    margin-top: 0.35rem;
}

.cr-sk-ranking__me--none { color: #aaa; font-style: italic; }

/* Post list */

.cr-sk-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

@media (max-width: 600px) {
    .cr-sk-list { grid-template-columns: 1fr; }
}

.cr-sk-empty {
    color: #aaa;
    font-size: 0.92rem;
    padding: 2rem 0;
    text-align: center;
    grid-column: 1 / -1;
}

.cr-sk-post {
    border-radius: 8px;
    overflow: hidden;
    background: #111;
    cursor: pointer;
}

/* Square image */
.cr-sk-post__media {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.cr-sk-post__media img,
.cr-sk-post__media-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.cr-sk-post__media-placeholder {
    background: linear-gradient(135deg, #2a2a3a 0%, #1a1a2e 100%);
}

.cr-sk-post:hover .cr-sk-post__media img {
    transform: scale(1.05);
}

/* Text overlay: sits at bottom, slides up on hover */
.cr-sk-post__overlay {
    position: absolute;
    inset: 0;
    padding: 1rem 1rem 3.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background: rgba(0,0,0,0.88);
    transform: translateY(100%);
    transition: transform 0.35s ease;
}

.cr-sk-post:hover .cr-sk-post__overlay {
    transform: translateY(0);
}

.cr-sk-post__meta {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.6);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cr-sk-post__title {
    font-weight: 700;
    font-size: 0.92rem;
    color: #fff;
    line-height: 1.35;
}

/* Share button: always visible, bottom-right */
.cr-sk-post__share-btn {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #fff;
    color: #1a1a2e;
    border: none;
    border-radius: 6px;
    padding: 0.45rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    transition: background 0.15s, transform 0.15s;
    z-index: 2;
}

.cr-sk-post__share-btn:hover {
    background: #f0f0f8;
    transform: translateY(-1px);
}

.cr-sk-sentinel {
    display: flex;
    justify-content: center;
    padding: 1.5rem 0 0.5rem;
    min-height: 40px;
}

/* Share modal */

.cr-sk-modal {
    max-width: 520px;
}

/* Compositing loading screen */

.cr-sk-compositing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 1rem;
}

.cr-sk-compositing__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e8e8f0;
    border-top-color: #1a1a2e;
    border-radius: 50%;
    animation: cr-spin 0.7s linear infinite;
}

.cr-sk-compositing__text {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

/* Image download */

.cr-sk-download {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 0 1.1rem;
    border-bottom: 1px solid #f0f0f3;
    margin-bottom: 0.25rem;
}

.cr-sk-download__preview {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.cr-sk-download__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: #f4f4f8;
    color: #1a1a2e;
    border: 1px solid #e0e0ea;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
}

.cr-sk-download__btn:hover {
    background: #e8e8f2;
}

/* Steps */

.cr-sk-step {
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f3;
    opacity: 0.45;
    transition: opacity 0.2s;
}

.cr-sk-step:last-child { border-bottom: none; }
.cr-sk-step--active,
.cr-sk-step--done { opacity: 1; }

.cr-sk-step__head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 0.92rem;
    color: #1a1a2e;
    margin-bottom: 0.85rem;
}

.cr-sk-step__num {
    width: 22px;
    height: 22px;
    background: #1a1a2e;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* Platform buttons */

.cr-sk-step__platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cr-sk-platform-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1rem;
    border: 1.5px solid #e0e0e3;
    background: #fff;
    border-radius: 0;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1;
    color: #333;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.cr-sk-platform-btn span {
    display: flex;
    align-items: center;
}

.cr-sk-platform-btn svg {
    display: block;
}

.cr-sk-platform-btn:hover,
.cr-sk-platform-btn.is-selected {
    border-color: var(--platform-color);
    background: var(--platform-color);
    color: #fff;
}

/* Info box */

.cr-sk-info {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    background: #fffbea;
    border: 1px solid #ffe082;
    color: #7a5f00;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 0.85rem;
}

.cr-sk-ig-hint {
    background: #fdf3f3;
    border: 1px solid #f5c5c5;
    color: #b02020;
    padding: 0.65rem 0.9rem;
    font-size: 0.83rem;
    margin-bottom: 0.85rem;
}

/* Copy row */

.cr-sk-copy-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.cr-sk-copy-url {
    flex: 1;
    min-width: 0;
    font-size: 0.78rem;
    background: #f4f4f7;
    border: 1px solid #e4e4e8;
    padding: 0.45rem 0.7rem;
    word-break: break-all;
    color: #444;
}

/* =============================================================================
   Team
   ============================================================================= */

.cr-section--team {
    max-width: 640px;
}

.cr-team-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cr-team-member {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 0.9rem;
    border: 1px solid #e4e4e8;
    background: #fafafa;
}

.cr-team-member__avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--cr-accent, #1a1a2e);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
}

.cr-team-member__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cr-team-member__name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cr-team-member__email {
    font-size: 0.78rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cr-team-member__role {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: #555;
    background: #ececf0;
    padding: 2px 8px;
    border-radius: 20px;
}

.cr-team-member__remove {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #bbb;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.15s;
}

.cr-team-member__remove:hover {
    color: #e53935;
}

.cr-team-form {
    border: 1px solid #e4e4e8;
    padding: 1.25rem;
    background: #fafafa;
}

.cr-team-form__title {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
}

.cr-team-form__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.cr-team-form__grid .cr-field--full {
    grid-column: 1 / -1;
}

.cr-team-form__hint {
    margin: 0 0 1rem;
    font-size: 0.8rem;
    color: #888;
    line-height: 1.5;
}


/* ── Admin Stand Editor App ─────────────────────────────────────────────── */
.csa-layout {
    display: flex;
    gap: 0;
    min-height: 600px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.csa-sidebar {
    width: 240px;
    flex-shrink: 0;
    border-right: 1px solid #e0e0e0;
    background: #f9f9fb;
    display: flex;
    flex-direction: column;
}
.csa-sidebar__search { padding: 12px; border-bottom: 1px solid #e0e0e0; }
.csa-sidebar__input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 13px;
    box-sizing: border-box;
}

.csa-company-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1;
}
.csa-company-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background 0.12s;
    font-size: 13px;
    color: #333;
}
.csa-company-item:hover  { background: #f0f0f8; }
.csa-company-item.is-active { background: #1a1a2e; color: #fff; }

.csa-company-item__logo {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    background: #e8e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.csa-company-item__logo img { width: 100%; height: 100%; object-fit: contain; }
.csa-company-item__initial { font-size: 12px; font-weight: 700; color: #555; }
.csa-company-item.is-active .csa-company-item__initial { color: #fff; }
.csa-company-item.is-active .csa-company-item__logo { background: rgba(255,255,255,0.15); }
.csa-company-item__name { font-weight: 500; line-height: 1.3; }
.csa-company-list__empty { padding: 16px; color: #999; font-size: 13px; font-style: italic; }

.csa-editor {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px 24px;
}
.csa-editor__header {
    position: sticky;
    top: 0;
    background: #fff;
    padding: 16px 0 12px;
    border-bottom: 1px solid #eee;
    margin-bottom: 8px;
    z-index: 1;
}
.csa-editor__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
}
.csa-editor__empty { padding: 40px; color: #999; text-align: center; }

/* Hide section title in admin context (header already shows the company name) */
.csa-editor .cr-section__title { display: none; }
