*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --toolbar-height: 48px;
    --sidebar-width: 260px;

    /* Fluent 2 palette */
    --fluent-blue: #0078d4;
    --fluent-blue-hover: #106ebe;
    --fluent-blue-active: #005a9e;
    --fluent-blue-light: #deecf9;
    --fluent-blue-tint: rgba(0,120,212,.08);

    --bg: linear-gradient(160deg, #f0f4fa 0%, #e6eaf2 50%, #dfe4ee 100%);
    --surface: rgba(255,255,255,.72);
    --surface-solid: #ffffff;
    --surface-hover: rgba(255,255,255,.88);
    --surface-card: rgba(255,255,255,.78);

    --text: #1b1b1b;
    --text-secondary: #424242;
    --text-muted: #707070;

    --border: rgba(0,0,0,.06);
    --border-strong: rgba(0,0,0,.12);
    --divider: rgba(0,0,0,.05);

    --danger: #d13438;
    --danger-bg: #fde7e9;
    --success: #107c10;
    --success-bg: #dff6dd;
    --warning: #d48c00;
    --warning-bg: #fff4ce;
    --info-bg: #deecf9;

    --shadow-2: 0 1px 2px rgba(0,0,0,.06), 0 2px 6px rgba(0,0,0,.04);
    --shadow-4: 0 2px 4px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.06);
    --shadow-8: 0 4px 8px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.08);
    --shadow-16: 0 8px 16px rgba(0,0,0,.06), 0 16px 48px rgba(0,0,0,.10);

    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --transition: 200ms cubic-bezier(.33,0,.67,1);
    --transition-fast: 120ms cubic-bezier(.33,0,.67,1);
}

/* Base */
body {
    font-family: 'Segoe UI Variable', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    background: var(--bg);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.5;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* ─── Toolbar (Acrylic) ─── */
.toolbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--toolbar-height);
    background: rgba(255,255,255,.68);
    backdrop-filter: blur(24px) saturate(1.8);
    -webkit-backdrop-filter: blur(24px) saturate(1.8);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 1000;
    gap: 10px;
}

.toolbar__hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}
.toolbar__hamburger:hover { background: var(--fluent-blue-tint); }

.toolbar__logo {
    height: 28px;
    width: 28px;
    border-radius: 5px;
    object-fit: contain;
    flex-shrink: 0;
}

.toolbar__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    flex: 1;
    letter-spacing: -.02em;
}

.toolbar__user { position: relative; }

.toolbar__user-btn {
    background: var(--fluent-blue);
    border: none;
    color: #fff;
    font-size: 13px;
    width: 32px; height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: box-shadow var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.toolbar__user-btn:hover { box-shadow: 0 0 0 2px var(--fluent-blue-light); }

.toolbar__dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: var(--surface-solid);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-16);
    min-width: 220px;
    padding: 4px;
    z-index: 1001;
}
.toolbar__dropdown.open { display: block; }

.toolbar__user-info {
    padding: 12px 14px 10px;
    border-bottom: 1px solid var(--divider);
    font-size: 13px;
    color: var(--text-secondary);
}

.toolbar__dropdown-item {
    display: flex;
    align-items: center;
    padding: 9px 14px;
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}
.toolbar__dropdown-item:hover { background: var(--fluent-blue-tint); }

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px; height: 18px;
    padding: 0 5px;
    border-radius: 10px;
    margin-left: 6px;
}
.badge:empty { display: none; }

/* ─── Sidebar (Acrylic) ─── */
.sidebar {
    position: fixed;
    top: var(--toolbar-height);
    left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: rgba(243,243,243,.60);
    backdrop-filter: blur(40px) saturate(1.4);
    -webkit-backdrop-filter: blur(40px) saturate(1.4);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    z-index: 999;
    padding: 12px 0;
}

.sidebar__nav { list-style: none; }

.sidebar__nav > li > a {
    display: flex;
    align-items: center;
    padding: 8px 16px 8px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin-right: 8px;
    transition: background var(--transition-fast), color var(--transition-fast);
    border-left: 3px solid transparent;
}
.sidebar__nav > li > a:hover {
    background: rgba(0,120,212,.06);
    color: var(--text);
}
.sidebar__nav > li > a.active {
    background: var(--fluent-blue-tint);
    color: var(--fluent-blue);
    border-left-color: var(--fluent-blue);
    font-weight: 600;
}

.sidebar__section-title {
    display: block;
    padding: 18px 20px 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    font-weight: 600;
}

