/*
 * Dark colour scheme, using the palette from Visual Studio Code's default
 * "Dark+" theme.
 *
 * Loaded on every page from templates/base.html and scoped entirely to
 * body.theme-dark, so it is inert unless the user has chosen it in
 * /settings/appearance-menu/. The choice is stored as the `theme` client
 * preference on the user; see server/settings/appearance_view.js.
 *
 * The custom properties below are named after the VS Code theme tokens they
 * are taken from, so a colour can be checked against its source rather than
 * guessed at. CTForge's surfaces are then mapped onto the editor's:
 *
 *     page background, topic content   ->  editor.background
 *     blips, popups, side panels       ->  sideBar / editorWidget.background
 *     header bars, tool strips         ->  activityBar / titleBar.background
 *     text fields                      ->  input.background
 *     ordinary buttons                 ->  button.secondaryBackground
 *     submit buttons                   ->  button.background, the blue one
 *
 * Two rules for editing this file:
 *
 *   - Set background-color, never the `background` shorthand, on anything that
 *     might carry a sprite. Most icons in this interface are background images
 *     on otherwise empty elements, and the shorthand silently drops them.
 *   - Conversely, the button family in page.css paints itself with a light
 *     linear-gradient. That is a background-image and it covers any
 *     background-color set over it, so those buttons need it cleared - see the
 *     block further down, and keep its selector list in step with page.css.
 *
 * Every colour here resolves through var(). A browser without custom
 * properties drops each declaration and shows the default theme, which is the
 * right outcome for one that old.
 */

body.theme-dark {
    /* Backgrounds, darkest to lightest. */
    --vscode-editor-background: #1e1e1e;
    --vscode-sideBar-background: #252526;
    --vscode-activityBar-background: #333333;
    --vscode-input-background: #3c3c3c;

    /* Text. */
    --vscode-editor-foreground: #d4d4d4;
    --vscode-foreground: #cccccc;
    --vscode-descriptionForeground: #9d9d9d;
    /* VS Code's own textLink.foreground is #3794ff, and links were the last
       thing in this interface still painted blue. They take the foreground
       instead, and lift to white on hover so a link still answers the pointer
       without colour doing the work. */
    --rizzoma-linkForeground: #cccccc;
    --rizzoma-linkHoverForeground: #ffffff;
    --vscode-disabledForeground: #6b6b6b;

    /* Lines and edges. */
    --vscode-panel-border: #3c3c3c;
    --vscode-menu-border: #454545;
    /* The edited blip's outline. The frame around a reply is drawn entirely by
       its menu strip - 1px along the top, 2px along the bottom, and nothing on
       the blip container itself, whose borders are all zero-width - so the
       only thing separating the active reply from its neighbours is this
       colour against panel-border. It is well clear of #3c3c3c for that
       reason, and neutral rather than the focus blue this theme is getting
       away from. */
    --rizzoma-activeBorder: #8c9196;
    --vscode-focusBorder: #007fd4;

    /* Buttons. */
    --vscode-button-background: #0e639c;
    --vscode-button-hoverBackground: #1177bb;
    --vscode-button-foreground: #ffffff;
    --vscode-button-secondaryBackground: #3a3d41;
    --vscode-button-secondaryHoverBackground: #45494e;

    /* Lists, selection, scrollbars. */
    --vscode-activityBarBadge-background: #007acc;
    --vscode-list-hoverBackground: #2a2d2e;
    --vscode-list-activeSelectionBackground: #094771;
    --vscode-list-inactiveSelectionBackground: #37373d;
    --vscode-editor-selectionBackground: #264f78;
    --vscode-input-placeholderForeground: #a6a6a6;
    --vscode-scrollbarSlider-background: #79797966;
    --vscode-scrollbarSlider-hoverBackground: #646464b3;

    background: var(--vscode-editor-background);
    color: var(--vscode-foreground);
}

/* ---------------------------------------------------------------- surfaces */

body.theme-dark .page-content,
body.theme-dark .navigation-container,
body.theme-dark .wave-container,
body.theme-dark .inner-wave-container,
body.theme-dark .wave-content,
body.theme-dark .wave,
body.theme-dark .tabs-container,
body.theme-dark .topic-list,
body.theme-dark .search-panel,
body.theme-dark .content,
body.theme-dark .content-wrap,
body.theme-dark .settings-content-block {
    background-color: var(--vscode-editor-background);
    color: var(--vscode-foreground);
}

/* The documents themselves, one step up from the page, the way the editor
   sits above its surroundings. */
body.theme-dark .blip,
body.theme-dark .root-blip,
body.theme-dark .blip-container,
body.theme-dark .editor,
body.theme-dark .topic-message-container {
    background-color: var(--vscode-sideBar-background);
    color: var(--vscode-editor-foreground);
}

/* Header strips and the panels either side: the activity bar of this
   interface. */
body.theme-dark .wave-header,
body.theme-dark .wave-header-section,
body.theme-dark .right-tools-panel,
body.theme-dark .left-menu-block,
body.theme-dark .header,
body.theme-dark .header-wrap,
body.theme-dark .footer {
    background-color: var(--vscode-activityBar-background);
    color: var(--vscode-foreground);
    border-color: var(--vscode-panel-border);
}

/* ------------------------------------------------------------------ popups */

/*
 * .internal-container is the shared 9px-border frame behind every popup in the
 * topic view - invite, share, manage members, the account menu - so recolouring
 * it covers all of them at once. The border and the background are the same
 * colour by design; that is what gives the popup its padding.
 */
body.theme-dark .internal-container,
body.theme-dark .popup-menu-container,
body.theme-dark .account-popup,
body.theme-dark .crowd-popup,
body.theme-dark .link-popup,
body.theme-dark .mention-recipient-popup,
body.theme-dark .widget-window-body,
body.theme-dark .add-form,
body.theme-dark .manage-participants-form,
body.theme-dark .wave-share-popup,
body.theme-dark .ctm,
body.theme-dark .autocomplete-results {
    background-color: var(--vscode-sideBar-background);
    border-color: var(--vscode-sideBar-background);
    color: var(--vscode-foreground);
}

body.theme-dark .autocomplete-results .autocomplete-item:hover,
body.theme-dark .popup-menu-container .menu-item:hover,
body.theme-dark .js-search-result:hover {
    background-color: var(--vscode-list-hoverBackground);
}

/*
 * The selected row in the topic list. Its own rule paints it #5DABF7, a blue
 * picked to sit on white. The editor's equivalent is the *inactive* selection
 * grey rather than the focused blue: this list does not hold the keyboard
 * focus while a topic is open, which is exactly the state VS Code renders
 * #37373d for.
 */
