@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600&display=swap');

@font-face {
    font-family: 'Satisfy';
    src: url('../font/Satisfy-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --topbar-height: 96px;
    --sidebar-width-expanded: 264px;
    --sidebar-width-collapsed: 64px;
    --app-font-default: 'Inter', 'Segoe UI', sans-serif;
    --app-font-satisfy: 'Satisfy', 'Brush Script MT', cursive;
    --app-font-family: var(--app-font-default);
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: var(--app-font-family);
    background: var(--rgba-255-255-255-0_9);
    min-height: 100vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    --sidebar-current-width: var(--sidebar-width-expanded);
    --layout-horizontal-gap: 5px;
    --layout-vertical-gap: 5px;
}

body.sidebar-collapsed {
    --sidebar-current-width: var(--sidebar-width-collapsed);
}

body.sidebar-collapsible {
    --sidebar-current-width: 0px;
}

body.sidebar-collapsible.sidebar-open {
    overflow: hidden;
}

body.sidebar-collapsible .app-layout {
    margin-left: 0;
    padding: var(--layout-vertical-gap) var(--layout-horizontal-gap);
}

body.sidebar-collapsible.sidebar-open .app-layout {
    pointer-events: none;
}

.new-project-overlay-open {
    overflow: hidden;
}

.project-picker-open {
    overflow: hidden;
}

.version-name-open {
    overflow: hidden;
}

.new-project-overlay {
    position: fixed;
    inset: 0;
    background: rgba(18, 26, 51, 0.72);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 1200;
    padding: 24px;
}

.new-project-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.project-picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(18, 26, 51, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 15000;
    padding: 20px;
}

.project-picker-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.version-name-overlay {
    position: fixed;
    inset: 0;
    background: rgba(18, 26, 51, 0.55);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 15500;
    padding: 16px;
}

.version-name-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.version-name-dialog {
    background: var(--theme-surface-1);
    color: var(--theme-text);
    width: min(420px, 100%);
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.version-name-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--theme-border-soft);
}

.version-name-header h3 {
    margin: 0;
    font-size: 16px;
}

.version-name-close {
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--theme-text-muted);
}

.version-name-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
}

.version-name-label {
    font-weight: 600;
    color: var(--theme-text-muted);
}

.version-name-input {
    width: 100%;
    border: 1px solid var(--theme-border);
    border-radius: 8px;
    padding: 10px;
    font-size: 14px;
    color: var(--theme-text);
    background: var(--theme-surface-2);
}

.version-name-input:focus {
    outline: none;
    border-color: var(--theme-primary, #3c6ff6);
    box-shadow: 0 0 0 1px var(--theme-primary, #3c6ff6);
}

.version-name-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 14px 14px;
    border-top: 1px solid var(--theme-border-soft);
    background: var(--theme-surface-1);
}

.version-name-btn {
    border: 1px solid var(--theme-border);
    background: var(--theme-surface-2);
    color: var(--theme-text);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.version-name-btn.primary {
    background: linear-gradient(90deg, var(--theme-primary, #3c6ff6) 0%, var(--theme-accent, var(--theme-primary-alt, #5aa6ff)) 100%);
    color: #fff;
    border-color: transparent;
}

.version-name-btn:hover,
.version-name-btn:focus-visible {
    outline: none;
    filter: brightness(0.97);
}

.project-picker-dialog {
    background: var(--theme-surface-1);
    color: var(--theme-text);
    width: min(960px, 100%);
    max-height: calc(100vh - 40px);
    border: 1px solid var(--theme-border);
    border-radius: 14px;
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.project-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--theme-border-soft);
}

.project-picker-header h3 {
    margin: 0;
    font-size: 18px;
}

.project-picker-close {
    border: none;
    background: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--theme-text-muted);
}

.project-picker-body {
    display: grid;
    grid-template-columns: 1.1fr 1.1fr;
    gap: 12px;
    padding: 12px 16px 0 16px;
    min-height: 320px;
}

.project-delete-dialog {
    width: min(520px, 94vw);
    max-height: none;
}

.project-delete-dialog .project-picker-body {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-bottom: 12px;
    align-items: flex-start;
    align-content: flex-start;
}

.project-picker-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-picker-column-title {
    font-weight: 600;
    color: var(--theme-text-muted);
    padding: 0 4px;
}

.project-picker-list {
    flex: 1;
    border: 1px solid var(--theme-border);
    border-radius: 10px;
    background: var(--theme-surface-2);
    overflow: auto;
    min-height: 240px;
}

.project-picker-separator {
    height: 1px;
    background: var(--theme-border-soft);
    margin: 2px 0;
}

.project-picker-empty {
    padding: 14px;
    color: var(--theme-text-muted);
}

.project-picker-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--theme-border);
    background: var(--theme-surface-2);
    color: var(--theme-text);
    font-size: 15px;
    line-height: 1.4;
    height: auto;
    min-height: auto;
    align-self: flex-start;
    box-sizing: border-box;
}