.sidebar__section ul { list-style: none; }
.sidebar__section ul a {
    display: flex;
    align-items: center;
    padding: 8px 16px 8px 28px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin-right: 8px;
    transition: background var(--transition-fast), color var(--transition-fast);
    border-left: 3px solid transparent;
}
.sidebar__section ul a:hover {
    background: rgba(0,120,212,.06);
    color: var(--text);
}
.sidebar__section ul a.active {
    background: var(--fluent-blue-tint);
    color: var(--fluent-blue);
    border-left-color: var(--fluent-blue);
    font-weight: 600;
}

/* Sidebar icons */
.sidebar__nav i.bi,
.sidebar__section-title i.bi,
.sidebar__section ul i.bi { margin-right: 8px; font-size: 15px; }

/* ─── Content area ─── */
.content {
    margin-left: var(--sidebar-width);
    margin-top: var(--toolbar-height);
    padding: 24px 28px;
    min-height: calc(100vh - var(--toolbar-height));
}

/* ─── Mobile ─── */
@media (max-width: 768px) {
    .toolbar__hamburger { display: block; }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 300ms cubic-bezier(.4,0,.2,1);
    }
    .sidebar.open { transform: translateX(0); }
    .content { margin-left: 0; padding: 16px; }
    .master-detail { flex-direction: column !important; }
    .master-detail__list { width: 100% !important; max-height: 300px; }
    .master-detail__detail { width: 100% !important; }
}

/* ─── Cards (Acrylic) ─── */
.card {
    background: var(--surface-card);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-2);
    transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow-4); }

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 16px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    text-decoration: none;
    transition: background var(--transition-fast), box-shadow var(--transition-fast), transform 100ms;
    line-height: 1.4;
    white-space: nowrap;
}
.btn:active { transform: scale(.98); }

.btn--primary { background: var(--fluent-blue); color: #fff; box-shadow: 0 1px 2px rgba(0,120,212,.20); }
.btn--primary:hover { background: var(--fluent-blue-hover); }
.btn--primary:active { background: var(--fluent-blue-active); }

.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: #c50f1f; }

.btn--success { background: var(--success); color: #fff; }
.btn--success:hover { background: #0e6a0e; }

.btn--outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text-secondary); }
.btn--outline:hover { background: rgba(0,0,0,.03); border-color: rgba(0,0,0,.18); }

.btn--subtle { background: transparent; color: var(--fluent-blue); }
.btn--subtle:hover { background: var(--fluent-blue-tint); }

.btn--small { padding: 4px 10px; font-size: 12px; }

/* ─── Forms ─── */
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 7px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    color: var(--text);
    background: var(--surface-solid);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--fluent-blue);
    box-shadow: 0 0 0 1px var(--fluent-blue);
}
.form-group textarea { min-height: 120px; resize: vertical; }
.form-group select { cursor: pointer; }

/* ─── Tables ─── */
table { width: 100%; border-collapse: collapse; border-radius: var(--radius); overflow: hidden; }
thead { background: rgba(0,0,0,.02); }
th {
    padding: 10px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--border-strong);
}
td {
    padding: 10px 14px;
    text-align: left;
    font-size: 13px;
    border-bottom: 1px solid var(--divider);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(0,120,212,.03); }

table a { color: var(--fluent-blue); text-decoration: none; font-weight: 500; }
table a:hover { text-decoration: underline; }

/* ─── Typography ─── */
h1 { font-size: 22px; font-weight: 600; margin-bottom: 16px; letter-spacing: -.02em; }
h2 { font-size: 17px; font-weight: 600; margin-bottom: 12px; letter-spacing: -.01em; }