body.theme-dark .js-search-result.active,
body.theme-dark .search-result-item.active,
body.theme-dark .market-panel-result.active,
body.theme-dark .autocomplete-results .autocomplete-item.active {
    background-color: var(--vscode-list-inactiveSelectionBackground);
    color: var(--vscode-foreground);
}

body.theme-dark .search-result-item:hover,
body.theme-dark .search-result-item.active:hover {
    background-color: var(--vscode-list-hoverBackground);
}

body.theme-dark .search-result-item.active:hover {
    background-color: var(--vscode-list-inactiveSelectionBackground);
}

/* The unread count on a selected row: a badge, in the editor's badge blue. */
body.theme-dark .search-result-item.active > .unread-blips-indicator > div {
    background-color: var(--vscode-activityBarBadge-background);
}

/* ------------------------------------------------------------------ fields */

body.theme-dark input[type="text"],
body.theme-dark input[type="email"],
body.theme-dark input[type="password"],
body.theme-dark input[type="search"],
body.theme-dark textarea,
body.theme-dark select,
body.theme-dark .button-like {
    background-color: var(--vscode-input-background);
    border: 1px solid var(--vscode-input-background);
    color: var(--vscode-foreground);
}

body.theme-dark input[type="text"]:focus,
body.theme-dark input[type="email"]:focus,
body.theme-dark input[type="password"]:focus,
body.theme-dark input[type="search"]:focus,
body.theme-dark textarea:focus {
    border-color: var(--vscode-focusBorder);
}

body.theme-dark input::-webkit-input-placeholder { color: var(--vscode-input-placeholderForeground); }
body.theme-dark input::placeholder { color: var(--vscode-input-placeholderForeground); }

/*
 * The invite field carries an olive colour from the light theme that turns
 * unreadable here; it is the "enter email" prompt.
 */
body.theme-dark .add-form .internal-container .input-email {
    color: var(--vscode-foreground);
}

body.theme-dark button,
body.theme-dark .button {
    background-color: var(--vscode-button-secondaryBackground);
    border: 1px solid var(--vscode-button-secondaryBackground);
    color: var(--vscode-foreground);
}

body.theme-dark button:hover,
body.theme-dark .button:hover {
    background-color: var(--vscode-button-secondaryHoverBackground);
}

/*
 * These paint themselves with a light linear-gradient, which is a
 * background-image and so sits on top of any background-color set here: the
 * button stayed light while its label, now light too, washed out against it.
 *
 * The list is the button family from page.css, copied rather than reduced to
 * `button`, because the icon buttons in the right tools panel are <button> as
 * well and their glyphs are background-images that have to survive. Keep the
 * two lists in step if page.css gains a button.
 */
body.theme-dark .common-create-wave-by-wizard,
body.theme-dark .create-wave-by-wizard,
body.theme-dark .create-wave,
body.theme-dark .add-block-button,
body.theme-dark .manage-participants-form button,
body.theme-dark .delete-from-wave,
body.theme-dark .selectBox.button-like,
body.theme-dark a.button-like,
body.theme-dark .wave-share-button,
body.theme-dark .show-more-participants,
body.theme-dark .mention-recipient-popup button,
body.theme-dark .button,
body.theme-dark .button:not([disabled="disabled"]):hover {
    background-image: none;
    background-color: var(--vscode-button-secondaryBackground);
    color: var(--vscode-foreground);
}

/*
 * The Insert button in the image popup, which is the same trap one file over:
 * `.inner-button` and `.copy-link-button` are declared in wave.css rather than
 * page.css, so they were missing from the list above and kept their light
 * gradient - a pale button with pale text on it.
 *
 * The light rule also gives them `text-shadow: white 1px 1px 1px`, which is a
 * white halo around what is now light text, so that goes too. The adjacent URL
 * field is `.outer-input`; it is styled here as well, because a dark button
 * fused to a white input looks like a rendering fault rather than a theme.
 */
body.theme-dark .widget-window-body .outer-input + .inner-button,
body.theme-dark .copy-link-button {
    background-image: none;
    background-color: var(--vscode-button-secondaryBackground);
    color: var(--vscode-foreground);
    text-shadow: none;
}

body.theme-dark .widget-window-body .outer-input + .inner-button:not([disabled="disabled"]):hover,
body.theme-dark .copy-link-button:not([disabled="disabled"]):hover {
    background-image: none;
    background-color: var(--vscode-button-secondaryHoverBackground);
}

body.theme-dark .widget-window-body .outer-input {
    background-color: var(--vscode-input-background);
    border-color: var(--vscode-menu-border);
    color: var(--vscode-foreground);
}

/*
 * The divider between "insert by URL" and "upload a file". It was an inline
 * rgba(0,0,0,.25), invisible here and unreachable without !important, so it
 * became a class in editor/file/template.js.
 */
body.theme-dark .image-insert-divider {
    background: var(--vscode-panel-border);
}

/*
 * Submit buttons look like every other button. VS Code paints its primary
 * action blue, but blue is the colour this theme has been asked to keep out,
 * and a lone blue button on a settings page reads as decoration rather than
 * emphasis.
 *
 * Not the sign-in dialog's buttons (.btn: Sign in, Sign up, Reset password).
 * Their value is empty and their label is drawn in the auth/btns.png sprite,
 * so clearing background-image left a blank dark button (issue #3) - readable
 * only on hover, where the dialog's own :hover rule outranks this one and
 * puts the sprite back. The dialog stays a white card in this theme, and its
 * teal buttons belong on it.
 */
body.theme-dark input[type="submit"]:not(.btn),
body.theme-dark .submit-block button {
    background-image: none;
    background-color: var(--vscode-button-secondaryBackground);
    border: 1px solid var(--vscode-button-secondaryBackground);
    color: var(--vscode-foreground);
}

body.theme-dark input[type="submit"]:not(.btn):hover,
body.theme-dark .submit-block button:hover {
    background-color: var(--vscode-button-secondaryHoverBackground);
}

/*
 * The topic-creation wizard's "Create new topic", and the invite popup's
 * "Next", which shares its rule in navigation.css. Both are a green gradient
 * with a 2px white border - the loudest thing on the screen in a dark window,
 * and the border in particular reads as a light-theme leftover.
 *
 * They are primary actions, so the obvious answer is button.background, the
 * VS Code blue. They get the neutral button instead, for the same reason the
 * submit buttons above do: this theme was asked to keep blue out. Emphasis
 * comes from size and position here, which is what the wizard already gives
 * them - full width at the foot of the popup.
 *
 * background-image, not just background-color: the gradient is an image and
 * would otherwise sit on top of whatever colour is set.
 */
