:root,
html[data-theme="sunset"] {
  color-scheme: dark;
  --bg: #12090d;
  --bg-soft: #211016;
  --surface: rgba(33, 16, 22, 0.86);
  --surface-strong: #2b151c;
  --surface-hover: rgba(48, 22, 29, 0.97);
  --border: rgba(253, 186, 116, 0.2);
  --border-strong: rgba(249, 115, 22, 0.56);
  --control-border: var(--border);
  --accent: #c2410c;
  --accent-light: #fdba74;
  --accent-rgb: 194 65 12;
  --accent-gradient-end: #be123c;
  --accent-hover: #9a3412;
  --accent-hover-end: #9f1239;
  --cyan: #fbbf24;
  --cyan-rgb: 251 191 36;
  --green: #4ade80;
  --green-rgb: 74 222 128;
  --gold: #fbbf24;
  --red: #fb7185;
  --text: #fff7ed;
  --text-soft: #d9c2b8;
  --text-muted: #a78b7d;
  --shadow: 0 22px 64px rgba(0, 0, 0, 0.38);
  --header-bg: rgba(18, 9, 13, 0.92);
  --panel-bg: rgba(33, 16, 22, 0.78);
  --media-start: #30161b;
  --media-end: #522017;
  --media-deep: rgba(33, 16, 22, 0.94);
  --media-overlay: rgba(18, 9, 13, 0.86);
  --radius: 14px;
  --radius-small: 8px;
  --content: 1200px;
  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

html[data-theme="aurora"] {
  color-scheme: dark;
  --bg: #080a1a;
  --bg-soft: #11142b;
  --surface: rgba(17, 20, 43, 0.86);
  --surface-strong: #191d3b;
  --surface-hover: rgba(30, 34, 68, 0.97);
  --border: rgba(196, 181, 253, 0.2);
  --border-strong: rgba(99, 102, 241, 0.58);
  --accent: #4f46e5;
  --accent-light: #c4b5fd;
  --accent-rgb: 79 70 229;
  --accent-gradient-end: #7e22ce;
  --accent-hover: #4338ca;
  --accent-hover-end: #6b21a8;
  --cyan: #22d3ee;
  --cyan-rgb: 34 211 238;
  --green: #34d399;
  --green-rgb: 52 211 153;
  --gold: #fbbf24;
  --red: #fb7185;
  --text: #f4f3ff;
  --text-soft: #c7c5e2;
  --text-muted: #9290b1;
  --shadow: 0 22px 64px rgba(0, 0, 0, 0.36);
  --header-bg: rgba(8, 10, 26, 0.92);
  --panel-bg: rgba(17, 20, 43, 0.78);
  --media-start: #171a3a;
  --media-end: #30205a;
  --media-deep: rgba(17, 20, 43, 0.94);
  --media-overlay: rgba(8, 10, 26, 0.86);
}

html[data-theme="ocean"] {
  color-scheme: dark;
  --bg: #03131d;
  --bg-soft: #072331;
  --surface: rgba(7, 35, 49, 0.86);
  --surface-strong: #0a3042;
  --surface-hover: rgba(12, 52, 70, 0.97);
  --border: rgba(125, 211, 252, 0.2);
  --border-strong: rgba(14, 165, 233, 0.58);
  --accent: #0369a1;
  --accent-light: #7dd3fc;
  --accent-rgb: 3 105 161;
  --accent-gradient-end: #0e7490;
  --accent-hover: #075985;
  --accent-hover-end: #155e75;
  --cyan: #2dd4bf;
  --cyan-rgb: 45 212 191;
  --green: #34d399;
  --green-rgb: 52 211 153;
  --gold: #fbbf24;
  --red: #fb7185;
  --text: #f0f9ff;
  --text-soft: #bad7e5;
  --text-muted: #86a9ba;
  --shadow: 0 22px 64px rgba(0, 0, 0, 0.36);
  --header-bg: rgba(3, 19, 29, 0.92);
  --panel-bg: rgba(7, 35, 49, 0.78);
  --media-start: #0a2c3b;
  --media-end: #0c4a55;
  --media-deep: rgba(7, 35, 49, 0.94);
  --media-overlay: rgba(3, 19, 29, 0.86);
}

html[data-theme="forest"] {
  color-scheme: dark;
  --bg: #06120f;
  --bg-soft: #0b2119;
  --surface: rgba(11, 33, 25, 0.84);
  --surface-strong: #102c22;
  --surface-hover: rgba(15, 44, 34, 0.96);
  --border: rgba(16, 185, 129, 0.24);
  --border-strong: rgba(16, 185, 129, 0.56);
  --accent: #047857;
  --accent-light: #6ee7b7;
  --accent-rgb: 16 185 129;
  --accent-gradient-end: #0f766e;
  --accent-hover: #065f46;
  --accent-hover-end: #115e59;
  --cyan: #2dd4bf;
  --cyan-rgb: 45 212 191;
  --green: #34d399;
  --green-rgb: 52 211 153;
  --gold: #fbbf24;
  --red: #fb7185;
  --text: #e5f7ef;
  --text-soft: #adcdbf;
  --text-muted: #83a694;
  --shadow: 0 22px 64px rgba(0, 0, 0, 0.36);
  --header-bg: rgba(6, 18, 15, 0.91);
  --panel-bg: rgba(11, 33, 25, 0.74);
  --media-start: #0d2a20;
  --media-end: #164536;
  --media-deep: rgba(11, 33, 25, 0.92);
  --media-overlay: rgba(6, 18, 15, 0.84);
}

html[data-theme="graphite"] {
  color-scheme: dark;
  --bg: #090b0f;
  --bg-soft: #11151b;
  --surface: rgba(17, 21, 27, 0.88);
  --surface-strong: #181e27;
  --surface-hover: rgba(29, 36, 47, 0.98);
  --border: rgba(203, 213, 225, 0.18);
  --border-strong: rgba(100, 116, 139, 0.62);
  --accent: #475569;
  --accent-light: #cbd5e1;
  --accent-rgb: 71 85 105;
  --accent-gradient-end: #334155;
  --accent-hover: #334155;
  --accent-hover-end: #1e293b;
  --cyan: #38bdf8;
  --cyan-rgb: 56 189 248;
  --green: #34d399;
  --green-rgb: 52 211 153;
  --gold: #fbbf24;
  --red: #fb7185;
  --text: #f8fafc;
  --text-soft: #cbd5e1;
  --text-muted: #94a3b8;
  --shadow: 0 22px 64px rgba(0, 0, 0, 0.4);
  --header-bg: rgba(9, 11, 15, 0.94);
  --panel-bg: rgba(17, 21, 27, 0.8);
  --media-start: #18202a;
  --media-end: #263446;
  --media-deep: rgba(17, 21, 27, 0.95);
  --media-overlay: rgba(9, 11, 15, 0.88);
}

html[data-theme="cobalt"] {
  color-scheme: dark;
  --bg: #050c20;
  --bg-soft: #091735;
  --surface: rgba(9, 23, 53, 0.87);
  --surface-strong: #10224b;
  --surface-hover: rgba(17, 39, 83, 0.98);
  --border: rgba(147, 197, 253, 0.2);
  --border-strong: rgba(59, 130, 246, 0.6);
  --accent: #1d4ed8;
  --accent-light: #93c5fd;
  --accent-rgb: 29 78 216;
  --accent-gradient-end: #3730a3;
  --accent-hover: #1e40af;
  --accent-hover-end: #312e81;
  --cyan: #22d3ee;
  --cyan-rgb: 34 211 238;
  --green: #34d399;
  --green-rgb: 52 211 153;
  --gold: #fbbf24;
  --red: #fb7185;
  --text: #eff6ff;
  --text-soft: #c0d2ea;
  --text-muted: #849bb9;
  --shadow: 0 22px 64px rgba(0, 0, 0, 0.38);
  --header-bg: rgba(5, 12, 32, 0.93);
  --panel-bg: rgba(9, 23, 53, 0.8);
  --media-start: #0d2147;
  --media-end: #153878;
  --media-deep: rgba(9, 23, 53, 0.95);
  --media-overlay: rgba(5, 12, 32, 0.87);
}

html[data-theme="amethyst"] {
  color-scheme: dark;
  --bg: #12091b;
  --bg-soft: #21102f;
  --surface: rgba(33, 16, 47, 0.87);
  --surface-strong: #2a163b;
  --surface-hover: rgba(48, 24, 67, 0.98);
  --border: rgba(216, 180, 254, 0.2);
  --border-strong: rgba(147, 51, 234, 0.58);
  --accent: #6d28d9;
  --accent-light: #d8b4fe;
  --accent-rgb: 109 40 217;
  --accent-gradient-end: #be185d;
  --accent-hover: #5b21b6;
  --accent-hover-end: #9d174d;
  --cyan: #67e8f9;
  --cyan-rgb: 103 232 249;
  --green: #4ade80;
  --green-rgb: 74 222 128;
  --gold: #fbbf24;
  --red: #fb7185;
  --text: #faf5ff;
  --text-soft: #dcc9e8;
  --text-muted: #aa8eba;
  --shadow: 0 22px 64px rgba(0, 0, 0, 0.38);
  --header-bg: rgba(18, 9, 27, 0.93);
  --panel-bg: rgba(33, 16, 47, 0.8);
  --media-start: #2b1740;
  --media-end: #51204a;
  --media-deep: rgba(33, 16, 47, 0.95);
  --media-overlay: rgba(18, 9, 27, 0.87);
}

html[data-theme="crimson"] {
  color-scheme: dark;
  --bg: #17070b;
  --bg-soft: #290d14;
  --surface: rgba(41, 13, 20, 0.87);
  --surface-strong: #38121c;
  --surface-hover: rgba(58, 19, 29, 0.98);
  --border: rgba(253, 164, 175, 0.2);
  --border-strong: rgba(225, 29, 72, 0.58);
  --accent: #be123c;
  --accent-light: #fda4af;
  --accent-rgb: 190 18 60;
  --accent-gradient-end: #991b1b;
  --accent-hover: #9f1239;
  --accent-hover-end: #7f1d1d;
  --cyan: #fbbf24;
  --cyan-rgb: 251 191 36;
  --green: #4ade80;
  --green-rgb: 74 222 128;
  --gold: #fbbf24;
  --red: #fb7185;
  --text: #fff1f2;
  --text-soft: #e8c2c7;
  --text-muted: #b68a91;
  --shadow: 0 22px 64px rgba(0, 0, 0, 0.4);
  --header-bg: rgba(23, 7, 11, 0.93);
  --panel-bg: rgba(41, 13, 20, 0.8);
  --media-start: #39111b;
  --media-end: #631824;
  --media-deep: rgba(41, 13, 20, 0.95);
  --media-overlay: rgba(23, 7, 11, 0.87);
}

html[data-theme="amber"] {
  color-scheme: dark;
  --bg: #171006;
  --bg-soft: #281b08;
  --surface: rgba(40, 27, 8, 0.88);
  --surface-strong: #38260c;
  --surface-hover: rgba(58, 39, 12, 0.98);
  --border: rgba(253, 230, 138, 0.2);
  --border-strong: rgba(217, 119, 6, 0.6);
  --accent: #b45309;
  --accent-light: #fde68a;
  --accent-rgb: 180 83 9;
  --accent-gradient-end: #92400e;
  --accent-hover: #92400e;
  --accent-hover-end: #78350f;
  --cyan: #facc15;
  --cyan-rgb: 250 204 21;
  --green: #4ade80;
  --green-rgb: 74 222 128;
  --gold: #fbbf24;
  --red: #fb7185;
  --text: #fffbeb;
  --text-soft: #ead7ad;
  --text-muted: #bba477;
  --shadow: 0 22px 64px rgba(0, 0, 0, 0.4);
  --header-bg: rgba(23, 16, 6, 0.93);
  --panel-bg: rgba(40, 27, 8, 0.8);
  --media-start: #38270d;
  --media-end: #654514;
  --media-deep: rgba(40, 27, 8, 0.95);
  --media-overlay: rgba(23, 16, 6, 0.87);
}

html[data-theme="teal"] {
  color-scheme: dark;
  --bg: #041514;
  --bg-soft: #082724;
  --surface: rgba(8, 39, 36, 0.88);
  --surface-strong: #0d3430;
  --surface-hover: rgba(14, 56, 52, 0.98);
  --border: rgba(153, 246, 228, 0.2);
  --border-strong: rgba(20, 184, 166, 0.58);
  --accent: #0f766e;
  --accent-light: #99f6e4;
  --accent-rgb: 15 118 110;
  --accent-gradient-end: #155e75;
  --accent-hover: #115e59;
  --accent-hover-end: #164e63;
  --cyan: #22d3ee;
  --cyan-rgb: 34 211 238;
  --green: #4ade80;
  --green-rgb: 74 222 128;
  --gold: #fbbf24;
  --red: #fb7185;
  --text: #f0fdfa;
  --text-soft: #b9ddd6;
  --text-muted: #82aaa3;
  --shadow: 0 22px 64px rgba(0, 0, 0, 0.38);
  --header-bg: rgba(4, 21, 20, 0.93);
  --panel-bg: rgba(8, 39, 36, 0.8);
  --media-start: #0b3531;
  --media-end: #0e5558;
  --media-deep: rgba(8, 39, 36, 0.95);
  --media-overlay: rgba(4, 21, 20, 0.87);
}

html[data-theme="paper"] {
  color-scheme: light;
  --bg: #f6f7fb;
  --bg-soft: #eef1f6;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --surface-hover: #ffffff;
  --border: rgba(15, 23, 42, 0.14);
  --border-strong: rgba(29, 78, 216, 0.5);
  --control-border: rgba(15, 23, 42, 0.48);
  --accent: #1d4ed8;
  --accent-light: #1d4ed8;
  --accent-rgb: 29 78 216;
  --accent-gradient-end: #3730a3;
  --accent-hover: #1e40af;
  --accent-hover-end: #312e81;
  --cyan: #0369a1;
  --cyan-rgb: 3 105 161;
  --green: #047857;
  --green-rgb: 4 120 87;
  --gold: #b45309;
  --red: #be123c;
  --text: #0f172a;
  --text-soft: #334155;
  --text-muted: #526078;
  --shadow: 0 22px 56px rgba(15, 23, 42, 0.16);
  --header-bg: rgba(246, 247, 251, 0.93);
  --panel-bg: rgba(255, 255, 255, 0.8);
  --media-start: #e7ecf5;
  --media-end: #d8e2f0;
  --media-deep: rgba(238, 241, 246, 0.96);
  --media-overlay: rgba(15, 23, 42, 0.74);
}

html[data-theme="sandstone"] {
  color-scheme: light;
  --bg: #fbf7f0;
  --bg-soft: #f3ebdd;
  --surface: rgba(255, 253, 248, 0.92);
  --surface-strong: #fffdf8;
  --surface-hover: #ffffff;
  --border: rgba(68, 64, 60, 0.16);
  --border-strong: rgba(146, 64, 14, 0.5);
  --control-border: rgba(68, 64, 60, 0.58);
  --accent: #92400e;
  --accent-light: #92400e;
  --accent-rgb: 146 64 14;
  --accent-gradient-end: #9f1239;
  --accent-hover: #78350f;
  --accent-hover-end: #881337;
  --cyan: #0f766e;
  --cyan-rgb: 15 118 110;
  --green: #047857;
  --green-rgb: 4 120 87;
  --gold: #a16207;
  --red: #be123c;
  --text: #1c1917;
  --text-soft: #44403c;
  --text-muted: #65584b;
  --shadow: 0 22px 56px rgba(68, 44, 24, 0.16);
  --header-bg: rgba(251, 247, 240, 0.94);
  --panel-bg: rgba(255, 253, 248, 0.82);
  --media-start: #eee1cf;
  --media-end: #e4c9ac;
  --media-deep: rgba(243, 235, 221, 0.96);
  --media-overlay: rgba(28, 25, 23, 0.74);
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.dialog-open {
  overflow: hidden;
}

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

button,
select {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
}

img,
svg {
  display: block;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

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

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-small);
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.16s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.ambient {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
}

.ambient-a {
  top: -28vw;
  left: -18vw;
  width: 70vw;
  height: 70vw;
  background: radial-gradient(circle, rgb(var(--accent-rgb) / 0.1), transparent 68%);
}

.ambient-b {
  right: -18vw;
  bottom: -28vw;
  width: 62vw;
  height: 62vw;
  background: radial-gradient(circle, rgb(var(--cyan-rgb) / 0.065), transparent 68%);
}

.site-header {
  position: sticky;
  z-index: 160;
  top: 0;
  height: 62px;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
}

.top-nav {
  display: flex;
  width: 100%;
  max-width: calc(var(--content) + 56px);
  height: 100%;
  padding: 0 28px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.025em;
  text-decoration: none;
  white-space: nowrap;
}

.brand em {
  color: var(--accent-light);
  font-style: normal;
}

.brand-mark {
  display: inline-flex;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-gradient-end));
  box-shadow: 0 0 24px rgb(var(--accent-rgb) / 0.28);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.nav-actions,
.sync-actions,
.toolbar-actions,
.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.theme-picker {
  position: relative;
}

.theme-trigger {
  position: relative;
  display: inline-flex;
  width: 42px;
  height: 42px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--control-border);
  border-radius: 11px;
  background: rgb(var(--accent-rgb) / 0.08);
  color: var(--text-soft);
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.theme-trigger:hover,
.theme-trigger[aria-expanded="true"] {
  border-color: var(--border-strong);
  background: rgb(var(--accent-rgb) / 0.16);
  color: var(--text);
  transform: translateY(-1px);
}

.theme-trigger-indicator {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--header-bg);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  box-shadow: 0 0 0 1px var(--border-strong);
}

