/* Structure a theme opts into beyond colour and shape (themes.js sets
   data-edge on <html>). Linked after the feature stylesheets, so these
   rules win over the ones they restyle at the same specificity plus the
   attribute. The gloss edge has its own sheet, theme-gloss.css, and what
   Windows 95 alone draws is in theme-windows-95.css. */

/* Bevel: classic desktop controls. Light falls from the top left, so raised
   controls have a light top-left edge and sunken fields a dark one. Buttons
   are panel coloured rather than filled with text or accent colour; the
   accent stays for text, selection and focus. The frame is --bevel-raised
   or --bevel-sunken as border colours, plus --bevel-raised-inner or
   --bevel-sunken-inner as an inset shadow for themes whose edge is two
   pixels deep (themes.js sets all four). Where a rule lists the inner ring
   with another shadow, the ring comes first so it stays inside the border. */

/* The window is panel coloured and content sits in it as sunken wells, as
   the skin draws its list panels: the feed column and the split post panel
   take a dark left edge and a light right one, and rows inside a well are
   split by an etched groove (a shadow line over a lighter one) instead of a
   flat rule. */
[data-edge="bevel"],
[data-edge="bevel"] body {
    background-color: var(--bg-secondary);
}
[data-edge="bevel"] .app-column,
[data-edge="bevel"] .nook-detail-panel {
    border-left-color: var(--edge-dark);
    border-right-color: var(--edge-light);
}
/* The split panel draws the column's right edge (detail-layer.css). */
[data-edge="bevel"] .app-column.app-column-split {
    border-right-color: transparent;
}
[data-edge="bevel"] .tweet-border {
    border-bottom-color: var(--divider-light);
    box-shadow: inset 0 -1px 0 var(--edge-dark);
}

/* Buttons take their face colours from the --button-* tokens; the bevel
   adds only the frame. Destructive buttons keep their colour, framed like the
   rest. */
[data-edge="bevel"] .nook-button:not(.is-text) {
    border-color: var(--bevel-raised);
    box-shadow: var(--bevel-raised-inner);
}
[data-edge="bevel"] .nook-button:not(.is-text):not(.is-danger):hover:not(:disabled) {
    color: var(--selected-text);
}
[data-edge="bevel"] .nook-button:not(.is-text):active:not(:disabled) {
    border-color: var(--bevel-sunken);
    box-shadow: var(--bevel-sunken-inner);
}
/* Classic toolkits set button labels in the regular weight, mark keyboard
   focus with a thin black frame (dotted and inside the face on Windows, per
   --bevel-focus-style and --bevel-focus-offset), and draw disabled labels
   engraved: a dark glyph over a lighter one offset down and right, rather
   than faded. */
[data-edge="bevel"] .nook-button:not(.is-text) {
    font-weight: 400;
}
[data-edge="bevel"] .nook-button:not(.is-text):focus-visible {
    outline: 1px var(--bevel-focus-style) #000;
    outline-offset: var(--bevel-focus-offset);
}
[data-edge="bevel"] .nook-button:not(.is-text):is(:disabled, [aria-disabled="true"]) {
    opacity: 1;
    color: var(--edge-dark);
    text-shadow: 1px 1px 0 var(--disabled-shadow);
}
/* Icon buttons and the feed's sort trigger are toolbar buttons: flat until
   the pointer or keyboard focus is on them, then a raised panel, and sunken
   while pressed or while their menu is open. Their shared hover fill is the
   button colour, which is the panel they already sit on here and so shows
   nothing. The frame is an inset shadow, since these buttons have no border
   to colour. */
[data-edge="bevel"] :is(.nook-icon-button, .feed-picker-trigger):is(:hover, :focus-visible, [aria-expanded="true"]):not(:disabled) {
    background: var(--button-bg);
    box-shadow: inset 1px 1px 0 var(--edge-light), inset -1px -1px 0 var(--edge-dark);
}
[data-edge="bevel"] :is(.nook-icon-button:not(.is-action, .is-danger), .feed-picker-trigger):hover:not(:disabled) {
    color: var(--selected-text);
}
[data-edge="bevel"] :is(.nook-icon-button, .feed-picker-trigger):is(:active, [aria-expanded="true"]):not(:disabled) {
    box-shadow: inset 1px 1px 0 var(--edge-dark), inset -1px -1px 0 var(--edge-light);
}
[data-edge="bevel"] :is(.nook-icon-button, .feed-picker-trigger):focus-visible {
    outline: 1px var(--bevel-focus-style) #000;
    outline-offset: -3px;
}
/* The scroll-to-top button and the search field's clear button are raised
   panel buttons like the rest, rather than an accent fill and a dark disc. */