body.theme-dark .ctm-create-topic,
body.theme-dark .invite-tool-next {
    background-image: none;
    background-color: var(--vscode-button-secondaryBackground);
    border: 1px solid var(--vscode-button-secondaryBackground);
    color: var(--vscode-foreground);
}

body.theme-dark .ctm-create-topic:hover,
body.theme-dark .invite-tool-next:hover {
    background-image: none;
    background-color: var(--vscode-button-secondaryHoverBackground);
    border-color: var(--vscode-button-secondaryHoverBackground);
}

/*
 * A disabled submit kept the primary blue while its label went to the disabled
 * grey - the button looked live and its text looked broken. Disabled means
 * disabled all through.
 */
body.theme-dark input[type="submit"]:not(.btn)[disabled],
body.theme-dark .submit-block button[disabled],
body.theme-dark .submit-block button[disabled="disabled"] {
    background-color: var(--vscode-button-secondaryBackground);
    border-color: var(--vscode-button-secondaryBackground);
    color: var(--vscode-disabledForeground);
}

body.theme-dark button[disabled],
body.theme-dark .button[disabled],
body.theme-dark input[type="submit"][disabled] {
    color: var(--vscode-disabledForeground);
}

/* -------------------------------------------------------------------- text */

/*
 * Every label in this interface is embossed with a white text-shadow, which is
 * what gives the buttons their raised look against a light background. On a
 * dark one it turns into a halo and makes the text read as greyed out - the
 * Invite and Share labels looked disabled. There are fifteen such rules across
 * the stylesheets, so they are dropped in one go rather than chased.
 */
body.theme-dark button,
body.theme-dark .button,
body.theme-dark .button-like,
body.theme-dark input[type="submit"],
body.theme-dark .wave-header,
body.theme-dark .tabs-container,
body.theme-dark .search-lists-container,
body.theme-dark .right-tools-panel,
body.theme-dark .tips-box {
    text-shadow: none;
}

body.theme-dark a {
    color: var(--rizzoma-linkForeground);
}

body.theme-dark a:hover,
body.theme-dark .change-password:hover,
body.theme-dark .introduce .next:hover,
body.theme-dark .introduce .prev:hover,
body.theme-dark .introduce .switch-link:hover,
body.theme-dark .introduce .close-txt:hover {
    color: var(--rizzoma-linkHoverForeground);
}

body.theme-dark .menu-info-description,
body.theme-dark .theme-option-description,
body.theme-dark .blip-info,
body.theme-dark .date,
body.theme-dark .snippet {
    color: var(--vscode-descriptionForeground);
}

body.theme-dark .header-title,
body.theme-dark .content-item-title {
    color: var(--vscode-foreground);
}

/* ----------------------------------------------------------------- borders */

body.theme-dark .blip,
body.theme-dark .root-blip,
body.theme-dark .wave-header,
body.theme-dark .content-item,
body.theme-dark .left-menu-block,
body.theme-dark .contacts-sync-button-container,
body.theme-dark .wave-share-window-delimiter {
    border-color: var(--vscode-panel-border);
}

/*
 * White separators drawn as a 1px ::before, which read as bright scars on a
 * dark background.
 */
body.theme-dark .add-form .contacts-sync-button-container:not(.first-sync)::before {
    border-top-color: var(--vscode-panel-border);
}

/* ------------------------------------------------------- selection, scroll */

body.theme-dark ::selection {
    background-color: var(--vscode-editor-selectionBackground);
    color: var(--vscode-editor-foreground);
}

/* The editor's scrollbars: no track, a translucent slider that darkens on
   hover. */
body.theme-dark ::-webkit-scrollbar {
    width: 14px;
    height: 14px;
}

body.theme-dark ::-webkit-scrollbar-track,
body.theme-dark ::-webkit-scrollbar-corner {
    background-color: transparent;
}

body.theme-dark ::-webkit-scrollbar-thumb {
    background-color: var(--vscode-scrollbarSlider-background);
}

body.theme-dark ::-webkit-scrollbar-thumb:hover {
    background-color: var(--vscode-scrollbarSlider-hoverBackground);
}

/* ------------------------------------------------- panels missed by the above
 *
 * Found by walking the rendered pages and reporting every visible element
 * whose computed background is light; these are the ones that set their own
 * colour deep enough in the cascade to survive the blocks above.
 */

body.theme-dark .search-lists-container,
body.theme-dark .search-lists-container .status-bar,
body.theme-dark .js-lists-container,
body.theme-dark .tips-box,
body.theme-dark .tips-toggle-container,
body.theme-dark .js-tips-toggle,
body.theme-dark .settings-header,
body.theme-dark .content-item-data,
body.theme-dark .bottom-blip-menu,
body.theme-dark .read-only-menu,
body.theme-dark .color-panel {
    background-color: var(--vscode-sideBar-background);
    color: var(--vscode-foreground);
}

/*
 * The right-hand tool strip draws its glyphs as sprite background-images, so
 * only the colour is touched here - a `background` shorthand would take the
 * sprite with it.
 */
body.theme-dark .right-tools-panel .hide-replies,
body.theme-dark .right-tools-panel .show-replies,
body.theme-dark .right-tools-panel .text-view,
body.theme-dark .right-tools-panel .mindmap-view,
body.theme-dark .right-tools-panel .mindmap-long-view,
body.theme-dark .right-tools-panel .next-unread-blip {
    background-color: var(--vscode-activityBar-background);
    color: var(--vscode-foreground);
}

/*
 * Control labels. These carry greys chosen against a light background - the
 * New button's is #696969 - and the selectors setting them are class-heavy
 * enough to outweigh the plain `button` rule above, so the panels are named
 * to get back over them rather than reaching for !important.
 */
body.theme-dark .navigation-container button,
body.theme-dark .tabs-container button,
body.theme-dark .wave-header button,
body.theme-dark .search-lists-container button,
body.theme-dark .tips-box button,
body.theme-dark .bottom-blip-menu button,
body.theme-dark .read-only-menu button {
    color: var(--vscode-foreground);
}

body.theme-dark .settings-content-block input[type="submit"] {
    color: var(--vscode-foreground);
}

body.theme-dark .navigation-container button[disabled],
body.theme-dark .wave-header button[disabled],
body.theme-dark .bottom-blip-menu button[disabled] {
    color: var(--vscode-disabledForeground);
}

/*
 * Last few, each held by a selector more specific than the general rules:
 * the avatar placeholder (plain .avatar, white so a photo can load over it),
 * the read-only blip menu (.wave-panel > .blip-menu .read-only-menu) and its
 * buttons, and the empty-topic-list New button (.topic-message-container
 * button.create-wave).
 */
