  /* ============================================================================
   Icon Library — website
   Flat, timeless UI inspired by Streamline's layout.
   Design language: 8px rhythm, hairline borders, calm surfaces, one green
   accent + a near-black/near-white primary. Fully themed for light & dark.
   ========================================================================== */

  /* ---- Design tokens ------------------------------------------------------- */
  :root {
    --bg: #ffffff;
    --surface: #f3f3f5;
    --surface-2: #e7e7eb;
    --hover: #ececf0;
    --border: #dedee3;
    --border-strong: #c4c4cd;
    --text: #0f0f12;
    --text-2: #3f3f47;
    --muted: #71717b;
    --sidebar-text: #202024;
    --sidebar-muted: #5e5e66;
    --accent: #15a34a;
    --accent-2: #0f7a38;
    --accent-soft: rgba(21, 163, 74, .12);
    --accent-ring: rgba(21, 163, 74, .30);
    --star: #d99400;
    --btn: #111114;
    --btn-text: #ffffff;
    --btn-hover: #2a2a30;
    --danger: #e5484d;

    --shadow-sm: 0 1px 2px rgba(16, 16, 20, .08), 0 1px 3px rgba(16, 16, 20, .05);
    --shadow-md: 0 4px 14px rgba(16, 16, 20, .10), 0 2px 6px rgba(16, 16, 20, .06);
    --shadow-lg: 0 12px 40px rgba(16, 16, 20, .16), 0 4px 12px rgba(16, 16, 20, .10);

    --radius: 14px;
    --radius-md: 10px;
    --radius-sm: 8px;

    --topbar-h: 60px;
    --sidebar-w: 264px;
    --detail-w: 380px;

    --check: #eeeef0;
    --scroll-thumb: #d9d9de;
    --scroll-thumb-hover: #c4c4cb;

    color-scheme: light;
  }

  :root[data-theme="dark"] {
    --bg: #0d0d0f;
    --surface: #171719;
    --surface-2: #212125;
    --hover: #232327;
    --border: #303036;
    --border-strong: #42424a;
    --text: #fbfbfb;
    --text-2: #b2b2ba;
    --muted: #7c7c85;
    --sidebar-text: #e4e4e7;
    --sidebar-muted: #9f9fa9;
    --accent: #34c26e;
    --accent-2: #2aa860;
    --accent-soft: rgba(52, 194, 110, .14);
    --accent-ring: rgba(52, 194, 110, .32);
    --star: #f5b830;
    --btn: #fafafa;
    --btn-text: #0e0e10;
    --btn-hover: #e6e6e6;
    --danger: #ff6369;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, .5);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, .6), 0 4px 12px rgba(0, 0, 0, .4);

    --check: #202024;
    --scroll-thumb: #2e2e34;
    --scroll-thumb-hover: #3c3c44;

    color-scheme: dark;
  }

  /* ---- Reset --------------------------------------------------------------- */
  * {
    box-sizing: border-box;
  }

  [hidden] {
    display: none !important;
  }

  html,
  body {
    height: 100%;
  }

  body {
    margin: 0;
    font-family: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow: hidden;
  }

  h1,
  h2 {
    margin: 0;
    font-weight: 600;
  }

  a {
    color: inherit;
  }

  button {
    font-family: inherit;
  }

  ::selection {
    background: var(--accent-soft);
  }

  input[type="search"]::-webkit-search-decoration,
  input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
  }

  ::-webkit-scrollbar {
    width: 11px;
    height: 11px;
  }

  ::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb);
    border-radius: 8px;
    border: 3px solid transparent;
    background-clip: content-box;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: var(--scroll-thumb-hover);
    background-clip: content-box;
  }

  * {
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) transparent;
  }

  /* ---- Shared bits --------------------------------------------------------- */
  .icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-2);
    cursor: pointer;
    transition: background .14s, color .14s, border-color .14s;
  }

  .icon-btn:hover {
    background: var(--hover);
    color: var(--text);
  }

  .icon-btn svg {
    width: 19px;
    height: 19px;
  }

  :focus-visible {
    outline: none;
  }

  .icon-btn:focus-visible,
  .side-link:focus-visible,
  .set-row:focus-visible,
  .tile:focus-visible,
  .btn:focus-visible,
  .chip-btn:focus-visible {
    box-shadow: 0 0 0 3px var(--accent-ring);
  }

  .spinner {
    width: 22px;
    height: 22px;
    display: inline-block;
    border: 2.5px solid var(--border-strong);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
  }

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

  /* ============================ Top bar ============================ */
  .topbar {
    height: var(--topbar-h);
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
    position: sticky;
    top: 0;
    z-index: 40;
  }

  .menu-toggle {
    display: none;
  }

  .brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    color: var(--text);
    flex: 0 0 auto;
    font-weight: 650;
    font-size: 15px;
    letter-spacing: -.01em;
    padding-right: 6px;
  }

  .brand-text {
    white-space: nowrap;
  }

  .searchbar {
    flex: 1 1 auto;
    max-width: 560px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
  }

  .search-lead {
    position: absolute;
    left: 13px;
    width: 17px;
    height: 17px;
    color: var(--muted);
    pointer-events: none;
  }

  #search {
    width: 100%;
    height: 40px;
    padding: 0 76px 0 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color .14s, background .14s, box-shadow .14s;
  }

  #search::placeholder {
    color: var(--muted);
  }

  #search:hover {
    border-color: var(--border-strong);
  }

  #search:focus {
    border-color: var(--accent);
    background: var(--bg);
    box-shadow: 0 0 0 3px var(--accent-ring);
  }

  .search-kbd {
    position: absolute;
    right: 12px;
    height: 20px;
    min-width: 20px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: 500 11px/1 Inter, sans-serif;
    color: var(--muted);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
  }

  .searchbar.filled .search-kbd {
    display: none;
  }

  .search-clear {
    position: absolute;
    right: 8px;
    width: 26px;
    height: 26px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    border-radius: 6px;
    transition: background .14s, color .14s;
  }

  .search-clear svg {
    width: 15px;
    height: 15px;
  }

  .search-clear:hover {
    background: var(--hover);
    color: var(--text);
  }

  .searchbar.filled .search-clear {
    display: inline-flex;
  }

  .top-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
  }

  .plugin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 99px;
    background: var(--bg);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 550;
    text-decoration: none;
    cursor: pointer;
    transition: background .14s, color .14s, border-color .14s;
  }

  .plugin-btn:hover {
    background: var(--hover);
    color: var(--text);
    border-color: var(--border-strong);
  }

  .plugin-btn svg {
    height: 16px;
    width: auto;
    flex: 0 0 auto;
  }

  #themeToggle svg {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  #themeToggle:hover svg {
    transform: rotate(20deg);
  }

  #themeToggle .i-moon {
    display: none;
  }

  :root[data-theme="dark"] #themeToggle .i-sun {
    display: none;
  }

  :root[data-theme="dark"] #themeToggle .i-moon {
    display: block;
  }

  /* ============================ Layout ============================ */
  .layout {
    display: flex;
    height: calc(100vh - var(--topbar-h));
    height: calc(100dvh - var(--topbar-h));
  }

  /* ---- Sidebar ---- */
  .sidebar {
    width: var(--sidebar-w);
    flex: 0 0 auto;
    border-right: 1px solid var(--border);
    background: var(--bg);
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .side-nav {
    padding: 12px 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 0 0 auto;
  }

  .side-link {
    display: flex;
    align-items: center;
    gap: 11px;
    height: 38px;
    padding: 0 12px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--sidebar-text);
    font-size: 13.5px;
    font-weight: 550;
    cursor: pointer;
    text-align: left;
    transition: background .14s, color .14s;
  }

  .side-link svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
  }

  .side-link:hover {
    background: var(--hover);
    color: var(--text);
  }

  .side-link.active {
    background: var(--accent-soft);
    color: var(--accent-2);
    font-weight: 600;
  }

  :root[data-theme="dark"] .side-link.active {
    color: var(--accent);
  }

  .side-count {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    color: var(--sidebar-muted);
    background: var(--surface-2);
    padding: 1px 7px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
  }

  .side-link.active .side-count {
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: var(--accent-2);
  }

  .side-count:empty {
    display: none;
  }

  .side-sets {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border);
    margin-top: 6px;
    padding-top: 10px;
  }

  .side-sets-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 0 20px 8px;
  }

  .side-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--sidebar-muted);
  }

  .side-label-count {
    font-size: 11px;
    color: var(--sidebar-muted);
    font-weight: 500;
  }

  .set-filter {
    position: relative;
    padding: 0 12px 8px;
    flex: 0 0 auto;
  }

  .set-filter svg {
    position: absolute;
    left: 24px;
    top: 9px;
    width: 15px;
    height: 15px;
    color: var(--sidebar-muted);
    pointer-events: none;
  }

  #setFilter {
    width: 100%;
    height: 34px;
    padding: 0 10px 0 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    outline: none;
    transition: border-color .14s, box-shadow .14s;
  }

  #setFilter:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
  }

  #setFilter::placeholder {
    color: var(--sidebar-muted);
  }

  .set-list {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0 8px 10px;
    min-height: 0;
  }

  .set-cat {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--sidebar-muted);
    padding: 12px 12px 5px;
  }

  .set-cat:first-child {
    padding-top: 4px;
  }

  .set-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 12px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--sidebar-text);
    cursor: pointer;
    text-align: left;
    font-size: 13px;
    font-weight: 500;
    transition: background .12s, color .12s;
  }

  .set-row svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    color: var(--sidebar-muted);
    transition: color .12s;
  }

  .set-row:hover {
    background: var(--hover);
    color: var(--text);
  }

  .set-row:hover svg {
    color: var(--text);
  }

  .set-row.active {
    background: var(--accent-soft);
    color: var(--accent-2);
    font-weight: 600;
  }

  .set-row.active svg {
    color: var(--accent-2);
  }

  :root[data-theme="dark"] .set-row.active {
    color: var(--accent);
  }

  :root[data-theme="dark"] .set-row.active svg {
    color: var(--accent);
  }

  .set-row-name {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .set-row-count {
    flex: 0 0 auto;
    font-size: 11px;
    color: var(--sidebar-muted);
    font-variant-numeric: tabular-nums;
  }

  .set-list-loading {
    display: flex;
    justify-content: center;
    padding: 28px 0;
  }

  .set-empty {
    padding: 16px 14px;
    color: var(--sidebar-muted);
    font-size: 12.5px;
  }

  .sidebar-foot {
    flex: 0 0 auto;
    padding: 10px 20px;
    border-top: 1px solid var(--border);
    font-size: 11.5px;
    color: var(--sidebar-muted);
  }

  .sidebar-foot a {
    color: var(--sidebar-text);
    text-decoration: none;
  }

  .sidebar-foot a:hover {
    color: var(--accent-2);
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  /* ---- Main ---- */
  .main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
  }

  .toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px 14px;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border);
  }

  .toolbar-context {
    min-width: 0;
  }

  .ctx-title {
    font-size: 19px;
    font-weight: 650;
    letter-spacing: -.02em;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ctx-sub {
    font-size: 12.5px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
  }

  .toolbar-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
  }

  .ctl {
    display: inline-flex;
    align-items: center;
  }

  .ctl-swatch {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    overflow: hidden;
    cursor: pointer;
    display: inline-block;
    box-shadow: var(--shadow-sm);
    transition: transform .12s, box-shadow .12s;
  }

  .ctl-swatch:hover {
    transform: scale(1.06);
    box-shadow: var(--shadow-md);
  }

  .ctl-swatch.big {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
  }

  .ctl-swatch input[type="color"] {
    position: absolute;
    inset: -4px;
    width: calc(100% + 8px);
    height: calc(100% + 8px);
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    cursor: pointer;
  }

  .ctl-swatch input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
  }

  .ctl-swatch input[type="color"]::-webkit-color-swatch {
    border: none;
  }

  .ctl-reset {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-2);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .14s, color .14s, border-color .14s;
  }

  .ctl-reset:hover {
    background: var(--hover);
    color: var(--text);
    border-color: var(--border-strong);
  }

  .ctl-reset svg {
    width: 15px;
    height: 15px;
  }

  .ctl-divider {
    width: 1px;
    height: 22px;
    background: var(--border);
    margin: 0 4px;
  }

  .ctl-size {
    height: 34px;
    padding: 0 4px;
    gap: 2px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
  }

  .size-btn {
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    color: var(--text-2);
    cursor: pointer;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .14s, color .14s;
  }

  .size-btn:hover {
    background: var(--hover);
    color: var(--text);
  }

  .size-btn svg {
    width: 15px;
    height: 15px;
  }

  .size-value {
    min-width: 26px;
    text-align: center;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums;
  }

  /* ---- Tag chips ---- */
  .tagchips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 12px 24px 2px;
    align-items: center;
  }

  .tagchips-label {
    font-size: 12px;
    color: var(--muted);
    margin-right: 2px;
  }

  .tagchip {
    height: 28px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    color: var(--text-2);
    font-size: 12.5px;
    cursor: pointer;
    transition: background .14s, color .14s, border-color .14s;
  }

  .tagchip:hover {
    background: var(--hover);
    color: var(--text);
    border-color: var(--border-strong);
  }

  /* ---- Grid ---- */
  .grid {
    --tile: 92px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--tile), 1fr));
    gap: 8px;
    padding: 18px 24px 24px;
    align-content: start;
  }

  .tile {
    position: relative;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg);
    color: var(--icon-color, var(--text));
    cursor: pointer;
    padding: 0;
    transition: background .14s, border-color .14s, box-shadow .14s, transform .14s;
  }

  .tile:hover {
    border-color: var(--accent);
    z-index: 1;
  }

  .tile:active {}

  .tile.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), var(--shadow-sm);
  }

  .tile svg {
    width: var(--icon-size, 32px);
    height: var(--icon-size, 32px);
    display: block;
    pointer-events: none;
  }

  .tile .skeleton {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.3s ease-in-out infinite;
  }

  @keyframes shimmer {
    to {
      background-position: -200% 0;
    }
  }

  .tile .fav-dot {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--star);
    display: none;
  }

  .tile.faved .fav-dot {
    display: block;
  }

  .tile .quick {
    position: absolute;
    bottom: 6px;
    right: 6px;
    display: none;
    gap: 4px;
  }

  .tile:hover .quick {
    display: flex;
  }

  .quick-btn {
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text-2);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: color .12s, background .12s, border-color .12s;
  }

  .quick-btn:hover {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border-strong);
  }

  .quick-btn.on {
    color: var(--star);
  }

  .quick-btn svg {
    width: 13px;
    height: 13px;
  }

  .sentinel {
    height: 1px;
  }

  /* ---- Landing (home) ---- */
  .home {
    padding: 0 24px 28px;
  }

  .hero {
    padding: 40px 4px 30px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
  }

  .hero h1 {
    font-size: 34px;
    line-height: 1.1;
    letter-spacing: -.03em;
    font-weight: 700;
    max-width: 640px;
  }

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

  .hero p {
    margin: 14px 0 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-2);
    max-width: 560px;
  }

  .hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    margin-top: 22px;
  }

  .hero-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .hero-stat b {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
  }

  .hero-stat span {
    font-size: 12px;
    color: var(--muted);
  }

  .hero-stat+.hero-stat {
    padding-left: 22px;
    border-left: 1px solid var(--border);
  }

  .home-cat {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 26px 2px 12px;
  }

  .home-cat h2 {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-2);
  }

  .home-cat span {
    font-size: 11.5px;
    color: var(--muted);
  }

  .home-cat:first-of-type {
    margin-top: 12px;
  }

  .set-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
  }

  .set-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    text-align: left;
    cursor: pointer;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    overflow: hidden;
    color: var(--text);
    transition: border-color .18s, box-shadow .18s, transform .18s, background .18s;
  }

  .set-card:hover {
    border-color: var(--accent);
  }

  .set-card-samples {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 8px;
    height: 74px;
    padding: 0 18px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    transition: background .14s;
  }

  .set-card-samples svg {
    width: 26px;
    height: 26px;
  }

  .set-card-samples .s-skel {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--surface-2) 0%, var(--hover) 50%, var(--surface-2) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.3s ease-in-out infinite;
  }

  .set-card-info {
    padding: 12px 14px 13px;
  }

  .set-card-name {
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: -.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .set-card-count {
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 3px;
    font-variant-numeric: tabular-nums;
  }

  /* ---- Status ---- */
  .status {
    padding: 72px 24px;
    text-align: center;
    color: var(--text-2);
  }

  .status .status-icon {
    width: 44px;
    height: 44px;
    margin: 0 auto 14px;
    color: var(--muted);
  }

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

  .status strong {
    display: block;
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
  }

  .status p {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.6;
    max-width: 340px;
    margin-inline: auto;
  }

  .status .spinner {
    margin-bottom: 6px;
  }

  .status-actions {
    margin-top: 18px;
  }

  .status .btn {
    display: inline-flex;
    width: auto;
  }

  /* ============================ Detail drawer ============================ */
  .scrim {
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(9, 9, 11, .5);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity .2s;
    display: none;
  }

  .scrim.show {
    display: block;
    opacity: 1;
  }

  .detail {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 50;
    width: var(--detail-w);
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: var(--bg);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .26s cubic-bezier(.4, 0, .2, 1);
    overflow: hidden;
  }

  .detail.show {
    transform: translateX(0);
  }

  .detail-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px 12px 20px;
  }

  .detail-eyebrow {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-2);
    letter-spacing: .01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  :root[data-theme="dark"] .detail-eyebrow {
    color: var(--accent);
  }

  .detail-preview {
    flex: 0 0 auto;
    margin: 0 20px;
    height: 190px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background:
      linear-gradient(45deg, var(--check) 25%, transparent 25%, transparent 75%, var(--check) 75%),
      linear-gradient(45deg, var(--check) 25%, transparent 25%, transparent 75%, var(--check) 75%);
    background-size: 18px 18px;
    background-position: 0 0, 9px 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  .detail-canvas {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--detail-color, var(--text));
  }

  .detail-canvas svg {
    display: block;
  }

  .detail-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 18px 20px 24px;
  }

  .detail-name {
    font-size: 18px;
    font-weight: 650;
    letter-spacing: -.01em;
    text-transform: capitalize;
  }

  .detail-id {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
  }

  .detail-id code {
    font-size: 12px;
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mini-copy {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .14s, color .14s;
  }

  .mini-copy:hover {
    background: var(--hover);
    color: var(--text);
  }

  .mini-copy svg {
    width: 13px;
    height: 13px;
  }

  .field {
    margin-top: 22px;
  }

  .field-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 10px;
  }

  .field-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .field-value {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums;
  }

  .range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 4px;
    background: var(--surface-2);
    outline: none;
    cursor: pointer;
  }

  .range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--btn);
    border: 3px solid var(--bg);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
  }

  .range::-moz-range-thumb {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--btn);
    border: 3px solid var(--bg);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
  }

  .size-presets {
    display: flex;
    gap: 6px;
    margin-top: 10px;
  }

  .size-preset {
    flex: 1;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-variant-numeric: tabular-nums;
    transition: background .14s, color .14s, border-color .14s;
  }

  .size-preset:hover {
    background: var(--hover);
    color: var(--text);
  }

  .size-preset.active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent-2);
    font-weight: 600;
  }

  :root[data-theme="dark"] .size-preset.active {
    color: var(--accent);
  }

  .color-row {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .hex-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    font-size: 13.5px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    text-transform: uppercase;
    outline: none;
    transition: border-color .14s, box-shadow .14s;
  }

  .hex-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
  }

  .ctl-reset-inline {
    flex: 0 0 auto;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-2);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: background .14s, color .14s;
  }

  .ctl-reset-inline:hover {
    background: var(--hover);
    color: var(--text);
  }

  .field-note {
    margin: 10px 0 0;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
  }

  .detail-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
  }

  .btn {
    flex: 1 1 0;
    height: 42px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    font-size: 13.5px;
    font-weight: 550;
    cursor: pointer;
    transition: background .14s, border-color .14s, transform .06s;
  }

  .btn:hover {
    background: var(--hover);
    border-color: var(--border-strong);
  }

  .btn:active {
    transform: translateY(1px);
  }

  .btn svg {
    width: 16px;
    height: 16px;
  }

  .btn-primary {
    background: var(--btn);
    border-color: var(--btn);
    color: var(--btn-text);
  }

  .btn-primary:hover {
    background: var(--btn-hover);
    border-color: var(--btn-hover);
  }

  .btn.copied {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
  }

  .detail-sub-actions {
    display: flex;
    gap: 8px;
    margin-top: 18px;
  }

  .chip-btn {
    flex: 1 1 0;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-2);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: background .14s, color .14s, border-color .14s;
  }

  .chip-btn:hover {
    background: var(--hover);
    color: var(--text);
    border-color: var(--border-strong);
  }

  .chip-btn svg {
    width: 15px;
    height: 15px;
  }

  .chip-btn.faved {
    color: var(--star);
    border-color: color-mix(in srgb, var(--star) 40%, var(--border));
  }

  .chip-btn.faved svg {
    fill: var(--star);
  }

  .detail-license {
    margin: 20px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 11.5px;
    color: var(--muted);
    line-height: 1.6;
  }

  .detail-license a {
    color: var(--text-2);
  }

  /* ============================ Toast ============================ */
  .toast {
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translate(-50%, 20px);
    z-index: 60;
    padding: 11px 18px;
    border-radius: 10px;
    background: var(--btn);
    color: var(--btn-text);
    font-size: 13px;
    font-weight: 550;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  .toast svg {
    width: 16px;
    height: 16px;
  }

  /* ============================ Responsive ============================ */
  @media (max-width: 1100px) {
    :root {
      --sidebar-w: 232px;
    }
  }

  @media (max-width: 860px) {
    .menu-toggle {
      display: inline-flex;
    }

    .brand-text {
      display: none;
    }

    .sidebar {
      position: fixed;
      top: var(--topbar-h);
      left: 0;
      bottom: 0;
      z-index: 44;
      transform: translateX(-100%);
      transition: transform .24s cubic-bezier(.4, 0, .2, 1);
      box-shadow: var(--shadow-lg);
      width: 280px;
    }

    .sidebar.open {
      transform: translateX(0);
    }

    .layout.sidebar-open::after {
      content: '';
      position: fixed;
      inset: var(--topbar-h) 0 0 0;
      z-index: 43;
      background: rgba(9, 9, 11, .4);
    }

    .search-kbd {
      display: none;
    }

    .searchbar {
      margin-left: 0;
    }

    .toolbar {
      padding: 14px 16px 12px;
    }

    .grid {
      padding: 14px 16px 24px;
    }

    .tagchips {
      padding: 12px 16px 2px;
    }
  }

  @media (max-width: 560px) {
    :root {
      --detail-w: 100vw;
    }

    .detail {
      border-left: none;
    }

    .toolbar {
      flex-wrap: wrap;
      gap: 10px;
    }

    .ctx-title {
      font-size: 17px;
    }

    .plugin-btn span {
      display: none;
    }

    .plugin-btn {
      padding: 0;
      width: 36px;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    * {
      transition-duration: .01ms !important;
      animation-duration: .01ms !important;
    }
  }