[data-edge="bevel"] :is(.scroll-to-top, .nook-search-clear),
[data-edge="bevel"] :is(.scroll-to-top, .nook-search-clear):hover {
    border: 1px solid;
    border-color: var(--bevel-raised);
    border-radius: 0;
    background: var(--button-bg);
    box-shadow: var(--bevel-raised-inner);
    color: var(--button-text);
}
[data-edge="bevel"] :is(.scroll-to-top, .nook-search-clear):hover {
    color: var(--selected-text);
}
[data-edge="bevel"] :is(.scroll-to-top, .nook-search-clear):active {
    border-color: var(--bevel-sunken);
    box-shadow: var(--bevel-sunken-inner);
}
[data-edge="bevel"] :is(.scroll-to-top, .nook-search-clear):focus-visible {
    outline: 1px var(--bevel-focus-style) #000;
    outline-offset: var(--bevel-focus-offset);
}
/* Search capsules are small raised panels set into the sunken search field,
   with square corners and the label white. Excluded filters keep the danger
   colour for their text. A capsule still being typed (no
   value yet, an unknown one, or a value being edited) is a sunken slot
   instead, so a finished filter stands out from one still in progress. */
[data-edge="bevel"] :is(.search-capsule.valid-capsule, .search-capsule.boolean-capsule, .filter-box) {
    border: 0;
    border-radius: 0;
    background: var(--button-bg);
    box-shadow: inset 1px 1px 0 var(--edge-light), inset -1px -1px 0 var(--edge-dark);
    color: var(--button-text);
}
[data-edge="bevel"] .search-capsule.boolean-capsule {
    color: var(--text-secondary);
}
[data-edge="bevel"] :is(.search-capsule.negative-capsule.valid-capsule, .filter-box.negative),
[data-edge="bevel"] :is(.search-capsule.negative-capsule.valid-capsule, .filter-box.negative) .capsule-key {
    color: var(--danger-color);
}
[data-edge="bevel"] :is(.search-capsule.incomplete-capsule, .search-capsule.invalid-capsule) .capsule-key,
[data-edge="bevel"] .filter-box:is(.is-editing, .is-empty, .is-unknown) {
    border-radius: 0;
    background: transparent;
    box-shadow: inset 1px 1px 0 var(--edge-dark), inset -1px -1px 0 var(--edge-light);
    color: var(--text-secondary);
}
[data-edge="bevel"] .filter-box:is(.is-editing, .is-empty, .is-unknown) .capsule-key {
    color: var(--text-secondary);
}
[data-edge="bevel"] :is(.search-capsule.negative-capsule:is(.incomplete-capsule, .invalid-capsule) .capsule-key, .filter-box.negative:is(.is-editing, .is-empty, .is-unknown) .capsule-key) {
    color: var(--danger-color);
}

/* A removable value in a field, such as a tag being added, is the same
   raised panel as a finished capsule, and its remove button a small toolbar
   button. */
[data-edge="bevel"] .nook-token {
    border-radius: 0;
    background: var(--button-bg);
    box-shadow: inset 1px 1px 0 var(--edge-light), inset -1px -1px 0 var(--edge-dark);
    color: var(--button-text);
    font-weight: 400;
}
[data-edge="bevel"] .nook-token button:hover {
    background: none;
    box-shadow: inset 1px 1px 0 var(--edge-light), inset -1px -1px 0 var(--edge-dark);
    color: var(--selected-text);
}
[data-edge="bevel"] .nook-token button:active {
    box-shadow: inset 1px 1px 0 var(--edge-dark), inset -1px -1px 0 var(--edge-light);
}
[data-edge="bevel"] .nook-token button:focus-visible {
    outline: 1px var(--bevel-focus-style) #000;
    outline-offset: -3px;
}

/* Switches are a sunken slot with a raised square knob; checkboxes are
   sunken wells whose tick takes the selected-text colour; radios are a thin
   light ring with a light dot, and the ring turns accent on keyboard focus. */
[data-edge="bevel"] .nook-switch {
    background: var(--field-bg);
    box-shadow: inset 1px 1px 0 var(--edge-dark), inset -1px -1px 0 var(--edge-light);
}
[data-edge="bevel"] .nook-switch.is-on,
[data-edge="bevel"] [aria-checked="true"] > .nook-switch,
[data-edge="bevel"] input:checked + .nook-switch {
    background: var(--accent-color);
}
[data-edge="bevel"] .nook-switch::after {
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    box-shadow: inset 1px 1px 0 var(--edge-light), inset -1px -1px 0 var(--edge-dark);
}
[data-edge="bevel"] .nook-switch.is-on::after,
[data-edge="bevel"] [aria-checked="true"] > .nook-switch::after,
[data-edge="bevel"] input:checked + .nook-switch::after {
    background: var(--bg-secondary);
}
[data-edge="bevel"] .nook-checkbox,
[data-edge="bevel"] .nook-checkbox:has(input:checked),
[data-edge="bevel"] [aria-checked="true"] > .nook-checkbox {
    border: 1px solid;
    border-color: var(--bevel-sunken);
    background: var(--field-bg);
    box-shadow: var(--bevel-sunken-inner);
}
[data-edge="bevel"] .nook-checkbox:has(input:checked),
[data-edge="bevel"] [aria-checked="true"] > .nook-checkbox {
    color: var(--selected-text);
}
[data-edge="bevel"] .nook-radio,
[data-edge="bevel"] [aria-checked="true"] > .nook-radio,
[data-edge="bevel"] input:checked + .nook-radio {
    width: 16px;
    height: 16px;
    border: 1px solid var(--text-primary);
    background: transparent;
}
[data-edge="bevel"] .nook-radio::after {
    inset: 4px;
    background: var(--text-primary);
}
[data-edge="bevel"] :focus-visible > .nook-radio {
    border-color: var(--accent-color);
}