body.theme-dark .avatar,
body.theme-dark .wave-participant.avatar {
    background-color: var(--vscode-input-background);
    color: var(--vscode-foreground);
}

body.theme-dark .wave-panel > .blip-menu .read-only-menu,
body.theme-dark .read-only-menu > button,
body.theme-dark .read-only-menu > * > button,
body.theme-dark .read-only-menu > button[disabled],
body.theme-dark .read-only-menu > * > button[disabled] {
    background-color: var(--vscode-sideBar-background);
}

body.theme-dark .topic-message-container button.create-wave {
    color: var(--vscode-foreground);
}

/*
 * The insert controls beside an active blip. Originally #78bcff, and the panel
 * they sit in appears the moment a blip is being edited - a slab of blue at
 * the side of the screen. They match the other controls now; the glyphs on
 * them are white and still read.
 */
body.theme-dark .active-blip-control,
body.theme-dark .active-blip-controls .active-blip-control {
    background-color: var(--vscode-button-secondaryBackground);
    color: var(--vscode-foreground);
}

body.theme-dark .active-blip-controls .active-blip-control:hover {
    background-color: var(--vscode-button-secondaryHoverBackground);
}

body.theme-dark .active-blip-controls .active-blip-control:active {
    background-color: var(--vscode-list-activeSelectionBackground);
}

/* ------------------------------------------------------------------ borders
 *
 * Found the same way as the light backgrounds: by walking the rendered pages
 * and reporting every visible edge whose computed colour came back light.
 * #859099 is the button border from page.css, #CCD9E5 the search field's, and
 * the white ones are separators that were meant to catch the light.
 */

body.theme-dark .button,
body.theme-dark .new-topic-buttons,
body.theme-dark .js-follow,
body.theme-dark .folded-play-pict,
body.theme-dark .create-wave,
body.theme-dark .add-block-button,
body.theme-dark .wave-share-button,
body.theme-dark .show-more-participants,
body.theme-dark .delete-from-wave,
body.theme-dark .manage-participants-form button {
    border-color: var(--vscode-button-secondaryBackground);
}

body.theme-dark .search-query {
    border-color: var(--vscode-input-background);
}

/* The right-hand tool strip divides its buttons with pale rules, and the
   insert controls outline themselves in a lighter shade of their old blue. */
body.theme-dark .right-tools-panel button,
body.theme-dark .right-tools-panel .next-unread-blip,
body.theme-dark .right-tools-panel .hide-replies,
body.theme-dark .right-tools-panel .show-replies,
body.theme-dark .right-tools-panel .text-view,
body.theme-dark .right-tools-panel .mindmap-view,
body.theme-dark .right-tools-panel .mindmap-long-view {
    border-color: var(--vscode-panel-border);
}

body.theme-dark .active-blip-control {
    border-color: var(--vscode-button-background);
}

/* The blip menu's own rules and the settings button's outline. */
body.theme-dark .show-settings-button,
body.theme-dark .wave-header-button,
body.theme-dark .bottom-blip-menu,
body.theme-dark .delimitered-right,
body.theme-dark .get-blip-link,
/* A 2px white rule above the shortcuts box. Three pixels tall in all, which is
   why the sweep for light edges walked past it: it was below the size floor
   that keeps hairline decorations out of the results. */
body.theme-dark .tips-delimiter {
    border-color: var(--vscode-panel-border);
}

body.theme-dark .search-results,
body.theme-dark .search-result-item,
body.theme-dark .search-result-item.active,
body.theme-dark .js-tips-toggle,
body.theme-dark .tips-box,
body.theme-dark .avatar,
body.theme-dark .wave-participant.avatar {
    border-color: var(--vscode-panel-border);
}

/* ------------------------------------------------------- the left tab strip
 *
 * The selected tab is painted with a white-to-#e3eaf0 gradient, which left a
 * white column down the side of the window. VS Code marks the active item in
 * the activity bar with a left accent rather than a fill, so that is what this
 * does - as an inset shadow, which does not take part in layout the way a
 * border would.
 */
body.theme-dark .tabs-container .tab.active {
    background-image: none;
    background-color: var(--vscode-editor-background);
    color: var(--vscode-foreground);
    box-shadow: inset 2px 0 0 var(--vscode-focusBorder);
}

body.theme-dark .tabs-container .tab:not(.active):hover {
    background-color: var(--vscode-list-hoverBackground);
}

/* ------------------------------------------------------------------- icons
 *
 * These are sprites, so their colour cannot be set - only filtered. Three
 * kinds, each needing something different:
 *
 *   - glyphs drawn dark for a light background, which disappear here and have
 *     to be inverted;
 *   - sprites that include the light face of a button, where inverting turns
 *     the face dark and the glyph light in one go;
 *   - glyphs drawn in the old blue, which grayscale turns into the grey the
 *     editor uses for its own icons.
 *
 * The buttons carrying a sprite directly have their background dropped to
 * transparent first. A filter applies to the whole element, background
 * included, so leaving a colour there would drag it along with the glyph.
 */

/* The active tab's icon is the dark half of the sprite. Inverting alone turns
   its navy into tan, so the colour comes out with it. */
body.theme-dark .tabs-container .tab.active .pict {
    filter: invert(1) grayscale(1);
}

/* Sprites that carry a light button face: the search magnifier, its menu
   arrow, the participants and account carets, the share lock. */
body.theme-dark .search-icon,
body.theme-dark .search-header .show-search-menu-button,
body.theme-dark .search-header .clear-search-query-button,
body.theme-dark .more-participants-image,
body.theme-dark .account-show-popup,
body.theme-dark .wave-share-button .lock,
body.theme-dark .show-settings-button,
body.theme-dark .wizard-icon {
    /* grayscale as well: inverting a navy glyph on its own yields tan. */
    filter: invert(1) grayscale(1);
}

/*
 * The column resizer between the panels. The handle is a sprite of pale rules
 * inside a box, and the box's own #B5BEC5 - set by a selector specific enough
 * to need naming here - ran as a light strip down the full height of the
 * window. The strip becomes a divider and the rules keep their lightness, so
 * they read against it.
 */
body.theme-dark .resizer,
body.theme-dark .collection-container .resizer {
    background-color: var(--vscode-panel-border);
}

body.theme-dark .resizer > div {
    filter: grayscale(1);
}

/* The blue glyphs in the right-hand tool strip. */
body.theme-dark .right-tools-panel .hide-replies,
body.theme-dark .right-tools-panel .show-replies,
body.theme-dark .right-tools-panel .next-unread-blip {
    background-color: transparent;
    filter: grayscale(1) brightness(1.35);
}

