/* ============================================================================
 * Finance Manager - app-specific overrides (loaded after the SixOrbit bundles).
 * ==========================================================================*/

/* Brand mark (the favicon SVG) reused as the logo. In the sidebar it fills the
   40x40 tile; the SVG already carries its own rounded blue background. */
.so-sidebar-logo {
    background: transparent;
    padding: 0;
    overflow: hidden;
}
.so-sidebar-logo-img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    display: block;
}
/* Auth screen: square brand mark, centred above the app name. */
.so-customer-logo-img {
    width: 80px;
    height: 80px;
    margin: 0 auto 8px;
    display: block;
    border-radius: 16px;
}

/* Sidebar footer: the row is sized for up to 4 buttons, evenly distributed
   across the full width (the framework default). Each button stays a compact
   square instead of stretching to fill its share. */
.so-sidebar-footer-buttons {
    justify-content: space-around;
    gap: 4px;
}

/* The logout <form> wrapper must not become a flex item itself — let its
   button sit directly in the footer-buttons flex row. */
.so-sidebar-logout-form {
    display: contents;
}

.so-sidebar-footer-btn {
    flex: 0 0 auto;
    width: 32px;
}

/* Collapsed rail (56px): show only ONE button (the theme toggle), centred —
   matching the reference. The framework already hides all footer buttons;
   we reveal just the theme toggle and keep the rest for the hover state. */
.so-sidebar.so-collapsed .so-sidebar-footer-buttons {
    justify-content: center;
}
.so-sidebar.so-collapsed #sidebarThemeBtn {
    display: flex;
    flex: 0 0 auto;
    width: 32px;
}

/* On hover the rail expands back to full width — show all actions in a row. */
.so-sidebar.so-collapsed:hover .so-sidebar-footer-buttons {
    justify-content: space-around;
}
.so-sidebar.so-collapsed:hover .so-sidebar-footer-btn {
    display: flex;
    flex: 0 0 auto;
    width: 32px;
}

/* --- Profile avatar -------------------------------------------------------- */
/* Initial fallback fills the avatar button/header circle. */
.so-avatar-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-weight: 600;
    line-height: 1;
    text-transform: uppercase;
}

/* Logout <form> in the profile dropdown footer must not break the flex row. */
.so-navbar-user-logout-form {
    display: contents;
}

/* Uploaded photo fills the circle without distortion. */
.so-navbar-user-btn img,
.so-navbar-user-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}

/* --- Finance tables -------------------------------------------------------- */
/* Archived rows in a SODataTable are dimmed but still readable. */
.fm-row-archived { opacity: .5; }

/* Income / expense amount colours, reused in tables and lists. */
.fm-amt-income { color: var(--so-accent-success); font-weight: 600; }
.fm-amt-expense { color: var(--so-accent-danger); font-weight: 600; }
.fm-amt-transfer { font-weight: 600; }

/* Record-count next to a panel title (rk-old "N records" stat). */
.fm-count-badge {
    font-size: .75rem;
    font-weight: 500;
    opacity: .6;
    white-space: nowrap;
}

/* 365-Day Plan — table row highlights */
.fm-plan-row-done { opacity: .5; }
.fm-plan-row-today { background: color-mix(in srgb, var(--so-primary) 6%, transparent) !important; }

/* 365-Day Plan — LeetCode problem links (so-badge used as anchor) */
a.fm-plan-lc-link { cursor: pointer; white-space: normal; height: auto; line-height: 1.35; padding: 3px 8px; border-radius: 4px; }
a.fm-plan-lc-link:hover { opacity: .8; text-decoration: underline; }
a.fm-plan-lc-link .material-symbols-rounded { font-size: 11px; flex-shrink: 0; }

/* 365-Day Plan — day view notes */
.fm-plan-dv-notes-label { font-weight: 600; font-size: .85rem; margin-bottom: .4rem; }
.fm-plan-dv-notes-ta { resize: none; font-size: .85rem; }
.fm-plan-dv-status { font-size: .75rem; opacity: .6; }

/* Elements that start hidden and are shown/hidden by JS */
.fm-badge-hidden { display: none; }

/* 365-Day Plan — modal layout (replaces inline styles) */
.fm-plan-modal-meta { display: flex; align-items: center; gap: .5rem; margin-bottom: .9rem; flex-wrap: wrap; }
.fm-plan-modal-meta-phase { opacity: .65; font-size: .85rem; }
.fm-plan-modal-meta-duration { margin-left: auto; opacity: .6; font-size: .8rem; }
.fm-plan-modal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: .75rem; margin-bottom: .9rem; font-size: .87rem; }
.fm-plan-modal-grid-label { opacity: .6; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .2rem; }
.fm-plan-modal-grid-val { font-weight: 500; }
/* DSA problem rows live inside the DSA card (no separate panel anymore) */
.fm-plan-dsa-list { display: flex; flex-direction: column; gap: .3rem; margin-top: .45rem; }
.fm-plan-dsa-list:empty { display: none; }
.fm-dsa-prob { display: flex; flex-wrap: nowrap; align-items: center; gap: .3rem .5rem; padding: .15rem .5rem; border: 1px solid color-mix(in srgb, var(--cat, var(--so-primary)) 22%, transparent); border-radius: 7px; background: color-mix(in srgb, var(--cat, var(--so-primary)) 5%, transparent); }
/* plain inline link (no boxed badge), truncates; sits on the same line as pickers */
.fm-dsa-link { flex: 1 1 9rem; min-width: 0; display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 500; color: var(--cat, var(--so-primary)); text-decoration: none; }
.fm-dsa-link:hover { text-decoration: underline; }
.fm-dsa-link .material-symbols-rounded { flex: 0 0 auto; opacity: .7; }
.fm-dsa-link-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-dsa-controls { display: flex; align-items: center; gap: .35rem; flex: 0 0 auto; margin-left: auto; }
/* small SOSelect pickers — sized to content, no wasted width */
.fm-dsa-controls .so-select { min-width: 0; width: auto; }
.fm-dsa-controls .so-select .so-select-trigger { min-width: 5.2rem; }
/* per-problem "Solution help" button (lightbulb) */
.fm-dsa-help-btn { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; border: 1px solid color-mix(in srgb, var(--cat, var(--so-primary)) 30%, transparent); background: color-mix(in srgb, var(--cat, var(--so-primary)) 8%, transparent); color: var(--cat, var(--so-primary)); cursor: pointer; border-radius: 6px; padding: 2px 5px; line-height: 1; }
.fm-dsa-help-btn:hover { background: color-mix(in srgb, var(--cat, var(--so-primary)) 18%, transparent); }
/* LeetCode link in the help modal sits on its own line above the reading */
.fm-mat-modal .fm-dsa-help-lc { display: inline-flex; margin-bottom: .9rem; }
.fm-plan-cards-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .5rem; margin-bottom: 1.1rem; }
@media (max-width: 479px) { .fm-plan-cards-wrap { grid-template-columns: 1fr; } }
/* Allow badge links inside subtask cards to wrap — without this flex: 1 won't shrink below content width */
.fm-plan-cards-wrap .so-checkbox-card-content { min-width: 0; }
/* Icon inside checkbox-card title — consistent opacity without inline styles */
.so-checkbox-card-title .material-symbols-rounded { opacity: .65; margin-right: .25rem; }