/* Text fields and dropdown triggers are sunken wells; focus keeps the well
   and adds the accent ring outside it. */
[data-edge="bevel"] .nook-field,
[data-edge="bevel"] .nook-input,
[data-edge="bevel"] .nook-search,
[data-edge="bevel"] .nook-select-trigger {
    border: 1px solid;
    border-color: var(--bevel-sunken);
    background: var(--field-bg);
    box-shadow: var(--bevel-sunken-inner);
}
[data-edge="bevel"] .nook-field:focus-within,
[data-edge="bevel"] .nook-input:focus-within,
[data-edge="bevel"] .nook-search:focus-within,
[data-edge="bevel"] .nook-select-trigger[aria-expanded="true"],
[data-edge="bevel"] .nook-select-trigger:focus-visible {
    border-color: var(--bevel-sunken);
    background: var(--field-bg);
    box-shadow: var(--bevel-sunken-inner), 0 0 0 1px var(--accent-color);
}
/* An invalid field keeps its well and takes the destructive ring instead. */
[data-edge="bevel"] .nook-field.is-invalid,
[data-edge="bevel"] .nook-input.is-invalid {
    box-shadow: var(--bevel-sunken-inner), 0 0 0 1px var(--destructive-color);
}

/* Segmented controls read as a row of buttons with the chosen one pressed. */
[data-edge="bevel"] .nook-segmented {
    background: transparent;
    padding: 0;
}
[data-edge="bevel"] .nook-segmented button {
    border: 1px solid;
    border-color: var(--bevel-raised);
    background: var(--bg-secondary);
    box-shadow: var(--bevel-raised-inner);
}
[data-edge="bevel"] .nook-segmented button:is([aria-checked="true"], [aria-pressed="true"]) {
    border-color: var(--bevel-sunken);
    background: var(--field-bg);
    color: var(--selected-text);
    box-shadow: var(--bevel-sunken-inner);
}

/* A post's tag chips are buttons like the rest, rather than X's tinted
   pills, and an activity log is a sunken text well, like a field. */
[data-edge="bevel"] .nook-td-chip {
    border-color: var(--bevel-raised);
    background: var(--button-bg);
    box-shadow: var(--bevel-raised-inner);
    color: var(--button-text);
    font-weight: 400;
}
[data-edge="bevel"] .nook-td-chip:hover {
    background: var(--button-bg);
    color: var(--selected-text);
}
[data-edge="bevel"] .nook-td-chip:active {
    border-color: var(--bevel-sunken);
    box-shadow: var(--bevel-sunken-inner);
}
[data-edge="bevel"] .nook-log-panel {
    border-color: var(--bevel-sunken);
    background: var(--field-bg);
    box-shadow: var(--bevel-sunken-inner);
}
/* A tag's share of the archive is a small sunken gauge with a square fill. */
[data-edge="bevel"] .nook-tag-share {
    height: 8px;
    border: 1px solid;
    border-color: var(--bevel-sunken);
    border-radius: 0;
    background: var(--bevel-meter-bg);
}
[data-edge="bevel"] .nook-tag-share > span {
    border-radius: 0;
    background: var(--accent-color);
}
/* Settings marks its current page with --bg-secondary, which is the panel
   colour the list already sits on here; the page takes the list selection
   instead. Phones show one page at a time and mark none. */
@media (min-width: 800px) {
    [data-edge="bevel"] .nook-settings-nav[aria-current="page"] {
        background: var(--option-active-bg);
        color: var(--option-active-text);
    }
    [data-edge="bevel"] .nook-settings-nav[aria-current="page"] :is(.nook-category-icon, .nook-category-arrow) {
        color: inherit;
    }
}
/* Floating panels and dialogs are raised windows with a hard edge; the
   theme's --popover-shadow and --dialog-shadow are the hard drop under them. */
[data-edge="bevel"] .nook-popover,
[data-edge="bevel"] .nook-dialog {
    border: 1px solid;
    border-color: var(--bevel-raised);
}
[data-edge="bevel"] .nook-popover,
[data-edge="bevel"] .nook-dialog.is-floating {
    box-shadow: var(--bevel-raised-inner), var(--popover-shadow);
}
[data-edge="bevel"] .nook-dialog:not(.is-floating) {
    box-shadow: var(--bevel-raised-inner), var(--dialog-shadow);
}
/* Menu rows take their size from the theme: X's touch rows unless the theme
   draws compact desktop menus. */
