/* ============================================================
   YWSH — Your Web Starts Here
   Themes via body[data-ywsh-theme="<theme-key>"]

   Token layers:
   1) :root — structure only (radius, font, transitions). Fonts stay global.
   2) Theme base packs — colors a future "custom theme" UI would edit.
   3) body.ywsh-app derivation — chrome tokens shared by every theme.
   Layout/components use var(--ywsh-*) only — never raw theme hex.
   ============================================================ */

:root {
  --ywsh-radius-sm: 6px;
  --ywsh-radius-md: 10px;
  --ywsh-radius-lg: 14px;
  --ywsh-transition: 0.2s ease;
  --ywsh-font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --ywsh-max-width: 99%;
  --ywsh-link-dead: #c62828;
  --ywsh-link-dead-muted: rgba(198, 40, 40, 0.12);
}

/* --- Theme base packs (editable color set for future user themes) --- */

body.ywsh-app[data-ywsh-theme="default"],
body.ywsh-app[data-ywsh-theme="ocean-blue"] {
  --ywsh-bg-main: #c5cedd;
  --ywsh-bg-surface: #d4dce8;
  --ywsh-bg-raised: #c9d3e1;
  --ywsh-bg-card: #eef2f8;
  --ywsh-bg-muted: #b0bbce;
  --ywsh-color-primary: #3b6fd9;
  --ywsh-color-primary-rgb: 59, 111, 217;
  --ywsh-color-accent: #6e62a8;
  --ywsh-text-main: #1e293b;
  --ywsh-text-muted: #64748b;
  --ywsh-text-inverse: #ffffff;
  --ywsh-border: #9aa8be;
  --ywsh-border-light: #b0bcce;
  --ywsh-highlight: #fde68a;
  --ywsh-tone-ink: #0f172a;
  --ywsh-tone-paper: #ffffff;
}

body.ywsh-app[data-ywsh-theme="forest-green"] {
  --ywsh-bg-main: #d8e0d9;
  --ywsh-bg-surface: #e3eae3;
  --ywsh-bg-raised: #d7dfd8;
  --ywsh-bg-card: #f1f5f1;
  --ywsh-bg-muted: #c2cec3;
  --ywsh-color-primary: #2f7c3f;
  --ywsh-color-primary-rgb: 47, 124, 63;
  --ywsh-color-accent: #3f8f77;
  --ywsh-text-main: #1f2e22;
  --ywsh-text-muted: #5f7465;
  --ywsh-text-inverse: #ffffff;
  --ywsh-border: #9db3a1;
  --ywsh-border-light: #b7c7ba;
  --ywsh-highlight: #d9efad;
  --ywsh-tone-ink: #142518;
  --ywsh-tone-paper: #ffffff;
}

body.ywsh-app[data-ywsh-theme="violet-purple"] {
  --ywsh-bg-main: #ddd7ea;
  --ywsh-bg-surface: #e8e2f0;
  --ywsh-bg-raised: #ddd6eb;
  --ywsh-bg-card: #f3eff9;
  --ywsh-bg-muted: #c7bddf;
  --ywsh-color-primary: #6d4fd0;
  --ywsh-color-primary-rgb: 109, 79, 208;
  --ywsh-color-accent: #8b63bf;
  --ywsh-text-main: #241e38;
  --ywsh-text-muted: #6a6187;
  --ywsh-text-inverse: #ffffff;
  --ywsh-border: #aa9fca;
  --ywsh-border-light: #c1b7da;
  --ywsh-highlight: #e8dbff;
  --ywsh-tone-ink: #1e1632;
  --ywsh-tone-paper: #ffffff;
}

body.ywsh-app[data-ywsh-theme="sunset-orange"] {
  --ywsh-bg-main: #ebddd4;
  --ywsh-bg-surface: #f2e6dd;
  --ywsh-bg-raised: #eadcd2;
  --ywsh-bg-card: #f8f1ea;
  --ywsh-bg-muted: #ddc6b8;
  --ywsh-color-primary: #ef7d28;
  --ywsh-color-primary-rgb: 239, 125, 40;
  --ywsh-color-accent: #e2574c;
  --ywsh-text-main: #3a251a;
  --ywsh-text-muted: #806256;
  --ywsh-text-inverse: #ffffff;
  --ywsh-border: #caa997;
  --ywsh-border-light: #dac0b2;
  --ywsh-highlight: #ffd7ac;
  --ywsh-tone-ink: #321e14;
  --ywsh-tone-paper: #ffffff;
}

body.ywsh-app[data-ywsh-theme="dark"],
body.ywsh-app[data-ywsh-theme="midnight-dark"] {
  --ywsh-bg-main: #0b1220;
  --ywsh-bg-surface: #121a2b;
  --ywsh-bg-raised: #182338;
  --ywsh-bg-card: #1c2a44;
  --ywsh-bg-muted: #243552;
  --ywsh-color-primary: #4d8fff;
  --ywsh-color-primary-rgb: 77, 143, 255;
  --ywsh-color-accent: #5ad4ff;
  --ywsh-text-main: #e8efff;
  --ywsh-text-muted: #9eb0d0;
  --ywsh-text-inverse: #0b1220;
  --ywsh-border: #35507a;
  --ywsh-border-light: #2a4062;
  --ywsh-highlight: #2a4a7a;
  --ywsh-tone-ink: #ffffff;
  --ywsh-tone-paper: #000000;
  color-scheme: dark;
}

body.ywsh-app[data-ywsh-theme="soft-teal"] {
  --ywsh-bg-main: #dce7ea;
  --ywsh-bg-surface: #e8f1f3;
  --ywsh-bg-raised: #dde9eb;
  --ywsh-bg-card: #f4f9fa;
  --ywsh-bg-muted: #c4d6db;
  --ywsh-color-primary: #2f9ca8;
  --ywsh-color-primary-rgb: 47, 156, 168;
  --ywsh-color-accent: #699cc8;
  --ywsh-text-main: #1f3238;
  --ywsh-text-muted: #5f7a84;
  --ywsh-text-inverse: #ffffff;
  --ywsh-border: #9eb8c0;
  --ywsh-border-light: #bdd1d7;
  --ywsh-highlight: #c9ecf1;
  --ywsh-tone-ink: #142a2e;
  --ywsh-tone-paper: #ffffff;
}

/* Notion — warm paper canvas, single blue accent (Design.Md/DESIGN-notion.md) */
body.ywsh-app[data-ywsh-theme="notion"] {
  --ywsh-bg-main: #f6f5f4;
  --ywsh-bg-surface: #f1f0ee;
  --ywsh-bg-raised: #ebeae8;
  --ywsh-bg-card: #ffffff;
  --ywsh-bg-muted: #e6e6e6;
  --ywsh-color-primary: #0075de;
  --ywsh-color-primary-rgb: 0, 117, 222;
  --ywsh-color-accent: #213183;
  --ywsh-text-main: #31302e;
  --ywsh-text-muted: #615d59;
  --ywsh-text-inverse: #ffffff;
  --ywsh-border: #e6e6e6;
  --ywsh-border-light: #f0efed;
  --ywsh-highlight: #dceefb;
  --ywsh-tone-ink: #000000;
  --ywsh-tone-paper: #ffffff;
}

/* Starbucks — warm cream canvas, green CTA system (Design.Md/DESIGN-starbucks.md) */
body.ywsh-app[data-ywsh-theme="starbucks"] {
  --ywsh-bg-main: #f2f0eb;
  --ywsh-bg-surface: #edebe9;
  --ywsh-bg-raised: #e8e6e1;
  --ywsh-bg-card: #ffffff;
  --ywsh-bg-muted: #d4e9e2;
  --ywsh-color-primary: #00754a;
  --ywsh-color-primary-rgb: 0, 117, 74;
  --ywsh-color-accent: #006241;
  --ywsh-text-main: #212121;
  --ywsh-text-muted: #6b6b6b;
  --ywsh-text-inverse: #ffffff;
  --ywsh-border: #d4d0c8;
  --ywsh-border-light: #e8e6e1;
  --ywsh-highlight: #d4e9e2;
  --ywsh-tone-ink: #000000;
  --ywsh-tone-paper: #ffffff;
}

/* Mastercard — putty cream canvas, signal orange accent (Design.Md/DESIGN-mastercard.md) */
body.ywsh-app[data-ywsh-theme="mastercard"] {
  --ywsh-bg-main: #f3f0ee;
  --ywsh-bg-surface: #ebe8e4;
  --ywsh-bg-raised: #e5e2de;
  --ywsh-bg-card: #fcfbf9;
  --ywsh-bg-muted: #e0dcd6;
  --ywsh-color-primary: #cf4500;
  --ywsh-color-primary-rgb: 207, 69, 0;
  --ywsh-color-accent: #141413;
  --ywsh-text-main: #141413;
  --ywsh-text-muted: #696969;
  --ywsh-text-inverse: #ffffff;
  --ywsh-border: #d1cdc7;
  --ywsh-border-light: #ebe8e4;
  --ywsh-highlight: #fde8dc;
  --ywsh-tone-ink: #141413;
  --ywsh-tone-paper: #ffffff;
}

/* Lamborghini — true black canvas, gold primary (Design.Md/DESIGN-lamborghini.md) */
body.ywsh-app[data-ywsh-theme="lamborghini"] {
  --ywsh-bg-main: #000000;
  --ywsh-bg-surface: #181818;
  --ywsh-bg-raised: #202020;
  --ywsh-bg-card: #202020;
  --ywsh-bg-muted: #313131;
  --ywsh-color-primary: #ffc000;
  --ywsh-color-primary-rgb: 255, 192, 0;
  --ywsh-color-accent: #29abe2;
  --ywsh-text-main: #ffffff;
  --ywsh-text-muted: #969696;
  --ywsh-text-inverse: #000000;
  --ywsh-border: #494949;
  --ywsh-border-light: #313131;
  --ywsh-highlight: #917300;
  --ywsh-tone-ink: #ffffff;
  --ywsh-tone-paper: #000000;
  color-scheme: dark;
}

/* Nintendo 2001 — periwinkle console chrome (Design.Md/DESIGN-nintendo-2001.md) */
body.ywsh-app[data-ywsh-theme="nintendo-2001"] {
  --ywsh-bg-main: #7a8aba;
  --ywsh-bg-surface: #8ba1d4;
  --ywsh-bg-raised: #9fbee7;
  --ywsh-bg-card: #ffffff;
  --ywsh-bg-muted: #dedede;
  --ywsh-color-primary: #f68d1f;
  --ywsh-color-primary-rgb: 246, 141, 31;
  --ywsh-color-accent: #e60012;
  --ywsh-text-main: #21242e;
  --ywsh-text-muted: #3d4f97;
  --ywsh-text-inverse: #ffffff;
  --ywsh-border: #5a5f8c;
  --ywsh-border-light: #8ba1d4;
  --ywsh-highlight: #ecab37;
  --ywsh-tone-ink: #21242e;
  --ywsh-tone-paper: #ffffff;
}

/* Ferrari — near-black canvas, Rosso Corsa primary (Design.Md/DESIGN-ferrari.md) */
body.ywsh-app[data-ywsh-theme="ferrari"] {
  --ywsh-bg-main: #181818;
  --ywsh-bg-surface: #202020;
  --ywsh-bg-raised: #303030;
  --ywsh-bg-card: #303030;
  --ywsh-bg-muted: #303030;
  --ywsh-color-primary: #da291c;
  --ywsh-color-primary-rgb: 218, 41, 28;
  --ywsh-color-accent: #fff200;
  --ywsh-text-main: #ffffff;
  --ywsh-text-muted: #969696;
  --ywsh-text-inverse: #181818;
  --ywsh-border: #303030;
  --ywsh-border-light: #404040;
  --ywsh-highlight: #b01e0a;
  --ywsh-tone-ink: #ffffff;
  --ywsh-tone-paper: #181818;
  color-scheme: dark;
}

/* Spotify — immersive near-black, green accent (Design.Md/DESIGN-spotify.md) */
body.ywsh-app[data-ywsh-theme="spotify"] {
  --ywsh-bg-main: #121212;
  --ywsh-bg-surface: #181818;
  --ywsh-bg-raised: #1f1f1f;
  --ywsh-bg-card: #282828;
  --ywsh-bg-muted: #1f1f1f;
  --ywsh-color-primary: #1ed760;
  --ywsh-color-primary-rgb: 30, 215, 96;
  --ywsh-color-accent: #539df5;
  --ywsh-text-main: #ffffff;
  --ywsh-text-muted: #b3b3b3;
  --ywsh-text-inverse: #121212;
  --ywsh-border: #4d4d4d;
  --ywsh-border-light: #535353;
  --ywsh-highlight: #1a3d2a;
  --ywsh-tone-ink: #ffffff;
  --ywsh-tone-paper: #121212;
  color-scheme: dark;
}

/*
 * Shared derivation — identical formulas for every theme.
 * Future custom themes only need to set the base pack above.
 */
body.ywsh-app {
  --ywsh-color-primary-hover: color-mix(in srgb, var(--ywsh-color-primary) 78%, var(--ywsh-tone-ink));
  --ywsh-color-primary-subtle: color-mix(in srgb, var(--ywsh-color-primary) 14%, var(--ywsh-bg-card));
  --ywsh-color-primary-muted: color-mix(in srgb, var(--ywsh-color-primary) 16%, transparent);
  --ywsh-text-link: var(--ywsh-color-primary);
  --ywsh-shadow-sm: 0 1px 2px color-mix(in srgb, var(--ywsh-tone-ink) 8%, transparent);
  --ywsh-shadow-md: 0 4px 10px color-mix(in srgb, var(--ywsh-tone-ink) 10%, transparent);
  --ywsh-shadow-lg: 0 8px 20px color-mix(in srgb, var(--ywsh-tone-ink) 12%, transparent);
  --ywsh-tab-inactive-bg: transparent;
  --ywsh-tab-inactive-text: var(--ywsh-text-muted);
  --ywsh-tab-top-active-bg: var(--ywsh-color-primary-subtle);
  --ywsh-tab-top-active-text: var(--ywsh-color-primary);
  --ywsh-card-accent-color: var(--ywsh-color-primary);
  --ywsh-card-header-color: var(--ywsh-color-primary);
  --ywsh-card-body-color: color-mix(in srgb, var(--ywsh-color-primary) 8%, var(--ywsh-bg-card));
  --ywsh-card-header-text: var(--ywsh-text-main);
  --ywsh-top-tab-link-bg: color-mix(in srgb, var(--ywsh-color-primary) 8%, transparent);
  --ywsh-top-tab-link-bg-hover: color-mix(in srgb, var(--ywsh-color-primary) 14%, transparent);
  --ywsh-top-tab-link-border: color-mix(in srgb, var(--ywsh-color-primary) 22%, transparent);
  --ywsh-top-tab-link-border-hover: color-mix(in srgb, var(--ywsh-color-primary) 34%, transparent);
  --ywsh-top-tab-link-text: var(--ywsh-text-main);
  --ywsh-top-tab-link-underline: var(--ywsh-color-primary);
  --ywsh-edit-header-bg: var(--ywsh-bg-muted);
  --ywsh-edit-header-text: var(--ywsh-text-main);
  --ywsh-drop-preview-bg: color-mix(in srgb, var(--ywsh-color-primary) 12%, transparent);
  --ywsh-drop-preview-border: 2px dashed var(--ywsh-color-primary);
  --ywsh-btn-hover-overlay: color-mix(in srgb, var(--ywsh-tone-paper) 20%, transparent);
  --ywsh-btn-hover-overlay-muted: color-mix(in srgb, var(--ywsh-tone-ink) 6%, transparent);
  --ywsh-divider-subtle: color-mix(in srgb, var(--ywsh-tone-ink) 8%, transparent);
  --ywsh-modal-overlay: color-mix(in srgb, var(--ywsh-tone-ink) 48%, transparent);
  --ywsh-tooltip-bg: var(--ywsh-text-main);
  --ywsh-tooltip-text: var(--ywsh-text-inverse);
  --ywsh-tag-bg: color-mix(in srgb, var(--ywsh-tone-paper) 16%, transparent);
  --ywsh-focus-ring: color-mix(in srgb, var(--ywsh-color-primary) 28%, transparent);
}

body.ywsh-app[data-ywsh-theme="dark"],
body.ywsh-app[data-ywsh-theme="midnight-dark"],
body.ywsh-app[data-ywsh-theme="lamborghini"],
body.ywsh-app[data-ywsh-theme="ferrari"],
body.ywsh-app[data-ywsh-theme="spotify"] {
  --ywsh-color-primary-hover: color-mix(in srgb, var(--ywsh-color-primary) 72%, var(--ywsh-tone-ink));
  --ywsh-shadow-sm: 0 1px 3px color-mix(in srgb, #000 40%, transparent);
  --ywsh-shadow-md: 0 4px 12px color-mix(in srgb, #000 45%, transparent);
  --ywsh-shadow-lg: 0 8px 24px color-mix(in srgb, #000 50%, transparent);
  --ywsh-btn-hover-overlay: color-mix(in srgb, var(--ywsh-tone-ink) 10%, transparent);
  --ywsh-btn-hover-overlay-muted: color-mix(in srgb, var(--ywsh-tone-ink) 8%, transparent);
  --ywsh-divider-subtle: color-mix(in srgb, var(--ywsh-tone-ink) 10%, transparent);
  --ywsh-modal-overlay: color-mix(in srgb, #000 72%, transparent);
  --ywsh-tab-top-active-text: color-mix(in srgb, var(--ywsh-color-primary) 40%, var(--ywsh-text-main));
  --ywsh-top-tab-link-underline: color-mix(in srgb, var(--ywsh-color-primary) 35%, var(--ywsh-text-main));
}

/* --- Reset & base --- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body.ywsh-app {
  margin: 0;
  min-height: 100vh;
  font-family: var(--ywsh-font);
  color: var(--ywsh-text-main);
  background: var(--ywsh-bg-main);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

svg.ywsh-icon {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
  display: block;
}

/* Author display:block above would otherwise override the HTML hidden attribute. */
svg.ywsh-icon[hidden] {
  display: none !important;
}

/* --- Shared edit/save buttons --- */

.ywsh-edit-button,
.ywsh-save-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  border-radius: var(--ywsh-radius-sm);
  color: inherit;
  opacity: 0.85;
  transition: opacity var(--ywsh-transition), background var(--ywsh-transition);
}

.ywsh-edit-button:hover,
.ywsh-save-button:hover {
  opacity: 1;
  background: var(--ywsh-btn-hover-overlay);
}

.ywsh-category-card-body .ywsh-edit-button {
  color: var(--ywsh-text-main);
  opacity: 0.6;
}

.ywsh-category-card-body .ywsh-edit-button:hover {
  opacity: 1;
  background: var(--ywsh-btn-hover-overlay-muted);
}

.ywsh-category-card__add-weblink,
.ywsh-top-tab__add-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--ywsh-color-primary);
  border-radius: var(--ywsh-radius-sm);
  background: var(--ywsh-color-primary-subtle);
  color: var(--ywsh-color-primary);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  opacity: 1;
  transition: background var(--ywsh-transition), color var(--ywsh-transition), border-color var(--ywsh-transition), box-shadow var(--ywsh-transition);
}

.ywsh-category-card-body__toolbar,
.ywsh-top-tab__panel-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0.35rem 0.75rem 0.1rem;
}