body.theme-dark .right-tools-panel .icon,
body.theme-dark .bottom-blip-menu .icon,
body.theme-dark .read-only-menu .icon {
    filter: grayscale(1) brightness(1.35);
}

/* The folded corner drawn over the tips box, a white triangle. */
body.theme-dark .diag-border,
body.theme-dark .tips-toggle-status {
    filter: invert(1) grayscale(1);
}

/*
 * Avatars are left exactly as uploaded - no filter, no recolouring. The
 * placeholder behind them is dark so an image with transparency still sits on
 * something sensible, but a person's picture is their own.
 */

/* ------------------------------------------------- the blip editing controls
 *
 * blip_menu.css paints the whole editing strip #4EA0F1 - the menu itself, each
 * button on it, the Done button and the outline round a blip being edited.
 * That blue was the interface's "you are editing this" signal against a white
 * page; here it is simply loud. The strip becomes another panel, and the state
 * is carried by the focus border instead, which is what the editor does.
 */
body.theme-dark .wave-panel > .blip-menu .edit-menu,
body.theme-dark .edit-menu > button,
body.theme-dark .edit-menu > * > button,
body.theme-dark .edit-menu > button[disabled],
body.theme-dark .edit-menu > * > button[disabled],
body.theme-dark .bottom-blip-menu .finish-edit-button {
    background-color: var(--vscode-button-secondaryBackground);
    color: var(--vscode-foreground);
    border-color: var(--vscode-panel-border);
}

body.theme-dark .edit-menu > button:hover,
body.theme-dark .edit-menu > * > button:hover,
body.theme-dark .bottom-blip-menu .finish-edit-button:hover {
    background-color: var(--vscode-button-secondaryHoverBackground);
}

body.theme-dark .edit-mode > .bottom-blip-menu,
body.theme-dark .edit-mode > .blip-menu {
    border-color: var(--vscode-panel-border);
}

/* Undo, redo and the rest of the strip's glyphs are the same blue sprites as
   the right-hand panel's. */
body.theme-dark .edit-menu .icon,
body.theme-dark .blip-menu .icon,
body.theme-dark .gearwheel,
body.theme-dark .change-mode {
    filter: grayscale(1) brightness(1.35);
}

/* ---------------------------------------------------------- the search menu
 *
 * The dropdown under the search field is a white card with a #5DABF7 pill on
 * the active filter and black link text.
 */
body.theme-dark .search-header .search-menu {
    background-color: var(--vscode-sideBar-background);
    border: 1px solid var(--vscode-menu-border);
}

body.theme-dark .search-header .search-menu a {
    color: var(--vscode-foreground);
}

body.theme-dark .search-header a.active {
    background-color: var(--vscode-list-activeSelectionBackground);
    color: var(--vscode-button-foreground);
}

body.theme-dark .search-header .tags-block a {
    color: var(--rizzoma-linkForeground);
}

/* ------------------------------------------------------- dropdowns and menus
 *
 * A native <select> draws its list with the control's own colours, so the
 * Invite popup's role dropdown opened white until these were set. Menu items
 * elsewhere carried the old link blue.
 */
body.theme-dark select,
body.theme-dark select option,
body.theme-dark .add-button-select,
body.theme-dark .add-button-select option {
    background-color: var(--vscode-input-background);
    color: var(--vscode-foreground);
}

body.theme-dark .popup-menu-container a,
body.theme-dark .account-popup a,
body.theme-dark .menu-item a,
body.theme-dark .wave-share-popup a,
body.theme-dark .crowd-popup a {
    color: var(--vscode-foreground);
}

/* --------------------------------------------------------------- share popup
 *
 * Its labels are near-black (#000, #5F7484, #3C3C3C), chosen for a white card.
 */
body.theme-dark .wave-share-popup,
body.theme-dark .wave-share-popup label,
body.theme-dark .make-public-section label,
body.theme-dark .sharing-section,
body.theme-dark .share-section .wave-url {
    color: var(--vscode-foreground);
}

body.theme-dark .make-public-section .description,
body.theme-dark .wave-share-popup .description {
    color: var(--vscode-descriptionForeground);
}

/* ------------------------------------------------------------------ mindmap */

body.theme-dark .topic-mindmap-container,
body.theme-dark .topic-mindmap-container .svg-container,
body.theme-dark svg.mindmap {
    background-color: var(--vscode-editor-background);
}

/* ----------------------------------------------------------- the tips box
 *
 * The shortcut labels are #96A3AF against white, and their icons are the same
 * blue sprites as everywhere else. The folded-corner decoration is a white
 * triangle: inverting it only turned it black, so it goes - it exists to fake
 * a page curl that this theme has no use for.
 */
body.theme-dark .tips-content div div {
    color: var(--vscode-foreground);
}

body.theme-dark .tips-content img,
body.theme-dark .folded-tips-video img,
body.theme-dark .play-pict {
    filter: grayscale(1) brightness(1.35);
}

body.theme-dark .diag-border {
    display: none;
}

/*
 * One logo, on the main page and the settings pages alike: the artwork from
 * rizzoma.com, with the wordmark white for this theme and slate for the
 * default one. It is swapped, not filtered - every filter that lifts a dark
 * wordmark also moves the teal of the mark, so the 'R' stopped matching the
 * one the light theme shows. Swapping keeps the mark pixel-identical.
 *
 * Nothing else may set a filter on these: an earlier attempt left one behind
 * here and it inverted the swapped image straight back again.
 */
body.theme-dark .rizzoma-logo,
body.theme-dark .header-wrap img {
    content: url('/s/img/settings/logo-dark.png');
}

/* ---------------------------------------------------------- settings button
 *
 * Selected, it took the foreground colour for its background and disappeared.
 */
body.theme-dark .show-settings-button.active,
body.theme-dark .show-settings-button.selected,
body.theme-dark .show-settings-button:active {
    background-color: var(--vscode-list-activeSelectionBackground);
    color: var(--vscode-button-foreground);
}

/* ------------------------------------- the view switch and remaining hairlines
 *
 * Text view / Mind map are a two-state switch: whichever is *not* current gets
 * #b6c4cf, the current one #e3eaef, both with blue labels. Those selectors are
 * specific enough to survive the panel rules above, so the pair is set here -
 * current takes the selected-row grey, the other the panel colour.
 */
body.theme-dark .right-tools-panel:not(.mindmap-view) .text-view,
body.theme-dark .mindmap-view.right-tools-panel .mindmap-view {
    background-color: var(--vscode-list-inactiveSelectionBackground);
    color: var(--vscode-foreground);
}

