/* Layout menu, name dialog and notices (app/layouts.js). The button itself lives in the chart's
   header and is styled in charting_library/static/modern.css. */

.ql-layout-menu {
    position: fixed;
    z-index: 60;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    font-size: 13px;
}

.ql-lm-head { padding: 12px 14px 10px; border-bottom: 1px solid var(--border); }
.ql-lm-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ql-lm-status { margin-top: 2px; font-size: 12px; color: var(--text-muted); }
.ql-lm-status.is-error { color: var(--down); }
.ql-lm-status.is-dirty { color: #f59e0b; }

.ql-lm-actions { padding: 6px; border-bottom: 1px solid var(--border); }
.ql-lm-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.ql-lm-item:hover, .ql-lm-item:focus-visible { background: var(--surface-2); outline: none; }
.ql-lm-item kbd { font: 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text-muted); }
.ql-lm-toggle input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }

.ql-lm-title {
    padding: 10px 14px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.ql-lm-search {
    margin: 0 10px 6px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
}
.ql-lm-search:focus { outline: none; border-color: var(--accent); }

.ql-lm-list { flex: 1; min-height: 0; overflow-y: auto; margin: 0; padding: 0 6px 6px; list-style: none; }
.ql-lm-empty { padding: 10px; color: var(--text-muted); font-size: 12.5px; }
.ql-lm-row { display: flex; align-items: center; border-radius: 8px; }
.ql-lm-row:hover { background: var(--surface-2); }
.ql-lm-row.is-current { background: var(--accent-soft); }
.ql-lm-open {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 7px 10px;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.ql-lm-row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.ql-lm-row.is-current .ql-lm-row-name::after { content: " ✓"; color: var(--accent); }
.ql-lm-row-meta { font-size: 11.5px; color: var(--text-muted); }
.ql-lm-del {
    flex: none;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin-right: 4px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
}
.ql-lm-row:hover .ql-lm-del, .ql-lm-del:focus-visible { opacity: 1; }
.ql-lm-del:hover { color: var(--down); background: var(--down-soft); }
@media (hover: none) { .ql-lm-del { opacity: 1; } }

.ql-lm-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 14px;
    border-top: 1px solid var(--border);
    font-size: 11.5px;
    color: var(--text-muted);
}
.ql-lm-signin {
    flex: none;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: none;
    color: var(--text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

/* Name dialog */
.ql-lm-dialog-back {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.45);
}
.ql-lm-dialog {
    width: min(360px, 100%);
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}
.ql-lm-dialog h3 { margin: 0 0 12px; font-size: 15px; }
.ql-lm-input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: 14px;
}
.ql-lm-input:focus { outline: none; border-color: var(--accent); }
.ql-lm-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.ql-lm-btn {
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: none;
    color: var(--text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.ql-lm-btn.is-primary { border-color: var(--accent); background: var(--accent); color: #fff; }

.ql-lm-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 80;
    max-width: calc(100% - 32px);
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    font-size: 13px;
    transform: translateX(-50%);
    transition: opacity .3s ease;
}
.ql-lm-toast.is-out { opacity: 0; }
