/* docs.ashikanw.com. Colors follow ashikanw.com (src/styles/global.css). */
:root {
  --bg: #ffffff;
  --surface: #f4f6f9;
  --surface-2: #eef1f5;
  --line: #dde2e9;
  --ink: #101720;
  --ink-2: #414b58;
  --ink-3: #6b7583;
  --b: #14497e;
  --b-deep: #0c2f53;
  --b-tint: #eaeff6;
  --b-line: #b9c8dc;
  --code-bg: #0f1a27;
  --code-ink: #dbe4ee;
  --get: #16704a; --get-tint: #e9f4ef;
  --post: #14497e; --post-tint: #eaeff6;
  --put: #8a5d0b; --put-tint: #fbf3e4;
  --delete: #a8322c; --delete-tint: #fbeeed;
  --font: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r: 8px;
  --header-h: 60px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d141c;
    --surface: #131c27;
    --surface-2: #18232f;
    --line: #253244;
    --ink: #e6ecf2;
    --ink-2: #b4bfcb;
    --ink-3: #8592a1;
    --b: #6ea8e0;
    --b-deep: #9cc4ec;
    --b-tint: #15263a;
    --b-line: #2c4561;
    --code-bg: #08101a;
    --get: #5cc79a; --get-tint: #11281f;
    --post: #6ea8e0; --post-tint: #15263a;
    --put: #e0b25c; --put-tint: #2a2213;
    --delete: #ec8a84; --delete-tint: #2c1716;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.85 var(--font); }
a { color: var(--b); text-underline-offset: 2px; }
a:hover { color: var(--b-deep); }
code { font-family: var(--mono); font-size: 0.88em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 0.05em 0.35em; overflow-wrap: anywhere; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--b); color: #fff; padding: 6px 12px; border-radius: var(--r); z-index: 50; }
.skip:focus { left: 8px; }

/* header */
.top { position: sticky; top: 0; z-index: 30; height: var(--header-h); display: flex; align-items: center; gap: 14px; padding: 0 20px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { height: 26px; width: auto; display: block; }
@media (prefers-color-scheme: dark) { .brand img { filter: brightness(0) invert(0.92); } }
.brand span { font-weight: 700; font-size: 14px; padding-left: 10px; border-left: 1px solid var(--line); color: var(--ink-2); }
.top-links { margin-left: auto; display: flex; gap: 18px; font-size: 13px; }
.top-links a { color: var(--ink-2); text-decoration: none; }
.top-links a:hover { color: var(--b); }
.menu { display: none; width: 40px; height: 40px; margin-left: -8px; border: 0; background: none; border-radius: var(--r); cursor: pointer; padding: 10px; }
.menu span { display: block; height: 2px; background: var(--ink); border-radius: 2px; margin: 4px 0; transition: transform .2s, opacity .2s; }
.menu[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* layout */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr) 200px; gap: 40px; max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.side { position: sticky; top: var(--header-h); align-self: start; max-height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 28px 0; }
.nav-group { margin-bottom: 22px; }
.nav-group p { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--ink-3); }
.nav-group ul { list-style: none; margin: 0; padding: 0; }
.nav-group a { display: block; padding: 5px 10px; margin-left: -10px; border-radius: 6px; color: var(--ink-2); text-decoration: none; font-size: 14px; }
.nav-group a:hover { background: var(--surface); color: var(--ink); }
.nav-group a[aria-current] { background: var(--b-tint); color: var(--b); font-weight: 700; }
.toc { position: sticky; top: var(--header-h); align-self: start; padding: 32px 0; font-size: 13px; }
.toc p { margin: 0 0 8px; font-weight: 700; color: var(--ink-3); font-size: 12px; }
.toc ul { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 1px solid var(--line); }
.toc li { margin: 4px 0; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover, .toc a.on { color: var(--b); }

/* content */
.content { padding: 32px 0 80px; min-width: 0; max-width: 780px; }
.content h1 { font-size: clamp(26px, 3.4vw, 32px); line-height: 1.4; margin: 0 0 14px; letter-spacing: .01em; }
.content h2 { font-size: 21px; line-height: 1.5; margin: 52px 0 12px; padding-top: 4px; position: relative; }
.content h3 { font-size: 17px; margin: 32px 0 8px; }
.content p, .content ul, .content ol { margin: 0 0 14px; }
.content li { margin: 4px 0; }
.lead { font-size: 16px; color: var(--ink-2); }
.anchor { position: absolute; left: -20px; color: var(--ink-3); text-decoration: none; opacity: 0; font-weight: 400; }
h2:hover .anchor { opacity: 1; }
.button { display: inline-block; background: var(--b); color: #fff; padding: 9px 18px; border-radius: var(--r); text-decoration: none; font-weight: 700; }
.button:hover { color: #fff; background: var(--b-deep); }
@media (prefers-color-scheme: dark) { .button, .button:hover { color: #0d141c; } }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 26px 0 8px; }
.card { display: grid; gap: 6px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); background: linear-gradient(160deg, var(--b-tint), var(--bg) 60%); transition: border-color .2s, transform .2s; }
.card:hover { border-color: var(--b-line); color: var(--ink); transform: translateY(-2px); }
.card-k { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--b); letter-spacing: .06em; }
.card strong { font-size: 17px; }
.card span:last-child { font-size: 13.5px; color: var(--ink-2); line-height: 1.75; }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 44px; margin: 0 0 22px; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 2px; width: 28px; height: 28px; border-radius: 50%; background: var(--b); color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; line-height: 1; }
@media (prefers-color-scheme: dark) { .steps > li::before { color: #0d141c; } }
.steps > li > strong { display: block; font-size: 16px; margin-bottom: 4px; }

/* code */
.code { position: relative; margin: 10px 0 18px; border-radius: 10px; background: var(--code-bg); border: 1px solid color-mix(in srgb, var(--code-bg) 70%, var(--line)); }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; }
.code code { background: none; border: 0; padding: 0; color: var(--code-ink); font-size: 13px; line-height: 1.7; overflow-wrap: normal; white-space: pre; }
.code-lang { display: block; padding: 8px 18px 0; font: 700 11px var(--mono); color: #8ea3b8; letter-spacing: .04em; }
.code-lang + .copy + pre { padding-top: 6px; }
.copy { position: absolute; top: 6px; right: 6px; font: 12px var(--font); color: #b9c6d4; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 6px; padding: 3px 10px; cursor: pointer; }
.copy:hover { background: rgba(255,255,255,.12); color: #fff; }

/* tables */
.table { overflow-x: auto; margin: 10px 0 20px; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface); font-size: 12.5px; color: var(--ink-2); font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td:first-child { white-space: nowrap; }
table.params td:last-child { white-space: normal; }
table.params:has(th:nth-child(3)) td:nth-child(2) { white-space: nowrap; }
table.list td code { white-space: nowrap; }
table.list td:last-child { min-width: 9em; }

/* endpoints */
.endpoint { margin: 22px 0 40px; padding-top: 6px; }
.endpoint h3 { margin-top: 0; }
.route { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.route code { font-size: 14px; }
.method { display: inline-block; min-width: 54px; text-align: center; font: 700 11.5px var(--mono); padding: 3px 8px; border-radius: 6px; letter-spacing: .03em; }
.m-get { color: var(--get); background: var(--get-tint); }
.m-post { color: var(--post); background: var(--post-tint); }
.m-put { color: var(--put); background: var(--put-tint); }
.m-delete { color: var(--delete); background: var(--delete-tint); }

.foot { border-top: 1px solid var(--line); padding: 26px 24px 40px; text-align: center; font-size: 13px; color: var(--ink-3); }
.foot p { margin: 4px 0; }
.foot a { color: var(--ink-2); }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 220px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 820px) {
  body { font-size: 15px; }
  .top { padding: 0 16px; }
  .menu { display: block; }
  .top-links { display: none; }
  .brand span { display: none; }
  .shell { display: block; padding: 0 16px; }
  .side { position: fixed; inset: var(--header-h) 0 0 0; z-index: 20; max-height: none; background: var(--bg); padding: 20px 20px 40px; transform: translateX(-100%); transition: transform .25s ease; }
  .side.open { transform: none; }
  .content { padding-top: 24px; }
  .anchor { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