body.theme-dark .mindmap-view.right-tools-panel .text-view,
body.theme-dark .right-tools-panel:not(.mindmap-view) .mindmap-view {
    background-color: var(--vscode-activityBar-background);
    color: var(--vscode-descriptionForeground);
}

body.theme-dark .right-tools-panel button:hover {
    background-color: var(--vscode-list-hoverBackground);
}

/* page.css draws every rule as a white line over a grey one, to look engraved
   on a light page. Both halves become the one divider colour. */
body.theme-dark hr {
    border-bottom-color: var(--vscode-panel-border);
    border-top-color: var(--vscode-panel-border);
}

/* --------------------------------------------------- last of the light panels
 *
 * Each of these is held by a selector more specific than the general popup and
 * field rules, so they are matched at the same depth here rather than by
 * adding weight to the rules above.
 */

/* The Invite popup's frame: `.add-participant-block .add-form .internal-container`
   sets both its border and its background to #E5EAF0. */
body.theme-dark .add-participant-block .add-form .internal-container,
body.theme-dark .manage-participants-form .internal-container,
body.theme-dark .share-section .internal-container,
body.theme-dark .popup-menu-container .internal-container,
body.theme-dark .account-popup .internal-container,
body.theme-dark .ctm .internal-container {
    background-color: var(--vscode-sideBar-background);
    border-color: var(--vscode-sideBar-background);
}

/* The email field in that popup, in both of its states: typed text was #000,
   the prompt an olive picked for a light card. */
body.theme-dark .add-participant-block .add-form .internal-container .input-email,
body.theme-dark .add-form .internal-container input.input-email {
    color: var(--vscode-foreground);
    background-color: var(--vscode-input-background);
}

body.theme-dark .add-form .internal-container .input-email.is-prompt {
    color: var(--vscode-input-placeholderForeground);
}

/* The round mark beside each sharing option in the Share popup. */
body.theme-dark .make-public-section .description-icon {
    background-color: var(--vscode-button-secondaryBackground);
}

/* The role dropdown's face, in the manage-members popup. */
body.theme-dark .selectBox-label,
body.theme-dark .selectBox-dropdown .selectBox-label,
body.theme-dark .selectBox-dropdown-menu,
body.theme-dark .selectBox-dropdown-menu li a {
    background-color: var(--vscode-input-background);
    color: var(--vscode-foreground);
}

/* -------------------------------------------------------------- black text
 *
 * Four rules set `color: black` outright, for text that used to sit on a white
 * card: the account menu's name, address and sign-in note, the sharing
 * options' descriptions, and the version link. They came through the earlier
 * sweeps because those only compared an element's colour against its *own*
 * background, and all of these are transparent - the dark panel behind them
 * belongs to an ancestor. Comparing against the colour actually painted
 * behind each one is what found them.
 */
body.theme-dark .wave-container,
body.theme-dark .account-popup .info,
body.theme-dark .account-popup .info span,
body.theme-dark .make-public-section .description-text,
body.theme-dark .build_version {
    color: var(--vscode-foreground);
}

body.theme-dark .make-public-section .description-text .section-details,
body.theme-dark .account-popup .signed-via-text {
    color: var(--vscode-descriptionForeground);
}

/* ------------------------------------------------------------------ hovers
 *
 * Four menus highlight a hovered row by painting it #4ea0f1 or #5CAAF7 and the
 * text white. On a dark panel that is a flash of saturated blue; the editor
 * uses a barely-lighter grey for the same job.
 */
body.theme-dark .settings-menu a:hover,
body.theme-dark .blip-menu .other-blipmenu-container .list-menu-button:hover,
body.theme-dark .blip-menu .other-blipmenu-container .list-menu-button:hover > button,
body.theme-dark .manage-participants-form .results-list li:hover {
    background-color: var(--vscode-list-hoverBackground);
    color: var(--vscode-foreground);
}

body.theme-dark .manage-participants-form .results-list li:hover .participant-role {
    color: var(--vscode-foreground);
}

/*
 * Buttons in the topic header. Their hover rule only changes the background,
 * leaving whatever colour the label already had - which after the theme's own
 * hover shade landed grey on grey. Both are set together.
 */
body.theme-dark .wave-header button:hover,
body.theme-dark .wave-header-button:hover,
body.theme-dark .add-block-button:hover,
body.theme-dark .wave-share-button:hover,
body.theme-dark .show-more-participants:hover,
body.theme-dark .show-settings-button:hover {
    background-color: var(--vscode-list-hoverBackground);
    color: var(--vscode-foreground);
}

/* ------------------------------------------------- the sharing option icons
 *
 * A lock, a link and an open padlock, each a dark glyph on a #D6DADF chip.
 * The chip goes dark with the rest of the popup, so the glyphs need turning
 * light the same way the other dark-on-light sprites did.
 */
body.theme-dark .make-public-section .description-icon {
    border-color: var(--vscode-panel-border);
}

body.theme-dark .make-public-section .description-icon img {
    filter: invert(1) grayscale(1);
}

/* ------------------------------------------------------- the settings pages
 *
 * The left menu was taking the activity-bar colour while the page around it
 * took the editor's, so it read as a panel floating on a different surface.
 * On this page there is no such split - it is one page.
 */
body.theme-dark .left-menu-block {
    background-color: var(--vscode-editor-background);
}

body.theme-dark .left-menu-block a {
    color: var(--vscode-foreground);
}

/*
 * The save buttons are a teal gradient with white text - the old brand accent.
 * As a gradient it is a background-image, so it has to be cleared rather than
 * covered. They become the editor's primary button, which is the role they
 * play.
 */
body.theme-dark .submit-block button:not([disabled="disabled"]),
body.theme-dark .submit-block .unsubscribe-form button:not([disabled="disabled"]) {
    background-image: none;
    background-color: var(--vscode-button-secondaryBackground);
    border-color: var(--vscode-button-secondaryBackground);
    color: var(--vscode-foreground);
}

body.theme-dark .submit-block button:not([disabled="disabled"]):hover {
    background-color: var(--vscode-button-secondaryHoverBackground);
}

/* A dashed underline in #1d83c5 marks the change-password link. */
body.theme-dark .change-password {
    color: var(--rizzoma-linkForeground);
    border-bottom-color: var(--rizzoma-linkForeground);
}

/* -------------------------------------------------- the topic list's rows
 *
 * Each row in the topic list is an <a>, so the link colour above turned every
 * unselected topic's title blue. Rows are not links to be read as links; they
 * take the ordinary foreground, and the snippet under each keeps the dimmer
 * one.
 */