.project-picker-item {
    width: 100%;
    padding: 12px 14px;
    border: none;
    background: none;
    color: var(--theme-text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    border-bottom: 1px solid var(--theme-border-soft);
}

.project-picker-item:last-child {
    border-bottom: none;
}

.project-picker-item:hover,
.project-picker-item:focus-visible {
    background: var(--theme-surface-hover, rgba(0, 0, 0, 0.05));
    outline: none;
}

.project-picker-item.is-active {
    background: linear-gradient(90deg, var(--theme-primary, #3c6ff6) 0%, var(--theme-accent, var(--theme-primary-alt, #5aa6ff)) 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.project-picker-item-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.project-picker-item-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.project-picker-item--ghost {
    justify-content: flex-start;
    font-weight: 600;
}

.project-picker-item-title {
    font-weight: 600;
    text-align: left;
}

.project-picker-item-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.project-picker-pill {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    color: inherit;
    font-size: 12px;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.project-picker-item.is-active .project-picker-pill {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.18);
}

.project-picker-dup-btn{border:none;background:rgba(255,255,255,0.1);color:inherit;border-radius:8px;padding:6px 10px;cursor:pointer;font-weight:600;font-size:12px;display:inline-flex;align-items:center;gap:6px;}
.project-picker-dup-btn:hover,
.project-picker-dup-btn:focus-visible{outline:none;background:rgba(255,255,255,0.2);}
.project-picker-delete-btn{border:none;background:rgba(255,0,0,0.08);color:inherit;border-radius:8px;padding:6px 10px;cursor:pointer;font-weight:600;font-size:12px;display:inline-flex;align-items:center;gap:6px;}
.project-picker-delete-btn:hover,
.project-picker-delete-btn:focus-visible{outline:none;background:rgba(255,0,0,0.14);}

.project-picker-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px 14px;
    border-top: 1px solid var(--theme-border-soft);
    background: var(--theme-surface-1);
}

.project-picker-btn {
    border: 1px solid var(--theme-border);
    background: var(--theme-surface-2);
    color: var(--theme-text);
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.project-picker-btn.primary {
    background: linear-gradient(90deg, var(--theme-primary, #3c6ff6) 0%, var(--theme-accent, var(--theme-primary-alt, #5aa6ff)) 100%);
    border-color: transparent;
    color: #fff;
}

.project-picker-btn:hover,
.project-picker-btn:focus-visible {
    outline: none;
    filter: brightness(0.98);
}

.new-project-dialog {
    position: relative;
    width: min(540px, 100%);
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    box-shadow: 0 36px 68px rgba(18, 26, 51, 0.35);
    padding: 32px 36px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.new-project-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: none;
    background: rgba(0, 0, 0, 0.08);
    color: var(--theme-text, #111);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.new-project-close:hover,
.new-project-close:focus-visible {
    background: rgba(0, 0, 0, 0.16);
    transform: translateY(-1px);
    outline: none;
}

.new-project-title {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    color: #121a33;
}

.new-project-lead {
    margin: 0;
    font-size: 15px;
    color: rgba(18, 26, 51, 0.78);
}

.new-project-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.new-project-action {
    border: none;
    border-radius: 16px;
    padding: 0;
    background: linear-gradient(135deg, rgba(94, 96, 206, 0.18), rgba(94, 193, 222, 0.18));
    color: #121a33;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    display: flex;
    align-items: stretch;
    overflow: hidden;
}

.new-project-action:hover,
.new-project-action:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 18px 32px rgba(94, 96, 206, 0.25);
    outline: none;
    background: linear-gradient(135deg, rgba(94, 96, 206, 0.3), rgba(94, 193, 222, 0.3));
}

.new-project-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 82px;
    background: rgba(255, 255, 255, 0.55);
    font-size: 34px;
    padding: 18px 0;
}

.new-project-action-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 22px;
    flex: 1 1 auto;
}

.new-project-action-label {
    font-size: 18px;
    font-weight: 700;
    color: #121a33;
}

.new-project-action-hint {
    font-size: 13px;
    color: rgba(18, 26, 51, 0.72);
}

@media (max-width: 600px) {
    .new-project-dialog {
        padding: 28px 24px;
    }
    .new-project-action {
        padding: 18px 20px;
    }
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 24px;
    min-height: 65px;
    background: var(--theme-surface-2);
    border-bottom: 1px solid var(--theme-border);
    backdrop-filter: blur(12px);
    flex: 0 0 auto;
    position: relative;
    z-index: 500;
    overflow: visible;
}

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

.app-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 56px;
    width: 56px;

}

.app-brand-logo {
    display: block;
    max-height: 55px;
    width: auto;
    object-fit: contain;
}

.app-brand-name {
    font-family: 'Satisfy', 'Brush Script MT', cursive;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.75px;
    color: var(--theme-text);
    white-space: nowrap;
}

.topbar-brand-block {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.topbar-wordmark {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.topbar-wordmark-main {
    font-family: 'Satisfy', 'Brush Script MT', cursive;
    font-size: 26px;
    color: var(--theme-text);
}

.topbar-wordmark-sub {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.4em;
    color: var(--theme-text-muted);
}

.topbar-project-block {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    
    min-width: 0;
}

.topbar-project-title {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
}

.topbar-title-row {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    margin-left:10px;
    flex-wrap: wrap;
}

.topbar-project-title .topbar-title-text {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--theme-text);
}

.topbar-project-title .topbar-subtitle-text {
    margin: 0;
    font-size: 14px;
    color: var(--theme-text-muted);
}

.topbar-title-separator {
    color: var(--theme-text-muted);
    font-weight: 600;
}

.topbar-author-text {
    min-width: 80px;
    font-size: 16px;
    color: var(--theme-text);
    border-bottom: 1px solid transparent;
    padding-bottom: 1px;
}

.topbar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
}

.topbar-menu-btn {
    border: none;
    background: none;
    color: var(--theme-text);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background-color 120ms ease, color 120ms ease;
    display: inline-flex;
    align-items: center;
}

.topbar-menu-btn:hover,
.topbar-menu-btn:focus-visible {
    color: #fff;
    background: linear-gradient(
        90deg,
        var(--theme-primary, #3c6ff6) 0%,
        var(--theme-accent, var(--theme-primary-alt, var(--theme-primary, #3c6ff6)), #5aa6ff) 100%
    );
    outline: none;
}

.menu-dropdown {
    position: relative;
}

.menu-dropdown-list {
    position: absolute;
    top: 100%;
    margin-top: 6px;
    left: 0;
    margin: 0;
    padding: 8px 0;
    list-style: none;
    background-color: var(--theme-surface-2);
    background-image: none;
    border: 1px solid var(--theme-border-soft);
    border-radius: 10px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.15);
    min-width: 300px;
    display: none;
    z-index: 12000;
}

.menu-dropdown:hover .menu-dropdown-list,
.menu-dropdown:focus-within .menu-dropdown-list,
.menu-dropdown-list:hover {
    display: block;
}

.menu-dropdown-list button {
    width: 100%;
    border: none;
    background: none;
    text-align: left;
    padding: 6px 14px;
    font-weight: 600;
    color: var(--theme-text);
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 120ms ease, color 120ms ease;
}

.menu-dropdown-list button:hover,
.menu-dropdown-list button:focus-visible {
    background: linear-gradient(90deg, var(--theme-primary, #3c6ff6) 0%, var(--theme-accent, var(--theme-primary-alt, #5aa6ff)) 100%);
    color: #fff;
    outline: none;
}

.topbar-right-block {
    display: flex;
    align-items: center;
    gap: 16px;
}

.layout-toolbar {
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    background: var(--theme-surface-1);
    border-bottom: 1px solid var(--theme-border-soft);
    padding: 0 12px;
    position: sticky;
    top: 0;
    z-index: 200;
    min-height: 36px;
    height: 36px;
}

.layout-toolbar-nav {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1 1 auto;
}

.layout-toolbar-nav::-webkit-scrollbar {
    display: none;
}

.layout-toolbar-nav.sidebar-layout-nav {
    flex-direction: row;
    margin: 0;
    gap: 0;
}

.layout-toolbar-btn {
    border: none;
    background: none;
    color: var(--theme-text);
    font-weight: 600;
    font-size: 13px;
    padding: 4px 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.layout-toolbar-nav.sidebar-layout-nav .layout-btn {
    width: auto;
    min-width: 0;
    border: none;
    border-radius: 0;
    background: none;
    padding: 6px 14px;
    justify-content: flex-start;
    color: var(--theme-text);
    box-shadow: none;
}

.layout-toolbar-btn + .layout-toolbar-btn::before {
    content: "";
    position: absolute;
    left: -4px;
    top: 25%;
    bottom: 25%;
    width: 1px;
    background: var(--theme-border-soft);
}

.layout-toolbar-btn:hover,
.layout-toolbar-btn:focus-visible {
    color: var(--theme-accent);
    background: linear-gradient(135deg, rgba(94, 96, 206, 0.12), rgba(100, 223, 223, 0.18));
    border-radius: 8px;
    outline: none;
    box-shadow: none;
}

.layout-toolbar-btn.active,
.layout-toolbar-btn[aria-pressed="true"] {
    background: var(--theme-gradient, linear-gradient(135deg, var(--accent), var(--accent-strong)));
    color: var(--theme-text-inverse, #fff);
    border-radius: 8px;
    box-shadow: none;
}

.layout-toolbar-btn.active:hover,
.layout-toolbar-btn.active:focus-visible,
.layout-toolbar-btn[aria-pressed="true"]:hover,
.layout-toolbar-btn[aria-pressed="true"]:focus-visible {
    color: var(--theme-text-inverse, #fff);
    box-shadow: none;
}

/* Enforce toolbar active state over legacy sidebar styles */
.layout-toolbar-nav .layout-btn.active,
.layout-toolbar-nav .layout-btn[aria-pressed="true"] {
    background: var(--theme-gradient, linear-gradient(135deg, var(--accent), var(--accent-strong))) !important;
    color: var(--theme-text-inverse, #fff) !important;
    border: none !important;
    box-shadow: none !important;
}

.layout-toolbar-nav .layout-btn.active:hover,
.layout-toolbar-nav .layout-btn.active:focus-visible,
.layout-toolbar-nav .layout-btn[aria-pressed="true"]:hover,
.layout-toolbar-nav .layout-btn[aria-pressed="true"]:focus-visible {
    color: var(--theme-text-inverse, #fff) !important;
    box-shadow: none !important;
}

.layout-toolbar-nav > * + * {
    position: relative;
    margin-left: 6px;
    padding-left: 8px;
}

.layout-toolbar-nav > * + *::before {
    content: "";
    position: absolute;
    left: -3px;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: var(--theme-border);
}

.layout-toolbar-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-left: 8px;
    border-left: 1px solid var(--theme-border-soft);
}

.layout-toolbar-theme-btn {
    border: none;
    background: none;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.layout-toolbar-theme-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.layout-toolbar-icon {
    font-size: 16px;
    line-height: 1;
}

.layout-toolbar-label {
    font-size: 13px;
}

.button-display-icon-only .layout-toolbar-btn {
    gap: 0;
    padding-left: 10px;
    padding-right: 10px;
}

.button-display-icon-only .layout-toolbar-label {
    display: none;
}

.button-display-text-only .layout-toolbar-icon {
    display: none;
}

.button-display-text-only .layout-toolbar-btn {
    gap: 6px;
}

.utility-toolbar {
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px;
    background: var(--theme-surface-1);
    border-bottom: 1px solid var(--theme-border-soft);
    min-height: 36px;
    height: 36px;
}

.utility-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.utility-toolbar > * + * {
    border-left: 1px solid var(--theme-border-soft);
    padding-left: 8px;
    margin-left: 6px;
}

.utility-fields > * + * {
    border-left: 1px solid var(--theme-border-soft);
    padding-left: 8px;
    margin-left: 6px;
}

.utility-fields {
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.instrument-group {
    position: relative;
}

.instrument-dropdown-toggle {
    border: none;
    background: none;
    border-radius: 8px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    cursor: pointer;
    min-height: 30px;
    height: 30px;
}

.instrument-dropdown-icon {
    font-size: 16px;
    line-height: 1;
}

.instrument-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background: var(--theme-surface-1);
    border: 1px solid var(--theme-border-soft);
    border-radius: 10px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
    min-width: 200px;
    display: none;
    z-index: 1200;
}

.instrument-dropdown-menu.is-open {
    display: block;
}

.instrument-dropdown-menu button {
    width: 100%;
    border: none;
    background: none;
    text-align: left;
    padding: 8px 14px;
    font-weight: 600;
    font-size: 14px;
    color: var(--theme-text);
    cursor: pointer;
}

.instrument-dropdown-menu button:hover,
.instrument-dropdown-menu button:focus-visible {
    background: var(--theme-surface-2);
    color: var(--theme-accent);
    outline: none;
}

html.theme-sombre .instrument-dropdown-toggle {
    color: var(--modern-text, #e2e8f0);
}

html.theme-sombre .instrument-dropdown-menu button {
    color: var(--modern-text, #e2e8f0);
}

html.theme-sombre .instrument-dropdown-menu button:hover,
html.theme-sombre .instrument-dropdown-menu button:focus-visible {
    background: var(--modern-surface-2, var(--theme-surface-2));
    color: var(--modern-accent, var(--theme-accent, #8bd6ff));
}

.version-bar {
    position: sticky;
    bottom: 0;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px;
    background-color: var(--theme-surface-1, #ffffff);
    background-image: none;
    opacity: 1;
    border-top: 1px solid var(--theme-border-soft);
    box-shadow: 0 -6px 14px rgba(15, 23, 42, 0.05);
    z-index: 180;
    min-height: 40px;
    height: 40px;
}

.version-bar-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.version-menu-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: var(--theme-text);
    font-size: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.version-menu-btn:hover,
.version-menu-btn:focus-visible {
    color: var(--theme-accent);
    outline: none;
}

.version-menu-dropdown {
    position: absolute;
    top: auto;
    bottom: calc(100% + 6px);
    left: 0;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background: var(--theme-surface-1);
    border: 1px solid var(--theme-border-soft);
    border-radius: 10px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.15);
    min-width: 200px;
    display: none;
    z-index: 1600;
}

.version-menu-dropdown.is-open {
    display: block;
}

.version-menu-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
}

.version-menu-item {
    border: none;
    background: none;
    flex: 1 1 auto;
    text-align: left;
    padding: 8px 8px;
    color: var(--theme-text);
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
}

.version-menu-item:hover,
.version-menu-item:focus-visible {
    background: var(--theme-surface-2);
    color: var(--theme-accent);
    outline: none;
}

.version-menu-item--active {
    background: var(--theme-gradient, linear-gradient(135deg, rgba(94, 96, 206, 0.95), rgba(100, 223, 223, 0.9)));
    color: var(--theme-text-inverse, #fff);
}

.version-menu-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
}

.version-menu-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.version-menu-action {
    border: none;
    background: none;
    color: var(--theme-text-muted);
    font-size: 14px;
    line-height: 1;
    padding: 6px;
    cursor: pointer;
    flex-shrink: 0;
}

.version-menu-action:hover,
.version-menu-action:focus-visible {
    color: var(--theme-accent);
    outline: none;
}

.version-bar-tabs {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    min-height: 36px;
}

.version-bar-tabs::-webkit-scrollbar {
    display: none;
}

.version-tabs-empty {
    font-size: 13px;
    color: var(--theme-text-muted);
    font-weight: 500;
}

.version-tab {
    border: none;
    background: none;
    color: var(--theme-text);
    font-weight: 600;
    font-size: 12px;
    padding: 4px 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 8px;
    position: relative;
    white-space: nowrap;
}

.version-tab-label {
    pointer-events: none;
}

.version-tab-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
}

.version-tab--ghost {
    border: 1px dashed var(--theme-border-soft);
    color: var(--theme-accent);
    padding: 4px 10px;
}

.version-tab--ghost:hover,
.version-tab--ghost:focus-visible {
    background: var(--theme-surface-2);
    outline: none;
}

.version-tab-action {
    border: none;
    background: none;
    color: var(--theme-text-muted);
    font-size: 12px;
    line-height: 1;
    padding: 2px;
    cursor: pointer;
}

.version-tab-action:hover,
.version-tab-action:focus-visible {
    color: var(--theme-accent);
    outline: none;
}

.version-tab--active .version-tab-action {
    color: var(--theme-text-inverse, #fff);
}

.version-tab--active .version-tab-action:hover,
.version-tab--active .version-tab-action:focus-visible {
    color: var(--theme-text-inverse, #fff);
}

.version-tab-separator {
    display: inline-block;
    width: 1px;
    height: 20px;
    background: var(--theme-border-soft);
    margin: 0 6px;
}

.version-tab--active .version-tab-action {
    color: var(--theme-text-inverse, #fff);
}

.version-tab--active .version-tab-action:hover,
.version-tab--active .version-tab-action:focus-visible {
    color: var(--theme-text-inverse, #fff);
}

.version-tab + .version-tab::before {
    content: "";
    position: absolute;
    left: -4px;
    top: 30%;
    bottom: 30%;
    width: 1px;
    background: var(--theme-border-soft);
}

.version-tab:hover,
.version-tab:focus-visible {
    background: linear-gradient(135deg, rgba(94, 96, 206, 0.12), rgba(100, 223, 223, 0.18));
    color: var(--theme-accent);
    outline: none;
}

.version-tab--active {
    background: var(--theme-gradient, linear-gradient(135deg, rgba(94, 96, 206, 0.95), rgba(100, 223, 223, 0.9)));
    color: var(--theme-text-inverse, #fff);
    box-shadow: 0 6px 16px rgba(94, 96, 206, 0.25);
}

.version-bar-actions {
    display: none;
}

.version-bar-action-btn {
    width: 32px;
    height: 32px;
}

.version-select-proxy {
    position: absolute;
    inset: auto auto 100% auto;
}

.topbar-center {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.topbar-actions-buttons {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.topbar-actions .export-buttons {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.topbar .export-btn {
    border: 1px solid var(--theme-border-soft);
    background: var(--theme-surface-1);
    color: var(--theme-text);
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.2s ease;
}

.topbar .export-btn:hover {
    transform: translateY(-1px);
    background: var(--theme-surface-2);
}

.topbar .export-label {
    color: var(--theme-text);
}

.topbar-actions-toggle {
    display: none;
    font-size: 20px;
}

.topbar-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    line-height: 1.25;
    padding: 10px 16px;
    border-radius: 8px;
}

.topbar-action-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    object-fit: contain;
}

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


.topbar-select {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 180px;
    flex: 0 1 260px;
    position: relative;
}

.topbar-select-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--theme-text);
    white-space: nowrap;
}

.topbar-select-input {
    appearance: none;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--theme-border-soft);
    background: transparent;
    color: var(--theme-text);
    font-family: var(--app-font-family);
    font-size: 15px;
    line-height: 1.4;
}

.topbar-select-input:disabled {
    cursor: not-allowed;
    opacity: 0.7;
    color: var(--theme-text-muted);
    border-color: var(--theme-border-soft);
    background: transparent;
}

.topbar-select-input:focus-visible {
    outline: 2px solid var(--theme-focus);
    outline-offset: 2px;
}

.topbar-select-status {
    display: none;
    margin-top: 6px;
    font-size: 12px;
    color: var(--theme-text-muted);
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.topbar-select-status > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.topbar-select[data-state="loading"] .topbar-select-status,
.topbar-select[data-state="empty"] .topbar-select-status,
.topbar-select[data-state="error"] .topbar-select-status {
    display: flex;
}

.topbar-select[data-state="loading"] .topbar-select-status {
    display: block;
}

.topbar-select[data-state="loading"] .topbar-select-status::before {
    content: "";
    display: block;
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: var(--theme-gradient);
    background-size: 200% 100%;
    animation: topbar-skeleton 1.2s linear infinite;
}

.topbar-select[data-state="loading"] .topbar-select-status > * {
    display: none;
}

.topbar-select[data-state="error"] .topbar-select-status {
    color: var(--theme-accent);
}

.topbar-select-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--theme-border-soft);
    background: var(--theme-accent-soft);
    color: var(--theme-text);
    font-family: var(--app-font-family);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.topbar-select-action:hover,
.topbar-select-action:focus-visible {
    background: var(--theme-accent);
    color: var(--theme-text-inverse);
    border-color: var(--theme-accent-border);
    transform: translateY(-1px);
    outline: none;
}

.topbar-select-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--theme-border-soft);
    background: transparent;
    padding: 0;
    flex-shrink: 0;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.topbar-select-icon-btn img {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.topbar-select-icon-btn + .topbar-select-icon-btn {
    margin-left: 8px;
}

.topbar-select-icon-btn:hover,
.topbar-select-icon-btn:focus-visible {
    background: var(--theme-surface-2);
    border-color: var(--theme-border);
    outline: none;
    transform: translateY(-1px);
}

.topbar-select-icon-btn[disabled],
.topbar-select-icon-btn[aria-disabled="true"] {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    pointer-events: none;
}

.topbar-select-icon-btn[disabled] img,
.topbar-select-icon-btn[aria-disabled="true"] img {
    opacity: 0.65;
}

@keyframes topbar-skeleton {
    0% {
        background-position-x: 0%;
    }
    100% {
        background-position-x: 200%;
    }
}

.app-toast-container {
    position: fixed;
    right: 24px;
    bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 400;
    pointer-events: none;
}

.app-toast {
    pointer-events: auto;
    background: var(--theme-surface-2);
    border: 1px solid var(--theme-border);
    color: var(--theme-text);
    padding: 12px 16px;
    border-radius: 16px;
    box-shadow: var(--theme-shadow);
    min-width: 260px;
    max-width: min(360px, 90vw);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.app-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.app-toast--error {
    border-color: var(--theme-accent-border);
    background: var(--theme-accent-soft);
}

@media (max-width: 600px) {
    .app-toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
        align-items: stretch;
    }

    .app-toast {
        max-width: 100%;
    }
}

.topbar-meta {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    flex-wrap: wrap;
}

.topbar-right {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

.account-inline {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* share button removed */


.account-inline-name {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: var(--theme-text);
}

.account-inline-btn {
    padding: 10px;
    border-radius: 12px;
    font-size: 16px;
    border: 1px solid var(--theme-border-soft);
    background: var(--theme-surface-1);
    color: var(--theme-text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.account-inline-icon {
    width: 18px;
    height: 18px;
    display: block;
}

.account-inline-label {
    font-weight: 600;
}

.button-display-icon-only .account-inline-label {
    display: none;
}

.button-display-icon-only .account-inline-btn {
    gap: 0;
}

.account-inline-btn:hover {
    background: var(--theme-surface-2);
}

.account-inline-btn:focus-visible,
.icon-btn:focus-visible,
.export-btn:focus-visible,
.topbar-actions-toggle:focus-visible {
    outline: 2px solid var(--theme-focus);
    outline-offset: 2px;
}

.icon-btn {
    padding: 10px 16px;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 12px;
    border: 1px solid var(--theme-border-soft);
    background: var(--theme-surface-1);
    color: var(--theme-text);
    font-family: var(--app-font-family);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.icon-btn:hover {
    transform: translateY(-1px);
    background: var(--theme-surface-2);
}

.icon-btn[data-button-label] {
    --icon-btn-icon-size: 20px;
    --icon-btn-text-size: 14px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.icon-btn[data-button-label]::before,
.icon-btn[data-button-label]::after {
    pointer-events: none;
    line-height: 1.2;
    white-space: nowrap;
}

.button-display-icon-only .icon-btn[data-button-label] {
    font-size: 0;
}

.button-display-icon-only .icon-btn[data-button-label]::before {
    content: attr(data-button-icon);
    font-size: var(--icon-btn-icon-size);
}

.button-display-icon-only .icon-btn[data-button-label]::after {
    content: "";
}

.button-display-icon-only #delete-project-btn .topbar-action-label {
    display: none;
}

.button-display-icon-text .icon-btn[data-button-label] {
    font-size: 0;
    padding-left: 14px;
    padding-right: 14px;
}

.button-display-icon-text .icon-btn[data-button-label]::before {
    content: attr(data-button-icon);
    font-size: var(--icon-btn-icon-size);
    margin-right: 6px;
}

.button-display-icon-text .icon-btn[data-button-label]::after {
    content: attr(data-button-label);
    font-size: var(--icon-btn-text-size);
    color: inherit;
}

.button-display-text-only .icon-btn[data-button-label] {
    font-size: 0;
    padding-left: 14px;
    padding-right: 14px;
}

.button-display-text-only .icon-btn[data-button-label]::before {
    content: "";
}

.button-display-text-only .icon-btn[data-button-label]::after {
    content: attr(data-button-label);
    font-size: var(--icon-btn-text-size);
    color: inherit;
}

.button-display-text-only .icon-btn[data-button-label] img,
.button-display-text-only .icon-btn[data-button-label] [aria-hidden="true"] {
    display: none !important;
}

.export-buttons {
    display: inline-flex;
    gap: 8px;
}

.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    background: var(--rgba-255-255-255-0_8);
    color: var(--theme-text);
    border: none;
    cursor: pointer;
    min-height: 42px;
}

.export-btn:hover {
    transform: translateY(-1px);
    background: var(--rgba-255-255-255-0_95);
}

.export-label {
    font-weight: 600;
}


.account-menu {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    background: var(--rgba-255-255-255-0_72);
    padding: 10px 16px;
    border-radius: 16px;
    border: 1px solid var(--rgba-255-255-255-0_65);
}

/* Account management page */

body.account-page {
    background: var(--theme-surface-0);
    color: var(--theme-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    --account-topbar-height: 72px;
    --account-toolbar-height: 44px;
}

body.account-overlay-active {
    overflow: hidden;
}

.account-topbar {
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    position: sticky;
    top: 0;
    z-index: 500;
    min-height: var(--account-topbar-height, 72px);
}

.account-topbar-context {
    flex: 1 1 auto;
    min-width: 0;
}

.account-topbar-context .topbar-title-row {
    align-items: center;
    gap: 12px;
}

.account-topbar-description {
    margin: 2px 0 0;
    color: var(--rgba-0-0-0-0_55);
    font-size: 14px;
}

.account-topbar-info {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid var(--theme-border-soft);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.account-topbar-actions {
    margin-left: auto;
}

.account-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.account-topbar-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.account-header-link {
    font-weight: 600;
    color: var(--theme-text);
    text-decoration: none;
    transition: color 0.2s ease;
    font-family: var(--app-font-family);
}

.account-header-link:focus-visible {
    outline: 2px solid var(--rgba-255-112-67-0_4);
    outline-offset: 3px;
}

.account-header-link:hover {
    color: var(--theme-accent);
}

.account-toolbar {
    border-bottom: 1px solid var(--theme-border-soft);
    background: var(--theme-surface-1);
    padding: 6px 24px;
    box-sizing: border-box;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    position: sticky;
    top: var(--account-topbar-height, 72px);
    z-index: 490;
    min-height: var(--account-toolbar-height, 44px);
}

.account-toolbar-line {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1 1 auto;
}

.account-topbar-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
}

.account-topbar-menu li {
    list-style: none;
}

.account-topbar-menu .topbar-menu-btn {
    min-width: 0;
}
.account-topbar-menu .topbar-menu-btn.active {
    color: #fff;
    background: linear-gradient(135deg, var(--theme-primary, #3c6ff6) 0%, var(--theme-accent, #5aa6ff) 100%);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
}
.account-topbar-menu .topbar-menu-btn.active:hover,
.account-topbar-menu .topbar-menu-btn.active:focus-visible,
.account-topbar-menu .topbar-menu-btn.active:focus {
    color: #fff;
    background: linear-gradient(135deg, var(--theme-primary, #3c6ff6) 0%, var(--theme-accent, #5aa6ff) 100%);
    outline: none;
}

.account-admin-toolbar {
    border-top: none;
    top: calc(var(--account-topbar-height, 72px) + var(--account-toolbar-height, 44px));
}

.account-toolbar-label {
    font-size: 14px;
    color: var(--rgba-0-0-0-0_7);
    font-weight: 600;
}

.account-toolbar-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 14px;
    border-radius: 999px;
    background: var(--theme-surface-2);
    border: 1px solid var(--theme-border-soft);
    font-weight: 600;
    color: var(--theme-text);
    min-height: 28px;
}

.account-toolbar-divider {
    display: inline-flex;
    width: 1px;
    height: 24px;
    background: var(--theme-border-soft);
}

.account-toolbar-actions {
    margin-left: auto;
}

.account-toolbar-btn,
#account-admin-link {
    border: none;
    border-radius: 10px;
    padding: 8px 16px;
    font-weight: 600;
    background: var(--theme-gradient);
    color: var(--theme-text);
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18);
}

.account-toolbar-btn:hover,
#account-admin-link:hover {
    transform: translateY(-1px);
}

.account-settings {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow: auto;
    gap: 16px;
}

.account-settings-separator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--rgba-0-0-0-0_45);
}

.account-settings-separator::before,
.account-settings-separator::after {
    content: "";
    height: 1px;
    flex: 1 1 auto;
    background: var(--rgba-0-0-0-0_12);
}

.account-settings-content,
.account-settings-content--full {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.account-settings-section {
    background: transparent;
    border-radius: 0;
    padding: 0;
    border: none;
    box-shadow: none;
    min-height: 320px;
}

.account-settings-section[hidden] {
    display: none !important;
}

.account-settings-section-header {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.account-settings-section-header h2 {
    margin: 0;
    font-size: 22px;
    color: var(--theme-text);
}

.account-settings-section-description {
    margin: 0;
    color: var(--rgba-0-0-0-0_6);
    font-size: 14px;
}

.account-details {
    margin: 0;
    padding: 0;
}

.account-details-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 12px;
    align-items: start;
    padding: 10px 0;
    border-bottom: 1px solid var(--rgba-0-0-0-0_08);
}

.account-details-row:last-child {
    border-bottom: none;
}

.account-details-row dt {
    font-weight: 600;
    color: var(--rgba-0-0-0-0_65);
}

.account-details-row dd {
    margin: 0;
    color: var(--theme-text);
}

.account-details-row input[type="email"] {
    width: 100%;
    max-width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--rgba-0-0-0-0_12);
    background: var(--rgba-255-255-255-0_95);
    font-size: 14px;
    box-sizing: border-box;
}

.account-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.account-section-hint {
    margin: 0;
    color: var(--rgba-0-0-0-0_55);
    font-style: italic;
}

.account-settings-nav--admin .account-settings-nav-button {
    border-color: var(--rgba-94-104-255-0_25);
}

.account-settings-nav--admin .account-settings-nav-button.is-active {
    background: var(--theme-gradient);
}

.account-header-button {
    border: none;
    border-radius: 999px;
    padding: 10px 20px;
    font-weight: 600;
    background: var(--theme-gradient);
    color: var(--theme-text);
    cursor: pointer;
    font-family: var(--app-font-family);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.account-header-button:hover {
    transform: translateY(-1px);
}

.account-main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 24px 60px;
}

.account-card {
    width: min(720px, 100%);
    background: var(--rgba-255-255-255-0_95);
    border-radius: 24px;
    padding: 32px;
    backdrop-filter: blur(6px);
}

.account-card-header h1 {
    margin: 0 0 8px;
    font-size: 28px;
}

.account-card-header p {
    margin: 0;
    color: var(--theme-text);
    font-size: 15px;
}

.account-section {
    margin-top: 28px;
}

.account-section h2 {
    margin: 0 0 16px;
    font-size: 20px;
    color: var(--theme-text);
}

.account-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.account-field label {
    font-weight: 600;
    font-size: 14px;
    color: var(--theme-text);
}

.account-field input[type="email"],
.account-field input[type="password"] {
    border: 1px solid var(--rgba-0-0-0-0_15);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 15px;
    background: var(--rgba-0-0-0-0_03);
    color: var(--theme-text);
}

.account-field input[type="email"][readonly] {
    cursor: not-allowed;
}

.account-field-hint {
    margin: 0;
    font-size: 13px;
    color: var(--theme-text);
}

.account-field-inline {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.account-field-inline--stack {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.account-field-inline--stack input {
    flex: 1 1 260px;
}

.account-field-inline--stack .account-settings-btn {
    flex: 0 0 auto;
}

.account-field-value {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--theme-text);
}

.account-password-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.account-field-feedback {
    margin: 6px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--theme-text);
}

.account-field-feedback[data-status="loading"] {
    color: var(--theme-accent, #3c6ff6);
}

.account-field-feedback[data-status="success"] {
    color: #1c8c4c;
}

.account-field-feedback[data-status="error"] {
    color: #c62828;
}

.account-field-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--rgba-255-126-95-0_12);
    color: var(--theme-text);
    font-weight: 600;
    font-size: 14px;
}

.account-field-badge-secondary {
    background: var(--rgba-76-175-80-0_12);
    color: var(--theme-text);
}

.account-select {
    border-radius: 10px;
    border: 1px solid var(--rgba-0-0-0-0_18);
    padding: 10px 12px;
    font-size: 15px;
    max-width: 220px;
    background: var(--rgba-255-255-255-0_9);
}

.account-feedback {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    display: none;
}

.account-feedback[data-status] {
    display: block;
}

.account-feedback[data-status="loading"] {
    background: var(--rgba-255-183-77-0_18);
    color: var(--theme-text);
}

.account-feedback[data-status="success"] {
    background: var(--rgba-129-199-132-0_25);
    color: var(--theme-text);
}

.account-feedback[data-status="error"] {
    background: var(--rgba-244-67-54-0_15);
    color: var(--theme-text);
}

.account-loading {
    font-size: 16px;
    font-weight: 600;
    color: var(--theme-text);
}

@media (max-width: 768px) {
    .account-topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 12px 16px;
    }

    .account-header-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .account-toolbar {
        flex-direction: column;
        gap: 12px;
    }

    .account-toolbar-summary {
        width: 100%;
    }

    .account-settings {
        flex-direction: column;
        padding: 0 16px 40px;
    }

    .account-settings-sidebar {
        position: static;
        width: 100%;
    }
}

.account-settings-section--admin {
    display: flex;
    flex-direction: column;
    gap: 32px;
    min-height: 0;
    flex: 1 1 auto;
    height: 100%;
}

.account-settings-section--admin[hidden] {
    display: none;
}

.theme-switcher {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 12px;
    background: var(--rgba-255-255-255-0_9);
    border: 1px solid var(--rgba-0-0-0-0_1);
}

.theme-switcher:hover {
    transform: translateY(-1px);
}

.theme-switcher-icon {
    font-size: 18px;
}

.theme-select {
    border: none;
    background: transparent;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    color: var(--theme-text);
    padding: 4px 0;
}

.theme-select:focus-visible {
    outline: 2px solid var(--rgba-0-0-0-0_25);
    outline-offset: 2px;
    border-radius: 6px;
}

.account-plan-badge {
    font-size: 13px;
    font-weight: 700;
    color: var(--theme-text);
    background: var(--rgba-255-255-255-0_92);
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--rgba-255-112-67-0_35);
    cursor: pointer;
}

.account-user-name {
    font-weight: 600;
    color: var(--theme-text);
}

.account-manage-btn,
.account-logout-btn {
    border: none;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.account-manage-btn {
    background: var(--theme-gradient);
    color: var(--theme-text);
}

.account-logout-btn {
    background: var(--rgba-255-255-255-0_9);
    color: var(--theme-text);
    border: 1px solid var(--rgba-0-0-0-0_12);
}

.account-settings-btn {
    background: linear-gradient(135deg, var(--theme-primary, #3c6ff6), var(--theme-accent, #5aa6ff));
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 10px 18px;
    font-weight: 600;
}

.account-settings-btn:hover {
    opacity: 0.95;
}

.account-manage-btn:hover,
.account-logout-btn:hover {
    transform: translateY(-1px);
}

.control-panel {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 14px;
    border: 1px solid var(--theme-dictionary-synonym-border, var(--theme-border));
    background: var(--rgba-255-255-255-0_18);
    backdrop-filter: blur(4px);
    min-width: 160px;
}

.control-panel-label {
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
    font-weight: 600;
    color: var(--rgba-33-33-33-0_7);
}

.control-panel-input {
    width: 100%;
    max-width: 96px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid var(--rgba-0-0-0-0_12);
    font-size: 16px;
    font-weight: 600;
    color: var(--theme-text);
    background: var(--rgba-255-255-255-0_95);
}

.instrument-toggle {
    margin-left: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.instrument-icon {
    font-size: 18px;
}

.instrument-label {
    display: none;
}




.app-layout {
    box-sizing: border-box;
    margin-left: 0;
    padding: 0;
    min-height: calc(100vh - var(--topbar-height));
    transition: margin-left 0.2s ease, transform 0.2s ease, opacity 0.2s ease, padding 0.2s ease;
}

#app-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#application-container {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: auto;
    margin: 0;
    padding: 0;
    width: 100%;
}

.application-content {
    flex: 1 1 auto;
    min-height: 0;
    gap: 0;
    border-radius: 0;
}

#application-container::-webkit-scrollbar,
.application-content::-webkit-scrollbar {
    width: 10px;
}

#application-container::-webkit-scrollbar-track,
.application-content::-webkit-scrollbar-track {
    background: var(--theme-surface-1);
}

#application-container::-webkit-scrollbar-thumb,
.application-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    border-radius: 999px;
}

#application-container {
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--theme-surface-1);
}

.header-banner {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 4px 24px;
    border-radius: 20px;
    border: 1px solid var(--theme-border-soft);
    background: var(--theme-surface-1);
    color: var(--theme-text);
    box-shadow: var(--theme-shadow, none);
    margin-bottom: 2px;
}

.header-banner-top {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.header-banner-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header-version-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-left: auto;
    align-items: flex-start;
    width: auto;
}

.header-song-title {
    margin: 0;
    font-size: 24px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: var(--theme-text);
    cursor: text;
    border-bottom: 2px solid transparent;
    padding-bottom: 2px;
}

.header-song-title[contenteditable="true"]:focus-visible {
    outline: none;
    border-bottom-color: var(--theme-focus);
}

.header-song-title[data-placeholder]:empty::before {
    content: attr(data-placeholder);
    color: var(--theme-text-muted);
    font-weight: 600;
    pointer-events: none;
}

.header-song-author {
    margin: 0;
    font-size: 15px;
    line-height: 1.4;
    color: var(--theme-text-muted);
    cursor: text;
    border-bottom: 2px solid transparent;
    padding-bottom: 2px;
}

.header-song-author[contenteditable="true"]:focus-visible {
    outline: none;
    border-bottom-color: var(--theme-focus);
}

.header-song-author[data-placeholder]:empty::before {
    content: attr(data-placeholder);
    color: var(--theme-text-muted);
    font-style: italic;
    pointer-events: none;
}

.header-version {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
}

.header-version-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--theme-text-muted);
}

.header-version-name {
    min-width: 80px;
    max-width: 260px;
    padding: 2px 4px;
    border-radius: 0;
    border: none;
    background: transparent;
    font-size: 14px;
    line-height: 1.3;
    font-weight: 600;
    color: var(--theme-text);
    cursor: text;
}

.header-version-name[contenteditable="true"]:focus-visible {
    outline: none;
    border-bottom: 2px solid var(--theme-focus);
    padding-bottom: 0;
}

.header-version-name[data-placeholder]:empty::before {
    content: attr(data-placeholder);
    color: var(--theme-text-muted);
    font-weight: 500;
    pointer-events: none;
}

.header-banner-actions {
    width: 100%;
    display: flex;
    gap: 12px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.header-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--theme-border-soft);
    background: var(--theme-surface-2);
    color: var(--theme-text);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    line-height: 1.2;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.header-action-btn:hover,
.header-action-btn:focus-visible {
    background: var(--theme-surface-3);
    border-color: var(--theme-border);
    transform: translateY(-1px);
    outline: none;
}

.header-action-btn:active {
    transform: translateY(0);
}

.header-banner-actions .header-action-btn {
    align-items: center;
}

.header-action-btn svg,
.header-action-btn img {
    pointer-events: none;
}

.header-action-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    object-fit: contain;
}

@media (max-width: 720px) {
    .header-banner-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header-version-block {
        width: 100%;
        margin-left: 0;
        align-items: stretch;
    }

    .header-banner-actions {
        width: 100%;
    }
}

.sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    z-index: 20;
    width: var(--sidebar-width-expanded);
    min-width: var(--sidebar-width-expanded);
    max-width: var(--sidebar-width-expanded);
    height: calc(100vh - var(--topbar-height));
    background: var(--theme-surface-1);
    border-radius: 0 24px 24px 0;
    border: 1px solid var(--theme-border-soft);
    color: var(--theme-text);
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px 20px;
    box-sizing: border-box;
    box-shadow: var(--theme-shadow, none);
    overflow-x: hidden;
    overflow-y: auto;
    transition: width 0.2s ease, min-width 0.2s ease, max-width 0.2s ease, padding 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    --sidebar-item-bg: var(--theme-surface-1);
    --sidebar-item-border: var(--theme-border-soft);
    --sidebar-item-text: var(--theme-text);
    --sidebar-item-hover-bg: var(--theme-surface-2);
    --sidebar-item-hover-border: var(--theme-border);
    --sidebar-item-active-bg: var(--theme-gradient, var(--theme-accent-soft));
    --sidebar-item-active-border: var(--theme-accent-border);
    --sidebar-item-active-text: var(--theme-text);
    --sidebar-item-active-hover-border: var(--theme-text);
}

.sidebar.collapsed {
    width: var(--sidebar-width-collapsed);
    min-width: var(--sidebar-width-collapsed);
    max-width: var(--sidebar-width-collapsed);
    padding: 24px 12px;
}

body.sidebar-collapsible .sidebar {
    transform: translateX(-120%);
    opacity: 0;
    pointer-events: none;
    box-shadow: none;
}

body.sidebar-collapsible.sidebar-open .sidebar {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
    box-shadow: var(--theme-shadow, none);
}

.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0px;
}

.sidebar-rail-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    padding: 12px 18px;
    border-radius: 16px;
    border: 1px solid var(--sidebar-item-border);
    background: var(--sidebar-item-bg);
    color: var(--sidebar-item-text);
    font-family: var(--app-font-family);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.sidebar-rail-toggle:hover,
.sidebar-rail-toggle:focus-visible {
    background: var(--sidebar-item-hover-bg);
    border-color: var(--sidebar-item-hover-border);
}

.sidebar-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: transform 0.2s ease;
}

.sidebar.collapsed .sidebar-toggle-label {
    display: none;
}

.sidebar-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--theme-text);
}

.sidebar.collapsed .sidebar-title {
    display: none;
}

.sidebar-subtitle {
    margin: 12px 0 0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--theme-text-muted);
    font-weight: 700;
}

.sidebar.collapsed .sidebar-subtitle {
    display: none;
}

.sidebar-layout-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 6px;
}

.sidebar-layout-nav .layout-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    padding: 12px 18px;
    border-radius: 16px;
    border: 1px solid var(--sidebar-item-border);
    background: var(--sidebar-item-bg);
    color: var(--sidebar-item-text);
    font-family: var(--app-font-family);
    font-weight: 600;
    font-size: 15px;
    line-height: 1.3;
    text-align: left;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    overflow: hidden;
}

.sidebar:not(.collapsed) .sidebar-layout-nav .layout-btn {
    font-size: 15px;
}

.sidebar-layout-nav .layout-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    width: 28px;
    min-width: 28px;
    transition: margin 0.2s ease, transform 0.2s ease;
}

.sidebar-layout-nav .layout-btn-icon,
.sidebar-layout-nav .layout-btn-label {
    display: inline-flex;
    align-items: center;
    color: inherit;
}

.sidebar-layout-nav .layout-btn-label {
    margin-left: 8px;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.12s ease 0s, visibility 0s linear 0s;
    white-space: nowrap;
}

.sidebar-layout-nav .layout-btn:hover,
.sidebar-layout-nav .layout-btn:focus-visible {
    border-color: var(--layout-btn-hover-border);
}

.sidebar-layout-nav .layout-btn:hover {
    transform: translateY(-1px);
}

.sidebar-layout-nav .layout-btn.active {
    background: var(--sidebar-item-active-bg);
    border: 1px solid var(--sidebar-item-active-border, transparent);
    color: var(--sidebar-item-active-text);
}

.sidebar-layout-nav .layout-btn:focus-visible {
    outline: 2px solid var(--theme-focus);
    outline-offset: 2px;
}

.sidebar.collapsed .sidebar-layout-nav .layout-btn {
    justify-content: center;
    padding: 12px;
    font-size: 0;
}

.sidebar.collapsed .sidebar-layout-nav .layout-btn::after {
    left: calc(50% - 2px);
}

.sidebar.collapsed .sidebar-layout-nav .layout-btn-icon {
    margin: 0;
}

.sidebar.collapsed .sidebar-layout-nav .layout-btn-label {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.08s ease 0s, visibility 0s linear 0.08s;
    margin-left: 0;
}

.sidebar.collapsed .song-list {
    display: none;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 12px;
    display: flex;
    width: 100%;
}

.sidebar-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    padding: 12px 18px;
    border-radius: 16px;
    border: 1px solid var(--sidebar-item-border);
    background: none;
    cursor: pointer;
    font-family: var(--app-font-family);
    font-weight: 600;
    color: var(--sidebar-item-text);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.sidebar-theme-toggle:hover,
.sidebar-theme-toggle:focus-visible {
    background: var(--sidebar-item-hover-bg);
    border-color: var(--sidebar-item-hover-border);
    outline: none;
}

.sidebar-theme-toggle-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.sidebar-theme-toggle-label {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.sidebar.collapsed .sidebar-rail-toggle {
    justify-content: center;
    padding: 12px;
    width: auto;
}

.sidebar.collapsed .sidebar-theme-toggle {
    justify-content: center;
    padding: 10px;
    width: auto;
}

.sidebar.collapsed .sidebar-theme-toggle-label {
    display: none;
}

.song-list {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--theme-accent) var(--theme-surface-1);
}

.song-list::-webkit-scrollbar {
    width: 10px;
}

.song-list::-webkit-scrollbar-track {
    background: var(--theme-surface-1);
}

.song-list::-webkit-scrollbar-thumb {
    background: var(--theme-accent);
    border-radius: 8px;
    border: 2px solid var(--theme-surface-1);
}

.song-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid var(--rgba-255-255-255-0_4);
    background: var(--rgba-255-255-255-0_6);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.song-close-btn {
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    border-radius: 6px;
    padding: 4px;
    opacity: 0;
    transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.song-close-btn:hover,
.song-close-btn:focus-visible {
    background: var(--rgba-0-0-0-0_1);
    color: var(--theme-text);
    outline: none;
}

.plan-modal[hidden] {
    display: none !important;
}

.plan-modal {
    position: fixed;
    inset: 0;
    background: var(--rgba-0-0-0-0_45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    z-index: 999;
}

.plan-modal-panel {
    background: var(--theme-surface-1);
    border-radius: 20px;
    padding: 32px 28px;
    max-width: 980px;
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.plan-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    border: none;
    background: var(--rgba-0-0-0-0_1);
    color: var(--theme-text);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
}

.plan-modal-subtitle {
    margin: 0;
    font-size: 15px;
    color: var(--theme-text);
}

.plan-modal-feedback {
    min-height: 18px;
    font-size: 13px;
    font-weight: 600;
}

.plan-modal-feedback[data-status="loading"] {
    color: var(--theme-text);
}

.plan-modal-feedback[data-status="success"] {
    color: var(--theme-text);
}

.plan-modal-feedback[data-status="error"] {
    color: var(--theme-text);
}

.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.plan-card {
    border-radius: 18px;
    border: 1px solid var(--rgba-0-0-0-0_08);
    background: var(--theme-gradient);
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.plan-card.active {
    border-color: var(--rgba-255-112-67-0_6);
}

.plan-card-header h3 {
    margin: 0;
    font-size: 20px;
    color: var(--theme-text);
}

.plan-price {
    margin: 4px 0;
    font-weight: 700;
    color: var(--theme-text);
}

.plan-tagline {
    margin: 0;
    font-size: 13px;
    color: var(--theme-text);
}

.plan-feature-list {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    color: var(--theme-text);
    display: grid;
    gap: 6px;
}

.plan-choose-btn {
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    color: var(--theme-text);
    background: var(--theme-gradient);
}

.plan-choose-btn:hover {
    transform: translateY(-1px);
}

.plan-choose-btn.active,
.plan-choose-btn[aria-pressed="true"] {
    background: var(--theme-surface-1);
}

@media (max-width: 720px) {
    .account-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    .plan-modal {
        align-items: flex-end;
    }
    .plan-modal-panel {
        max-height: 90vh;
        overflow-y: auto;
    }
}

.song-list li.song-list-empty {
    background: transparent;
    color: var(--rgba-0-0-0-0_6);
    cursor: default;
    pointer-events: none;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    overflow: hidden;
}

.header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    color: var(--theme-text);
    font-weight: 600;
    width: 100%;
    box-sizing: border-box;
    background: transparent;
}

.header-block {
    padding: 8px 16px;
    width: 100%;
    box-sizing: border-box;
}

.header-block.header-top {
    padding: 4px 24px;
    border-radius: 20px;
    border: 1px solid var(--theme-border-soft);
    background: var(--theme-surface-1);
    color: var(--theme-text);
    box-shadow: var(--theme-shadow, none);
}

.header-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 20px;
}

.header-top-controls {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.header-quick-controls {
    display: flex;
    align-items: flex-end;
    gap: 12px 20px;
    flex-wrap: wrap;
    flex: 1 1 260px;
}

.header-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px 12px;
    flex: 1 1 360px;
    min-width: 0;
}

.meta-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 200px;
    min-width: 140px;
}

.meta-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--rgba-0-0-0-0_6);
}

.meta-label strong {
    font-weight: 700;
}

.meta-field input {
    flex: 1 1 auto;
    min-width: 140px;
    max-width: 220px;
}

.quick-controls {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    min-width: 80px;
    flex: 0 0 auto;
}

.quick-controls.quick-controls--inline {
    flex-wrap: nowrap;
}

.quick-controls.quick-controls--inline .quick-control-label {
    margin: 0;
}

.quick-control-label {
    font-size: 12px;
    color: var(--theme-text);
    white-space: nowrap;
}

.quick-control-label strong {
    font-weight: 700;
}

.quick-control-input {
    width: 60px;
    padding: 2px 4px;
    height: 26px;
    border-radius: 0;
    border: none;
    background: var(--theme-surface-1);
    font-size: 15px;
    font-weight: 700;
    color: var(--theme-text);
    accent-color: var(--theme-accent);
    caret-color: var(--theme-accent);
    appearance: textfield;
}

.spin-control {
    gap: 6px;
}

.spin-display {
    min-width: 34px;
    max-width: 44px;
    padding: 2px 6px;
    font-weight: 700;
    text-align: center;
    outline: none;
}

.spin-display:focus-visible {
    outline: 1px solid var(--theme-accent);
    outline-offset: 1px;
}

.spin-steppers {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
}

.spin-stepper-btn {
    border: 1px solid var(--theme-border-soft);
    background: var(--theme-surface-1);
    color: var(--theme-text);
    width: 20px;
    height: 12px;
    line-height: 10px;
    padding: 0;
    font-size: 12px;
    cursor: pointer;
}

.spin-stepper-btn:hover,
.spin-stepper-btn:focus-visible {
    background: var(--theme-surface-2);
    outline: none;
}


.header-top-controls .instrument-toggle {
    gap: 8px;
}

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

.title-author {
    display: contents;
}

.title-input,
.author-input,
.version-name-input {
    width: 100%;
}

.control-stack {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.instrument-stack {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    min-width: 140px;
}

.layout-btn-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    pointer-events: none;
}


.title-input,
.author-input,
.version-name-input {
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--rgba-0-0-0-0_4);
    border-radius: 0;
    padding: 4px 2px;
    min-width: 140px;
    color: var(--theme-text);
}

.title-input {
    font-size: 20px;
    font-weight: 700;
}

.author-input {
    font-size: 14px;
    font-style: italic;
}

.version-name-input {
    font-size: 13px;
}

.title-input:focus,
.author-input:focus,
.version-name-input:focus {
    outline: none;
    border-bottom-color: var(--rgba-33-150-243-0_85);
}

.title-input::placeholder,
.author-input::placeholder,
.version-name-input::placeholder {
    color: var(--rgba-0-0-0-0_45);
}

.layout-toggle {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    --layout-btn-background: var(--rgba-255-255-255-0_25);
    --layout-btn-border: var(--rgba-255-255-255-0_45);
    --layout-btn-color: var(--theme-text);
    --layout-btn-hover: var(--rgba-255-255-255-0_4);
    --layout-btn-hover-border: var(--rgba-255-255-255-0_7);
    --layout-btn-shadow: 0 6px 16px var(--rgba-0-0-0-0_08);
    --layout-btn-active-bg: var(--theme-gradient, var(--theme-accent));
    --layout-btn-active-color: var(--theme-text);
    --layout-btn-active-shadow: 0 10px 22px var(--rgba-255-112-67-0_28);
    --layout-btn-focus-outline: var(--rgba-255-112-67-0_35);
}

.layout-toggle .account-settings-nav-button {
    justify-content: flex-start;
}

.layout-toggle .icon-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--layout-btn-border);
    box-sizing: border-box;
    background: var(--layout-btn-background);
    color: var(--layout-btn-color);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

.layout-toggle .icon-btn:hover,
.layout-toggle .icon-btn:focus-visible {
    background: var(--layout-btn-hover);
    border-color: var(--layout-btn-hover-border);
    transform: translateY(-1px);
}

.layout-toggle .icon-btn:focus-visible {
    outline: none;
}

.layout-toggle .icon-btn.active {
    background: var(--layout-btn-active-bg);
    color: var(--layout-btn-active-color);
    border: none;
    transform: translateY(0);
}

.sidebar-layout-nav .layout-btn:not(.active):hover,
.sidebar-layout-nav .layout-btn:not(.active):focus-visible {
    background: var(--layout-btn-background);
}

.sidebar-layout-nav .layout-btn.active:hover {
    background: var(--sidebar-item-active-bg);
    border-color: var(--sidebar-item-active-hover-border);
}



.title-input::placeholder {
    color: var(--rgba-33-33-33-0_6);
}

.application-content {
    flex: 1 1 auto;
    width: 100%;
}

.application-view {
    display: contents;
}

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

.legend-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: var(--rgba-0-0-0-0_08);
    font-weight: 700;
    font-size: 16px;
}

/* Make the history/story panel expand so the main story textarea grows */
#panel-history {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    height: 100%;
}

