/* Figtree Variable 5.3.0 via Fontsource. See fonts/OFL.txt. */
/* figtree-latin-ext-wght-normal */
@font-face {
  font-family: Figtree;
  font-style: normal;
  font-display: swap;
  font-weight: 400 800;
  src: url("fonts/figtree-latin-ext-wght-normal.eca8d8b337ff.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* figtree-latin-wght-normal */
@font-face {
  font-family: Figtree;
  font-style: normal;
  font-display: swap;
  font-weight: 400 800;
  src: url("fonts/figtree-latin-wght-normal.202cfb54d4e6.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* Pair the frontend palette with an equivalent dark color scheme. */
:root, html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
    html:not([data-theme]), html[data-theme="auto"] { color-scheme: dark; }
}

:root, html[data-theme] {
    --background: light-dark(#f7f7f8, #0f0f11);
    --foreground: light-dark(#18181b, #f4f4f5);
    --card: light-dark(#fff, #18181b);
    --popover: light-dark(#fff, #202023);
    --muted: light-dark(#f2f2f4, #222226);
    --muted-foreground: light-dark(#62626c, #a1a1aa);
    --border: light-dark(#e4e4e8, #2b2b30);
    --input: light-dark(#d5d5dc, #3e3e45);
    --control-border: light-dark(#8a8a8a, #737373);
    --primary: light-dark(#a95909, #f1a75e);
    --primary-hover: light-dark(#924a08, #ffc187);
    --primary-foreground: light-dark(#fff, #241504);
    --accent-surface: light-dark(#fff3e1, #3c2a18);
    --accent-foreground: light-dark(#97510b, #ffbf80);
    --ring: light-dark(#b86917, #f1a75e);
    --destructive: light-dark(#af2432, #ff9aa3);
    --destructive-surface: light-dark(#fff0f1, #3b2024);
    --destructive-emphasis: light-dark(#ffe1e4, #512b31);
    --warning: var(--accent-surface);
    --warning-foreground: light-dark(#7a460e, #f9c387);
    --online: light-dark(#22815d, #80d3ad);
    --success-surface: light-dark(#e9f6ef, #1d362b);
    --success-foreground: light-dark(#1b684b, #9be0bc);
    --info-surface: light-dark(#ecf2fa, #233143);
    --info-foreground: light-dark(#345375, #b4d2f3);
    --chart-1: var(--primary);
    --chart-2: light-dark(#087864, #58c3ad);
    --chart-3: light-dark(#5654b0, #a3a0f1);
    --chart-4: light-dark(#356591, #82b8e4);
    --radius: 12px;
    --radius-sm: 8px;
    --ease: cubic-bezier(.22, 1, .36, 1);
    --space-1: .25rem;
    --space-2: .5rem;
    --space-3: .75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --target: 2.25rem;
    --gutter: clamp(1rem, 3vw, 2rem);
    --sidebar-width: 15rem;
    --topbar-height: 3.75rem;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / .045);
    --shadow-overlay: 0 2px 8px rgb(0 0 0 / .12);

    /* Django's widgets also consume these variables. */
    --font-family-primary: Figtree, system-ui, sans-serif;
    --primary-fg: var(--primary-foreground);
    --secondary: var(--muted);
    --accent: var(--accent-foreground);
    --body-bg: var(--background);
    --body-fg: var(--foreground);
    --body-loud-color: var(--foreground);
    --body-medium-color: var(--foreground);
    --body-quiet-color: var(--muted-foreground);
    --darkened-bg: var(--card);
    --selected-bg: var(--muted);
    --selected-row: var(--accent-surface);
    --hairline-color: var(--border);
    --border-color: var(--control-border);
    --header-bg: var(--card);
    --header-color: var(--muted-foreground);
    --header-branding-color: var(--foreground);
    --header-link-color: var(--foreground);
    --breadcrumbs-bg: var(--background);
    --breadcrumbs-fg: var(--foreground);
    --breadcrumbs-link-fg: var(--muted-foreground);
    --link-fg: var(--accent-foreground);
    --link-hover-color: var(--accent-foreground);
    --link-selected-fg: var(--accent-foreground);
    --button-bg: var(--card);
    --button-hover-bg: var(--muted);
    --button-fg: var(--foreground);
    --default-button-bg: var(--primary);
    --default-button-hover-bg: var(--primary-hover);
    --close-button-bg: var(--muted);
    --close-button-hover-bg: var(--border);
    --delete-button-bg: var(--destructive-surface);
    --delete-button-hover-bg: var(--destructive-emphasis);
    --object-tools-bg: var(--card);
    --object-tools-hover-bg: var(--muted);
    --object-tools-fg: var(--foreground);
    --error-fg: var(--destructive);
    --message-debug-bg: var(--muted);
    --message-info-bg: var(--info-surface);
    --message-success-bg: var(--success-surface);
    --message-warning-bg: var(--warning);
    --message-error-bg: var(--destructive-surface);
}

body { accent-color: var(--primary); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
a { text-underline-offset: .18em; }
:is(h1, h2, h3, .breadcrumbs, .help) { overflow-wrap: anywhere; }
.skip-to-content-link:focus { z-index: 20; }
.skip-to-content-link:is(:link, :visited) { color: var(--foreground); }

#container > :is(header, nav, .main, footer),
.main > .content,
#content,
#content-main,
.titles-and-tools .titles { min-width: 0; }

#container { min-width: 0; min-height: 100dvh; height: auto; }

#container:has(> .cb-sidebar:not([hidden])) {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    grid-template-rows: auto auto 1fr auto;
}

#container:has(> .cb-sidebar:not([hidden])) > :is(header, nav, .main, footer) {
    grid-column: 2;
}

#container > header { grid-row: 1; }
#container > nav { grid-row: 2; }
#container > .main { grid-row: 3; }
#container > footer { grid-row: 4; }
#content, .dashboard #content { box-sizing: border-box; width: 100%; max-width: 1400px; margin-inline: auto; padding: var(--gutter); }
.titles-and-tools { gap: var(--space-3); margin-bottom: var(--space-4); }
#content h1 {
    margin: 0;
    color: var(--foreground);
    font-size: clamp(1.5rem, 3vw, 1.75rem);
    font-weight: 600;
    letter-spacing: -.035em;
    line-height: 1.12;
}
.titles h2 { margin: .35rem 0 0; color: var(--muted-foreground); font-size: .925rem; }

.cb-sidebar {
    box-sizing: border-box;
    position: sticky;
    inset-block-start: 0;
    grid-column: 1;
    grid-row: 1 / -1;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    min-width: 0;
    border-inline-end: 1px solid var(--border);
    background: var(--card);
}
.cb-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: var(--space-4);
    border-bottom: 1px solid var(--border);
}
.cb-sidebar-nav {
    flex: 1;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 8px 10px 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--input) transparent;
    mask-image: linear-gradient(transparent, black 6px, black calc(100% - 6px), transparent);
}
.cb-nav-group { margin: 8px 0 0; }
.cb-nav-group ul { margin: 0; padding: 0; list-style: none; }
.cb-nav-group li { list-style: none; padding: 0; }
.cb-nav-group > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    min-height: 28px;
    padding-inline: 8px;
    border-radius: 6px;
    color: var(--muted-foreground);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}
.cb-nav-group > summary::-webkit-details-marker { display: none; }
.cb-nav-group > summary:hover { background: var(--muted); }
.cb-nav-group > summary .cb-icon { width: 12px; height: 12px; }
.cb-nav-group:not([open]) > summary .cb-icon { rotate: -90deg; }
.cb-sidebar-nav .cb-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding-inline: 8px;
    border-radius: 7px;
    color: var(--foreground);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}
.cb-nav-link .cb-icon { color: var(--muted-foreground); }
.cb-nav-link span { overflow-wrap: anywhere; }
#cb-sidebar .cb-nav-link:is(:link, :visited) { text-decoration: none; }
.cb-sidebar-nav a:hover { background: var(--muted); text-decoration: none; }
.cb-sidebar-nav a[aria-current] { background: var(--accent-surface); color: var(--accent-foreground); }
.cb-sidebar-nav a[aria-current] .cb-icon { color: var(--primary); }

.cb-icon {
    width: 1rem;
    height: 1rem;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
#cb-sidebar .cb-brand:is(:link, :visited), #header .cb-brand {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--foreground);
    text-decoration: none;
    line-height: 1.2;
}
.cb-brand strong { font-size: 1rem; font-weight: 650; letter-spacing: -.025em; }
.cb-brand-mark {
    display: grid;
    flex: none;
    place-items: center;
    width: 2.125rem;
    height: 2.125rem;
    color: var(--accent-foreground);
    background: var(--accent-surface);
    border-radius: var(--radius-sm);
}
.cb-brand-mark .cb-icon { width: 1.25rem; height: 1.25rem; }
.cb-brand-context { display: block; color: var(--muted-foreground); font-size: .75rem; }

#header.cb-topbar {
    box-sizing: border-box;
    display: flex;
    flex-flow: row nowrap;
    justify-content: space-between;
    min-height: var(--topbar-height);
    padding: .375rem var(--gutter);
    gap: var(--space-2);
    border-bottom: 1px solid var(--border);
}
.cb-topbar-start, .cb-account-tools, .cb-header-controls { display: flex; align-items: center; gap: 4px; min-width: 0; }

.cb-icon-button, .cb-popover > summary {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-width: var(--target);
    min-height: var(--target);
    margin: 0;
    padding: 0 var(--space-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--foreground);
    background: var(--card);
    font: inherit;
    cursor: pointer;
}
.cb-popover > summary::-webkit-details-marker { display: none; }
.cb-popover > summary { list-style: none; }
.cb-icon-button:hover, .cb-popover > summary:hover, .cb-popover[open] > summary { background: var(--muted); }
.cb-language-label { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
.cb-account-name { max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-popover { position: relative; }
.cb-popover-panel {
    box-sizing: border-box;
    position: absolute;
    z-index: 5;
    inset-inline-end: 0;
    inset-block-start: calc(100% + .375rem);
    width: max-content;
    min-width: 10rem;
    max-width: min(18rem, 80vw);
    max-height: min(65dvh, 30rem);
    overflow: auto;
    padding: var(--space-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--popover);
    box-shadow: var(--shadow-overlay);
}
.cb-popover-panel button, .cb-popover-panel a, .cb-logout-form button {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    box-sizing: border-box;
    min-height: var(--target);
    padding: .375rem var(--space-2);
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--foreground);
    text-align: start;
    font: inherit;
    text-decoration: none;
    text-transform: none;
    cursor: pointer;
}
.cb-popover-panel a:hover, .cb-popover-panel button:hover, .cb-logout-form button:hover { background: var(--muted); }
.cb-popover-panel button[aria-current] { background: var(--accent-surface); color: var(--accent-foreground); }
#cb-sidebar .cb-popover-panel a:is(:link, :visited), #header .cb-popover-panel a:is(:link, :visited) { text-decoration: none; color: var(--foreground); }
.cb-popover-panel button span { margin-inline-start: auto; }
.cb-drawer {
    margin: 0;
    padding: 0;
    border: 0;
    width: min(20rem, calc(100vw - 3rem));
    max-width: none;
    height: 100dvh;
    max-height: none;
    color: var(--foreground);
    background: var(--card);
    box-shadow: var(--shadow-overlay);
}
.cb-drawer[open] { animation: cb-drawer-in 200ms var(--ease); }
.cb-drawer::backdrop { background: rgb(0 0 0 / .48); }
html:has(.cb-drawer[open]) { overflow: hidden; }
.cb-drawer .cb-sidebar { height: 100%; }
@keyframes cb-drawer-in { from { transform: translateX(-100%); } to { transform: translateX(0); } }

ol.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem;
    padding: .65rem var(--gutter) 0;
    border: 0;
    background: transparent;
    font-size: .8125rem;
}
ol.breadcrumbs li[aria-current] { font-weight: 650; }
ol.breadcrumbs a:hover { text-decoration: underline; }

.module caption, .module h2, .inline-group h2 {
    padding: var(--space-3) var(--space-4);
    color: var(--foreground);
    background: var(--muted);
    font-size: .875rem;
    font-weight: 600;
}
.module caption a.section { color: var(--foreground); }
.app-list .module, fieldset.module, .inline-group {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow-sm);
}
.app-list .module { overflow: hidden; }
.app-list table { width: 100%; }
.app-list :is(th, td) { padding: var(--space-3); }
.app-list tr:last-child > * { border-bottom: 0; }
.app-list tbody tr:hover { background: var(--muted); }
.inline-group .tabular { overflow: auto; }
.inline-group .module { border: 0; box-shadow: none; }

input:is(:not([type]), [type="text"], [type="search"], [type="password"], [type="email"],
    [type="url"], [type="number"], [type="date"], [type="time"], [type="tel"]),
select, textarea {
    box-sizing: border-box;
    max-width: 100%;
    min-height: var(--target);
    padding: .375rem var(--space-2);
    border: 1px solid var(--control-border);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--foreground);
    font: inherit;
}
select:not([multiple]) { height: auto; }
input::placeholder { color: var(--muted-foreground); }
input[type="checkbox"], input[type="radio"] { width: 1rem; height: 1rem; vertical-align: middle; }
input:focus-visible, select:focus-visible, textarea:focus-visible,
#toolbar #searchbar:focus-visible { border-color: var(--ring); outline: 2px solid var(--ring); outline-offset: 1px; }
input[aria-invalid="true"], .errors :is(input, select, textarea) { border-color: var(--destructive); }

.button, input:is([type="submit"], [type="button"]),
.submit-row a, .delete-confirmation form .cancel-link, .object-tools a:is(:link, :visited),
#toolbar form input[type="submit"], #changelist .actions .button {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--target);
    height: auto;
    max-width: 100%;
    border: 1px solid var(--control-border);
    border-radius: var(--radius-sm);
    padding: .4rem var(--space-3);
    background: var(--card);
    color: var(--foreground);
    font: 500 .875rem / 1.25 var(--font-family-primary);
    text-align: center;
    text-transform: none;
    text-decoration: none;
    box-shadow: none;
    cursor: pointer;
    transition: background-color 150ms var(--ease);
}
.button:hover, input:is([type="submit"], [type="button"]):hover,
.submit-row a:hover, .delete-confirmation form .cancel-link:hover, .object-tools a:hover,
#toolbar form input[type="submit"]:hover, #changelist .actions .button:hover { background: var(--muted); }
.object-tools { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; }
.object-tools li { height: auto; margin: 0; }
.object-tools a.addlink, .submit-row input.default, input.default, .button.default, .login #login-form input[type="submit"] {
    border-color: transparent;
    background: var(--primary);
    color: var(--primary-foreground);
}
.object-tools a.addlink:hover, .submit-row input.default:hover, input.default:hover, .button.default:hover,
.login #login-form input[type="submit"]:hover { background: var(--primary-hover); }
.submit-row a.deletelink, .delete-confirmation form input[type="submit"] {
    border-color: transparent;
    background: var(--destructive-surface);
    color: var(--destructive);
}
.submit-row a.deletelink:hover, .delete-confirmation form input[type="submit"]:hover { background: var(--destructive-emphasis); }
.submit-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
}
.submit-row :is(input, a) { margin: 0; }
.form-row { padding: var(--space-3) var(--space-4); }
.form-row:last-child { border-bottom: 0; }

ul.messagelist { display: grid; justify-items: end; gap: var(--space-2); padding: var(--space-3) var(--gutter) 0; }
ul.messagelist li {
    box-sizing: border-box;
    width: min(100%, 32rem);
    margin: 0;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border);
    border-inline-start: .2rem solid currentColor;
    border-radius: var(--radius-sm);
    background-image: none;
    box-shadow: var(--shadow-overlay);
    overflow-wrap: anywhere;
}
ul.messagelist li.success { color: var(--success-foreground); }
ul.messagelist li.warning { color: var(--warning-foreground); }
ul.messagelist li.error, .errornote { color: var(--destructive); }
ul.messagelist li.info { color: var(--info-foreground); }
.errornote { background: var(--destructive-surface); border-color: var(--destructive); border-radius: var(--radius-sm); }

.cb-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    width: fit-content;
    max-width: 100%;
    padding: .2rem .55rem;
    border-radius: 999px;
    background: var(--badge-bg, var(--muted));
    color: var(--badge-fg, var(--muted-foreground));
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.2;
}
.cb-badge--success { --badge-bg: var(--success-surface); --badge-fg: var(--success-foreground); }
.cb-badge--warning { --badge-bg: var(--warning); --badge-fg: var(--warning-foreground); }
.cb-badge--danger { --badge-bg: var(--destructive-surface); --badge-fg: var(--destructive); }
.cb-badge--info { --badge-bg: var(--info-surface); --badge-fg: var(--info-foreground); }
.cb-badge-dot { flex: none; width: .375rem; height: .375rem; border-radius: 50%; background: currentColor; }
.cb-badge--success .cb-badge-dot { background: var(--online); }
.cb-date { display: inline-flex; flex-direction: column; white-space: nowrap; }
.cb-date-relative, .cb-muted-text { color: var(--muted-foreground); font-size: .75rem; }
.cb-recipe-title { display: flex; align-items: center; gap: var(--space-2); min-width: 8rem; }
.cb-recipe-thumb, .cb-recipe-preview { object-fit: cover; background: var(--muted); border-radius: var(--radius-sm); }
.cb-recipe-thumb { display: inline-grid; flex: none; place-items: center; width: 2rem; height: 2rem; color: var(--muted-foreground); }
.cb-recipe-preview { max-width: 100%; }
.cb-user-label { display: block; overflow-wrap: anywhere; }

body.login { display: grid; place-items: center; min-height: 100dvh; }
.login #container {
    box-sizing: border-box;
    margin: 1rem;
    width: min(27rem, calc(100% - 2rem));
    min-width: 0;
    min-height: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow-sm);
}
.login #header { border-radius: var(--radius) var(--radius) 0 0; }
.login #content { padding: var(--space-5); }
.login .form-row { padding: 0 0 var(--space-3); }
.login .submit-row { padding: 0; border: 0; }
.login #login-form input[type="submit"] { width: 100%; }

@media (max-width: 768px) {
    :root, html[data-theme] { --target: 2.75rem; }
    #container:has(> .cb-sidebar:not([hidden])) { display: flex; flex-direction: column; }
    #container > .cb-sidebar { position: static; height: auto; max-height: 15rem; order: 1; }
    #container > :is(nav, .main, footer) { order: 2; }
    #header.cb-topbar { position: sticky; inset-block-start: 0; z-index: 8; }

    .cb-brand-context { font-size: .6875rem; }
    .titles-and-tools { align-items: flex-start; flex-wrap: wrap; }
    .app-list :is(th, td) { padding-inline: var(--space-2); overflow-wrap: anywhere; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}


.cb-sidebar-search {
    position: relative;
    display: flex;
    align-items: center;
    margin: 12px 10px 0;
    color: var(--muted-foreground);
}
.cb-sidebar-search svg { position: absolute; inset-inline-start: 9px; pointer-events: none; }
.cb-sidebar-search input { width: 100%; padding-inline-start: 32px; border-color: var(--input); }
.cb-sidebar-footer { padding: 8px; border-top: 1px solid var(--border); }
.cb-sidebar-footer summary { display: flex; justify-content: start; width: 100%; border-color: transparent; padding: 6px; }
.cb-sidebar-footer .cb-popover-panel { inset: auto auto calc(100% + 6px) 0; z-index: 12; }
.cb-sidebar-footer .cb-account-identity { flex: 1; min-width: 0; }
.cb-sidebar-footer .cb-account-name { max-width: none; }
.cb-account-identity :is(strong, small) { display: block; overflow: hidden; text-overflow: ellipsis; }
.cb-account-identity strong { font-weight: 600; }
.cb-account-identity small { color: var(--muted-foreground); font-size: 12px; }
.cb-avatar {
    display: inline-grid; flex: none; place-items: center; width: 30px; height: 30px; border-radius: 50%;
    background: var(--accent-surface); color: var(--accent-foreground); font-size: 11px; font-weight: 600;
}
.cb-account summary > .cb-icon, .cb-header-controls summary > .cb-icon:last-child { width: 12px; height: 12px; color: var(--muted-foreground); }
.cb-account summary { gap: 6px; }
.cb-account-tools > .cb-account .cb-avatar { width: 24px; height: 24px; }
.cb-nav-empty { padding-inline: 8px; color: var(--muted-foreground); }

#container:has(> .cb-sidebar-compact) { --sidebar-width: 64px; }
.cb-sidebar-compact .cb-sidebar-header { padding: 12px 14px; }
.cb-sidebar-compact .cb-brand > span:last-child, .cb-sidebar-compact .cb-nav-group summary,
.cb-sidebar-compact .cb-sidebar-footer summary > :not(.cb-avatar) { display: none; }
.cb-sidebar-compact .cb-sidebar-nav {
    overflow: auto;
    mask-image: none;
    scrollbar-width: thin;
    padding-inline: 8px;
}
.cb-sidebar-compact .cb-nav-group { margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--border); }
.cb-sidebar-compact .cb-nav-link { justify-content: center; }
.cb-sidebar-compact .cb-nav-link span {
    position: fixed; z-index: 14; inset-inline-start: 59px;
    display: block; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
}
.cb-sidebar-compact .cb-nav-link:is(:focus-visible, :hover):not(.cb-tooltip-dismissed) span {
    width: max-content; height: auto; padding: 6px 9px; clip-path: none; overflow: visible;
    border: 1px solid var(--border); border-radius: 6px; color: var(--foreground); background: var(--popover);
    box-shadow: var(--shadow-overlay); white-space: nowrap;
}
.cb-sidebar-compact .cb-nav-link { anchor-name: --cb-nav-link; anchor-scope: --cb-nav-link; }
@supports (position-area: inline-end center) {
    .cb-sidebar-compact .cb-nav-link span {
        inset: auto; position-anchor: --cb-nav-link; position-area: inline-end center;
    }
}
.cb-sidebar-compact .cb-sidebar-footer summary { justify-content: center; }

#header.cb-topbar { position: relative; z-index: 8; }
.cb-topbar-start { flex: 1 1 auto; }
.cb-breadcrumb-slot { flex: 1 1 0%; min-width: 0; }
.cb-breadcrumb-slot ol.breadcrumbs { flex-wrap: nowrap; margin: 0; padding: 0; }
.cb-breadcrumb-slot .breadcrumbs li { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-breadcrumb-slot .breadcrumbs li:last-child { flex: 0 1 auto; max-width: clamp(7rem, 23vw, 25rem); }
.cb-breadcrumb-slot .breadcrumbs a:is(:link, :visited) { color: var(--muted-foreground); text-decoration: none; }
.cb-breadcrumb-slot .breadcrumbs :is(a:hover, [aria-current]) { color: var(--foreground); }
.cb-palette-trigger kbd {
    white-space: nowrap; padding: 2px 4px; border-radius: 4px; background: var(--muted);
    color: var(--muted-foreground); font: 11px var(--font-family-primary);
}
.cb-theme summary > svg:not(:last-child) { display: none; }
[data-theme="light"] .cb-theme summary svg:has(use[href="#cb-icon-sun"]),
[data-theme="dark"] .cb-theme summary svg:has(use[href="#cb-icon-moon"]),
html:not([data-theme="light"], [data-theme="dark"]) .cb-theme summary svg:has(use[href="#cb-icon-monitor"]) { display: block; }
.cb-theme .cb-popover-panel button[aria-current]::after { content: "✓" / ""; margin-inline-start: auto; }

.cb-palette {
    box-sizing: border-box; inset: min(14dvh, 105px) 0 auto; margin: 0 auto;
    width: min(530px, calc(100vw - 24px)); max-height: 75dvh; padding: 0;
    color: var(--foreground); border: 1px solid var(--border); border-radius: 12px;
    background: var(--popover); box-shadow: var(--shadow-overlay);
}
.cb-palette::backdrop { background: rgb(0 0 0 / .55); }
html:has(.cb-palette[open]) { overflow: hidden; }
.cb-palette-search {
    position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--popover);
}
.cb-palette-search > .cb-icon { color: var(--muted-foreground); }
.cb-palette-search input { flex: 1; min-width: 0; border: 0; background: transparent; }
.cb-palette-results { padding: 8px; }
.cb-palette-results h3 { margin: 8px; color: var(--muted-foreground); font-size: 12px; font-weight: 600; }
.cb-palette-row { display: flex; gap: 4px; }
#cb-palette .cb-palette-row a:is(:link, :visited) {
    display: flex; flex: 1 1 auto; align-items: center; gap: 8px; min-height: var(--target);
    padding: 0 8px; color: var(--foreground); border-radius: 6px; text-decoration: none;
}
.cb-palette-row a.cb-palette-add { flex: none; color: var(--muted-foreground); }
.cb-palette-row a:is(:hover, :focus-visible) { background: var(--muted); }
.cb-palette-empty { margin: 0; padding: 16px; text-align: center; color: var(--muted-foreground); }

.button .cb-icon { margin-inline-end: 6px; }
.delete-confirmation #content > :is(p, ul, form), body.password-change #content-main, body.password-change #content > p, #change-history {
    box-sizing: border-box; max-width: 100%; padding: 16px; border: 1px solid var(--border);
    border-radius: var(--radius); background: var(--card); overflow-wrap: anywhere;
}
#change-history { overflow: auto; }

@media (max-width: 768px) {
    :root, html[data-theme] { --gutter: 14px; --target: 40px; }
    #header.cb-topbar { position: sticky; padding-inline: 8px; gap: 4px; }
    .cb-topbar-start, .cb-account-tools { gap: 4px; }
    .cb-header-controls { gap: 2px; }
    .cb-palette-trigger kbd, .cb-account-tools .cb-account { display: none; }
    .cb-breadcrumb-slot .breadcrumbs li:not(:last-child) { display: none; }
    .cb-breadcrumb-slot .breadcrumbs li:last-child { max-width: none; }
    .cb-sidebar-nav .cb-nav-link, .cb-nav-group > summary { min-height: 40px; }
    .cb-palette input, .cb-sidebar-search input { font-size: 16px; }
}
