:root {
    --bg: #1d1f24;
    --panel: rgba(33, 35, 42, 0.96);
    --panel-strong: #252830;
    --panel-soft: rgba(47, 50, 60, 0.9);
    --stroke: rgba(255, 255, 255, 0.08);
    --stroke-strong: rgba(255, 255, 255, 0.18);
    --text-main: #f3f5f7;
    --text-soft: #aeb4c0;
    --text-faint: #7d8494;
    --accent-a: #0d99ff;
    --accent-b: #5ec6ff;
    --accent-c: #ff9d55;
    --success: #4cd9a0;
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.26);
    --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.22);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    min-height: 100%;
    background: linear-gradient(180deg, #1b1d23 0%, #16181d 100%);
    color: var(--text-main);
    font-family: "IBM Plex Sans", sans-serif;
    overflow: hidden;
    overscroll-behavior: none;
}

button,
input,
select {
    font: inherit;
}

button {
    border: 0;
    background: none;
    color: inherit;
}

.app-shell {
    height: 100vh;
    min-height: 100vh;
    display: grid;
    grid-template-rows: 76px 1fr;
    overflow: hidden;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 18px 14px 16px;
    border-bottom: 1px solid var(--stroke);
    background: rgba(29, 31, 36, 0.88);
    backdrop-filter: blur(18px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(13, 153, 255, 0.16), rgba(94, 198, 255, 0.14));
    border: 1px solid var(--stroke);
    display: grid;
    place-items: center;
    box-shadow: var(--shadow-md);
}

.brand-mark img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.brand-copy strong {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.08rem;
    letter-spacing: 0.01em;
}

.brand-copy span {
    color: var(--text-soft);
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-btn,
.zoom-chip,
.rail-btn,
.collapse-btn,
.ghost-btn,
.chip-btn,
.mini-chip,
.layer-btn,
.cluster-row,
.object-row,
.row-action-btn,
.layer-delete-btn {
    transition:
        transform 140ms ease,
        border-color 140ms ease,
        background 140ms ease,
        box-shadow 140ms ease;
}

.topbar-btn {
    padding: 11px 16px;
    border-radius: 999px;
    background: rgba(42, 45, 54, 0.92);
    border: 1px solid var(--stroke);
    color: var(--text-main);
    cursor: pointer;
}

.topbar-btn:hover,
.object-row:hover,
.rail-btn:hover,
.ghost-btn:hover,
.chip-btn:hover,
.layer-btn:hover,
.cluster-row:hover,
.row-action-btn:hover,
.layer-delete-btn:hover {
    transform: translateY(-1px);
    border-color: var(--stroke-strong);
}

.topbar-btn.danger {
    color: #ffd5dd;
    border-color: rgba(255, 114, 143, 0.24);
    background: rgba(72, 26, 35, 0.55);
}

.zoom-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
    border-radius: 999px;
    background: rgba(42, 45, 54, 0.92);
    border: 1px solid var(--stroke);
}

.zoom-chip button {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
}

.zoom-chip span {
    min-width: 54px;
    text-align: center;
    font-weight: 600;
    color: var(--text-soft);
}

.workspace-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 380px;
    min-height: 0;
    overflow: hidden;
}

/* Left panel */
.left-panel {
    border-right: 1px solid var(--stroke);
    background: rgba(25, 27, 33, 0.96);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    overflow: hidden;
    transition: width 0.2s ease;
}

.left-panel-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 8px 10px;
    border-bottom: 1px solid var(--stroke);
}

.left-panel-toggle {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid var(--stroke);
    background: rgba(42, 45, 54, 0.92);
    cursor: pointer;
    color: var(--text-soft);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.left-panel-scroll {
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

.left-panel-scroll .panel-section {
    padding: 14px 12px;
    border-bottom: 1px solid var(--stroke);
}

.left-inspector-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.left-empty-hint {
    color: var(--text-soft);
    font-size: 0.85rem;
    line-height: 1.5;
}

.left-rotation-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.left-rotation-block .control-caption {
    color: var(--text-soft);
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.left-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
}

.left-info-row .label {
    color: var(--text-soft);
}

.left-info-row .value {
    color: var(--text-main);
    font-weight: 600;
}

body.left-panel-collapsed .workspace-shell {
    grid-template-columns: 44px minmax(0, 1fr) 380px;
}

body.left-panel-collapsed .left-panel-scroll {
    display: none;
}

body.left-panel-collapsed .left-panel-header {
    justify-content: center;
}

body.left-panel-collapsed .left-panel-toggle {
    transform: scaleX(-1);
}

/* Left panel tabs */
.left-panel-tab {
    padding: 6px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: none;
    color: var(--text-faint);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.left-panel-tab.is-active {
    background: rgba(13, 153, 255, 0.16);
    border-color: rgba(13, 153, 255, 0.3);
    color: var(--text-main);
}

body.left-panel-collapsed .left-panel-tab {
    display: none;
}

/* Files panel */
.left-panel-files {
    overflow-y: auto;
    min-height: 0;
    padding: 0;
}

.files-toolbar {
    padding: 12px;
    border-bottom: 1px solid var(--stroke);
}

.files-new-btn {
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px dashed rgba(13, 153, 255, 0.4);
    background: rgba(13, 153, 255, 0.08);
    color: var(--accent-a);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    text-align: center;
}

.files-new-btn:hover {
    background: rgba(13, 153, 255, 0.16);
}

.files-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.1s;
}

.file-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.file-item.is-active {
    background: rgba(13, 153, 255, 0.12);
    border-color: rgba(13, 153, 255, 0.3);
}

.file-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(13, 153, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.file-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-item-info strong {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-item-info span {
    font-size: 0.72rem;
    color: var(--text-faint);
}

.file-item-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.1s;
}

.file-item:hover .file-item-actions {
    opacity: 1;
}

.file-action-btn {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: 1px solid var(--stroke);
    background: rgba(42, 45, 54, 0.9);
    color: var(--text-soft);
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-action-btn.delete {
    border-color: rgba(255, 114, 143, 0.2);
    color: #ffd5dd;
}

.file-rename-input {
    width: 100%;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(13, 153, 255, 0.4);
    background: rgba(17, 20, 26, 0.96);
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 600;
    outline: none;
}

/* Topbar primary button */
.topbar-btn.primary {
    background: rgba(13, 153, 255, 0.18);
    border: 1px solid rgba(13, 153, 255, 0.35);
    color: var(--accent-b);
}

.stage-shell {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    background: linear-gradient(180deg, #1a1c22 0%, #181a20 100%);
    overflow: hidden;
}

.stage-info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--stroke);
}

.stage-info-main,
.stage-info-side {
    color: var(--text-soft);
    font-size: 0.92rem;
}

.stage-info-side {
    font-weight: 600;
}

.stage-viewport {
    min-height: 0;
    overflow: auto;
    position: relative;
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.025), transparent 18%),
        radial-gradient(circle at 88% 18%, rgba(255, 255, 255, 0.02), transparent 20%),
        linear-gradient(180deg, #17191e 0%, #14161b 100%);
    scrollbar-gutter: stable both-edges;
}

.stage-surface {
    position: relative;
    min-width: 100%;
    min-height: 100%;
    cursor: default;
}

.stage-board {
    position: absolute;
    left: 0;
    top: 0;
    width: 3200px;
    height: 2200px;
    border-radius: 32px;
    overflow: hidden;
    background:
        radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.035), transparent 16%),
        radial-gradient(circle at 82% 12%, rgba(255, 255, 255, 0.025), transparent 18%),
        linear-gradient(180deg, #20232a 0%, #1b1e24 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), var(--shadow-lg);
    transform-origin: top left;
    cursor: default;
}

.stage-board::after {
    content: "";
    position: absolute;
    top: 0;
    right: 32px;
    width: 220px;
    height: 220px;
    pointer-events: none;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.04), transparent 70%);
    opacity: 0.6;
}