.ywsh-category-card__add-weblink .ywsh-icon,
.ywsh-top-tab__add-link .ywsh-icon {
  width: 1rem;
  height: 1rem;
}

.ywsh-category-card__add-weblink:hover,
.ywsh-top-tab__add-link:hover,
.ywsh-category-card__add-weblink:focus-visible,
.ywsh-top-tab__add-link:focus-visible {
  color: var(--ywsh-tone-paper, #fff);
  border-color: var(--ywsh-color-primary);
  background: var(--ywsh-color-primary);
  box-shadow: var(--ywsh-shadow-sm);
  outline: none;
}

/* --- TopTabs_ywsh --- */

.ywsh-top-tabs {
  width: var(--ywsh-max-width);
  margin: 0.75rem auto 0;
  padding: 0 0.5%;
}

.ywsh-top-tabs__inner {
  background: var(--ywsh-bg-card);
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-md);
  box-shadow: var(--ywsh-shadow-sm);
  overflow: hidden;
}

.ywsh-top-tabs__button-row {
  display: flex;
  flex-wrap: wrap;
  background: var(--ywsh-bg-raised);
  border-bottom: 1px solid var(--ywsh-border-light);
}

.ywsh-top-tab {
  display: none;
}

.ywsh-top-tab--active {
  display: block;
}

.ywsh-top-tab__button {
  padding: 0.6rem 1.25rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ywsh-tab-inactive-text);
  background: var(--ywsh-tab-inactive-bg);
  border-right: 1px solid var(--ywsh-border-light);
  border-bottom: 2px solid transparent;
  transition: background var(--ywsh-transition), color var(--ywsh-transition), border-color var(--ywsh-transition);
}

.ywsh-top-tab__button:hover {
  background: var(--ywsh-color-primary-subtle);
  color: var(--ywsh-text-main);
}

.ywsh-top-tab__button--active {
  background: var(--ywsh-tab-top-active-bg);
  color: var(--ywsh-tab-top-active-text);
  border-bottom-color: var(--ywsh-color-primary);
}

.ywsh-top-tab__button--dnd-target {
  background: var(--ywsh-color-primary-subtle);
  outline: 2px dashed var(--ywsh-color-primary);
  outline-offset: -3px;
}

.ywsh-content-tab-item--dnd-target {
  background: var(--ywsh-color-primary-subtle);
  outline: 2px dashed var(--ywsh-color-primary);
  outline-offset: -2px;
  border-radius: var(--ywsh-radius-sm);
}

.ywsh-top-tab__label {
  pointer-events: none;
}

.ywsh-tab-name-editor {
  display: none;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.45rem;
}

.ywsh-tab-name-editor--open {
  display: inline-flex;
}

.ywsh-tab-name-editor__input {
  min-width: 8rem;
  max-width: 14rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-sm);
  background: var(--ywsh-bg-surface);
}

.ywsh-tab-name-editor__input:focus {
  outline: none;
  border-color: var(--ywsh-color-primary);
  box-shadow: 0 0 0 3px rgba(var(--ywsh-color-primary-rgb), 0.15);
}

.ywsh-tab-name-editor__save {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-sm);
  background: var(--ywsh-bg-surface);
  opacity: 1;
}

.ywsh-tab-name-editor__save .ywsh-icon {
  width: 1rem;
  height: 1rem;
}

.ywsh-tab-name-editor__save:disabled {
  opacity: 0.65;
  cursor: wait;
}

.ywsh-top-tab__panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-sizing: border-box;
  width: 100%;
  min-height: 5.5rem;
  padding: 0.75rem 1rem;
  background: color-mix(in srgb, var(--ywsh-bg-main) 88%, var(--ywsh-bg-raised));
  border-top: 1px solid color-mix(in srgb, var(--ywsh-border-light) 70%, transparent);
}

.ywsh-top-tabs__panels > .ywsh-top-tab:nth-child(4n+2) .ywsh-top-tab__panel {
  background: color-mix(in srgb, var(--ywsh-bg-main) 82%, var(--ywsh-bg-raised));
}

.ywsh-top-tabs__panels > .ywsh-top-tab:nth-child(4n+3) .ywsh-top-tab__panel {
  background: color-mix(in srgb, var(--ywsh-bg-main) 76%, var(--ywsh-bg-surface));
}

.ywsh-top-tabs__panels > .ywsh-top-tab:nth-child(4n+4) .ywsh-top-tab__panel {
  background: color-mix(in srgb, var(--ywsh-bg-main) 70%, var(--ywsh-bg-surface));
}

.ywsh-top-tab__panel[data-ywsh-drop-zone="top-tab-links"].ywsh-dnd-drop-zone--active {
  background: color-mix(in srgb, var(--ywsh-color-primary-subtle) 70%, var(--ywsh-bg-raised));
  outline: 2px dashed var(--ywsh-color-primary);
  outline-offset: -4px;
}

/* TopTabLinks_ywsh */
.ywsh-top-tab-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  align-content: flex-start;
  flex: 1 1 auto;
  width: 100%;
  min-height: 3.75rem;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  border-radius: var(--ywsh-radius-sm);
}

.ywsh-top-tab-link {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ywsh-top-tab-link__edit {
  color: var(--ywsh-text-muted);
  opacity: 0.65;
}

.ywsh-top-tab-link__edit:hover {
  opacity: 1;
  color: var(--ywsh-color-primary);
}

/* Top tab add-link styles shared with category card — see .ywsh-category-card__add-weblink block */

.ywsh-top-tab-link a {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ywsh-top-tab-link-text);
  text-decoration: underline;
  text-decoration-color: var(--ywsh-top-tab-link-underline);
  text-underline-offset: 3px;
  background: var(--ywsh-top-tab-link-bg);
  border: 1px solid var(--ywsh-top-tab-link-border);
  border-radius: var(--ywsh-radius-md);
  box-shadow: var(--ywsh-shadow-sm);
  transition: background var(--ywsh-transition), border-color var(--ywsh-transition), box-shadow var(--ywsh-transition);
}

.ywsh-top-tab-link a:hover {
  background: var(--ywsh-top-tab-link-bg-hover);
  border-color: var(--ywsh-top-tab-link-border-hover);
  box-shadow: var(--ywsh-shadow-sm);
  color: var(--ywsh-top-tab-link-text);
}

/* --- MenuBar_ywsh --- */

.ywsh-menubar {
  width: var(--ywsh-max-width);
  margin: 0 auto;
  padding: 0.75rem 0.5%;
  position: sticky;
  top: 0;
  z-index: 100;
  /* Menubar is NOT draggable */
}

.ywsh-menubar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--ywsh-bg-card);
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-md);
  padding: 0.65rem 1rem;
  box-shadow: var(--ywsh-shadow-sm);
}

.ywsh-menubar__start {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.ywsh-menubar__edit-toggle[aria-pressed="true"] {
  background: var(--ywsh-color-primary-muted);
  color: var(--ywsh-color-primary);
}

.ywsh-menubar__add-category:hover {
  color: var(--ywsh-color-primary);
  background: var(--ywsh-color-primary-muted);
}

.ywsh-menubar__center {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1.25rem;
}

.ywsh-menubar__actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.ywsh-menubar__icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--ywsh-radius-sm);
  color: var(--ywsh-text-muted);
  transition: background var(--ywsh-transition), color var(--ywsh-transition);
}

.ywsh-menubar__icon-btn:hover {
  background: var(--ywsh-bg-muted);
  color: var(--ywsh-text-main);
}

.ywsh-menubar__snippets-btn {
  width: auto;
  min-width: 3.25rem;
  padding: 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: var(--ywsh-color-primary);
  border: 1px solid var(--ywsh-color-primary-hover);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.ywsh-menubar__snippets-btn:hover {
  background: var(--ywsh-color-primary-hover);
  color: #fff;
}

.ywsh-menubar__news-btn,
.ywsh-menubar__settings-btn {
  position: relative;
}

.ywsh-unread-badge {
  position: absolute;
  top: -0.2rem;
  right: -0.25rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: var(--ywsh-color-primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.1rem;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 0 0 2px var(--ywsh-bg-card);
}

.ywsh-unread-badge[hidden] {
  display: none !important;
}

/* Search */
.ywsh-search {
  position: relative;
  min-width: 220px;
  flex: 1 1 280px;
  max-width: 420px;
}

.ywsh-search__label,
.ywsh-category-filter__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ywsh-search__input {
  width: 100%;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-sm);
  background: var(--ywsh-bg-surface);
  transition: border-color var(--ywsh-transition), box-shadow var(--ywsh-transition);
}

.ywsh-search__input:focus {
  outline: none;
  border-color: var(--ywsh-color-primary);
  box-shadow: 0 0 0 3px rgba(var(--ywsh-color-primary-rgb), 0.15);
}

.ywsh-search__suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--ywsh-bg-surface);
  border: 1px solid var(--ywsh-border-light);
  border-radius: var(--ywsh-radius-sm);
  box-shadow: var(--ywsh-shadow-md);
  max-height: 240px;
  overflow-y: auto;
  z-index: 200;
}

.ywsh-search__suggestion {
  padding: 0.5rem 0.85rem;
  font-size: 0.875rem;
  cursor: pointer;
  border-bottom: 1px solid var(--ywsh-border-light);
}

.ywsh-search__suggestion:last-child {
  border-bottom: none;
}

.ywsh-search__suggestion:hover,
.ywsh-search__suggestion--active {
  background: var(--ywsh-color-primary-muted);
}

.ywsh-search__suggestion-type {
  display: block;
  font-size: 0.7rem;
  color: var(--ywsh-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Category filter */
.ywsh-category-filter {
  flex: 0 1 220px;
}

.ywsh-category-filter__controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ywsh-category-filter__select {
  width: 100%;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-sm);
  background: var(--ywsh-bg-surface);
  cursor: pointer;
}

.ywsh-category-filter__filter-toggle {
  flex-shrink: 0;
}

.ywsh-category-filter__input {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-sm);
  background: var(--ywsh-bg-surface);
}

.ywsh-category-filter__select:focus {
  outline: none;
  border-color: var(--ywsh-color-primary);
  box-shadow: 0 0 0 3px rgba(var(--ywsh-color-primary-rgb), 0.15);
}

@media (max-width: 720px) {
  .ywsh-results-panel__toolbar,
  .ywsh-results-panel__actions {
    justify-content: flex-start;
  }

  .ywsh-results-panel__actions .ywsh-modal__btn,
  .ywsh-results-panel__actions .ywsh-batch-bar__move {
    flex: 1 1 auto;
  }
}

/* --- ContentTabSection_ywsh --- */

.ywsh-content-tabs {
  flex: 1;
  width: var(--ywsh-max-width);
  margin: 0 auto;
  padding: 0 0.5% 1.5rem;
}

.ywsh-content-tabs__bar {
  display: flex;
  flex-wrap: wrap;
  background: var(--ywsh-bg-surface);
  border: 1px solid var(--ywsh-border);
  border-bottom: none;
  border-radius: var(--ywsh-radius-md) var(--ywsh-radius-md) 0 0;
  overflow: hidden;
}

.ywsh-content-tab-item {
  display: inline-flex;
  align-items: center;
  background: var(--ywsh-tab-inactive-bg);
  border-right: 1px solid var(--ywsh-border-light);
}

.ywsh-content-tab-item--active {
  background: var(--ywsh-color-primary);
}

.ywsh-content-tab {
  padding: 0.65rem 0.85rem 0.65rem 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ywsh-tab-inactive-text);
  background: transparent;
  border: none;
  transition: background var(--ywsh-transition), color var(--ywsh-transition);
}

.ywsh-content-tab__label {
  pointer-events: none;
}

.ywsh-tab-name-editor--content {
  padding-right: 0.55rem;
}

.ywsh-content-tab__cards-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 1.7rem;
  height: 1.7rem;
  margin: 0 0.55rem 0 0;
  padding: 0;
  border: none;
  border-radius: var(--ywsh-radius-sm);
  background: transparent;
  color: inherit;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.92;
  pointer-events: none;
  transition: background var(--ywsh-transition), opacity var(--ywsh-transition), transform var(--ywsh-transition);
}

.ywsh-content-tab__cards-toggle[hidden] {
  display: none !important;
}

.ywsh-content-tab-item--active > .ywsh-content-tab__cards-toggle:not([hidden]) {
  display: inline-flex;
  pointer-events: auto;
  color: var(--ywsh-text-inverse);
}

.ywsh-content-tab__cards-toggle:hover,
.ywsh-content-tab__cards-toggle:focus-visible {
  opacity: 1;
  background: color-mix(in srgb, currentColor 16%, transparent);
  outline: none;
}

.ywsh-content-tab__cards-toggle .ywsh-icon,
.ywsh-content-panel__cards-toggle .ywsh-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
  transform: translate(-50%, -50%);
}

/* svg.ywsh-icon sets display:block, which overrides the HTML hidden attribute. */
.ywsh-content-tab__cards-toggle .ywsh-icon--expand-all,
.ywsh-content-panel__cards-toggle .ywsh-icon--expand-all,
.ywsh-content-tab__cards-toggle .ywsh-icon[hidden],
.ywsh-content-panel__cards-toggle .ywsh-icon[hidden] {
  display: none;
}

.ywsh-content-tab__cards-toggle[aria-expanded="false"] .ywsh-icon--collapse-all,
.ywsh-content-panel__cards-toggle[aria-expanded="false"] .ywsh-icon--collapse-all {
  display: none;
}

.ywsh-content-tab__cards-toggle[aria-expanded="false"] .ywsh-icon--expand-all,
.ywsh-content-panel__cards-toggle[aria-expanded="false"] .ywsh-icon--expand-all {
  display: block;
}

.ywsh-content-panel__toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: 0 0 0.75rem;
}

.ywsh-content-panel__cards-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-sm);
  background: var(--ywsh-bg-card);
  color: var(--ywsh-text-main);
  cursor: pointer;
  transition: background var(--ywsh-transition), border-color var(--ywsh-transition), color var(--ywsh-transition);
}

.ywsh-content-panel__cards-toggle:hover,
.ywsh-content-panel__cards-toggle:focus-visible {
  border-color: var(--ywsh-color-primary);
  color: var(--ywsh-color-primary);
  background: var(--ywsh-color-primary-subtle);
  outline: none;
}

.ywsh-content-tab:hover {
  color: var(--ywsh-text-main);
}

.ywsh-content-tab-item:hover:not(.ywsh-content-tab-item--active) {
  background: var(--ywsh-color-primary-subtle);
}

.ywsh-content-tab-item--active .ywsh-content-tab {
  color: var(--ywsh-text-inverse);
}

.ywsh-content-tab--active {
  color: var(--ywsh-text-inverse);
}

.ywsh-content-panel {
  display: none;
  background: var(--ywsh-bg-surface);
  border: 1px solid var(--ywsh-border);
  border-top: none;
  border-radius: 0 0 var(--ywsh-radius-md) var(--ywsh-radius-md);
  padding: 1.25rem;
  box-shadow: var(--ywsh-shadow-sm);
  min-height: 320px;
}

.ywsh-content-panel--active {
  display: block;
}

/* Category grid — CSS grid fallback; masonry applied via JS after measure */
.ywsh-category-grid {
  --ywsh-masonry-gap: 1.25rem;
  --ywsh-masonry-min-col: 260px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--ywsh-masonry-min-col), 1fr));
  gap: var(--ywsh-masonry-gap);
  align-items: start;
}

.ywsh-category-grid--masonry {
  display: block;
}

.ywsh-category-grid--masonry .ywsh-category-card {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  transform: translate(var(--ywsh-masonry-x, 0), var(--ywsh-masonry-y, 0));
  transition: transform 0.25s ease, box-shadow var(--ywsh-transition), opacity var(--ywsh-transition);
  will-change: transform;
}

.ywsh-category-grid--masonry .ywsh-category-card:hover {
  transform: translate(var(--ywsh-masonry-x, 0), var(--ywsh-masonry-y, 0)) translateY(-2px);
}

.ywsh-category-grid--masonry .ywsh-category-card.ywsh-dnd-dragging {
  opacity: 0.45;
}

.ywsh-category-grid--masonry .ywsh-category-card.ywsh-dnd-dragging:hover {
  transform: translate(var(--ywsh-masonry-x, 0), var(--ywsh-masonry-y, 0));
}

.ywsh-category-grid > .ywsh-dnd-placeholder--category-card.ywsh-dnd-placeholder--overlay {
  position: absolute;
  z-index: 6;
  margin: 0;
  box-shadow: none;
  pointer-events: none;
  transition: left 0.12s ease, top 0.12s ease, width 0.12s ease, height 0.12s ease;
}