body.theme-dark .search-result-item,
body.theme-dark a.search-result-item,
body.theme-dark .market-panel-result {
    color: var(--vscode-foreground);
}

body.theme-dark .search-result-item .item-snippet,
body.theme-dark .search-result-item .last-changed {
    color: var(--vscode-descriptionForeground);
}

/* ------------------------------------------------- the editing outline again
 *
 * #57AAD9 marks the blip being edited - the container, the little arrow that
 * points at it, and the first contributor's avatar - and blip_menu.css adds
 * #4EA0F1 round the menu. Four rules in two files for one outline. The editor
 * marks a focused region with a single accent line, so that is what they all
 * become.
 */
body.theme-dark .contributors .contributor:first-child,
body.theme-dark .active-blip-controls,
body.theme-dark .active-blip-controls .active-blip-control {
    border-color: var(--vscode-panel-border);
}

/* The blip actually being edited, and the menu attached to it. */
body.theme-dark .blip-container.active.edit-mode,
body.theme-dark .default-text.blip-container.edit-mode.last-active,
body.theme-dark .blip-container.active > .blip-arrow div,
body.theme-dark .edit-mode > .bottom-blip-menu,
body.theme-dark .edit-mode > .blip-menu {
    border-color: var(--rizzoma-activeBorder);
}

/* ------------------------------------------------------- the search button
 *
 * Inverting the sprite turned its light face nearly black, so the magnifier
 * sat in a hole. Lifted to sit with the field beside it.
 */
body.theme-dark .search-icon,
body.theme-dark .search-header .show-search-menu-button,
body.theme-dark .search-header .clear-search-query-button {
    filter: invert(1) grayscale(1) brightness(1.9);
}

/* ------------------------------------------------- text the author coloured
 *
 * The highlight palette in the blip menu is six pastels - #FFE066 through
 * #F2A79D - applied as an inline background-color on the run of text. They
 * were chosen to sit under black text, and the theme's light foreground on a
 * salmon or yellow highlight is unreadable. Any run carrying its own
 * background keeps black text, whichever theme is on.
 *
 * Matching on the style attribute is the only handle available: the colour is
 * written inline by editor/renderer.js and there is no class to hang this on.
 */
body.theme-dark .blip [style*="background-color"],
body.theme-dark .editor [style*="background-color"],
body.theme-dark .blip-container [style*="background-color"] {
    color: #000000;
}

/* ------------------------------------------------------------------ mindmap
 *
 * The map is svg, so its colours are fill and stroke rather than background
 * and color, and none of the rules above touch it. Three things were wrong:
 * the text had no fill at all, which in svg means black; the node boxes are
 * painted with gradients defined in the document's <defs>, which a stylesheet
 * cannot recolour but can replace with a flat fill; and the connector arrows
 * are near-white greys that showed as bright rectangles along the top and left
 * edges of the map.
 */
body.theme-dark svg.mindmap text,
body.theme-dark svg.mindmap .root-node,
body.theme-dark svg.mindmap .paragraph-label text {
    fill: var(--vscode-foreground);
}

body.theme-dark svg.mindmap .blip-size-box,
body.theme-dark svg.mindmap .thread-container.virtual .blip-size-box,
body.theme-dark svg.mindmap .thread-container:not(.root-thread):not(.virtual) .blip-container:nth-of-type(even) .blip-size-box {
    fill: var(--vscode-sideBar-background);
    stroke: var(--vscode-panel-border);
}

body.theme-dark svg.mindmap .description-arrow.to-top,
body.theme-dark svg.mindmap .description-arrow.to-mid,
body.theme-dark svg.mindmap .description-arrow.to-bottom {
    fill: var(--vscode-panel-border);
}

body.theme-dark svg.mindmap .description-arrow.to-top .description-arrow-line,
body.theme-dark svg.mindmap .description-arrow.to-mid .description-arrow-line,
body.theme-dark svg.mindmap .description-arrow.to-bottom .description-arrow-line {
    stroke: var(--vscode-panel-border);
}

body.theme-dark svg.mindmap .description-arrow.selected {
    fill: var(--rizzoma-activeBorder);
}

body.theme-dark svg.mindmap .node-container.virtual {
    fill: var(--vscode-descriptionForeground);
}

/*
 * The two rules that drew the bright rectangles: a 1px rail under each block
 * and a 4px bar marking a blip's height, both near-white. They are structural
 * guides, so they take the divider colour.
 */
body.theme-dark svg.mindmap .block-line-bottom,
body.theme-dark svg.mindmap .blip-height-line {
    fill: var(--vscode-panel-border);
}

/* The title above the map is html, not svg, and inherits the blip's colour. */
body.theme-dark .topic-mindmap-container .blip-title,
body.theme-dark .topic-mindmap-container h1,
body.theme-dark .topic-mindmap-container h2 {
    color: var(--vscode-foreground);
}

/* ------------------------------------------------------- the tab accent
 *
 * The active tab was marked with the focus blue. VS Code marks its active
 * activity-bar item in the foreground colour, which is also the one colour
 * left that is not competing with anything.
 */
body.theme-dark .tabs-container .tab.active {
    box-shadow: inset 2px 0 0 var(--vscode-foreground);
}

/* ----------------------------------------------------- the settings heading
 *
 * The band behind 'Profile settings' was taking the panel colour while the
 * page took the editor's, so the heading sat on a lighter strip.
 */
body.theme-dark .settings-header,
body.theme-dark .header-wrap {
    background-color: var(--vscode-editor-background);
}

/* -------------------------------------------------------- help / guide popup */

body.theme-dark .account-menu-popup,
body.theme-dark .tips-video-popup,
body.theme-dark .tips-video-popup .internal-container,
body.theme-dark .chrome-app-popup,
body.theme-dark .tips-video-title {
    background-color: var(--vscode-sideBar-background);
    color: var(--vscode-foreground);
    border-color: var(--vscode-menu-border);
}

body.theme-dark .tips-video-popup a {
    color: var(--vscode-foreground);
}

/* ------------------------------------------------- attachments and pictures
 *
 * A file or image in a blip is a card: a light grey gradient with a silver
 * border, and its caption and extension label sit on white. Against the
 * theme's light foreground those labels vanished - which is what shows when
 * the pointer is over a picture and its caption appears.
 *
 * The gradient is a background-image, so as elsewhere it has to be cleared
 * rather than covered.
 */
body.theme-dark .attachment-content,
body.theme-dark .file-content {
    background-image: none;
    background-color: var(--vscode-sideBar-background);
    border-color: var(--vscode-panel-border);
    color: var(--vscode-foreground);
}

