:root {
      --bg: #f3f6fb;
      --panel: #ffffff;
      --panel-soft: #f8faff;
      --line: #dbe4f2;
      --line-strong: #c2d2ea;
      --text: #1b2a42;
      --muted: #5b6f8f;
      --title: #12203a;
      --primary: #2363d1;
      --primary-soft: #eaf2ff;
      --get-bg: #e8f8f0;
      --get-text: #1d7a49;
      --post-bg: #eaf0ff;
      --post-text: #2358c5;
      --danger-bg: #fff0f0;
      --danger-text: #a12626;
      --shadow: 0 12px 28px rgba(14, 30, 62, 0.08);
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      color: var(--text);
      font-family: "Manrope", sans-serif;
      background: linear-gradient(180deg, #f6f9ff 0%, #eef3fa 100%);
      min-height: 100vh;
    }

    .wrap {
      width: min(1260px, 94vw);
      margin: 0 auto;
      padding: 24px 0 60px;
    }

    .topbar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 16px;
      padding: 14px 18px;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--panel);
      box-shadow: var(--shadow);
      margin-bottom: 16px;
    }

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

    .brand strong {
      color: var(--title);
      font-size: 1.5rem;
      font-weight: 800;
      line-height: 1.2;
      overflow-wrap: anywhere;
      word-break: break-word;
    }

    .brand span {
      color: var(--muted);
      font-size: 0.92rem;
    }

    .badge {
      font-family: "JetBrains Mono", monospace;
      font-size: 0.76rem;
      color: #36578e;
      border: 1px solid var(--line-strong);
      background: var(--primary-soft);
      border-radius: 999px;
      padding: 7px 12px;
    }

    .topbar-actions {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .docs-lang-dropdown {
      position: relative;
    }

    .docs-lang-dropdown[open] {
      z-index: 20;
    }

    .docs-lang-trigger {
      list-style: none;
      display: inline-flex;
      align-items: center;
      gap: 0.45rem;
      padding: 7px 12px;
      border-radius: 999px;
      border: 1px solid rgba(122, 162, 232, 0.44);
      background: linear-gradient(180deg, #f4f8ff 0%, #eaf2ff 100%);
      color: #31589b;
      font-family: "JetBrains Mono", monospace;
      font-size: 0.76rem;
      font-weight: 700;
      line-height: 1;
      box-shadow:
        0 14px 26px rgba(43, 92, 171, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
      cursor: pointer;
      user-select: none;
      transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    }

    .docs-lang-trigger::-webkit-details-marker {
      display: none;
    }

    .docs-lang-trigger:hover {
      transform: translateY(-2px);
      border-color: rgba(93, 145, 232, 0.58);
      background: linear-gradient(180deg, #f7faff 0%, #edf4ff 100%);
      box-shadow:
        0 16px 30px rgba(43, 92, 171, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.94);
    }

    .docs-lang-dropdown[open] .docs-lang-trigger {
      border-color: rgba(86, 138, 229, 0.62);
      background: linear-gradient(180deg, #f7faff 0%, #edf4ff 100%);
      box-shadow:
        0 16px 30px rgba(43, 92, 171, 0.16),
        0 0 0 3px rgba(82, 133, 226, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.94);
    }

    .docs-lang-trigger:focus-visible {
      outline: 2px solid rgba(82, 133, 226, 0.36);
      outline-offset: 2px;
    }

    .docs-lang-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 1.42rem;
      height: 1.08rem;
      padding: 0 0.16rem;
      border-radius: 0.34rem;
      border: 1px solid rgba(120, 164, 237, 0.34);
      background: linear-gradient(180deg, #edf4ff 0%, #dfeeff 100%);
      color: #4d76c8;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
    }

    .docs-lang-icon svg {
      width: 0.82rem;
      height: 0.82rem;
      display: block;
      overflow: visible;
    }

    .docs-lang-label {
      letter-spacing: 0.02em;
      color: #2f5394;
    }

    .docs-lang-chevron {
      color: rgba(47, 83, 148, 0.72);
      font-size: 0.64rem;
      transition: transform 0.2s ease, color 0.2s ease;
    }

    .docs-lang-dropdown[open] .docs-lang-chevron {
      transform: rotate(180deg);
      color: #2f5394;
    }

    .docs-lang-menu {
      position: absolute;
      top: calc(100% + 0.55rem);
      right: 0;
      min-width: 172px;
      padding: 0.38rem;
      border-radius: 16px;
      border: 1px solid rgba(111, 151, 234, 0.18);
      background:
        linear-gradient(180deg, rgba(11, 19, 45, 0.98) 0%, rgba(8, 17, 40, 0.97) 100%);
      box-shadow:
        0 22px 44px rgba(6, 12, 32, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
      display: grid;
      gap: 0.28rem;
    }

    .docs-lang-option {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.75rem;
      text-decoration: none;
      padding: 0.72rem 0.82rem;
      border-radius: 12px;
      border: 1px solid transparent;
      color: rgba(229, 238, 255, 0.88);
      background: transparent;
      font-size: 0.78rem;
      font-weight: 700;
      transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    }

    .docs-lang-option:hover {
      background: rgba(37, 99, 235, 0.12);
      border-color: rgba(110, 159, 255, 0.18);
      color: #ffffff;
      transform: translateY(-1px);
    }

    .docs-lang-option.active {
      background: linear-gradient(180deg, rgba(47, 111, 216, 0.2) 0%, rgba(47, 111, 216, 0.12) 100%);
      border-color: rgba(103, 157, 255, 0.24);
      color: #ffffff;
    }

    .docs-lang-option small {
      color: rgba(171, 193, 235, 0.88);
      font-size: 0.7rem;
      font-weight: 600;
    }

    .home-btn {
      text-decoration: none;
      font-family: "JetBrains Mono", monospace;
      font-size: 0.76rem;
      color: #ffffff;
      border: 1px solid #245ec2;
      background: #2f6fd8;
      border-radius: 999px;
      padding: 7px 12px;
      transition: all 0.2s ease;
    }

    .home-btn:hover {
      color: #ffffff;
      background: #235fc0;
      border-color: #1f56af;
    }

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

    .sidebar {
      position: sticky;
      top: 16px;
      align-self: start;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--panel);
      box-shadow: var(--shadow);
      padding: 16px;
    }

    .sidebar h2 {
      margin: 0;
      font-size: 0.86rem;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: #3f5e94;
    }

    .sidebar ul {
      margin: 12px 0 0;
      padding: 0;
      list-style: none;
      display: grid;
      gap: 6px;
    }

    .sidebar a {
      display: block;
      text-decoration: none;
      color: var(--muted);
      font-weight: 600;
      font-size: 0.9rem;
      border-radius: 8px;
      padding: 8px 10px;
      border: 1px solid transparent;
    }

    .sidebar a:hover {
      color: #204f9f;
      border-color: #c9daf2;
      background: #f4f8ff;
    }

    .sidebar-note {
      margin-top: 12px;
      border: 1px solid #d8e4f6;
      background: #f7faff;
      border-radius: 10px;
      padding: 10px;
      color: #4f668a;
      font-size: 0.78rem;
      line-height: 1.5;
    }

    .main {
      display: grid;
      gap: 14px;
      min-width: 0;
    }

    .hero {
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--panel);
      box-shadow: var(--shadow);
      padding: 18px;
    }

    .hero h1 {
      margin: 0;
      color: var(--title);
      font-size: clamp(1.45rem, 2.4vw, 2rem);
    }

    .hero p {
      margin: 10px 0 0;
      color: var(--muted);
      line-height: 1.7;
    }

    .meta {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 14px;
      justify-content: center;
    }

    .meta span {
      font-family: "JetBrains Mono", monospace;
      font-size: 0.76rem;
      border-radius: 999px;
      padding: 7px 11px;
      color: #33588f;
      border: 1px solid var(--line-strong);
      background: var(--primary-soft);
    }

    .card {
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--panel);
      box-shadow: var(--shadow);
      padding: 16px;
    }

    .card h2 {
      margin: 0 0 10px;
      color: var(--title);
      font-size: 1.05rem;
    }

    .quick ul {
      margin: 0;
      padding-left: 18px;
      display: grid;
      gap: 8px;
    }

    .quick li {
      color: var(--muted);
    }

    code {
      font-family: "JetBrains Mono", monospace;
      font-size: 0.79rem;
      border: 1px solid #d5e2f6;
      background: #f6f9ff;
      color: #284a80;
      border-radius: 8px;
      padding: 0.18rem 0.48rem;
      line-height: 2.6;
      margin: 0;
      white-space: normal;
      overflow-wrap: anywhere;
      word-break: break-word;
      vertical-align: baseline;
    }

    .endpoint {
      border: 1px solid #dbe4f3;
      border-radius: 12px;
      overflow: hidden;
      margin-top: 10px;
    }

    .endpoint-head {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 10px;
      padding: 12px;
      background: var(--panel-soft);
      border-bottom: 1px solid #dbe4f3;
    }

    .method {
      font-family: "JetBrains Mono", monospace;
      font-size: 0.74rem;
      font-weight: 700;
      border-radius: 999px;
      padding: 5px 10px;
      border: 1px solid transparent;
      min-width: 52px;
      text-align: center;
    }

    .get {
      background: var(--get-bg);
      border-color: #c0ecd5;
      color: var(--get-text);
    }

    .post {
      background: var(--post-bg);
      border-color: #c8dafd;
      color: var(--post-text);
    }

    .endpoint-body {
      padding: 12px;
      display: grid;
      gap: 10px;
    }

    .endpoint-body p {
      margin: 0;
      color: var(--muted);
      line-height: 1.78;
    }

    table {
      width: 100%;
      table-layout: fixed;
      border-collapse: collapse;
      font-size: 0.86rem;
      border: 1px solid #e0e8f4;
      border-radius: 10px;
      overflow: hidden;
    }

    th,
    td {
      padding: 9px 10px;
      text-align: left;
      border-bottom: 1px solid #e8eef7;
      vertical-align: top;
      overflow-wrap: anywhere;
      word-break: break-word;
      hyphens: auto;
      line-height: 1.72;
    }

    td code,
    th code {
      display: inline;
      max-width: 100%;
    }

    .chip-line {
      display: grid;
      gap: 8px;
      padding: 2px 0 4px;
    }

    .chip-line-label {
      color: var(--muted);
      line-height: 1.72;
    }

    .chip-group {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: flex-start;
    }

    .chip-group code {
      display: inline-block;
      padding: 0.24rem 0.6rem;
      margin: 0;
      line-height: 1.45;
    }

    .chip-note {
      margin-top: 8px;
      color: var(--muted);
      line-height: 1.72;
    }

    .mailbox-events-endpoint .endpoint-body > p:first-child {
      margin-bottom: -2px;
    }

    .mailbox-events-endpoint td {
      padding-top: 12px;
      padding-bottom: 12px;
    }

    th {
      background: #f8fbff;
      color: #35527f;
      font-size: 0.8rem;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    tr:last-child td {
      border-bottom: none;
    }

    pre {
      margin: 0;
      overflow: auto;
      border: 1px solid #d9e5f8;
      border-radius: 10px;
      padding: 12px;
      background: #f6f9ff;
      font-family: "JetBrains Mono", monospace;
      font-size: 0.78rem;
      line-height: 1.55;
      color: #25406e;
    }

    .error-list {
      display: grid;
      gap: 8px;
    }

    .error-row {
      border: 1px solid #ecd4d4;
      border-radius: 10px;
      background: #fff8f8;
      padding: 10px 12px;
      display: flex;
      gap: 10px;
      align-items: flex-start;
    }

    .error-row strong {
      font-family: "JetBrains Mono", monospace;
      background: var(--danger-bg);
      color: var(--danger-text);
      border: 1px solid #efc8c8;
      border-radius: 999px;
      padding: 3px 8px;
      min-width: 52px;
      text-align: center;
      font-size: 0.74rem;
    }

    .section-desc {
      margin: 0 0 10px;
      color: var(--muted);
      line-height: 1.6;
    }

    .footer {
      color: #778cab;
      font-size: 0.85rem;
      font-family: "JetBrains Mono", monospace;
      margin-top: 2px;
    }

    .scroll-top-fab {
      position: fixed;
      right: 18px;
      bottom: 18px;
      width: 46px;
      height: 46px;
      border-radius: 999px;
      border: 1px solid #255dc0;
      background: #2f6fd8;
      color: #ffffff;
      font-size: 1.05rem;
      font-weight: 700;
      line-height: 1;
      cursor: pointer;
      box-shadow: 0 12px 24px rgba(27, 62, 130, 0.28);
      opacity: 0;
      transform: translateY(10px);
      pointer-events: none;
      transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
      z-index: 999;
    }

    .scroll-top-fab:hover {
      background: #255fc1;
    }

    .scroll-top-fab:focus-visible {
      outline: 2px solid #1f56af;
      outline-offset: 2px;
    }

    .scroll-top-fab.show {
      opacity: 1;
      transform: translateY(0);
      pointer-events: auto;
    }

    .read-progress {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 5px;
      background: rgba(35, 99, 209, 0.12);
      z-index: 1000;
    }

    .read-progress-bar {
      width: 0%;
      height: 100%;
      background: linear-gradient(90deg, #2f6fd8 0%, #23a2d1 100%);
      transition: width 0.1s linear;
    }

    .read-progress-label {
      position: fixed;
      top: 8px;
      right: 14px;
      font-family: "JetBrains Mono", monospace;
      font-size: 0.72rem;
      color: #ffffff;
      background: rgba(35, 99, 209, 0.92);
      border: 1px solid rgba(31, 86, 175, 0.9);
      border-radius: 999px;
      padding: 3px 8px;
      z-index: 1001;
      box-shadow: 0 8px 18px rgba(21, 56, 120, 0.28);
      user-select: none;
    }

    @media (max-width: 1024px) {
      .layout {
        grid-template-columns: 1fr;
      }

      .sidebar {
        position: static;
      }

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

    @media (max-width: 720px) {
      .wrap {
        width: 95vw;
        padding: 14px 0 38px;
      }

      .layout,
      .hero,
      .card,
      .endpoint,
      .endpoint-body,
      .quick li,
      .meta {
        min-width: 0;
      }

      .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 12px;
      }

      .topbar-actions {
        width: 100%;
        flex-wrap: wrap;
      }

      .brand strong {
        font-size: 1.22rem;
      }

      .brand span {
        font-size: 0.88rem;
      }

      .sidebar {
        max-height: 48vh;
        overflow: auto;
      }

      .sidebar ul {
        grid-template-columns: 1fr;
        gap: 4px;
      }

      .sidebar a {
        font-size: 0.86rem;
        padding: 8px 9px;
      }

      .meta {
        justify-content: flex-start;
      }

      .meta span,
      .endpoint-head code,
      .quick li code,
      .card code {
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
      }

      .hero,
      .card,
      .sidebar {
        padding: 12px;
      }

      table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
      }

      pre {
        font-size: 0.73rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
      }

      .read-progress-label {
        top: 10px;
        right: 10px;
        font-size: 0.68rem;
        padding: 2px 7px;
      }

      .scroll-top-fab {
        right: 12px;
        bottom: 12px;
        width: 42px;
        height: 42px;
      }
    }

    @media (max-width: 480px) {
      .wrap {
        width: 96vw;
        padding: 10px 0 28px;
      }

      .brand strong {
        font-size: 1.1rem;
      }

      .hero h1 {
        font-size: 1.25rem;
      }

      .topbar-actions {
        gap: 6px;
      }

      .docs-lang-trigger,
      .home-btn,
      .badge {
        font-size: 0.72rem;
        padding: 6px 10px;
      }

      .docs-lang-menu {
        right: auto;
        left: 0;
        min-width: 160px;
      }
    }
