/* Shared stylesheet for cloud.yuwakisa.com. No external resources. */
:root {
  --bg: #fbfaf7;
  --fg: #1d2330;
  --muted: #5d6573;
  --line: #c9ccd3;
  --panel: #f1efe9;
  --link: #1f5fbf;
  --accent: #c2410c;
  --accent-fill: #fde6d3;
  --tint-auth: #dbe7f7;
  --tint-js: #dcefdc;
  --tint-store: #f3e8c8;
  --tint-ext: #ebebe8;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171d;
    --fg: #e6e8ec;
    --muted: #9aa2b1;
    --line: #3a4150;
    --panel: #1b1f27;
    --link: #8ab4f8;
    --accent: #fb923c;
    --accent-fill: #4a2a14;
    --tint-auth: #1f3555;
    --tint-js: #1e4030;
    --tint-store: #4a3f1c;
    --tint-ext: #272b34;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 var(--font-sans);
}
a { color: var(--link); }
code, .mono { font-family: var(--font-mono); font-size: .9em; }
code { background: var(--panel); padding: .05em .3em; border-radius: 3px; overflow-wrap: anywhere; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
header.site { padding: 32px 0 8px; border-bottom: 1px solid var(--line); }
header.site h1 { margin: 0; font-size: 1.7rem; line-height: 1.2; }
header.site p { margin: .3rem 0 0; color: var(--muted); }
main { padding-bottom: 48px; }
h2 { font-size: 1.3rem; margin: 2.4rem 0 .6rem; line-height: 1.25; }
h3 { font-size: 1.05rem; margin: 1.6rem 0 .4rem; }
.prose { max-width: 70ch; }
.prose p, .prose li { margin: .6rem 0; }
.prose ul { padding-left: 1.2rem; }

nav.toc { margin: 1rem 0 0; font-size: .95rem; display: flex; flex-wrap: wrap; gap: .2rem 1rem; }
nav.toc a { white-space: nowrap; }

/* Figures */
figure { margin: 1.2rem 0 1.6rem; }
figure svg { display: block; max-width: 100%; height: auto; margin: 0 auto; color: var(--fg); }
figcaption { max-width: 70ch; margin: .6rem 0 0; font-size: .95rem; color: var(--muted); }
figcaption strong { color: var(--fg); }

/* SVG semantic classes (applied to elements inside inline SVG) */
svg text { fill: currentColor; font-family: var(--font-sans); font-size: 12px; }
svg .b { font-weight: 600; font-size: 13px; }
svg .m { font-family: var(--font-mono); }
svg .dim { fill: var(--muted); }
svg .lbl { paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; }
svg .tr { text-anchor: end; }
svg .tm { text-anchor: middle; }
svg rect { stroke: currentColor; stroke-width: 1.2; fill: none; }
svg .n-auth { fill: var(--tint-auth); }
svg .n-js { fill: var(--tint-js); }
svg .n-store { fill: var(--tint-store); }
svg .n-ext { fill: var(--tint-ext); }
svg .n-accent { fill: var(--accent-fill); stroke: var(--accent); stroke-width: 2.5; }
svg .planned { stroke-dasharray: 5 4; fill: none; }
svg .muted-box { stroke: var(--muted); fill: none; }
svg .region { stroke: var(--line); stroke-width: 1.5; fill: none; }
svg .frame { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; fill: none; }
svg .life { stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 3 4; fill: none; }
svg .e { fill: none; stroke: currentColor; stroke-width: 1.6; }
svg .e-bind { stroke-dasharray: 6 4; }
svg .e-store { stroke-width: 1.1; }
svg .e-acc { stroke: var(--accent); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 1rem 0; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; min-width: 760px; }
th, td { text-align: left; vertical-align: top; padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
thead th { border-bottom: 2px solid var(--fg); font-weight: 600; }
tbody th { font-weight: 600; white-space: nowrap; }
td.none { color: var(--muted); }

.box { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: .8rem 1rem; max-width: 70ch; margin: 1rem 0; }
.box p { margin: .4rem 0; }
.box h3 { margin-top: 0; }

footer { border-top: 1px solid var(--line); padding: 1rem 0 2rem; color: var(--muted); font-size: .9rem; }

/* Cloudflare key */
.key { max-width: 90ch; }
.key dl { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1rem; margin: .4rem 0 0; }
.key dt { font-weight: 600; white-space: nowrap; }
.key .colors { color: var(--muted); font-size: .95rem; }
.key .colors .sw { vertical-align: -2px; }
.key dd { margin: 0; color: var(--muted); }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--fg); flex: none; }
.sw-auth { background: var(--tint-auth); }
.sw-js { background: var(--tint-js); }
.sw-store { background: var(--tint-store); }
.sw-ext { background: var(--tint-ext); }
@media (max-width: 600px) {
  .key dl { grid-template-columns: 1fr; gap: .1rem; }
  .key dd { margin-bottom: .5rem; }
}

@media print {
  :root { --bg: #fff; --fg: #000; --muted: #444; --line: #aaa; --panel: #f4f4f4; --link: #000;
          --tint-auth: #e3ecf8; --tint-js: #e3f1e3; --tint-store: #f5edd2; --tint-ext: #eee; --accent: #b03a00; --accent-fill: #fde6d3; }
  body { font-size: 11pt; }
  .wrap { max-width: none; padding: 0; }
  figure, table, .box { break-inside: avoid; }
  h2 { break-after: avoid; }
  nav.toc { display: none; }
  .table-wrap { overflow: visible; }
  table { min-width: 0; font-size: 9pt; }
}