[data-edge="bevel"] .nook-option {
    min-height: var(--bevel-option-height);
    padding: var(--bevel-option-pad);
}
[data-edge="bevel"] .nook-option:is([role="menuitem"], [role="menuitemradio"], [role="menuitemcheckbox"]) {
    font-weight: var(--bevel-option-weight);
}
/* The highlighted menu row takes --option-active-text, which a theme with a
   solid highlight (Windows' navy) sets to contrast with it. Destructive rows
   keep their colour. */
[data-edge="bevel"] .nook-option:is(button, a):hover:not(.is-danger),
[data-edge="bevel"] .nook-option:is(:focus-visible, [data-active="true"], .is-active):not(.is-danger) {
    color: var(--option-active-text);
}

/* The search suggestions are a compact menu under the field, as the skin
   draws its dropdown lists: square, with tighter rows, and the active row
   lights its label (--option-active-label: Steam's selected-text yellow)
   rather than relying on the faint row shade alone. */
[data-edge="bevel"] .nook-suggest {
    margin-top: 2px;
    border-radius: 0;
}
[data-edge="bevel"] .nook-suggest-row {
    padding: 6px 12px;
}
[data-edge="bevel"] .nook-suggest-row.is-active :is(.nook-suggest-glyph, .nook-suggest-key, .nook-suggest-name, .nook-suggest-tag) {
    color: var(--option-active-label);
}
[data-edge="bevel"] .nook-suggest-row.is-active .nook-suggest-desc {
    color: var(--option-active-text);
}

/* Tabs: a row of raised tabs standing on the top edge of the page below.
   The strip draws that edge as a light line along its foot; each tab is
   framed on three sides, and the selected one drops its foot and takes the
   page's colour so it joins the page. Hover lights the label rather than
   shading the tab. The tighter padding goes through --tab-pad at low
   specificity, so .is-sm and the header's phone sizes still override it. */
:where([data-edge="bevel"]) .nook-tab {
    --tab-pad: 14px;
}
[data-edge="bevel"] .nook-tabs {
    align-items: flex-end;
    gap: 3px;
    padding: 8px 8px 0;
    box-shadow: inset 0 -1px 0 var(--edge-light);
}
[data-edge="bevel"] .nook-tab {
    height: 30px;
    border: 1px solid;
    border-color: var(--edge-light) var(--edge-dark) var(--edge-light) var(--edge-light);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    background: var(--bg-secondary);
    color: var(--button-text);
    font-weight: 400;
}
[data-edge="bevel"] .nook-tab.is-sm {
    height: 26px;
}
[data-edge="bevel"] .nook-tab:hover {
    background: var(--bg-secondary);
    color: var(--selected-text);
}
[data-edge="bevel"] .nook-tab[aria-selected="true"] {
    border-bottom-color: transparent;
    background: var(--bg-primary);
    color: var(--selected-text);
}
[data-edge="bevel"] .nook-tab[aria-selected="true"] .nook-tab-label::after {
    display: none;
}
[data-edge="bevel"] .nook-tab:focus-visible {
    outline: 1px var(--bevel-focus-style) #000;
    outline-offset: -4px;
}
/* A frame's own divider would cut the selected tab off from the page. */
[data-edge="bevel"] .nook-tabs-frame {
    border-bottom: 0;
}
/* The header is an opaque olive panel here, so clipped tabs fade into it
   rather than into the page. */
[data-edge="bevel"] .nook-header > .nook-tabs-frame {
    --tabs-surface: var(--bg-header);
}
/* Scrolling tucks the tabs away: they fade while the header's backdrop
   retracts under them. Over an opaque panel that briefly shows ghost tabs on
   the posts and swaps a grey band for white in 200ms, a flash on every turn
   of the wheel. Here the strip is a solid panel that slides up behind the
   title row instead, so the band leaves as one piece. */
[data-edge="bevel"] .nook-header > .nook-title-row {
    background: var(--bg-header);
}
[data-edge="bevel"] .nook-header > .nook-tabs-frame {
    background: var(--bg-header);
}
[data-edge="bevel"] .nook-header.tabs-hidden .nook-tabs-frame {
    opacity: 1;
}
/* Inside a dialog the page under the tabs is the dialog's own face, which a
   theme with grey windows around white lists (Windows 95) sets apart from
   the page background. */
[data-edge="bevel"] .nook-dialog .nook-tabs-frame {
    --tabs-surface: var(--dialog-bg);
}
[data-edge="bevel"] .nook-dialog .nook-tab[aria-selected="true"] {
    background: var(--dialog-bg);
}

/* Analytics: tiles are raised panels on the darker dialog, empty heat cells
   and meter tracks are sunken slots, sections are split by an etched line,
   and the tag chips are raised buttons like the rest. */