/* ─── Alerts ─── */
.alert { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.alert--success { background: var(--success-bg); color: #0b5a08; }
.alert--error { background: var(--danger-bg); color: #a80000; }
.alert--info { background: var(--info-bg); color: #004578; }
.alert--warning { background: var(--warning-bg); color: #8a6914; }

/* ─── Login / Accept-invite ─── */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 14px;
    background: var(--bg);
    background-attachment: fixed;
}
.login-container h1 { font-size: 26px; font-weight: 700; letter-spacing: -.03em; margin-bottom: 4px; }

.login-logo { width: 64px; height: 64px; border-radius: var(--radius-lg); margin-bottom: 4px; }

.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 280px;
    padding: 11px 20px;
    text-align: center;
    border-radius: var(--radius);
    font-size: 14px;
    text-decoration: none;
    font-weight: 500;
    transition: box-shadow var(--transition), transform 100ms;
}
.login-btn:hover { box-shadow: var(--shadow-4); }
.login-btn:active { transform: scale(.98); }

.login-btn--google { background: var(--surface-solid); border: 1px solid var(--border-strong); color: var(--text); }
.login-btn--microsoft { background: #2f2f2f; color: #fff; }

/* ─── Master-Detail layout ─── */
.master-detail { display: flex; gap: 20px; min-height: calc(100vh - var(--toolbar-height) - 100px); }

.master-detail__list { width: 340px; flex-shrink: 0; overflow-y: auto; }
.master-detail__detail { flex: 1; min-width: 0; }

.note-list-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition-fast);
    border: 1px solid transparent;
    margin-bottom: 2px;
}
.note-list-item:hover { background: rgba(0,120,212,.04); }
.note-list-item--active { background: var(--fluent-blue-tint); border-color: var(--fluent-blue); }

.note-list-item__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.note-list-item__meta {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    gap: 8px;
    align-items: center;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.status-badge--draft { background: var(--warning-bg); color: var(--warning); }
.status-badge--published { background: var(--success-bg); color: var(--success); }
.status-badge--reads { background: rgba(0, 120, 212, .1); color: #0078d4; font-variant-numeric: tabular-nums; }

/* ─── Note detail panel ─── */
.note-detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.note-detail-header h2 { margin-bottom: 0; }
.note-detail-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }

.attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 6px;
    background: rgba(255,255,255,.5);
    transition: background var(--transition-fast);
    font-size: 13px;
}
.attachment-item:hover { background: rgba(255,255,255,.85); }

.attachment-item__name {
    flex: 1;
    color: var(--fluent-blue);
    font-weight: 500;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.attachment-item__name:hover { text-decoration: underline; }

.attachment-item__size { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }

/* ─── Note body ─── */
.note-body { line-height: 1.7; font-size: 14px; color: var(--text-secondary); }

/* ─── Section dividers ─── */
.section-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    margin: 20px 0 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--divider);
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.22); }

::selection { background: var(--fluent-blue-light); }

/* ─── Quill editor integration ─── */
.ql-toolbar.ql-snow { border: 1px solid var(--border-strong); border-radius: 8px 8px 0 0; background: var(--surface-solid); }
.ql-container.ql-snow { border: 1px solid var(--border-strong); border-top: none; border-radius: 0 0 8px 8px; font-family: 'Segoe UI', sans-serif; font-size: 14px; background: var(--surface-solid); }
.ql-editor { min-height: 150px; }
.ql-editor:focus { outline: none; }

/* Note body rendering for HTML content */
.note-body h1, .note-body h2, .note-body h3 { margin: 12px 0 6px; }
.note-body ul, .note-body ol { padding-left: 20px; margin: 8px 0; }
.note-body a { color: var(--fluent-blue); text-decoration: underline; }

/* ─── Notes page layout ─── */
.notes-page { display: flex; gap: 20px; }
.notes-page__sidebar { width: 260px; flex-shrink: 0; }
.notes-page__list { flex: 1; min-width: 0; }

.notes-filter-select {
    width: 100%;
    padding: 7px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    color: var(--text);
    background: var(--surface-solid);
    cursor: pointer;
    outline: none;
}
.notes-filter-select:focus { border-color: var(--fluent-blue); box-shadow: 0 0 0 1px var(--fluent-blue); }

@media (max-width: 768px) {
    .notes-page { flex-direction: column; }
    .notes-page__sidebar { width: 100%; }
}

/* ─── Calendar ─── */
.notes-calendar { padding: 14px; }

.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.cal-header__title { font-size: 14px; font-weight: 600; color: var(--text); }

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.cal-day-header {
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    padding: 4px 0;
}

.cal-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    position: relative;
    min-height: 28px;
}

.cal-cell--day {
    cursor: pointer;
    transition: background var(--transition-fast);
}
.cal-cell--day:hover { background: var(--fluent-blue-tint); }

.cal-cell__num { font-size: 12px; color: var(--text-secondary); line-height: 1; }

.cal-cell--today { background: rgba(0,120,212,.06); }
.cal-cell--today .cal-cell__num { color: var(--fluent-blue); font-weight: 700; }

.cal-cell--selected { background: var(--fluent-blue) !important; }
.cal-cell--selected .cal-cell__num { color: #fff !important; font-weight: 600; }
.cal-cell--selected .cal-cell__dot { background: #fff !important; }

.cal-cell__dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--fluent-blue);
    position: absolute;
    bottom: 3px;
}