.theme-menu {
  position: absolute;
  z-index: 180;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  padding: 16px;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--surface-strong);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.42);
}

.theme-menu-header {
  display: flex;
  margin-bottom: 13px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.theme-menu-header p,
.theme-menu-header h2 {
  margin: 0;
}

.theme-menu-header p {
  margin-bottom: 3px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.theme-menu-header h2 {
  color: var(--text);
  font-size: 15px;
  letter-spacing: -0.01em;
}

.theme-menu-header > span {
  color: var(--accent-light);
  font-size: 12px;
  font-weight: 750;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.theme-option {
  display: grid;
  min-height: 46px;
  padding: 7px 9px;
  align-items: center;
  grid-template-columns: 27px minmax(0, 1fr) 18px;
  gap: 8px;
  border: 1px solid var(--control-border);
  border-radius: 10px;
  background: rgb(var(--accent-rgb) / 0.035);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.theme-option:hover {
  border-color: var(--border-strong);
  background: rgb(var(--accent-rgb) / 0.1);
  color: var(--text);
  transform: translateY(-1px);
}

.theme-option.is-active {
  border-color: var(--accent);
  background: rgb(var(--accent-rgb) / 0.16);
  color: var(--text);
}

.theme-swatch {
  width: 27px;
  height: 27px;
  border: 2px solid rgba(255, 255, 255, 0.68);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--swatch-a), var(--swatch-b));
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.24), inset 0 0 12px rgba(255, 255, 255, 0.12);
}

.theme-check {
  color: var(--accent-light);
  font-size: 13px;
  font-weight: 900;
  opacity: 0;
  text-align: center;
}

.theme-option.is-active .theme-check {
  opacity: 1;
}

[data-swatch="sunset"] { --swatch-a: #c2410c; --swatch-b: #be123c; }
[data-swatch="ocean"] { --swatch-a: #0369a1; --swatch-b: #0f766e; }
[data-swatch="aurora"] { --swatch-a: #4f46e5; --swatch-b: #7e22ce; }
[data-swatch="forest"] { --swatch-a: #047857; --swatch-b: #0f766e; }
[data-swatch="graphite"] { --swatch-a: #475569; --swatch-b: #111827; }
[data-swatch="cobalt"] { --swatch-a: #1d4ed8; --swatch-b: #3730a3; }
[data-swatch="amethyst"] { --swatch-a: #6d28d9; --swatch-b: #be185d; }
[data-swatch="crimson"] { --swatch-a: #be123c; --swatch-b: #7f1d1d; }
[data-swatch="amber"] { --swatch-a: #b45309; --swatch-b: #facc15; }
[data-swatch="teal"] { --swatch-a: #0f766e; --swatch-b: #22d3ee; }
[data-swatch="paper"] { --swatch-a: #f8fafc; --swatch-b: #1d4ed8; }
[data-swatch="sandstone"] { --swatch-a: #fbf7f0; --swatch-b: #92400e; }

.button {
  display: inline-flex;
  min-height: 38px;
  padding: 8px 14px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-small);
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.button:hover {
  border-color: var(--border-strong);
  background: rgb(var(--accent-rgb) / 0.1);
  color: var(--text);
}

.button-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-gradient-end));
  box-shadow: 0 8px 28px rgb(var(--accent-rgb) / 0.25);
  color: #fff;
}

.button-primary:hover {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-hover), var(--accent-hover-end));
  box-shadow: 0 10px 34px rgb(var(--accent-rgb) / 0.38);
  color: #fff;
  transform: translateY(-1px);
}

.button-compact {
  min-height: 34px;
  padding: 6px 11px;
  color: var(--text-soft);
  font-size: 12px;
}

.button-compact.is-loading svg {
  animation: spin 0.75s linear infinite;
}

.button:disabled {
  opacity: 0.55;
  transform: none;
}

.sync-strip {
  position: relative;
  z-index: 2;
  display: flex;
  width: 100%;
  max-width: var(--content);
  min-height: 44px;
  padding: 8px 24px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
}

.sync-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.sync-message {
  min-width: 0;
  color: var(--text-soft);
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgb(var(--green-rgb) / 0.08);
}

.status-dot.is-loading {
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.08);
  animation: pulse 1.5s ease-in-out infinite;
}

.status-dot.is-error {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.08);
}

.status-dot.is-stale {
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.08);
}

.api-badge {
  flex: 0 0 auto;
  padding: 3px 8px;
  border: 1px solid rgb(var(--cyan-rgb) / 0.25);
  border-radius: 999px;
  background: rgb(var(--cyan-rgb) / 0.08);
  color: var(--cyan);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.03em;
}

.sync-time {
  white-space: nowrap;
}

main,
.site-footer {
  position: relative;
  z-index: 1;
}

.hero {
  padding: 52px 24px 42px;
  text-align: center;
}

.hero-pill {
  display: inline-flex;
  padding: 6px 15px;
  margin: 0 0 22px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgb(var(--accent-rgb) / 0.32);
  border-radius: 999px;
  background: rgb(var(--accent-rgb) / 0.075);
  color: var(--accent-light);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.055em;
}

.hero-pill span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  animation: pulse 2s ease-in-out infinite;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 1.04;
}

.hero h1 span {
  color: var(--text);
}

.hero h1 strong {
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  background-clip: text;
  color: transparent;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  max-width: 590px;
  margin: 0 auto 34px;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.7;
}

.hero-subtitle em {
  color: var(--accent-light);
  font-style: normal;
}

.stats {
  display: grid;
  width: min(720px, 100%);
  padding: 0;
  margin: 0 auto;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats div {
  min-width: 0;
  padding: 0 18px;
}

.stats div + div {
  border-left: 1px solid var(--border);
}

.stats dd {
  margin: 0;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent-light), var(--cyan));
  background-clip: text;
  color: transparent;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 850;
  letter-spacing: -0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stats dt {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.catalog {
  width: 100%;
  max-width: var(--content);
  padding: 0 24px 88px;
  margin: 0 auto;
}

.filters {
  margin-bottom: 22px;
}

.search-row {
  display: grid;
  margin-bottom: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.search-wrap {
  position: relative;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 15px;
  color: var(--text-muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.search-wrap input {
  width: 100%;
  height: 50px;
  padding: 0 88px 0 45px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
  outline: 0;
  background: var(--surface);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.search-wrap input::placeholder {
  color: var(--text-muted);
}

.search-wrap input:hover {
  border-color: rgb(var(--accent-rgb) / 0.38);
}

.search-wrap input:focus,
.select-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgb(var(--accent-rgb) / 0.14);
}

.search-wrap input:focus-visible,
.select-field select:focus-visible {
  outline: 0;
}

.search-wrap kbd {
  position: absolute;
  top: 50%;
  right: 13px;
  padding: 3px 7px;
  border: 1px solid var(--control-border);
  border-radius: 5px;
  background: rgb(var(--accent-rgb) / 0.06);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 11px;
  transform: translateY(-50%);
}

.select-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.select-field label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.select-field select {
  min-width: 112px;
  height: 50px;
  padding: 0 36px 0 13px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-small);
  outline: 0;
  background-color: var(--surface);
  background-image: linear-gradient(45deg, transparent 50%, var(--text-soft) 50%), linear-gradient(135deg, var(--text-soft) 50%, transparent 50%);
  background-position: calc(100% - 17px) 21px, calc(100% - 12px) 21px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  color: var(--text);
  font-size: 13px;
  -webkit-appearance: none;
  appearance: none;
}

.advanced-toggle,
.clear-filters {
  display: inline-flex;
  min-height: 38px;
  padding: 7px 12px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-small);
  background: transparent;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.advanced-toggle:hover,
.advanced-toggle[aria-expanded="true"],
.clear-filters:hover {
  border-color: var(--border-strong);
  background: rgb(var(--accent-rgb) / 0.1);
  color: var(--accent-light);
}

.filter-count {
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 10px;
}

.advanced-panel {
  display: grid;
  padding: 16px;
  margin: 10px 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-bg);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

fieldset {
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}

.advanced-panel legend {
  margin-bottom: 8px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.045em;
}

.filter-note {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.filter-chips,
.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chip,
.category-chip {
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--control-border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.category-chip {
  min-height: 40px;
  padding: 8px 15px;
  font-size: 13px;
}

.filter-chip:hover,
.category-chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
  transform: translateY(-1px);
}

.filter-chip.is-active {
  border-color: var(--accent);
  background: rgb(var(--accent-rgb) / 0.18);
  color: var(--accent-light);
}

.category-chip.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
  box-shadow: 0 8px 22px rgb(var(--accent-rgb) / 0.22);
}

.chip-count {
  margin-left: 5px;
  opacity: 0.72;
  font-size: 10px;
}

.advanced-panel .clear-filters {
  align-self: end;
  justify-self: start;
}

.category-fieldset {
  margin: 0 0 15px;
}

.catalog-toolbar {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.result-summary {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.result-summary strong {
  color: var(--text-soft);
}

.compact-select select {
  height: 40px;
  background-position: calc(100% - 17px) 16px, calc(100% - 12px) 16px;
}

.view-switcher {
  display: flex;
  padding: 3px;
  align-items: center;
  gap: 3px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-small);
  background: var(--surface-strong);
}

.view-button {
  display: inline-flex;
  width: 36px;
  height: 34px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  transition: color 0.18s ease, background 0.18s ease;
}

.view-button:hover {
  color: var(--text);
}

.view-button.is-active {
  background: var(--accent);
  color: white;
}

.results {
  scroll-margin-top: 80px;
}

.results[aria-busy="true"] .plugin-grid:not([hidden]) {
  opacity: 0.56;
}

.skeleton-grid,
.plugin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  transition: opacity 0.18s ease;
}

.skeleton-card {
  position: relative;
  min-height: 320px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.skeleton-card::before,
.skeleton-card::after {
  position: absolute;
  content: "";
}

.skeleton-card::before {
  inset: 20px;
  border-radius: 8px;
  background: repeating-linear-gradient(to bottom, rgba(148, 163, 184, 0.075) 0 13px, transparent 13px 32px);
}

.skeleton-card::after {
  inset: 0;
  background: linear-gradient(90deg, transparent, rgb(var(--accent-rgb) / 0.09), transparent);
  animation: shimmer 1.45s linear infinite;
  transform: translateX(-100%);
}

.plugin-grid.view-gallery {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.plugin-grid.view-list {
  grid-template-columns: 1fr;
  gap: 8px;
}

.plugin-card {
  position: relative;
  display: flex;
  min-width: 0;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.plugin-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.plugin-card.is-top-one {
  border-color: rgba(251, 191, 36, 0.45);
}

.plugin-card.is-top-two {
  border-color: rgba(168, 181, 201, 0.42);
}

.plugin-card.is-top-three {
  border-color: rgba(249, 115, 22, 0.38);
}

.plugin-content {
  display: flex;
  min-width: 0;
  height: 100%;
  padding: 20px;
  flex-direction: column;
  gap: 13px;
}

.plugin-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 2 / 1;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--media-start), var(--media-end));
}

.plugin-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.32s ease;
}

.plugin-media img.is-avatar {
  padding: clamp(18px, 5%, 34px);
  background: radial-gradient(circle at center, rgb(var(--accent-rgb) / 0.2), transparent 62%);
  object-fit: contain;
}

.plugin-card:hover .plugin-media img {
  transform: scale(1.035);
}

.image-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 10%, rgb(var(--cyan-rgb) / 0.16), transparent 36%), linear-gradient(135deg, rgb(var(--accent-rgb) / 0.28), var(--media-deep));
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 800;
  text-transform: uppercase;
}

.plugin-media.has-image .image-placeholder {
  display: none;
}

.media-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 45%, var(--media-overlay));
  pointer-events: none;
}

.media-rank {
  position: absolute;
  bottom: 12px;
  left: 14px;
}

.plugin-heading {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 12px;
}

.plugin-title-group {
  min-width: 0;
  flex: 1;
}

.plugin-name-row {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.badges {
  display: contents;
}

.plugin-badge-group {
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
  flex: 0 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.plugin-name {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  flex: 0 1 auto;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 16px;
  font-weight: 780;
  letter-spacing: -0.018em;
  line-height: 1.35;
}

.plugin-title-link {
  color: inherit;
  text-decoration: none;
}

.plugin-title-link:hover {
  color: var(--accent-light);
}

.owner-line {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.owner-line a {
  color: var(--text-soft);
  text-decoration: none;
}

.owner-line a:hover,
.site-footer a:hover,
.dialog-link:hover {
  color: var(--cyan);
  text-decoration: underline;
}

.rank-badge {
  display: inline-flex;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgb(var(--accent-rgb) / 0.11);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 800;
}

.rank-badge.gold {
  background: rgba(251, 191, 36, 0.15);
  color: var(--gold);
}

.rank-badge.silver {
  background: rgba(168, 181, 201, 0.14);
  color: #cbd5e1;
}

.rank-badge.bronze {
  background: rgba(249, 115, 22, 0.14);
  color: #fb923c;
}

html[data-theme="paper"] .plugin-content .rank-badge.silver,
html[data-theme="sandstone"] .plugin-content .rank-badge.silver {
  background: rgba(51, 65, 85, 0.12);
  color: #334155;
}

html[data-theme="paper"] .plugin-content .rank-badge.bronze,
html[data-theme="sandstone"] .plugin-content .rank-badge.bronze {
  background: rgba(154, 52, 18, 0.11);
  color: #9a3412;
}

.media-rank .rank-badge {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(15, 23, 42, 0.86);
  color: #fff;
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.28);
}

.media-rank .rank-badge.gold {
  background: rgba(113, 63, 18, 0.9);
  color: #fde68a;
}

.media-rank .rank-badge.silver {
  background: rgba(30, 41, 59, 0.9);
  color: #f8fafc;
}

.media-rank .rank-badge.bronze {
  background: rgba(124, 45, 18, 0.9);
  color: #fed7aa;
}

.badge {
  display: inline-flex;
  min-height: 24px;
  padding: 3px 8px;
  align-items: center;
  max-width: 100%;
  flex: 0 0 auto;
  border: 1px solid rgb(var(--accent-rgb) / 0.2);
  border-radius: 999px;
  background: rgb(var(--accent-rgb) / 0.1);
  color: var(--accent-light);
  font-size: 10.5px;
  font-weight: 720;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge-language {
  border-color: rgb(var(--cyan-rgb) / 0.22);
  background: rgb(var(--cyan-rgb) / 0.09);
  color: var(--cyan);
}

.badge-verified {
  border-color: rgb(var(--green-rgb) / 0.24);
  background: rgb(var(--green-rgb) / 0.1);
  color: var(--green);
}

.plugin-description {
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  color: var(--text);
  font-size: 13px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.plugin-description-secondary {
  margin: -6px 0 0;
  overflow: hidden;
  display: -webkit-box;
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.plugin-stats {
  display: flex;
  min-width: 0;
  margin: 0;
  flex-wrap: wrap;
  gap: 8px 15px;
}

.plugin-stats div {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.plugin-stats dt {
  color: var(--text-muted);
  font-size: 11px;
}

.plugin-stats dd {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
}

.install-command,
.command-box {
  display: flex;
  min-width: 0;
  padding: 10px 10px 10px 12px;
  align-items: center;
  gap: 10px;
  border: 1px solid rgb(var(--accent-rgb) / 0.2);
  border-radius: var(--radius-small);
  background: var(--bg-soft);
}

.install-command code,
.command-box code {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-button {
  min-height: 34px;
  padding: 6px 10px;
  flex: 0 0 auto;
  border: 1px solid var(--control-border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.copy-button:hover {
  border-color: var(--accent);
  background: rgb(var(--accent-rgb) / 0.12);
  color: var(--accent-light);
}

.copy-button.is-copied {
  border-color: var(--green);
  color: var(--green);
}

.plugin-footer {
  display: flex;
  margin-top: auto;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.updated-at {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.4;
}

.card-link,
.card-action {
  display: inline-flex;
  min-height: 36px;
  padding: 7px 10px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--control-border);
  border-radius: 7px;
  background: transparent;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.card-link:hover,
.card-action:hover {
  border-color: var(--accent);
  background: rgb(var(--accent-rgb) / 0.1);
  color: var(--accent-light);
}

.card-action.primary-action {
  border-color: rgb(var(--accent-rgb) / 0.42);
  color: var(--accent-light);
}

.gallery-card .plugin-content {
  padding: 17px;
}

.gallery-card .plugin-description {
  -webkit-line-clamp: 2;
}

.gallery-card .rank-badge {
  width: 36px;
  height: 36px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.list-card {
  min-height: 74px;
  flex-direction: row;
  align-items: center;
}

.list-card .plugin-content {
  display: grid;
  padding: 12px 15px;
  align-items: center;
  grid-template-columns: minmax(210px, 1fr) minmax(230px, 1.35fr) auto auto;
  gap: 14px;
}

.list-card .plugin-heading {
  align-items: center;
}

.list-card .rank-badge {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.list-card .plugin-name {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-card .owner-line {
  display: none;
}

.list-card .plugin-description {
  display: block;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-card .plugin-stats {
  flex-wrap: nowrap;
}

.list-card .plugin-stats div:nth-child(n + 3) {
  display: none;
}

.list-card .card-actions {
  flex-wrap: nowrap;
}

.inline-error,
.empty-state {
  padding: 42px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-bg);
  text-align: center;
}

.inline-error {
  display: grid;
  margin-bottom: 18px;
  align-items: center;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  text-align: left;
}

.state-icon {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(251, 113, 133, 0.32);
  border-radius: 50%;
  background: rgba(251, 113, 133, 0.1);
  color: var(--red);
  font-weight: 900;
}

.inline-error h3,
.empty-state h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 16px;
}

.inline-error p,
.empty-state p {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.55;
}

.empty-state {
  padding-block: 72px;
}

.empty-state svg {
  margin: 0 auto 16px;
  color: var(--text-muted);
}

.empty-state .button {
  margin-top: 20px;
}

.pagination {
  display: flex;
  margin-top: 28px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.page-button,
.page-ellipsis {
  display: inline-flex;
  min-width: 40px;
  min-height: 40px;
  padding: 7px 10px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--control-border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
}

.page-button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--text);
}

.page-button.is-current {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.page-button:disabled {
  opacity: 0.42;
}

.page-ellipsis {
  border-color: transparent;
  background: transparent;
}

.install-dialog {
  width: min(620px, calc(100% - 32px));
  max-height: min(86vh, 780px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 17px;
  background: var(--bg-soft);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.64);
  color: var(--text);
}

.install-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.dialog-header {
  display: flex;
  padding: 19px 22px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

.dialog-eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dialog-header h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 17px;
}

.dialog-close {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--control-border);
  border-radius: 9px;
  background: transparent;
  color: var(--text-soft);
  font-size: 22px;
  line-height: 1;
}

.dialog-close:hover {
  border-color: var(--accent);
  color: var(--text);
}

.dialog-body {
  max-height: calc(min(86vh, 780px) - 82px);
  padding: 20px 22px 24px;
  overflow: auto;
  overscroll-behavior: contain;
}

.dialog-description {
  margin: 0 0 16px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.65;
}

.dialog-meta {
  display: flex;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 7px;
}

.dialog-step-list {
  display: flex;
  margin: 0;
  padding: 0;
  flex-direction: column;
  gap: 17px;
  list-style: none;
}

.dialog-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
}

.step-number {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 12px;
  font-weight: 800;
}

.step-content {
  min-width: 0;
}

.step-content h3 {
  margin: 3px 0 7px;
  font-size: 13px;
}

.step-content p {
  margin: 0 0 9px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.55;
}

.command-box code {
  overflow: auto;
  text-overflow: clip;
  white-space: nowrap;
  scrollbar-width: thin;
}

.trust-note {
  padding: 12px 14px;
  margin-top: 19px;
  border: 1px solid rgb(var(--green-rgb) / 0.38);
  border-radius: var(--radius-small);
  background: rgb(var(--green-rgb) / 0.1);
  color: var(--green);
  font-size: 12px;
  line-height: 1.6;
}

.dialog-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--accent-light);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.contact-widget {
  position: fixed;
  z-index: 200;
  top: 50%;
  right: max(18px, env(safe-area-inset-right));
  transform: translateY(-50%);
}

.contact-trigger {
  display: inline-flex;
  width: 52px;
  min-height: 116px;
  padding: 12px 8px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: linear-gradient(160deg, var(--surface-strong), var(--bg-soft));
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.3);
  color: var(--accent-light);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.contact-trigger span {
  max-width: 1em;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.contact-trigger:hover,
.contact-trigger[aria-expanded="true"] {
  border-color: var(--accent-light);
  box-shadow: 0 18px 50px rgb(var(--accent-rgb) / 0.26);
  color: var(--cyan);
  transform: translateX(-2px);
}

.contact-panel {
  position: absolute;
  top: 50%;
  right: calc(100% + 12px);
  width: 420px;
  max-height: min(720px, calc(100dvh - 32px));
  padding: 18px;
  overflow-y: auto;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: var(--surface-strong);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
  transform: translateY(-50%);
}

.contact-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.contact-panel-header p,
.contact-panel-header h2,
.contact-intro,
.contact-card h3,
.contact-card p {
  margin: 0;
}

.contact-panel-header p {
  margin-bottom: 4px;
  color: var(--accent-light);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.18em;
}

.contact-panel-header h2 {
  color: var(--text);
  font-size: 18px;
  letter-spacing: -0.02em;
}

.contact-close {
  display: inline-flex;
  width: 36px;
  height: 36px;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid var(--control-border);
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
}

.contact-close:hover {
  border-color: var(--border-strong);
  background: rgb(var(--accent-rgb) / 0.1);
  color: var(--text);
}

.contact-intro {
  margin: 9px 0 15px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.55;
}

.contact-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.contact-card {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgb(var(--accent-rgb) / 0.045);
}

.contact-qr-link {
  display: block;
  padding: 8px;
  margin-bottom: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.contact-qr-link img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  background: #fff;
  object-fit: contain;
}

.contact-kind {
  display: inline-flex;
  min-height: 23px;
  padding: 3px 8px;
  align-items: center;
  border: 1px solid rgb(var(--accent-rgb) / 0.28);
  border-radius: 999px;
  background: rgb(var(--accent-rgb) / 0.1);
  color: var(--accent-light);
  font-size: 9px;
  font-weight: 800;
}

.contact-kind.is-personal {
  border-color: rgb(var(--cyan-rgb) / 0.26);
  background: rgb(var(--cyan-rgb) / 0.08);
  color: var(--cyan);
}

.contact-card h3 {
  margin-top: 8px;
  color: var(--text);
  font-size: 15px;
  letter-spacing: -0.01em;
}

.contact-card p {
  min-height: 38px;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.5;
}

.contact-hint,
.contact-copy {
  display: inline-flex;
  min-height: 34px;
  margin-top: 9px;
  align-items: center;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 750;
}

.contact-copy {
  padding: 7px 10px;
  border: 1px solid var(--control-border);
  border-radius: 8px;
  background: transparent;
}

.contact-copy:hover,
.contact-copy.is-copied {
  border-color: var(--accent);
  background: rgb(var(--accent-rgb) / 0.1);
  color: var(--accent-light);
}

.toast {
  position: fixed;
  z-index: 1000;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  max-width: min(360px, calc(100% - 36px));
  padding: 11px 15px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
}

.toast.is-error {
  border-color: rgba(251, 113, 133, 0.45);
}

.copy-fallback {
  position: fixed;
  top: 0;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.site-footer {
  display: flex;
  min-height: 90px;
  padding: 24px max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px 22px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.site-footer a {
  color: var(--text-soft);
  text-decoration: none;
}

.noscript-message {
  position: fixed;
  z-index: 1100;
  right: 16px;
  bottom: 16px;
  left: 16px;
  padding: 14px;
  border: 1px solid rgba(251, 113, 133, 0.4);
  border-radius: 10px;
  background: #341522;
  color: #fecdd3;
  text-align: center;
}

.not-found-page {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
}

.not-found {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  padding: clamp(30px, 7vw, 60px);
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.not-found-code {
  margin: 0;
  background: linear-gradient(135deg, var(--accent-light), var(--cyan));
  background-clip: text;
  color: transparent;
  font-size: clamp(72px, 18vw, 128px);
  font-weight: 900;
  letter-spacing: -0.08em;
  line-height: 0.9;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.not-found h1 {
  margin: 24px 0 10px;
  font-size: clamp(22px, 5vw, 30px);
}

.not-found p:not(.not-found-code) {
  margin: 0 0 24px;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.65;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.38; }
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 1299px) {
  .contact-widget {
    top: auto;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    transform: none;
  }

  .contact-trigger {
    width: 54px;
    height: 54px;
    min-height: 54px;
    padding: 0;
    border-radius: 50%;
  }

  .contact-trigger span {
    display: none;
  }

  .contact-trigger:hover,
  .contact-trigger[aria-expanded="true"] {
    transform: translateY(-2px);
  }

  .contact-panel {
    top: auto;
    right: 0;
    bottom: calc(100% + 12px);
    max-height: calc(100dvh - 100px - env(safe-area-inset-bottom));
    transform: none;
  }

  .toast {
    bottom: max(84px, calc(env(safe-area-inset-bottom) + 78px));
  }
}

@media (max-width: 1023px) {
  .skeleton-grid,
  .plugin-grid,
  .plugin-grid.view-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .advanced-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .list-card .plugin-content {
    grid-template-columns: minmax(200px, 1fr) minmax(150px, 1fr) auto;
  }

  .list-card .plugin-stats {
    display: none;
  }
}

@media (max-width: 767px) {
  .site-header {
    height: 58px;
  }

  .top-nav {
    padding-inline: 16px;
  }

  .theme-menu {
    position: fixed;
    top: 68px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100dvh - 80px);
    overflow-y: auto;
  }

  .sync-strip {
    padding-inline: 16px;
  }

  .hero {
    padding: 40px 16px 32px;
  }

  .catalog {
    padding-inline: 16px;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .scope-field {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .scope-field select {
    width: 100%;
  }

  .advanced-panel {
    grid-template-columns: 1fr;
  }

  .catalog-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-actions {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .skeleton-grid,
  .plugin-grid,
  .plugin-grid.view-gallery {
    grid-template-columns: 1fr;
  }

  .list-card {
    min-height: 0;
  }

  .list-card .plugin-content {
    display: flex;
    padding: 15px;
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .list-card .plugin-description {
    white-space: normal;
  }

  .list-card .card-actions {
    align-self: flex-end;
  }

  .inline-error {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .inline-error .button {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .contact-widget {
    top: auto;
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    transform: none;
  }

  .contact-trigger {
    width: 54px;
    height: 54px;
    min-height: 54px;
    padding: 0;
    border-radius: 50%;
  }

  .contact-trigger span {
    display: none;
  }

  .contact-trigger:hover,
  .contact-trigger[aria-expanded="true"] {
    transform: translateY(-2px);
  }

  .contact-panel {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: max(78px, calc(env(safe-area-inset-bottom) + 68px));
    left: 12px;
    width: auto;
    max-height: calc(100dvh - 96px - env(safe-area-inset-bottom));
    transform: none;
  }

  .contact-cards {
    grid-template-columns: 1fr;
  }

  .contact-card {
    display: grid;
    align-items: start;
    grid-template-columns: 136px minmax(0, 1fr);
    column-gap: 12px;
  }

  .contact-qr-link {
    margin: 0;
    grid-column: 1;
    grid-row: 1 / span 5;
  }

  .contact-kind,
  .contact-card h3,
  .contact-card p,
  .contact-hint,
  .contact-copy {
    grid-column: 2;
    justify-self: start;
  }

  .contact-card h3 {
    margin-top: 7px;
  }

  .contact-card p {
    min-height: 0;
  }

  .contact-copy {
    min-height: 40px;
  }

  .toast {
    bottom: max(82px, calc(env(safe-area-inset-bottom) + 76px));
  }
}

@media (max-width: 620px) {
  .nav-topics span {
    display: none;
  }

  .nav-topics {
    width: 42px;
    padding-inline: 0;
  }

  .sync-strip {
    padding-block: 10px;
    align-items: flex-start;
    flex-direction: column;
  }

  .sync-main {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .sync-actions {
    width: 100%;
    justify-content: space-between;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 0;
  }

  .stats div {
    padding: 14px 10px;
  }

  .stats div + div {
    border-left: 0;
  }

  .stats div:nth-child(even) {
    border-left: 1px solid var(--border);
  }

  .stats div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }

  .plugin-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .card-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .install-dialog {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
  }

  .dialog-body {
    max-height: calc(100dvh - 102px);
    padding-inline: 16px;
  }

  .dialog-header {
    padding-inline: 16px;
  }
}

@media (max-width: 479px) {
  .brand {
    gap: 7px;
    font-size: 14px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .nav-actions .button-primary {
    padding-inline: 10px;
  }

  .nav-topics {
    display: none;
  }

  .api-badge,
  .search-wrap kbd {
    display: none;
  }

  .search-wrap input {
    padding-right: 14px;
  }

  .hero h1 {
    font-size: 38px;
  }

  .hero-subtitle br {
    display: none;
  }

  .toolbar-actions {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .compact-select {
    display: grid;
    min-width: 0;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .compact-select select {
    width: 100%;
    min-width: 0;
  }

  .page-size-field {
    grid-column: 1 / -1;
  }

  .view-switcher {
    align-self: end;
    grid-column: 2;
    grid-row: 1;
  }

  .install-command,
  .command-box {
    align-items: stretch;
    flex-direction: column;
  }

  .install-command code,
  .command-box code {
    width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .copy-button {
    align-self: flex-start;
  }

  .inline-error {
    padding: 28px 18px;
  }

  .pagination {
    gap: 4px;
  }

  .page-button,
  .page-ellipsis {
    min-width: 38px;
  }

  .theme-menu {
    padding: 14px;
  }

  .theme-option {
    min-height: 44px;
    padding-inline: 7px;
    grid-template-columns: 25px minmax(0, 1fr) 14px;
    gap: 6px;
  }

  .theme-swatch {
    width: 25px;
    height: 25px;
  }

  .contact-panel {
    padding: 15px;
  }

  .contact-card {
    padding: 9px;
  }
}

@media (max-width: 359px) {
  .nav-topics {
    display: none;
  }

  .top-nav {
    padding-inline: 12px;
  }

  .brand > span:last-child {
    max-width: 116px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .category-chip,
  .filter-chip {
    padding-inline: 10px;
  }

  .contact-card {
    grid-template-columns: 124px minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