.ywsh-category-grid--dnd-frozen .ywsh-category-card {
  transition: none !important;
}

/* --- CategoryCard_ywsh --- */

.ywsh-category-card {
  border-radius: var(--ywsh-radius-lg);
  overflow: hidden;
  box-shadow: var(--ywsh-shadow-md);
  border: 1px solid var(--ywsh-border);
  background: var(--ywsh-bg-card);
  transition: transform var(--ywsh-transition), box-shadow var(--ywsh-transition);
  /* Per-card colors via inline style custom properties */
}

.ywsh-category-card:hover {
  box-shadow: var(--ywsh-shadow-lg);
}

.ywsh-category-grid--masonry .ywsh-category-card:hover {
  box-shadow: var(--ywsh-shadow-lg);
}

/* Highlight animation when jumped to from category dropdown */
.ywsh-category-card--highlight {
  animation: ywsh-highlight-pulse 1.5s ease 2;
}

@keyframes ywsh-highlight-pulse {
  0%, 100% { box-shadow: var(--ywsh-shadow-md); }
  50% { box-shadow: 0 0 0 4px var(--ywsh-highlight), var(--ywsh-shadow-lg); }
}

.ywsh-category-card--edit-mode {
  outline: 2px dashed var(--ywsh-color-primary);
  outline-offset: 3px;
}

.ywsh-category-card-header {
  position: relative;
  background: var(--ywsh-card-header-bg, color-mix(in srgb, var(--ywsh-card-header-color) 56%, var(--ywsh-bg-raised)));
  color: var(--ywsh-card-title, var(--ywsh-card-header-text));
  padding: 0.75rem 1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--ywsh-card-stripe, var(--ywsh-card-header-color)) 28%, var(--ywsh-border));
  box-shadow: inset 4px 0 0 var(--ywsh-card-stripe, var(--ywsh-card-header-color));
  transition: background var(--ywsh-transition), color var(--ywsh-transition), box-shadow var(--ywsh-transition);
}

.ywsh-category-card-header__top {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.25rem;
  min-height: 2rem;
}

.ywsh-category-card__link-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--ywsh-card-count-bg, color-mix(in srgb, #fff 78%, var(--ywsh-card-header-color)));
  color: var(--ywsh-card-count-fg, var(--ywsh-text-main));
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  grid-column: 3;
}

.ywsh-category-card__import-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: var(--ywsh-color-primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1;
  flex-shrink: 0;
}

.ywsh-category-card--import-new .ywsh-category-card-header__top {
  grid-template-columns: 2rem minmax(0, 1fr) auto auto auto;
}

.ywsh-category-card--import-new .ywsh-category-card__import-badge {
  grid-column: 3;
}

.ywsh-category-card--import-new .ywsh-category-card__link-count {
  grid-column: 4;
}

.ywsh-category-card--import-new .ywsh-category-card-header__actions {
  grid-column: 5;
}

.ywsh-category-card-header__actions {
  grid-column: 4;
  display: flex;
  align-items: center;
  gap: 0.1rem;
  justify-self: end;
}

.ywsh-category-card__collapse-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: none;
  border-radius: var(--ywsh-radius-sm);
  background: transparent;
  color: var(--ywsh-text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: color var(--ywsh-transition), background var(--ywsh-transition), transform var(--ywsh-transition);
}

.ywsh-category-card__collapse-toggle:hover,
.ywsh-category-card__collapse-toggle:focus-visible {
  color: var(--ywsh-color-primary);
  background: var(--ywsh-color-primary-muted);
  outline: none;
}

.ywsh-category-card__collapse-toggle .ywsh-icon {
  width: 1.15rem;
  height: 1.15rem;
  transition: transform var(--ywsh-transition);
}

.ywsh-category-card--collapsed .ywsh-category-card__collapse-toggle .ywsh-icon {
  transform: rotate(-90deg);
}

.ywsh-category-card--collapsed .ywsh-category-card-body {
  display: none;
}

.ywsh-category-card--collapsed .ywsh-category-card-header {
  border-bottom: none;
}

.ywsh-category-card--edit-mode .ywsh-category-card__collapse-toggle {
  display: none;
}

.ywsh-category-card--edit-mode .ywsh-category-card-header {
  /* Neutral edit chrome, but keep the card's chosen accent so color pickers stay visible. */
  background: color-mix(in srgb, var(--ywsh-card-stripe, var(--ywsh-card-header-color)) 22%, var(--ywsh-edit-header-bg));
  color: var(--ywsh-edit-header-text);
  box-shadow: inset 4px 0 0 var(--ywsh-card-stripe, var(--ywsh-card-header-color));
  border-bottom-color: color-mix(in srgb, var(--ywsh-card-stripe, var(--ywsh-card-header-color)) 24%, var(--ywsh-border));
}

.ywsh-category-card-header__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ywsh-text-main);
  text-align: center;
  cursor: text;
  user-select: none;
  min-width: 0;
}

.ywsh-category-card-header__title-wrap {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-width: 0;
  width: 100%;
}

.ywsh-category-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.15rem;
  height: 1.15rem;
  color: var(--ywsh-card-title, var(--ywsh-text-main));
}

.ywsh-category-card__icon[hidden] {
  display: none !important;
}

.ywsh-category-card__icon-svg,
.ywsh-category-card__icon .ywsh-icon {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

.ywsh-category-card__icon-custom {
  display: inline-flex;
  width: 1.15rem;
  height: 1.15rem;
}

.ywsh-category-card__icon-custom svg {
  width: 100%;
  height: 100%;
}

.ywsh-category-card-header__title-input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0.3rem 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  text-align: center;
  border: 1px solid var(--ywsh-color-primary);
  border-radius: var(--ywsh-radius-sm);
  background: var(--ywsh-bg-card);
  color: var(--ywsh-text-main);
  box-shadow: 0 0 0 3px rgba(var(--ywsh-color-primary-rgb), 0.12);
}

.ywsh-category-card-header__title-input:focus {
  outline: none;
  border-color: var(--ywsh-color-primary-hover);
}

.ywsh-category-card-header__title[hidden],
.ywsh-category-card-header__title-input[hidden] {
  display: none;
}

.ywsh-category-card__icon-controls {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ywsh-category-card__icon-controls-label {
  font-size: 0.8rem;
}

.ywsh-category-card__icon-controls-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ywsh-category-card__icon-pick {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  max-width: 100%;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-sm);
  background: var(--ywsh-bg-surface);
  color: var(--ywsh-text-main);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
}

.ywsh-category-card__icon-pick:hover,
.ywsh-category-card__icon-pick:focus-visible {
  border-color: var(--ywsh-color-primary);
  outline: none;
}

.ywsh-category-card__icon-pick-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  color: var(--ywsh-color-primary);
}

.ywsh-category-card__icon-pick-preview .ywsh-icon,
.ywsh-category-card__icon-pick-preview svg {
  width: 1.1rem;
  height: 1.1rem;
}

.ywsh-category-card__icon-pick-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ywsh-category-card__icon-clear {
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-sm);
  background: transparent;
  color: var(--ywsh-text-muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
}

.ywsh-category-card__icon-clear[hidden] {
  display: none !important;
}

.ywsh-category-card__icon-clear:hover,
.ywsh-category-card__icon-clear:focus-visible {
  color: var(--ywsh-text-main);
  border-color: var(--ywsh-color-primary);
  outline: none;
}

.ywsh-icon-picker {
  width: min(34rem, 96vw);
  max-height: min(36rem, 90vh);
  display: flex;
  flex-direction: column;
}

.ywsh-icon-picker__toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0 1.25rem 0.75rem;
}

.ywsh-icon-picker__search {
  width: 100%;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-sm);
  background: var(--ywsh-bg-surface);
  color: var(--ywsh-text-main);
  font: inherit;
}

.ywsh-icon-picker__packs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.ywsh-icon-picker__pack {
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--ywsh-border);
  border-radius: 999px;
  background: var(--ywsh-bg-surface);
  color: var(--ywsh-text-muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
}

.ywsh-icon-picker__pack.is-active,
.ywsh-icon-picker__pack[aria-selected="true"] {
  background: var(--ywsh-color-primary-muted);
  border-color: var(--ywsh-color-primary);
  color: var(--ywsh-color-primary);
}

.ywsh-icon-picker__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr));
  gap: 0.45rem;
  padding: 0 1.25rem 1rem;
  overflow: auto;
  max-height: 22rem;
}

.ywsh-icon-picker__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.55rem 0.35rem;
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-sm);
  background: var(--ywsh-bg-surface);
  color: var(--ywsh-text-main);
  cursor: pointer;
  font: inherit;
  font-size: 0.68rem;
  line-height: 1.2;
  text-align: center;
}

.ywsh-icon-picker__item:hover,
.ywsh-icon-picker__item:focus-visible,
.ywsh-icon-picker__item.is-selected {
  border-color: var(--ywsh-color-primary);
  background: var(--ywsh-color-primary-muted);
  outline: none;
}

.ywsh-icon-picker__item-icon {
  display: inline-flex;
  width: 1.4rem;
  height: 1.4rem;
  color: var(--ywsh-color-primary);
}

.ywsh-icon-picker__item-icon svg {
  width: 100%;
  height: 100%;
}

.ywsh-icon-picker__item-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  color: var(--ywsh-text-muted);
}

.ywsh-icon-picker__empty {
  margin: 0;
  padding: 1rem 1.25rem 1.25rem;
  color: var(--ywsh-text-muted);
  text-align: center;
}

.ywsh-icon-picker__footer {
  margin-top: auto;
}

.ywsh-category-modal__icon-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ywsh-category-card__edit-toggle {
  grid-column: 1;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  color: var(--ywsh-text-muted);
  flex-shrink: 0;
}

.ywsh-category-card__edit-toggle .ywsh-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.ywsh-category-card__edit-toggle .ywsh-icon--save {
  display: none;
}

.ywsh-category-card__edit-toggle .ywsh-icon--edit {
  display: block;
}

.ywsh-category-card--edit-mode .ywsh-category-card__edit-toggle {
  color: var(--ywsh-color-primary);
}

.ywsh-category-card--edit-mode .ywsh-category-card__edit-toggle .ywsh-icon--edit {
  display: none;
}

.ywsh-category-card--edit-mode .ywsh-category-card__edit-toggle .ywsh-icon--save {
  display: block;
}

.ywsh-category-card-header .ywsh-edit-button:hover {
  background: var(--ywsh-btn-hover-overlay-muted);
}

.ywsh-category-card__edit-controls {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--ywsh-border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.8rem;
  text-align: left;
  color: var(--ywsh-text-main);
}

.ywsh-category-card__edit-controls[hidden] {
  display: none !important;
}

.ywsh-category-card__move-label,
.ywsh-category-card__color-controls label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ywsh-category-card__move-select {
  padding: 0.3rem 0.5rem;
  border-radius: var(--ywsh-radius-sm);
  border: 1px solid var(--ywsh-border);
  background: var(--ywsh-bg-surface);
  color: var(--ywsh-text-main);
}

.ywsh-category-card__color-controls {
  display: flex;
  gap: 0.75rem;
}

.ywsh-category-card__color-controls input[type="color"] {
  width: 2.5rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-sm);
  cursor: pointer;
  background: var(--ywsh-bg-surface);
}

.ywsh-category-card-body {
  background: var(--ywsh-card-body-bg, var(--ywsh-card-body-color));
  padding: 0.5rem 0;
}

/* CategoryWebLinks_ywsh */
.ywsh-category-weblinks {
  display: flex;
  flex-direction: column;
}

.ywsh-category-weblinks:empty {
  min-height: 2.75rem;
}

.ywsh-category-weblink {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--ywsh-divider-subtle);
}

.ywsh-category-weblink:last-child {
  border-bottom: none;
}

.ywsh-category-weblink--overflow-hidden[hidden] {
  display: none !important;
}

.ywsh-category-card__show-more {
  display: block;
  width: calc(100% - 1.5rem);
  margin: 0.35rem 0.75rem 0.15rem;
  padding: 0.4rem 0.65rem;
  border: 1px dashed var(--ywsh-border);
  border-radius: var(--ywsh-radius-sm);
  background: color-mix(in srgb, var(--ywsh-bg-raised) 80%, transparent);
  color: var(--ywsh-color-primary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--ywsh-transition), border-color var(--ywsh-transition);
}

.ywsh-category-card__show-more:hover,
.ywsh-category-card__show-more:focus-visible {
  border-color: var(--ywsh-color-primary);
  background: var(--ywsh-color-primary-subtle);
  outline: none;
}

.ywsh-category-card__show-more[hidden] {
  display: none !important;
}

/* Temporary search / tag results overview */
.ywsh-results-panel {
  width: 99%;
  max-width: 1100px;
  margin: 0.85rem auto 1.25rem;
  padding: 0 0.5rem;
}

.ywsh-results-panel[hidden] {
  display: none !important;
}

.ywsh-results-panel__inner {
  background: var(--ywsh-bg-card);
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-md);
  box-shadow: var(--ywsh-shadow-soft, 0 8px 24px rgba(0, 0, 0, 0.08));
  padding: 1rem 1.25rem 1.25rem;
}

.ywsh-results-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.ywsh-results-panel__header-main {
  min-width: 0;
  flex: 1;
}

.ywsh-results-panel__title {
  margin: 0;
  font-size: 1.15rem;
  color: var(--ywsh-text-main);
}

.ywsh-results-panel__close {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-sm);
  background: var(--ywsh-bg-raised);
  color: var(--ywsh-text-main);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.ywsh-results-panel__close:hover,
.ywsh-results-panel__close:focus-visible {
  border-color: var(--ywsh-color-primary);
  color: var(--ywsh-color-primary);
  outline: none;
}

.ywsh-results-panel__meta {
  margin: 0.2rem 0 0;
  color: var(--ywsh-text-muted);
  font-size: 0.88rem;
}

.ywsh-results-panel__status {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: var(--ywsh-text-main);
}

.ywsh-results-panel__toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 0.65rem 0 0.85rem;
}

.ywsh-results-panel__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

.ywsh-results-panel__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ywsh-results-panel__item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--ywsh-border-light);
  border-radius: var(--ywsh-radius-sm);
  background: var(--ywsh-bg-surface);
}

.ywsh-results-panel__row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.ywsh-results-panel__select {
  display: inline-flex;
  align-items: center;
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.ywsh-results-panel__body {
  min-width: 0;
  flex: 1;
}

.ywsh-results-panel__item-top {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.ywsh-results-panel__type {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ywsh-color-primary);
  cursor: pointer;
}

.ywsh-results-panel__type:hover:not(:disabled),
.ywsh-results-panel__type:focus-visible:not(:disabled) {
  text-decoration: underline;
  outline: none;
}

.ywsh-results-panel__type--static,
.ywsh-results-panel__type:disabled {
  cursor: default;
  opacity: 0.9;
}

.ywsh-results-panel__name {
  font-weight: 600;
  color: var(--ywsh-color-primary);
  text-decoration: none;
}

.ywsh-results-panel__name:hover {
  text-decoration: underline;
}

.ywsh-results-panel__url {
  font-size: 0.82rem;
  color: var(--ywsh-text-muted);
  word-break: break-all;
}

.ywsh-results-panel__desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ywsh-text-main);
}

.ywsh-results-panel__tags {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ywsh-text-muted);
}

body.ywsh-results-open .ywsh-content-tabs {
  display: none;
}

.ywsh-category-weblink__anchor {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ywsh-card-link, var(--ywsh-text-main));
  transition: color var(--ywsh-transition);
}

.ywsh-category-weblink__anchor:hover {
  color: var(--ywsh-card-accent, var(--ywsh-color-primary));
}

.ywsh-category-weblink--dead {
  background: var(--ywsh-link-dead-muted);
}

.ywsh-category-weblink__health {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--ywsh-link-dead);
}