.stage-object {
    position: absolute;
    border-radius: 8px;
    padding: 0;
    cursor: move;
    user-select: none;
    touch-action: none;
    overflow: visible; /* canvas may extend outside when content-box is inset */
}

.stage-object.is-selected {
    outline: 1.5px solid rgba(13, 153, 255, 0.9);
    outline-offset: 0px;
    background: transparent;
    box-shadow: none;
}

/* Shape-matching selection outlines — hug the object shape so neighbours stay clickable */
.stage-object[data-mobtype="arco"][data-variant="arco-fondo"] { border-radius: 50%; }
.stage-object[data-mobtype="arco"]:not([data-variant="arco-fondo"]) {
    border-radius: 48% 48% 6px 6px;
}
.stage-object[data-mobtype="marco-globos"] { border-radius: 46% 46% 4px 4px; }
.stage-object[data-mobtype="cilindro-alto"] { border-radius: 40% / 14%; }
.stage-object[data-kind="text"],
.stage-object[data-kind="rect"] { border-radius: 6px; }

.stage-object.is-dragging {
    cursor: grabbing;
}

.stage-object canvas {
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
    filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.22));
}

.stage-viewport.is-pan-mode .stage-surface,
.stage-viewport.is-pan-mode .stage-board {
    cursor: grab;
}

.stage-viewport.is-pan-mode .stage-object {
    cursor: grab;
}

.stage-viewport.is-panning .stage-surface,
.stage-viewport.is-panning .stage-board,
.stage-viewport.is-panning .stage-object,
.stage-viewport.is-panning .stage-object.is-dragging {
    cursor: grabbing;
}

.object-chrome {
    position: absolute;
    top: -10px;
    left: 6px;
    right: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(22, 25, 32, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
    font-size: 0.78rem;
    color: var(--text-soft);
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
    transition:
        opacity 140ms ease,
        transform 140ms ease;
}

.object-chrome strong {
    color: var(--text-main);
    font-weight: 600;
}

.stage-object:hover .object-chrome,
.stage-object.is-dragging .object-chrome {
    opacity: 1;
    transform: translateY(0);
}

.inspector {
    border-left: 1px solid var(--stroke);
    background: rgba(32, 34, 41, 0.97);
    backdrop-filter: blur(18px);
    display: grid;
    grid-template-rows: auto 1fr;
    min-height: 0;
}

.inspector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 16px;
    border-bottom: 1px solid var(--stroke);
}

.inspector-header strong {
    display: block;
    font-family: "Space Grotesk", sans-serif;
    letter-spacing: 0.01em;
}

.inspector-header span {
    color: var(--text-soft);
    font-size: 0.88rem;
}

.collapse-btn {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    border: 1px solid var(--stroke);
    background: rgba(42, 45, 54, 0.92);
    cursor: pointer;
}

.inspector-scroll {
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    height: 100%;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    overscroll-behavior: contain;
    scrollbar-gutter: stable both-edges;
    scrollbar-width: thin;
    position: relative;
}

.panel-section {
    padding: 16px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(40, 43, 52, 0.96), rgba(34, 36, 44, 0.96));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-md);
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.panel-head strong {
    display: block;
    font-size: 0.98rem;
}

.panel-head span {
    color: var(--text-soft);
    font-size: 0.82rem;
}

.object-library {
    display: grid;
    gap: 12px;
}

.object-library-list {
    gap: 16px;
}

.object-group {
    display: grid;
    gap: 10px;
}

.object-group-title {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
}

.object-row {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(28, 30, 37, 0.96);
    cursor: grab;
    user-select: none;
}

.object-row:active {
    cursor: grabbing;
}

.object-row.is-dragging {
    opacity: 0.7;
    border-color: rgba(13, 153, 255, 0.34);
}

.library-drag-preview {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    pointer-events: none;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(24, 27, 34, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(10px);
}

.library-drag-preview.is-over-canvas {
    border-color: rgba(13, 153, 255, 0.36);
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.34),
        0 0 0 1px rgba(13, 153, 255, 0.18);
}

.library-drag-preview canvas {
    width: 56px;
    height: 56px;
    display: block;
    object-fit: contain;
}

.library-drag-preview span {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
}

.object-row-garland {
    grid-template-columns: 80px minmax(0, 1fr);
}

.object-row-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.object-row-garland .mini-segmented {
    align-self: flex-start;
}

.library-preview {
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
    display: block;
    object-fit: contain;
}

.library-preview.is-small {
    width: 64px;
    height: 64px;
}

.library-preview.is-compact {
    width: 80px;
    height: 80px;
}

.object-row-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.object-row-main strong {
    font-size: 0.92rem;
}

.object-row-main span {
    color: var(--text-soft);
    font-size: 0.78rem;
    line-height: 1.4;
}

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

.object-row-controls-stack {
    flex-direction: column;
    align-items: stretch;
}

