:root,
body[data-current-user-theme="light"],
body[data-current-user-theme="design-light"],
html[data-ui-theme="light"],
html[data-ui-theme="design-light"],
body[data-ui-theme="design-light"],
body[data-ui-theme="light"] {
  color-scheme: light;
  --emalm-ui-page-bg: var(--emalm-theme-page-bg, #f5f5dc);
  --emalm-ui-page-text: var(--emalm-theme-page-text, #251710);
  --emalm-ui-surface-1: var(--emalm-theme-surface-bg, #fffaf4);
  --emalm-ui-surface-2: #f7eadf;
  --emalm-ui-surface-3: #f1dfd1;
  --emalm-ui-surface-text: var(--emalm-theme-surface-text, #251710);
  --emalm-ui-header-bg: var(--emalm-theme-header-bg, #7f3824);
  --emalm-ui-header-text: var(--emalm-theme-header-text, #fff7ef);
  --emalm-ui-footer-bg: var(--emalm-theme-footer-bg, #5f2d1e);
  --emalm-ui-footer-text: var(--emalm-theme-footer-text, #f0d8cb);
  --emalm-ui-border: var(--emalm-theme-border, #d7b8a3);
  --emalm-ui-border-strong: #bb8e6b;
  --emalm-ui-text: var(--emalm-theme-page-text, #251710);
  --emalm-ui-text-muted: #685147;
  --emalm-ui-link: var(--emalm-theme-link, #8a3d2a);
  --emalm-ui-link-hover: var(--emalm-theme-accent, #e35336);
  --emalm-ui-accent: var(--emalm-theme-accent, #e35336);
  --emalm-ui-accent-strong: #a0522d;
  --emalm-ui-accent-soft: #f4a460;
  --emalm-ui-accent-text: var(--emalm-theme-accent-text, #fffaf4);
  --emalm-ui-focus: rgba(227, 83, 54, 0.28);
  --emalm-ui-shadow-soft: 0 8px 24px rgba(74, 42, 28, 0.12);
  --emalm-ui-shadow-strong: 0 18px 40px rgba(74, 42, 28, 0.18);
  --emalm-ui-info-bg: #f8efe7;
  --emalm-ui-info-border: #ddb79d;
  --emalm-ui-info-text: #61331f;
  --emalm-ui-warning-bg: #fff0d8;
  --emalm-ui-warning-border: #e7b670;
  --emalm-ui-warning-text: #6b4319;
  --emalm-ui-danger-bg: #fde7e3;
  --emalm-ui-danger-border: #d67f71;
  --emalm-ui-danger-text: #6d2018;
  --emalm-ui-success-bg: #edf6e7;
  --emalm-ui-success-border: #8db279;
  --emalm-ui-success-text: #284725;
  --emalm-ui-autocomplete-border: #d1d1da;
  --emalm-ui-autocomplete-selected-bg: #e1e8ff;
  --emalm-ui-overlay: rgba(32, 20, 15, 0.62);
  --body-background-color: var(--emalm-ui-page-bg);
  --text-color: var(--emalm-ui-text);
  --muted-text-color: var(--emalm-ui-text-muted);
  --link-color: var(--emalm-ui-link);
  --link-hover-color: var(--emalm-ui-link-hover);
  --default-border-color: var(--emalm-ui-border);
  --card-background-color: var(--emalm-ui-surface-1);
  --form-input-background: var(--emalm-ui-surface-1);
  --form-input-border-color: var(--emalm-ui-border);
  --button-primary-background-color: var(--emalm-ui-accent);
  --button-primary-hover-background-color: var(--emalm-ui-accent-strong);
  --table-header-border-color: var(--emalm-ui-border-strong);
  --table-row-border-color: var(--emalm-ui-border);
  --table-row-hover-background: color-mix(in srgb, var(--emalm-ui-surface-1) 78%, var(--emalm-ui-accent-soft) 22%);
  --table-even-row-background: color-mix(in srgb, var(--emalm-ui-surface-1) 84%, var(--emalm-ui-surface-2) 16%);
  --form-input-validation-error-border-color: var(--emalm-ui-danger-border);
  --form-input-validation-error-text-color: var(--emalm-ui-danger-text);
  --quick-search-form-background: var(--emalm-ui-surface-1);
  --note-box-background-color: color-mix(in srgb, var(--emalm-ui-warning-bg) 68%, var(--card-background-color) 32%);
  --note-box-border-color: var(--emalm-ui-warning-border);
  --note-body-background-color: var(--card-background-color);
  --note-body-border-color: var(--default-border-color);
  --note-body-text-color: var(--text-color);
  --note-resize-handle-background-color: var(--emalm-ui-warning-border);
  --note-preview-background-color: color-mix(in srgb, var(--emalm-ui-warning-bg) 72%, transparent);
  --note-unsaved-border-color: var(--emalm-ui-danger-border);
  --note-movable-border-color: var(--emalm-ui-link);
  --note-highlight-color: var(--emalm-ui-danger-border);
}

body[data-current-user-theme="dark"],
body[data-current-user-theme="design-dark"],
html[data-ui-theme="dark"],
html[data-ui-theme="design-dark"],
body[data-ui-theme="design-dark"],
body[data-ui-theme="dark"] {
  color-scheme: dark;
  --emalm-ui-page-bg: #1e1714;
  --emalm-ui-page-text: #f5ede3;
  --emalm-ui-surface-1: #2a201d;
  --emalm-ui-surface-2: #342723;
  --emalm-ui-surface-3: #402f2a;
  --emalm-ui-surface-text: #f5ede3;
  --emalm-ui-header-bg: #170f0d;
  --emalm-ui-header-text: #fff3e7;
  --emalm-ui-footer-bg: #1a120f;
  --emalm-ui-footer-text: #e7d0c2;
  --emalm-ui-border: #67493d;
  --emalm-ui-border-strong: #8d6758;
  --emalm-ui-text: #f5ede3;
  --emalm-ui-text-muted: #ccb9ac;
  --emalm-ui-link: #ffb089;
  --emalm-ui-link-hover: #ffd0b3;
  --emalm-ui-accent: #ff7c5d;
  --emalm-ui-accent-strong: #ff9a77;
  --emalm-ui-accent-soft: #b86644;
  --emalm-ui-accent-text: #1d110c;
  --emalm-ui-focus: rgba(255, 124, 93, 0.3);
  --emalm-ui-shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.34);
  --emalm-ui-shadow-strong: 0 22px 48px rgba(0, 0, 0, 0.48);
  --emalm-ui-info-bg: #33261f;
  --emalm-ui-info-border: #7e5c4d;
  --emalm-ui-info-text: #f0d4c4;
  --emalm-ui-warning-bg: #382819;
  --emalm-ui-warning-border: #a6763d;
  --emalm-ui-warning-text: #f3d3a7;
  --emalm-ui-danger-bg: #3d201b;
  --emalm-ui-danger-border: #a85f53;
  --emalm-ui-danger-text: #f7cdc5;
  --emalm-ui-success-bg: #1f3023;
  --emalm-ui-success-border: #5b8d63;
  --emalm-ui-success-text: #cee8d0;
  --emalm-ui-autocomplete-border: #9192a7;
  --emalm-ui-autocomplete-selected-bg: #3f4058;
  --emalm-post-tooltip-background-color: var(--emalm-ui-surface-2);
  --emalm-post-tooltip-border-color: var(--emalm-ui-border-strong);
  --emalm-post-tooltip-header-background-color: var(--emalm-ui-surface-3);
  --emalm-post-tooltip-text-color: #111;
  --emalm-ui-overlay: rgba(6, 4, 3, 0.72);
  --body-background-color: var(--emalm-ui-page-bg);
  --text-color: var(--emalm-ui-text);
  --muted-text-color: var(--emalm-ui-text-muted);
  --link-color: var(--emalm-ui-link);
  --link-hover-color: var(--emalm-ui-link-hover);
  --default-border-color: var(--emalm-ui-border);
  --card-background-color: var(--emalm-ui-surface-1);
  --form-input-background: var(--emalm-ui-surface-1);
  --form-input-border-color: var(--emalm-ui-border);
  --button-primary-background-color: var(--emalm-ui-accent);
  --button-primary-hover-background-color: var(--emalm-ui-accent-strong);
  --table-header-border-color: var(--emalm-ui-border-strong);
  --table-row-border-color: var(--emalm-ui-border);
  --table-row-hover-background: color-mix(in srgb, var(--emalm-ui-surface-1) 68%, var(--emalm-ui-surface-3) 32%);
  --table-even-row-background: color-mix(in srgb, var(--emalm-ui-surface-1) 82%, var(--emalm-ui-surface-2) 18%);
  --form-input-validation-error-border-color: var(--emalm-ui-danger-border);
  --form-input-validation-error-text-color: var(--emalm-ui-danger-text);
  --quick-search-form-background: var(--emalm-ui-surface-1);
  --note-box-background-color: color-mix(in srgb, var(--emalm-ui-warning-bg) 58%, var(--card-background-color) 42%);
  --note-box-border-color: var(--emalm-ui-warning-border);
  --note-body-background-color: color-mix(in srgb, var(--card-background-color) 90%, var(--emalm-ui-surface-2) 10%);
  --note-body-border-color: var(--default-border-color);
  --note-body-text-color: var(--text-color);
  --note-resize-handle-background-color: var(--emalm-ui-warning-border);
  --note-preview-background-color: color-mix(in srgb, var(--emalm-ui-warning-bg) 58%, transparent);
  --note-unsaved-border-color: var(--emalm-ui-danger-border);
  --note-movable-border-color: var(--emalm-ui-link);
  --note-highlight-color: var(--emalm-ui-danger-border);
}

body[data-current-user-theme="danbooru-light"],
html[data-ui-theme="danbooru-light"],
body[data-ui-theme="danbooru-light"] {
  color-scheme: light;
  --emalm-theme-page-bg:#ffffff;
  --emalm-theme-page-text:#000000;
  --emalm-theme-surface-bg:#ffffff;
  --emalm-theme-surface-text:#000000;
  --emalm-theme-accent:#0075f8;
  --emalm-theme-accent-text:#ffffff;
  --emalm-theme-link:#0075f8;
  --emalm-theme-header-bg:#1e1e2c;
  --emalm-theme-header-text:#f6f6f8;
  --emalm-theme-footer-bg:#1e1e2c;
  --emalm-theme-footer-text:#d1d1da;
  --emalm-theme-border:#e8e8ec;
  --emalm-ui-page-bg: #ffffff;
  --emalm-ui-page-text: #000000;
  --emalm-ui-surface-1: #ffffff;
  --emalm-ui-surface-2: #f6f6f8;
  --emalm-ui-surface-3: #e8e8ec;
  --emalm-ui-surface-text: #000000;
  --emalm-ui-header-bg: #1e1e2c;
  --emalm-ui-header-text: #f6f6f8;
  --emalm-ui-footer-bg: #1e1e2c;
  --emalm-ui-footer-text: #d1d1da;
  --emalm-ui-border: #e8e8ec;
  --emalm-ui-border-strong: #5b5c79;
  --emalm-ui-text: #000000;
  --emalm-ui-text-muted: #9192a7;
  --emalm-ui-link: #0075f8;
  --emalm-ui-link-hover: #8caaff;
  --emalm-ui-accent: #0075f8;
  --emalm-ui-accent-strong: #005ac3;
  --emalm-ui-accent-soft: #e1e8ff;
  --emalm-ui-accent-text: #ffffff;
  --emalm-ui-focus: rgba(0, 117, 248, 0.28);
  --emalm-ui-shadow-soft: 0 8px 24px rgba(30, 30, 44, 0.1);
  --emalm-ui-shadow-strong: 0 18px 40px rgba(30, 30, 44, 0.16);
  --emalm-ui-info-bg: #fdf6e6;
  --emalm-ui-info-border: #f7e7c3;
  --emalm-ui-info-text: #504100;
  --emalm-ui-warning-bg: #fdf6e6;
  --emalm-ui-warning-border: #ead084;
  --emalm-ui-warning-text: #504100;
  --emalm-ui-danger-bg: #fbe3e3;
  --emalm-ui-danger-border: #ff5a5b;
  --emalm-ui-danger-text: #c00004;
  --emalm-ui-success-bg: #e8fce9;
  --emalm-ui-success-border: #93e49a;
  --emalm-ui-success-text: #006e19;
  --emalm-ui-autocomplete-border: #d1d1da;
  --emalm-ui-autocomplete-selected-bg: #e1e8ff;
  --emalm-ui-overlay: rgba(30, 30, 44, 0.62);
  --body-background-color: var(--emalm-ui-page-bg);
  --text-color: var(--emalm-ui-text);
  --inverse-text-color: #ffffff;
  --muted-text-color: var(--emalm-ui-text-muted);
  --header-color: #1e1e2c;
  --link-color: var(--emalm-ui-link);
  --link-hover-color: var(--emalm-ui-link-hover);
  --default-border-color: var(--emalm-ui-border);
  --card-background-color: var(--emalm-ui-surface-1);
  --form-input-background: var(--emalm-ui-surface-1);
  --form-input-border-color: #d1d1da;
  --form-button-text-color: var(--emalm-ui-text);
  --form-button-background: #e8e8ec;
  --form-button-border-color: #d1d1da;
  --form-button-hover-background: #f6f6f8;
  --button-primary-background-color: var(--emalm-ui-accent);
  --button-primary-hover-background-color: var(--emalm-ui-accent-strong);
  --table-header-border-color: var(--emalm-ui-border-strong);
  --table-row-border-color: #d1d1da;
  --table-row-hover-background: #e1e8ff;
  --table-even-row-background: #f6f6f8;
  --quick-search-form-background: var(--emalm-ui-surface-1);
  --form-input-validation-error-border-color: var(--emalm-ui-danger-border);
  --form-input-validation-error-text-color: var(--emalm-ui-danger-text);
  --note-box-background-color: #ffffee;
  --note-box-border-color: #000000;
  --note-body-background-color: #ffffee;
  --note-body-border-color: #000000;
  --note-body-text-color: #000000;
  --note-resize-handle-background-color: #000000;
  --note-preview-background-color: #ffffee;
  --note-unsaved-border-color: #ff5a5b;
  --note-movable-border-color: #0075f8;
  --note-highlight-color: #0075f8;
  --artist-tag-color: #c00004;
  --artist-tag-hover-color: #ed2426;
  --copyright-tag-color: #a800aa;
  --copyright-tag-hover-color: #d700d9;
  --character-tag-color: #00ab2c;
  --character-tag-hover-color: #35c64a;
  --general-tag-color: var(--emalm-ui-link);
  --general-tag-hover-color: var(--emalm-ui-link-hover);
  --meta-tag-color: #fd9200;
  --meta-tag-hover-color: #ffc5a5;
}

body[data-current-user-theme="danbooru-dark"],
html[data-ui-theme="danbooru-dark"],
body[data-ui-theme="danbooru-dark"] {
  color-scheme: dark;
  --emalm-theme-page-bg:#1e1e2c;
  --emalm-theme-page-text:#d1d1da;
  --emalm-theme-surface-bg:#2c2d3f;
  --emalm-theme-surface-text:#d1d1da;
  --emalm-theme-accent:#009be6;
  --emalm-theme-accent-text:#1e1e2c;
  --emalm-theme-link:#009be6;
  --emalm-theme-header-bg:#1e1e2c;
  --emalm-theme-header-text:#f6f6f8;
  --emalm-theme-footer-bg:#1e1e2c;
  --emalm-theme-footer-text:#d1d1da;
  --emalm-theme-border:#3f4058;
  --emalm-ui-page-bg: #1e1e2c;
  --emalm-ui-page-text: #d1d1da;
  --emalm-ui-surface-1: #2c2d3f;
  --emalm-ui-surface-2: #3f4058;
  --emalm-ui-surface-3: #5b5c79;
  --emalm-ui-surface-text: #d1d1da;
  --emalm-ui-header-bg: #1e1e2c;
  --emalm-ui-header-text: #f6f6f8;
  --emalm-ui-footer-bg: #1e1e2c;
  --emalm-ui-footer-text: #d1d1da;
  --emalm-ui-border: #3f4058;
  --emalm-ui-border-strong: #5b5c79;
  --emalm-ui-text: #d1d1da;
  --emalm-ui-text-muted: #9192a7;
  --emalm-ui-link: #009be6;
  --emalm-ui-link-hover: #4bb4ff;
  --emalm-ui-accent: #009be6;
  --emalm-ui-accent-strong: #4bb4ff;
  --emalm-ui-accent-soft: #00314d;
  --emalm-ui-accent-text: #1e1e2c;
  --emalm-ui-focus: rgba(0, 155, 230, 0.32);
  --emalm-ui-shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.34);
  --emalm-ui-shadow-strong: 0 22px 48px rgba(0, 0, 0, 0.48);
  --emalm-ui-info-bg: #00314d;
  --emalm-ui-info-border: #006496;
  --emalm-ui-info-text: #afd5ff;
  --emalm-ui-warning-bg: #382d00;
  --emalm-ui-warning-border: #705d00;
  --emalm-ui-warning-text: #ead084;
  --emalm-ui-danger-bg: #5c1313;
  --emalm-ui-danger-border: #861011;
  --emalm-ui-danger-text: #ff5a5b;
  --emalm-ui-success-bg: #003708;
  --emalm-ui-success-border: #006e19;
  --emalm-ui-success-text: #35c64a;
  --emalm-ui-autocomplete-border: #9192a7;
  --emalm-ui-autocomplete-selected-bg: #3f4058;
  --emalm-ui-overlay: rgba(0, 0, 0, 0.72);
  --body-background-color: var(--emalm-ui-page-bg);
  --text-color: var(--emalm-ui-text);
  --inverse-text-color: #f6f6f8;
  --muted-text-color: var(--emalm-ui-text-muted);
  --header-color: #e8e8ec;
  --link-color: var(--emalm-ui-link);
  --link-hover-color: var(--emalm-ui-link-hover);
  --default-border-color: var(--emalm-ui-border);
  --card-background-color: var(--emalm-ui-surface-1);
  --form-input-background: #3f4058;
  --form-input-border-color: #777892;
  --form-button-text-color: #1e1e2c;
  --form-button-background: #d1d1da;
  --form-button-border-color: #9192a7;
  --form-button-hover-background: #f6f6f8;
  --button-primary-background-color: var(--emalm-ui-accent);
  --button-primary-hover-background-color: var(--emalm-ui-accent-strong);
  --table-header-border-color: #3f4058;
  --table-row-border-color: #3f4058;
  --table-row-hover-background: #3f4058;
  --table-even-row-background: #2c2d3f;
  --quick-search-form-background: var(--emalm-ui-page-bg);
  --form-input-validation-error-border-color: var(--emalm-ui-danger-border);
  --form-input-validation-error-text-color: var(--emalm-ui-danger-text);
  --note-box-background-color: #ffffee;
  --note-box-border-color: #000000;
  --note-body-background-color: #ffffee;
  --note-body-border-color: #000000;
  --note-body-text-color: #000000;
  --note-resize-handle-background-color: #000000;
  --note-preview-background-color: #ffffee;
  --note-unsaved-border-color: #ed2426;
  --note-movable-border-color: #0075f8;
  --note-highlight-color: #0075f8;
  --artist-tag-color: #ff8a8b;
  --artist-tag-hover-color: #ffc3c3;
  --copyright-tag-color: #c797ff;
  --copyright-tag-hover-color: #ddc9fb;
  --character-tag-color: #35c64a;
  --character-tag-hover-color: #93e49a;
  --general-tag-color: var(--emalm-ui-link);
  --general-tag-hover-color: var(--emalm-ui-link-hover);
  --meta-tag-color: #ead084;
  --meta-tag-hover-color: #f7e7c3;
  --user-owner-color: #e00;
  --user-owner-hover-color: #c00;
  --user-admin-color: #e00;
  --user-admin-hover-color: #c00;
  --user-moderator-color: #00a000;
  --user-moderator-hover-color: #008800;
  --user-approver-color: #b000b0;
  --user-approver-hover-color: #900090;
  --user-contributor-color: #b000b0;
  --user-contributor-hover-color: #900090;
  --user-builder-color: #b000b0;
  --user-builder-hover-color: #900090;
  --user-platinum-color: #666;
  --user-platinum-hover-color: #555;
  --user-gold-color: #ff4a00;
  --user-gold-hover-color: #d63d00;
  --user-member-color: #006ffa;
  --user-member-hover-color: #0057c7;
  --user-restricted-color: #006ffa;
  --user-restricted-hover-color: #0057c7;
  --emalm-ui-header-link:#009be6;
  --emalm-ui-header-link-hover:#5fc3ff;
}

body[data-current-user-theme="danbooru-pink"],
html[data-ui-theme="danbooru-pink"],
body[data-ui-theme="danbooru-pink"] {
  color-scheme: light;
  --emalm-theme-page-bg:#fff0f6;
  --emalm-theme-page-text:#a61e4d;
  --emalm-theme-surface-bg:#ffffff;
  --emalm-theme-surface-text:#a61e4d;
  --emalm-theme-accent:#e64980;
  --emalm-theme-accent-text:#fff0f6;
  --emalm-theme-link:#d6336c;
  --emalm-theme-header-bg:#a61e4d;
  --emalm-theme-header-text:#fff0f6;
  --emalm-theme-footer-bg:#a61e4d;
  --emalm-theme-footer-text:#ffdeeb;
  --emalm-theme-border:#fcc2d7;
  --emalm-ui-page-bg: #fff0f6;
  --emalm-ui-page-text: #a61e4d;
  --emalm-ui-surface-1: #ffffff;
  --emalm-ui-surface-2: #ffdeeb;
  --emalm-ui-surface-3: #fcc2d7;
  --emalm-ui-surface-text: #a61e4d;
  --emalm-ui-header-bg: #a61e4d;
  --emalm-ui-header-text: #fff0f6;
  --emalm-ui-footer-bg: #a61e4d;
  --emalm-ui-footer-text: #ffdeeb;
  --emalm-ui-border: #fcc2d7;
  --emalm-ui-border-strong: #d6336c;
  --emalm-ui-text: #a61e4d;
  --emalm-ui-text-muted: #d6336c;
  --emalm-ui-link: #d6336c;
  --emalm-ui-link-hover: #f06595;
  --emalm-ui-accent: #e64980;
  --emalm-ui-accent-strong: #c2255c;
  --emalm-ui-accent-soft: #ffdeeb;
  --emalm-ui-accent-text: #fff0f6;
  --emalm-ui-focus: rgba(230, 73, 128, 0.28);
  --emalm-ui-shadow-soft: 0 8px 24px rgba(166, 30, 77, 0.12);
  --emalm-ui-shadow-strong: 0 18px 40px rgba(166, 30, 77, 0.18);
  --emalm-ui-info-bg: #f3f0ff;
  --emalm-ui-info-border: #d0bfff;
  --emalm-ui-info-text: #5f3dc4;
  --emalm-ui-warning-bg: #fff9db;
  --emalm-ui-warning-border: #ffec99;
  --emalm-ui-warning-text: #e67700;
  --emalm-ui-danger-bg: #fff5f5;
  --emalm-ui-danger-border: #ff8787;
  --emalm-ui-danger-text: #c92a2a;
  --emalm-ui-success-bg: #ebfbee;
  --emalm-ui-success-border: #b2f2bb;
  --emalm-ui-success-text: #2f9e44;
  --emalm-ui-autocomplete-border: #fcc2d7;
  --emalm-ui-autocomplete-selected-bg: #ffdeeb;
  --emalm-ui-overlay: rgba(166, 30, 77, 0.48);
  --body-background-color: var(--emalm-ui-page-bg);
  --text-color: var(--emalm-ui-text);
  --inverse-text-color: #fff0f6;
  --muted-text-color: var(--emalm-ui-text-muted);
  --header-color: #a61e4d;
  --link-color: var(--emalm-ui-link);
  --link-hover-color: var(--emalm-ui-link-hover);
  --default-border-color: var(--emalm-ui-border);
  --card-background-color: var(--emalm-ui-surface-1);
  --form-input-background: var(--emalm-ui-surface-1);
  --form-input-border-color: #fcc2d7;
  --form-button-text-color: #a61e4d;
  --form-button-background: #ffdeeb;
  --form-button-border-color: #fcc2d7;
  --form-button-hover-background: #fff0f6;
  --button-primary-background-color: var(--emalm-ui-accent);
  --button-primary-hover-background-color: var(--emalm-ui-accent-strong);
  --table-header-border-color: var(--emalm-ui-border-strong);
  --table-row-border-color: #fcc2d7;
  --table-row-hover-background: #ffdeeb;
  --table-even-row-background: #fff0f6;
  --quick-search-form-background: var(--emalm-ui-surface-1);
  --form-input-validation-error-border-color: var(--emalm-ui-danger-border);
  --form-input-validation-error-text-color: var(--emalm-ui-danger-text);
  --note-box-background-color: #fff9db;
  --note-box-border-color: #e67700;
  --note-body-background-color: #ffffff;
  --note-body-border-color: #fcc2d7;
  --note-body-text-color: #a61e4d;
  --note-resize-handle-background-color: #d6336c;
  --note-preview-background-color: #fff9db;
  --note-unsaved-border-color: #ff8787;
  --note-movable-border-color: #d6336c;
  --note-highlight-color: #e64980;
  --artist-tag-color: #c92a2a;
  --artist-tag-hover-color: #ff6b6b;
  --copyright-tag-color: #ae3ec9;
  --copyright-tag-hover-color: #cc5de8;
  --character-tag-color: #37b24d;
  --character-tag-hover-color: #51cf66;
  --general-tag-color: var(--emalm-ui-link);
  --general-tag-hover-color: var(--emalm-ui-link-hover);
  --meta-tag-color: #f76707;
  --meta-tag-hover-color: #ff922b;
}

body[data-current-user-theme="gelbooru-light"],
html[data-ui-theme="gelbooru-light"],
body[data-ui-theme="gelbooru-light"] {
  color-scheme: light;
  --emalm-theme-page-bg:#ffffff;
  --emalm-theme-page-text:#000000;
  --emalm-theme-surface-bg:#ffffff;
  --emalm-theme-surface-text:#000000;
  --emalm-theme-accent:#006ffa;
  --emalm-theme-accent-text:#ffffff;
  --emalm-theme-link:#337ab7;
  --emalm-theme-header-bg:#0773fb;
  --emalm-theme-header-text:#ffffff;
  --emalm-theme-footer-bg:#444444;
  --emalm-theme-footer-text:#ffffff;
  --emalm-theme-border:#f0f0f0;
  --emalm-ui-page-bg: #ffffff;
  --emalm-ui-page-text: #000000;
  --emalm-ui-surface-1: #ffffff;
  --emalm-ui-surface-2: #f5f5f5;
  --emalm-ui-surface-3: #edf5ff;
  --emalm-ui-surface-text: #000000;
  --emalm-ui-header-bg: #0773fb;
  --emalm-ui-header-text: #ffffff;
  --emalm-ui-footer-bg: #444444;
  --emalm-ui-footer-text: #ffffff;
  --emalm-ui-border: #f0f0f0;
  --emalm-ui-border-strong: #e0e0e0;
  --emalm-ui-text: #000000;
  --emalm-ui-text-muted: #777777;
  --emalm-ui-link: #337ab7;
  --emalm-ui-link-hover: #33cfff;
  --emalm-ui-accent: #006ffa;
  --emalm-ui-accent-strong: #0773fb;
  --emalm-ui-accent-soft: #edf5ff;
  --emalm-ui-accent-text: #ffffff;
  --emalm-ui-focus: rgba(0, 111, 250, 0.28);
  --emalm-ui-shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.08);
  --emalm-ui-shadow-strong: 0 18px 40px rgba(0, 0, 0, 0.14);
  --emalm-ui-info-bg: #edf5ff;
  --emalm-ui-info-border: #dcecf6;
  --emalm-ui-info-text: #0b4c93;
  --emalm-ui-warning-bg: #fffbbf;
  --emalm-ui-warning-border: #ccc999;
  --emalm-ui-warning-text: #504100;
  --emalm-ui-danger-bg: #f6dcdc;
  --emalm-ui-danger-border: #cc0000;
  --emalm-ui-danger-text: #cc0000;
  --emalm-ui-success-bg: #e8fce9;
  --emalm-ui-success-border: #93e49a;
  --emalm-ui-success-text: #006e19;
  --emalm-ui-autocomplete-border: #e0e0e0;
  --emalm-ui-autocomplete-selected-bg: #edf5ff;
  --emalm-ui-overlay: rgba(0, 0, 0, 0.5);
  --body-background-color: var(--emalm-ui-page-bg);
  --text-color: var(--emalm-ui-text);
  --muted-text-color: var(--emalm-ui-text-muted);
  --header-color: #006ffa;
  --link-color: var(--emalm-ui-link);
  --link-hover-color: var(--emalm-ui-link-hover);
  --default-border-color: var(--emalm-ui-border);
  --card-background-color: var(--emalm-ui-surface-1);
  --form-input-background: var(--emalm-ui-surface-1);
  --form-input-border-color: #e0e0e0;
  --form-button-text-color: #000000;
  --form-button-background: #ffffff;
  --form-button-border-color: #e0e0e0;
  --form-button-hover-background: #edf5ff;
  --button-primary-background-color: var(--emalm-ui-accent);
  --button-primary-hover-background-color: var(--emalm-ui-accent-strong);
  --table-header-border-color: var(--emalm-ui-border-strong);
  --table-row-border-color: #f0f0f0;
  --table-row-hover-background: #edf5ff;
  --table-even-row-background: #f5f5f5;
  --quick-search-form-background: var(--emalm-ui-surface-1);
  --note-box-background-color: #ffffee;
  --note-box-border-color: #000000;
  --note-body-background-color: #ffffee;
  --note-body-border-color: #000000;
  --note-body-text-color: #000000;
  --note-resize-handle-background-color: #000000;
  --note-preview-background-color: #ffffee;
  --note-unsaved-border-color: #cc0000;
  --note-movable-border-color: #006ffa;
  --note-highlight-color: #006ffa;
  --artist-tag-color: #ff0000;
  --artist-tag-hover-color: #cc0000;
  --copyright-tag-color: #a800aa;
  --copyright-tag-hover-color: #d700d9;
  --character-tag-color: #00aa00;
  --character-tag-hover-color: #35c64a;
  --general-tag-color: var(--emalm-ui-link);
  --general-tag-hover-color: var(--emalm-ui-link-hover);
  --meta-tag-color: #fd9200;
  --meta-tag-hover-color: #ffc5a5;
}

body[data-current-user-theme="gelbooru-dark"],
html[data-ui-theme="gelbooru-dark"],
body[data-ui-theme="gelbooru-dark"] {
  color-scheme: dark;
  --emalm-theme-page-bg:#1f1f1f;
  --emalm-theme-page-text:#999999;
  --emalm-theme-surface-bg:#111111;
  --emalm-theme-surface-text:#eeeeee;
  --emalm-theme-accent:#555555;
  --emalm-theme-accent-text:#ffffff;
  --emalm-theme-link:#ffffff;
  --emalm-theme-header-bg:#333333;
  --emalm-theme-header-text:#ffffff;
  --emalm-theme-footer-bg:#333333;
  --emalm-theme-footer-text:#ffffff;
  --emalm-theme-border:#333333;
  --emalm-ui-page-bg: #1f1f1f;
  --emalm-ui-page-text: #999999;
  --emalm-ui-surface-1: #111111;
  --emalm-ui-surface-2: #252525;
  --emalm-ui-surface-3: #333333;
  --emalm-ui-surface-text: #eeeeee;
  --emalm-ui-header-bg: #333333;
  --emalm-ui-header-text: #ffffff;
  --emalm-ui-footer-bg: #333333;
  --emalm-ui-footer-text: #ffffff;
  --emalm-ui-border: #333333;
  --emalm-ui-border-strong: #555555;
  --emalm-ui-text: #999999;
  --emalm-ui-text-muted: #c4c4c4;
  --emalm-ui-link: #ffffff;
  --emalm-ui-link-hover: #33cfff;
  --emalm-ui-accent: #555555;
  --emalm-ui-accent-strong: #666666;
  --emalm-ui-accent-soft: #303030;
  --emalm-ui-accent-text: #ffffff;
  --emalm-ui-focus: rgba(255, 255, 255, 0.24);
  --emalm-ui-shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.34);
  --emalm-ui-shadow-strong: 0 22px 48px rgba(0, 0, 0, 0.48);
  --emalm-ui-info-bg: #555555;
  --emalm-ui-info-border: #333333;
  --emalm-ui-info-text: #ffffff;
  --emalm-ui-warning-bg: #111111;
  --emalm-ui-warning-border: #333333;
  --emalm-ui-warning-text: #ffffff;
  --emalm-ui-danger-bg: #331b1b;
  --emalm-ui-danger-border: #cc0000;
  --emalm-ui-danger-text: #ff9999;
  --emalm-ui-success-bg: #173019;
  --emalm-ui-success-border: #306d36;
  --emalm-ui-success-text: #93e49a;
  --emalm-ui-autocomplete-border: #666666;
  --emalm-ui-autocomplete-selected-bg: #333333;
  --emalm-ui-overlay: rgba(0, 0, 0, 0.72);
  --body-background-color: var(--emalm-ui-page-bg);
  --text-color: var(--emalm-ui-text);
  --muted-text-color: var(--emalm-ui-text-muted);
  --header-color: #ffffff;
  --link-color: var(--emalm-ui-link);
  --link-hover-color: var(--emalm-ui-link-hover);
  --default-border-color: var(--emalm-ui-border);
  --card-background-color: var(--emalm-ui-surface-1);
  --form-input-background: #333333;
  --form-input-border-color: #555555;
  --form-button-text-color: #ffffff;
  --form-button-background: #333333;
  --form-button-border-color: #555555;
  --form-button-hover-background: #555555;
  --button-primary-background-color: var(--emalm-ui-accent);
  --button-primary-hover-background-color: var(--emalm-ui-accent-strong);
  --table-header-border-color: #333333;
  --table-row-border-color: #333333;
  --table-row-hover-background: #333333;
  --table-even-row-background: #252525;
  --quick-search-form-background: var(--emalm-ui-surface-1);
  --note-box-background-color: #ffffee;
  --note-box-border-color: #000000;
  --note-body-background-color: #ffffee;
  --note-body-border-color: #000000;
  --note-body-text-color: #000000;
  --note-resize-handle-background-color: #000000;
  --note-preview-background-color: #ffffee;
  --note-unsaved-border-color: #cc0000;
  --note-movable-border-color: #33cfff;
  --note-highlight-color: #33cfff;
  --artist-tag-color: #ff9999;
  --artist-tag-hover-color: #ffc3c3;
  --copyright-tag-color: #c797ff;
  --copyright-tag-hover-color: #ddc9fb;
  --character-tag-color: #93e49a;
  --character-tag-hover-color: #b2f2bb;
  --general-tag-color: var(--emalm-ui-link);
  --general-tag-hover-color: var(--emalm-ui-link-hover);
  --meta-tag-color: #ead084;
  --meta-tag-hover-color: #f7e7c3;
}

html {
  background: var(--emalm-ui-page-bg);
}

body {
  background: var(--emalm-ui-page-bg);
  color: var(--emalm-ui-text);
}

body,
input,
select,
textarea,
button {
  color: var(--emalm-ui-text);
}

a {
  color: var(--emalm-ui-link);
}

a:hover,
a:focus {
  color: var(--emalm-ui-link-hover);
}

html body a.user-owner,
html body a.user.user-owner,
html body a.user[data-user-level="60"],
html body a.user-admin,
html body a.user.user-admin,
html body a.user[data-user-level="50"],
html body a.user-moderator,
html body a.user.user-moderator,
html body a.user[data-user-level="40"],
html body a.user-approver,
html body a.user.user-approver,
html body a.user[data-user-level="37"],
html body a.user-contributor,
html body a.user.user-contributor,
html body a.user[data-user-level="35"],
html body a.user-builder,
html body a.user.user-builder,
html body a.user[data-user-level="32"],
html body a.user-platinum,
html body a.user.user-platinum,
html body a.user[data-user-level="31"],
html body a.user-gold,
html body a.user.user-gold,
html body a.user[data-user-level="30"],
html body a.user-member,
html body a.user.user-member,
html body a.user[data-user-level="20"],
html body a.user-restricted,
html body a.user.user-restricted,
html body a.user[data-user-level="10"],
html body a.user.user-guest,
html body a.user.user-banned,
html body a.user.user-deleted {
  font-weight: 600;
}

html body a.user-owner,
html body a.user.user-owner,
html body a.user[data-user-level="60"],
html body a.user-admin,
html body a.user.user-admin,
html body a.user[data-user-level="50"] {
  color: var(--user-owner-color) !important;
}

html body a.user-moderator,
html body a.user.user-moderator,
html body a.user[data-user-level="40"] {
  color: var(--user-moderator-color) !important;
}

html body a.user-approver,
html body a.user.user-approver,
html body a.user[data-user-level="37"],
html body a.user-contributor,
html body a.user.user-contributor,
html body a.user[data-user-level="35"],
html body a.user-builder,
html body a.user.user-builder,
html body a.user[data-user-level="32"] {
  color: var(--user-approver-color) !important;
}

html body a.user-platinum,
html body a.user.user-platinum,
html body a.user[data-user-level="31"] {
  color: var(--user-platinum-color) !important;
}

html body a.user-gold,
html body a.user.user-gold,
html body a.user[data-user-level="30"] {
  color: var(--user-gold-color) !important;
}

html body a.user-member,
html body a.user.user-member,
html body a.user[data-user-level="20"],
html body a.user-restricted,
html body a.user.user-restricted,
html body a.user[data-user-level="10"],
html body a.user.user-guest {
  color: var(--user-member-color) !important;
}

a.user.user-banned,
a.user.user-deleted {
  color: #888 !important;
  text-decoration: line-through;
}

a.user-owner:hover,
a.user-owner:focus,
a.user.user-owner:hover,
a.user.user-owner:focus,
a.user-admin:hover,
a.user-admin:focus,
a.user.user-admin:hover,
a.user.user-admin:focus {
  color: var(--user-owner-hover-color) !important;
}

a.user-moderator:hover,
a.user-moderator:focus,
a.user.user-moderator:hover,
a.user.user-moderator:focus {
  color: var(--user-moderator-hover-color) !important;
}

a.user-approver:hover,
a.user-approver:focus,
a.user.user-approver:hover,
a.user.user-approver:focus,
a.user-contributor:hover,
a.user-contributor:focus,
a.user.user-contributor:hover,
a.user.user-contributor:focus,
a.user-builder:hover,
a.user-builder:focus,
a.user.user-builder:hover,
a.user.user-builder:focus {
  color: var(--user-approver-hover-color) !important;
}

a.user-platinum:hover,
a.user-platinum:focus,
a.user.user-platinum:hover,
a.user.user-platinum:focus {
  color: var(--user-platinum-hover-color) !important;
}

a.user-gold:hover,
a.user-gold:focus,
a.user.user-gold:hover,
a.user.user-gold:focus {
  color: var(--user-gold-hover-color) !important;
}

a.user-member:hover,
a.user-member:focus,
a.user.user-member:hover,
a.user.user-member:focus,
a.user-restricted:hover,
a.user-restricted:focus,
a.user.user-restricted:hover,
a.user.user-restricted:focus,
a.user.user-guest:hover,
a.user.user-guest:focus {
  color: var(--user-member-hover-color) !important;
}

a.user.user-banned:hover,
a.user.user-banned:focus,
a.user.user-deleted:hover,
a.user.user-deleted:focus {
  color: #777 !important;
}

hr {
  border-color: var(--emalm-ui-border);
}

input,
select,
textarea,
.form-control,
.ui-widget input,
.ui-widget select,
.ui-widget textarea {
  background: var(--emalm-ui-surface-1);
  border-color: var(--emalm-ui-border);
  color: var(--emalm-ui-surface-text);
}

input::placeholder,
textarea::placeholder {
  color: var(--emalm-ui-text-muted);
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus,
button:focus,
.btn:focus,
a:focus {
  box-shadow: 0 0 0 3px var(--emalm-ui-focus);
  outline: none;
}

button,
input[type="submit"],
input[type="button"],
.btn {
  background-image: none;
  box-shadow: none;
}

.btn-default,
.btn,
input[type="submit"],
input[type="button"],
button:not(.ui-dialog-titlebar-close):not(.news-update-close):not(.emalm-top-toggle):not(.emalm-mobile-shell-toggle):not(.emalm-mobile-shell-close):not(.emalm-mobile-shell-language):not(.post-vote-button):not(.media-vote-button):not(.media-viewer-engagement-button):not(.media-viewer-favorite-button):not(.media-viewer-sidebar-link-button):not(.emalm-post-expunge-confirm-button):not(.media-comment-vote-button):not(.forum-vote-button) {
  background: var(--emalm-ui-accent);
  border-color: var(--emalm-ui-accent-strong);
  color: var(--emalm-ui-accent-text);
}

.btn-default:hover,
.btn-default:focus,
.btn:hover,
.btn:focus,
input[type="submit"]:hover,
input[type="submit"]:focus,
input[type="button"]:hover,
input[type="button"]:focus,
button:not(.ui-dialog-titlebar-close):not(.news-update-close):not(.emalm-top-toggle):not(.emalm-mobile-shell-toggle):not(.emalm-mobile-shell-close):not(.emalm-mobile-shell-language):not(.post-vote-button):not(.media-vote-button):not(.media-viewer-engagement-button):not(.media-viewer-favorite-button):not(.media-viewer-sidebar-link-button):not(.emalm-post-expunge-confirm-button):not(.media-comment-vote-button):not(.forum-vote-button):hover,
button:not(.ui-dialog-titlebar-close):not(.news-update-close):not(.emalm-top-toggle):not(.emalm-mobile-shell-toggle):not(.emalm-mobile-shell-close):not(.emalm-mobile-shell-language):not(.post-vote-button):not(.media-vote-button):not(.media-viewer-engagement-button):not(.media-viewer-favorite-button):not(.media-viewer-sidebar-link-button):not(.emalm-post-expunge-confirm-button):not(.media-comment-vote-button):not(.forum-vote-button):focus {
  background: var(--emalm-ui-accent-strong);
  border-color: var(--emalm-ui-accent-strong);
  color: var(--emalm-ui-accent-text);
}

.btn-link,
.btn-link:hover,
.btn-link:focus {
  background: transparent;
  border-color: transparent;
  color: var(--emalm-ui-link);
}

.panel,
.panel-default,
.well,
.dropdown-menu,
.ui-dialog,
.notice,
.autocomplete,
.emalm-static-page,
.emalm-listing-table-wrap,
.emalm-mobile-shell-drawer,
.emalm-mobile-home-card,
.emalm-mobile-home-section,
.emalm-posts-show .rside > div,
.emalm-posts-show .left,
table.striped,
#page table.striped,
.ui-widget-content {
  background: var(--emalm-ui-surface-1);
  border-color: var(--emalm-ui-border);
  color: var(--emalm-ui-surface-text);
}

.emalm-infinite-page .jumbotron {
  background: var(--emalm-ui-surface-1);
  border: 1px solid var(--emalm-ui-border);
  color: var(--emalm-ui-surface-text);
}

.emalm-infinite-page .jumbotron .lead,
.emalm-infinite-page .jumbotron h1,
.emalm-infinite-page .jumbotron p {
  color: var(--emalm-ui-surface-text);
}

table,
th,
td {
  border-color: var(--emalm-ui-border);
}

tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--emalm-ui-surface-1) 84%, var(--emalm-ui-surface-2) 16%);
}

tbody tr:hover {
  background: color-mix(in srgb, var(--emalm-ui-surface-1) 78%, var(--emalm-ui-accent-soft) 22%);
}

.notice.notice-info,
.notice-info,
.emalm-theme-note,
.ui-state-highlight {
  background: var(--emalm-ui-info-bg);
  border-color: var(--emalm-ui-info-border);
  color: var(--emalm-ui-info-text);
}

.notice.notice-warning,
.notice-warning {
  background: var(--emalm-ui-warning-bg);
  border-color: var(--emalm-ui-warning-border);
  color: var(--emalm-ui-warning-text);
}

.notice.notice-error,
.notice-error,
.emalm-request-integrity-warning,
.ui-state-error {
  background: var(--emalm-ui-danger-bg);
  border-color: var(--emalm-ui-danger-border);
  color: var(--emalm-ui-danger-text);
}

.notice.notice-success,
.notice-success {
  background: var(--emalm-ui-success-bg);
  border-color: var(--emalm-ui-success-border);
  color: var(--emalm-ui-success-text);
}

.emalm-top-header,
.emalm-mobile-shell-bar {
  background: var(--emalm-ui-header-bg);
  color: var(--emalm-ui-header-text);
}

html[data-ui-theme="gelbooru-light"] .emalm-top-header,
body[data-ui-theme="gelbooru-light"] .emalm-top-header,
html[data-ui-theme="gelbooru-light"] .emalm-mobile-shell-bar,
body[data-ui-theme="gelbooru-light"] .emalm-mobile-shell-bar,
html[data-ui-theme="gelbooru-light"] .navbar.navbar-inverse.navbar-top,
body[data-ui-theme="gelbooru-light"] .navbar.navbar-inverse.navbar-top {
  background: linear-gradient(#328dfe, #0773fb) !important;
  border-color: #006ffa !important;
}

html[data-ui-theme="gelbooru-dark"] .emalm-top-header,
body[data-ui-theme="gelbooru-dark"] .emalm-top-header,
html[data-ui-theme="gelbooru-dark"] .emalm-mobile-shell-bar,
body[data-ui-theme="gelbooru-dark"] .emalm-mobile-shell-bar,
html[data-ui-theme="gelbooru-dark"] .navbar.navbar-inverse.navbar-top,
body[data-ui-theme="gelbooru-dark"] .navbar.navbar-inverse.navbar-top {
  background: linear-gradient(#444444, #333333) !important;
  border-color: #333333 !important;
}

html[data-ui-theme^="gelbooru-"] body,
body[data-ui-theme^="gelbooru-"],
html[data-ui-theme^="gelbooru-"] input,
html[data-ui-theme^="gelbooru-"] select,
html[data-ui-theme^="gelbooru-"] textarea,
html[data-ui-theme^="gelbooru-"] button {
  font-family: verdana, sans-serif, helvetica;
}

html[data-ui-theme="gelbooru-light"] .emalm-subnav-menu,
body[data-ui-theme="gelbooru-light"] .emalm-subnav-menu {
  background: #444444;
  background: color-mix(in srgb, var(--emalm-theme-header-bg) 94%, var(--emalm-theme-header-text) 6%);
  border-top-color: #006ffa;
}

html[data-ui-theme="gelbooru-dark"] .emalm-subnav-menu,
body[data-ui-theme="gelbooru-dark"] .emalm-subnav-menu {
  background: #252525;
  background: color-mix(in srgb, var(--emalm-theme-header-bg) 94%, var(--emalm-theme-header-text) 6%);
  border-top-color: #333333;
}

html[data-ui-theme^="gelbooru-"] div.quote,
body[data-ui-theme^="gelbooru-"] div.quote,
html[data-ui-theme^="gelbooru-"] blockquote,
body[data-ui-theme^="gelbooru-"] blockquote {
  background-image: url("/images/themes/gelbooru/quote.png");
  background-position: top right;
  background-repeat: no-repeat;
}

.emalm-theme-banner-header,
.emalm-theme-banner-footer {
  background: var(--emalm-ui-surface-1);
  border-color: var(--emalm-ui-border);
  color: var(--emalm-ui-surface-text);
}

.emalm-top-header .dropdown-menu,
.ui-autocomplete,
.emalm-resource-autocomplete {
  background: var(--emalm-ui-surface-1);
  border-color: var(--emalm-ui-autocomplete-border);
  box-shadow: var(--emalm-ui-shadow-soft);
  color: var(--emalm-ui-surface-text);
}

.emalm-search-autocomplete-anchor {
  display: block;
  position: relative;
}

.emalm-resource-autocomplete {
  border: 1px solid var(--emalm-ui-autocomplete-border);
  border-radius: 10px;
  margin-top: 4px;
  max-height: 320px;
  min-width: min(420px, 100%);
  overflow: auto;
  padding: 4px;
  position: absolute;
  width: 100%;
  z-index: 1200;
}

.emalm-resource-autocomplete-group {
  color: var(--emalm-ui-text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 6px 8px 3px;
  text-transform: uppercase;
}

.emalm-post-search-suggestion {
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: inherit;
  display: block;
  margin: 0;
  padding: 7px 8px;
  text-align: left;
  width: 100%;
}

.emalm-post-search-suggestion:hover,
.emalm-post-search-suggestion:focus,
.emalm-post-search-suggestion.is-active {
  background: var(--emalm-ui-autocomplete-selected-bg);
  outline: none;
}

.emalm-post-search-suggestion-main {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.emalm-post-search-suggestion-label {
  min-width: 0;
}

.emalm-post-search-suggestion-detail {
  color: var(--emalm-ui-text-muted);
  display: block;
  font-size: 11px;
  line-height: 1.35;
  margin-top: 2px;
}

.emalm-autocomplete-badges {
  display: inline-flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

.emalm-autocomplete-badge {
  background: color-mix(in srgb, var(--emalm-ui-surface-3) 78%, transparent);
  border: 1px solid color-mix(in srgb, var(--emalm-ui-border-strong) 58%, transparent);
  border-radius: 999px;
  color: var(--emalm-ui-text-muted);
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  padding: 2px 6px;
  text-transform: uppercase;
}

.emalm-autocomplete-match {
  background: color-mix(in srgb, var(--emalm-ui-accent-soft) 32%, transparent);
  border-radius: 4px;
  color: inherit;
  padding: 0 0.1em;
}

.emalm-post-search-suggestion-label.tag-state-existing {
  background: rgba(121, 170, 235, 0.22);
  border-radius: 4px;
  color: #4d79b8;
  padding: 0 0.18em;
}

.emalm-post-search-suggestion-label.tag-state-draft-added {
  background: rgba(137, 208, 154, 0.22);
  border-radius: 4px;
  color: #3c8a56;
  padding: 0 0.18em;
}

.emalm-post-search-suggestion-label.tag-state-draft-removed {
  background: rgba(232, 153, 153, 0.2);
  border-radius: 4px;
  color: #b06363;
  padding: 0 0.18em;
  text-decoration: line-through;
}

.emalm-mobile-shell-backdrop,
.ui-widget-overlay {
  background: var(--emalm-ui-overlay);
}

::selection {
  background: color-mix(in srgb, var(--emalm-ui-accent) 36%, transparent);
  color: var(--emalm-ui-text);
}
.media-viewer-favorite-form {
  display: inline-flex;
  align-items: center;
}

.media-viewer-favorite-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.media-viewer-favorite-button [data-emalm-favorite-button-label] {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.media-viewer-favorite-form[data-emalm-favorite-state="active"] .media-viewer-favorite-button,
.media-viewer-favorite-form.is-favorited .media-viewer-favorite-button {
  border-color: #ff4f8b;
  background: linear-gradient(135deg, #ff4f8b 0%, #ff7a59 100%);
  color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 79, 139, 0.22), 0 0.45rem 1.1rem rgba(166, 30, 77, 0.22);
}

.media-viewer-favorite-form[data-emalm-favorite-state="active"] .media-viewer-favorite-button:hover,
.media-viewer-favorite-form.is-favorited .media-viewer-favorite-button:hover {
  background: linear-gradient(135deg, #e93f7b 0%, #ef6845 100%);
  color: #fff;
}

.media-viewer-favorite-form[data-emalm-favorite-state="active"] .media-viewer-favorite-button .glyphicon-heart,
.media-viewer-favorite-form.is-favorited .media-viewer-favorite-button .glyphicon-heart {
  color: #fff;
  text-shadow: 0 0 0.65rem rgba(255, 255, 255, 0.75);
}

/* Keep Danbooru-style user level colors stable across themes and page-specific link rules. */
html body #page a.user.user-owner,
html body #page a.user[data-user-level="60"],
html body .emalm-static-layout a.user.user-owner,
html body .emalm-static-layout a.user[data-user-level="60"],
html body .emalm-table a.user.user-owner,
html body .emalm-table a.user[data-user-level="60"],
html body .profile-user-header a.user.user-owner,
html body .profile-user-header a.user[data-user-level="60"] {
  color: var(--user-owner-color, #e00) !important;
}

html body #page a.user.user-admin,
html body #page a.user[data-user-level="50"],
html body .emalm-static-layout a.user.user-admin,
html body .emalm-static-layout a.user[data-user-level="50"],
html body .emalm-table a.user.user-admin,
html body .emalm-table a.user[data-user-level="50"] {
  color: var(--user-admin-color, #e00) !important;
}

html body #page a.user.user-moderator,
html body #page a.user[data-user-level="40"],
html body .emalm-static-layout a.user.user-moderator,
html body .emalm-static-layout a.user[data-user-level="40"],
html body .emalm-table a.user.user-moderator,
html body .emalm-table a.user[data-user-level="40"] {
  color: var(--user-moderator-color, #00a000) !important;
}

html body #page a.user.user-approver,
html body #page a.user.user-contributor,
html body #page a.user.user-builder,
html body #page a.user[data-user-level="37"],
html body #page a.user[data-user-level="35"],
html body #page a.user[data-user-level="32"],
html body .emalm-static-layout a.user.user-approver,
html body .emalm-static-layout a.user.user-contributor,
html body .emalm-static-layout a.user.user-builder,
html body .emalm-static-layout a.user[data-user-level="37"],
html body .emalm-static-layout a.user[data-user-level="35"],
html body .emalm-static-layout a.user[data-user-level="32"],
html body .emalm-table a.user.user-approver,
html body .emalm-table a.user.user-contributor,
html body .emalm-table a.user.user-builder,
html body .emalm-table a.user[data-user-level="37"],
html body .emalm-table a.user[data-user-level="35"],
html body .emalm-table a.user[data-user-level="32"] {
  color: var(--user-approver-color, #b000b0) !important;
}

html body #page a.user.user-platinum,
html body #page a.user[data-user-level="31"],
html body .emalm-static-layout a.user.user-platinum,
html body .emalm-static-layout a.user[data-user-level="31"],
html body .emalm-table a.user.user-platinum,
html body .emalm-table a.user[data-user-level="31"] {
  color: var(--user-platinum-color, #666) !important;
}

html body #page a.user.user-gold,
html body #page a.user[data-user-level="30"],
html body .emalm-static-layout a.user.user-gold,
html body .emalm-static-layout a.user[data-user-level="30"],
html body .emalm-table a.user.user-gold,
html body .emalm-table a.user[data-user-level="30"] {
  color: var(--user-gold-color, #ff4a00) !important;
}

html body #page a.user.user-member,
html body #page a.user.user-restricted,
html body #page a.user.user-guest,
html body #page a.user[data-user-level="20"],
html body #page a.user[data-user-level="10"],
html body .emalm-static-layout a.user.user-member,
html body .emalm-static-layout a.user.user-restricted,
html body .emalm-static-layout a.user.user-guest,
html body .emalm-static-layout a.user[data-user-level="20"],
html body .emalm-static-layout a.user[data-user-level="10"],
html body .emalm-table a.user.user-member,
html body .emalm-table a.user.user-restricted,
html body .emalm-table a.user.user-guest,
html body .emalm-table a.user[data-user-level="20"],
html body .emalm-table a.user[data-user-level="10"] {
  color: var(--user-member-color, #006ffa) !important;
}

/* Final user-color guard: page and feature styles may redefine generic links. */
html body a.user.user-owner,
html body a.user[data-user-level="60"],
html body a.user.user-admin,
html body a.user[data-user-level="50"] {
  color: var(--user-owner-color, #e00) !important;
}

html body a.user.user-moderator,
html body a.user[data-user-level="40"] {
  color: var(--user-moderator-color, #00a000) !important;
}

html body a.user.user-approver,
html body a.user.user-contributor,
html body a.user.user-builder,
html body a.user[data-user-level="37"],
html body a.user[data-user-level="35"],
html body a.user[data-user-level="32"] {
  color: var(--user-approver-color, #b000b0) !important;
}

html body a.user.user-platinum,
html body a.user[data-user-level="31"] {
  color: var(--user-platinum-color, #666) !important;
}

html body a.user.user-gold,
html body a.user[data-user-level="30"] {
  color: var(--user-gold-color, #ff4a00) !important;
}

html body a.user.user-member,
html body a.user.user-restricted,
html body a.user.user-guest,
html body a.user[data-user-level="20"],
html body a.user[data-user-level="10"] {
  color: var(--user-member-color, #006ffa) !important;
}
/* Post mode toolbar: make the selected action visually explicit across themes. */
.post-mode-menu-button.is-active,
.post-mode-menu-button[aria-pressed="true"] {
  background: var(--emalm-ui-accent, #2563eb) !important;
  border-color: var(--emalm-ui-accent, #2563eb) !important;
  color: var(--emalm-ui-accent-contrast, #fff) !important;
  box-shadow: 0 0 0 2px var(--emalm-ui-accent-soft, rgba(37, 99, 235, .18)) !important;
}

.post-mode-menu-button.is-active[data-post-mode-value="add-fav"],
.post-mode-menu-button[aria-pressed="true"][data-post-mode-value="add-fav"],
.post-mode-menu-button.is-active[data-post-mode-value="remove-fav"],
.post-mode-menu-button[aria-pressed="true"][data-post-mode-value="remove-fav"] {
  background: linear-gradient(135deg, #ff4f93, #ff7a59) !important;
  border-color: #ff4f93 !important;
  color: #fff !important;
  box-shadow: 0 0 0 2px rgba(255, 79, 147, .22), 0 8px 20px rgba(255, 79, 147, .18) !important;
}

.post-mode-menu-button.is-active[data-post-mode-value="vote-up"],
.post-mode-menu-button[aria-pressed="true"][data-post-mode-value="vote-up"] {
  background: linear-gradient(135deg, #16a34a, #22c55e) !important;
  border-color: #16a34a !important;
  color: #fff !important;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, .22), 0 8px 20px rgba(34, 197, 94, .18) !important;
}

.post-mode-menu-button.is-active[data-post-mode-value="vote-down"],
.post-mode-menu-button[aria-pressed="true"][data-post-mode-value="vote-down"] {
  background: linear-gradient(135deg, #dc2626, #f97316) !important;
  border-color: #dc2626 !important;
  color: #fff !important;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, .22), 0 8px 20px rgba(220, 38, 38, .18) !important;
}

.post-mode-menu-button.is-active[data-post-mode-value="unvote"],
.post-mode-menu-button[aria-pressed="true"][data-post-mode-value="unvote"] {
  background: linear-gradient(135deg, #64748b, #94a3b8) !important;
  border-color: #64748b !important;
  color: #fff !important;
  box-shadow: 0 0 0 2px rgba(100, 116, 139, .22), 0 8px 20px rgba(100, 116, 139, .16) !important;
}

.post-mode-menu-button.is-active .glyphicon,
.post-mode-menu-button[aria-pressed="true"] .glyphicon,
.post-mode-menu-button.is-active .post-mode-menu-symbol,
.post-mode-menu-button[aria-pressed="true"] .post-mode-menu-symbol {
  color: inherit !important;
}
 .compare-tags-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
 .compare-tags-side { min-width: 0; padding: 1rem; border: 1px solid var(--emalm-border, #ddd); }
 .compare-tags-form { display: flex; gap: .75rem; flex-wrap: wrap; align-items: end; }
 .compare-tags-form label { display: grid; gap: .25rem; flex: 1 1 16rem; }
 .compare-tags-query { overflow-wrap: anywhere; }
 .compare-tags-section { margin-top: 1rem; }
 @media (max-width: 768px) { .compare-tags-grid { grid-template-columns: 1fr; } }