#partition-placeholder {
    display: none;
}

.layout-placeholder {
    margin: 80px auto;
    max-width: 640px;
    padding: 32px;
    border-radius: 16px;
    background: var(--theme-surface-1);
    border: 1px solid var(--theme-border-soft);
    color: var(--theme-text);
    font-size: 18px;
    line-height: 1.6;
    text-align: center;
    box-shadow: var(--theme-shadow, none);
}

.layout-placeholder p {
    margin: 0;
}

.chord-fingering-figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--rgba-0-0-0-0_12);
    /*background: var(--theme-gradient);*/
    max-width: 100%;
    flex: 1 1 280px;
}

.chord-fingering-image {
    width: auto;
    max-width: min(100%, 560px);
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--rgba-0-0-0-0_1);
    background: var(--theme-surface-1);
}

.chord-fingering-caption {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rgba-0-0-0-0_55);
}

.chord-fingering {
    flex: 1 1 0;
    margin: 0;
    padding: 12px 16px;
    border-radius: 8px;
    background: var(--rgba-0-0-0-0_04);
    border: 1px solid var(--rgba-0-0-0-0_08);
    font-family: 'Courier New', Courier, monospace;
    font-size: 18px;
    line-height: 1.5;
    white-space: pre;
}

.chord-tip {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border-radius: 12px;
    background: var(--rgba-255-255-255-0_95);
    border: 1px solid var(--rgba-26-35-126-0_12);
    width: 100%;
    box-sizing: border-box;
}