/* Toggle sections */
.toggle-head {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toggle-arrow {
    color: var(--text-faint);
    font-size: 1rem;
    transition: transform 0.15s ease;
}

.toggle-body {
    display: none;
    padding-top: 12px;
}

.toggle-body.is-open {
    display: block;
}

.toggle-placeholder {
    color: var(--text-faint);
    font-size: 0.84rem;
    line-height: 1.5;
    padding: 8px 0;
}

/* Rotation handle on canvas objects */
.rotation-handle {
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(13, 153, 255, 0.85);
    border: 2px solid #fff;
    cursor: grab;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.rotation-handle:active {
    cursor: grabbing;
}

.stage-object.is-selected .rotation-handle {
    display: block;
}

.scale-handle {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: rgba(13, 153, 255, 0.85);
    border: 2px solid #fff;
    cursor: nwse-resize;
    bottom: -9px;
    right: -9px;
    z-index: 10;
    display: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.stage-object.is-selected .scale-handle {
    display: block;
}

/* Layer drag styles */
.layer-row.is-dragging {
    opacity: 0.5;
}

.layer-row.drag-over {
    border-top: 2px solid var(--accent-a);
}

.layer-btn {
    cursor: grab;
}

.layer-btn:active {
    cursor: grabbing;
}

.mini-segmented {
    display: inline-grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    background: rgba(17, 20, 26, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.mini-chip {
    padding: 8px 14px;
    border-radius: 10px;
    color: var(--text-soft);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}

.mini-chip.is-active {
    background: rgba(13, 153, 255, 0.22);
    color: var(--text-main);
    border: 1px solid rgba(13, 153, 255, 0.3);
}

.row-action-btn {
    min-width: 72px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(13, 153, 255, 0.32);
    background: rgba(13, 153, 255, 0.16);
    color: var(--text-main);
    font-weight: 600;
    cursor: pointer;
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.palette-swatch {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(32, 35, 43, 0.94);
    cursor: pointer;
    text-align: left;
}

.palette-swatch.is-active {
    border-color: rgba(13, 153, 255, 0.4);
    background: rgba(13, 153, 255, 0.14);
    box-shadow: inset 0 0 0 1px rgba(13, 153, 255, 0.18);
}

.palette-dot {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    flex: 0 0 auto;
}

.palette-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.palette-copy strong {
    font-size: 0.82rem;
}

.palette-copy span {
    color: var(--text-faint);
    font-size: 0.72rem;
}

.inspector-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.inspector-content.is-empty {
    color: var(--text-soft);
    line-height: 1.6;
}

.control-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-block label,
.control-caption {
    color: var(--text-soft);
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.segmented {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.segmented.size-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.chip-btn,
.ghost-btn {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(32, 35, 43, 0.94);
    cursor: pointer;
}

.chip-btn.is-active,
.ghost-btn.is-active {
    background: rgba(13, 153, 255, 0.14);
    border-color: rgba(13, 153, 255, 0.34);
}

.cluster-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cluster-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(32, 35, 43, 0.94);
    cursor: pointer;
    text-align: left;
}

.cluster-row.is-active {
    border-color: rgba(13, 153, 255, 0.34);
    background: rgba(13, 153, 255, 0.14);
}

.cluster-row .swatch {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    flex: 0 0 auto;
}

.cluster-row-wrap {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cluster-row {
    justify-content: flex-start;
}

.cluster-row-arrow {
    margin-left: auto;
    color: var(--text-faint);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.cluster-color-picker {
    padding: 10px 12px;
    border-radius: 0 0 16px 16px;
    background: rgba(17, 20, 26, 0.96);
    border: 1px solid rgba(13, 153, 255, 0.2);
    border-top: 0;
    margin-top: -1px;
}

.mob-color-current {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--text-secondary, #aaa);
}

.mob-color-current .swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.2);
    flex-shrink: 0;
}

.cluster-color-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
}

.cluster-color-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    transition: transform 0.1s ease, border-color 0.1s ease;
}

.cluster-color-dot:hover {
    transform: scale(1.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.cluster-color-dot.is-active {
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(13, 153, 255, 0.5);
}

.cluster-row-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cluster-row-copy strong {
    font-size: 0.88rem;
}

.cluster-row-copy span {
    color: var(--text-faint);
    font-size: 0.74rem;
}

.range-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.range-wrap input[type="range"] {
    width: 100%;
    accent-color: #0d99ff;
}

.range-value {
    min-width: 56px;
    color: var(--text-soft);
    font-weight: 600;
    text-align: right;
}

.rotation-input {
    width: 56px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(17, 20, 26, 0.96);
    color: var(--text-main);
    font-weight: 600;
    text-align: center;
    appearance: textfield;
    -moz-appearance: textfield;
}

.rotation-input::-webkit-inner-spin-button,
.rotation-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.range-unit {
    color: var(--text-faint);
    font-weight: 600;
    font-size: 0.88rem;
}

.action-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.ghost-btn.delete {
    border-color: rgba(255, 114, 143, 0.2);
    color: #ffd5dd;
}

.ghost-btn.delete:hover {
    background: rgba(72, 26, 35, 0.5);
}

.layers-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.layer-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 36px;
    gap: 8px;
    align-items: stretch;
}

.layer-btn {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(32, 35, 43, 0.94);
    cursor: pointer;
    text-align: left;
}

.layer-btn.is-active {
    border-color: rgba(13, 153, 255, 0.34);
    background: rgba(13, 153, 255, 0.14);
}

.layer-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.layer-title strong {
    font-size: 0.88rem;
}

.layer-title span,
.layer-meta {
    color: var(--text-faint);
    font-size: 0.75rem;
}

.layer-delete-btn {
    border-radius: 14px;
    border: 1px solid rgba(255, 114, 143, 0.2);
    background: rgba(72, 26, 35, 0.5);
    color: #ffd5dd;
    cursor: pointer;
}

body.panel-collapsed .workspace-shell {
    grid-template-columns: 280px minmax(0, 1fr) 92px;
}

body.panel-collapsed.left-panel-collapsed .workspace-shell {
    grid-template-columns: 48px minmax(0, 1fr) 92px;
}

body.panel-collapsed .inspector-header {
    justify-content: center;
}

body.panel-collapsed .inspector-header > div,
body.panel-collapsed .inspector-scroll {
    opacity: 0;
    pointer-events: none;
}

body.panel-collapsed .collapse-btn {
    transform: scaleX(-1);
}

@media (max-width: 1260px) {
    .workspace-shell {
        grid-template-columns: 220px minmax(0, 1fr) 320px;
    }

    body.panel-collapsed .workspace-shell {
        grid-template-columns: 220px minmax(0, 1fr) 92px;
    }

    .object-row,
    .object-row-garland {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
}

@media (max-width: 980px) {
    .topbar {
        flex-direction: column;
        align-items: stretch;
        height: auto;
    }

    .topbar-actions {
        flex-wrap: wrap;
    }

    .workspace-shell {
        grid-template-columns: 1fr;
        grid-template-rows: 64px minmax(0, 1fr) 360px;
    }

    .left-rail {
        flex-direction: row;
        justify-content: center;
        border-right: 0;
        border-bottom: 1px solid var(--stroke);
    }

    .inspector {
        border-left: 0;
        border-top: 1px solid var(--stroke);
    }
}

/* ── Named color grid ─────────────────────── */
.cluster-color-named-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
}

.cluster-color-named {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    color: var(--text-soft);
    font-size: 0.75rem;
    text-align: left;
}

.cluster-color-named:hover {
    background: rgba(255,255,255,0.06);
}

.cluster-color-named.is-active {
    background: rgba(13, 153, 255, 0.14);
    border-color: rgba(13, 153, 255, 0.34);
    color: var(--text-main);
}

.cluster-color-dot-circle {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.15);
}

.cluster-color-dot-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Stage bottom toolbar ─────────────────────── */
.stage-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-top: 1px solid var(--stroke);
    background: rgba(22, 24, 30, 0.96);
}

.toolbar-tool {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(32, 35, 43, 0.94);
    color: var(--text-soft);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.15s, border-color 0.15s;
}

.toolbar-tool:hover {
    background: rgba(40, 44, 55, 1);
    border-color: rgba(255, 255, 255, 0.14);
    color: var(--text-main);
}

.toolbar-tool svg {
    flex-shrink: 0;
}

/* ── Text object on stage ─────────────────────── */
.stage-text-content {
    position: relative;
    width: 100%;
    min-height: 32px;
    padding: 4px 8px;
    color: #ffffff;
    font-family: 'IBM Plex Sans', sans-serif;
    outline: none;
    border: none;
    background: transparent;
    white-space: pre-wrap;
    word-break: break-word;
    cursor: text;
    line-height: 1.3;
}

.stage-text-content:empty::before {
    content: "Escribe aquí…";
    color: rgba(255, 255, 255, 0.3);
    pointer-events: none;
}

/* ── Rect object on stage ─────────────────────── */
.stage-rect-content {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* ── Image object on stage ─────────────────────── */
.stage-image-content {
    pointer-events: none;
    user-select: none;
}

/* ── Materials modal ─────────────────────── */
.materials-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.materials-modal {
    background: var(--panel-bg, #1e2028);
    border: 1px solid var(--stroke, rgba(255,255,255,0.08));
    border-radius: 20px;
    width: 520px;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}

.materials-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--stroke, rgba(255,255,255,0.08));
    font-size: 1.1rem;
}

.materials-close {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.06);
    color: var(--text-soft);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.materials-body {
    padding: 20px 24px;
    overflow-y: auto;
    color: var(--text-main, #e0e0e0);
    font-size: 0.9rem;
    line-height: 1.6;
}

.mat-section {
    margin-bottom: 20px;
}

.mat-section-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.mat-table {
    width: 100%;
    border-collapse: collapse;
}

.mat-table th,
.mat-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.mat-table th {
    color: var(--text-soft);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mat-total-row td {
    font-weight: 700;
    border-top: 2px solid rgba(255,255,255,0.12);
    padding-top: 12px;
}

.mat-color-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    border: 1px solid rgba(255,255,255,0.15);
}

.mat-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-soft);
}

/* ── Budget card (top of materials modal) ─────── */
.mat-budget-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(59, 130, 246, 0.14));
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 18px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}
.mat-budget-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.72);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}
.mat-budget-amount {
    font-size: 2.1rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.mat-budget-breakdown {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 18px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.82rem;
}
.mat-budget-breakdown > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: rgba(255, 255, 255, 0.72);
}
.mat-budget-breakdown strong {
    color: #fff;
    font-weight: 600;
}
.mat-readonly-hint {
    margin-top: 10px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.65);
    font-style: italic;
}

