/* Fries reader UI. Layered on Tabler: this file carries the suite design tokens
   and the reader-specific shell that Tabler has no component for. */

:root {
    color-scheme: light dark;

    /* Surfaces */
    --bg-canvas: light-dark(#f5f7fb, #0e1523);
    --bg-surface: light-dark(#ffffff, #172033);
    --bg-surface-alt: light-dark(#f8fafc, #1c2739);
    --bg-surface-hover: light-dark(#f1f5f9, #202d43);
    --bg-input: light-dark(#ffffff, #111a29);

    /* Borders */
    --border-default: light-dark(#e2e8f0, #2a3650);
    --border-subtle: light-dark(#eef2f7, #222d44);
    --border-strong: light-dark(#cbd5e1, #3a4862);

    /* Text */
    --text-primary: light-dark(#1e293b, #e8edf5);
    --text-secondary: light-dark(#475569, #afbdd0);
    --text-muted: light-dark(#64748b, #93a2b8);
    --text-on-brand: #fff;
    --text-link: light-dark(#206bc4, #7fb2f0);

    /* Brand */
    --brand-solid: light-dark(#206bc4, #2e77d6);
    --brand-solid-hover: light-dark(#1a579f, #3d86e0);
    --brand-subtle-bg: light-dark(#e9f1fc, #1b2c47);
    --brand-subtle-text: light-dark(#1a5aa6, #86b8f2);
    --brand-border: light-dark(#b9d3f2, #2f4a72);

    /* Status */
    --success-solid: light-dark(#2fb344, #47c55c);
    --warning-solid: light-dark(#f59f00, #f2a93b);
    --warning-subtle-bg: light-dark(#fdf3e0, #33260d);
    --danger-solid: light-dark(#d63939, #e15c5c);
    --danger-subtle-bg: light-dark(#fbeaea, #3a1a1d);
    --danger-subtle-text: light-dark(#a82626, #f09a9a);

    /* Stored label palette */
    --label-azure-bg: light-dark(#e7f2fd, #12293f);
    --label-azure-solid: light-dark(#4299e1, #4aa3e5);
    --label-indigo-bg: light-dark(#eaecfd, #1c2350);
    --label-indigo-solid: light-dark(#4263eb, #5a75ee);
    --label-violet-bg: light-dark(#efeafd, #241c4d);
    --label-violet-solid: light-dark(#7048e8, #8563ec);
    --label-grape-bg: light-dark(#f7eafb, #331640);
    --label-grape-solid: light-dark(#ae3ec9, #b95fd0);
    --label-pink-bg: light-dark(#fce9f0, #3d1628);
    --label-pink-solid: light-dark(#d6336c, #dd5b86);
    --label-cyan-bg: light-dark(#e4f4f7, #10303a);
    --label-cyan-solid: light-dark(#17a2b8, #2fb3c7);
    --label-slate-bg: light-dark(#e2e8f0, #2b3a56);
    --label-slate-solid: light-dark(#64748b, #8497b0);

    /* Icons */
    --icon-default: light-dark(#64748b, #93a2b8);
    --icon-brand: light-dark(#1a5aa6, #86b8f2);
    --icon-danger: light-dark(#d63939, #e15c5c);

    /* Elevation */
    --shadow-popover:
        0 2px 6px -2px light-dark(rgb(15 23 42 / .10), rgb(0 0 0 / .45)),
        0 12px 32px -8px light-dark(rgb(15 23 42 / .16), rgb(0 0 0 / .55));

    --focus-ring: 0 0 0 2px color-mix(in srgb, var(--brand-solid) 35%, transparent);

    /* Reader metrics */
    --sidebar-width: 268px;
    --list-width: 404px;
    --toolbar-height: 52px;
    --bottom-toolbar-height: 48px;

    --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    /* Tabler token overrides */
    --tblr-body-bg: var(--bg-canvas);
    --tblr-body-color: var(--text-primary);
    --tblr-border-color: var(--border-default);
    --tblr-primary: var(--brand-solid);
    --tblr-link-color: var(--text-link);
    --tblr-font-sans-serif: var(--font-sans);
}

/* Explicit color-scheme overrides. */
[data-theme="light"] { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }

body {
    background: var(--bg-canvas);
    color: var(--text-primary);
    font-family: var(--font-sans);
    margin: 0;
}


/* Icons -------------------------------------------------------------------
   Tabler outline set on a 24 viewBox. Stroke weight tracks the rendered size
   so a 15px glyph does not carry the same slab as a 24px one. */

.icon-sprite { display: none; }

.icon {
    fill: none;
    flex: 0 0 auto;
    height: 17px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.65;
    width: 17px;
}

.icon-sm {
    height: 15px;
    stroke-width: 1.75;
    width: 15px;
}


/* Shell -------------------------------------------------------------------
   Desktop is a fixed sidebar, a fixed list and a flexible reader. */

.reader {
    display: grid;
    grid-template-columns: var(--sidebar-width) var(--list-width) minmax(0, 1fr);
    height: 100dvh;
    overflow: hidden;
}

.sidebar,
.list,
.article {
    background: var(--bg-surface);
    min-width: 0;
}

.sidebar,
.list {
    border-right: 1px solid var(--border-default);
}

.pane-toolbar {
    align-items: center;
    border-bottom: 1px solid var(--border-default);
    display: flex;
    gap: 8px;
    height: var(--toolbar-height);
    padding: 0 12px 0 16px;
}

.pane-toolbar h2 {
    font-size: 14.5px;
    font-weight: 600;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pane-toolbar .spacer { flex: 1; }

.list-heading { align-items: baseline; display: flex; gap: 7px; min-width: 0; }
.list-heading span { color: var(--text-muted); font-size: 11.5px; font-weight: 500; white-space: nowrap; }


/* Controls ----------------------------------------------------------------
   Figma: icon button 32x32 r7, hover fills surface-hover, focus adds a 2px
   brand ring, disabled drops to 40% with no fill. */

.icon-button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 7px;
    color: var(--icon-default);
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    height: 32px;
    justify-content: center;
    padding: 0;
    width: 32px;
}

.icon-button:hover { background: var(--bg-surface-hover); }

.icon-button[aria-pressed="true"] { color: var(--icon-brand); }

.icon-button:disabled {
    cursor: default;
    opacity: .4;
}

.icon-button:disabled:hover { background: transparent; }

/* Figma 118:2 puts the search clear inside the field, 20px square inset 10px from its
   right edge. Tabler's .input-icon-addon cannot serve: it ignores pointer events. */
.input-clear {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 999px;
    color: var(--icon-default);
    cursor: pointer;
    display: inline-flex;
    height: 20px;
    justify-content: center;
    padding: 0;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
}

.input-clear:hover { background: var(--bg-surface-hover); }

/* The native affordance would sit beside the one the design specifies. */
[data-search-input]::-webkit-search-cancel-button { display: none; }

.reader :focus-visible,
.menu :focus-visible {
    box-shadow: var(--focus-ring);
    outline: none;
}


/* Sidebar ----------------------------------------------------------------- */

.sidebar {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding: 10px 10px 0;
}

.brand {
    font-size: 15px;
    height: 44px;
    padding: 2px 10px 14px;
}

.brand-mark {
    background: var(--warning-subtle-bg);
    border-radius: 8px;
    display: grid;
    height: 28px;
    place-items: center;
    width: 28px;
}

.sidebar-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 10px;
}

.scope-row {
    align-items: center;
    background: var(--brand-subtle-bg);
    border-radius: 7px;
    color: var(--brand-subtle-text);
    display: flex;
    font-size: 13px;
    font-weight: 600;
    gap: 10px;
    height: 32px;
    margin: 0 10px 10px;
    padding: 0 10px;
}

.scope-row .icon { height: 17px; width: 17px; }
.scope-row .count { color: inherit; font-size: 11.5px; font-weight: 500; margin-left: auto; }

.nav-row,
.tree-row,
.feed-row {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 7px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    font-size: 12.5px;
    gap: 10px;
    height: 32px;
    padding: 0 10px;
    text-align: left;
    width: 100%;
}

.nav-row:hover,
.tree-row:hover,
.feed-row:hover,
.article-row:hover { background: var(--bg-surface-hover); }

/* Figma: selected uses brand/subtle-bg with a Semi-Bold label. */
.nav-row.active,
.tree-row.active,
.feed-row.active {
    background: var(--brand-subtle-bg);
    color: var(--brand-subtle-text);
    font-weight: 600;
}

.nav-row > .label,
.tree-row > .label,
.feed-row > .label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.count {
    color: var(--text-muted);
    font-size: 11.5px;
    margin-left: auto;
    padding-left: 6px;
}

.divider {
    border-bottom: 1px solid var(--border-subtle);
    height: 17px;
    margin: 0 4px;
}

.section-label {
    align-items: center;
    color: var(--text-muted);
    display: flex;
    font-size: 10px;
    font-weight: 700;
    gap: 6px;
    height: 28px;
    letter-spacing: .7px;
    padding: 0 10px;
}

.section-toggle {
    background: transparent;
    border: 0;
    cursor: pointer;
    text-align: left;
    width: 100%;
}

.section-toggle .icon { height: 13px; transition: transform 120ms ease; width: 13px; }
.section-toggle[aria-expanded="true"] .icon { transform: rotate(90deg); }

.unlabelled-label { margin-top: 8px; }

.label-row,
.managed-row {
    align-items: center;
    display: flex;
}

.tree-toggle {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--icon-default);
    cursor: pointer;
    display: flex;
    /* Match the LABELS header's disclosure-and-gap column. */
    flex: 0 0 40px;
    height: 30px;
    justify-content: center;
    padding: 0;
    width: 40px;
}

.tree-toggle .icon {
    height: 13px;
    transition: transform 120ms ease;
    width: 13px;
}

.tree-toggle[aria-expanded="true"] .icon { transform: rotate(90deg); }

.label-row .tree-row {
    font-size: 13px;
    height: 30px;
    padding-left: 0;
}

.feed-row {
    font-size: 12.5px;
    height: 30px;
    padding-left: 43px;
}

.tree-feed { padding-left: 43px; }

.managed-row { width: 100%; }
.managed-row > .feed-row { min-width: 0; }

/* Figma: the label dot carries the label colour. */
.dot {
    background: var(--label-slate-solid);
    border-radius: 50%;
    flex: 0 0 8px;
    height: 8px;
    width: 8px;
}

.dot-azure { background: var(--label-azure-solid); }
.dot-indigo { background: var(--label-indigo-solid); }
.dot-violet { background: var(--label-violet-solid); }
.dot-grape { background: var(--label-grape-solid); }
.dot-pink { background: var(--label-pink-solid); }
.dot-cyan { background: var(--label-cyan-solid); }
.dot-slate { background: var(--label-slate-solid); }

.avatar-letter {
    background: var(--label-slate-bg);
    border-radius: 4px;
    color: var(--label-slate-solid);
    display: grid;
    flex: none;
    font-size: 8.5px;
    font-weight: 700;
    height: 16px;
    overflow: hidden;
    place-items: center;
    position: relative;
    text-transform: uppercase;
    width: 16px;
}

/* The favicon covers the initial only once it has actually decoded; a feed with
   no usable icon keeps the palette initial. Hidden with opacity rather than
   display, because a lazily-loaded image that is display:none never enters the
   viewport and so is never fetched at all. */
.avatar-favicon {
    height: 100%;
    inset: 0;
    object-fit: contain;
    opacity: 0;
    position: absolute;
    width: 100%;
}

/* Transparent, not a surface colour: the icon's own padding should show the row
   beneath so hover and selected states still read correctly. */
.avatar-letter.has-favicon {
    background: transparent;
    color: transparent;
}

.avatar-letter.has-favicon .avatar-favicon { opacity: 1; }

.avatar-azure { background: var(--label-azure-bg); color: var(--label-azure-solid); }
.avatar-indigo { background: var(--label-indigo-bg); color: var(--label-indigo-solid); }
.avatar-violet { background: var(--label-violet-bg); color: var(--label-violet-solid); }
.avatar-grape { background: var(--label-grape-bg); color: var(--label-grape-solid); }
.avatar-pink { background: var(--label-pink-bg); color: var(--label-pink-solid); }
.avatar-cyan { background: var(--label-cyan-bg); color: var(--label-cyan-solid); }
.avatar-slate { background: var(--label-slate-bg); color: var(--label-slate-solid); }

/* Figma: a sync error replaces the count. */
.feed-failed .feed-row { color: var(--text-muted); }
.feed-failed .count { color: var(--danger-solid); }

.sidebar-footer {
    align-items: center;
    display: flex;
    flex: 0 0 var(--bottom-toolbar-height);
    gap: 6px;
    margin-top: auto;
    padding: 0;
    position: relative;
}

.sidebar-footer > .btn {
    left: 0;
    position: absolute;
    right: 38px;
    top: 50%;
    transform: translateY(-50%);
}

.sidebar-footer > .icon-button {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

/* Keep every toolbar control on the same vertical centreline. */
.filter-bar > * { align-self: center; }


/* Article list ------------------------------------------------------------ */

.list {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.list-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.filter-bar {
    align-items: center;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-default);
    display: flex;
    flex: 0 0 var(--bottom-toolbar-height);
    gap: 4px;
    justify-content: center;
    padding: 0 12px;
}

.filter-control {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 7px;
    color: var(--text-primary);
    display: inline-flex;
    height: 32px;
    justify-content: center;
    padding: 0;
    transition: background-color 160ms cubic-bezier(.2, 0, 0, 1), color 160ms cubic-bezier(.2, 0, 0, 1), width 160ms cubic-bezier(.2, 0, 0, 1);
    width: 32px;
}

.filter-control:hover { background: var(--bg-surface-hover); }
.filter-control.active { background: var(--brand-subtle-bg); color: var(--brand-subtle-text); gap: 7px; padding: 0 12px 0 11px; width: auto; }
.filter-control .icon { height: 17px; width: 17px; }
.filter-control span { font-size: 10.5px; font-weight: 600; letter-spacing: .6px; }

.group {
    align-items: center;
    background: var(--bg-surface-alt);
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    display: flex;
    font-size: 10px;
    font-weight: 700;
    gap: 8px;
    height: 32px;
    letter-spacing: .7px;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.group .group-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.group .count { font-weight: 400; }

.article-row {
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    display: block;
    padding: 11px 16px;
    text-align: left;
    width: 100%;
}

.article-row .meta {
    align-items: center;
    color: var(--text-muted);
    display: flex;
    font-size: 11.5px;
    gap: 4px;
}

.article-row .starred {
    color: var(--warning-solid);
    margin-left: auto;
}

/* Figma: unread carries Semi-Bold + text/primary. */
.article-title {
    color: var(--text-primary);
    font-size: 13.5px;
    font-weight: 650;
    line-height: 19px;
    margin: 3px 0;
}

/* A read article drops to Medium and the muted colour, so an opened item is
   visibly different from an unread one at a glance. */
.article-row.read .article-title {
    color: var(--text-muted);
    font-weight: 500;
}

.snippet {
    color: var(--text-muted);
    display: -webkit-box;
    font-size: 12.5px;
    line-clamp: 2;
    line-height: 18px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.clamp-1 { line-clamp: 1; -webkit-line-clamp: 1; }
.clamp-3 { line-clamp: 3; -webkit-line-clamp: 3; }

/* Figma: selection tints the row; the title and snippet keep their own colour. */
.article-row.selected { background: var(--brand-subtle-bg); }

.load-more {
    display: grid;
    padding: 12px 16px;
    place-items: center;
}

.skeleton {
    animation: pulse 1.4s linear infinite;
    background: linear-gradient(90deg, var(--bg-surface-alt), var(--bg-surface-hover), var(--bg-surface-alt));
    background-size: 400px 100%;
    height: 90px;
    margin: 1px 0;
}

@keyframes pulse {
    to { background-position: 400px 0; }
}


/* Status banner ----------------------------------------------------------- */

.status-banner {
    align-items: center;
    background: var(--danger-subtle-bg);
    border-bottom: 1px solid var(--border-default);
    color: var(--danger-subtle-text);
    display: flex;
    font-size: 12px;
    gap: 11px;
    padding: 11px 12px 11px 16px;
}

.status-banner > div {
    display: grid;
    flex: 1;
    gap: 1px;
}

.status-banner strong { font-size: 12.5px; }

.status-banner .status-detail {
    color: var(--text-muted);
    font-size: 11.5px;
}


/* Reader ------------------------------------------------------------------ */

.article {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.article-toolbar { justify-content: flex-end; }

.article-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.reader-copy {
    margin: 40px auto;
    max-width: 640px;
    padding: 0 20px;
}

.kicker {
    align-items: center;
    color: var(--brand-subtle-text);
    display: flex;
    font-size: 13px;
    gap: 6px;
}

.kicker .kicker-time { color: var(--text-muted); }

.reader-copy h1 {
    font-size: 30px;
    letter-spacing: -.5px;
    line-height: 39px;
    margin: 10px 0;
}

.byline {
    color: var(--text-secondary);
    font-size: 13px;
}

.article-content {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 28px;
    margin-top: 28px;
    overflow-wrap: break-word;
}

.article-content img {
    border-radius: 12px;
    height: auto;
    max-width: 100%;
}

.article-content figcaption {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 18px;
    margin: 8px 0 20px;
}

.article-content pre {
    background: var(--bg-surface-alt);
    border-radius: 8px;
    overflow-x: auto;
    padding: 12px;
}

.article-content a { color: var(--text-link); }


/* Feed detail ------------------------------------------------------------- */

/* The detail block is centred in the reading pane on both axes. `margin: auto`
   inside a flex container centres without making overflow unreachable. */
.feed-detail-scroll { display: flex; }

.feed-detail {
    display: grid;
    gap: 26px;
    justify-items: start;
    margin: auto;
    max-width: 760px;
    padding: 40px 64px;
    width: 100%;
}

.feed-detail-header {
    align-items: flex-start;
    display: flex;
    gap: 14px;
    width: 100%;
}

.feed-detail-avatar {
    border-radius: 11px;
    flex: 0 0 44px;
    font-size: 19px;
    height: 44px;
    width: 44px;
}

.feed-detail-copy { min-width: 0; }

.feed-detail-copy h1 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -.3px;
    line-height: 28px;
    margin: 0;
}

.feed-detail-copy p {
    color: var(--text-secondary);
    font-size: 13.5px;
    line-height: 19px;
    margin: 4px 0 0;
}

.feed-detail-card {
    border: 1px solid var(--border-default);
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
}

.feed-detail-row {
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    display: grid;
    font-size: 11px;
    gap: 12px;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    line-height: 16px;
    min-height: 39px;
    padding: 8px 16px;
}

.feed-detail-row:last-child { border-bottom: 0; }

.feed-detail-row > span { overflow-wrap: anywhere; }

.feed-detail-key { color: var(--text-muted); }

.feed-detail-row a {
    color: var(--text-link);
    text-decoration: none;
}

.feed-detail-row a:hover { text-decoration: underline; }

.detail-updated {
    color: var(--text-muted);
    text-align: right;
}

.feed-labels {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
}

.feed-label-heading {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .7px;
    margin: 0 0 2px;
    width: 100%;
}

.feed-detail-actions {
    align-items: center;
    display: flex;
    gap: 6px;
    width: 100%;
}

.feed-detail-actions .action-danger { margin-left: auto; }


/* Label chip --------------------------------------------------------------
   Figma: unselected shows the label dot; selected swaps it for a check and
   takes brand/border. */

.label-chip {
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 999px;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    font-size: 12px;
    gap: 6px;
    min-height: 24px;
    padding: 0 10px;
}

.label-chip:hover { background: var(--bg-surface-hover); }

.label-chip .dot {
    flex: 0 0 6px;
    height: 6px;
    width: 6px;
}

.label-chip[aria-pressed="true"] {
    background: var(--brand-subtle-bg);
    border-color: var(--brand-border);
    color: var(--brand-subtle-text);
}

.label-chip .icon {
    height: 13px;
    width: 13px;
}

.chip-hint {
    color: var(--text-muted);
    font-size: 11.5px;
    line-height: 16px;
    margin: 6px 0 0;
    width: 100%;
}


/* Menus -------------------------------------------------------------------
   Figma: anchored popover, item h32 r6, 15px icon, destructive items sit
   below a divider. Right-click on desktop, long-press on mobile. */

.menu {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    box-shadow: var(--shadow-popover);
    padding: 5px;
    position: fixed;
    z-index: 30;
}

.menu-feed { min-width: 232px; }
.menu-label { min-width: 210px; }
.menu-article { min-width: 262px; }

.menu-item {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    font-size: 13px;
    font-weight: 500;
    gap: 9px;
    height: 32px;
    padding: 0 10px;
    text-align: left;
    width: 100%;
}

.menu-item:hover { background: var(--bg-surface-hover); }

.menu-item .icon {
    color: var(--icon-default);
    height: 16px;
    width: 16px;
}

.menu-divider {
    background: var(--border-subtle);
    height: 1px;
    margin: 4px 6px;
}

.menu-item.destructive,
.menu-item.destructive .icon { color: var(--danger-subtle-text); }

.menu-item.destructive:hover { background: var(--danger-subtle-bg); }


/* Dialogs -----------------------------------------------------------------
   Tabler reserves 3.5rem of header padding for its own absolutely positioned
   close control; ours is a normal flex item, so reclaim it and push right. */

.fries-modal .modal-header { padding: 0 12px 0 20px; }

.fries-modal .modal-header .icon-button { margin-left: auto; }


/* Settings ----------------------------------------------------------------
   Tabler supplies the modal, switches and selects; these carry the Figma
   section rhythm and helper copy. */

.settings-section {
    border-bottom: 1px solid var(--border-subtle);
    display: grid;
    gap: 14px;
    padding: 18px 20px;
}

.settings-section:last-of-type { border-bottom: 0; }

.settings-section h3 {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .7px;
    margin: 0;
    text-transform: uppercase;
}

.setting {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin: 0;
    min-height: 32px;
}

.setting-label { display: grid; }

/* Named rather than `.setting-label > span`: that also matched the hint and, at one
   class plus one type, outscored `.setting-hint` so hints rendered full size. */
.setting-name {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    line-height: 18px;
}

.setting-hint {
    color: var(--text-muted);
    font-size: 11px;
    line-height: 15px;
}

.setting .form-select {
    flex: 0 0 190px;
    width: 190px;
}

.setting .form-check { margin: 0; }


/* Empty states ------------------------------------------------------------
   Figma: each names the scope it applies to and offers the one action that
   resolves it. */

.empty-pane {
    align-items: center;
    display: flex;
    flex: 1 1 auto;
    justify-content: center;
    min-height: 0;
    padding: 32px;
    text-align: center;
}

.empty-pane .empty-body { max-width: 320px; }

/* Centre explicitly rather than relying on inherited text-align, so the glyph
   cannot be knocked out of line by a framework rule turning it into a block. */
.empty-glyph {
    align-items: center;
    color: var(--icon-default);
    display: flex;
    justify-content: center;
    margin: 0 0 12px;
}

.empty-glyph .icon {
    height: 28px;
    stroke-width: 1.4;
    width: 28px;
}

.empty-pane h3 {
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 6px;
}

.empty-pane p {
    color: var(--text-muted);
    font-size: 12.5px;
    line-height: 18px;
    margin: 0 0 16px;
}


/* Toast ------------------------------------------------------------------- */

.toast-note {
    background: var(--text-primary);
    border-radius: 8px;
    bottom: 16px;
    color: var(--bg-surface);
    font-size: 13px;
    max-width: 320px;
    padding: 10px 14px;
    position: fixed;
    right: 16px;
    z-index: 40;
}

.toast-note:empty { display: none; }


/* Login ------------------------------------------------------------------- */

.login-page {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 100dvh;
    padding: 24px 16px;
}

.login-card { width: min(100%, 448px); }

.login-brand {
    display: grid;
    justify-items: center;
    margin-bottom: 20px;
}

.login-brand .brand-mark {
    height: 44px;
    margin-bottom: 10px;
    width: 44px;
}

.login-brand h1 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}


/* Responsive --------------------------------------------------------------
   840-1279px collapses the sidebar into a drawer; below 840px the three
   panes become a navigation stack. */

.mobile-only { display: none; }

.drawer-backdrop {
    background: rgb(0 0 0 / .33);
    inset: 0;
    position: fixed;
    z-index: 2;
}

@media (min-width: 840px) and (max-width: 1279px) {
    .reader { grid-template-columns: var(--list-width) minmax(0, 1fr); }

    .sidebar {
        inset: 0 auto 0 0;
        position: fixed;
        transform: translateX(-100%);
        transition: transform .18s ease;
        width: var(--sidebar-width);
        z-index: 3;
    }

    .sidebar.open { transform: translateX(0); }

    .list { grid-column: 1; }
    .article { grid-column: 2; }

    .list .mobile-only[data-drawer] { display: inline-flex; }
}

@media (max-width: 839px) {
    :root { --bottom-toolbar-height: 56px; }

    .reader {
        display: block;
        height: 100dvh;
    }

    .sidebar,
    .list,
    .article {
        border: 0;
        display: none;
        height: 100dvh;
    }

    .reader[data-mobile-view="feeds"] .sidebar,
    .reader[data-mobile-view="list"] .list,
    .reader[data-mobile-view="article"] .article {
        display: flex;
        flex-direction: column;
    }

    .sidebar { padding: 10px 0 0; }
    .brand { padding: 2px 16px 14px; }
    .scope-row { border-radius: 0; font-size: 14px; gap: 12px; height: 44px; margin: 0 0 10px; padding: 0 16px; }
    .scope-row .icon { height: 19px; width: 19px; }
    .scope-row .count { font-size: 12.5px; }

    .nav-row,
    .tree-row,
    .feed-row {
        font-size: 14px;
        height: 44px;
        padding: 0 16px;
    }

    .label-row .tree-row { padding-left: 0; }

    .feed-row,
    .tree-feed { padding-left: 42px; }

    .section-label { height: 32px; padding: 0 16px; }
    .sidebar-footer { padding: 0 16px; }

    .pane-toolbar { padding: 0 10px; }
    .pane-toolbar h2 { font-size: 15px; }

    .group { height: 34px; }
    .article-row { padding: 12px 16px; }

    .filter-bar { background: var(--bg-navbar, var(--bg-surface)); gap: 6px; }
    .filter-control { border-radius: 8px; height: 38px; width: 38px; }
    .filter-control.active { padding: 0 14px 0 13px; }
    .filter-control .icon { height: 19px; width: 19px; }
    .filter-control span { font-size: 11px; }

    .article-toolbar { justify-content: space-between; }

    .reader-copy {
        margin: 22px auto;
        padding: 0 20px;
    }

    .reader-copy h1 {
        font-size: 26px;
        line-height: 32px;
    }

    .feed-detail { padding: 20px; }

    .feed-detail-row {
        grid-template-columns: 80px minmax(0, 1fr) auto;
        padding: 8px 12px;
    }

    .mobile-only { display: inline-flex; }

    /* Figma: dialogs dock to the bottom edge on mobile. Scoped to our own wrapper
       so this extends Tabler's modal instead of shadowing its class. */
    .fries-modal .modal-dialog {
        margin: 0;
        max-width: 100%;
        position: absolute;
        bottom: 0;
        width: 100%;
    }

    .fries-modal .modal-content {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .tree-toggle .icon,
    .filter-control { transition: none; }

    .skeleton { animation: none; }
}