.ywsh-category-weblink__health .ywsh-icon {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.ywsh-category-weblink__anchor--dead,
.ywsh-category-weblink__anchor--dead:hover {
  color: var(--ywsh-link-dead);
}

.ywsh-top-tab-link--dead .ywsh-top-tab-link__anchor--dead,
.ywsh-top-tab-link--dead a.ywsh-top-tab-link__anchor--dead {
  color: var(--ywsh-link-dead);
}

.ywsh-top-tab-link__health {
  display: inline-flex;
  align-items: center;
  color: var(--ywsh-link-dead);
  margin-right: 0.2rem;
}

.ywsh-top-tab-link__health .ywsh-icon {
  width: 0.9rem;
  height: 0.9rem;
  fill: currentColor;
}

.ywsh-category-card--edit-mode .ywsh-category-weblink__edit {
  display: inline-flex !important;
}

/* Tooltip on hover */
.ywsh-category-weblink__tooltip {
  position: absolute;
  left: 1rem;
  bottom: calc(100% + 6px);
  min-width: 180px;
  max-width: 260px;
  padding: 0.5rem 0.75rem;
  background: var(--ywsh-tooltip-bg);
  color: var(--ywsh-tooltip-text);
  border-radius: var(--ywsh-radius-sm);
  font-size: 0.8rem;
  line-height: 1.4;
  box-shadow: var(--ywsh-shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity var(--ywsh-transition), transform var(--ywsh-transition), visibility var(--ywsh-transition);
  z-index: 50;
  pointer-events: none;
}

.ywsh-category-weblink:hover .ywsh-category-weblink__tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.ywsh-category-weblink__tooltip-desc {
  margin: 0 0 0.35rem;
}

.ywsh-category-weblink__tooltip-tags {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.ywsh-tag {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  background: var(--ywsh-tag-bg);
  border-radius: 999px;
  font-size: 0.7rem;
}

.ywsh-tag--button {
  border: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.ywsh-tag--button:hover {
  box-shadow: 0 0 0 1px var(--ywsh-color-primary);
}

.ywsh-link-select {
  display: none;
  align-items: center;
  margin: 0;
}

.ywsh-link-select__input {
  width: auto;
  margin: 0;
}

body.ywsh-batch-mode-active .ywsh-link-select {
  display: inline-flex;
}

body.ywsh-batch-mode-active .ywsh-category-weblink.is-tag-filtered-out,
body.ywsh-batch-mode-active .ywsh-top-tab-link.is-tag-filtered-out,
body.ywsh-batch-mode-active .ywsh-category-weblink.is-search-filtered-out {
  display: none;
}

/* Keep top-tab weblinks visible during search results. */
body.ywsh-batch-mode-active .ywsh-top-tab-link.is-search-filtered-out {
  display: list-item;
}

/* Legacy alias while batch mode supersedes tag-only filtering */
body.ywsh-tag-filter-active .ywsh-link-select {
  display: inline-flex;
}

body.ywsh-tag-filter-active .ywsh-category-weblink.is-tag-filtered-out,
body.ywsh-tag-filter-active .ywsh-top-tab-link.is-tag-filtered-out {
  display: none;
}

.ywsh-batch-bar {
  width: var(--ywsh-max-width);
  margin: 0 auto 0.75rem;
  padding: 0 0.5%;
}

.ywsh-batch-bar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-md);
  background: var(--ywsh-bg-card);
  box-shadow: var(--ywsh-shadow-sm);
}

.ywsh-batch-bar__status {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ywsh-text-main);
}

.ywsh-batch-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.ywsh-batch-bar__move {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.ywsh-batch-bar__move-label {
  font-size: 0.85rem;
  color: var(--ywsh-text-muted);
  white-space: nowrap;
}

.ywsh-batch-bar__category-select {
  min-width: 10rem;
  max-width: 14rem;
  min-height: 2rem;
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-sm);
  background: var(--ywsh-bg-surface);
  color: var(--ywsh-text-main);
  padding: 0.35rem 0.6rem;
}

.ywsh-tag-filter__select option.ywsh-tag-filter__option--deadlink,
.ywsh-tag-filter__select option[value="deadlink"] {
  color: var(--ywsh-link-dead);
  font-weight: 600;
}

.ywsh-tag-filter {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 0 1 200px;
  min-width: 10rem;
}

.ywsh-tag-filter__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ywsh-tag-filter__select {
  width: 100%;
  min-height: 2.1rem;
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-sm);
  background: var(--ywsh-bg-surface);
  color: var(--ywsh-text-main);
  padding: 0.5rem 0.85rem;
  cursor: pointer;
}

.ywsh-tag-filter__select:focus {
  outline: none;
  border-color: var(--ywsh-color-primary);
  box-shadow: 0 0 0 3px rgba(var(--ywsh-color-primary-rgb), 0.15);
}

.ywsh-import-progress {
  margin-top: 0.75rem;
}

.ywsh-import-progress__track {
  height: 0.55rem;
  border-radius: 999px;
  background: var(--ywsh-bg-muted);
  overflow: hidden;
}

.ywsh-import-progress__bar {
  height: 100%;
  width: 0%;
  background: var(--ywsh-color-primary);
  transition: width 0.2s ease;
}

.ywsh-import-progress__label {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--ywsh-text-muted);
}

.ywsh-import-tree {
  margin-top: 0.75rem;
  max-height: 280px;
  overflow: auto;
  padding: 0.75rem;
  border: 1px solid var(--ywsh-border-light);
  border-radius: var(--ywsh-radius-md);
  background: var(--ywsh-bg-main);
  font-size: 0.85rem;
}

.ywsh-import-tree__tab,
.ywsh-import-tree__card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.35rem 0;
}

.ywsh-import-tree__tab {
  border-top: 1px solid var(--ywsh-border-light);
  margin-top: 0.35rem;
  padding-top: 0.55rem;
  font-weight: 600;
}

.ywsh-import-tree__card {
  padding-left: 0.85rem;
  font-weight: 400;
  color: var(--ywsh-text-muted);
}

.ywsh-import-tree__role {
  min-width: 8.5rem;
}

/* --- Footer_ywsh --- */

.ywsh-footer {
  width: var(--ywsh-max-width);
  margin: 0 auto;
  padding: 0 0.5% 1.5rem;
}

.ywsh-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--ywsh-bg-card);
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-md);
  font-size: 0.875rem;
  color: var(--ywsh-text-muted);
}

.ywsh-footer__brand {
  margin: 0;
  color: var(--ywsh-text-main);
}

.ywsh-footer__abbr {
  color: var(--ywsh-text-muted);
  font-weight: normal;
}

.ywsh-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.ywsh-footer__link {
  color: var(--ywsh-text-link);
  transition: color var(--ywsh-transition);
}

.ywsh-footer__link:hover {
  color: var(--ywsh-color-primary-hover);
  text-decoration: underline;
}

.ywsh-footer__copy {
  margin: 0;
  width: 100%;
  text-align: center;
  font-size: 0.8rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--ywsh-border-light);
}

/* --- Modal --- */

.ywsh-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--ywsh-modal-overlay);
  display: flex;
  align-items: safe center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
  overflow: auto;
}

.ywsh-modal-overlay[hidden] {
  display: none;
}

.ywsh-modal {
  width: 100%;
  max-width: 480px;
  background: var(--ywsh-bg-surface);
  border-radius: var(--ywsh-radius-lg);
  box-shadow: var(--ywsh-shadow-lg);
  overflow: hidden;
  flex-shrink: 0;
}

.ywsh-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--ywsh-border-light);
  flex-shrink: 0;
}

.ywsh-modal__title {
  margin: 0;
  font-size: 1.15rem;
}

.ywsh-modal__close {
  display: flex;
  padding: 0.25rem;
  border-radius: var(--ywsh-radius-sm);
  color: var(--ywsh-text-muted);
}

.ywsh-modal__close:hover {
  background: var(--ywsh-bg-muted);
  color: var(--ywsh-text-main);
}

.ywsh-modal__form {
  padding: 1.25rem;
}

.ywsh-modal__field {
  margin-bottom: 1rem;
}

.ywsh-modal__field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ywsh-text-main);
}

.ywsh-modal__field input,
.ywsh-modal__field textarea,
.ywsh-modal__field select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-sm);
  background: var(--ywsh-bg-main);
}

.ywsh-modal__field input:focus,
.ywsh-modal__field textarea:focus,
.ywsh-modal__field select:focus {
  outline: none;
  border-color: var(--ywsh-color-primary);
  box-shadow: 0 0 0 3px rgba(var(--ywsh-color-primary-rgb), 0.15);
}

.ywsh-modal__field-actions {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.ywsh-modal__btn--inline {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.ywsh-modal__field-status {
  font-size: 0.8rem;
  color: var(--ywsh-text-muted);
}

.ywsh-tag-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-sm);
  background: var(--ywsh-bg-main);
  min-height: 2.5rem;
  cursor: text;
  transition: border-color var(--ywsh-transition), box-shadow var(--ywsh-transition);
}

.ywsh-tag-input:focus-within {
  border-color: var(--ywsh-color-primary);
  box-shadow: 0 0 0 3px rgba(var(--ywsh-color-primary-rgb), 0.15);
}

.ywsh-tag-input__chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.ywsh-tag-input__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.18rem 0.5rem;
  border: 1px solid color-mix(in srgb, var(--ywsh-color-primary) 45%, var(--ywsh-border));
  border-radius: 999px;
  background: var(--ywsh-color-primary-subtle);
  color: var(--ywsh-text-main);
  font-size: 0.8rem;
  line-height: 1.2;
}

.ywsh-tag-input__chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  color: inherit;
  opacity: 0.7;
  font-size: 0.9rem;
  line-height: 1;
  transition: opacity var(--ywsh-transition), background var(--ywsh-transition);
}

.ywsh-tag-input__chip-remove:hover {
  opacity: 1;
  background: var(--ywsh-btn-hover-overlay-muted);
}

.ywsh-tag-input input[type="text"] {
  flex: 1 1 8rem;
  min-width: 7rem;
  border: none;
  background: transparent;
  padding: 0.2rem 0.3rem;
  box-shadow: none;
}

.ywsh-tag-input input[type="text"]:focus {
  outline: none;
  border: none;
  box-shadow: none;
}

/* Combobox — used in Edit Bookmark modal category picker */
.ywsh-combobox {
  position: relative;
}

.ywsh-combobox--vibrate .ywsh-combobox__control {
  animation: ywsh-combobox-vibrate 260ms ease-in-out;
}

.ywsh-combobox__control {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-sm);
  background: var(--ywsh-bg-surface);
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--ywsh-transition), box-shadow var(--ywsh-transition);
}

.ywsh-combobox--open .ywsh-combobox__control,
.ywsh-combobox__control:focus-within {
  border-color: var(--ywsh-color-primary);
  box-shadow: 0 0 0 3px rgba(var(--ywsh-color-primary-rgb), 0.15);
}

.ywsh-combobox__input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--ywsh-text-main);
  cursor: pointer;
}

.ywsh-combobox__input::placeholder {
  color: var(--ywsh-text-muted);
}

.ywsh-combobox--open .ywsh-combobox__input,
.ywsh-combobox__input:focus {
  cursor: text;
  outline: none;
}

.ywsh-combobox__input[readonly] {
  caret-color: transparent;
}

.ywsh-combobox--open .ywsh-combobox__input[readonly],
.ywsh-combobox__input[readonly]:focus {
  caret-color: auto;
}

.ywsh-combobox__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  flex-shrink: 0;
  border: none;
  border-left: 1px solid var(--ywsh-border-light);
  background: var(--ywsh-bg-raised);
  color: var(--ywsh-text-muted);
  cursor: pointer;
  transition: background var(--ywsh-transition), color var(--ywsh-transition);
}

.ywsh-combobox__toggle:hover {
  background: var(--ywsh-bg-muted);
  color: var(--ywsh-text-main);
}

.ywsh-combobox__chevron {
  width: 1.35rem;
  height: 1.35rem;
  fill: currentColor;
  transition: transform var(--ywsh-transition);
}

.ywsh-combobox--open .ywsh-combobox__chevron {
  transform: rotate(180deg);
}

.ywsh-combobox__list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--ywsh-bg-card);
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-sm);
  box-shadow: var(--ywsh-shadow-md);
  max-height: 200px;
  overflow-y: auto;
  z-index: 10;
}

.ywsh-combobox__option {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  cursor: pointer;
  border-bottom: 1px solid var(--ywsh-border-light);
}

.ywsh-combobox__option:last-child {
  border-bottom: none;
}

.ywsh-combobox__option:hover,
.ywsh-combobox__option--active {
  background: var(--ywsh-color-primary-muted);
}

.ywsh-combobox__option--selected {
  font-weight: 600;
  color: var(--ywsh-color-primary);
}

@keyframes ywsh-combobox-vibrate {
  0% { transform: translateX(0); }
  15% { transform: translateX(-2px); }
  30% { transform: translateX(2px); }
  45% { transform: translateX(-2px); }
  60% { transform: translateX(2px); }
  75% { transform: translateX(-1px); }
  90% { transform: translateX(1px); }
  100% { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .ywsh-combobox--vibrate .ywsh-combobox__control {
    animation: none;
  }
}

.ywsh-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 0.5rem;
}

.ywsh-modal__btn {
  padding: 0.5rem 1.25rem;
  border-radius: var(--ywsh-radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
  transition: background var(--ywsh-transition), color var(--ywsh-transition), border-color var(--ywsh-transition);
}

.ywsh-modal__btn--cancel {
  background: var(--ywsh-bg-muted);
  color: var(--ywsh-text-main);
  border-color: var(--ywsh-border);
}

.ywsh-modal__btn--cancel:hover {
  background: var(--ywsh-border-light);
}

.ywsh-modal__btn--save {
  background: var(--ywsh-color-primary);
  color: var(--ywsh-text-inverse);
}

.ywsh-modal__btn--save:hover {
  background: var(--ywsh-color-primary-hover);
}

.ywsh-modal__btn--primary {
  background: var(--ywsh-color-primary);
  color: var(--ywsh-text-inverse);
  border-color: color-mix(in srgb, var(--ywsh-color-primary) 55%, var(--ywsh-tone-ink));
}

.ywsh-modal__btn--primary:hover {
  background: var(--ywsh-color-primary-hover);
  border-color: color-mix(in srgb, var(--ywsh-color-primary-hover) 55%, var(--ywsh-tone-ink));
}

.ywsh-modal__btn--danger {
  margin-right: auto;
  background: rgba(192, 88, 88, 0.12);
  color: #8f2f2f;
  border: 1px solid rgba(192, 88, 88, 0.35);
}

.ywsh-modal__btn--danger:hover {
  background: rgba(192, 88, 88, 0.22);
}

/* Add Category / Tab modal */
.ywsh-category-modal__tabs {
  display: flex;
  gap: 0.35rem;
  margin: 0 1.25rem 0.85rem;
  padding: 0.25rem;
  border-radius: var(--ywsh-radius-sm);
  background: var(--ywsh-bg-raised);
  border: 1px solid var(--ywsh-border-light);
}

.ywsh-category-modal__tab {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: calc(var(--ywsh-radius-sm) - 2px);
  background: transparent;
  color: var(--ywsh-text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background var(--ywsh-transition), color var(--ywsh-transition);
}

.ywsh-category-modal__tab:hover {
  color: var(--ywsh-text-main);
  background: color-mix(in srgb, var(--ywsh-color-primary) 8%, transparent);
}

.ywsh-category-modal__tab--active {
  background: var(--ywsh-bg-card);
  color: var(--ywsh-color-primary);
  box-shadow: var(--ywsh-shadow-sm);
}

.ywsh-category-modal__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.ywsh-category-modal__colors-label,
.ywsh-tab-modal__type-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--ywsh-text-muted);
}

.ywsh-tab-modal__type {
  border: none;
  margin: 0;
  padding: 0;
}

.ywsh-tab-modal__type-option {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.35rem 0;
  font-size: 0.92rem;
  cursor: pointer;
}

.ywsh-modal__field-hint {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  color: var(--ywsh-text-muted);
  line-height: 1.35;
}

.ywsh-modal__field-count {
  margin-left: 0.35rem;
  font-variant-numeric: tabular-nums;
}

.ywsh-category-modal__color-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.ywsh-category-modal__color-controls label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
}

.ywsh-category-modal__preview-label {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ywsh-text-muted);
}

.ywsh-category-card--preview {
  pointer-events: none;
  box-shadow: var(--ywsh-shadow-sm);
}

.ywsh-category-modal__empty-hint {
  padding: 0.75rem 0.5rem;
  color: var(--ywsh-text-muted);
  font-size: 0.85rem;
  font-style: italic;
  list-style: none;
}

@media (max-width: 720px) {
  .ywsh-category-modal__layout {
    grid-template-columns: 1fr;
  }
}

/* Settings modal */
.ywsh-settings-modal {
  max-width: 760px;
  width: min(820px, calc(100vw - 2rem));
  max-height: min(90vh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ywsh-settings-modal__body {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.ywsh-settings-modal__sections {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem;
  border-right: 1px solid var(--ywsh-border-light);
  background: var(--ywsh-bg-raised);
  overflow-y: auto;
  min-height: 0;
}

.ywsh-settings-modal__section-btn {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-radius: var(--ywsh-radius-sm);
  color: var(--ywsh-text-muted);
  font-weight: 600;
  transition: background var(--ywsh-transition), color var(--ywsh-transition);
}

.ywsh-settings-modal__section-btn:hover {
  background: var(--ywsh-color-primary-muted);
  color: var(--ywsh-text-main);
}

.ywsh-settings-modal__section-btn--active {
  background: var(--ywsh-color-primary-muted);
  color: var(--ywsh-color-primary);
}

.ywsh-settings-modal__section {
  padding: 1rem 1.25rem;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.ywsh-settings-modal__section h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.ywsh-settings-modal__section p {
  margin: 0.1rem 0 0.85rem;
  color: var(--ywsh-text-muted);
  font-size: 0.9rem;
}

.ywsh-settings-modal__field {
  max-width: 300px;
  margin-bottom: 0.9rem;
}

.ywsh-settings-modal__field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ywsh-text-main);
}

.ywsh-settings-modal__field select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-sm);
  background: var(--ywsh-bg-main);
  color: var(--ywsh-text-main);
}

.ywsh-settings-modal__field select:focus {
  outline: none;
  border-color: var(--ywsh-color-primary);
  box-shadow: 0 0 0 3px rgba(var(--ywsh-color-primary-rgb), 0.15);
}

.ywsh-settings-modal__export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.ywsh-settings-modal__export-actions a.ywsh-modal__btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
}

.ywsh-settings-modal__field--checkbox label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
}

.ywsh-settings-modal__field--checkbox input {
  width: auto;
}

.ywsh-settings-modal__status {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: var(--ywsh-text-muted);
  min-height: 1.25rem;
}

.ywsh-settings-modal__preview {
  margin: 0.75rem 0 0;
  max-height: 220px;
  overflow: auto;
  padding: 0.75rem;
  border-radius: var(--ywsh-radius-md);
  border: 1px solid var(--ywsh-border-light);
  background: var(--ywsh-bg-main);
  font-size: 0.78rem;
  white-space: pre-wrap;
}

.ywsh-settings-modal__divider {
  margin: 1.25rem 0;
  border: 0;
  border-top: 1px solid var(--ywsh-border-light);
}

.ywsh-snippets-modal {
  max-width: 920px;
  width: min(920px, calc(100vw - 2rem));
  max-height: min(90vh, 840px);
  display: flex;
  flex-direction: column;
}

.ywsh-snippets-modal__body {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  align-items: start;
  overflow: auto;
  min-height: 0;
  flex: 1 1 auto;
}

.ywsh-snippets-editor {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}

.ywsh-snippets-form__checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.ywsh-snippets-form__checkbox input[type="checkbox"] {
  width: auto;
}