/* Editable price inputs */
.mat-prices-table th:nth-child(3),
.mat-prices-table th:nth-child(4),
.mat-prices-table td:nth-child(3),
.mat-prices-table td:nth-child(4) {
    text-align: right;
}
.mat-price-input {
    width: 80px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #fff;
    font-size: 0.85rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.mat-price-input:focus {
    outline: none;
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}
.mat-price-input[readonly] {
    opacity: 0.6;
    cursor: not-allowed;
}
.mat-subsection-title {
    margin: 14px 0 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.mat-reset-section {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.mat-reset-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.75);
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.mat-reset-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* ── Mobiliario background image ── */
.bg-image-upload-btn {
    width: 100%;
    padding: 10px;
    text-align: center;
    border: 2px dashed var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}
.bg-image-upload-btn:hover {
    border-color: var(--accent);
    background: rgba(59,130,246,0.05);
}
.bg-image-preview-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.bg-image-preview {
    width: 100%;
    max-height: 120px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
}
.bg-image-remove {
    font-size: 12px;
    padding: 4px 8px;
}

/* ── Layer rename input ── */
.layer-rename-input {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--accent);
    border-radius: 4px;
    color: var(--text-main);
    font-weight: 600;
    font-size: 13px;
    padding: 2px 6px;
    outline: none;
}

/* ── Text content input in properties panel ── */
.text-content-input {
    width: 100%;
    min-height: 60px;
    padding: 8px 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-main);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 13px;
    line-height: 1.4;
    resize: vertical;
    outline: none;
}
.text-content-input:focus {
    border-color: var(--accent);
}

/* ── Marquee selection rectangle ── */
.marquee-rect {
    position: absolute;
    border: 2px dashed rgba(59, 130, 246, 0.8);
    background: rgba(59, 130, 246, 0.1);
    pointer-events: none;
    z-index: 99999;
    display: none;
}

/* --- Bg image edit mode (Figma-style crop) --- */
.stage-object.is-bg-editing {
    border-color: rgba(168, 85, 247, 0.85);
    background: rgba(168, 85, 247, 0.08);
    box-shadow:
        0 0 0 2px rgba(168, 85, 247, 0.5),
        0 24px 40px rgba(15, 18, 34, 0.5);
    z-index: 99998 !important;
}