/* ─── Month group headers ─── */
.notes-month-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 4px 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    border-bottom: 2px solid var(--fluent-blue);
    margin-bottom: 8px;
    margin-top: 16px;
    position: sticky;
    top: 0;
    background: linear-gradient(160deg, #f0f4fa, #e6eaf2);
    z-index: 1;
}
.notes-month-header:first-child { margin-top: 0; }
.notes-month-header__count { font-size: 12px; font-weight: 400; color: var(--text-muted); }

/* ─── Note cards (user list) ─── */
.note-card-link { text-decoration: none; color: inherit; display: block; }

.note-card {
    display: flex;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 6px;
    background: var(--surface-card);
    backdrop-filter: blur(20px);
    transition: box-shadow var(--transition), transform 100ms, border-color var(--transition-fast);
}
.note-card:hover { box-shadow: var(--shadow-4); border-color: var(--fluent-blue); transform: translateY(-1px); }

.note-card__date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 4px 0;
    border-radius: var(--radius-sm);
    background: var(--fluent-blue-tint);
}
.note-card__day { font-size: 20px; font-weight: 700; color: var(--fluent-blue); line-height: 1.1; }
.note-card__month-abbr { font-size: 10px; text-transform: uppercase; color: var(--fluent-blue); font-weight: 600; letter-spacing: .04em; }

.note-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.note-card__title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-card__meta { display: flex; gap: 10px; font-size: 12px; color: var(--text-muted); align-items: center; }
.note-card__category { background: rgba(0,0,0,.04); padding: 1px 8px; border-radius: 10px; font-weight: 500; }

/* ─── Cross-reference links ─── */
.note-body a[href^="/notes/"] {
    color: var(--fluent-blue);
    background: var(--fluent-blue-tint);
    padding: 1px 6px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
}
.note-body a[href^="/notes/"]:hover {
    background: var(--fluent-blue-light);
    text-decoration: none;
}

/* ─── Video player ─── */
.video-player-wrapper {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 12px;
    background: rgba(255,255,255,.5);
}
.video-player-wrapper__title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}
.video-player-wrapper__progress {
    height: 4px;
    background: var(--border-strong);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}
.video-player-wrapper__progress-bar {
    height: 100%;
    background: var(--fluent-blue);
    border-radius: 2px;
    transition: width 1s linear;
}

/* ─── Note ref search dialog ─── */
.note-ref-dialog-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.3);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.note-ref-dialog {
    background: var(--surface-solid);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-16);
    width: 420px;
    max-height: 400px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.note-ref-dialog__input {
    padding: 14px 16px;
    border: none;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    outline: none;
    font-family: inherit;
}
.note-ref-dialog__results {
    flex: 1;
    overflow-y: auto;
    padding: 4px;
}
.note-ref-dialog__item {
    padding: 10px 14px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 13px;
    display: flex;
    gap: 8px;
    align-items: center;
}
.note-ref-dialog__item:hover {
    background: var(--fluent-blue-tint);
}
.note-ref-dialog__num {
    color: var(--fluent-blue);
    font-weight: 700;
    flex-shrink: 0;
}

/* === App Launcher === */
.app-launcher { position: relative; margin-left: auto; flex-shrink: 0; }
.app-launcher-btn {
    background: none; border: none; cursor: pointer; padding: 6px;
    border-radius: var(--radius-sm); color: var(--text-muted); font-size: 1.2rem;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
}
.app-launcher-btn:hover { background: var(--hover-bg); color: var(--fluent-blue); }
.app-launcher-menu {
    display: none; position: absolute; top: 100%; right: 0; margin-top: 4px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); box-shadow: 0 8px 32px rgba(0,0,0,0.14);
    z-index: 200; padding: 12px;
    /* Griglia di app */
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 4px; width: 340px; max-height: 400px; overflow-y: auto;
}
.app-launcher-menu.open { display: grid; }
.app-launcher-item {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 10px 6px; border-radius: var(--radius-sm); color: var(--text-primary);
    text-decoration: none; transition: background .15s; text-align: center;
}
.app-launcher-item:hover { background: var(--hover-bg); color: var(--fluent-blue); }
.app-launcher-icon {
    width: 48px; height: 48px; background: var(--hover-bg); border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; color: var(--fluent-blue); flex-shrink: 0; overflow: hidden;
}
.app-launcher-icon img { width: 100%; height: 100%; object-fit: contain; }
.app-launcher-label {
    font-size: .7rem; font-weight: 500; line-height: 1.2;
    max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