body.theme-dark .file-content .caption,
body.theme-dark .file-content .file-ext,
body.theme-dark .file-preview .caption,
body.theme-dark .attachment-preview .caption {
    background-color: var(--vscode-sideBar-background);
    color: var(--vscode-foreground);
}

/* ----------------------------------------------------- mentions and tags
 *
 * An @mention or #tag in a blip is a chip: #eaeaea behind it, and a 2px
 * white border on its container that only exists to keep two adjacent chips
 * apart on a white page. In this theme both stayed light (issue #1), and the
 * tag's black text sat on that. The chip takes the input surface, one step
 * up from the blip; the border goes transparent so the gap shows the blip
 * through it, as it showed white before. The mention keeps its blue text,
 * which reads on #3c3c3c.
 */
body.theme-dark .blip-recipient,
body.theme-dark .blip-tag {
    background-color: var(--vscode-input-background);
}

body.theme-dark .blip-recipient-container,
body.theme-dark .blip-tag-container,
body.theme-dark .blip-recipient,
body.theme-dark .blip-tag {
    border-color: transparent;
}

body.theme-dark .blip-tag-text {
    color: var(--vscode-foreground);
}

/* ------------------------------------------------------- help and gear menus
 *
 * Their entries - Guide, Show tips, and the settings list - are #303030,
 * chosen for a white menu.
 */
body.theme-dark .settings-menu a {
    color: var(--vscode-foreground);
}

/* ------------------------------------------------- the frame around a reply
 *
 * `.blip-container { border: 2px solid #D6D6D6 }` - the light frame drawn
 * round every reply, and the one thing this file had never touched. Its
 * absence is why the edited reply looked *darker* than its neighbours: they
 * kept #D6D6D6 while the edited one took the theme's active grey. Both are on
 * the same scale now, dark for a reply at rest and lighter for the one being
 * edited.
 *
 * It went unnoticed because a topic with a single root blip suppresses these
 * borders - .root-blip drops the top, `.root-blip ~ .blip-container` the sides
 * - so on the one-blip topic used for checking, every side measured 0px wide.
 * It takes a reply or two before the frame is drawn at all.
 */
body.theme-dark .blip-container,
body.theme-dark .blip-arrow div {
    border-color: var(--vscode-panel-border);
}

body.theme-dark .blip-container.active.edit-mode,
body.theme-dark .default-text.blip-container.edit-mode.last-active,
body.theme-dark .blip-container.active > .blip-arrow div {
    border-color: var(--rizzoma-activeBorder);
}

/* ---------------------------------------------- the gear menu on a reply
 *
 * The list that drops out of the gearwheel is `background: white` with the
 * menu's own dark text on it.
 */
body.theme-dark .blip-menu .other-blipmenu-container,
body.theme-dark .blip-menu .other-blipmenu-container button,
body.theme-dark .blip-menu .list-menu-button,
body.theme-dark .blip-menu .list-menu-button > button {
    background-color: var(--vscode-sideBar-background);
    color: var(--vscode-foreground);
    border-color: var(--vscode-menu-border);
}

/* -------------------------------------------- mindmap: hover and selection
 *
 * A hovered or selected node fills #ABBFCF - a pale blue-grey meant to sit
 * under black text - so its label disappeared. The paragraph rules inside a
 * node are stroked white for the same reason.
 */
body.theme-dark svg.mindmap .selected .paragraph-size-box {
    fill: var(--vscode-list-activeSelectionBackground);
}

body.theme-dark svg.mindmap .paragraph-line {
    stroke: var(--vscode-panel-border);
}

body.theme-dark svg.mindmap .unread .paragraph-line {
    stroke: #7cba6c;
}

body.theme-dark svg.mindmap .block-line-top {
    fill: var(--vscode-panel-border);
}

/* ---------------------------------------------------------------- the Guide
 *
 * The tour that opens from Help > Guide. Its panel is #f4f4f4 inside a white
 * border, with the controls above it in a light grey. The slides themselves
 * are screenshots - background images on .slide - and are deliberately left
 * alone: they are pictures of the product, not chrome, and recolouring them
 * would only make them wrong.
 */
body.theme-dark .introduce .slides-container {
    background-color: var(--vscode-sideBar-background);
    border-color: var(--vscode-menu-border);
}

body.theme-dark .introduce .slider-header {
    color: var(--vscode-foreground);
}

body.theme-dark .introduce .next,
body.theme-dark .introduce .prev,
body.theme-dark .introduce .switch-link,
body.theme-dark .introduce .close-txt {
    color: var(--rizzoma-linkForeground);
}

body.theme-dark .introduce .switch-to-video .switch-link {
    color: var(--rizzoma-linkForeground);
}

body.theme-dark .introduce .progressbar-round {
    background-color: var(--vscode-button-secondaryBackground);
}

body.theme-dark .introduce .progressbar-round.active {
    background-color: var(--vscode-foreground);
}

body.theme-dark .introduce .video-button {
    background-color: var(--vscode-button-background);
    color: var(--vscode-button-foreground);
}

body.theme-dark .introduce .video {
    background-color: var(--vscode-editor-background);
}

/* ------------------------------------------------------- the tab separators
 *
 * #5E7386 between Topics, Mentions and the rest - a blue-grey drawn to divide
 * a blue panel. It takes the same divider colour as the line down the side of
 * the strip.
 */
body.theme-dark .tabs-container .tab {
    border-bottom-color: var(--vscode-panel-border);
}

/* ------------------------------------------------------- checkboxes and radios
 *
 * These are native controls. A dark page makes the browser draw them in the
 * platform's accent colour, which is the blue on the Notifications and
 * Appearance pages - nothing in this file put it there. accent-color is the
 * one property that reaches inside them.
 */
body.theme-dark input[type="checkbox"],
body.theme-dark input[type="radio"] {
    accent-color: var(--vscode-foreground);
}

/* Share link expiry: the native select keeps the light card's colours otherwise. */
body.theme-dark .wave-share-popup .link-expiry {
    color: var(--vscode-descriptionForeground);
}

body.theme-dark .wave-share-popup .link-expiry-select {
    background: var(--vscode-input-background, #3c3c3c);
    color: var(--vscode-foreground);
    border: 1px solid var(--vscode-input-border, #3c3c3c);
}

body.theme-dark .wave-share-popup .link-expiry-status.expired {
    color: #f14c4c;
}

body.theme-dark .settings-menu a.delete-topic {
    color: #f14c4c;
    border-top-color: var(--vscode-widget-border, #454545);
}

body.theme-dark .settings-menu a.delete-topic:hover {
    background: #c0392b;
    color: #fff;
}
