/* Softifex documentation: a plain reading layout (sidebar, article, on-this-page) */
:root {
  --bg: #ffffff;
  --panel: #f6f8fb;
  --text: #1b2a3b;
  --muted: #5b6b7e;
  --line: #e1e7ef;
  --brand: #27587b;
  --brand2: #3f7fb8;
  --link: #1f6fb5;
  --code: #eef2f7;
  --hl: #fff6d6;
  --note: #eaf3fc;
  --note-b: #9cc6ee;
  --tip: #e9f7ef;
  --tip-b: #8fd1ac;
  --warn: #fff3e0;
  --warn-b: #f0b866;
  --info: #eef0fb;
  --info-b: #aab3ee;
  --side: 300px;
  --top: 62px;
  --shadow: 0 8px 30px rgba(15, 39, 66, 0.12);
}
html[data-theme="dark"] {
  --bg: #0c1522;
  --panel: #111e2f;
  --text: #dfe8f3;
  --muted: #93a6bb;
  --line: #223349;
  --brand: #8ec1ee;
  --brand2: #4f9cf0;
  --link: #7db8ef;
  --code: #16273b;
  --hl: #3a3320;
  --note: #10253b;
  --note-b: #2c5a86;
  --tip: #0f2a22;
  --tip-b: #2b7a58;
  --warn: #2c2314;
  --warn-b: #8a6420;
  --info: #1a1f3a;
  --info-b: #4a53a8;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--top) + 18px);
}
body {
  font:
    16px/1.7 "Outfit",
    "Segoe UI",
    system-ui,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
img {
  max-width: 100%;
  display: block;
}
code,
kbd {
  font:
    0.88em Consolas,
    "Cascadia Mono",
    monospace;
  background: var(--code);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
}
kbd {
  border-bottom-width: 2px;
}

/* top bar */
.top {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--top);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  z-index: 50;
}
.top .burger {
  display: none;
  border: 1px solid var(--line);
  background: none;
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.05rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
}
.logo:hover {
  text-decoration: none;
}
.logo .lg {
  width: 171px;
  height: 52px;
  overflow: hidden;
  position: relative;
}
.logo .lg img {
  position: absolute;
  width: 196px;
  max-width: none;
  left: -12px;
  top: -26px;
}
.logo .lg .w {
  display: none;
}
html[data-theme="dark"] .logo .lg .d {
  display: none;
}
html[data-theme="dark"] .logo .lg .w {
  display: block;
}
.logo .tag {
  font-weight: 600;
  color: var(--muted);
  padding-left: 12px;
  border-left: 1px solid var(--line);
  font-size: 0.95rem;
}
.top .sp {
  flex: 1;
}
.top .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font:
    600 0.88rem "Outfit",
    sans-serif;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
}
.top .btn:hover {
  border-color: var(--brand2);
  text-decoration: none;
}
.top .btn.p {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
html[data-theme="dark"] .top .btn.p {
  color: #07203a;
}

/* sidebar */
.side {
  position: fixed;
  top: var(--top);
  bottom: 0;
  left: 0;
  width: var(--side);
  background: var(--panel);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  padding: 16px 14px 40px;
  z-index: 40;
}
.sq {
  position: relative;
  margin-bottom: 14px;
}
.sq i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.85rem;
}
.sq input {
  width: 100%;
  font: inherit;
  font-size: 0.92rem;
  padding: 10px 38px 10px 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  outline: none;
}
.sq input:focus {
  border-color: var(--brand2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand2) 20%, transparent);
}
.sq kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.72rem;
  padding: 0 6px;
}
.gh {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 16px 10px 6px;
}
.side a.nl {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 9px;
  color: var(--text);
  font-size: 0.93rem;
  border-left: 3px solid transparent;
}
.side a.nl i {
  width: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}
.side a.nl:hover {
  background: color-mix(in srgb, var(--brand2) 10%, transparent);
  text-decoration: none;
}
.side a.nl.on {
  background: color-mix(in srgb, var(--brand2) 16%, transparent);
  border-left-color: var(--brand2);
  font-weight: 600;
  color: var(--brand);
}
.side a.nl.on i {
  color: var(--brand2);
}
.side .none {
  display: none;
  padding: 14px 10px;
  color: var(--muted);
  font-size: 0.9rem;
}
.backdrop {
  display: none;
}

/* article */
main {
  margin-left: var(--side);
  padding-top: var(--top);
}
.cols {
  display: flex;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 40px;
}
article {
  flex: 1;
  min-width: 0;
  max-width: 830px;
  padding: 34px 0 80px;
}
aside.toc {
  width: 220px;
  flex: none;
  position: sticky;
  top: calc(var(--top) + 30px);
  align-self: flex-start;
  max-height: calc(100vh - var(--top) - 60px);
  overflow: auto;
  margin-left: 36px;
  padding-top: 40px;
  font-size: 0.88rem;
  display: none;
}
aside.toc h6 {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
aside.toc a {
  display: block;
  padding: 4px 0 4px 12px;
  border-left: 2px solid var(--line);
  color: var(--muted);
}
aside.toc a:hover {
  color: var(--text);
  text-decoration: none;
}
aside.toc a.on {
  border-left-color: var(--brand2);
  color: var(--brand);
  font-weight: 600;
}
@media (min-width: 1320px) {
  aside.toc {
    display: block;
  }
}

section.doc {
  padding: 42px 0 30px;
  border-bottom: 1px solid var(--line);
}
section.doc:first-of-type {
  padding-top: 8px;
}
.crumb {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand2);
}
h2 {
  font-size: 2rem;
  line-height: 1.2;
  font-weight: 700;
  margin: 6px 0 16px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}