[data-edge="bevel"] .nook-stats {
    --nook-track: var(--field-bg);
}
[data-edge="bevel"] .nook-stats .stats-card,
[data-edge="bevel"] .nook-stats .stats-card:hover {
    border-color: var(--bevel-raised);
    box-shadow: var(--bevel-raised-inner);
}
[data-edge="bevel"] .nook-stats .stats-card.nook-stats-link:hover {
    background: var(--nook-tile);
    border-color: var(--bevel-raised);
    color: var(--selected-text);
}
[data-edge="bevel"] .nook-stats .stats-card.nook-stats-link:active {
    border-color: var(--bevel-sunken);
    box-shadow: var(--bevel-sunken-inner);
}
[data-edge="bevel"] .nook-stats-section + .nook-stats-section {
    border-top-color: var(--edge-dark);
    box-shadow: inset 0 1px 0 var(--edge-light);
}
/* The storage and status bars are a sunken well holding one raised block
   per part, lit on its top and left like a filled heat cell; the chosen part
   takes the mark colour. */
[data-edge="bevel"] .nook-segments {
    gap: 2px;
    padding: 2px;
    border: 1px solid;
    border-color: var(--bevel-sunken);
    background: var(--bevel-meter-bg);
    box-shadow: var(--bevel-sunken-inner);
}
[data-edge="bevel"] .nook-segments.is-joined {
    gap: 0;
}
[data-edge="bevel"] .nook-segment {
    border-radius: 0;
    background: var(--gray-700);
    box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .3), inset -1px -1px 0 rgba(0, 0, 0, .35);
    opacity: 1;
}
[data-edge="bevel"] .nook-segment.is-active {
    background: var(--nook-mark);
}
/* The bar chart is the skin's graph panel: a sunken dark-green well that
   Steam fills with narrow flat maize columns standing on its floor, with no
   grid or baseline. Each bar holds more columns than it can fit; they wrap
   onto lines below the bar's height, which are clipped, so a bar of any
   width shows only whole columns. */
[data-edge="bevel"] .nook-years {
    padding: 8px 6px 2px;
    border: 1px solid;
    border-color: var(--bevel-sunken);
    background: var(--field-bg);
    box-shadow: var(--bevel-sunken-inner);
}
[data-edge="bevel"] .nook-year-track {
    border-bottom: 0;
}
[data-edge="bevel"] .nook-year-bar {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: center;
    gap: 0 1px;
    overflow: hidden;
    border-radius: 0;
    background: transparent;
}
[data-edge="bevel"] .nook-year-col {
    display: block;
    flex: none;
    width: 2px;
    height: 100%;
    background: var(--nook-mark);
}
/* Heatmaps: square cells. An empty one is a sunken slot; a filled one is a
   raised block, lit on its top and left. */
[data-edge="bevel"] .nook-heat-cell,
[data-edge="bevel"] .nook-cal-day,
[data-edge="bevel"] .nook-cal-month-days .nook-cal-day,
[data-edge="bevel"] .nook-tall-row .nook-heat-cell {
    border-radius: 0;
    box-shadow: inset 1px 1px 0 var(--edge-dark), inset -1px -1px 0 color-mix(in srgb, var(--edge-light) 45%, transparent);
}
[data-edge="bevel"] :is(.nook-heat-cell, .nook-cal-day):not([data-level="0"]):is([data-level]) {
    box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .3), inset -1px -1px 0 rgba(0, 0, 0, .35);
}
[data-edge="bevel"] .nook-cal-day.is-future {
    background: transparent;
    box-shadow: inset 0 0 0 1px var(--edge-dark);
}
[data-edge="bevel"] .nook-heatmap .nook-heat-row .nook-heat-cell:hover,
[data-edge="bevel"] .nook-tall-row .nook-heat-cell:hover,
[data-edge="bevel"] .nook-cal-day:is(:hover, :focus-visible) {
    outline: 1px solid var(--selected-text);
    outline-offset: 0;
}

/* Scrollbars are wide, square and drawn like the controls: a raised thumb in
   a lighter gutter (--scrollbar-track, which may be a pattern, over
   --scrollbar-bg). Chrome only honours the ::-webkit-
   pseudo-elements while scrollbar-width and scrollbar-color are auto, so the
   thin overlay settings from styles.css are reset here; Firefox has no
   pseudo-elements and takes the two colours instead. The page's own
   scrollbar belongs to <html>, which carries data-edge itself, so every
   rule names the root as well as its descendants. Only a mouse gets them:
   on touch screens a 16px gutter takes width from narrow dialogs and the
   arrows can't be aimed at, so the thin overlay bar stays. */