.bg-edit-overlay {
    position: absolute;
    inset: 18px; /* inside the chrome padding */
    cursor: grab;
    border-radius: 4px;
    z-index: 10;
}

.bg-edit-overlay:active {
    cursor: grabbing;
}

.bg-edit-hint {
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 11px;
    font-weight: 500;
    color: #fff;
    background: rgba(168, 85, 247, 0.85);
    padding: 3px 10px;
    border-radius: 6px;
    pointer-events: none;
}

.stage-object.is-bg-editing .rotation-handle,
.stage-object.is-bg-editing .scale-handle {
    display: none !important;
}

.stage-object.is-bg-editing .object-chrome {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.3);
}

.bg-move-btn {
    margin-top: 6px;
    width: 100%;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(168, 85, 247, 0.95);
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.bg-move-btn:hover {
    background: rgba(168, 85, 247, 0.22);
    border-color: rgba(168, 85, 247, 0.5);
}

/* --- Auth UI --- */
.auth-btn {
    background: rgba(59, 130, 246, 0.15);
    color: #6cb4ff;
    border-color: rgba(59, 130, 246, 0.3);
    font-weight: 600;
}
.auth-btn:hover { background: rgba(59, 130, 246, 0.25); }
.auth-btn.is-logged-in {
    background: rgba(52, 211, 153, 0.12);
    color: #6ee7b7;
    border-color: rgba(52, 211, 153, 0.3);
    padding: 4px 10px;
    gap: 6px;
    display: flex;
    align-items: center;
}
.auth-btn .auth-avatar {
    width: 22px; height: 22px; border-radius: 50%;
    object-fit: cover;
}

/* Auth overlay */
.auth-overlay {
    position: fixed; inset: 0; z-index: 100000;
    background: rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
}
.auth-modal {
    background: var(--panel-strong, #252830);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    width: 380px; max-width: 92vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    overflow: hidden;
}
.auth-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.auth-header strong { font-size: 16px; color: #fff; }
.auth-close {
    background: none; border: none; color: #888; font-size: 22px;
    cursor: pointer; padding: 0 4px; line-height: 1;
}
.auth-close:hover { color: #fff; }
.auth-body { padding: 20px; }

.auth-google-btn {
    width: 100%; padding: 11px 16px;
    background: #fff; color: #333; border: none; border-radius: 8px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: background 0.15s;
}
.auth-google-btn:hover { background: #f0f0f0; }
.auth-google-btn svg { flex-shrink: 0; }

.auth-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 16px 0; color: #666; font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
    content: ""; flex: 1; height: 1px; background: rgba(255,255,255,0.08);
}

.auth-input {
    width: 100%; padding: 10px 14px; margin-bottom: 10px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px; color: #fff; font-size: 14px;
    outline: none; box-sizing: border-box;
}
.auth-input:focus { border-color: rgba(59, 130, 246, 0.5); }
.auth-input::placeholder { color: #666; }

.auth-error {
    background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5; padding: 8px 12px; border-radius: 6px;
    font-size: 12px; margin-bottom: 10px;
}

.auth-submit-btn {
    width: 100%; padding: 11px 16px;
    background: rgba(59, 130, 246, 0.8); color: #fff; border: none;
    border-radius: 8px; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: background 0.15s;
}
.auth-submit-btn:hover { background: rgba(59, 130, 246, 1); }

.auth-switch-btn {
    width: 100%; padding: 8px; margin-top: 8px;
    background: none; border: none; color: #6cb4ff;
    font-size: 12px; cursor: pointer; text-align: center;
}
.auth-switch-btn:hover { text-decoration: underline; }

/* Auth user dropdown menu */
.auth-user-menu {
    position: fixed; z-index: 100001;
    background: var(--panel-strong, #252830);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px; padding: 12px;
    min-width: 220px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.auth-user-info {
    display: flex; flex-direction: column; gap: 2px;
    padding-bottom: 10px; margin-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.auth-user-info strong { color: #fff; font-size: 13px; }
.auth-user-info span { color: #888; font-size: 11px; }
.auth-menu-btn {
    width: 100%; padding: 8px 12px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px; color: #ccc; font-size: 12px;
    cursor: pointer; text-align: center;
}
.auth-menu-btn.danger { color: #fca5a5; border-color: rgba(239,68,68,0.2); }
.auth-menu-btn:hover { background: rgba(255,255,255,0.1); }

/* Project limit warning */
.project-limit-msg {
    background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24; padding: 8px 12px; border-radius: 6px;
    font-size: 12px; text-align: center; margin-bottom: 8px;
}

/* ===== LIVE COLLABORATION ===== */

/* Invite button in topbar */
.live-invite-btn {
    background: linear-gradient(135deg, #7c3aed, #3b82f6) !important;
    color: #fff !important;
    border: none !important;
    font-weight: 600;
}
.live-invite-btn:hover { filter: brightness(1.1); }

/* Guest mode: hide chrome the guest shouldn't see */
body.live-guest .left-panel,
body.live-guest .inspector,
body.live-guest #toggleFilesBtn,
body.live-guest #materialsBtn,
body.live-guest #deleteSelectionTopBtn,
body.live-guest #togglePanelBtn,
body.live-guest #authBtn,
body.live-guest #liveInviteBtn,
body.live-guest .auth-user-menu,
body.live-guest #filesPanelView,
body.live-guest .topbar,
body.live-guest .stage-info-bar,
body.live-guest .stage-toolbar,
body.live-guest .brand-copy span {
    display: none !important;
}
/* Guest: full-screen stage, offset by the live banner */
body.live-guest { overflow: hidden; }
body.live-guest .app-shell {
    padding: 0 !important;
    margin: 0 !important;
    gap: 0 !important;
    height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
}
body.live-guest .workspace-shell {
    padding: 0 !important;
    margin: 0 !important;
    gap: 0 !important;
    grid-template-columns: 1fr !important;
    display: flex !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    padding-top: 40px !important; /* live banner height */
}
body.live-guest .stage-shell {
    padding: 0 !important;
    margin: 0 !important;
    gap: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
}
body.live-guest .stage-viewport {
    width: 100% !important;
    height: 100% !important;
    flex: 1 1 auto !important;
    border-radius: 0 !important;
    min-height: 0 !important;
}

/* Live banner (top bar, guest only) */
.live-banner {
    display: none; position: fixed; top: 0; left: 0; right: 0; height: 40px;
    background: #111; color: #fff; align-items: center; justify-content: center;
    z-index: 5000; font-size: 14px; font-weight: 600; letter-spacing: 0.2px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
body.live-guest .live-banner { display: flex; }

/* Lock canvas when the participant doesn't have control */
body.live-locked .stage-board { pointer-events: none; }
body.live-locked .stage-board * { cursor: not-allowed !important; }

/* Marker placement cursor */
body.live-marker-mode .stage-viewport { cursor: crosshair !important; }

/* Overlay for cursors + markers (lives inside .stage-surface so it moves with the content) */
.live-overlay {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 500;
    overflow: visible;
}

/* Remote cursors */
.live-cursor {
    position: absolute; top: 0; left: 0;
    transform-origin: 0 0;
    pointer-events: none;
    z-index: 501;
    will-change: transform;
}
.live-cursor svg { display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4)); }
.live-cursor-label {
    display: inline-block; margin-left: 12px; margin-top: -4px;
    padding: 2px 8px; border-radius: 10px;
    color: #fff; font-size: 11px; font-weight: 600;
    white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

/* Markers */
.live-marker {
    position: absolute; top: 0; left: 0;
    pointer-events: auto;
    z-index: 502;
    transform-origin: center;
    width: 0; height: 0;
}
.live-marker-dot {
    position: absolute; left: -14px; top: -28px;
    font-size: 22px; line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35));
    cursor: default;
}
.live-marker.can-delete .live-marker-dot { cursor: pointer; }

/* Yellow sticky note overlay */
.live-note {
    position: absolute; top: 0; left: 0;
    pointer-events: auto;
    z-index: 503;
    width: 0; height: 0;
}
.live-note-body {
    position: absolute;
    left: 10px; top: -14px;
    min-width: 80px;
    max-width: 220px;
    padding: 8px 12px;
    background: #fde047;
    color: #1f2937;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    border-radius: 4px 10px 10px 10px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.35), 0 1px 0 rgba(0,0,0,0.1) inset;
    transform: rotate(-1.5deg);
    word-wrap: break-word;
    white-space: pre-wrap;
}
.live-note-author {
    position: absolute;
    left: 14px; top: 24px;
    transform: translateY(100%) rotate(-1.5deg);
    padding: 1px 6px;
    background: rgba(17,17,17,0.8);
    color: #fff;
    font-size: 9px;
    font-weight: 600;
    border-radius: 6px;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.live-note-close {
    position: absolute;
    left: 210px; top: -22px;
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.15);
    background: #fff;
    color: #111;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    display: none;
}
.live-note.can-delete:hover .live-note-close { display: block; }
body.live-note-mode .stage-viewport { cursor: crosshair; }
.live-marker-pulse {
    position: absolute; left: -12px; top: -12px;
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--mk-color, #f59e0b);
    opacity: 0.35;
    animation: liveMarkerPulse 1.6s ease-out infinite;
}
.live-marker-label {
    position: absolute; left: 10px; top: -10px;
    padding: 2px 6px; border-radius: 8px;
    background: rgba(17, 17, 17, 0.85); color: #fff;
    font-size: 10px; font-weight: 600; white-space: nowrap;
}
@keyframes liveMarkerPulse {
    0%   { transform: scale(0.6); opacity: 0.5; }
    70%  { transform: scale(1.8); opacity: 0; }
    100% { transform: scale(1.8); opacity: 0; }
}

/* Floating live toolbar (undo/redo/marker/control) */
.live-toolbar {
    position: fixed; bottom: 92px; left: 50%;
    transform: translateX(-50%);
    display: flex; align-items: center; gap: 6px;
    padding: 8px 10px;
    background: rgba(17, 17, 17, 0.92);
    color: #fff; border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    z-index: 4500;
    backdrop-filter: blur(6px);
}
/* In guest mode there is no stage-toolbar below, so bring it back down */
body.live-guest .live-toolbar { bottom: 20px; }
.live-tool-btn.is-note-active { background: #fde047; color: #111; border-color: #fde047; }
.live-tool-btn {
    background: rgba(255,255,255,0.08);
    color: #fff; border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px; padding: 6px 10px;
    font-size: 14px; cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}
.live-tool-btn:hover { background: rgba(255,255,255,0.18); }
.live-tool-btn.is-active { background: #f59e0b; color: #111; border-color: #f59e0b; }
/* Control bar at top (owner only, shown when guest connected) */
.live-control-bar {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translate(-50%, -120%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px 8px 14px;
    background: rgba(17, 17, 17, 0.94);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    z-index: 5500;
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: transform 220ms ease, opacity 220ms ease;
    font-size: 13px;
}
.live-control-bar.is-visible {
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: auto;
}
.live-control-bar__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
    animation: liveDotPulse 1.8s ease-in-out infinite;
}
@keyframes liveDotPulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18); }
    50% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0.08); }
}
.live-control-bar__label {
    color: #e5e7eb;
    font-weight: 500;
    white-space: nowrap;
}
.live-control-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.live-control-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}
.live-control-toggle__track {
    position: relative;
    width: 32px;
    height: 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    transition: background 0.2s ease;
}
.live-control-toggle__thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    transition: left 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}
.live-control-toggle.is-on .live-control-toggle__track {
    background: linear-gradient(135deg, #7c3aed, #3b82f6);
}
.live-control-toggle.is-on .live-control-toggle__thumb {
    left: 16px;
}
.live-control-toggle__text {
    letter-spacing: 0.01em;
}
/* Hide control bar completely while guest is viewing (guests should not see it) */
body.live-guest .live-control-bar { display: none !important; }
.live-control-indicator {
    padding: 4px 10px; border-radius: 8px;
    font-size: 12px; font-weight: 600;
    background: rgba(255,255,255,0.08); color: #cbd5e1;
}
.live-control-indicator.is-editor { background: #10b981; color: #fff; }

/* Invite / guest name modal */
.live-invite-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex; align-items: center; justify-content: center;
    z-index: 6000;
}
.live-invite-modal {
    background: #0f172a; color: #e2e8f0;
    border-radius: 14px; padding: 0;
    width: min(480px, 92vw);
    box-shadow: 0 24px 60px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.08);
    overflow: hidden;
}
.live-invite-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 15px;
}
.live-invite-close {
    background: none; border: none; color: #94a3b8;
    font-size: 22px; cursor: pointer; line-height: 1;
}
.live-invite-body { padding: 16px 18px 20px; font-size: 13px; }
.live-invite-body p { margin: 0 0 12px; color: #cbd5e1; }
.live-invite-linkbox {
    display: flex; gap: 8px; margin: 8px 0 6px;
}
.live-invite-linkbox input {
    flex: 1; background: #1e293b; color: #f1f5f9;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px; padding: 8px 10px;
    font-size: 12px; font-family: monospace;
}
.live-invite-copy, .live-name-submit {
    background: #3b82f6; color: #fff; border: none;
    padding: 8px 14px; border-radius: 8px; cursor: pointer;
    font-size: 13px; font-weight: 600;
}
.live-invite-copy:hover { background: #2563eb; }
.live-name-input {
    width: 100%; background: #1e293b; color: #f1f5f9;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px; padding: 10px 12px; font-size: 14px;
    margin-bottom: 12px;
}
.live-invite-hint { color: #94a3b8; font-size: 11px; margin-top: 8px; }

/* Chat FAB + panel */
.live-chat-fab {
    position: fixed; right: 20px; bottom: 20px;
    width: 52px; height: 52px; border-radius: 50%;
    background: #3b82f6; color: #fff; border: none;
    font-size: 22px; cursor: pointer;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
    z-index: 4600;
    display: none;
    align-items: center; justify-content: center;
}
body.live-session .live-chat-fab { display: flex; }
body.live-session .live-toolbar { display: flex; }
body:not(.live-session) .live-toolbar { display: none; }
.live-chat-badge {
    position: absolute; top: -4px; right: -4px;
    background: #ef4444; color: #fff;
    min-width: 18px; height: 18px; border-radius: 9px;
    padding: 0 5px; font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.live-chat-panel {
    position: fixed; right: 20px; bottom: 84px;
    width: 320px; max-height: 440px;
    background: #0f172a; color: #e2e8f0;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,0.45);
    display: none; flex-direction: column;
    z-index: 4600; overflow: hidden;
}
.live-chat-panel.is-open { display: flex; }
.live-chat-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 13px;
}
.live-chat-close {
    background: none; border: none; color: #94a3b8; font-size: 20px;
    cursor: pointer; line-height: 1;
}
.live-chat-messages {
    flex: 1; overflow-y: auto;
    padding: 12px 14px; display: flex; flex-direction: column; gap: 10px;
}
.live-chat-msg { display: flex; flex-direction: column; gap: 2px; }
.live-chat-msg.is-mine { align-items: flex-end; }
.live-chat-author { font-size: 11px; font-weight: 700; }
.live-chat-text {
    background: #1e293b; padding: 6px 10px; border-radius: 10px;
    font-size: 12px; max-width: 85%; word-wrap: break-word;
}
.live-chat-msg.is-mine .live-chat-text { background: #3b82f6; color: #fff; }
.live-chat-form {
    display: flex; gap: 6px; padding: 10px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.live-chat-input {
    flex: 1; background: #1e293b; color: #f1f5f9;
    border: 1px solid rgba(255,255,255,0.1); border-radius: 8px;
    padding: 8px 10px; font-size: 12px;
}
.live-chat-send {
    background: #3b82f6; color: #fff; border: none;
    padding: 8px 12px; border-radius: 8px; cursor: pointer;
    font-size: 12px; font-weight: 600;
}
.live-chat-send:hover { background: #2563eb; }

/* ═══════════════════════════════════════════════════════════════════
   BOOKING SYSTEM — #/citas (public) & #/admin (admin panel)
   Dark theme with glassmorphism, coral accent (#ff4d4d)
   ═══════════════════════════════════════════════════════════════════ */

/* ── Page containers ────────────────────────────────── */
.booking-page, .admin-page {
    position: fixed; inset: 0; z-index: 100;
    background: linear-gradient(180deg, #1b1d23 0%, #16181d 100%);
    overflow-y: auto;
    font-family: 'IBM Plex Sans', sans-serif;
}

.bk-page {
    max-width: 620px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}

.bk-loading {
    text-align: center; padding: 80px 0;
    color: var(--text-soft, #aeb4c0);
    font-size: 15px;
}

/* ── Header ─────────────────────────────────────────── */
.bk-header {
    text-align: center;
    margin-bottom: 36px;
}

.bk-logo {
    width: 64px; height: 64px;
    border-radius: 16px;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.bk-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 28px; font-weight: 700;
    color: #f3f5f7;
    margin: 0 0 8px;
}

.bk-subtitle {
    font-size: 14px; color: #aeb4c0;
    max-width: 440px; margin: 0 auto;
    line-height: 1.5;
}

/* ── Cards (glassmorphism) ──────────────────────────── */
.bk-card {
    background: rgba(33, 35, 42, 0.96);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 20px;
}

/* ── Calendar ───────────────────────────────────────── */
.bk-calendar-nav {
    display: flex; align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.bk-nav-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: #f3f5f7; font-size: 18px;
    width: 40px; height: 40px;
    cursor: pointer;
    transition: background 0.15s;
}
.bk-nav-btn:hover { background: rgba(255,255,255,0.12); }

.bk-month-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px; font-weight: 600;
    color: #f3f5f7;
}

.bk-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.bk-day-header {
    text-align: center;
    font-size: 11px; font-weight: 600;
    color: #7d8494;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 0 8px;
}

.bk-day {
    text-align: center;
    padding: 10px 0;
    border-radius: 12px;
    font-size: 14px; font-weight: 500;
    color: #7d8494;
    transition: all 0.15s;
    min-height: 40px;
    display: flex; align-items: center; justify-content: center;
}

.bk-day.empty { visibility: hidden; }

.bk-day.past {
    color: rgba(125, 132, 148, 0.35);
    cursor: default;
}

.bk-day.available {
    color: #f3f5f7;
    background: rgba(76, 217, 160, 0.08);
    border: 1px solid rgba(76, 217, 160, 0.15);
    cursor: pointer;
}
.bk-day.available:hover {
    background: rgba(76, 217, 160, 0.18);
    transform: translateY(-1px);
}

.bk-day.today {
    box-shadow: inset 0 0 0 2px rgba(255, 77, 77, 0.4);
}

.bk-day.selected {
    background: #ff4d4d !important;
    color: #fff !important;
    border-color: #ff4d4d !important;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(255, 77, 77, 0.3);
}

/* ── Time slots ─────────────────────────────────────── */
.bk-slots-label {
    font-size: 13px; color: #aeb4c0;
    margin: 0 0 14px;
}

.bk-slots {
    display: flex; flex-wrap: wrap; gap: 10px;
}

.bk-slot {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px;
    color: #f3f5f7;
    font-size: 14px; font-weight: 500;
    padding: 10px 22px;
    cursor: pointer;
    transition: all 0.15s;
}
.bk-slot:hover {
    background: rgba(255,255,255,0.12);
    transform: translateY(-1px);
}
.bk-slot.selected {
    background: #ff4d4d;
    border-color: #ff4d4d;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(255, 77, 77, 0.3);
}

/* ── Booking form ───────────────────────────────────── */
.bk-form-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px; font-weight: 600;
    color: #f3f5f7;
    margin: 0 0 4px;
}

.bk-form-summary {
    font-size: 13px; color: #aeb4c0;
    margin: 0 0 20px;
}

.bk-field { margin-bottom: 16px; }

.bk-label {
    display: block;
    font-size: 12px; font-weight: 600;
    color: #aeb4c0;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.bk-input {
    width: 100%; box-sizing: border-box;
    background: rgba(42, 45, 54, 0.92);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    color: #f3f5f7;
    font-size: 14px;
    padding: 12px 16px;
    transition: border-color 0.15s;
    font-family: inherit;
}
.bk-input:focus {
    outline: none;
    border-color: #ff4d4d;
    box-shadow: 0 0 0 3px rgba(255, 77, 77, 0.15);
}
.bk-input::placeholder { color: #5a5f6d; }

.bk-input-sm { width: 100px; padding: 8px 12px; }

/* ── Buttons ────────────────────────────────────────── */
.bk-btn {
    display: inline-flex; align-items: center; justify-content: center;
    border: none; border-radius: 12px;
    font-size: 14px; font-weight: 600;
    padding: 12px 28px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.bk-btn:disabled {
    opacity: 0.5; cursor: not-allowed;
}

.bk-btn-primary {
    background: #ff4d4d; color: #fff;
}
.bk-btn-primary:hover:not(:disabled) {
    background: #e63e3e;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 77, 77, 0.3);
}

.bk-btn-success {
    background: #4cd9a0; color: #111;
}
.bk-btn-success:hover:not(:disabled) {
    background: #3cc48d;
    transform: translateY(-1px);
}

.bk-btn-danger {
    background: rgba(255, 77, 77, 0.15); color: #ff6b6b;
    border: 1px solid rgba(255, 77, 77, 0.2);
}
.bk-btn-danger:hover:not(:disabled) {
    background: rgba(255, 77, 77, 0.25);
}

.bk-btn-sm { padding: 8px 16px; font-size: 13px; border-radius: 10px; }

.bk-submit-btn { width: 100%; margin-top: 4px; }

/* ── Confirmation ───────────────────────────────────── */
.bk-confirmation {
    text-align: center; padding: 40px 24px;
}
.bk-confirmation h3 {
    color: #4cd9a0;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 22px; margin: 0 0 12px;
}
.bk-confirmation p { color: #aeb4c0; font-size: 14px; margin: 0; line-height: 1.5; }
.bk-confirm-icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: rgba(76, 217, 160, 0.15);
    color: #4cd9a0;
    font-size: 32px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
}

/* ── Admin ──────────────────────────────────────────── */
.bk-admin-login-card {
    max-width: 380px; margin: 120px auto;
    text-align: center; padding: 48px 32px;
}
.bk-admin-login-card h2 {
    color: #f3f5f7;
    font-family: 'Space Grotesk', sans-serif;
}

.bk-admin-user-bar {
    display: flex; align-items: center; justify-content: center;
    gap: 12px; margin-top: 8px;
}
.bk-user-email {
    font-size: 13px; color: #7d8494;
}

.bk-admin-tabs {
    display: flex; gap: 8px;
    margin-bottom: 24px;
}

.bk-tab {
    flex: 1;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    color: #aeb4c0;
    font-size: 13px; font-weight: 600;
    padding: 10px 0;
    cursor: pointer;
    transition: all 0.15s;
}
.bk-tab:hover { background: rgba(255,255,255,0.08); }
.bk-tab.active {
    background: rgba(255, 77, 77, 0.12);
    border-color: rgba(255, 77, 77, 0.3);
    color: #ff4d4d;
}

/* ── Appointment cards ──────────────────────────────── */
.bk-appt-card {
    display: flex; align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.bk-appt-info { flex: 1; }

.bk-appt-name {
    font-size: 16px; font-weight: 600; color: #f3f5f7;
    margin-bottom: 6px;
}
.bk-appt-detail {
    font-size: 13px; color: #aeb4c0;
    margin-bottom: 3px;
}
.bk-appt-meta {
    font-size: 11px; color: #7d8494;
    margin-top: 6px;
}

.bk-badge {
    display: inline-block; font-size: 10px; padding: 2px 8px;
    border-radius: 10px; font-weight: 600; vertical-align: middle;
    margin-left: 6px;
}
.bk-badge-synced { background: rgba(46, 160, 67, 0.2); color: #2ea043; }
.bk-badge-pending-sync { background: rgba(255, 193, 7, 0.2); color: #ffc107; }

.bk-appt-actions {
    display: flex; flex-direction: column; gap: 8px;
    flex-shrink: 0;
}

/* ── Settings ───────────────────────────────────────── */
.bk-settings { margin-top: 8px; }

.bk-settings-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px; font-weight: 600;
    color: #f3f5f7;
    margin: 0 0 20px;
}

.bk-days-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.bk-day-check {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: #aeb4c0;
    cursor: pointer;
}
.bk-day-check input[type=checkbox] {
    width: 18px; height: 18px;
    accent-color: #ff4d4d;
}

.bk-hours-row {
    display: flex; gap: 16px;
    flex-wrap: wrap;
}

.bk-hour-field {
    flex: 1; min-width: 100px;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 640px) {
    .bk-page { padding: 32px 16px 60px; }
    .bk-title { font-size: 22px; }
    .bk-card { padding: 18px; border-radius: 16px; }
    .bk-calendar { gap: 4px; }
    .bk-day { padding: 8px 0; font-size: 13px; min-height: 36px; }
    .bk-slot { padding: 8px 16px; font-size: 13px; }
    .bk-appt-card { flex-direction: column; }
    .bk-appt-actions { flex-direction: row; }
    .bk-days-grid { grid-template-columns: 1fr; }
}