h2 .ic {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--brand2) 14%, transparent);
  color: var(--brand2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex: none;
}
h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 28px 0 10px;
  position: relative;
}
h4 {
  font-size: 1rem;
  font-weight: 700;
  margin: 20px 0 8px;
  color: var(--muted);
}
.anchor {
  opacity: 0;
  margin-left: 8px;
  color: var(--muted);
  font-size: 0.8em;
}
h2:hover .anchor,
h3:hover .anchor {
  opacity: 1;
}
p {
  margin: 10px 0;
}
.lead {
  font-size: 1.15rem;
  color: var(--muted);
}
ul,
ol {
  margin: 10px 0 10px 22px;
}
li {
  margin: 5px 0;
}
ul li::marker {
  color: var(--brand2);
}
b,
strong {
  font-weight: 600;
}

.where {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 14px 0;
  font-size: 0.92rem;
}
.where i {
  color: var(--brand2);
}
.where code {
  margin-left: auto;
}

/* numbered steps */
ol.steps {
  list-style: none;
  margin: 14px 0;
  counter-reset: s;
}
ol.steps li {
  counter-increment: s;
  position: relative;
  padding: 2px 0 2px 46px;
  margin: 12px 0;
  min-height: 32px;
}
ol.steps li:before {
  content: counter(s);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
html[data-theme="dark"] ol.steps li:before {
  color: #07203a;
}

/* tables */
.tw {
  overflow-x: auto;
  margin: 14px 0;
}
.tw table {
  min-width: 520px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}
thead th {
  background: var(--panel);
  text-align: left;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
tbody tr:hover td {
  background: color-mix(in srgb, var(--brand2) 5%, transparent);
}
td:first-child {
  min-width: 130px;
}
.req {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: #b3261e;
  background: color-mix(in srgb, #e5484d 13%, transparent);
  padding: 1px 9px;
  border-radius: 20px;
}
.opt {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--code);
  padding: 1px 9px;
  border-radius: 20px;
}
html[data-theme="dark"] .req {
  color: #ff8a8f;
}

/* callouts */
.callout {
  display: flex;
  gap: 14px;
  border: 1px solid;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 18px 0;
}
.callout i {
  margin-top: 4px;
  font-size: 1.05rem;
}
.callout p {
  margin: 3px 0 0;
}
.callout.note {
  background: var(--note);
  border-color: var(--note-b);
}
.callout.note i {
  color: #2a7fd4;
}
.callout.tip {
  background: var(--tip);
  border-color: var(--tip-b);
}
.callout.tip i {
  color: #1f9e63;
}
.callout.warn {
  background: var(--warn);
  border-color: var(--warn-b);
}
.callout.warn i {
  color: #e08a1e;
}
.callout.info {
  background: var(--info);
  border-color: var(--info-b);
}
.callout.info i {
  color: #5560d6;
}

/* flow diagram */
.flow {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  margin: 18px 0;
  background: var(--panel);
}
.flow-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.flow-row:last-child {
  border-bottom: 0;
}
.flow-tag {
  flex: 0 0 150px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--brand);
}
.flow-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.flow-steps b {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 5px 12px;
  font-size: 0.86rem;
  font-weight: 600;
}
.flow-steps i {
  color: var(--brand2);
  font-size: 0.8rem;
}
.flow-or {
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
}

/* figures */
figure {
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel);
}
figure img {
  width: 100%;
}
figcaption {
  padding: 10px 14px;
  font-size: 0.86rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.phones {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 20px 0;
}
.phones figure {
  margin: 0;
}
@media (max-width: 760px) {
  .phones {
    grid-template-columns: repeat(2, 1fr);
  }
}

.pn {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin: 34px 0 0;
}
.pn a {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text);
  background: var(--panel);
}
.pn a:hover {
  border-color: var(--brand2);
  text-decoration: none;
}
.pn small {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.pn a.n {
  text-align: right;
}
.pn span.gap {
  flex: 1;
}
footer.foot {
  margin-left: var(--side);
  padding: 30px 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}
mark {
  background: var(--hl);
  color: inherit;
  padding: 0 2px;
  border-radius: 3px;
}

/* small screens */
@media (max-width: 980px) {
  .top .burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .top .tag,
  .top .hide-s {
    display: none;
  }
  .side {
    transform: translateX(-102%);
    transition: transform 0.25s;
    box-shadow: var(--shadow);
  }
  body.menu .side {
    transform: none;
  }
  body.menu .backdrop {
    display: block;
    position: fixed;
    inset: var(--top) 0 0 0;
    background: rgba(5, 15, 30, 0.5);
    z-index: 35;
  }
  main,
  footer.foot {
    margin-left: 0;
  }
  .cols {
    padding: 0 18px;
  }
  h2 {
    font-size: 1.6rem;
  }
  .where code {
    margin-left: 0;
  }
  .flow-tag {
    flex-basis: 100%;
  }
}
@media print {
  .top,
  .side,
  aside.toc,
  .pn,
  .backdrop {
    display: none !important;
  }
  main,
  footer.foot {
    margin: 0;
  }
  section.doc {
    break-inside: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .side {
    transition: none;
  }
}