.chord-tip h5 {
    margin: 0;
    font-size: 14px;
    color: var(--theme-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chord-tip-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chord-tip-list li {
    margin: 0;
    display: flex;
    gap: 8px;
    align-items: flex-start;
    color: var(--rgba-0-0-0-0_78);
    font-size: 13px;
    line-height: 1.6;
}

.chord-tip-list li::before {
    content: "➡️";
    flex: none;
    font-size: 12px;
    line-height: 1.4;
    margin-top: 2px;
}

.chord-tip-list li span {
    flex: 1;
}

.chord-tip-paragraph {
    margin: 0 0 10px;
    color: var(--rgba-0-0-0-0_78);
    font-size: 13px;
    line-height: 1.6;
}

.chord-tip-paragraph:last-child {
    margin-bottom: 0;
}

.lyric-word-block {
    position: relative;
    display: inline-block;
    vertical-align: bottom;
    text-align: center;
    padding-top: 2.4rem;
}

.lyric-word-block::before {
    content: "";
    position: absolute;
    top: 1.92rem;
    left: var(--chord-left, 50%);
    transform: translateX(-50%);
    width: 0;
    height: 0.45rem;
    border-left: 2px solid var(--rgba-30-30-30-0_45);
    pointer-events: none;
    z-index: 0;
}

html.theme-sombre .lyric-word-block::before {
    border-left-color: rgba(255,255,255,0.7);
}

.lyric-word-block + .lyric-word-block {
    margin-left: 3.8rem;
}

.lyric-word-block .chord-pill {
    position: absolute;
    top: 0;
    left: var(--chord-left, 50%);
    transform: translateX(-50%);
    margin: 0;
    cursor: grab;
    touch-action: pan-y;
    user-select: none;
    z-index: 1;
}

.lyric-word-block .chord-pill.chord-pill--dragging,
.lyric-word-block .chord-pill.chord-pill--dragging:active {
    cursor: grabbing;
}

.lyric-word {
    display: inline-block;
    text-align: center;
}

.lyric-cell {
    font-weight: bold;
    line-height: 1.2;
    white-space: pre-wrap;
    color: var(--theme-text);
}

.lyric-cell--interactive {
    cursor: pointer;
}

.lyric-word--placeholder {
    color: transparent;
    min-width: 0.65rem;
    border-bottom: 1px dashed var(--rgba-30-30-30-0_25);
    display: inline-block;
}

.definition-tooltip {
    position: absolute;
    min-width: 240px;
    max-width: 360px;
    background: var(--theme-dictionary-tooltip-bg, var(--theme-surface-1));
    color: var(--theme-dictionary-tooltip-text, var(--theme-text));
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--theme-accent-border, var(--accent));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 1000;
}

.definition-tooltip--active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.definition-tooltip__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.definition-tooltip__word,
.definition-tooltip__title {
    font-weight: 700;
    font-size: 1rem;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.definition-tooltip__languages {
    display: flex;
    gap: 4px;
    align-items: center;
}

.definition-tooltip__reload {
    border: none;
    background: var(--rgba-255-255-255-0_1);
    color: var(--theme-text);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    transition: background 0.2s ease, transform 0.2s ease;
}

.definition-tooltip__reload:hover,
.definition-tooltip__reload:focus-visible {
    background: var(--rgba-255-255-255-0_25);
    transform: rotate(-20deg);
    outline: none;
}

.definition-tooltip__lang-btn {
    border: none;
    background: var(--rgba-255-255-255-0_12);
    color: var(--theme-text);
    border-radius: 4px;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1.2;
    opacity: 0.75;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.definition-tooltip__lang-btn:hover {
    background: var(--rgba-255-255-255-0_24);
    opacity: 1;
}

.definition-tooltip__lang-btn.is-active {
    background: var(--rgba-255-255-255-0_35);
    opacity: 1;
}

.definition-tooltip__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.9rem;
    max-height: 320px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.definition-tooltip__section-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--theme-dictionary-tooltip-heading, #000000);
}

.definition-tooltip__list {
    padding-left: 18px;
    margin: 0;
}

.definition-tooltip__list li {
    margin-bottom: 4px;
}

.definition-tooltip__synonym-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.definition-tooltip__synonym-btn {
    border: 1px solid var(--theme-dictionary-synonym-border, var(--theme-border));
    background: var(--rgba-255-255-255-0_08);
    color: var(--theme-text);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.definition-tooltip__synonym-btn:hover {
    background: var(--theme-gradient);
    border-color: var(--theme-dictionary-synonym-border, var(--theme-border));
}

.definition-tooltip__empty {
    font-style: italic;
    opacity: 0.75;
}

.definition-tooltip__loading {
    font-style: italic;
    opacity: 0.8;
}

.definition-tooltip__error {
    color: var(--theme-text);
    font-weight: 600;
}

.section-label {
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 12px;
    text-align: left;
    background: var(--theme-gradient);
    color: var(--theme-text);
}

.chord-cell {
    text-align: left;
    padding: 6px 4px;
    vertical-align: middle;
}

.chord-pill {
    border: 1px solid var(--theme-border, #d9d9d9);
    background: #ffffff;
    color: #111827;
    border-radius: 999px;
    padding: 4px 10px;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.chord-pill:hover,
.chord-pill:focus-visible {
    background: var(--rgba-195-25-25-0_2);
    color: var(--theme-text);
    outline: none;
    box-shadow: 0 0 0 2px var(--rgba-195-25-25-0_18);
}

.chord-pill--missing {
    border-color: var(--theme-danger);
    background: var(--rgba-195-25-25-0_12);
    color: var(--theme-danger);
}

.chord-pill--missing:hover,
.chord-pill--missing:focus-visible {
    background: var(--rgba-195-25-25-0_18);
    border-color: var(--theme-danger);
    color: var(--theme-danger);
}

.chord-pill--empty {
    background: var(--rgba-30-30-30-0_04);
    border: 1px dashed var(--rgba-30-30-30-0_35);
    color: var(--rgba-30-30-30-0_65);
}

.chord-pill--empty:hover,
.chord-pill--empty:focus-visible {
    border-style: solid;
    border-color: var(--theme-text);
    color: var(--theme-text);
}

/* Friends overlay */
.friends-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    padding: 20px;
}

.friends-overlay.is-visible {
    display: flex;
}

.friends-dialog {
    background: var(--theme-surface-1, #0f172a);
    color: var(--theme-text, #e2e8f0);
    border: 1px solid var(--theme-border, rgba(255,255,255,0.1));
    border-radius: 12px;
    min-width: 320px;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

.friends-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--theme-border-soft, rgba(255,255,255,0.1));
}

.friends-header h3 {
    margin: 0;
    font-size: 16px;
}

.friends-close {
    border: none;
    background: none;
    color: inherit;
    font-size: 20px;
    cursor: pointer;
}

.friends-body {
    padding: 12px 14px 14px;
}

.friends-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.friends-list li {
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--theme-surface-2, rgba(255,255,255,0.05));
    border: 1px solid var(--theme-border-soft, rgba(255,255,255,0.08));
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.friends-empty {
    padding: 8px;
    color: var(--theme-text-muted, #94a3b8);
    font-size: 13px;
}

.friends-section h4 {
    margin: 0 0 6px 0;
    font-size: 13px;
    color: var(--theme-text-muted, #94a3b8);
}

.friends-form-label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--theme-text, #e2e8f0);
}

.friends-form-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--theme-border, rgba(255,255,255,0.2));
    background: var(--theme-surface-2, rgba(255,255,255,0.04));
    color: var(--theme-text, #e2e8f0);
    font-size: 14px;
    box-sizing: border-box;
}

.friends-error {
    margin: 8px 0 0;
    color: var(--theme-danger, #ef4444);
    font-size: 13px;
}

.friends-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.friends-close-btn,
.friends-cta-btn {
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
}

.friends-close-btn {
    background: var(--theme-surface-2, rgba(255,255,255,0.05));
    color: var(--theme-text, #e2e8f0);
}

.friends-cta-btn {
    background: var(--theme-primary, #3c6ff6);
    color: #fff;
}

.friends-pill {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--theme-border-soft, rgba(255,255,255,0.15));
    color: inherit;
    font-size: 12px;
}

.friends-row-actions {
    display: inline-flex;
    gap: 6px;
}

.friends-row-actions button {
    border: 1px solid var(--theme-border-soft, rgba(255,255,255,0.2));
    background: var(--theme-surface-2, rgba(255,255,255,0.05));
    color: inherit;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
}

.friends-share-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--theme-surface-2, rgba(255,255,255,0.05));
    border: 1px solid var(--theme-border-soft, rgba(255,255,255,0.08));
    color: inherit;
}

.shared-refresh-btn {
    margin-top: 6px;
    align-self: flex-end;
    border: 1px solid var(--theme-border, rgba(255,255,255,0.2));
    background: var(--theme-surface-2, rgba(255,255,255,0.08));
    color: var(--theme-text, #e2e8f0);
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
}

/* Lecture seule partages */
body.shared-readonly {
    background: linear-gradient(135deg, #ffe6f0 0%, #ffd1e8 50%, #ffb8e0 100%) !important;
    --theme-primary: #ff6fa0;
    --theme-primary-alt: #ff8fba;
    --theme-accent: #ffa6d1;
    --accent: #ff6fa0;
    --accent-strong: #ff8fba;
    --theme-gradient: linear-gradient(135deg, #ff6fa0 0%, #ff8fba 50%, #ffa6d1 100%);
}
body.shared-readonly .application-content {
    background: transparent;
    pointer-events: auto;
    overflow: auto;
}
body.shared-readonly .application-content input,
body.shared-readonly .application-content textarea,
body.shared-readonly .application-content [contenteditable],
body.shared-readonly .application-content select {
    user-select: none;
}

.chord-popover {
    position: absolute;
    width: min(680px, calc(100vw - 24px));
    min-width: 360px;
    background: var(--theme-popover-bg, var(--theme-surface-2, var(--theme-surface-1)));
    color: var(--theme-text);
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 8px 24px var(--rgba-0-0-0-0_15);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
    transform: translateY(-4px);
    z-index: 1000;
}

.chord-popover--below {
    transform: translateY(4px);
}

.chord-popover--active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.chord-popover__header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    gap: 4px;
}

.chord-popover__title {
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chord-popover__categories {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 12px;
    position: sticky;
    top: 0;
    background: inherit;
    padding: 6px 0;
    z-index: 1;
    overflow: hidden;
}

.chord-popover__category {
    border: 1px solid var(--theme-info);
    background: var(--theme-surface-1);
    color: var(--theme-text);
    border-radius: 999px;
    padding: 5px 12px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    text-align: center;
    flex-shrink: 0;
    white-space: nowrap;
}

.chord-popover__category:hover,
.chord-popover__category:focus-visible {
    outline: none;
    background: var(--theme-surface-1);
    border-color: var(--theme-text);
}

.chord-popover__category.is-active {
    background: #3cc56b;
    border-color: #2ca75a;
    color: #0a1f0a;
}

.chord-popover__groups {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}

.chord-popover__group-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--rgba-29-45-83-0_85);
    margin-bottom: 4px;
}

.chord-popover__group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chord-popover__group-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chord-popover__subgroup {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chord-popover__subgroup-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--rgba-29-45-83-0_65);
}

.chord-popover__options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chord-popover__option,
.chord-popover__clear {
    border: 1px solid var(--rgba-59-130-246-0_55);
    background: var(--theme-gradient);
    color: #fff;
    border-radius: 999px;
    padding: 6px 12px;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
    word-break: normal;
    flex-shrink: 0;
    white-space: nowrap;
}

.chord-popover__option:hover,
.chord-popover__option:focus-visible,
.chord-popover__clear:hover,
.chord-popover__clear:focus-visible {
    background: var(--theme-gradient);
    border-color: var(--rgba-59-130-246-0_85);
    filter: brightness(1.05);
    outline: none;
}

.chord-popover__option.is-active,
.chord-popover__clear.is-active {
    background: var(--theme-gradient);
    color: #fff;
    border-color: var(--rgba-59-130-246-0_95);
}

.chord-popover__option--unknown {
    background: rgba(244, 67, 54, 0.15);
    border-color: rgba(244, 67, 54, 0.65);
    color: #b71c1c;
}

.chord-popover__option--unknown:hover,
.chord-popover__option--unknown:focus-visible {
    background: rgba(244, 67, 54, 0.3);
    border-color: rgba(244, 67, 54, 0.85);
    color: #7f1111;
}

.chord-popover__option--unknown.is-active {
    background: #ff4d4f;
    border-color: #d9363e;
    color: #fff;
}

.chord-popover__option--unknown {
    background: rgba(244, 67, 54, 0.15);
    border-color: rgba(244, 67, 54, 0.65);
    color: #b71c1c;
}

.chord-popover__option--unknown:hover,
.chord-popover__option--unknown:focus-visible {
    background: rgba(244, 67, 54, 0.3);
    border-color: rgba(244, 67, 54, 0.85);
    color: #7f1111;
}

.chord-popover__option--unknown.is-active {
    background: #ff4d4f;
    border-color: #d9363e;
    color: #fff;
}

.chord-popover__clear {
    background: rgba(244, 67, 54, 0.15);
    border-color: rgba(244, 67, 54, 0.65);
    color: #b71c1c;
}

.chord-popover__clear:hover,
.chord-popover__clear:focus-visible {
    background: rgba(244, 67, 54, 0.35);
    border-color: rgba(244, 67, 54, 0.85);
    color: #7f1111;
}

.chord-popover__clear.is-active {
    background: #ff4d4f;
    border-color: #d9363e;
    color: #fff;
}

html.theme-sombre .topbar-action-icon {
    filter: invert(1) brightness(1.2);
}

html.theme-sombre .topbar-select-icon-btn img {
    filter: invert(1) brightness(1.2);
}


html.theme-sombre .chord-pill--empty {
    background: var(--modern-chord-empty-bg);
    border-color: var(--modern-chord-empty-border);
    color: var(--modern-contrast);
}

html.theme-sombre .chord-pill--empty:hover,
html.theme-sombre .chord-pill--empty:focus-visible {
    border-color: var(--modern-contrast);
    color: var(--modern-contrast);
}


/* Theme-specific structural rules */
html.theme-claire body {
    font-family: var(--app-font-family);
    color: var(--claire-text);
    background: var(--claire-body-gradient);
    position: relative;
}

html.theme-claire body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: var(--claire-body-overlay);
    pointer-events: none;
    z-index: -1;
}

html.theme-claire .topbar {
    background: var(--rgba-255-255-255-0_8);
    border-bottom-color: var(--claire-border-soft);
    backdrop-filter: blur(12px);
}

html.theme-claire .topbar .icon-btn,
html.theme-claire .icon-btn,
html.theme-claire .export-btn {
    background: var(--claire-surface-strong);
    color: var(--claire-text);
    border-color: var(--claire-border-soft);
}

html.theme-claire .topbar .icon-btn:hover,
html.theme-claire .icon-btn:hover,
html.theme-claire .export-btn:hover {
    background: linear-gradient(135deg, var(--rgba-94-96-206-0_15), var(--rgba-100-223-223-0_18));
}

html.theme-claire .export-btn .export-label {
    color: var(--claire-text);
}

html.theme-claire .account-menu {
    background: var(--claire-surface);
    border-color: var(--claire-border-soft);
    color: var(--claire-text);
}

html.theme-claire .account-plan-badge {
    background: linear-gradient(135deg, var(--rgba-94-96-206-0_92), var(--rgba-100-223-223-0_85));
    border-color: transparent;
    color: var(--theme-text-inverse);
}

html.theme-claire .account-user-name {
    color: var(--claire-text);
}

html.theme-claire .account-manage-btn {
    background: linear-gradient(135deg, var(--rgba-94-96-206-0_95), var(--rgba-100-223-223-0_8));
    color: var(--theme-text-inverse);
    border: none;
}

html.theme-claire .account-logout-btn {
    background: var(--rgba-225-29-72-0_14);
    border-color: var(--rgba-225-29-72-0_4);
    color: var(--claire-text);
}

html.theme-claire .account-manage-btn:hover,
html.theme-claire .account-logout-btn:hover {
    transform: translateY(-1px);
}

html.theme-claire .account-logout-btn:hover,
html.theme-claire .account-logout-btn:focus-visible {
    background: var(--rgba-225-29-72-0_26);
    border-color: var(--rgba-225-29-72-0_55);
}

html.theme-claire .theme-switcher,
html.theme-claire .button-display-control {
    background: var(--claire-surface);
    border-color: var(--claire-border-soft);
}

html.theme-claire .theme-switcher-icon {
    color: var(--claire-text);
}

html.theme-claire .theme-select {
    color: var(--claire-text);
    background: transparent;
    border: none;
}

html.theme-claire .theme-select option {
    color: var(--claire-text);
    background: var(--theme-surface-1);
}

html.theme-claire .sidebar {
    background: var(--claire-surface);
    border-color: var(--claire-border-soft);
    color: var(--claire-text);
    --sidebar-item-bg: var(--claire-surface-strong);
    --sidebar-item-border: var(--claire-border-soft);
   --sidebar-item-text: var(--claire-text);
   --sidebar-item-hover-bg: linear-gradient(135deg, var(--rgba-94-96-206-0_12), var(--rgba-100-223-223-0_16));
   --sidebar-item-hover-border: var(--rgba-94-96-206-0_28);
    --sidebar-item-active-bg: var(--theme-gradient, linear-gradient(135deg, var(--claire-accent), var(--claire-accent-secondary)));
    --sidebar-item-active-border: transparent;
    --sidebar-item-active-text: var(--theme-text-inverse);
}

html.theme-claire .sidebar-title {
    color: var(--claire-text);
}

html.theme-claire .sidebar-subtitle {
    color: var(--claire-text-muted);
}

html.theme-claire .sidebar-theme-toggle {
    background: var(--rgba-255-255-255-0_72);
    border-color: var(--claire-border-soft);
    color: var(--claire-text);
    box-shadow: 0 4px 16px var(--rgba-94-96-206-0_12);
}

html.theme-claire .sidebar-theme-toggle:hover,
html.theme-claire .sidebar-theme-toggle:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--rgba-94-96-206-0_16);
}

html.theme-claire .sidebar-theme-toggle-label {
    color: var(--claire-text);
}

html.theme-claire .sidebar-theme-toggle-track {
    background: var(--rgba-94-96-206-0_18);
    border-color: var(--rgba-94-96-206-0_35);
}

html.theme-claire .sidebar-theme-toggle-handle {
    background: var(--theme-surface-1);
    box-shadow: 0 2px 6px var(--rgba-37-44-97-0_18);
}

html.theme-claire .sidebar-theme-toggle[aria-checked="true"] .sidebar-theme-toggle-track {
    background: linear-gradient(135deg, var(--rgba-94-96-206-0_92), var(--rgba-100-223-223-0_85));
    border-color: var(--rgba-94-96-206-0_35);
}

html.theme-claire .sidebar-theme-toggle[aria-checked="true"] .sidebar-theme-toggle-handle {
    box-shadow: 0 2px 6px var(--rgba-26-32-73-0_25);
}

html.theme-claire .song-list {
    scrollbar-color: var(--rgba-94-96-206-0_35) var(--rgba-255-255-255-0_3);
}

html.theme-claire .song-status-indicator {
    border-color: var(--rgba-94-96-206-0_35);
}


html.theme-claire .meta-label,
html.theme-claire .quick-control-label {
    color: var(--claire-text-muted);
}

html.theme-claire input,
html.theme-claire textarea,
html.theme-claire select {
    background: var(--claire-surface-strong);
    color: var(--claire-text);
    border-color: var(--rgba-94-96-206-0_22);
}

html.theme-claire input::placeholder,
html.theme-claire textarea::placeholder {
    color: var(--rgba-47-47-47-0_45);
}

html.theme-claire .control-panel {
    background: var(--claire-surface-strong);
    border-color: var(--claire-border-soft);
}

html.theme-claire .control-panel-label {
    color: var(--claire-text-muted);
}

html.theme-claire .layout-toggle {
    --layout-btn-background: var(--claire-surface-strong);
    --layout-btn-border: var(--claire-border-soft);
    --layout-btn-color: var(--claire-text);
    --layout-btn-hover: linear-gradient(135deg, var(--rgba-94-96-206-0_12), var(--rgba-100-223-223-0_16));
    --layout-btn-hover-border: var(--rgba-94-96-206-0_32);
    --layout-btn-shadow: 0 14px 24px var(--rgba-94-96-206-0_18);
    --layout-btn-active-bg: var(--theme-gradient, linear-gradient(135deg, var(--rgba-94-96-206-0_92), var(--rgba-100-223-223-0_85)));
    --layout-btn-active-color: var(--theme-text-inverse);
    --layout-btn-active-shadow: 0 22px 34px var(--rgba-94-96-206-0_32);
    --layout-btn-focus-outline: var(--rgba-94-96-206-0_35);
}

html.theme-claire .theme-select:focus-visible {
    outline-color: var(--rgba-94-96-206-0_6);
}

html.theme-claire .song-list li.song-list-empty {
    color: var(--claire-text-muted);
}

html.theme-sombre body {
    font-family: var(--app-font-family);
    color: var(--modern-text);
    background: var(--modern-bg);
    position: relative;
}

html.theme-sombre body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: var(--modern-body-overlay);
    z-index: -1;
    pointer-events: none;
}

html.theme-sombre button:focus-visible,
html.theme-sombre a:focus-visible,
html.theme-sombre input:focus-visible,
html.theme-sombre select:focus-visible,
html.theme-sombre textarea:focus-visible {
    outline: 2px solid var(--modern-focus);
    outline-offset: 2px;
}

html.theme-sombre .topbar {
    background: var(--modern-surface-2);
    border-bottom-color: var(--modern-border);
    backdrop-filter: blur(18px);
}

html.theme-sombre .icon-btn,
html.theme-sombre .topbar .icon-btn,
html.theme-sombre .export-btn {
    background: var(--btn-ghost-bg);
    color: var(--btn-ghost-text);
    border-color: var(--btn-ghost-border);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

html.theme-sombre .topbar .icon-btn .icon-img,
html.theme-sombre .icon-btn .icon-img {
    filter: invert(1) brightness(1.1);
}

html.theme-sombre .layout-control svg,
html.theme-sombre .topbar .icon-btn svg,
html.theme-sombre .icon-btn svg {
    fill: var(--modern-text-inverse);
    color: var(--modern-text-inverse);
}

html.theme-sombre .topbar .icon-btn:hover,
html.theme-sombre .icon-btn:hover,
html.theme-sombre .export-btn:hover,
html.theme-sombre .topbar .icon-btn:focus-visible,
html.theme-sombre .icon-btn:focus-visible,
html.theme-sombre .export-btn:focus-visible {
    background: var(--btn-ghost-bg-hover);
    border-color: var(--btn-ghost-border);
    color: var(--btn-ghost-text);
    filter: none;
}

html.theme-sombre .export-btn .export-label {
    color: var(--modern-text-muted);
}

html.theme-sombre .topbar .icon-btn .icon-img,
html.theme-sombre .icon-btn .icon-img,
html.theme-sombre .topbar .icon-btn svg,
html.theme-sombre .icon-btn svg {
    filter: invert(1) brightness(1.2);
    fill: currentColor;
    color: var(--modern-text-inverse);
}

html.theme-sombre .account-menu {
    background: var(--modern-surface-1);
    border-color: var(--modern-border);
    color: var(--modern-text);
}

html.theme-sombre .account-plan-badge {
    background: var(--modern-accent-soft);
    border-color: var(--modern-accent);
    color: var(--modern-text);
}

html.theme-sombre .account-user-name {
    color: var(--modern-text);
}

html.theme-sombre .account-manage-btn {
    background: var(--btn-bg);
    color: var(--btn-text);
    border-color: var(--btn-border);
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

html.theme-sombre .account-manage-btn:hover,
html.theme-sombre .account-manage-btn:focus-visible {
    background: var(--btn-bg-hover);
    color: var(--btn-text);
}

html.theme-sombre .account-logout-btn {
    background: var(--rgba-239-68-68-0_16);
    color: var(--btn-ghost-text);
    border-color: var(--rgba-239-68-68-0_45);
}

html.theme-sombre .account-logout-btn:hover,
html.theme-sombre .account-logout-btn:focus-visible {
    background: var(--rgba-239-68-68-0_28);
    border-color: var(--rgba-239-68-68-0_65);
}

html.theme-sombre .theme-switcher,
html.theme-sombre .button-display-control {
    background: var(--modern-surface-1);
    border-color: var(--modern-border-soft);
    color: var(--modern-text);
}

html.theme-sombre .theme-switcher-icon {
    color: var(--modern-text);
}

html.theme-sombre .theme-select {
    color: var(--modern-text);
    background: transparent;
    border: none;
}

html.theme-sombre .theme-select option {
    color: var(--modern-text-inverse);
}

html.theme-sombre .sidebar {
    background: var(--modern-surface-1);
    border-color: var(--modern-border);
    color: var(--modern-text);
    box-shadow: var(--modern-shadow);
    --sidebar-item-bg: var(--modern-surface-1);
    --sidebar-item-border: var(--modern-border);
    --sidebar-item-text: var(--modern-text);
    --sidebar-item-hover-bg: var(--modern-surface-2);
    --sidebar-item-hover-border: var(--modern-border-soft);
    --sidebar-item-active-bg: var(--theme-gradient, linear-gradient(135deg, var(--modern-accent), var(--modern-accent-strong)));
    --sidebar-item-active-border: transparent;
    --sidebar-item-active-text: var(--modern-text-inverse);
}

html.theme-sombre .sidebar-title {
    color: var(--modern-text);
}

html.theme-sombre .sidebar-subtitle {
    color: var(--modern-text-muted);
}

html.theme-sombre .sidebar-theme-toggle {
    background: var(--modern-surface-2);
    border-color: var(--modern-border);
    color: var(--modern-text);
    box-shadow: 0 6px 18px var(--rgba-7-10-30-0_35);
}

html.theme-sombre .sidebar-theme-toggle:hover,
html.theme-sombre .sidebar-theme-toggle:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px var(--rgba-7-10-30-0_45);
}

html.theme-sombre .sidebar-theme-toggle-label {
    color: var(--modern-text);
}

html.theme-sombre .sidebar-theme-toggle-track {
    background: var(--modern-surface-3);
    border-color: var(--modern-border);
}

html.theme-sombre .sidebar-theme-toggle-handle {
    background: var(--modern-text);
    box-shadow: 0 2px 6px var(--rgba-3-4-15-0_45);
}

html.theme-sombre .sidebar-theme-toggle[aria-checked="true"] .sidebar-theme-toggle-track {
    background: linear-gradient(135deg, var(--rgba-159-103-255-0_75), var(--rgba-92-200-255-0_7));
    border-color: var(--modern-accent);
}

html.theme-sombre .sidebar-theme-toggle[aria-checked="true"] .sidebar-theme-toggle-handle {
    background: var(--modern-text-inverse);
    box-shadow: 0 2px 10px var(--rgba-9-16-48-0_55);
}

html.theme-sombre .song-status-indicator {
    border-color: var(--modern-border);
}

html.theme-sombre .meta-label,
html.theme-sombre .quick-control-label {
    color: var(--modern-text-muted);
}

html.theme-sombre input,
html.theme-sombre textarea,
html.theme-sombre select {
    background: var(--input-bg);
    border-color: var(--input-border);
    color: var(--input-text);
}

html.theme-sombre input::placeholder,
html.theme-sombre textarea::placeholder {
    color: var(--input-placeholder);
}

html.theme-sombre input:focus,
html.theme-sombre textarea:focus,
html.theme-sombre select:focus {
    border-color: var(--input-border-focus);
}

html.theme-sombre .control-panel {
    background: var(--modern-surface-1);
    border-color: var(--modern-border);
}

html.theme-sombre .control-panel-label {
    color: var(--modern-text-muted);
}

html.theme-sombre .layout-toggle {
    --layout-btn-background: var(--modern-surface-1);
    --layout-btn-border: var(--modern-border);
    --layout-btn-color: var(--modern-text);
    --layout-btn-hover: var(--modern-surface-2);
    --layout-btn-hover-border: var(--modern-border);
    --layout-btn-shadow: var(--modern-shadow);
    --layout-btn-active-bg: var(--theme-gradient, linear-gradient(135deg, var(--modern-accent), var(--modern-accent-strong)));
    --layout-btn-active-color: var(--modern-text-inverse);
    --layout-btn-active-shadow: 0 20px 36px var(--rgba-108-86-255-0_32);
    --layout-btn-focus-outline: var(--modern-focus);
}

html.theme-sombre .chord-popover {
    background: var(--rgba-35-35-35-0_98);
    color: var(--theme-text);
    box-shadow: 0 8px 28px var(--rgba-0-0-0-0_35);
}

html.theme-sombre .chord-popover__header {
    color: inherit;
}

html.theme-sombre .chord-popover__categories {
    background: transparent;
}

html.theme-sombre .chord-popover__category {
    border-color: var(--rgba-255-255-255-0_2);
    background: var(--rgba-255-255-255-0_08);
    color: var(--theme-text);
}

html.theme-sombre .chord-popover__category:hover,
html.theme-sombre .chord-popover__category:focus-visible {
    background: var(--rgba-255-255-255-0_16);
    border-color: var(--rgba-255-255-255-0_35);
}

html.theme-sombre .chord-popover__category.is-active {
    background: #3cc56b;
    border-color: #2ca75a;
    color: #0a1f0a;
}

html.theme-sombre .chord-popover__group-title {
    color: var(--rgba-245-245-245-0_7);
}

html.theme-sombre .chord-popover__subgroup-title {
    color: var(--rgba-245-245-245-0_6);
}

html.theme-sombre .chord-popover__option,
html.theme-sombre .chord-popover__clear {
    border-color: var(--rgba-59-130-246-0_6);
    background: var(--theme-gradient);
    color: #fff;
}

html.theme-sombre .chord-popover__option:hover,
html.theme-sombre .chord-popover__option:focus-visible {
    background: var(--theme-gradient);
    border-color: var(--rgba-59-130-246-0_85);
    filter: brightness(1.05);
}

html.theme-sombre .chord-popover__option.is-active {
    background: var(--theme-gradient);
    color: #fff;
    border-color: var(--rgba-59-130-246-0_95);
}

html.theme-sombre .chord-popover__option--unknown {
    background: rgba(244, 67, 54, 0.2);
    border-color: rgba(244, 67, 54, 0.6);
    color: #ffb3b3;
}

html.theme-sombre .chord-popover__option--unknown:hover,
html.theme-sombre .chord-popover__option--unknown:focus-visible {
    background: rgba(244, 67, 54, 0.35);
    border-color: rgba(244, 67, 54, 0.8);
    color: #ffe0e0;
}

html.theme-sombre .chord-popover__option--unknown.is-active {
    background: #ff4d4f;
    border-color: #d9363e;
    color: #fff;
}

html.theme-sombre .chord-popover__clear {
    background: rgba(244, 67, 54, 0.25);
    border-color: rgba(244, 67, 54, 0.65);
    color: #ffd6d6;
}

html.theme-sombre .chord-popover__clear:hover,
html.theme-sombre .chord-popover__clear:focus-visible {
    background: rgba(244, 67, 54, 0.4);
    border-color: rgba(244, 67, 54, 0.85);
    color: #fff4f4;
}

html.theme-sombre .chord-popover__clear.is-active {
    background: #ff4d4f;
    border-color: #d9363e;
    color: #fff;
}


html.theme-sombre .theme-select:focus-visible {
    outline-color: var(--modern-focus);
}

html.theme-sombre .song-list li.song-list-empty {
    color: var(--modern-text-muted);
}

html.theme-sombre .definition-tooltip__section-title {
    color: var(--theme-dictionary-tooltip-heading, #ffffff);
}


.library-layout-active .header,
.library-layout-active .layout-divider {
    display: none;
}

.library-layout-active #application-container {
    margin-top: var(--library-margin-top, 26px);
}

.library-layout-active .lyrics_container.layout-library {
    margin-top: 0;
}


.library-layout-active .main-content {
    gap: 0;
}
.library-layout-active .app-layout {
    padding-top: 0;
}
.topbar-project-title .topbar-title-text[contenteditable="true"] {
    border-bottom: 2px solid transparent;
    padding-bottom: 2px;
}

.topbar-project-title .topbar-title-text[contenteditable="true"]:focus-visible {
    outline: none;
    border-bottom-color: var(--theme-focus);
}

.topbar-project-title .topbar-title-text[data-placeholder]:empty::before {
    content: attr(data-placeholder);
    color: var(--theme-text-muted);
}

.topbar-author-text[contenteditable="true"] {
    border-bottom: 1px solid transparent;
}

.topbar-author-text[contenteditable="true"]:focus-visible {
    outline: none;
    border-bottom-color: var(--theme-focus);
}

.topbar-author-text[data-placeholder]:empty::before {
    content: attr(data-placeholder);
    color: var(--theme-text-muted);
}

.topbar-project-title .topbar-subtitle-text[contenteditable="true"] {
    border-bottom: 1px solid transparent;
}

.topbar-project-title .topbar-subtitle-text[contenteditable="true"]:focus-visible {
    outline: none;
    border-bottom-color: var(--theme-border);
}

.topbar-project-title .topbar-subtitle-text[data-placeholder]:empty::before {
    content: attr(data-placeholder);
    color: var(--theme-text-muted);
}
.quick-control-input::-webkit-inner-spin-button,
.quick-control-input::-webkit-outer-spin-button {
    appearance: none;
    margin: 0;
    background: transparent;
}
.account-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 600;
    padding: 24px;
}

.account-overlay[hidden] {
    display: none;
}

.account-overlay-panel {
    width: min(420px, 100%);
    background: var(--theme-surface-1);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.35);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.account-overlay-close {
    position: absolute;
    top: 12px;
    right: 12px;
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--theme-text);
}

.account-overlay-description {
    margin: 0;
    color: var(--rgba-0-0-0-0_6);
    font-size: 14px;
}

.account-overlay-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.account-settings-btn--ghost {
    background: none;
    color: var(--theme-text);
    border: 1px solid var(--theme-border-soft);
}

.password-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.password-input-wrapper input {
    flex: 1 1 auto;
}

.password-visibility-btn {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 6px;
}