.ywsh-snippets-wrap-fields {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.75rem;
  border: 1px dashed var(--ywsh-border);
  border-radius: var(--ywsh-radius-md);
  background: var(--ywsh-bg-raised);
}

/* display:flex above would otherwise override the HTML hidden attribute */
.ywsh-snippets-wrap-fields[hidden] {
  display: none;
}

.ywsh-snippets-wrap-fields__templates {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.ywsh-snippets-wrap-fields__templates-label {
  font-size: 0.85rem;
  color: var(--ywsh-text-muted);
  margin-right: 0.15rem;
}

.ywsh-snippets-wrap-fields__middle {
  margin: 0;
  padding: 0.55rem 0.75rem;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ywsh-text-muted);
  background: var(--ywsh-bg-card);
  border: 1px solid var(--ywsh-border-light);
  border-radius: var(--ywsh-radius-sm);
}

.ywsh-snippets-wrap-fields__preview-label {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: var(--ywsh-text-muted);
}

.ywsh-snippets-wrap-fields__preview {
  margin: 0;
  padding: 0.55rem 0.7rem;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--ywsh-bg-card);
  border: 1px solid var(--ywsh-border-light);
  border-radius: var(--ywsh-radius-sm);
  color: var(--ywsh-text-main);
  min-height: 2.2rem;
}

.ywsh-snippets-list__badge--wrap {
  background: color-mix(in srgb, var(--ywsh-color-primary) 18%, transparent);
  color: var(--ywsh-color-primary);
}

.ywsh-snippets-list {
  border: 1px solid var(--ywsh-border-light);
  border-radius: var(--ywsh-radius-md);
  background: var(--ywsh-bg-main);
  padding: 0.85rem;
  min-width: 0;
  min-height: 0;
  max-height: min(68vh, 620px);
  display: flex;
  flex-direction: column;
}

.ywsh-snippets-list__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
}

.ywsh-snippets-list__header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: flex-end;
}

.ywsh-snippets-list__title {
  margin: 0;
  font-size: 0.95rem;
}

.ywsh-snippets-list__stack {
  position: relative;
  flex: 1 1 auto;
  min-height: 12rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ywsh-snippets-list__view {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: hidden;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.ywsh-snippets-list--managing .ywsh-snippets-list__view {
  opacity: 0;
  transform: translateY(0.5rem);
  pointer-events: none;
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.ywsh-snippets-list__status {
  margin: 0 0 0.7rem;
  min-height: 1.1rem;
  font-size: 0.82rem;
  color: var(--ywsh-text-muted);
}

.ywsh-snippets-list__status--error {
  color: #b42318;
}

.ywsh-snippets-list__items {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.6rem;
  flex: 1 1 auto;
  min-height: 8rem;
  overflow: auto;
}

.ywsh-snippets-list__empty {
  margin: 0;
  color: var(--ywsh-text-muted);
  font-size: 0.86rem;
}

.ywsh-snippets-list__item {
  border: 1px solid var(--ywsh-border-light);
  border-radius: var(--ywsh-radius-sm);
  background: var(--ywsh-bg-surface);
  padding: 0.6rem;
  display: grid;
  gap: 0.5rem;
}

.ywsh-snippets-list__item-title {
  margin: 0;
  font-weight: 700;
  color: var(--ywsh-text-main);
}

.ywsh-snippets-list__item-shortcut {
  margin: 0.15rem 0 0;
  display: inline-block;
  width: fit-content;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--ywsh-border);
  background: var(--ywsh-color-primary-subtle);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.8rem;
}

.ywsh-snippets-list__item-content {
  margin: 0.35rem 0 0;
  color: var(--ywsh-text-muted);
  font-size: 0.82rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ywsh-snippets-list__item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.ywsh-snippets-list__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 600;
}

.ywsh-snippets-list__badge--enabled {
  background: rgba(16, 185, 129, 0.16);
  color: #0f7a5a;
}

.ywsh-snippets-list__badge--disabled {
  background: rgba(245, 158, 11, 0.15);
  color: #915a03;
}

.ywsh-snippets-categories {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0;
  padding: 0.15rem 0.1rem 0.25rem;
  border: 0;
  border-radius: 0;
  background: var(--ywsh-bg-main);
  opacity: 0;
  transform: translateY(0.75rem);
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
  overflow: auto;
}

.ywsh-snippets-list--managing .ywsh-snippets-categories {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
}

.ywsh-snippets-categories > .ywsh-modal__field-hint {
  margin: 0 0 0.35rem;
}

.ywsh-snippets-categories__body {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 0;
}

.ywsh-snippets-categories__add {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.ywsh-snippets-categories__add input {
  flex: 1 1 auto;
}

.ywsh-snippets-categories__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.ywsh-snippets-categories__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--ywsh-border-light);
}

.ywsh-snippets-categories__item:last-child {
  border-bottom: 0;
}

.ywsh-snippets-categories__item-name {
  margin: 0;
  font-size: 0.95rem;
}

.ywsh-snippets-categories__item-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.ywsh-snippets-categories__empty {
  margin: 0;
  color: var(--ywsh-text-muted);
  font-size: 0.9rem;
}

.ywsh-snippets-list__toolbar {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) minmax(12rem, 1.4fr);
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.ywsh-snippets-list__filter select,
.ywsh-snippets-form select,
.ywsh-snippets-list__search input {
  width: 100%;
}

.ywsh-snippets-list__item-category {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--ywsh-text-muted);
}

@media (max-width: 720px) {
  .ywsh-settings-modal {
    max-height: min(92vh, 900px);
    width: calc(100vw - 1rem);
  }

  .ywsh-settings-modal__body {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .ywsh-settings-modal__sections {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--ywsh-border-light);
    padding: 0.65rem 0.75rem;
    gap: 0.35rem;
    -webkit-overflow-scrolling: touch;
  }

  .ywsh-settings-modal__section-btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .ywsh-settings-modal__section {
    padding: 0.85rem 1rem 1.1rem;
  }

  .ywsh-snippets-modal__body {
    grid-template-columns: 1fr;
  }

  .ywsh-snippets-list {
    max-height: none;
  }

  .ywsh-snippets-list__toolbar {
    grid-template-columns: 1fr;
  }
}

/* --- Drag-and-drop (Stage 3) --- */

.ywsh-drag-handle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border: none;
  border-radius: var(--ywsh-radius-sm);
  background: transparent;
  color: var(--ywsh-text-muted);
  cursor: grab;
  opacity: 0.45;
  transition: opacity var(--ywsh-transition), color var(--ywsh-transition), background var(--ywsh-transition);
}

.ywsh-drag-handle:hover,
.ywsh-drag-handle:focus-visible {
  opacity: 1;
  color: var(--ywsh-color-primary);
  background: var(--ywsh-color-primary-muted);
  outline: none;
}

.ywsh-drag-handle:active {
  cursor: grabbing;
}

.ywsh-drag-handle__icon {
  width: 0.75rem;
  height: 0.75rem;
  fill: currentColor;
}

.ywsh-top-tab__button .ywsh-drag-handle,
.ywsh-content-tab-item .ywsh-drag-handle {
  width: 1rem;
  height: 1rem;
  margin-right: 0.35rem;
  margin-left: 0.35rem;
  vertical-align: middle;
}

.ywsh-category-card-header__top .ywsh-drag-handle {
  margin: 0;
}

.ywsh-category-card--edit-mode .ywsh-drag-handle {
  display: none;
}

/* --- App-wide edit mode (MenuBar toggle) --- */

body.ywsh-app:not(.ywsh-app--edit-mode) .ywsh-category-card__edit-toggle,
body.ywsh-app:not(.ywsh-app--edit-mode) .ywsh-category-weblink__edit,
body.ywsh-app:not(.ywsh-app--edit-mode) .ywsh-top-tab-link__edit {
  display: none !important;
}

body.ywsh-app:not(.ywsh-app--edit-mode) .ywsh-tab-name-editor {
  display: none !important;
}

body.ywsh-app:not(.ywsh-app--edit-mode) .ywsh-category-card__move-label,
body.ywsh-app:not(.ywsh-app--edit-mode) .ywsh-category-card__color-controls {
  display: none !important;
}

.ywsh-category-card:not(.ywsh-category-card--edit-mode) .ywsh-category-card__edit-controls {
  display: none !important;
}

body.ywsh-app:not(.ywsh-app--edit-mode) .ywsh-category-card-header__top {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

/* title-wrap is the grid item (not the h2); keep it in column 1 outside edit mode */
body.ywsh-app:not(.ywsh-app--edit-mode) .ywsh-category-card-header__title-wrap {
  grid-column: 1;
}

body.ywsh-app:not(.ywsh-app--edit-mode) .ywsh-category-card-header__title,
body.ywsh-app:not(.ywsh-app--edit-mode) .ywsh-category-card-header__title-input {
  cursor: default;
}

body.ywsh-app:not(.ywsh-app--edit-mode) .ywsh-category-card__link-count {
  grid-column: 2;
}

body.ywsh-app:not(.ywsh-app--edit-mode) .ywsh-category-card-header__actions {
  grid-column: 3;
}

body.ywsh-app:not(.ywsh-app--edit-mode) .ywsh-category-card--import-new .ywsh-category-card-header__top {
  grid-template-columns: minmax(0, 1fr) auto auto auto;
}

body.ywsh-app:not(.ywsh-app--edit-mode) .ywsh-category-card--import-new .ywsh-category-card__import-badge {
  grid-column: 2;
}

body.ywsh-app:not(.ywsh-app--edit-mode) .ywsh-category-card--import-new .ywsh-category-card__link-count {
  grid-column: 3;
}

body.ywsh-app:not(.ywsh-app--edit-mode) .ywsh-category-card--import-new .ywsh-category-card-header__actions {
  grid-column: 4;
}

.ywsh-category-card__link-count[hidden] {
  display: none !important;
}

.ywsh-category-weblink .ywsh-drag-handle {
  margin-right: 0.15rem;
}

.ywsh-dnd-dragging {
  opacity: 0.55;
}

.ywsh-dnd-drop-zone--active {
  outline: 2px dashed var(--ywsh-color-primary);
  outline-offset: 4px;
  border-radius: var(--ywsh-radius-sm);
}

.ywsh-dnd-placeholder {
  box-sizing: border-box;
  border: var(--ywsh-drop-preview-border);
  background: var(--ywsh-drop-preview-bg);
  border-radius: var(--ywsh-radius-lg);
  pointer-events: none;
}

.ywsh-dnd-placeholder--category-card {
  min-height: 120px;
  width: 100%;
}

.ywsh-dnd-placeholder--overlay {
  box-sizing: border-box;
  border: 2px dashed var(--ywsh-color-primary);
  background: color-mix(in srgb, var(--ywsh-color-primary) 18%, transparent);
  border-radius: var(--ywsh-radius-lg);
  pointer-events: none;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ywsh-color-primary) 35%, transparent);
}

.ywsh-dnd-placeholder--top-tab-link,
.ywsh-dnd-placeholder--category-weblink {
  min-height: 2.25rem;
  border-radius: var(--ywsh-radius-md);
}

.ywsh-dnd-placeholder--top-tab-button,
.ywsh-dnd-placeholder--content-tab {
  min-height: 2.5rem;
  min-width: 4rem;
  border-radius: var(--ywsh-radius-sm);
}

.ywsh-drop-target--active {
  background: var(--ywsh-drop-preview-bg);
}

/* --- Responsive --- */

@media (max-width: 900px) {
  .ywsh-category-grid {
    --ywsh-masonry-min-col: 220px;
  }
}

@media (max-width: 768px) {
  .ywsh-top-tabs {
    margin-top: 0.5rem;
  }

  .ywsh-top-tabs__button-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .ywsh-top-tab__button {
    flex: 0 0 auto;
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
  }

  .ywsh-top-tab__panel {
    padding: 0.55rem 0.75rem;
  }

  .ywsh-menubar {
    padding: 0.5rem 0.5%;
  }

  .ywsh-menubar__inner {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.5rem 0.65rem;
    padding: 0.55rem 0.75rem;
  }

  .ywsh-menubar__start {
    order: 0;
    grid-column: 1;
    align-self: center;
  }

  .ywsh-menubar__actions {
    order: 0;
    grid-column: 2;
    justify-content: flex-end;
    gap: 0.25rem;
  }

  .ywsh-menubar__center {
    order: 1;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    gap: 0.5rem;
  }

  .ywsh-search {
    grid-column: 1 / -1;
    min-width: 0;
    max-width: none;
    flex: none;
  }

  .ywsh-category-filter,
  .ywsh-tag-filter {
    min-width: 0;
    flex: none;
  }

  .ywsh-menubar__icon-btn {
    width: 2.75rem;
    height: 2.75rem;
  }

  .ywsh-menubar__snippets-btn {
    min-width: 2.75rem;
    padding: 0 0.55rem;
  }

  .ywsh-user-menu__trigger {
    min-height: 2.75rem;
  }

  .ywsh-drag-handle {
    width: 1.75rem;
    height: 1.75rem;
  }

  .ywsh-drag-handle__icon {
    width: 0.9rem;
    height: 0.9rem;
  }

  .ywsh-content-tabs {
    padding: 0 0.5% 1rem;
  }

  .ywsh-content-tabs__bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .ywsh-content-tab-item {
    flex: 0 0 auto;
  }

  .ywsh-content-panel {
    min-height: 0;
    padding: 0.85rem;
    overflow-x: hidden;
  }

  .ywsh-category-grid {
    --ywsh-masonry-min-col: 100%;
    --ywsh-masonry-gap: 0.85rem;
    grid-template-columns: 1fr;
    width: 100%;
    min-width: 0;
  }

  .ywsh-category-grid--masonry .ywsh-category-card {
    width: 100% !important;
    left: 0;
  }

  .ywsh-footer {
    padding-bottom: 1rem;
  }

  .ywsh-footer__inner {
    flex-direction: column;
    text-align: center;
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }

  .ywsh-footer__links {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .ywsh-top-tab-links {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
  }

  .ywsh-top-tab-link {
    max-width: 100%;
  }

  .ywsh-menubar__center {
    grid-template-columns: 1fr;
  }

  .ywsh-menubar__actions {
    gap: 0.15rem;
  }

  .ywsh-user-menu__name {
    display: none;
  }
}

/* --- Authentication pages --- */

body.ywsh-auth {
  min-height: 100vh;
  background: var(--ywsh-bg-main);
}

.ywsh-auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(320px, 0.9fr);
}

.ywsh-auth-hero {
  position: relative;
  overflow: hidden;
  padding: 3rem clamp(1.5rem, 4vw, 4rem);
  background:
    radial-gradient(circle at 20% 20%, rgba(var(--ywsh-color-primary-rgb), 0.28), transparent 45%),
    linear-gradient(145deg, var(--ywsh-bg-raised), var(--ywsh-bg-main));
  border-right: 1px solid var(--ywsh-border-light);
}

.ywsh-auth-hero__glow {
  position: absolute;
  inset: auto -20% -30% auto;
  width: 70%;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(var(--ywsh-color-primary-rgb), 0.22), transparent 70%);
  pointer-events: none;
}

.ywsh-auth-hero__grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding: 2rem;
  opacity: 0.35;
  pointer-events: none;
}

.ywsh-auth-hero__cell {
  border-radius: var(--ywsh-radius-md);
  border: 1px solid rgba(var(--ywsh-color-primary-rgb), 0.18);
  background: rgba(var(--ywsh-color-primary-rgb), 0.06);
  animation: ywsh-auth-float 6s ease-in-out infinite;
  animation-delay: var(--ywsh-auth-delay, 0s);
}

@keyframes ywsh-auth-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.ywsh-auth-hero__content {
  position: relative;
  z-index: 1;
  max-width: 34rem;
  margin-top: 15vh;
}

.ywsh-auth-hero__eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ywsh-color-primary);
  font-weight: 700;
}

.ywsh-auth-hero__title {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.08;
  color: var(--ywsh-text-main);
}

.ywsh-auth-hero__text {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--ywsh-text-muted);
  max-width: 30rem;
}

.ywsh-auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem 1.25rem;
}

.ywsh-auth-card {
  width: min(100%, 420px);
  padding: 1.75rem;
  background: var(--ywsh-bg-card);
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-lg);
  box-shadow: var(--ywsh-shadow-lg);
}

.ywsh-auth-card__header {
  margin-bottom: 1.25rem;
}

.ywsh-auth-card__brand {
  margin: 0 0 0.35rem;
  color: var(--ywsh-color-primary);
  letter-spacing: 0.08em;
}

.ywsh-auth-card__title {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  color: var(--ywsh-text-main);
}

.ywsh-auth-card__subtitle {
  margin: 0;
  color: var(--ywsh-text-muted);
  font-size: 0.92rem;
}

.ywsh-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  padding: 0.25rem;
  background: var(--ywsh-bg-surface);
  border-radius: var(--ywsh-radius-md);
}

.ywsh-auth-tabs__link {
  display: block;
  text-align: center;
  padding: 0.55rem 0.75rem;
  border-radius: calc(var(--ywsh-radius-md) - 2px);
  color: var(--ywsh-text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background var(--ywsh-transition), color var(--ywsh-transition);
}

.ywsh-auth-tabs__link:hover {
  color: var(--ywsh-text-main);
}

.ywsh-auth-tabs__link--active {
  background: var(--ywsh-bg-card);
  color: var(--ywsh-color-primary);
  box-shadow: var(--ywsh-shadow-sm);
}

.ywsh-auth-alert {
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--ywsh-radius-sm);
  font-size: 0.9rem;
}

.ywsh-auth-alert--error {
  background: rgba(192, 88, 88, 0.12);
  border: 1px solid rgba(192, 88, 88, 0.35);
  color: #8f2f2f;
}

.ywsh-auth-alert--success {
  background: rgba(74, 143, 124, 0.12);
  border: 1px solid rgba(74, 143, 124, 0.35);
  color: #2f6b5a;
}