/* 365-Day Plan — per-category colour palette (one --cat per learning track).
   Applied to subtask cards, table topic chips/dots, progress pips & schedule. */
.fm-cat-dsa  { --cat: #2563eb; } /* DSA            — blue   */
.fm-cat-sd   { --cat: #7c3aed; } /* System Design  — violet */
.fm-cat-lld  { --cat: #0891b2; } /* LLD            — cyan   */
.fm-cat-os   { --cat: #16a34a; } /* OS             — green  */
.fm-cat-java { --cat: #ea580c; } /* Java           — orange */
.fm-cat-en   { --cat: #ca8a04; } /* English        — gold   */
.fm-cat-beh  { --cat: #db2777; } /* Behavioral     — pink   */

/* Card view — colour the title icon + a left accent bar per category */
.so-checkbox-card-title { display: flex; align-items: center; gap: .25rem; }
.so-checkbox-card.fm-cat-dsa, .so-checkbox-card.fm-cat-sd, .so-checkbox-card.fm-cat-lld,
.so-checkbox-card.fm-cat-os, .so-checkbox-card.fm-cat-java, .so-checkbox-card.fm-cat-en,
.so-checkbox-card.fm-cat-beh {
    border-left: 3px solid var(--cat);
    background: color-mix(in srgb, var(--cat) 7%, transparent);
}
/* Slightly deeper tint when the task is checked, so done cards still read as "this category" */
.so-checkbox-card[class*="fm-cat-"]:has(input:checked) { background: color-mix(in srgb, var(--cat) 14%, transparent); }
.so-checkbox-card[class*="fm-cat-"] .fm-plan-card-title .material-symbols-rounded { color: var(--cat); opacity: 1; }

/* Compact card: checkbox + heading + time in a top row, content full-width below */
.so-checkbox-card.fm-plan-card { flex-direction: column; align-items: stretch; padding: .5rem .6rem; }
.fm-plan-card-head { display: flex; align-items: center; gap: .45rem; }
.fm-plan-card-head input[type="checkbox"] { flex: 0 0 auto; }
.fm-plan-card-head .so-checkbox-box { margin: 0; flex: 0 0 auto; }
.fm-plan-card-title { display: flex; align-items: center; gap: .3rem; flex: 1 1 auto; min-width: 0; font-weight: 600; font-size: .82rem; }
.fm-plan-card-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fm-plan-card .so-checkbox-card-description { font-size: .78rem; opacity: .85; margin: .35rem 0 0; }
.fm-plan-card .fm-plan-mat { margin-top: .45rem; }

/* Per-card clock-time window, pinned to the bottom of each card */
.fm-plan-card-foot { margin-top: auto; padding-top: .45rem; border-top: 1px dashed color-mix(in srgb, var(--cat, var(--so-border)) 30%, transparent); display: flex; align-items: center; gap: .25rem; font-size: .72rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--cat, var(--so-text-muted, #888)); }
.fm-plan-card-foot:empty { display: none; }
.fm-plan-card-foot .material-symbols-rounded { opacity: .8; }

/* Day view / modal split into two sections: DSA alone on the left (narrow), the
   rest in a grid on the right. align-items:flex-start lets each section keep its
   own height — the tall DSA card no longer stretches the other cards. */
.fm-plan-layout { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-start; margin-bottom: 1.1rem; }
.fm-plan-dsa-col { flex: 1 1 320px; max-width: 380px; }
.fm-plan-rest-col { flex: 3 1 420px; margin-bottom: 0; }
@media (max-width: 760px) {
    .fm-plan-dsa-col, .fm-plan-rest-col { flex-basis: 100%; max-width: none; }
}
/* DSA card fills its narrow column; overflow:visible keeps SOSelect dropdowns
   from being clipped, and its problem rows wrap their controls when space is tight. */
.fm-plan-dsa-col .fm-plan-card-dsa { overflow: visible; }
.fm-plan-card-dsa .fm-dsa-prob { flex-wrap: wrap; }

/* 365-Day Plan — per-topic recommended time chip (sits at the end of the card title) */
.fm-plan-time-chip { margin-left: auto; font-size: .7rem; font-weight: 600; line-height: 1; white-space: nowrap; padding: 3px 7px; border-radius: 999px; background: color-mix(in srgb, var(--cat, var(--so-primary)) 14%, transparent); color: var(--cat, var(--so-primary)); }
.fm-plan-time-chip:empty { display: none; }
.fm-plan-time-chip-skip { background: var(--so-surface-2); color: var(--so-text-muted, #888); font-weight: 500; }
/* 365-Day Plan — table-view per-topic time chip + daily total under the Type badge */
.fm-plan-td-topic { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.fm-plan-td-dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--cat, var(--so-primary)); }
/* Truncate long topic text so columns stay a sane width (full text on hover) */
.fm-plan-td-topic-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-plan-td-time { flex-shrink: 0; font-size: .68rem; font-weight: 600; line-height: 1; white-space: nowrap; padding: 2px 6px; border-radius: 999px; background: color-mix(in srgb, var(--cat, var(--so-primary)) 14%, transparent); color: var(--cat, var(--so-primary)); }
.fm-plan-td-time-skip { background: var(--so-surface-2); color: var(--so-text-muted, #888); font-weight: 500; }
.fm-plan-td-total { font-size: .68rem; opacity: .6; margin-top: .25rem; white-space: nowrap; }
/* 365-Day Plan — progress pips: one pip per category, filled in its colour when
   done; empty pips are visible outlined rings. */
.fm-plan-progress { display: flex; align-items: center; gap: .3rem; }
.fm-plan-progress-num { font-size: .75rem; opacity: .65; margin-left: .2rem; }
.fm-pip { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin: 0 1px; background: transparent; box-shadow: inset 0 0 0 1.5px var(--so-border-dark, #cbd5e1); }
.fm-pip-on { box-shadow: none; background: var(--cat, var(--so-primary)); }
/* Time / reading toggles are framework so-btn-groups; these are width hooks only */
.fm-plan-fmt-btn { min-width: 2.6rem; justify-content: center; }
.fm-plan-fmt-modal { margin-left: .6rem; }

/* 365-Day Plan — per-topic study material block (inside each subtask card) */
.fm-plan-mat { margin-top: .5rem; }
.fm-plan-mat-toggle { display: inline-flex; align-items: center; gap: .25rem; border: 1px solid var(--so-border, #e2e8f0); background: transparent; cursor: pointer; font: inherit; font-size: .72rem; font-weight: 600; color: var(--cat, var(--so-primary)); padding: .2rem .5rem; border-radius: 999px; }
.fm-plan-mat-toggle:hover { background: color-mix(in srgb, var(--cat, var(--so-primary)) 8%, transparent); }
.fm-plan-mat-caret { margin-left: .1rem; }
.fm-plan-mat-body { margin-top: .5rem; padding: .55rem .65rem; border: 1px solid var(--so-border, #e2e8f0); border-radius: 8px; background: var(--so-surface-2); font-size: .8rem; }
.fm-plan-mat-empty { opacity: .6; font-size: .78rem; font-style: italic; }
.fm-plan-mat-links { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .5rem; }
a.fm-plan-mat-link { cursor: pointer; height: auto; line-height: 1.3; padding: 3px 8px; white-space: normal; }
.fm-plan-mat-tabs { display: inline-flex; border: 1px solid var(--so-border, #e2e8f0); border-radius: 6px; overflow: hidden; margin-bottom: .5rem; }
.fm-plan-mat-tab { border: none; background: transparent; cursor: pointer; font: inherit; font-size: .7rem; font-weight: 600; padding: .25rem .6rem; color: var(--so-text-muted, #888); }
.fm-plan-mat-tab + .fm-plan-mat-tab { border-left: 1px solid var(--so-border, #e2e8f0); }
.fm-plan-mat-tab.is-active { background: var(--so-primary); color: #fff; }
.fm-plan-mat-read { line-height: 1.5; }
.fm-plan-mat-read .fm-md-h { font-size: .82rem; font-weight: 700; margin: .5rem 0 .25rem; }
.fm-plan-mat-read p { margin: .3rem 0; }
.fm-plan-mat-read ul, .fm-plan-mat-read ol { margin: .3rem 0; padding-left: 1.2rem; }
.fm-plan-mat-read li { margin: .15rem 0; }
.fm-plan-mat-read code { background: var(--so-border-light, rgba(0,0,0,.05)); padding: 1px 4px; border-radius: 3px; font-size: .92em; }

/* 365-Day Plan — Study Material modal: per-topic (category) tabs */
.fm-matm-tabs { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .75rem; }
.fm-matm-tab { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--so-border, #e2e8f0); background: transparent; cursor: pointer; font: inherit; font-size: .74rem; font-weight: 600; padding: .3rem .6rem; border-radius: 999px; color: var(--cat, var(--so-primary)); }
.fm-matm-tab .material-symbols-rounded { color: var(--cat, var(--so-primary)); }
.fm-matm-tab:hover { background: color-mix(in srgb, var(--cat, var(--so-primary)) 8%, transparent); }
.fm-matm-tab.is-active { background: var(--cat, var(--so-primary)); color: #fff; border-color: var(--cat, var(--so-primary)); }
.fm-matm-tab.is-active .material-symbols-rounded { color: #fff; }
.fm-matm-topic { font-weight: 700; font-size: .95rem; margin-bottom: .6rem; }
.fm-matm-content { font-size: .9rem; line-height: 1.6; }
/* Slightly larger reading inside the modal than the old inline card */
.fm-matm-content .fm-plan-mat-read .fm-md-h { font-size: 1rem; }
/* Full-screen material modal: scrollable body, content uses the full width.
   The reading flows into multiple columns so wide screens aren't wasted while
   each line stays a readable length. */
.fm-mat-modal .so-modal-body { overflow-y: auto; }
.fm-mat-modal .fm-matm-content { max-width: none; }
.fm-mat-modal .fm-matm-topic { font-size: 1.15rem; }
.fm-mat-modal .fm-plan-mat-read { column-width: 30rem; column-gap: 2.75rem; }
.fm-mat-modal .fm-plan-mat-read > * { break-inside: avoid; }
.fm-mat-modal .fm-plan-mat-read li { break-inside: avoid; }
.fm-mat-modal .fm-plan-mat-read .fm-md-h { break-after: avoid-column; break-before: auto; }
/* First heading shouldn't push a blank gap at the top of column 1 */
.fm-mat-modal .fm-plan-mat-read > .fm-md-h:first-child { margin-top: 0; }

/* ── Study-material modal: richer reading design ──────────────────────────── */
/* Reading-detail toggle in the header (same look as the min/h:m time toggle) */
.fm-matm-readtoggle { margin-left: auto; margin-right: .6rem; flex: 0 0 auto; }
.fm-matm-readtoggle .fm-plan-read-btn:disabled { opacity: .45; pointer-events: none; }
/* Material modal: day navigation row */
.fm-mat-modal .fm-matm-nav { display: flex; align-items: center; gap: .4rem; margin-bottom: .9rem; flex-wrap: wrap; }
.fm-mat-modal .fm-matm-daylabel { margin-left: .4rem; font-weight: 600; font-size: .85rem; opacity: .75; }
/* Topic title with a category accent bar */
.fm-mat-modal .fm-matm-topic { font-size: 1.35rem; font-weight: 800; padding-left: .7rem; border-left: 4px solid var(--cat, var(--so-primary)); }
/* Resource links as raised buttons (YouTube red, website = category colour) */
.fm-mat-modal .fm-plan-mat-links { gap: .6rem; margin-bottom: 1.1rem; }
.fm-mat-modal a.fm-plan-mat-link { display: inline-flex; align-items: center; gap: .45rem; padding: .55rem .9rem; border-radius: 10px; font-size: .82rem; font-weight: 600; border: 1px solid var(--so-border, #e2e8f0); background: var(--so-surface, #fff); box-shadow: 0 1px 2px rgba(0,0,0,.05); transition: transform .1s ease, box-shadow .1s ease; }
.fm-mat-modal a.fm-plan-mat-link:hover { box-shadow: 0 4px 10px rgba(0,0,0,.12); text-decoration: none; }
.fm-mat-modal a.fm-mat-link-yt  { color: #c4302b; border-color: color-mix(in srgb, #c4302b 35%, transparent); background: color-mix(in srgb, #c4302b 7%, transparent); }
.fm-mat-modal a.fm-mat-link-web { color: var(--cat, var(--so-primary)); border-color: color-mix(in srgb, var(--cat, var(--so-primary)) 35%, transparent); background: color-mix(in srgb, var(--cat, var(--so-primary)) 7%, transparent); }
.fm-mat-modal a.fm-plan-mat-link .material-symbols-rounded { font-size: 18px; }
/* Reading typography — category-coloured headings, accent bullets, callout */
.fm-mat-modal .fm-plan-mat-read { font-size: .9rem; line-height: 1.65; }
.fm-mat-modal .fm-plan-mat-read .fm-md-h { color: var(--cat, var(--so-primary)); font-size: 1.02rem; font-weight: 700; margin: 1.1rem 0 .5rem; padding-bottom: .25rem; border-bottom: 2px solid color-mix(in srgb, var(--cat, var(--so-primary)) 25%, transparent); }
.fm-mat-modal .fm-plan-mat-read ul { list-style: none; padding-left: 0; margin: .4rem 0; }
.fm-mat-modal .fm-plan-mat-read ul > li { position: relative; padding-left: 1.3rem; margin: .42rem 0; }
.fm-mat-modal .fm-plan-mat-read ul > li::before { content: ''; position: absolute; left: .3rem; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--cat, var(--so-primary)); }
.fm-mat-modal .fm-plan-mat-read ol { padding-left: 1.4rem; margin: .4rem 0; }
.fm-mat-modal .fm-plan-mat-read ol > li { margin: .42rem 0; }
.fm-mat-modal .fm-plan-mat-read ol > li::marker { color: var(--cat, var(--so-primary)); font-weight: 700; }
.fm-mat-modal .fm-plan-mat-read code { background: color-mix(in srgb, var(--cat, var(--so-primary)) 12%, transparent); color: var(--cat, var(--so-primary)); padding: 1px 5px; border-radius: 4px; font-size: .88em; }
/* Interview-takeaway / key-insight callout */
.fm-mat-modal .fm-mat-callout { break-inside: avoid; margin: .9rem 0; padding: .7rem .9rem; background: color-mix(in srgb, var(--cat, var(--so-primary)) 10%, transparent); border-left: 4px solid var(--cat, var(--so-primary)); border-radius: 8px; font-size: .9rem; }
/* Markdown tables in the reading material */
.fm-mat-modal .fm-md-table-wrap { break-inside: avoid; overflow-x: auto; margin: .8rem 0; }
.fm-mat-modal .fm-md-table { border-collapse: collapse; width: 100%; font-size: .85rem; }
.fm-mat-modal .fm-md-table th, .fm-mat-modal .fm-md-table td { border: 1px solid var(--so-border, #e2e8f0); padding: .4rem .6rem; text-align: left; vertical-align: top; }
.fm-mat-modal .fm-md-table th { background: color-mix(in srgb, var(--cat, var(--so-primary)) 14%, transparent); color: var(--cat, var(--so-primary)); font-weight: 700; white-space: nowrap; }
.fm-mat-modal .fm-md-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--cat, var(--so-primary)) 4%, transparent); }
.fm-mat-modal .fm-md-table code { white-space: nowrap; }
/* Code blocks (highlight.js atom-one-dark theme paints the inner <code>) */
.fm-mat-modal .fm-code { break-inside: avoid; margin: .7rem 0; border-radius: 10px; background: #282c34; border: 1px solid rgba(255,255,255,.08); overflow: auto; }
.fm-mat-modal .fm-code code.hljs { display: block; padding: .85rem 1rem; font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace; font-size: .82rem; line-height: 1.5; background: transparent; }
/* Fallback before hljs runs */
.fm-mat-modal .fm-code code { white-space: pre; color: #abb2bf; }
/* Language switch-group: only the selected-language variant is visible */
.fm-mat-modal .fm-code-group .fm-code[hidden] { display: none; }
.fm-mat-modal .fm-code-fallback { font-size: .72rem; opacity: .7; margin: .7rem 0 -.4rem; padding: .25rem .55rem; border-radius: 6px; background: var(--so-surface-2); display: inline-block; }
/* Header language selector sits beside the reading-detail toggle — keep it
   compact so the modal title never gets squeezed into wrapping. The rendered
   SOSelect (.so-select) must not flex-grow to fill the header. */
.fm-mat-modal .so-modal-header .so-modal-title { white-space: nowrap; }
.fm-mat-modal .so-modal-header .fm-matm-langsel,
.fm-mat-modal .so-modal-header .so-select { flex: 0 0 auto; width: auto; min-width: 0; }
.fm-mat-modal .so-modal-header .so-select .so-select-trigger { min-width: 6.5rem; }
.fm-plan-modal-softskills { font-size: .8rem; opacity: .65; margin-bottom: .9rem; padding: .5rem .65rem; background: var(--so-surface-2); border-radius: 6px; display: flex; flex-direction: column; gap: .3rem; }
.fm-plan-modal-subtasks { margin-bottom: .9rem; }
.fm-plan-modal-subtasks-title { font-weight: 600; font-size: .85rem; margin-bottom: .5rem; }
.fm-plan-modal-subtasks-list { display: flex; flex-direction: column; gap: .25rem; }
.fm-plan-modal-notes-row { display: flex; justify-content: flex-end; align-items: center; gap: .5rem; margin-top: .4rem; }
.fm-plan-modal-notes-status { font-size: .75rem; opacity: .6; }

/* Inline icon size helpers (replaces per-element style="font-size:Npx") */
.fm-icon-xs { font-size: 12px; vertical-align: middle; }
.fm-icon-sm { font-size: 13px; vertical-align: middle; }

/* --- Icon loading skeleton --------------------------------------------------
   While the Material Symbols Rounded font-face hasn't loaded yet, ligature
   strings ("chevron_left", "close", …) would flash as raw text. We prevent
   that by adding html.icons-loading before the <link> is processed, and
   removing it only once document.fonts.load() reports the face is live. */
@keyframes fm-icon-skel { 0%, 100% { opacity: .5 } 50% { opacity: 1 } }
html.icons-loading .material-symbols-rounded {
    display: inline-block;
    width: 1em; height: 1em; line-height: 1;
    overflow: hidden;
    color: transparent !important;
    background: var(--so-border);
    border-radius: 5px;
    vertical-align: middle;
    animation: fm-icon-skel 1.1s ease-in-out infinite;
}

/* ============================================================================
 * FM Notes — Floating notes & reminders widget
 * ========================================================================== */

/* ── FAB ─────────────────────────────────────────────────────────────────── */
.fm-notes-widget {
    position: fixed;
    z-index: 1050;
    display: flex;
    flex-direction: column;
}
.fm-notes-widget.pos-bottom-right { bottom: 24px; right: 24px; align-items: flex-end; }
.fm-notes-widget.pos-bottom-left  { bottom: 24px; left:  24px; align-items: flex-start; }
.fm-notes-widget.pos-top-right    { top:    80px; right: 24px; align-items: flex-end; }
.fm-notes-widget.pos-top-left     { top:    80px; left:  24px; align-items: flex-start; }

.fm-notes-fab {
    width: 50px; height: 50px;
    border-radius: 50%;
    background: var(--so-accent-primary, #6366f1);
    color: #fff;
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(99,102,241,.35);
    transition: box-shadow .18s, transform .18s;
    position: relative;
    flex-shrink: 0;
    font-family: inherit;
}
.fm-notes-fab .material-symbols-rounded { font-size: 22px; }
.fm-notes-fab:hover { box-shadow: 0 6px 18px rgba(99,102,241,.45); }
.fm-notes-widget.is-open .fm-notes-fab { display: none; }

.fm-notes-count {
    position: absolute; top: -4px; right: -4px;
    min-width: 18px; height: 18px; padding: 0 4px;
    background: #ef4444; color: #fff;
    font-size: 10px; font-weight: 700; line-height: 18px;
    border-radius: 9px; text-align: center;
    font-family: inherit;
    pointer-events: none;
}

/* ── Panel ──────────────────────────────────────────────────────────────── */
.fm-notes-panel {
    position: fixed;
    z-index: 1050;
    width: 380px; max-width: calc(100vw - 32px);
    max-height: calc(100vh - 88px);
    background: var(--so-card-bg, #fff);
    border: 1px solid var(--so-border, #e2e8f0);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,.14);
    display: flex; flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    animation: fm-notes-pop .15s ease-out;
}
.fm-notes-widget.pos-bottom-left  .fm-notes-panel { transform-origin: bottom left; }
.fm-notes-widget.pos-top-right    .fm-notes-panel { transform-origin: top right; }
.fm-notes-widget.pos-top-left     .fm-notes-panel { transform-origin: top left; }

@keyframes fm-notes-pop {
    from { opacity: 0; transform: scale(.94); }
    to   { opacity: 1; transform: scale(1);   }
}

.fm-notes-widget.is-full .fm-notes-panel {
    inset: 18px !important;
    width: auto !important; max-width: none !important;
    max-height: none !important; border-radius: 14px;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.fm-notes-head {
    display: flex; align-items: center; gap: 4px;
    padding: 10px 12px 8px;
    border-bottom: 1px solid var(--so-border, #e2e8f0);
    flex-shrink: 0;
    position: relative;
}
.fm-notes-title {
    font-size: 13px; font-weight: 600;
    color: var(--so-text-heading, #1e293b);
    display: flex; align-items: center; gap: 5px;
    flex: 1; min-width: 0;
}
.fm-notes-title .material-symbols-rounded { font-size: 16px; color: var(--so-accent-primary, #6366f1); }
.fm-notes-head-actions { display: flex; align-items: center; gap: 1px; }

.fm-notes-ibtn {
    width: 28px; height: 28px;
    border: none; background: transparent; cursor: pointer;
    border-radius: 6px; display: flex; align-items: center; justify-content: center;
    color: var(--so-text-secondary, #64748b);
    transition: background .14s, color .14s;
    padding: 0; font-family: inherit;
}
.fm-notes-ibtn .material-symbols-rounded { font-size: 17px; }
.fm-notes-ibtn:hover  { background: var(--so-bg-secondary, #f8fafc); color: var(--so-text-heading, #1e293b); }
.fm-notes-ibtn.is-active { color: var(--so-accent-primary, #6366f1); }

/* Position dropdown */
.fm-notes-posmenu {
    position: absolute; top: 44px; right: 10px;
    background: var(--so-card-bg, #fff);
    border: 1px solid var(--so-border, #e2e8f0);
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
    padding: 4px; z-index: 10;
    display: flex; flex-direction: column; gap: 2px;
}
.fm-notes-posopt {
    display: flex; align-items: center; gap: 7px;
    padding: 6px 10px; border-radius: 6px;
    border: none; background: transparent; cursor: pointer;
    font-size: 12.5px; color: var(--so-text-heading, #1e293b);
    white-space: nowrap; font-family: inherit;
}
.fm-notes-posopt .material-symbols-rounded { font-size: 16px; color: var(--so-text-secondary, #64748b); }
.fm-notes-posopt:hover { background: var(--so-bg-secondary, #f8fafc); }

/* ── Add bar ─────────────────────────────────────────────────────────────── */
.fm-notes-add {
    padding: 8px 12px 0;
    flex-shrink: 0;
}
.fm-notes-add .so-btn { width: 100%; justify-content: center; gap: 4px; font-size: 12.5px; }
.fm-notes-add .material-symbols-rounded { font-size: 16px; }

/* ── Create / edit form ─────────────────────────────────────────────────── */
.fm-notes-forms { flex-shrink: 0; }
.fm-notes-form {
    padding: 8px 12px;
    border-bottom: 1px solid var(--so-border, #e2e8f0);
    display: flex; flex-direction: column; gap: 6px;
}
.fm-notes-form [data-f="title"] { font-size: 13px; }

.fm-notes-fc-row {
    display: flex; align-items: center; flex-wrap: wrap; gap: 5px;
}
.fm-notes-fc-label {
    font-size: 11px; font-weight: 500;
    color: var(--so-text-secondary, #64748b);
    white-space: nowrap;
}
.fm-notes-fc-label-ml { margin-left: 6px; }

/* Category chips in form */
.fm-notes-fc-cats { display: flex; flex-wrap: wrap; gap: 4px; }
.fm-notes-fc-cat {
    font-size: 11px; padding: 2px 8px; border-radius: 20px;
    border: 1px solid var(--so-border, #e2e8f0);
    background: var(--so-bg-secondary, #f8fafc);
    color: var(--so-text-secondary, #64748b);
    cursor: pointer; transition: background .12s, color .12s, border-color .12s;
    font-family: inherit;
}
.fm-notes-fc-cat.is-sel {
    background: var(--cat-bg, rgba(99,102,241,.12));
    color: var(--cat-c, #6366f1);
    border-color: var(--cat-c, #6366f1);
    font-weight: 600;
}
.fm-notes-fc-cat:hover:not(.is-sel) { background: var(--so-border, #e2e8f0); }

/* Priority pills in form */
.fm-notes-fc-pris { display: flex; gap: 3px; }
.fm-notes-fc-pri {
    font-size: 11px; padding: 2px 8px; border-radius: 4px;
    border: 1px solid var(--so-border, #e2e8f0);
    background: var(--so-bg-secondary, #f8fafc);
    color: var(--so-text-secondary, #64748b);
    cursor: pointer; transition: background .12s, color .12s;
    font-family: inherit;
}
.fm-notes-fc-pri.is-sel {
    background: rgba(0,0,0,.06);
    color: var(--pri-c, #6366f1);
    border-color: var(--pri-c, #6366f1);
    font-weight: 600;
}
.fm-notes-fc-pri:hover:not(.is-sel) { background: var(--so-border, #e2e8f0); }

/* Colour swatches in form */
.fm-notes-fc-cols { display: flex; gap: 3px; }
.fm-notes-fc-col {
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid transparent; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: border-color .12s, transform .12s;
    flex-shrink: 0; font-family: inherit; padding: 0;
}
.fm-notes-fc-col.is-none {
    background: var(--so-bg-secondary, #f8fafc);
    border-color: var(--so-border, #e2e8f0);
    color: var(--so-text-secondary, #64748b);
}
.fm-notes-fc-col.is-none .material-symbols-rounded { font-size: 12px; }
.fm-notes-fc-col.is-sel  { border-color: var(--so-text-heading, #1e293b); transform: scale(1.2); }
.fm-notes-fc-col:hover:not(.is-sel) { transform: scale(1.15); }

/* Due date input in form */
.fm-notes-fc-date { max-width: 140px; font-size: 12px !important; }
.fm-notes-fc-plain { font-size: 12px !important; }
.fm-notes-fc-plain .so-checkbox-label { font-size: 12px; }

.fm-notes-form-actions {
    display: flex; justify-content: flex-end; gap: 6px;
}

/* ── Body (scrollable list area) ─────────────────────────────────────────── */
.fm-notes-body {
    flex: 1; overflow-y: auto; min-height: 0;
}

/* ── Filter chips ────────────────────────────────────────────────────────── */
.fm-notes-filters {
    display: flex; gap: 4px; padding: 8px 10px 4px; flex-wrap: wrap;
}
.fm-notes-flt {
    display: flex; align-items: center; gap: 4px;
    padding: 3px 9px; border-radius: 20px;
    border: 1px solid var(--so-border, #e2e8f0);
    background: var(--so-bg-secondary, #f8fafc);
    font-size: 11.5px; color: var(--so-text-secondary, #64748b);
    cursor: pointer; transition: background .12s, color .12s, border-color .12s;
    font-family: inherit;
}
.fm-notes-flt .material-symbols-rounded { font-size: 14px; }
.fm-notes-flt-n { font-weight: 600; }
.fm-notes-flt.is-on {
    background: var(--so-accent-primary, #6366f1);
    color: #fff; border-color: var(--so-accent-primary, #6366f1);
}
.fm-notes-flt:hover:not(.is-on) { border-color: var(--so-accent-primary, #6366f1); color: var(--so-accent-primary, #6366f1); }

/* ── Category filter strip ───────────────────────────────────────────────── */
.fm-notes-catstrip {
    display: flex; gap: 4px; padding: 0 10px 6px;
    overflow-x: auto; scrollbar-width: none;
}
.fm-notes-catstrip::-webkit-scrollbar { display: none; }
.fm-notes-catbtn {
    font-size: 11px; padding: 2px 9px; border-radius: 20px;
    border: 1px solid var(--so-border, #e2e8f0);
    background: transparent; color: var(--so-text-secondary, #64748b);
    cursor: pointer; white-space: nowrap; flex-shrink: 0;
    transition: background .12s, color .12s, border-color .12s;
    font-family: inherit;
}
.fm-notes-catbtn.is-on {
    background: currentColor; /* filled with the category color */
    font-weight: 600;
}
/* Override for "All" (no category color) */
.fm-notes-catbtn[data-catfilter=""].is-on {
    background: var(--so-accent-primary, #6366f1);
    color: #fff !important; border-color: var(--so-accent-primary, #6366f1);
}
/* Individual category active uses its color as bg tint */
.fm-notes-catbtn[data-catfilter]:not([data-catfilter=""]).is-on {
    background: transparent;
    font-weight: 700;
    border-width: 2px;
}
.fm-notes-catbtn:hover:not(.is-on) { border-color: currentColor; }

/* ── Search row ──────────────────────────────────────────────────────────── */
.fm-notes-searchrow {
    display: flex; align-items: center; gap: 5px;
    padding: 0 10px 7px;
}
.fm-notes-search-icon {
    font-size: 15px; color: var(--so-text-secondary, #64748b); flex-shrink: 0;
}
.fm-notes-search-input {
    flex: 1; border: none; background: transparent; outline: none;
    font-size: 12.5px; color: var(--so-text-heading, #1e293b);
    font-family: inherit; padding: 0;
    min-width: 0;
}
.fm-notes-search-input::placeholder { color: var(--so-text-secondary, #64748b); }
.fm-notes-search-clear {
    border: none; background: transparent; cursor: pointer; padding: 0;
    color: var(--so-text-secondary, #64748b); display: flex;
    font-family: inherit;
}
.fm-notes-search-clear .material-symbols-rounded { font-size: 15px; }
.fm-notes-search-clear:hover { color: var(--so-text-heading, #1e293b); }

/* ── Note list ───────────────────────────────────────────────────────────── */
.fm-notes-list { padding: 0 8px 10px; }

.fm-notes-divider {
    display: flex; align-items: center;
    margin: 8px 0 4px; padding: 0 4px;
}
.fm-notes-divider::before, .fm-notes-divider::after {
    content: ''; flex: 1; height: 1px;
    background: var(--so-border, #e2e8f0);
}
.fm-notes-divider span {
    padding: 0 8px;
    font-size: 11px; font-weight: 600;
    color: var(--so-text-secondary, #64748b);
    white-space: nowrap;
}
.fm-notes-div-overdue span { color: #dc2626; }
.fm-notes-div-today   span { color: #16a34a; }

.fm-notes-empty {
    text-align: center; padding: 32px 16px;
    color: var(--so-text-secondary, #64748b);
}
.fm-notes-empty .material-symbols-rounded { font-size: 36px; margin-bottom: 8px; display: block; }
.fm-notes-empty p { margin: 4px 0; font-size: 13px; }
.fm-notes-sub { font-size: 12px; }

.fm-notes-hint {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 8px;
    font-size: 12.5px; color: var(--so-text-secondary, #64748b);
}

.fm-notes-more { padding: 6px 0; display: flex; justify-content: center; }
.fm-notes-more .so-btn { gap: 4px; font-size: 12px; }

/* ── Note card ───────────────────────────────────────────────────────────── */
.fm-note {
    display: flex; align-items: flex-start; gap: 4px;
    padding: 7px 6px;
    border: 1px solid var(--so-border, #e2e8f0);
    border-radius: 8px;
    margin-bottom: 4px;
    background: var(--so-card-bg, #fff);
    transition: border-color .15s, box-shadow .15s;
    position: relative;
    /* color accent applied via inline style (border-left + background override) */
}
.fm-note:hover { border-color: var(--so-accent-primary, #6366f1); }
.fm-note.is-done {
    opacity: .62;
}
.fm-note.is-locked {
    border-color: #f59e0b;
    background: rgba(245,158,11,.04);
}
.fm-note.is-archived {
    border-style: dashed;
    opacity: .72;
}

/* Drag handle.
   The row is align-items:flex-start so controls hug the first content line.
   To keep the checkbox / drag / actions vertically centred against that line
   (the action buttons are 28px tall, the title line only ~18px), every
   first-line element shares a 28px band with its content centred. */
.fm-note-drag {
    font-size: 16px; cursor: grab; flex-shrink: 0;
    min-height: 28px; display: flex; align-items: center;
    color: var(--so-text-secondary, #64748b); opacity: .4;
    margin-right: 1px;
}
.fm-note-drag:hover { opacity: .8; }

/* Checkbox / plain icon */
.fm-note-check { flex-shrink: 0; min-height: 28px; display: flex; align-items: center; }
.fm-note-noteic {
    font-size: 15px; color: var(--so-text-secondary, #64748b); flex-shrink: 0;
    min-height: 28px; display: flex; align-items: center;
}

/* Content */
.fm-note-main { flex: 1; min-width: 0; overflow: hidden; }
.fm-note-title {
    font-size: 13px; font-weight: 500;
    color: var(--so-text-heading, #1e293b);
    line-height: 1.4;
    word-break: break-word;
    min-height: 28px; display: flex; align-items: center; flex-wrap: wrap;
}
.fm-note.is-done .fm-note-title-text { text-decoration: line-through; }
.fm-note-untitled { color: var(--so-text-secondary, #64748b); font-style: italic; font-weight: 400; }

.fm-note-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.fm-note-meta-inline { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; vertical-align: middle; }

.fm-note-body {
    font-size: 12px; color: var(--so-text-secondary, #64748b);
    margin-top: 4px; line-height: 1.5; word-break: break-word;
    white-space: pre-wrap;
}

/* Category chip on card */
.fm-note-cat {
    font-size: 10.5px; font-weight: 600; padding: 1px 7px;
    border-radius: 20px; white-space: nowrap;
}

/* Priority badge on card */
.fm-note-pri {
    display: inline-flex; align-items: center; gap: 2px;
    font-size: 10.5px; font-weight: 600; padding: 1px 6px;
    border-radius: 4px; white-space: nowrap;
}
.fm-note-pri .material-symbols-rounded { font-size: 13px; }

/* Due date pill on card */
.fm-note-due {
    display: inline-flex; align-items: center; gap: 2px;
    font-size: 10.5px; font-weight: 500; padding: 1px 6px;
    border-radius: 4px; white-space: nowrap;
    background: var(--so-bg-secondary, #f8fafc);
    color: var(--so-text-secondary, #64748b);
}
.fm-note-due .material-symbols-rounded { font-size: 12px; }
.fm-note-due-today   { background: rgba(22,163,74,.10);  color: #16a34a; }
.fm-note-due-soon    { background: rgba(217,119,6,.10);  color: #d97706; }
.fm-note-due-overdue { background: rgba(220,38,38,.10);  color: #dc2626; }
.fm-note-due-done    { opacity: .5; }

/* Actions column */
.fm-note-actions {
    display: flex; flex-direction: column; gap: 1px; flex-shrink: 0; align-self: flex-start;
    opacity: 0; transition: opacity .15s;
}
.fm-note:hover .fm-note-actions { opacity: 1; }
.fm-note-lockbtn.fm-notes-ibtn { color: #f59e0b; }
.fm-note-delbtn:hover { color: #ef4444 !important; }

/* ── Compact mode ─────────────────────────────────────────────────────────── */
.fm-notes-widget.mode-compact .fm-note { padding: 4px 6px; }
.fm-notes-widget.mode-compact .fm-note-actions { flex-direction: row; opacity: 0; }
.fm-notes-widget.mode-compact .fm-note:hover .fm-note-actions { opacity: 1; }
.fm-notes-widget.mode-compact .fm-note.is-expanded .fm-note-actions { flex-direction: column; opacity: 1; }

/* ── Focused view ─────────────────────────────────────────────────────────── */
/* Header: hide everything except the focus toggle and close button */
.fm-notes-widget.is-focused .fm-notes-head-actions > * { display: none !important; }
.fm-notes-widget.is-focused .fm-notes-head-actions > [data-act="focus"],
.fm-notes-widget.is-focused .fm-notes-head-actions > [data-act="close"] { display: flex !important; }
/* Note cards: hide all per-note chrome */
.fm-notes-widget.is-focused .fm-note-drag    { display: none !important; }
.fm-notes-widget.is-focused .fm-note-check   { display: none !important; }
.fm-notes-widget.is-focused .fm-note-noteic  { display: none !important; }
.fm-notes-widget.is-focused .fm-note-actions { display: none !important; }
/* Panel chrome */
.fm-notes-widget.is-focused .fm-notes-add    { display: none; }
.fm-notes-widget.is-focused .fm-notes-forms  { display: none; }

/* ── Fullscreen grid ─────────────────────────────────────────────────────── */
.fm-notes-widget.is-full .fm-notes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 6px; align-items: start; padding: 8px;
}
.fm-notes-widget.is-full .fm-notes-filters,
.fm-notes-widget.is-full .fm-notes-catstrip,
.fm-notes-widget.is-full .fm-notes-searchrow,
.fm-notes-widget.is-full .fm-notes-divider,
.fm-notes-widget.is-full .fm-notes-empty,
.fm-notes-widget.is-full .fm-notes-more {
    grid-column: 1 / -1;
}

/* ── Toast ───────────────────────────────────────────────────────────────── */
.fm-notes-toast {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 12px; margin: 8px 12px 0;
    border-radius: 7px; font-size: 12.5px; font-weight: 500;
    flex-shrink: 0;
    animation: fm-notes-pop .15s ease-out;
}
.fm-notes-toast-success { background: rgba(22,163,74,.12);  color: #16a34a; }
.fm-notes-toast-error   { background: rgba(220,38,38,.10);  color: #dc2626; }
.fm-notes-toast .material-symbols-rounded { font-size: 16px; flex-shrink: 0; }

/* ── Multi-select & lock ─────────────────────────────────────────────────── */
/* Selection checkbox on each card. The whole card is the click target (see
   .is-selecting below), so the checkbox itself is non-interactive. */
.fm-notes-selbox {
    flex-shrink: 0; min-height: 28px;
    display: flex; align-items: center;
    pointer-events: none;
}
.fm-note.is-selected {
    border-color: var(--so-accent-primary, #6366f1);
    background: rgba(99,102,241,.06);
    box-shadow: inset 0 0 0 1px var(--so-accent-primary, #6366f1);
}
/* In select mode the card is a single click target — hide the normal controls. */
.fm-notes-widget.is-selecting .fm-note { cursor: pointer; }
.fm-notes-widget.is-selecting .fm-note-drag,
.fm-notes-widget.is-selecting .fm-note-check,
.fm-notes-widget.is-selecting .fm-note-noteic,
.fm-notes-widget.is-selecting .fm-note-actions { display: none !important; }

/* Selection action bar (panel footer) */
.fm-notes-selbar {
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 8px 12px;
    border-top: 1px solid var(--so-border, #e2e8f0);
    background: var(--so-bg-secondary, #f8fafc);
}
.fm-notes-selbar-info {
    display: flex; align-items: center; gap: 5px;
    font-size: 12.5px; font-weight: 600;
    color: var(--so-text-heading, #1e293b);
}
.fm-notes-selbar-info .material-symbols-rounded { font-size: 16px; color: var(--so-accent-primary, #6366f1); }
.fm-notes-selbar-acts { display: flex; gap: 6px; }
.fm-notes-selbar-acts .so-btn { gap: 3px; font-size: 12px; }
.fm-notes-selbar-acts .material-symbols-rounded { font-size: 15px; }

/* Password re-auth modal body */
.fm-notes-auth-msg {
    margin: 0 0 10px; font-size: 13px; line-height: 1.5;
    color: var(--so-text-secondary, #64748b);
}
.fm-notes-auth .so-form-label { font-size: 12px; }
.fm-notes-auth-err {
    margin-top: 8px; font-size: 12px; font-weight: 500;
    color: #dc2626;
}

/* ── Loading overlay ─────────────────────────────────────────────────────── */
.fm-notes-loading {
    position: absolute; inset: 0; z-index: 5;
    background: rgba(255,255,255,.6);
    display: flex; align-items: center; justify-content: center;
    border-radius: 14px;
    pointer-events: none;
}
[data-theme="dark"] .fm-notes-loading { background: rgba(15,23,42,.55); }

/* ── Spin animation (refresh icon) ──────────────────────────────────────── */
@keyframes fm-spin { to { transform: rotate(360deg); } }
.fm-spin { animation: fm-spin .7s linear infinite; display: inline-block; }

/* ── Dark mode ───────────────────────────────────────────────────────────── */
[data-theme="dark"] .fm-notes-panel {
    background: var(--so-card-bg, #1e293b);
    border-color: var(--so-border, #334155);
    box-shadow: 0 12px 40px rgba(0,0,0,.4);
}
[data-theme="dark"] .fm-notes-head   { border-color: var(--so-border, #334155); }
[data-theme="dark"] .fm-notes-form   { border-color: var(--so-border, #334155); }
[data-theme="dark"] .fm-note         { background: var(--so-card-bg, #1e293b); border-color: var(--so-border, #334155); }
[data-theme="dark"] .fm-note.is-locked { background: rgba(245,158,11,.06); }
[data-theme="dark"] .fm-note.is-selected { background: rgba(99,102,241,.14); }
[data-theme="dark"] .fm-notes-selbar { background: rgba(255,255,255,.03); border-color: var(--so-border, #334155); }
[data-theme="dark"] .fm-notes-loading { background: rgba(15,23,42,.7); }
[data-theme="dark"] .fm-notes-posmenu { background: var(--so-card-bg, #1e293b); border-color: var(--so-border, #334155); }
[data-theme="dark"] .fm-notes-fc-cat  { background: var(--so-bg-secondary, #0f172a); border-color: var(--so-border, #334155); }
[data-theme="dark"] .fm-notes-fc-pri  { background: var(--so-bg-secondary, #0f172a); border-color: var(--so-border, #334155); }

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .fm-notes-panel { width: calc(100vw - 28px) !important; }
}

/* ============================================================================
 * Mobile / tablet sidebar drawer fix.
 *
 * The SixOrbit bundle ships TWO competing mobile layouts:
 *   1. @media (max-width:767px)  → a translateX drawer on `.so-sidebar`
 *      (this is what our topbar hamburger + fm-layout.js `.so-open` toggle and
 *      the `.so-sidebar-overlay` element are built for).
 *   2. @media (max-width:1023px) → `.so-sidebar { display:none !important }`
 *      plus `.so-sidebar-overlay { display:none !important }`. This assumes a
 *      SEPARATE `.so-drawer-sidebar` element that we don't render.
 * Rule 2 loads later and uses !important, so on every screen ≤1023px the
 * sidebar is force-hidden: the hamburger toggles `.so-open` but nothing ever
 * appears. We re-enable the drawer on `.so-sidebar` itself across the full
 * ≤1023px range (matching where the hamburger shows). app.css loads last, so
 * these win the cascade.
 * ========================================================================== */
@media (max-width: 1023px) {
    /* Beat rule 2's `display:none !important` and slide off-canvas by default. */
    .so-sidebar {
        display: flex !important;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 16px rgba(0, 0, 0, 0.18);
        /* Sit ABOVE the overlay (1045) — the framework leaves the sidebar at
           1040, which would let the dimmer cover the open drawer. */
        z-index: 1050 !important;
    }
    .so-sidebar.so-open {
        transform: translateX(0);
    }

    /* A desktop-collapsed (icon-rail) state is meaningless in the drawer:
       force full width + visible labels so the menu is usable. */
    .so-sidebar.so-collapsed {
        width: 280px;
    }
    .so-sidebar.so-collapsed .so-sidebar-text,
    .so-sidebar.so-collapsed .so-sidebar-brand-info,
    .so-sidebar.so-collapsed .so-sidebar-arrow {
        opacity: 1 !important;
        visibility: visible !important;
    }
    /* The pin/collapse radio toggle has no meaning in drawer mode. */
    .so-sidebar .so-sidebar-toggle {
        display: none !important;
    }

    /* Dimmer behind the open drawer. Base hidden; `.so-active` (added by
       fm-layout.js) reveals it and out-specifies rule 2's hide. */
    .so-sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1045;
        display: none !important;
    }
    .so-sidebar-overlay.so-active {
        display: block !important;
    }

    /* Freeze the page behind the open drawer (set by fm-layout.js). */
    body.fm-drawer-open {
        overflow: hidden;
    }
}

/* ============================================================================
 * Page-content responsiveness.
 *
 * The SixOrbit grid utilities (`.so-grid-cols-4`, etc.) are NOT responsive on
 * their own — the framework expects per-breakpoint variants (`.so-grid-cols-sm-2`)
 * that our views don't apply, so multi-column tiles stay N-up even at 375px.
 * Rather than touch every view, collapse the grids inside the page body here.
 * Scoped to `.so-page-body` so framework component internals are untouched.
 * ========================================================================== */
@media (max-width: 767px) {
    .so-page-body .so-grid-cols-4,
    .so-page-body .so-grid-cols-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}
@media (max-width: 480px) {
    .so-page-body .so-grid-cols-4,
    .so-page-body .so-grid-cols-3,
    .so-page-body .so-grid-cols-2 {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

/* Settings page: the inline `grid-template-columns:240px 1fr` leaves almost no
   room for the content panel on a phone — stack the tab nav above the panel. */
@media (max-width: 640px) {
    .fm-settings-layout {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

/* List-page panel header: the date-range picker is `min-width:268px`, which
   overflows narrow screens. Let it (and the action row) take the full width
   below the title instead of being crammed onto the same line. */
@media (max-width: 575px) {
    .so-card-header-actions {
        width: 100%;
    }
    .so-card-header-actions .so-panel-datepicker {
        min-width: 0 !important;
        flex: 1 1 100%;
    }
}

/* ════════ No translate-based motion (per request) ═══════════════════════════
   Keep static positioning transforms (e.g. translate(-50%,-50%) centering) but
   remove translate from anything that animates. Two parts:
   1) strip `transform` from every transition so nothing slides on hover/state;
   2) redefine the framework entrance keyframes to fade only (no translate).
   Transient attention effects (shake/bounce) and spinners are left untouched so
   modal centering and loaders keep working. */
*, *::before, *::after {
    transition-property: opacity, color, background-color, border-color, box-shadow,
        fill, stroke, width, height, max-height, min-height, padding, margin,
        top, right, bottom, left, filter, outline-color !important;
}
@keyframes so-fade-in-up    { from { opacity: 0; } to { opacity: 1; } }
@keyframes so-fade-in-down  { from { opacity: 0; } to { opacity: 1; } }
@keyframes so-fade-in-left  { from { opacity: 0; } to { opacity: 1; } }
@keyframes so-fade-in-right { from { opacity: 0; } to { opacity: 1; } }
@keyframes so-slide-in-up    { from { opacity: 0; } to { opacity: 1; } }
@keyframes so-slide-in-down  { from { opacity: 0; } to { opacity: 1; } }
@keyframes so-slide-in-left  { from { opacity: 0; } to { opacity: 1; } }
@keyframes so-slide-in-right { from { opacity: 0; } to { opacity: 1; } }
@keyframes so-slide-out-up   { from { opacity: 1; } to { opacity: 0; } }
@keyframes so-slide-out-down { from { opacity: 1; } to { opacity: 0; } }