@media (hover: hover) and (pointer: fine) {
    [data-edge="bevel"],
    [data-edge="bevel"] * {
        scrollbar-width: auto;
        scrollbar-color: auto;
    }
    @supports not selector(::-webkit-scrollbar) {
        [data-edge="bevel"],
        [data-edge="bevel"] * {
            scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-bg);
        }
    }
    [data-edge="bevel"]::-webkit-scrollbar,
    [data-edge="bevel"] ::-webkit-scrollbar {
        width: 16px;
        height: 16px;
    }
    [data-edge="bevel"]::-webkit-scrollbar-track,
    [data-edge="bevel"] ::-webkit-scrollbar-track {
        background: var(--scrollbar-track);
    }
    [data-edge="bevel"]::-webkit-scrollbar-corner,
    [data-edge="bevel"] ::-webkit-scrollbar-corner {
        background: var(--scrollbar-bg);
    }
    [data-edge="bevel"]::-webkit-scrollbar-thumb,
    [data-edge="bevel"] ::-webkit-scrollbar-thumb,
    [data-edge="bevel"]::-webkit-scrollbar-thumb:hover,
    [data-edge="bevel"] ::-webkit-scrollbar-thumb:hover {
        border: 1px solid;
        border-color: var(--bevel-raised);
        border-radius: 0;
        background: var(--scrollbar-thumb);
        box-shadow: var(--bevel-raised-inner);
    }

    /* The gutter ends in square raised buttons with a small arrow, like the skin.
       A data-URI icon can't read theme colours, so each arrow is two half
       triangles drawn with diagonal gradients and placed side by side. Buttons
       are named by position rather than :single-button, which macOS never
       matches; the extra pair a double-button layout adds is hidden. */
    [data-edge="bevel"]::-webkit-scrollbar-button:start:decrement,
    [data-edge="bevel"]::-webkit-scrollbar-button:end:increment,
    [data-edge="bevel"] ::-webkit-scrollbar-button:start:decrement,
    [data-edge="bevel"] ::-webkit-scrollbar-button:end:increment {
        display: block;
        width: 16px;
        height: 16px;
        border: 1px solid;
        border-color: var(--bevel-raised);
        background-color: var(--scrollbar-thumb);
        box-shadow: var(--bevel-raised-inner);
        background-repeat: no-repeat;
        background-size: 4px 4px;
    }
    [data-edge="bevel"]::-webkit-scrollbar-button:start:increment,
    [data-edge="bevel"]::-webkit-scrollbar-button:end:decrement,
    [data-edge="bevel"] ::-webkit-scrollbar-button:start:increment,
    [data-edge="bevel"] ::-webkit-scrollbar-button:end:decrement {
        display: none;
    }
    [data-edge="bevel"]::-webkit-scrollbar-button:vertical:decrement,
    [data-edge="bevel"] ::-webkit-scrollbar-button:vertical:decrement {
        background-image: linear-gradient(to top left, var(--scrollbar-arrow) 50%, transparent 50%), linear-gradient(to top right, var(--scrollbar-arrow) 50%, transparent 50%);
        background-position: 3px 5px, 7px 5px;
    }
    [data-edge="bevel"]::-webkit-scrollbar-button:vertical:increment,
    [data-edge="bevel"] ::-webkit-scrollbar-button:vertical:increment {
        background-image: linear-gradient(to bottom left, var(--scrollbar-arrow) 50%, transparent 50%), linear-gradient(to bottom right, var(--scrollbar-arrow) 50%, transparent 50%);
        background-position: 3px 5px, 7px 5px;
    }
    [data-edge="bevel"]::-webkit-scrollbar-button:horizontal:decrement,
    [data-edge="bevel"] ::-webkit-scrollbar-button:horizontal:decrement {
        background-image: linear-gradient(to top left, var(--scrollbar-arrow) 50%, transparent 50%), linear-gradient(to bottom left, var(--scrollbar-arrow) 50%, transparent 50%);
        background-position: 5px 3px, 5px 7px;
    }
    [data-edge="bevel"]::-webkit-scrollbar-button:horizontal:increment,
    [data-edge="bevel"] ::-webkit-scrollbar-button:horizontal:increment {
        background-image: linear-gradient(to top right, var(--scrollbar-arrow) 50%, transparent 50%), linear-gradient(to bottom right, var(--scrollbar-arrow) 50%, transparent 50%);
        background-position: 5px 3px, 5px 7px;
    }
    /* A pressed thumb or button sinks, and a pressed arrow moves a pixel down and
       right, as the skin draws it. The selectors repeat the position and
       direction pseudo-classes so they outrank the resting rules above. */
    [data-edge="bevel"]::-webkit-scrollbar-thumb:active,
    [data-edge="bevel"] ::-webkit-scrollbar-thumb:active,
    [data-edge="bevel"]::-webkit-scrollbar-button:start:decrement:active,
    [data-edge="bevel"]::-webkit-scrollbar-button:end:increment:active,
    [data-edge="bevel"] ::-webkit-scrollbar-button:start:decrement:active,
    [data-edge="bevel"] ::-webkit-scrollbar-button:end:increment:active {
        border-color: var(--bevel-sunken);
        box-shadow: var(--bevel-sunken-inner);
    }
    [data-edge="bevel"]::-webkit-scrollbar-button:vertical:active,
    [data-edge="bevel"] ::-webkit-scrollbar-button:vertical:active {
        background-position: 4px 6px, 8px 6px;
    }
    [data-edge="bevel"]::-webkit-scrollbar-button:horizontal:active,
    [data-edge="bevel"] ::-webkit-scrollbar-button:horizontal:active {
        background-position: 6px 4px, 6px 8px;
    }
}

