:root {
      --bg: #0d0f0e;
      --surface: #151816;
      --surface-2: #101311;
      --text: #f7efe4;
      --muted: #b9ad9b;
      --line: rgba(201, 154, 83, .24);
      --soft-line: rgba(255, 255, 255, .08);
      --gold: #c99a53;
      --gold-2: #f2cb82;
      --brass: #b8793c;
      --brass-hover: #c98f4a;
      --ink: #130e09;
    }

    * { box-sizing: border-box; }

    html {
      scroll-behavior: smooth;
      scroll-padding-top: 86px;
    }

    body {
      margin: 0;
      min-height: 100vh;
      color: var(--text);
      background-color: var(--bg);
      background-image:
        linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
      background-size: 32px 32px;
      font-family: 'IRANYekan', 'IRYekan', Tahoma, Arial, sans-serif !important;
      overflow-x: hidden;
      text-align: right;
    }

    body.dialog-open { overflow: hidden; }
    button, input, select, textarea { font-family: inherit !important; }
    button { color: inherit; }
    a { color: inherit; text-decoration: none; }
    img { display: block; max-width: 100%; }

    .site-header {
      position: fixed;
      inset: 0 0 auto;
      z-index: 1000;
      border-bottom: 1px solid rgba(201, 154, 83, .20);
      background: rgba(10, 12, 11, .92);
      backdrop-filter: blur(18px);
      box-shadow: 0 12px 38px rgba(0, 0, 0, .28);
    }

    .navbar { min-height: 72px; }
    .navbar-brand { gap: 11px; margin: 0; color: var(--text) !important; }

    .brand-mark {
      width: 38px;
      height: 38px;
      display: grid;
      place-items: center;
      flex: 0 0 auto;
      color: #17110a;
      border-radius: 7px;
      background: var(--brass);
      font-weight: 950;
    }

    .brand-title { display: block; font-size: .96rem; font-weight: 950; line-height: 1.4; }
    .brand-sub { display: block; color: #968c7e; direction: ltr; font-size: .62rem; text-align: right; }

    .navbar .nav-link {
      padding: .55rem .72rem !important;
      color: #d7cfbf !important;
      border-radius: 7px;
      font-size: .82rem;
      transition: color .18s ease, background .18s ease;
    }

    .navbar .nav-link:hover,
    .navbar .nav-link.active {
      color: #f2d6aa !important;
      background: rgba(184, 121, 60, .13);
    }

    .navbar-toggler {
      border: 1px solid rgba(201, 154, 83, .38);
      box-shadow: none !important;
    }

    .navbar-toggler-icon { filter: invert(1) sepia(.6); }

    .header-action,
    .catalog-action,
    .filter-button,
    .share-option,
    .dialog-close {
      border: 1px solid transparent;
      cursor: pointer;
      transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease;
    }

    .header-action {
      min-height: 36px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 0 12px;
      color: var(--ink);
      border-radius: 7px;
      background: var(--brass);
      font-size: .72rem;
      font-weight: 850;
    }

    .header-action:hover { color: var(--ink); background: var(--brass-hover); transform: translateY(-1px); }

    .catalog-main {
      min-height: calc(100vh - 220px);
      padding: 112px 0 76px;
    }

    .catalog-heading {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: end;
      gap: 24px;
      margin-bottom: 26px;
    }

    .breadcrumb-mini {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 7px;
      margin-bottom: 13px;
      color: #8f877b;
      font-size: .72rem;
    }

    .breadcrumb-mini a { color: #d2c4b1; }
    .breadcrumb-mini span { color: #5e5b55; }

    .page-kicker {
      display: block;
      margin-bottom: 8px;
      color: var(--gold);
      font-size: .72rem;
      font-weight: 900;
    }

    .page-title {
      margin: 0;
      color: #fff4e6;
      font-size: clamp(1.75rem, 4vw, 3rem);
      font-weight: 950;
      line-height: 1.35;
    }

    .page-description {
      max-width: 650px;
      margin: 10px 0 0;
      color: var(--muted);
      font-size: .9rem;
      line-height: 1.9;
    }

    .catalog-count {
      min-width: 150px;
      padding: 13px 15px;
      border-right: 3px solid var(--brass);
      background: rgba(21, 24, 22, .88);
    }

    .catalog-count strong { display: block; color: #f6e7d3; font-size: 1.45rem; direction: ltr; }
    .catalog-count span { display: block; margin-top: 2px; color: #91887c; font-size: .68rem; }

    .catalog-toolbar {
      position: sticky;
      top: 84px;
      z-index: 20;
      display: grid;
      grid-template-columns: auto minmax(0, 1fr) auto;
      align-items: center;
      gap: 14px;
      margin-bottom: 18px;
      padding: 12px;
      border: 1px solid var(--soft-line);
      border-radius: 8px;
      background: rgba(15, 18, 16, .94);
      backdrop-filter: blur(16px);
      box-shadow: 0 14px 34px rgba(0, 0, 0, .24);
    }

    .toolbar-label {
      color: #d9cebf;
      font-size: .74rem;
      font-weight: 850;
      white-space: nowrap;
    }

    .size-filters {
      min-width: 0;
      display: flex;
      gap: 6px;
      overflow-x: auto;
      padding-bottom: 2px;
      scrollbar-width: thin;
      scrollbar-color: rgba(201, 154, 83, .45) transparent;
    }

    .filter-button {
      min-height: 34px;
      flex: 0 0 auto;
      padding: 0 11px;
      color: #bcb1a1;
      border-color: rgba(255, 255, 255, .08);
      border-radius: 6px;
      background: #151816;
      direction: ltr;
      font-size: .68rem;
      font-weight: 800;
    }

    .filter-button:hover {
      color: #f2d4a7;
      border-color: rgba(201, 154, 83, .40);
      background: #1b1e1b;
    }

    .filter-button.active {
      color: var(--ink);
      border-color: rgba(242, 203, 130, .20);
      background: var(--brass);
    }

    .filter-button[data-filter="all"] { direction: rtl; }
    .result-count { color: #817a70; font-size: .66rem; white-space: nowrap; }

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

    .catalog-card {
      position: relative;
      min-width: 0;
      display: grid;
      grid-template-columns: minmax(220px, .88fr) minmax(0, 1.12fr);
      overflow: visible;
      border: 1px solid var(--soft-line);
      border-radius: 8px;
      background: var(--surface);
      box-shadow: 0 16px 42px rgba(0, 0, 0, .22);
      transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
    }

    .catalog-card[hidden] { display: none; }

    .catalog-card:hover {
      transform: none;
      border-color: rgba(201, 154, 83, .48);
      box-shadow: 0 24px 56px rgba(0, 0, 0, .30);
    }

    .catalog-cover {
      position: relative;
      min-height: 330px;
      overflow: hidden;
      border-left: 1px solid var(--soft-line);
      border-radius: 0 7px 7px 0;
      background: #0f1210;
    }

    .catalog-cover img {
      position: absolute;
      inset: -1px;
      width: calc(100% + 2px);
      height: calc(100% + 2px);
      object-fit: cover;
      filter: saturate(.82) contrast(1.08) brightness(.58);
      transform: translateZ(0);
      backface-visibility: hidden;
    }

    .catalog-cover::after {
      content: "";
      position: absolute;
      inset: 0;
      background: linear-gradient(180deg, rgba(7,9,8,.10), rgba(7,9,8,.76));
      pointer-events: none;
    }

    .catalog-index,
    .catalog-edition {
      position: absolute;
      z-index: 2;
      top: 16px;
      min-height: 27px;
      display: inline-flex;
      align-items: center;
      padding: 0 8px;
      border-radius: 4px;
      font-size: .6rem;
      font-weight: 900;
    }

    .catalog-index {
      right: 16px;
      color: #1a1209;
      background: var(--brass);
      direction: ltr;
    }

    .catalog-edition {
      left: 16px;
      color: #d3c7b7;
      border: 1px solid rgba(255,255,255,.14);
      background: rgba(10,12,11,.68);
      direction: ltr;
    }

    .cover-size-demo {
      position: absolute;
      z-index: 2;
      inset: 58px 18px 70px;
      display: grid;
      place-items: center;
    }

    .tile-ratio {
      position: relative;
      width: var(--tile-w);
      height: var(--tile-h);
      max-width: 78%;
      max-height: 190px;
      border: 1px solid rgba(255, 240, 214, .74);
      background: rgba(242, 203, 130, .09);
      box-shadow: 12px 14px 0 rgba(0,0,0,.22);
    }

    .tile-ratio::before,
    .tile-ratio::after {
      content: "";
      position: absolute;
      background: rgba(255, 240, 214, .42);
    }

    .tile-ratio::before { right: -8px; top: 50%; width: 8px; height: 1px; }
    .tile-ratio::after { left: 50%; bottom: -8px; width: 1px; height: 8px; }

    .cover-size-label {
      position: absolute;
      z-index: 2;
      right: 18px;
      bottom: 18px;
    }

    .cover-size-label strong {
      display: block;
      color: #fff4e6;
      direction: ltr;
      font-size: 1.5rem;
      font-weight: 950;
      line-height: 1.1;
    }

    .cover-size-label span { display: block; margin-top: 5px; color: #c5b8a7; font-size: .65rem; }

    .catalog-card-body {
      min-width: 0;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      padding: 20px;
    }

    .catalog-category {
      display: block;
      margin-bottom: 8px;
      color: var(--gold);
      direction: ltr;
      font-size: .62rem;
      font-weight: 900;
    }

    .catalog-card h2 {
      margin: 0;
      color: #fff3e3;
      font-size: 1.08rem;
      font-weight: 950;
    }

    .catalog-card p {
      margin: 9px 0 0;
      color: var(--muted);
      font-size: .76rem;
      line-height: 1.82;
    }

    .catalog-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 13px;
    }

    .catalog-meta span {
      padding: 4px 7px;
      color: #cfc2b1;
      border: 1px solid rgba(201,154,83,.22);
      border-radius: 4px;
      background: var(--surface-2);
      font-size: .61rem;
    }

    .catalog-actions {
      position: relative;
      display: grid;
      grid-template-columns: .8fr 1.15fr 1.15fr;
      gap: 7px;
      margin-top: 22px;
    }

    .share-wrap { position: relative; min-width: 0; }
    .share-wrap > .catalog-action { width: 100%; }

    .catalog-action {
      min-width: 0;
      min-height: 38px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      padding: 0 8px;
      color: #efcf9f;
      border-color: rgba(184,121,60,.42);
      border-radius: 6px;
      background: rgba(184,121,60,.08);
      font-size: .66rem;
      font-weight: 850;
      white-space: nowrap;
    }

    .catalog-action .action-symbol {
      display: inline-grid;
      width: 18px;
      height: 18px;
      place-items: center;
      direction: ltr;
      font-size: .82rem;
      line-height: 1;
    }

    .catalog-action:hover {
      color: #ffe2b2;
      border-color: rgba(201,143,74,.74);
      background: rgba(184,121,60,.16);
      transform: translateY(-1px);
    }

    .catalog-action.primary {
      color: var(--ink);
      border-color: rgba(242,203,130,.24);
      background: var(--brass);
    }

    .catalog-action.primary:hover { color: var(--ink); background: var(--brass-hover); }

    .catalog-action:focus-visible,
    .filter-button:focus-visible,
    .share-option:focus-visible,
    .dialog-close:focus-visible,
    .header-action:focus-visible {
      outline: 2px solid rgba(242, 203, 130, .75);
      outline-offset: 2px;
    }

    .share-menu {
      position: absolute;
      right: 0;
      bottom: calc(100% + 8px);
      z-index: 30;
      width: 190px;
      overflow: hidden;
      padding: 6px;
      border: 1px solid rgba(201,154,83,.34);
      border-radius: 7px;
      background: #0d100e;
      box-shadow: 0 18px 42px rgba(0,0,0,.42);
    }

    .share-menu[hidden] { display: none; }

    .share-option {
      width: 100%;
      min-height: 36px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 9px;
      color: #d9cebf;
      border-color: transparent;
      border-radius: 4px;
      background: transparent;
      font-size: .68rem;
      text-align: right;
    }

    a.share-option { display: flex; }
    .share-option:hover { color: #f3d4a7; background: rgba(184,121,60,.14); }
    .share-option span:last-child { color: #867e73; direction: ltr; font-size: .58rem; }

    .catalog-dialog {
      width: min(920px, calc(100% - 28px));
      max-height: calc(100vh - 28px);
      overflow: auto;
      padding: 0;
      color: var(--text);
      border: 1px solid rgba(201,154,83,.42);
      border-radius: 8px;
      background: #0d100e;
      box-shadow: 0 32px 90px rgba(0,0,0,.62);
    }

    .catalog-dialog::backdrop {
      background: rgba(3,5,4,.78);
      backdrop-filter: blur(7px);
    }

    .dialog-header {
      position: sticky;
      top: 0;
      z-index: 5;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      padding: 14px 16px;
      border-bottom: 1px solid var(--soft-line);
      background: rgba(15,18,16,.96);
    }

    .dialog-header strong { display: block; color: #fff2df; font-size: .86rem; }
    .dialog-header span { display: block; margin-top: 3px; color: #8f877b; font-size: .62rem; }

    .dialog-close {
      width: 34px;
      height: 34px;
      display: grid;
      place-items: center;
      flex: 0 0 auto;
      color: #d8ccbc;
      border-color: rgba(255,255,255,.10);
      border-radius: 5px;
      background: #151816;
      font-size: 1.2rem;
    }

    .dialog-close:hover { color: #fff; border-color: rgba(201,154,83,.50); background: #1c1f1c; }

    .dialog-body { padding: 18px; }

    .viewer-spread {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      min-height: 480px;
      overflow: hidden;
      border: 1px solid rgba(255,255,255,.10);
      border-radius: 6px;
      background: #121512;
      box-shadow: 0 22px 56px rgba(0,0,0,.30);
    }

    .viewer-cover {
      position: relative;
      min-height: 480px;
      overflow: hidden;
      border-left: 1px solid rgba(255,255,255,.10);
    }

    .viewer-cover img {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      filter: brightness(.48) contrast(1.08) saturate(.84);
    }

    .viewer-cover::after {
      content: "";
      position: absolute;
      inset: 0;
      background: linear-gradient(180deg, rgba(5,7,6,.12), rgba(5,7,6,.82));
    }

    .viewer-cover-copy {
      position: absolute;
      z-index: 2;
      right: 24px;
      bottom: 24px;
      left: 24px;
    }

    .viewer-cover-copy span { display: block; color: #d8c6ae; direction: ltr; font-size: .68rem; }
    .viewer-cover-copy strong { display: block; margin-top: 8px; color: #fff4e6; direction: ltr; font-size: 2.4rem; font-weight: 950; }

    .viewer-page {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      padding: 28px;
      background-color: #f0e6d8;
      background-image:
        linear-gradient(rgba(18,16,13,.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(18,16,13,.045) 1px, transparent 1px);
      background-size: 24px 24px;
      color: #1b1813;
    }

    .viewer-page-label { color: #91602f; direction: ltr; font-size: .64rem; font-weight: 900; }
    .viewer-page h2 { margin: 12px 0 0; font-size: 1.45rem; font-weight: 950; }
    .viewer-page p { margin: 10px 0 0; color: #5e5549; font-size: .76rem; line-height: 1.9; }

    .viewer-spec-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      margin-top: 22px;
    }

    .viewer-spec {
      min-height: 72px;
      padding: 10px;
      border: 1px solid rgba(27,24,19,.14);
      border-radius: 4px;
      background: rgba(255,255,255,.34);
    }

    .viewer-spec span { display: block; color: #81766a; font-size: .6rem; }
    .viewer-spec strong { display: block; margin-top: 6px; font-size: .72rem; }

    .viewer-ratio-box {
      min-height: 150px;
      display: grid;
      place-items: center;
      margin-top: 22px;
      border-top: 1px solid rgba(27,24,19,.15);
    }

    .viewer-ratio-box .tile-ratio {
      width: var(--viewer-tile-w);
      height: var(--viewer-tile-h);
      max-height: 128px;
      border-color: rgba(27,24,19,.50);
      background: rgba(184,121,60,.13);
      box-shadow: 9px 10px 0 rgba(27,24,19,.10);
    }

    .dialog-actions {
      display: flex;
      justify-content: flex-end;
      gap: 8px;
      margin-top: 14px;
    }

    .dialog-actions .catalog-action { min-width: 140px; }

    .copy-toast {
      position: fixed;
      right: 50%;
      bottom: 24px;
      z-index: 1200;
      min-width: 210px;
      padding: 10px 14px;
      color: #f7ead9;
      border: 1px solid rgba(201,154,83,.42);
      border-radius: 6px;
      background: #111411;
      box-shadow: 0 18px 42px rgba(0,0,0,.38);
      font-size: .72rem;
      text-align: center;
      transform: translate(50%, 20px);
      opacity: 0;
      pointer-events: none;
      transition: opacity .2s ease, transform .2s ease;
    }

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

    footer {
      padding: 26px 0;
      border-top: 1px solid var(--line);
      background: #0a0c0b;
    }

    .footer-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 20px;
    }

    .footer-row strong { display: block; color: #f1e5d5; font-size: .84rem; }
    .footer-row span { display: block; margin-top: 4px; color: #817a70; font-size: .66rem; }
    .footer-links { display: flex; flex-wrap: wrap; gap: 14px; }
    .footer-links a { color: #b8ad9d; font-size: .7rem; }
    .footer-links a:hover { color: #efd0a1; }

    @media (max-width: 1199.98px) {
      .catalog-card { grid-template-columns: 210px minmax(0, 1fr); }
      .catalog-actions { grid-template-columns: 1fr 1fr; }
      .catalog-actions .share-wrap { grid-column: 1 / -1; }
      .catalog-actions .share-wrap .catalog-action { width: 100%; }
    }

    @media (max-width: 991.98px) {
      .catalog-heading { grid-template-columns: 1fr; }
      .catalog-count { width: fit-content; }
      .catalog-toolbar { top: 78px; grid-template-columns: 1fr auto; }
      .toolbar-label { display: none; }
      .catalog-grid { grid-template-columns: 1fr; }
      .catalog-card { grid-template-columns: minmax(230px, .72fr) minmax(0, 1fr); }
      .catalog-actions { grid-template-columns: .8fr 1.15fr 1.15fr; }
      .catalog-actions .share-wrap { grid-column: auto; }
    }

    @media (max-width: 767.98px) {
      .catalog-main { padding-top: 100px; }
      .catalog-toolbar { position: relative; top: auto; }
      .catalog-card { grid-template-columns: 1fr; }
      .catalog-cover { min-height: 300px; border-left: 0; border-bottom: 1px solid var(--soft-line); border-radius: 7px 7px 0 0; }
      .catalog-card-body { padding: 17px; }
      .catalog-actions { grid-template-columns: .8fr 1.1fr 1.1fr; }
      .viewer-spread { grid-template-columns: 1fr; }
      .viewer-cover { min-height: 360px; border-left: 0; border-bottom: 1px solid rgba(255,255,255,.10); }
      .dialog-actions { flex-direction: column; }
      .dialog-actions .catalog-action { width: 100%; }
      .footer-row { align-items: flex-start; flex-direction: column; }
    }

    @media (max-width: 479.98px) {
      .brand-sub { display: none; }
      .catalog-heading { gap: 16px; }
      .catalog-count { min-width: 132px; }
      .catalog-toolbar { grid-template-columns: 1fr; }
      .result-count { padding-right: 2px; }
      .catalog-actions { grid-template-columns: 1fr 1fr; }
      .catalog-actions .share-wrap { grid-column: 1 / -1; }
      .catalog-actions .share-wrap .catalog-action { width: 100%; }
      .catalog-action { font-size: .62rem; }
      .dialog-body { padding: 10px; }
      .viewer-cover { min-height: 310px; }
      .viewer-page { padding: 20px 16px; }
      .viewer-spec-grid { grid-template-columns: 1fr; }
    }