.ywsh-auth-alert p {
  margin: 0;
}

.ywsh-auth-alert p + p {
  margin-top: 0.35rem;
}

.ywsh-auth-forgot {
  margin: 0.45rem 0 0;
  text-align: right;
  font-size: 0.88rem;
}

.ywsh-auth-forgot a,
.ywsh-auth-card__footer a {
  color: var(--ywsh-color-primary);
  text-decoration: none;
  font-weight: 600;
}

.ywsh-auth-forgot a:hover,
.ywsh-auth-card__footer a:hover {
  text-decoration: underline;
}

.ywsh-auth-card__footer {
  margin: 1.1rem 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--ywsh-text-muted);
}

.ywsh-auth-form {
  display: grid;
  gap: 0.9rem;
}

.ywsh-auth-field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ywsh-text-main);
}

.ywsh-auth-field input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-sm);
  background: var(--ywsh-bg-surface);
  color: var(--ywsh-text-main);
  font: inherit;
}

.ywsh-auth-field input:focus {
  outline: 2px solid rgba(var(--ywsh-color-primary-rgb), 0.35);
  border-color: var(--ywsh-color-primary);
}

.ywsh-auth-field__hint {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--ywsh-text-muted);
}

.ywsh-auth-field__status {
  margin: 0.35rem 0 0;
  min-height: 1.1em;
  font-size: 0.8rem;
  font-weight: 600;
}

.ywsh-auth-field__status:empty {
  display: none;
}

.ywsh-auth-field__status--pending {
  color: var(--ywsh-text-muted);
  font-weight: 500;
}

.ywsh-auth-field__status--ok {
  color: #1f7a45;
}

.ywsh-auth-field__status--error {
  color: #b42318;
}

.ywsh-auth-field input.ywsh-auth-field__input--ok {
  border-color: #1f7a45;
}

.ywsh-auth-field input.ywsh-auth-field__input--error {
  border-color: #b42318;
}

.ywsh-auth-submit {
  margin-top: 0.35rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: var(--ywsh-radius-sm);
  background: var(--ywsh-color-primary);
  color: var(--ywsh-text-inverse);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--ywsh-transition), transform var(--ywsh-transition);
}

.ywsh-auth-submit:hover {
  background: var(--ywsh-color-primary-hover);
}

.ywsh-auth-turnstile {
  display: flex;
  justify-content: flex-start;
}

.ywsh-auth-turnstile .cf-turnstile {
  max-width: 100%;
}

.ywsh-auth-oauth {
  margin-top: 1.1rem;
}

.ywsh-auth-oauth__divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
  color: var(--ywsh-text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ywsh-auth-oauth__divider::before,
.ywsh-auth-oauth__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ywsh-border-light);
}

.ywsh-auth-oauth__divider span {
  white-space: nowrap;
}

.ywsh-auth-oauth__buttons {
  display: grid;
  gap: 0.55rem;
}

.ywsh-oauth-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-sm);
  background: var(--ywsh-bg-surface);
  color: var(--ywsh-text-main);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color var(--ywsh-transition), background var(--ywsh-transition), box-shadow var(--ywsh-transition);
}

.ywsh-oauth-button:hover {
  border-color: var(--ywsh-color-primary);
  background: var(--ywsh-bg-card);
  box-shadow: var(--ywsh-shadow-sm);
}

.ywsh-oauth-button__icon {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}

.ywsh-oauth-button--google:hover {
  border-color: #4285f4;
}

.ywsh-oauth-button--facebook:hover {
  border-color: #1877f2;
}

.ywsh-oauth-button--microsoft365:hover,
.ywsh-oauth-button--microsoft-outlook:hover {
  border-color: #0078d4;
}

.ywsh-auth-demo {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--ywsh-border-light);
}

.ywsh-auth-demo__title {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  color: var(--ywsh-text-main);
}

.ywsh-auth-demo__hint {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: var(--ywsh-text-muted);
}

.ywsh-auth-demo__hint code {
  font-size: 0.85em;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: var(--ywsh-bg-surface);
}

.ywsh-auth-demo__chips {
  display: grid;
  gap: 0.45rem;
}

.ywsh-auth-demo__chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--ywsh-border-light);
  border-radius: var(--ywsh-radius-sm);
  background: var(--ywsh-bg-surface);
  color: var(--ywsh-text-main);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--ywsh-transition), background var(--ywsh-transition);
}

.ywsh-auth-demo__chip:hover {
  border-color: var(--ywsh-color-primary);
  background: var(--ywsh-color-primary-subtle);
}

.ywsh-auth-demo__chip-name {
  font-weight: 600;
  font-size: 0.88rem;
}

.ywsh-auth-demo__chip-hint {
  font-size: 0.75rem;
  color: var(--ywsh-text-muted);
}

.ywsh-auth-footnote {
  margin: 1rem 0 0;
  font-size: 0.8rem;
  color: var(--ywsh-text-muted);
}

/* --- Signed-in user menu --- */

.ywsh-user-menu {
  position: relative;
}

.ywsh-user-menu__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 12rem;
  padding: 0.35rem 0.55rem 0.35rem 0.35rem;
  border: 1px solid var(--ywsh-border-light);
  border-radius: 999px;
  background: var(--ywsh-bg-surface);
  color: var(--ywsh-text-main);
  font: inherit;
  cursor: pointer;
  transition: border-color var(--ywsh-transition), box-shadow var(--ywsh-transition);
}

.ywsh-user-menu__trigger:hover,
.ywsh-user-menu--open .ywsh-user-menu__trigger {
  border-color: var(--ywsh-color-primary);
  box-shadow: var(--ywsh-shadow-sm);
}

.ywsh-user-menu__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--ywsh-color-primary);
  color: var(--ywsh-text-inverse);
  font-size: 0.72rem;
  font-weight: 700;
}

.ywsh-user-menu__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 600;
}

.ywsh-user-menu__chevron {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
  opacity: 0.7;
  flex-shrink: 0;
}

.ywsh-user-menu__panel {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 40;
  min-width: 14rem;
  padding: 0.85rem;
  background: var(--ywsh-bg-card);
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-md);
  box-shadow: var(--ywsh-shadow-lg);
}

.ywsh-user-menu__meta,
.ywsh-user-menu__email {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ywsh-text-muted);
}

.ywsh-user-menu__email {
  margin-bottom: 0.75rem;
  word-break: break-word;
}

.ywsh-user-menu__logout {
  margin: 0;
}

.ywsh-user-menu__logout-btn {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-sm);
  background: transparent;
  color: var(--ywsh-text-main);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--ywsh-transition), border-color var(--ywsh-transition);
}

.ywsh-user-menu__logout-btn:hover {
  background: rgba(192, 88, 88, 0.08);
  border-color: rgba(192, 88, 88, 0.45);
  color: #a33;
}

/* Toast notifications */
.ywsh-toast-host {
  position: fixed;
  z-index: 12000;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  pointer-events: none;
  width: min(28rem, calc(100vw - 1.5rem));
}

.ywsh-toast-host--top-center {
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  align-items: stretch;
}

.ywsh-toast-host--center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  align-items: stretch;
}

.ywsh-toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem 0.75rem;
  align-items: start;
  padding: 0.85rem 0.95rem;
  border-radius: var(--ywsh-radius-md);
  border: 1px solid var(--ywsh-border);
  background: var(--ywsh-bg-card);
  box-shadow: var(--ywsh-shadow-md, 0 8px 24px rgba(0, 0, 0, 0.16));
  opacity: 1;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.ywsh-toast--leaving {
  opacity: 0;
  transform: translateY(-0.35rem);
}

.ywsh-toast__logo {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.35rem;
  object-fit: contain;
  margin-top: 0.1rem;
}

.ywsh-toast__content {
  min-width: 0;
}

.ywsh-toast__title {
  margin: 0 0 0.2rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ywsh-text-main);
}

.ywsh-toast__body {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--ywsh-text-main);
  white-space: pre-wrap;
  word-break: break-word;
}

.ywsh-toast__close {
  border: 0;
  background: transparent;
  color: var(--ywsh-text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.1rem 0.25rem;
}

.ywsh-toast__close:hover {
  color: var(--ywsh-text-main);
}

.ywsh-toast--info {
  border-left: 4px solid var(--ywsh-color-primary);
  background: color-mix(in srgb, var(--ywsh-color-primary-subtle) 70%, var(--ywsh-bg-card));
}

.ywsh-toast--warning {
  border-left: 4px solid #c47b16;
  background: color-mix(in srgb, #fff3e0 75%, var(--ywsh-bg-card));
}

.ywsh-toast--error {
  border-left: 4px solid #c62828;
  background: color-mix(in srgb, #ffebee 75%, var(--ywsh-bg-card));
}

.ywsh-unread-badge--inline {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.35rem;
  vertical-align: middle;
}

.ywsh-unread-badge--inline[hidden] {
  display: none !important;
}

/* Soft-delete controls (edit mode only) */
.ywsh-tab-delete,
.ywsh-category-card__delete,
.ywsh-category-weblink__delete,
.ywsh-top-tab-link__delete {
  display: none;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  margin-left: 0.35rem;
  border: 0;
  border-radius: 999px;
  background: rgba(198, 40, 40, 0.12);
  color: #c62828;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.ywsh-app--edit-mode .ywsh-tab-delete,
.ywsh-app--edit-mode .ywsh-category-card__delete,
.ywsh-app--edit-mode .ywsh-category-weblink__delete,
.ywsh-app--edit-mode .ywsh-top-tab-link__delete {
  display: inline-flex;
}

.ywsh-tab-delete:hover,
.ywsh-category-card__delete:hover,
.ywsh-category-weblink__delete:hover,
.ywsh-top-tab-link__delete:hover {
  background: #c62828;
  color: #fff;
}

.ywsh-top-tab__button,
.ywsh-content-tab {
  display: inline-flex;
  align-items: center;
}

.ywsh-recycle-tree {
  margin-top: 0.75rem;
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-sm);
  background: var(--ywsh-bg-raised, var(--ywsh-bg-surface));
  max-height: 22rem;
  overflow: auto;
  padding: 0.5rem 0.65rem;
}

.ywsh-recycle-tree__branch {
  margin: 0.35rem 0 0.75rem;
}

.ywsh-recycle-tree__branch-title {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ywsh-text-main);
}

.ywsh-recycle-tree__list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 0.25rem;
}

.ywsh-recycle-tree__item {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.3rem 0.2rem;
  font-size: 0.85rem;
}

.ywsh-recycle-tree__item label {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  cursor: pointer;
}

.ywsh-recycle-tree__meta {
  color: var(--ywsh-text-muted);
  font-size: 0.75rem;
}

.ywsh-recycle-tree__empty {
  color: var(--ywsh-text-muted);
  font-size: 0.85rem;
  margin: 0.25rem 0;
}

.ywsh-settings-modal__section-btn {
  position: relative;
}

.ywsh-messages-history {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 22rem;
  overflow: auto;
}

.ywsh-messages-history__empty {
  margin: 0;
  color: var(--ywsh-text-muted);
  font-size: 0.9rem;
}

.ywsh-messages-history__item {
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-sm);
  background: var(--ywsh-bg-raised, var(--ywsh-bg-surface));
  overflow: hidden;
}

.ywsh-messages-history__item--unread {
  border-left: 3px solid var(--ywsh-color-primary);
}

.ywsh-messages-history__item--error {
  border-left-color: #c62828;
}

.ywsh-messages-history__item--warning {
  border-left-color: #c47b16;
}

.ywsh-messages-history__summary {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: flex-start;
  padding: 0.65rem 0.75rem;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.ywsh-messages-history__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  font-size: 0.75rem;
  color: var(--ywsh-text-muted);
}

.ywsh-messages-history__type {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ywsh-messages-history__title {
  font-weight: 600;
  color: var(--ywsh-text-main);
}

.ywsh-messages-history__preview {
  font-size: 0.85rem;
  color: var(--ywsh-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.ywsh-messages-history__body {
  margin: 0;
  padding: 0 0.75rem 0.75rem;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--ywsh-text-main);
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 640px) {
  .ywsh-toast-host--top-center,
  .ywsh-toast-host--center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
}

.ywsh-error-panel {
  width: min(32rem, 92%);
  margin: 4rem auto;
  padding: 1.5rem;
  background: var(--ywsh-bg-card);
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-md);
}

@media (max-width: 900px) {
  .ywsh-auth-shell {
    grid-template-columns: 1fr;
  }

  .ywsh-auth-hero {
    min-height: 28vh;
    border-right: none;
    border-bottom: 1px solid var(--ywsh-border-light);
  }

  .ywsh-auth-hero__content {
    margin-top: 0;
  }

  .ywsh-auth-hero__grid {
    display: none;
  }

  .ywsh-user-menu__name {
    display: none;
  }
}

/* —— Administrator module —— */
.ywsh-admin-app {
  min-height: 100vh;
  background: var(--ywsh-bg-main);
}

.ywsh-admin-header {
  background: var(--ywsh-bg-surface);
  border-bottom: 1px solid var(--ywsh-border);
}

.ywsh-admin-header__inner {
  width: 99%;
  margin: 0 auto;
  padding: 1.25rem 0.75rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.ywsh-admin-header__eyebrow {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ywsh-text-muted);
}

.ywsh-admin-header__title {
  margin: 0.15rem 0;
  font-size: 1.6rem;
}

.ywsh-admin-header__meta {
  margin: 0;
  color: var(--ywsh-text-muted);
}

.ywsh-admin-main {
  width: 99%;
  margin: 0 auto;
  padding: 1rem 0.75rem 2rem;
}

.ywsh-admin-tabs__bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.ywsh-admin-tabs__btn {
  border: 1px solid var(--ywsh-border);
  background: var(--ywsh-bg-card);
  color: var(--ywsh-text);
  border-radius: var(--ywsh-radius-sm, 0.4rem);
  padding: 0.45rem 0.85rem;
  cursor: pointer;
}

.ywsh-admin-tabs__btn.is-active {
  background: var(--ywsh-color-primary);
  border-color: var(--ywsh-color-primary);
  color: #fff;
}

.ywsh-admin-panel {
  background: var(--ywsh-bg-card);
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-md, 0.6rem);
  padding: 1rem;
}

.ywsh-admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.ywsh-admin-input,
.ywsh-admin-textarea {
  border: 1px solid var(--ywsh-border);
  background: var(--ywsh-bg-raised, var(--ywsh-bg-surface));
  color: var(--ywsh-text);
  border-radius: 0.35rem;
  padding: 0.45rem 0.6rem;
  min-width: 10rem;
}

.ywsh-admin-input--title {
  background: #ffffff;
  color: #1e293b;
}

.ywsh-admin-theme-toggles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.35rem 0.75rem;
  margin: 0.5rem 0 0.75rem;
}

.ywsh-admin-textarea {
  width: 100%;
  min-width: 0;
  font-family: var(--ywsh-font, inherit);
  margin-bottom: 0.5rem;
}

.ywsh-admin-btn {
  border: 1px solid var(--ywsh-color-primary);
  background: var(--ywsh-color-primary);
  color: #fff;
  border-radius: 0.35rem;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.ywsh-admin-btn--ghost {
  background: transparent;
  color: var(--ywsh-color-primary);
}

.ywsh-admin-btn--danger {
  border-color: #b42318;
  background: #b42318;
  color: #fff;
}

.ywsh-admin-btn--danger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ywsh-admin-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.35rem 0;
}

.ywsh-admin-check--table {
  margin: 0;
  gap: 0.25rem;
  white-space: nowrap;
}

.ywsh-admin-col-check {
  width: 4.5rem;
  vertical-align: middle;
}

.ywsh-admin-select-all-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ywsh-text-muted);
}

.ywsh-admin-preview-features {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ywsh-admin-preview-feature {
  border: 1px solid var(--ywsh-border-light, var(--ywsh-border));
  border-radius: var(--ywsh-radius-md);
  padding: 0.85rem;
  background: var(--ywsh-bg-raised, var(--ywsh-bg-surface));
}

.ywsh-admin-preview-feature h4 {
  margin: 0 0 0.35rem;
}

.ywsh-admin-preview-feature h4 code {
  font-size: 0.85em;
  font-weight: 500;
}

.ywsh-admin-preview-feature__users select {
  min-height: 8rem;
}

.ywsh-admin-table-wrap {
  overflow-x: auto;
}

.ywsh-admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.ywsh-admin-table th,
.ywsh-admin-table td {
  border-bottom: 1px solid var(--ywsh-border-light, var(--ywsh-border));
  padding: 0.5rem 0.4rem;
  text-align: left;
  vertical-align: top;
}

.ywsh-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.ywsh-admin-actions button {
  font-size: 0.78rem;
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--ywsh-border);
  background: var(--ywsh-bg-raised, var(--ywsh-bg-surface));
  border-radius: 0.3rem;
  cursor: pointer;
}

.ywsh-admin-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ywsh-color-primary) 18%, transparent);
  color: var(--ywsh-color-primary);
}

.ywsh-admin-badge--warn {
  background: color-mix(in srgb, #c45c26 22%, transparent);
  color: #c45c26;
}

.ywsh-admin-muted {
  color: var(--ywsh-text-muted);
  font-size: 0.85rem;
}

.ywsh-admin-status {
  min-height: 1.25rem;
  margin: 0.25rem 0 0.75rem;
  color: var(--ywsh-text-muted);
}

.ywsh-admin-status.is-error {
  color: #b42318;
}

.ywsh-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.ywsh-admin-card {
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-md, 0.6rem);
  padding: 0.85rem;
  background: var(--ywsh-bg-raised, var(--ywsh-bg-surface));
}

.ywsh-admin-card--wide {
  grid-column: 1 / -1;
}

.ywsh-admin-i18n-table textarea.ywsh-admin-i18n-value {
  width: 100%;
  min-width: 14rem;
  resize: vertical;
}