/* Meters are sunken wells (--bevel-meter-bg) filled with a row of upright blocks. A single
   fill holds more fixed-size blocks than it can fit; they wrap onto lines
   below the meter's height, which are clipped, so a fill of any width shows
   only whole blocks, sized by --meter-block-width and --meter-block-gap. A
   parts meter that carries whole cells (the Jobs bar)
   shows those instead, so each block is one colour and a part never ends
   halfway through one. */
[data-edge="bevel"] .nook-meter {
    height: 14px;
    padding: 2px;
    border: 1px solid;
    border-color: var(--bevel-sunken);
    border-radius: 0;
    background: var(--bevel-meter-bg);
}
[data-edge="bevel"] .nook-meter-fill {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 0 var(--meter-block-gap);
    overflow: hidden;
    border-radius: 0;
    background: transparent;
}
[data-edge="bevel"] .nook-meter-block {
    display: block;
    flex: none;
    width: var(--meter-block-width);
    height: 100%;
    background: var(--meter-fill, var(--accent-color));
}
[data-edge="bevel"] .nook-meter:has(> .nook-meter-cell) > .nook-meter-part {
    display: none;
}
[data-edge="bevel"] .nook-meter-cell {
    display: block;
    flex: 1 1 0;
    min-width: 0;
}
/* Indeterminate: a run of lit blocks walks across the well. Each cell is lit
   for the first eighth of the cycle, offset by its index. */
[data-edge="bevel"] .nook-meter-cell.is-sweep {
    animation: bevel-cell-sweep 1.6s steps(1, end) infinite;
    animation-delay: calc(var(--i) * 0.05s - 1.6s);
}
@keyframes bevel-cell-sweep {
    0% { background: var(--accent-color); }
    12.5%, 100% { background: transparent; }
}
@media (prefers-reduced-motion: reduce) {
    [data-edge="bevel"] .nook-meter-cell.is-sweep { animation: none; }
    [data-edge="bevel"] .nook-meter-cell.is-sweep:nth-of-type(-n + 12) { background: var(--accent-color); }
}

/* Sliders are a one-pixel light rail with an upright rectangular thumb. */
[data-edge="bevel"] .nook-font-slider input::-webkit-slider-runnable-track {
    height: 1px;
    border-radius: 0;
    background: var(--button-text);
}
[data-edge="bevel"] .nook-font-slider input::-webkit-slider-thumb {
    width: 8px;
    height: 16px;
    margin-top: -7.5px;
    border-radius: 0;
    background: var(--button-text);
}
[data-edge="bevel"] .nook-font-slider input::-moz-range-track,
[data-edge="bevel"] .nook-font-slider input::-moz-range-progress {
    height: 1px;
    border-radius: 0;
    background: var(--button-text);
}
[data-edge="bevel"] .nook-font-slider input::-moz-range-thumb {
    width: 8px;
    height: 16px;
    border-radius: 0;
    background: var(--button-text);
}
[data-edge="bevel"] .nook-font-slider input:focus-visible {
    outline: 1px var(--bevel-focus-style) #000;
    outline-offset: 2px;
}

/* Video badges and the desktop player are panels of the window rather than
   X's translucent overlays: a raised olive bar with bevelled buttons, the
   seek bar as a sunken well filled with the accent, and the slider's
   upright thumb. The phone feed and viewer keep X's layout, which their
   gestures and safe-area spacing are built around. */
[data-edge="bevel"] .media-video-duration,
[data-edge="bevel"] .media-gif-indicator {
    border: 1px solid;
    border-color: var(--bevel-raised);
    border-radius: 0;
    background: var(--bg-secondary);
    color: var(--button-text);
}
/* The GIF badge's pause half and label carry X's own dark fills, which put
   the panel's dark label on black; the badge is one panel face instead, the
   halves split by a groove. */
[data-edge="bevel"] .media-gif-indicator {
    gap: 0;
}
[data-edge="bevel"] :is(.media-gif-action, .media-gif-label) {
    border-radius: 0;
    background: none;
}
[data-edge="bevel"] .media-gif-action {
    border-right: 1px solid var(--gray-700);
}
/* A text-less post's page dashes are tiny sunken meter slots that fill with
   the accent as the strip passes them. --dot-active runs 0 to 1 with the
   scroll, so the fill mixes rather than switching. The slots are taller than
   X's 4px dashes so the bevel still leaves a visible fill. */
