.whiteboard-nav-btn {
    color: var(--gold-light);
}

.whiteboard-nav-btn i {
    width: 16px;
    color: var(--gold);
    text-align: center;
}

.whiteboard-nav-btn:hover {
    background: var(--gold-subtle);
    color: var(--text);
}

.whiteboard-workspace {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: var(--bg, #0a0a0a);
    color: var(--text, #f5f5f7);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.whiteboard-workspace[open] {
    display: flex;
    flex-direction: column;
}

.whiteboard-workspace::backdrop {
    background: #090909;
}

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

.whiteboard-workspace button,
.whiteboard-workspace input,
.whiteboard-workspace textarea,
.whiteboard-workspace select {
    font: inherit;
}

.whiteboard-workspace button {
    color: inherit;
}

.whiteboard-workspace button:focus-visible,
.whiteboard-workspace input:focus-visible,
.whiteboard-workspace textarea:focus-visible,
.whiteboard-workspace select:focus-visible {
    outline: 2px solid var(--gold-light, #f3e5ab);
    outline-offset: 2px;
}

.whiteboard-workspace [hidden] {
    display: none !important;
}

.whiteboard-list-view {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
}

.whiteboard-topbar,
.whiteboard-editor-header {
    position: relative;
    z-index: 4;
    display: flex;
    flex: 0 0 58px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
    padding: 0 22px;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, .08));
    background: rgba(14, 14, 15, .96);
}

.whiteboard-topbar-brand,
.whiteboard-topbar-actions,
.wb-editor-leading,
.wb-editor-actions {
    display: flex;
    align-items: center;
    min-width: 0;
}

.whiteboard-topbar-brand {
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
}

.whiteboard-topbar-brand img,
.wb-editor-leading > img {
    flex: 0 0 auto;
    object-fit: contain;
}

.whiteboard-topbar-brand b {
    margin-left: 4px;
    color: var(--text-secondary, #a1a1a6);
    font-weight: 500;
}

.whiteboard-topbar-actions,
.wb-editor-actions {
    gap: 8px;
}

.wb-icon-button,
.wb-tool-button {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary, #a1a1a6);
    cursor: pointer;
    transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease;
}

.wb-icon-button:hover,
.wb-tool-button:hover:not(:disabled) {
    border-color: var(--border, rgba(255, 255, 255, .08));
    background: var(--surface-hover, #212328);
    color: var(--text, #f5f5f7);
}

.wb-icon-button:active,
.wb-tool-button:active:not(:disabled) {
    transform: scale(.96);
}

.wb-danger-button:hover:not(:disabled) {
    border-color: rgba(255, 82, 82, .24);
    background: rgba(255, 82, 82, .1);
    color: #ff8585;
}

.whiteboard-sync-status {
    overflow: hidden;
    color: var(--text-muted, #6e6e73);
    font-size: 11px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.whiteboard-library {
    width: min(100%, 920px);
    min-height: 0;
    flex: 1;
    margin: 0 auto;
    padding: clamp(26px, 6vh, 64px) 28px 42px;
    overflow: auto;
}

.whiteboard-library-heading,
.whiteboard-library-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.whiteboard-eyebrow {
    margin: 0 0 8px;
    color: var(--gold, #d4af37);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
}

.whiteboard-library-heading h1 {
    margin: 0;
    color: var(--text, #f5f5f7);
    font-size: 28px;
    font-weight: 600;
    line-height: 1.2;
}

.wb-primary-button,
.wb-secondary-button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 15px;
    border: 1px solid var(--border-gold, rgba(212, 175, 55, .28));
    border-radius: 8px;
    background: var(--gold, #d4af37);
    color: var(--text-inverse, #0a0a0a) !important;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
    transition: background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.wb-primary-button:hover {
    background: var(--gold-light, #f3e5ab);
    box-shadow: 0 5px 18px rgba(212, 175, 55, .16);
    transform: translateY(-1px);
}

.wb-secondary-button {
    border-color: var(--border, rgba(255, 255, 255, .08));
    background: var(--surface-raised, #17181c);
    color: var(--text, #f5f5f7) !important;
}

.wb-secondary-button:hover {
    background: var(--surface-hover, #212328);
}

.whiteboard-library-controls {
    margin-top: 32px;
    padding-bottom: 13px;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, .08));
}

.whiteboard-search {
    display: flex;
    width: min(100%, 360px);
    height: 40px;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border: 1px solid var(--border, rgba(255, 255, 255, .08));
    border-radius: 8px;
    background: var(--surface, #111215);
    color: var(--text-muted, #6e6e73);
}

.whiteboard-search:focus-within {
    border-color: var(--gold, #d4af37);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, .1);
}

.whiteboard-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text, #f5f5f7);
    font-size: 13px;
}

.whiteboard-search input:focus-visible {
    outline: 0;
}

.whiteboard-count {
    color: var(--text-muted, #6e6e73);
    font-size: 12px;
}

.whiteboard-cards {
    display: grid;
    gap: 8px;
    padding-top: 10px;
}

.whiteboard-card {
    display: flex;
    min-height: 72px;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
    text-align: left;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease;
}

.whiteboard-card:hover {
    border-color: var(--border-gold, rgba(212, 175, 55, .28));
    background: var(--surface-raised, #17181c);
}

.whiteboard-card-main {
    display: flex;
    min-width: 0;
    flex: 1;
    align-items: center;
    gap: 14px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.whiteboard-card-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--border-gold, rgba(212, 175, 55, .28));
    border-radius: 8px;
    background: var(--gold-subtle, rgba(212, 175, 55, .12));
    color: var(--gold, #d4af37);
}

.whiteboard-card-copy {
    display: grid;
    min-width: 0;
    flex: 1;
    gap: 5px;
}

.whiteboard-card-copy strong {
    overflow: hidden;
    color: var(--text, #f5f5f7);
    font-size: 13px;
    font-weight: 550;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.whiteboard-card-copy small {
    color: var(--text-muted, #6e6e73);
    font-size: 11px;
}

.whiteboard-card-delete {
    opacity: .58;
}

.whiteboard-card:hover .whiteboard-card-delete,
.whiteboard-card-delete:focus-visible {
    opacity: 1;
}

.whiteboard-empty-state {
    display: grid;
    justify-items: center;
    gap: 11px;
    padding: 72px 18px;
    color: var(--text-secondary, #a1a1a6);
    text-align: center;
}

.whiteboard-empty-state > i {
    margin-bottom: 5px;
    color: var(--gold, #d4af37);
    font-size: 25px;
}

.whiteboard-empty-state strong {
    color: var(--text, #f5f5f7);
    font-size: 15px;
    font-weight: 550;
}

.whiteboard-empty-state p {
    max-width: 360px;
    margin: 0 0 8px;
    color: var(--text-muted, #6e6e73);
    font-size: 13px;
    line-height: 1.6;
}

.whiteboard-editor-view {
    display: flex;
    min-width: 0;
    min-height: 0;
    flex: 1;
    flex-direction: column;
}

.whiteboard-editor-view[hidden] {
    display: none;
}

.whiteboard-editor-header {
    flex-basis: 54px;
    padding: 0 14px;
}

.wb-editor-leading {
    flex: 1;
    gap: 9px;
}

.whiteboard-title-input {
    width: min(32vw, 280px);
    min-width: 90px;
    padding: 7px 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text, #f5f5f7);
    font-size: 13px;
    font-weight: 550;
    text-overflow: ellipsis;
}

.whiteboard-title-input:hover,
.whiteboard-title-input:focus {
    border-color: var(--border, rgba(255, 255, 255, .08));
    background: var(--surface-raised, #17181c);
}

.wb-ask-button {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 8px;
    padding: 0 11px;
    border: 1px solid var(--border-gold, rgba(212, 175, 55, .28));
    border-radius: 7px;
    background: var(--gold-subtle, rgba(212, 175, 55, .12));
    color: var(--gold-light, #f3e5ab) !important;
    font-size: 12px;
    font-weight: 550;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease;
}

.wb-ask-button:hover {
    border-color: var(--gold, #d4af37);
    background: rgba(212, 175, 55, .19);
}

.whiteboard-canvas-shell {
    position: relative;
    min-width: 0;
    min-height: 0;
    flex: 1;
    overflow: hidden;
    background: #0b0b0c;
}

.whiteboard-stage,
.whiteboard-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.whiteboard-stage {
    overflow: hidden;
}

.whiteboard-svg {
    display: block;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    cursor: default;
}

.whiteboard-svg.tool-hand,
.whiteboard-svg.is-panning {
    cursor: grab;
}

.whiteboard-svg.is-panning {
    cursor: grabbing;
}

.whiteboard-svg.tool-pen,
.whiteboard-svg.tool-highlighter,
.whiteboard-svg.tool-eraser,
.whiteboard-svg.tool-line,
.whiteboard-svg.tool-arrow,
.whiteboard-svg.tool-rectangle,
.whiteboard-svg.tool-ellipse,
.whiteboard-svg.tool-text,
.whiteboard-svg.tool-sticky {
    cursor: crosshair;
}

.whiteboard-toolbar {
    position: absolute;
    z-index: 5;
    top: 14px;
    left: 50%;
    display: flex;
    max-width: calc(100% - 32px);
    min-height: 48px;
    align-items: center;
    gap: 7px;
    padding: 5px 7px;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 10px;
    background: rgba(22, 22, 23, .96);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .4);
    transform: translateX(-50%);
    scrollbar-width: none;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.whiteboard-toolbar::-webkit-scrollbar {
    display: none;
}

.wb-tool-group {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 2px;
}

.wb-tool-button {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    font-size: 13px;
}

.wb-tool-button.is-active {
    border-color: var(--border-gold, rgba(212, 175, 55, .28));
    background: var(--gold-subtle, rgba(212, 175, 55, .12));
    color: var(--gold-light, #f3e5ab);
}

.wb-tool-button:disabled {
    color: #545454;
    cursor: not-allowed;
}

.wb-tool-divider {
    display: block;
    width: 1px;
    height: 22px;
    flex: 0 0 auto;
    margin: 0 3px;
    background: rgba(255, 255, 255, .11);
}

.wb-stroke-control {
    display: flex;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 7px;
    background: #101112;
    cursor: pointer;
}

.wb-stroke-control input {
    width: 25px;
    height: 25px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.wb-stroke-control input::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.wb-stroke-control input::-webkit-color-swatch {
    border: 0;
    border-radius: 4px;
}

.wb-width-control {
    display: flex;
    width: 72px;
    height: 32px;
    flex: 0 0 auto;
    align-items: center;
    padding: 0 5px;
}

.wb-width-control input {
    width: 100%;
    height: 4px;
    accent-color: var(--gold, #d4af37);
    cursor: pointer;
}

.whiteboard-zoom-controls {
    position: absolute;
    z-index: 4;
    right: 18px;
    bottom: 18px;
    display: flex;
    min-height: 42px;
    align-items: center;
    gap: 2px;
    padding: 3px 5px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 9px;
    background: rgba(22, 22, 23, .95);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .28);
}

.whiteboard-zoom-controls .wb-icon-button {
    width: 32px;
    height: 32px;
}

.wb-zoom-label {
    min-width: 50px;
    padding: 6px 2px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--text-secondary, #a1a1a6) !important;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

.wb-zoom-label:hover {
    color: var(--gold-light, #f3e5ab) !important;
}

.whiteboard-canvas-hint {
    position: absolute;
    bottom: 22px;
    left: 18px;
    margin: 0;
    color: rgba(190, 190, 190, .5);
    font-size: 10px;
    pointer-events: none;
}

.whiteboard-canvas-hint span {
    padding: 0 5px;
    color: rgba(212, 175, 55, .7);
}

.whiteboard-drop-hint {
    position: absolute;
    z-index: 6;
    inset: 12px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 12px;
    border: 1px dashed rgba(212, 175, 55, .6);
    border-radius: 12px;
    background: rgba(8, 8, 8, .82);
    color: var(--gold-light, #f3e5ab);
    font-size: 14px;
    pointer-events: none;
}

.whiteboard-drop-hint i {
    font-size: 26px;
}

.wb-marquee {
    fill: rgba(212, 175, 55, .08);
    stroke: var(--gold, #d4af37);
    stroke-dasharray: 5 4;
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.wb-object-text {
    width: 100%;
    height: 100%;
    padding: 8px 10px;
    overflow: hidden;
    color: #f2f0e8;
    font: 14px/1.45 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    user-select: none;
}

.wb-object-text.sticky-object-text {
    padding: 22px 13px 12px;
    color: #e9e2ca;
    font-size: 13px;
}

.wb-object-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.wb-selection-outline {
    fill: none;
    stroke: var(--gold, #d4af37);
    stroke-dasharray: 4 3;
    stroke-width: 1.25;
    vector-effect: non-scaling-stroke;
}

.wb-selection-handle {
    fill: #f4e3a2;
    stroke: #151515;
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
    pointer-events: all;
    cursor: nwse-resize;
}

.wb-dialog-layer {
    position: absolute;
    z-index: 20;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, .64);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.wb-dialog-layer[hidden] {
    display: none;
}

.wb-dialog-card {
    width: min(100%, 470px);
    max-height: min(90vh, 720px);
    padding: 22px;
    overflow: auto;
    border: 1px solid var(--border, rgba(255, 255, 255, .08));
    border-radius: 12px;
    background: var(--surface, #111215);
    box-shadow: var(--shadow-lg, 0 24px 64px rgba(0, 0, 0, .65));
}

.wb-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.wb-dialog-header .whiteboard-eyebrow {
    margin-bottom: 5px;
}

.wb-dialog-header h2 {
    margin: 0;
    color: var(--text, #f5f5f7);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.35;
}

.wb-dialog-label,
.wb-note-colors legend {
    display: block;
    margin: 15px 0 7px;
    color: var(--text-secondary, #a1a1a6);
    font-size: 12px;
    font-weight: 550;
}

.wb-dialog-label span {
    color: var(--text-muted, #6e6e73);
    font-weight: 400;
}

.wb-dialog-card textarea,
.wb-dialog-card select {
    display: block;
    width: 100%;
    min-height: 42px;
    padding: 10px 11px;
    border: 1px solid var(--border, rgba(255, 255, 255, .08));
    border-radius: 7px;
    background: var(--bg, #0a0a0a);
    color: var(--text, #f5f5f7);
    font-size: 13px;
    line-height: 1.5;
}

.wb-dialog-card textarea {
    min-height: 100px;
    resize: vertical;
}

.wb-dialog-card textarea::placeholder {
    color: var(--text-muted, #6e6e73);
}

.wb-note-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: 14px 0 0;
    padding: 0;
    border: 0;
}

.wb-note-colors legend {
    float: left;
    width: 100%;
    margin: 0 0 8px;
}

.wb-note-colors label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary, #a1a1a6);
    font-size: 11px;
    cursor: pointer;
}

.wb-note-colors input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.wb-color-swatch {
    width: 13px;
    height: 13px;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 4px;
}

.wb-color-gold { background: #d4af37; }
.wb-color-sage { background: #849b85; }
.wb-color-slate { background: #74839a; }

.wb-note-colors input:checked + .wb-color-swatch {
    outline: 2px solid var(--text, #f5f5f7);
    outline-offset: 2px;
}

.wb-note-colors input:focus-visible + .wb-color-swatch {
    outline: 2px solid var(--gold-light, #f3e5ab);
    outline-offset: 3px;
}

.wb-dialog-copy {
    margin: -7px 0 14px;
    color: var(--text-secondary, #a1a1a6);
    font-size: 12px;
    line-height: 1.55;
}

.wb-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

.wb-confirm-danger {
    border-color: rgba(255, 82, 82, .3);
    background: rgba(255, 82, 82, .16);
    color: #ffaaaa !important;
}

.wb-confirm-danger:hover {
    background: rgba(255, 82, 82, .24);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

@media (max-width: 700px) {
    .whiteboard-library {
        padding: 34px 18px 30px;
    }

    .whiteboard-editor-header {
        gap: 8px;
        padding: 0 9px;
    }

    .wb-editor-leading {
        gap: 5px;
    }

    .wb-editor-leading > img {
        display: none;
    }

    .whiteboard-title-input {
        width: min(35vw, 190px);
        padding-left: 5px;
        font-size: 12px;
    }

    .wb-editor-actions {
        gap: 3px;
    }

    .whiteboard-toolbar {
        top: auto;
        right: 10px;
        bottom: 12px;
        left: 10px;
        max-width: none;
        min-height: 48px;
        justify-content: flex-start;
        transform: none;
    }

    .whiteboard-zoom-controls {
        right: 12px;
        bottom: 74px;
    }

    .whiteboard-canvas-hint {
        bottom: 25px;
        left: 14px;
        max-width: calc(100% - 250px);
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .whiteboard-topbar,
    .whiteboard-editor-header {
        flex-basis: 52px;
    }

    .whiteboard-topbar {
        padding: 0 12px;
    }

    .whiteboard-topbar-brand {
        gap: 7px;
        font-size: 13px;
    }

    .whiteboard-topbar-brand img {
        width: 26px;
        height: 26px;
    }

    #whiteboardEditorStatus {
        display: none;
    }

    .wb-ask-button {
        width: 34px;
        min-height: 34px;
        justify-content: center;
        padding: 0;
    }

    .wb-ask-button span {
        display: none;
    }

    .whiteboard-library-heading {
        align-items: flex-start;
    }

    .whiteboard-library-heading h1 {
        font-size: 24px;
    }

    .whiteboard-library-heading .wb-primary-button {
        min-height: 38px;
        gap: 7px;
        padding: 0 10px;
        font-size: 12px;
    }

    .whiteboard-library-controls {
        margin-top: 25px;
    }

    .whiteboard-count {
        display: none;
    }

    .whiteboard-canvas-hint {
        display: none;
    }

    .wb-dialog-card {
        padding: 18px;
    }

    .wb-dialog-actions > button {
        flex: 1;
        padding: 0 9px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .whiteboard-workspace *,
    .whiteboard-workspace *::before,
    .whiteboard-workspace *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