#ywsh-admin-msg-locale-tabs .ywsh-admin-btn.is-active {
  border-color: var(--ywsh-accent, #2563eb);
  background: color-mix(in srgb, var(--ywsh-accent, #2563eb) 12%, transparent);
}

.ywsh-admin-pages-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.ywsh-admin-field--inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}

.ywsh-admin-page-editor {
  min-height: 20rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
}

.tox-tinymce {
  border-radius: var(--ywsh-radius-sm, 0.4rem) !important;
}

.ywsh-admin-dialog {
  border: 1px solid var(--ywsh-border, #d0d7de);
  border-radius: 0.5rem;
  padding: 0;
  max-width: min(40rem, 94vw);
  width: 100%;
  background: var(--ywsh-bg-elevated, #fff);
  color: inherit;
}

.ywsh-admin-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.ywsh-admin-dialog__inner {
  margin: 0;
  padding: 1rem 1.1rem 1.2rem;
}

.ywsh-admin-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.ywsh-admin-dialog__header h3 {
  margin: 0;
}

.ywsh-admin-feedback-body {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--ywsh-border, #e5e7eb);
  line-height: 1.5;
  max-height: min(60vh, 28rem);
  overflow: auto;
}

.ywsh-admin-feedback-body img {
  max-width: 100%;
  height: auto;
}

.ywsh-admin-card h3 {
  margin: 0 0 0.5rem;
}

.ywsh-admin-help {
  margin: 0 0 0.5rem;
  color: var(--ywsh-text-muted);
  font-size: 0.9rem;
}

.ywsh-admin-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.75rem;
  margin: 0 0 0.75rem;
}

.ywsh-admin-dl dt {
  color: var(--ywsh-text-muted);
}

.ywsh-admin-dl dd {
  margin: 0;
  word-break: break-word;
}

.ywsh-admin-mail-log {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem;
  max-height: 18rem;
  overflow: auto;
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-sm, 0.4rem);
  background: color-mix(in srgb, var(--ywsh-bg-surface, #111) 92%, var(--ywsh-text, #fff) 8%);
  color: var(--ywsh-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.ywsh-admin-mail-table-wrap {
  max-height: 22rem;
  overflow: auto;
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-sm, 0.4rem);
}

.ywsh-admin-mail-table {
  font-size: 0.82rem;
}

.ywsh-admin-mail-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--ywsh-bg-raised, var(--ywsh-bg-surface));
  box-shadow: 0 1px 0 var(--ywsh-border);
}

.ywsh-admin-mail-table td {
  vertical-align: top;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ywsh-admin-mail-ok {
  color: color-mix(in srgb, #16a34a 80%, var(--ywsh-text));
  font-weight: 600;
}

.ywsh-admin-mail-fail {
  color: color-mix(in srgb, #dc2626 85%, var(--ywsh-text));
  font-weight: 600;
}

.ywsh-admin-toolbar--tight {
  align-items: baseline;
  gap: 0.75rem;
  margin: 0.35rem 0 0.5rem;
}

.ywsh-admin-inline-heading {
  margin: 0;
  font-size: 1rem;
}

.ywsh-admin-btn--danger {
  border-color: color-mix(in srgb, #dc2626 55%, var(--ywsh-border));
  color: color-mix(in srgb, #dc2626 80%, var(--ywsh-text));
}

.ywsh-admin-mail-detail {
  margin-top: 0.75rem;
}

.ywsh-admin-mail-detail summary {
  cursor: pointer;
  color: var(--ywsh-text-muted);
  margin-bottom: 0.35rem;
}

.ywsh-admin-btn--small {
  padding: 0.15rem 0.45rem;
  font-size: 0.75rem;
  margin-left: 0;
}

.ywsh-admin-task-list {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}

.ywsh-admin-banner {
  width: 99%;
  margin: 0.5rem auto 0;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-sm, 0.4rem);
  background: color-mix(in srgb, var(--ywsh-color-primary) 12%, var(--ywsh-bg-card));
}

.ywsh-impersonation-banner {
  width: 99%;
  margin: 0.5rem auto 0;
  padding: 0.65rem 0.85rem;
  border: 1px solid color-mix(in srgb, #b45309 45%, var(--ywsh-border));
  border-radius: var(--ywsh-radius-sm, 0.4rem);
  background: color-mix(in srgb, #f59e0b 18%, var(--ywsh-bg-card));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.95rem;
}

.ywsh-admin-pua-identity {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.ywsh-admin-pua-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--ywsh-radius-sm, 0.4rem);
  border: 1px solid var(--ywsh-border);
  flex-shrink: 0;
}

.ywsh-admin-pua-locale {
  margin-bottom: 0.55rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid color-mix(in srgb, var(--ywsh-border) 70%, transparent);
}

.ywsh-admin-pua-locale:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.ywsh-admin-check--inline {
  display: inline-flex;
  margin: 0 0.35rem;
}

.ywsh-onboarding-shell {
  width: min(960px, 96%);
  margin: 2rem auto 3rem;
}

.ywsh-onboarding-header h1 {
  margin: 0.25rem 0 0.5rem;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}

.ywsh-onboarding-kicker {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ywsh-text-muted, #667);
}

.ywsh-onboarding-lead {
  margin: 0 0 1rem;
  max-width: 40rem;
  color: var(--ywsh-text-secondary, inherit);
}

.ywsh-onboarding-locale {
  max-width: 16rem;
  margin-bottom: 1.25rem;
}

.ywsh-onboarding-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.ywsh-onboarding-card {
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-sm, 0.4rem);
  background: var(--ywsh-bg-card, #fff);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ywsh-onboarding-card.is-selected {
  outline: 2px solid var(--ywsh-color-primary, #0f6b5c);
  outline-offset: 2px;
}

.ywsh-onboarding-card img,
.ywsh-onboarding-card__placeholder {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--ywsh-radius-sm, 0.35rem);
  background: color-mix(in srgb, var(--ywsh-color-primary) 12%, var(--ywsh-bg-surface, #eee));
}

.ywsh-onboarding-card h2 {
  margin: 0;
  font-size: 1.1rem;
}

.ywsh-onboarding-alt {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.ywsh-local-env-banner {
  width: 99%;
  margin: 0.5rem auto 0;
  padding: 0.55rem 0.85rem;
  border: 1px solid color-mix(in srgb, #d97706 50%, var(--ywsh-border));
  border-radius: var(--ywsh-radius-sm, 0.4rem);
  background: color-mix(in srgb, #f59e0b 20%, var(--ywsh-bg-card));
  color: var(--ywsh-text-primary, inherit);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

.ywsh-win-app-banner {
  position: relative;
  width: 99%;
  margin: 0.5rem auto 0;
  padding: 0.55rem 0.85rem;
  border: 1px solid color-mix(in srgb, #2563eb 45%, var(--ywsh-border));
  border-radius: var(--ywsh-radius-sm, 0.4rem);
  background: color-mix(in srgb, #3b82f6 14%, var(--ywsh-bg-card));
  color: var(--ywsh-text-primary, inherit);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.45;
}

.ywsh-win-app-banner__panel[hidden] {
  display: none;
}

.ywsh-win-app-banner__panel--inactive {
  padding-right: 1.75rem;
}

.ywsh-win-app-banner__dismiss {
  position: absolute;
  top: 0.25rem;
  right: 0.35rem;
  width: 1.6rem;
  height: 1.6rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ywsh-text-muted, #64748b);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.ywsh-win-app-banner__dismiss:hover,
.ywsh-win-app-banner__dismiss:focus-visible {
  color: var(--ywsh-text-primary, inherit);
  background: color-mix(in srgb, var(--ywsh-text-primary, #111) 8%, transparent);
}

.ywsh-win-app-banner__text {
  margin: 0;
}

.ywsh-win-app-banner__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.ywsh-win-app-banner__inline-btn {
  margin-left: 0.35rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ywsh-color-primary, #1d4ed8);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.ywsh-win-app-banner__inline-btn:hover,
.ywsh-win-app-banner__inline-btn:focus-visible {
  color: var(--ywsh-color-primary-hover, #1e40af);
}

.ywsh-win-app-banner__link {
  color: var(--ywsh-color-primary, #1d4ed8);
  font-weight: 700;
  text-decoration: underline;
}

.ywsh-settings-modal__textarea {
  width: 100%;
  min-height: 6rem;
  resize: vertical;
  box-sizing: border-box;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--ywsh-border, #cbd5e1);
  border-radius: var(--ywsh-radius-sm, 0.4rem);
  background: var(--ywsh-bg-raised, #fff);
  color: inherit;
  font: inherit;
  line-height: 1.4;
}

.ywsh-settings-modal__hint {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--ywsh-text-muted, #64748b);
}

.ywsh-settings-modal__label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.ywsh-settings-modal__static-value {
  margin: 0;
  padding: 0.45rem 0.65rem;
  border: 1px solid transparent;
  border-radius: var(--ywsh-radius-sm, 0.4rem);
  background: color-mix(in srgb, var(--ywsh-bg-main, #f5f7fa) 70%, var(--ywsh-bg-raised, #fff));
  color: var(--ywsh-text-muted, #64748b);
  font: inherit;
  line-height: 1.4;
}

.ywsh-settings-modal__theme-color-actions {
  margin-top: 0.65rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ywsh-settings-modal__template-downloads {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ywsh-roadmap-suggest-toggle-wrap {
  margin: 0 0 0.85rem;
}

.ywsh-roadmap-submit .ywsh-settings-modal__field--full,
.ywsh-roadmap-submit .ywsh-settings-modal__field--full textarea {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.ywsh-roadmap-submit textarea {
  width: 100%;
}

.ywsh-settings-modal__hint a {
  color: var(--ywsh-color-primary, #1d4ed8);
  font-weight: 600;
}

.ywsh-settings-modal__import-block {
  margin: 0.85rem 0 1rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--ywsh-border, #cbd5e1);
  border-radius: var(--ywsh-radius-sm, 0.4rem);
  background: color-mix(in srgb, var(--ywsh-bg-raised, #fff) 88%, var(--ywsh-bg-main, #f5f7fa));
}

.ywsh-settings-modal__import-block-title {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 700;
}

.ywsh-settings-modal__import-block > p {
  margin: 0 0 0.65rem;
}

.ywsh-settings-modal__import-block .ywsh-settings-modal__export-actions {
  margin-top: 0.35rem;
  margin-bottom: 0;
}

.ywsh-snippets-modal__header {
  gap: 0.75rem;
}

.ywsh-snippets-modal__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem 0.85rem;
  min-width: 0;
  flex: 1 1 auto;
}

.ywsh-snippets-modal__win-status {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ywsh-text-muted);
}

.ywsh-snippets-modal__win-status--error {
  color: #b42318;
}

.ywsh-snippets-modal__win-status--ok {
  color: #067647;
}

/* Snippet cheatsheet (printable) — narrow sheet, not full A4 width */
.ywsh-cheatsheet-page {
  margin: 0;
  padding: 0.5rem 0.5rem 1rem;
  font-family: var(--ywsh-font, "Segoe UI", system-ui, sans-serif);
  color: #111827;
  background: #e8ecf1;
}

.ywsh-cheatsheet__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 40rem;
  margin: 0 auto 1rem;
}

.ywsh-cheatsheet__sheet {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0.75rem 0.85rem 1rem;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.ywsh-cheatsheet__btn {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.85rem;
  border: 1px solid #d1d5db;
  border-radius: 0.4rem;
  background: #f9fafb;
  color: #111827;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.ywsh-cheatsheet__btn--primary {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

.ywsh-cheatsheet__header h1 {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
}

.ywsh-cheatsheet__meta,
.ywsh-cheatsheet__hint {
  margin: 0.25rem 0;
  color: #4b5563;
  font-size: 0.9rem;
}

.ywsh-cheatsheet__group {
  margin-top: 1.5rem;
  break-inside: avoid;
}

.ywsh-cheatsheet__group h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 0.35rem;
}

.ywsh-cheatsheet__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.ywsh-cheatsheet__table th,
.ywsh-cheatsheet__table td {
  border: 1px solid #e5e7eb;
  padding: 0.45rem 0.55rem;
  vertical-align: top;
  text-align: left;
}

.ywsh-cheatsheet__table th {
  background: #f3f4f6;
}

.ywsh-cheatsheet__shortcut code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.88rem;
}

.ywsh-cheatsheet__content pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 0.88rem;
}

.ywsh-cheatsheet__empty {
  color: #6b7280;
}

@media print {
  .no-print {
    display: none !important;
  }

  @page {
    size: A4;
    margin: 8mm 10mm;
  }

  .ywsh-cheatsheet-page {
    padding: 0;
    background: #fff;
  }

  .ywsh-cheatsheet__sheet {
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .ywsh-cheatsheet__group {
    page-break-inside: avoid;
  }
}

/* Roadmap timeline (Settings) */
.ywsh-roadmap-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin: 0.75rem 0 1rem;
}

.ywsh-roadmap-toolbar__field {
  display: grid;
  gap: 0.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  min-width: 0;
}

.ywsh-roadmap-toolbar__field select {
  min-width: 9rem;
  max-width: 100%;
}

.ywsh-roadmap-submit {
  margin: 0 0 1rem;
  padding: 0.85rem;
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-sm, 0.4rem);
  background: color-mix(in srgb, var(--ywsh-color-primary) 6%, var(--ywsh-bg-card));
}

.ywsh-roadmap-submit h4 {
  margin: 0 0 0.65rem;
}

.ywsh-roadmap-submit .ywsh-settings-modal__field {
  max-width: none;
}

.ywsh-roadmap-submit textarea {
  resize: vertical;
  min-height: 4.5rem;
  max-height: 10rem;
}

.ywsh-roadmap-timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0.5rem 0.85rem;
  border-left: 2px solid color-mix(in srgb, var(--ywsh-color-primary) 35%, var(--ywsh-border));
  display: grid;
  gap: 0.85rem;
}

.ywsh-roadmap-item {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-sm, 0.4rem);
  background: var(--ywsh-bg-card);
  min-width: 0;
}

.ywsh-roadmap-item::before {
  content: "";
  position: absolute;
  left: -1.05rem;
  top: 1.15rem;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--ywsh-color-primary);
  border: 2px solid var(--ywsh-bg-card);
}

.ywsh-roadmap-item--user {
  border-style: dashed;
  background: color-mix(in srgb, #f59e0b 8%, var(--ywsh-bg-card));
}

.ywsh-roadmap-item--team {
  border-style: solid;
}

.ywsh-roadmap-item__icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.45rem;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--ywsh-color-primary) 18%, var(--ywsh-bg-muted, #eef2ff));
}

.ywsh-roadmap-item__icon--website { background: #dbeafe; }
.ywsh-roadmap-item__icon--windows { background: #cffafe; }
.ywsh-roadmap-item__icon--extension { background: #ede9fe; }
.ywsh-roadmap-item__icon--phone { background: #dcfce7; }

.ywsh-roadmap-item__body {
  min-width: 0;
}

.ywsh-roadmap-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--ywsh-text-muted);
}

.ywsh-roadmap-item__badge {
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
}

.ywsh-roadmap-item__badge--rejected {
  background: #fee2e2;
  color: #991b1b;
}

.ywsh-roadmap-item h4 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.ywsh-roadmap-item p {
  margin: 0 0 0.65rem;
  color: var(--ywsh-text-muted);
  font-size: 0.9rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ywsh-roadmap-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.ywsh-roadmap-empty {
  color: var(--ywsh-text-muted);
  font-size: 0.9rem;
}

@media (max-width: 720px) {
  .ywsh-roadmap-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .ywsh-roadmap-toolbar__field select {
    min-width: 0;
    width: 100%;
  }

  .ywsh-roadmap-item {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .ywsh-roadmap-item__icon {
    width: 1.75rem;
    height: 1.75rem;
  }

  .ywsh-roadmap-timeline {
    padding-left: 0.7rem;
  }

  .ywsh-roadmap-item::before {
    left: -0.9rem;
    top: 0.95rem;
  }
}

@media (max-width: 480px) {
  .ywsh-roadmap-submit {
    padding: 0.65rem;
  }

  .ywsh-roadmap-submit textarea {
    min-height: 3.5rem;
  }
}

.ywsh-user-menu__admin-link {
  display: block;
  padding: 0.4rem 0.75rem;
  color: var(--ywsh-color-primary);
  text-decoration: none;
  font-weight: 600;
}

.ywsh-user-menu__admin-link:hover {
  text-decoration: underline;
}

/* M2: admin message ack toasts + link review */
.ywsh-toast--ack {
  max-width: min(28rem, 92vw);
}

.ywsh-toast__ack {
  margin-top: 0.5rem;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  border-radius: 0.35rem;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
  font: inherit;
}

.ywsh-toast-backdrop {
  position: fixed;
  inset: 0;
  z-index: 11990;
  background: rgba(15, 23, 42, 0.35);
  opacity: 1;
  transition: opacity 0.25s ease;
}

.ywsh-toast-backdrop--leaving {
  opacity: 0;
}

.ywsh-toast--dialog {
  z-index: 12010;
  max-width: min(28rem, 92vw);
}

.ywsh-toast__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.7rem;
  justify-content: flex-end;
}

.ywsh-toast__btn {
  border-radius: 0.35rem;
  padding: 0.35rem 0.85rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
  border: 1px solid transparent;
}

.ywsh-toast__btn--primary {
  background: var(--ywsh-color-primary);
  color: #fff;
  border-color: var(--ywsh-color-primary);
}

.ywsh-toast__btn--primary:hover,
.ywsh-toast__btn--primary:focus-visible {
  filter: brightness(0.95);
}

.ywsh-toast__btn--secondary {
  background: var(--ywsh-bg-muted, #f3f4f6);
  color: var(--ywsh-text-main);
  border-color: var(--ywsh-border);
}

.ywsh-toast__btn--secondary:hover,
.ywsh-toast__btn--secondary:focus-visible {
  background: var(--ywsh-border-light, #e5e7eb);
}

.ywsh-link-health-review {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--ywsh-border);
  border-radius: var(--ywsh-radius-sm, 0.4rem);
  background: var(--ywsh-bg-raised, var(--ywsh-bg-surface));
}

.ywsh-link-health-review h4 {
  margin: 0 0 0.35rem;
}

.ywsh-link-health-review ul {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}

.ywsh-link-health-review__item {
  margin: 0.35rem 0;
}

.ywsh-admin-fieldset {
  border: 1px solid var(--ywsh-border);
  border-radius: 0.35rem;
  padding: 0.5rem 0.75rem;
  margin: 0.75rem 0;
}

.ywsh-admin-field-label {
  display: block;
  margin: 0.5rem 0 0.2rem;
  font-size: 0.9rem;
}

.ywsh-admin-user-checklist {
  max-height: 22rem;
  overflow: auto;
  border: 1px solid var(--ywsh-border);
  border-radius: 0.35rem;
  padding: 0.5rem;
}

.ywsh-admin-url-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}

.ywsh-admin-url-list li {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--ywsh-border-light, var(--ywsh-border));
  word-break: break-all;
}

.ywsh-admin-stats-dup td:first-child {
  font-weight: 600;
}

.ywsh-settings-modal--wide {
  max-width: 820px;
  width: min(820px, calc(100vw - 2rem));
}

.ywsh-settings-modal__divider {
  border: 0;
  border-top: 1px solid var(--ywsh-border-light);
  margin: 1.25rem 0;
}

.ywsh-settings-modal__hint {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--ywsh-text-muted);
}

.ywsh-settings-modal__color-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ywsh-settings-modal__color-row input[type="color"] {
  width: 3rem;
  height: 2.1rem;
  padding: 0.15rem;
  border: 1px solid var(--ywsh-border-light);
  border-radius: var(--ywsh-radius-sm);
  background: var(--ywsh-bg-surface);
  cursor: pointer;
}

.ywsh-settings-modal__color-swatch {
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;
  font-size: 0.9rem;
  color: var(--ywsh-text-muted);
  letter-spacing: 0.02em;
}

.ywsh-settings-modal__actions-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.ywsh-settings-modal__status {
  font-size: 0.9rem;
  color: var(--ywsh-text-muted);
}

.ywsh-settings-modal__status--error {
  color: var(--ywsh-color-danger, #c0392b);
}

/* Public informational pages — fixed light docs skin (not dashboard theme) */
body.ywsh-app.ywsh-info-page[data-ywsh-theme="docs-light"],
body.ywsh-app.ywsh-info-page[data-ywsh-docs-skin="light"] {
  --ywsh-docs-bg: #f4f6f8;
  --ywsh-docs-surface: #ffffff;
  --ywsh-docs-ink: #1c2430;
  --ywsh-docs-muted: #5b6778;
  --ywsh-docs-border: #e2e7ee;
  --ywsh-docs-border-strong: #cfd7e2;
  --ywsh-docs-accent: #0f7a72;
  --ywsh-docs-accent-soft: rgba(15, 122, 114, 0.1);
  --ywsh-docs-accent-line: #1aa396;
  --ywsh-docs-code-bg: #eef2f6;
  --ywsh-docs-shadow: 0 1px 2px rgba(28, 36, 48, 0.04), 0 8px 24px rgba(28, 36, 48, 0.04);
  --ywsh-bg-main: var(--ywsh-docs-bg);
  --ywsh-bg-surface: var(--ywsh-docs-surface);
  --ywsh-bg-raised: #f0f3f7;
  --ywsh-bg-card: var(--ywsh-docs-surface);
  --ywsh-bg-muted: #e8edf3;
  --ywsh-color-primary: var(--ywsh-docs-accent);
  --ywsh-color-primary-rgb: 15, 122, 114;
  --ywsh-color-accent: #2a6f97;
  --ywsh-text-main: var(--ywsh-docs-ink);
  --ywsh-text-muted: var(--ywsh-docs-muted);
  --ywsh-text-inverse: #ffffff;
  --ywsh-border: var(--ywsh-docs-border-strong);
  --ywsh-border-light: var(--ywsh-docs-border);
  --ywsh-highlight: #dff5f2;
  --ywsh-tone-ink: var(--ywsh-docs-ink);
  --ywsh-tone-paper: var(--ywsh-docs-surface);
  --ywsh-font: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 420px at 8% -10%, rgba(15, 122, 114, 0.07), transparent 55%),
    radial-gradient(900px 380px at 92% 0%, rgba(42, 111, 151, 0.06), transparent 50%),
    var(--ywsh-docs-bg);
  color: var(--ywsh-docs-ink);
  font-family: var(--ywsh-font);
}

.ywsh-info-page__header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--ywsh-docs-border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.ywsh-info-page__header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1.5rem;
  max-width: 92rem;
  margin: 0 auto;
  padding: 0.8rem 1.5rem;
}

.ywsh-info-page__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: inherit;
  text-decoration: none;
}

.ywsh-info-page__brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  color: var(--ywsh-docs-accent);
  background: var(--ywsh-docs-accent-soft);
}

.ywsh-info-page__brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.ywsh-info-page__brand-text strong {
  font-size: 0.98rem;
  letter-spacing: 0.02em;
}

.ywsh-info-page__brand-text span {
  color: var(--ywsh-docs-muted);
  font-weight: 400;
  font-size: 0.75rem;
}

.ywsh-info-page__header-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.2rem;
}

.ywsh-info-page__header-nav a {
  color: var(--ywsh-docs-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.ywsh-info-page__header-nav a:hover {
  color: var(--ywsh-docs-ink);
  background: rgba(28, 36, 48, 0.04);
}

.ywsh-info-page__header-nav a.is-active {
  color: var(--ywsh-docs-accent);
  background: var(--ywsh-docs-accent-soft);
  border-bottom-color: var(--ywsh-docs-accent-line);
}

.ywsh-info-page__header-nav-cta {
  margin-left: 0.35rem;
  color: #fff !important;
  background: var(--ywsh-docs-accent) !important;
  border-bottom-color: transparent !important;
}

.ywsh-info-page__header-nav-cta:hover {
  filter: brightness(1.05);
  color: #fff !important;
}

.ywsh-info-page__shell {
  display: grid;
  grid-template-columns: minmax(12rem, 16.5rem) minmax(0, 1fr);
  gap: 1.75rem 2.25rem;
  width: min(92rem, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 1.75rem 0 3.25rem;
  flex: 1;
}

.ywsh-info-page__shell--no-sidebar {
  grid-template-columns: minmax(0, 1fr);
}

.ywsh-info-page__sidebar {
  position: sticky;
  top: 4.5rem;
  align-self: start;
  max-height: calc(100vh - 5.5rem);
  overflow: auto;
  padding: 1rem 0.85rem;
  border: 1px solid var(--ywsh-docs-border);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--ywsh-docs-shadow);
}

.ywsh-info-page__sidebar-group + .ywsh-info-page__sidebar-group {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--ywsh-docs-border);
}

.ywsh-info-page__sidebar-title {
  margin: 0 0 0.65rem;
  padding: 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ywsh-docs-muted);
}

.ywsh-info-page__sidebar-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ywsh-info-page__sidebar-nav li + li {
  margin-top: 0.15rem;
}

.ywsh-info-page__sidebar-nav a {
  display: block;
  padding: 0.42rem 0.55rem;
  border-radius: 0.45rem;
  border-left: 2px solid transparent;
  color: var(--ywsh-docs-ink);
  text-decoration: none;
  font-size: 0.92rem;
  line-height: 1.35;
}

.ywsh-info-page__sidebar-nav a:hover {
  background: rgba(28, 36, 48, 0.04);
  color: var(--ywsh-docs-accent);
}

.ywsh-info-page__sidebar-nav a.is-active,
.ywsh-info-page__sidebar-nav a[aria-current="page"] {
  background: var(--ywsh-docs-accent-soft);
  color: var(--ywsh-docs-accent);
  border-left-color: var(--ywsh-docs-accent-line);
  font-weight: 600;
}

.ywsh-info-page__main {
  min-width: 0;
}

.ywsh-info-page__article {
  max-width: none;
  padding: 1.75rem 2rem 2.25rem;
  border: 1px solid var(--ywsh-docs-border);
  border-radius: 1rem;
  background: var(--ywsh-docs-surface);
  box-shadow: var(--ywsh-docs-shadow);
}

.ywsh-info-page__title-row {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  margin: 0 0 1.35rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--ywsh-docs-border);
}

.ywsh-info-page__subject-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 3rem;
  height: 3rem;
  margin-top: 0.1rem;
  border-radius: 0.8rem;
  color: var(--ywsh-docs-accent);
  background:
    linear-gradient(160deg, rgba(15, 122, 114, 0.14), rgba(42, 111, 151, 0.08));
  border: 1px solid rgba(15, 122, 114, 0.16);
}

.ywsh-info-page__icon-svg {
  display: block;
}

.ywsh-info-page__article h1 {
  margin: 0;
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: clamp(1.9rem, 3.2vw, 2.55rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ywsh-docs-ink);
}

.ywsh-info-page__body {
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 68rem;
}

.ywsh-info-page__body a {
  color: var(--ywsh-docs-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

.ywsh-info-page__body a:hover {
  color: #0b5f59;
}

.ywsh-info-page__body code,
.ywsh-info-page__body kbd {
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;
  font-size: 0.9em;
  padding: 0.12em 0.4em;
  border-radius: 0.35rem;
  background: var(--ywsh-docs-code-bg);
  border: 1px solid var(--ywsh-docs-border);
}

.ywsh-info-page__body pre {
  margin: 1rem 0;
  padding: 0.95rem 1.1rem;
  overflow: auto;
  border-radius: 0.7rem;
  background: #1e2632;
  color: #e8eef6;
  border: 1px solid #2c3645;
}

.ywsh-info-page__body pre code {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 0.92rem;
}

.ywsh-info-page__lede {
  font-size: 1.15rem;
  color: var(--ywsh-docs-muted);
  line-height: 1.65;
  margin: 0 0 0.5rem;
}

.ywsh-info-page__section {
  margin-top: 2rem;
  scroll-margin-top: 5.5rem;
}

.ywsh-info-page__section h2,
.ywsh-info-page__body h2 {
  margin: 0 0 0.75rem;
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 1.4rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--ywsh-docs-ink);
  scroll-margin-top: 5.5rem;
}

.ywsh-info-page__section h3,
.ywsh-info-page__body h3 {
  margin: 1.25rem 0 0.55rem;
  font-size: 1.1rem;
  font-weight: 650;
}

.ywsh-info-page__section ul,
.ywsh-info-page__section ol,
.ywsh-info-page__body ul,
.ywsh-info-page__body ol {
  padding-left: 1.25rem;
  line-height: 1.7;
  list-style: revert;
  margin: 0 0 0.9rem;
}

.ywsh-info-page__body ul {
  list-style: disc;
}

.ywsh-info-page__body ol {
  list-style: decimal;
}

.ywsh-info-page__section p,
.ywsh-info-page__body p {
  margin: 0 0 0.9rem;
}

.ywsh-info-page__card-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.9rem;
}

.ywsh-info-page__body ul.ywsh-info-page__card-list {
  list-style: none;
  padding: 0;
}

.ywsh-info-page__card-list li {
  padding: 0.95rem 1.05rem;
  margin-bottom: 0.55rem;
  border: 1px solid var(--ywsh-docs-border);
  border-radius: 0.7rem;
  background: linear-gradient(180deg, #fbfcfd, #f6f8fb);
}

.ywsh-info-page__video {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  margin-top: 0.75rem;
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--ywsh-docs-code-bg);
  border: 1px solid var(--ywsh-docs-border);
}

.ywsh-info-page__video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.ywsh-info-page__note {
  margin-top: 0.5rem;
  font-size: 0.88rem;
  color: var(--ywsh-docs-muted);
}

.ywsh-info-page__footer {
  margin-top: auto;
  border-top: 1px solid var(--ywsh-docs-border);
  background: rgba(255, 255, 255, 0.7);
}

.ywsh-info-page__footer .ywsh-footer__inner {
  max-width: 92rem;
}

@media (max-width: 900px) {
  .ywsh-info-page__shell {
    grid-template-columns: 1fr;
    width: min(100%, calc(100% - 1.5rem));
    padding-top: 1.15rem;
  }

  .ywsh-info-page__sidebar {
    position: static;
    max-height: none;
    order: -1;
  }

  .ywsh-info-page__article {
    padding: 1.25rem 1.15rem 1.6rem;
  }
}

/* Snippet Share & Adopt page */
.ywsh-snippet-share {
  flex: 1;
  padding: 1.5rem 1rem 2.5rem;
}
.ywsh-snippet-share__inner {
  max-width: 1200px;
  margin: 0 auto;
}
.ywsh-snippet-share__title {
  margin: 0 0 0.75rem;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(1.75rem, 2.5vw, 2.25rem);
  color: var(--ywsh-tone-ink, #0f172a);
}
.ywsh-snippet-share__lang {
  display: inline-flex;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}
.ywsh-snippet-share__lang-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.4rem;
  background: #fff;
  color: #334155;
  text-decoration: none;
  font-size: 0.9rem;
}
.ywsh-snippet-share__lang-btn.is-active,
.ywsh-snippet-share__lang-btn:hover {
  border-color: #4a7ec9;
  color: #1e3a5f;
  background: #eff6ff;
}
.ywsh-snippet-share__lead {
  margin: 0 0 1.25rem;
  color: #475569;
  max-width: 46rem;
}
.ywsh-snippet-share__status {
  margin: 0 0 1rem;
  color: #475569;
}
.ywsh-snippet-share__status.is-error {
  color: #b91c1c;
}
.ywsh-snippet-share__gate {
  padding: 1.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.6rem;
  background: #fff;
  max-width: 36rem;
}
.ywsh-snippet-share__gate h2 {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
}
.ywsh-snippet-share__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(192px, 192px));
  gap: 0.85rem;
  justify-content: start;
}
.ywsh-snippet-share-card {
  width: 100%;
  max-width: 192px;
}
.ywsh-snippet-share-card .ywsh-category-card-header,
.ywsh-snippet-share-card__header {
  padding: 0.45rem 0.5rem 0.4rem;
}
.ywsh-snippet-share-card .ywsh-category-card-body,
.ywsh-snippet-share-card__body {
  padding: 0.35rem 0.45rem 0.5rem;
}
.ywsh-snippet-share-card .ywsh-category-card__title {
  color: var(--ywsh-card-title, #fff);
  font-size: 0.95rem;
  line-height: 1.25;
}
.ywsh-snippet-share-card .ywsh-category-card__link-count {
  font-size: 0.75rem;
  min-width: 1.5rem;
  padding: 0.1rem 0.35rem;
}
.ywsh-snippet-share-card__pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.35rem;
}
.ywsh-snippet-share-card__page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.55rem;
  height: 1.55rem;
  padding: 0 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 0.3rem;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
}
.ywsh-snippet-share-card__page-btn:hover:not(:disabled),
.ywsh-snippet-share-card__page-btn:focus-visible:not(:disabled) {
  background: rgba(255, 255, 255, 0.32);
}
.ywsh-snippet-share-card__page-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.ywsh-snippet-share-card__page-meta {
  flex: 0 0 100%;
  margin: 0.15rem 0 0;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}
.ywsh-snippet-share-card__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.ywsh-snippet-share-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem;
  align-items: start;
  padding: 0.35rem 0.15rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.18);
}
/* display:grid above would otherwise override the HTML hidden attribute. */
.ywsh-snippet-share-item[hidden],
.ywsh-snippet-share-item.is-page-hidden {
  display: none !important;
}
.ywsh-snippet-share-item:last-child {
  border-bottom: 1px solid rgba(15, 23, 42, 0.18);
}
.ywsh-snippet-share-item__name {
  margin: 0;
  font-weight: 600;
  font-size: 0.82rem;
  color: #0f172a;
  word-break: break-word;
}
.ywsh-snippet-share-item__value {
  margin: 0.1rem 0 0;
  color: #475569;
  font-size: 0.78rem;
  word-break: break-word;
}
.ywsh-snippet-share-item__shortcut {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
}
.ywsh-snippet-share-item__shortcut code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: rgba(15, 23, 42, 0.06);
  padding: 0.05rem 0.25rem;
  border-radius: 0.2rem;
}
.ywsh-snippet-share-item__adopt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border: 1px solid rgba(15, 23, 42, 0.15);
  border-radius: 0.3rem;
  background: #fff;
  color: #1e3a5f;
  cursor: pointer;
}
.ywsh-snippet-share-item__adopt:hover,
.ywsh-snippet-share-item__adopt:focus-visible {
  border-color: var(--ywsh-card-accent, #4a7ec9);
  background: #eff6ff;
}
.ywsh-snippet-share-item__adopt.is-adopted {
  opacity: 0.55;
  cursor: default;
}
.ywsh-snippet-share-item__adopt .ywsh-icon {
  width: 0.95rem;
  height: 0.95rem;
  fill: currentColor;
}
.ywsh-snippet-share-item.is-just-adopted {
  animation: ywsh-snippet-adopt-pulse 1.1s ease;
}
.ywsh-snippet-share-item.is-adopted {
  background: rgba(34, 197, 94, 0.12);
}
@keyframes ywsh-snippet-adopt-pulse {
  0% {
    background: rgba(34, 197, 94, 0);
    box-shadow: inset 0 0 0 0 rgba(34, 197, 94, 0);
  }
  35% {
    background: rgba(34, 197, 94, 0.28);
    box-shadow: inset 0 0 0 2px rgba(34, 197, 94, 0.55);
  }
  100% {
    background: rgba(34, 197, 94, 0.12);
    box-shadow: inset 0 0 0 0 rgba(34, 197, 94, 0);
  }
}
.ywsh-snippets-list__share.is-shared {
  color: #1d4ed8;
  border-color: #93c5fd;
  background: #eff6ff;
}
.ywsh-snippets-share-panel {
  padding: 0.75rem 0;
}
