html {
    scroll-behavior: smooth;
  }

  .doc {
    width: 950px;
    margin: 0 auto;
    padding: 0 0.25rem 2.5rem;
    text-align: left;
  }

  .doc-head {
    margin: 0 0 1.1rem;
  }

  .doc-title {
    font-size: 2.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
  }

  .doc-sub {
    margin-top: 0.35rem;
    font-size: 14px;
    color: #555;
  }

  .doc-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 1rem;
    align-items: start;
  }

  .toc {
    position: sticky;
    top: 5.5rem;
    border: 1px solid #e5e5e5;
    background: #fafafa;
    border-radius: 14px;
    padding: 0.85rem 0.9rem;
  }

  .toc-title {
    font-size: 13px;
    font-weight: 700;
    color: #444;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.55rem;
  }

  .toc a {
    display: block;
    text-decoration: none;
    color: #666;
    font-size: 13px;
    padding: 0.32rem 0.4rem;
    border-radius: 10px;
    position: relative;
  }

  .toc a span{
    position: relative;
    display: inline-block;
  }

  .toc a span::after{
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 1px;
    background: currentColor;
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left;
    transition: opacity .18s ease, transform .18s ease;
    border-radius: 1px;
  }

  .toc a.is-active span::after{
    opacity: 1;
    transform: scaleX(1);
  }

 .toc a.is-active {
    color: #111;
  }

  .dark-mode .toc a.is-active {
    color: #fff;
  }

  .toc a:hover {
    background: #f2f2f2;
    color: #111;
  }

  .doc-section {
    border: 1px solid #e5e5e5;
    background: #fafafa;
    border-radius: 14px;
    padding: 0.95rem 1rem;
    margin-bottom: 0.9rem;
    scroll-margin-top: 6.25rem;
  }

  .sec-title {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.55rem;
  }

  .sec-title .material-symbols-outlined {
    font-size: 18px;
  }

  .sec-text {
    font-size: 13px;
    color: #555;
    margin-bottom: 0.75rem;
    line-height: 1.55;
  }

  .chips {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
  }

  .chip {
    border: 1px solid #e5e5e5;
    background: #fff;
    border-radius: 999px;
    padding: 0.22rem 0.55rem;
    font-size: 12px;
    color: #444;
  }

  .steps {
    display: grid;
    gap: 0.55rem;
  }

  .step {
    border: 1px solid #e5e5e5;
    background: #fff;
    border-radius: 14px;
    padding: 0.75rem 0.8rem;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 0.7rem;
  }

  .step-num {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid #e5e5e5;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: #111;
  }

  .step h4 {
    font-size: 14px;
    margin-bottom: 0.25rem;
  }

  .step p {
    font-size: 13px;
    color: #555;
    line-height: 1.55;
  }

  .code-block {
    position: relative;
    margin-top: 0.6rem;
    border: 1px solid #e5e5e5;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
  }

  .code-block pre {
    margin: 0;
    border: none;
    background: transparent;
    color: #111;
    padding: 0.75rem 0.85rem;
    padding-right: 3.1rem;
    overflow: auto;
    font-size: 12px;
    line-height: 1.55;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  }

  .copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    height: 28px;
    width: 28px;
    border-radius: 10px;
    border: 1px solid #e5e5e5;
    background: #fafafa;
    color: #111;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
  }

  .copy-btn:hover {
    background: #f2f2f2;
    border-color: #d7d7d7;
  }

  .copy-btn .material-symbols-outlined {
    font-size: 18px;
    line-height: 1;
    color: #666;
  }

  .copy-btn.is-copied .material-symbols-outlined {
    color: #B36BED;
  }

  .callout {
    border: 1px solid #e5e5e5;
    background: #fff;
    border-radius: 14px;
    padding: 0.75rem 0.8rem;
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .callout .material-symbols-outlined {
    font-size: 18px;
    color: #666;
    margin-top: 1px;
  }

  .callout p {
    font-size: 13px;
    color: #555;
    line-height: 1.55;
  }

  .table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid #e5e5e5;
    background: #fff;
  }

  .table th, .table td {
    padding: 0.55rem 0.65rem;
    font-size: 13px;
    border-bottom: 1px solid #eee;
    text-align: left;
    vertical-align: top;
  }

  .table th {
    font-weight: 700;
    background: #fafafa;
  }

  .table tr:last-child td {
    border-bottom: none;
  }

  .muted {
    color: #777;
    font-size: 12px;
  }

  .faq{
    display:grid;
    gap:.55rem;
  }
  
  .faq-item{
    border:1px solid #e5e5e5;
    background:#fff;
    border-radius:14px;
    overflow:hidden;
  }
  
  .faq-q{
    width:100%;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:.75rem;
    padding:.75rem .85rem;
    border:0;
    background:transparent;
    cursor:pointer;
    text-align:left;
    font-size:13px;
    font-weight:700;
    color:#111;
  }
  
  .faq-q:hover{
    background:transparent;
  }
  
  .faq-ico{
    font-size:20px;
    color:#666;
    transition: transform .18s ease;
  }
  
  .faq-item.is-open .faq-ico{
    transform: rotate(180deg);
  }
  
  .faq-a{
    max-height:0;
    overflow:hidden;
    opacity:0;
    transform: translateY(-2px);
    padding:0 .85rem;
    transition:
      max-height .32s cubic-bezier(.22,1,.36,1),
      opacity .18s ease,
      transform .18s ease,
      padding .22s ease;
  }
  
  .faq-item.is-open .faq-a{
    opacity:1;
    transform: translateY(0);
    padding:0 .85rem 1.1rem;
  }
  
  .faq-a p{
    margin:.1rem 0 .6rem;
    font-size:13px;
    color:#555;
    line-height:1.55;
  }

  .format-chip{
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    letter-spacing:.02em;
  }
  
  .dark-mode .faq-item{
    border-color:#333;
    background:#121212;
  }
  
  .dark-mode .faq-q{color:#eee}
  .dark-mode .faq-q:hover{background:transparent}
  .dark-mode .faq-ico{color:#bbb}
  .dark-mode .faq-a p{color:#bbb}

  .dark-mode .doc-sub, .dark-mode .sec-text, .dark-mode .step p, .dark-mode .callout p { color: #bbb; }
  .dark-mode .toc, .dark-mode .doc-section { border-color: #333; background: #1a1a1a; }
  .dark-mode .toc a { color: #bbb; }
  .dark-mode .toc-title{ color:#ddd; }
  .dark-mode .toc-title .material-symbols-outlined{ color:#bbb; }
  .dark-mode .toc a:hover { background: #202020; color: #fff; }
  .dark-mode .step { border-color: #333; background: #121212; }
  .dark-mode .step-num { border-color: #333; background: #1a1a1a; color: #eee; }
  .dark-mode .chip { border-color: #333; background: #121212; color: #ddd; }
  .dark-mode .table { border-color: #333; background: #121212; }
  .dark-mode .table th { background: #1a1a1a; }
  .dark-mode .table th, .dark-mode .table td { border-bottom-color: #222; }

  .dark-mode .muted{
    color:#8b8b8b;
  }

  .dark-mode .code-block {
    border-color: #333;
    background: #0d0d0d;
  }

  .dark-mode .code-block pre {
    color: #eee;
  }

  .dark-mode .copy-btn {
    border-color: #333;
    background: #121212;
    color: #eee;
  }

  .dark-mode .copy-btn:hover {
    background: #1a1a1a;
    border-color: #444;
  }

  .dark-mode .copy-btn .material-symbols-outlined {
    color: #bbb;
  }

  .dark-mode .copy-btn.is-copied .material-symbols-outlined {
    color: #B36BED;
  }

  .dark-mode .callout {
    border-color: #333;
    background: #121212;
  }

  .dark-mode .callout .material-symbols-outlined {
    color: #bbb;
  }

  .dark-mode .callout p {
    color: #bbb;
  }

  @media (max-width: 1040px) {
    .doc { width: 92vw; }
  }

  @media (max-width: 860px) {
    .doc-layout { grid-template-columns: 1fr; }
    .toc { position: relative; top: auto; }
  }

  /* ══════════════════════════════════════
     Mobile layout — docs page
  ═══════════════════════════════════════ */
  @media (max-width: 960px) {
    .doc {
      width: 100%;
      padding: 0 0.9rem 2rem;
    }

    .doc-title { font-size: 1.5rem; }
    .doc-sub   { font-size: 13px; }

    /* Bump scroll-margin so sections aren't hidden under the sticky mobile navbar */
    .doc-section {
      scroll-margin-top: 4.5rem;
    }

    /* ── TOC: move to top as a horizontal scrollable chip strip ── */
    .toc {
      order: -1;
      display: flex;
      flex-direction: row;
      flex-wrap: nowrap;
      overflow-x: auto;
      gap: 0.4rem;
      padding: 0.55rem 0.5rem;
      border-radius: 12px;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
    }

    .toc::-webkit-scrollbar { display: none; }

    .toc-title { display: none; }

    .toc a {
      display: inline-flex;
      white-space: nowrap;
      padding: 0.3rem 0.75rem;
      border-radius: 999px;
      background: #f0f0f0;
      border: 1px solid #e8e8e8;
      font-size: 12.5px;
      color: #555;
    }

    .toc a:hover { background: #e8e8e8; color: #111; }

    .toc a.is-active {
      background: #111;
      color: #fff;
      border-color: #111;
    }

    /* ── Tables: horizontal scroll instead of overflow ── */
    .table {
      display: block;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      white-space: nowrap;
    }

    .table th, .table td {
      font-size: 12px;
      min-width: 80px;
    }

    /* ── hub-explain already collapses at 860px, tighten spacing ── */
    .hub-explain {
      padding: 0.85rem 0.9rem;
      gap: 0.9rem;
      margin-top: 1.2rem;
    }

    /* ── Dark mode chips ── */
    .dark-mode .toc a {
      background: #222;
      border-color: #333;
      color: #bbb;
    }

    .dark-mode .toc a:hover {
      background: #2a2a2a;
      color: #eee;
    }

    .dark-mode .toc a.is-active {
      background: #eee;
      color: #111;
      border-color: #eee;
    }
  }

/* Explain image container */
.hub-explain{
  margin-top: 2.2rem;
  display: grid;
  grid-template-columns: minmax(0,1fr) 320px;
  gap: 1.4rem;
  padding: 1.2rem 1.3rem;
  border-radius: 18px;
  background: #fafafa;
}

.hub-explain-title{
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: .35rem;
}

.hub-explain-text p{
  font-size: 13px;
  color: #555;
  line-height: 1.55;
}

.hub-explain-image img{
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid #e5e5e5;
  background: #fff;
}

/* Dark mode */
.dark-mode .hub-explain{
  background: #1a1a1a;
  border-color: #333;
}

.dark-mode .hub-explain-text p{ color:#bbb; }

.dark-mode .hub-explain-image img{
  background:#121212;
  border-color:#333;
}

@media (max-width: 860px){
  .hub-explain{
    grid-template-columns: 1fr;
  }
}