[data-edge="bevel"] .media-carousel-dots {
    height: 8px;
    margin-bottom: 10px;
}
[data-edge="bevel"] .media-carousel-dots > span {
    box-sizing: border-box;
    width: calc(14px + 12px * var(--dot-active, 0));
    border: 1px solid;
    border-color: var(--bevel-sunken);
    border-radius: 0;
    box-shadow: var(--bevel-sunken-inner);
    background: color-mix(in srgb, var(--accent-color) calc(100% * var(--dot-active, 0)), var(--bevel-meter-bg));
    opacity: 1;
}
@media (min-width: 641px) and (pointer: fine) {
    [data-edge="bevel"] .video-control-bar {
        padding: 0 6px 3px;
        border-top: 1px solid var(--edge-light);
        background: var(--bg-secondary);
        color: var(--button-text);
        font-family: inherit;
    }
    [data-edge="bevel"] .video-control-row { gap: 4px; }
    [data-edge="bevel"] .video-control-row .video-button {
        flex-basis: 30px;
        width: 30px;
        height: 28px;
        border: 1px solid;
        border-color: var(--bevel-raised);
        border-radius: 0;
        background: var(--bg-secondary);
        color: var(--button-text);
    }
    [data-edge="bevel"] .video-control-row .video-button svg { width: 16px; height: 16px; }
    [data-edge="bevel"] .video-control-row .video-button:hover { color: var(--selected-text); }
    [data-edge="bevel"] .video-control-row .video-button:active { border-color: var(--bevel-sunken); }
    [data-edge="bevel"] .video-button:focus-visible,
    [data-edge="bevel"] .video-volume:focus-visible,
    [data-edge="bevel"] .media-video-player:focus-visible {
        outline: 1px var(--bevel-focus-style) #000;
        outline-offset: -4px;
    }
    [data-edge="bevel"] .video-time {
        color: var(--text-secondary);
        font-size: 12px;
    }
    [data-edge="bevel"] .video-seek { margin: 0 2px; width: calc(100% - 4px); }
    [data-edge="bevel"] .video-seek::-webkit-slider-runnable-track {
        height: 6px;
        border: 1px solid;
        border-color: var(--bevel-sunken);
        border-radius: 0;
        background: linear-gradient(to right, var(--accent-color) var(--video-progress), var(--field-bg) var(--video-progress));
    }
    [data-edge="bevel"] .video-seek::-moz-range-track {
        height: 6px;
        border: 1px solid;
        border-color: var(--bevel-sunken);
        border-radius: 0;
        background: var(--field-bg);
    }
    [data-edge="bevel"] .video-seek::-moz-range-progress {
        height: 6px;
        border-radius: 0;
        background: var(--accent-color);
    }
    [data-edge="bevel"] .video-seek::-webkit-slider-thumb {
        width: 8px;
        height: 16px;
        margin-top: -6px;
        border-radius: 0;
        background: var(--button-text);
        opacity: 1;
    }
    [data-edge="bevel"] .video-seek::-moz-range-thumb {
        width: 8px;
        height: 16px;
        border-radius: 0;
        background: var(--button-text);
        opacity: 1;
    }
    [data-edge="bevel"] .video-seek:focus-visible::-webkit-slider-thumb { outline: 1px var(--bevel-focus-style) #000; outline-offset: 1px; }
    [data-edge="bevel"] .video-seek:focus-visible::-moz-range-thumb { outline: 1px var(--bevel-focus-style) #000; outline-offset: 1px; }
    [data-edge="bevel"] .video-volume {
        bottom: 30px;
        border: 1px solid;
        border-color: var(--bevel-raised);
        border-radius: 0;
        background: var(--bg-secondary);
    }
    [data-edge="bevel"] .video-volume::-webkit-slider-runnable-track {
        border: 1px solid;
        border-color: var(--bevel-sunken);
        border-radius: 0;
        background: var(--field-bg);
    }
    [data-edge="bevel"] .video-volume::-moz-range-track {
        border: 1px solid;
        border-color: var(--bevel-sunken);
        border-radius: 0;
        background: var(--field-bg);
    }
    [data-edge="bevel"] .video-volume::-webkit-slider-thumb {
        width: 16px;
        height: 8px;
        margin-left: -7px;
        border-radius: 0;
        background: var(--button-text);
    }
    [data-edge="bevel"] .video-volume::-moz-range-thumb {
        width: 16px;
        height: 8px;
        border-radius: 0;
        background: var(--button-text);
    }
    /* The poster glyph is a grey disc with a triangle; the disc is dropped
       so the button itself can be the bevelled box. */
    [data-edge="bevel"] .video-center-play {
        width: 56px;
        height: 56px;
        border: 1px solid;
        border-color: var(--bevel-raised);
        border-radius: 0;
        background: var(--bg-secondary);
    }
    [data-edge="bevel"] .video-center-play svg { width: 44px; height: 44px; }
    [data-edge="bevel"] .video-center-play svg circle { display: none; }
    [data-edge="bevel"] .video-center-play svg path { fill: var(--button-text); }
    [data-edge="bevel"] .video-center-play:hover { background: var(--bg-secondary); }
    [data-edge="bevel"] .video-center-play:hover svg path { fill: var(--selected-text); }
}
