*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;color-scheme:light}
body{margin:0}
img{max-width:100%}
[hidden]{display:none!important}
/* Düzen: solda adım adım bölüm listesi, sağda ayar paneli + terminal görünümlü komut blokları */
:root {
  --bg: #EDF1F3;
  --surface: #FFFFFF;
  --surface-2: #F5F8F9;
  --ink: #15212B;
  --muted: #55636E;
  --line: #D3DCE1;
  --accent: #0B6B73;
  --accent-soft: #D6ECEC;
  --ok: #2B7A4B;
  --ok-soft: #DDF0E4;
  --warn: #9A5B00;
  --warn-soft: #FBEBD2;
  --danger: #B0281F;
  --danger-soft: #F8DEDB;
  --term-bg: #15212B;
  --term-line: #26343F;
  --term-ink: #D5DEE5;
  --term-path: #74B9F2;
  --term-verb: #E07FD6;
  --term-key: #86D293;
  --term-str: #E9C76E;
  --term-cmt: #7C8B96;
  --term-var: rgba(79, 193, 201, .18);
  --term-ph: rgba(233, 120, 100, .28);
  --font-display: "Archivo", "Segoe UI", system-ui, sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E151B; --surface: #152029; --surface-2: #111A21; --ink: #DCE5EC; --muted: #8E9DA8; --line: #263540;
    --accent: #4FC1C9; --accent-soft: #143338; --ok: #6CCB8F; --ok-soft: #16301F; --warn: #E8A54A; --warn-soft: #33260F;
    --danger: #F08A80; --danger-soft: #3A1916; --term-bg: #0A1116; --term-line: #1E2B34; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E151B; --surface: #152029; --surface-2: #111A21; --ink: #DCE5EC; --muted: #8E9DA8; --line: #263540;
  --accent: #4FC1C9; --accent-soft: #143338; --ok: #6CCB8F; --ok-soft: #16301F; --warn: #E8A54A; --warn-soft: #33260F;
  --danger: #F08A80; --danger-soft: #3A1916; --term-bg: #0A1116; --term-line: #1E2B34; color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 16px; line-height: 1.55;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 48px;
}
a { color: var(--accent); }
code { font-family: var(--font-mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.top { max-width: 1200px; margin: 0 auto; padding-block: 32px 20px; display: grid; gap: 8px; }
.top .kicker { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.top h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(28px, 4.5vw, 42px); line-height: 1.1; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
.top p { margin: 0; color: var(--muted); max-width: 68ch; }

.shell { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 32px; align-items: start; }
nav.toc { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 16px); display: grid; gap: 2px; }
nav.toc .label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 10px 6px; }
nav.toc a { display: grid; grid-template-columns: 26px 1fr; align-items: baseline; gap: 4px; padding: 6px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 15px; }
nav.toc a .n { font-family: var(--font-mono); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
nav.toc a:hover { background: var(--surface); }
nav.toc a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
nav.toc a.active .n { color: var(--accent); }
main { min-width: 0; display: grid; gap: 40px; }

/* Ayar paneli */
details.settings { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
details.settings > summary { cursor: pointer; list-style: none; padding: 16px 20px; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; justify-content: space-between; }
details.settings > summary::-webkit-details-marker { display: none; }
details.settings > summary h2 { font-family: var(--font-display); font-size: 20px; margin: 0; }
details.settings > summary span { color: var(--muted); font-size: 14px; }
details.settings[open] > summary { border-bottom: 1px solid var(--line); }
.groups { padding: 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px 24px; }
fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; min-width: 0; }
legend { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); padding: 0; margin-bottom: 4px; }
.field { display: grid; gap: 3px; }
.field label { font-size: 14px; font-weight: 600; }
.field small { color: var(--muted); font-size: 13px; line-height: 1.35; }
input, select { font: inherit; font-size: 15px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; width: 100%; min-width: 0; }
input:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
input.mono { font-family: var(--font-mono); font-size: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.settings-foot { padding: 0 20px 18px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; color: var(--muted); font-size: 14px; }
.lock { display: inline-flex; gap: 6px; align-items: center; }

/* Bölümler */
section.chap { display: grid; gap: 16px; scroll-margin-top: 16px; }
.chap-head { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: baseline; }
.chap-head .num { font-family: var(--font-mono); font-size: 14px; color: var(--accent); font-variant-numeric: tabular-nums; border: 1px solid var(--accent); border-radius: 6px; padding: 1px 7px; }
.chap-head h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(22px, 3vw, 28px); line-height: 1.15; margin: 0; text-wrap: balance; }
.chap-head .copy-all { grid-column: 2; justify-self: start; }
.lead { margin: 0; max-width: 72ch; color: var(--ink); }
.lead p { margin: 0 0 8px; }
.lead ul { margin: 4px 0 0; padding-left: 20px; }
.lead li { margin-bottom: 4px; }

.cmd { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; min-width: 0; }
.cmd-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 10px 12px 10px 16px; }
.cmd-head h3 { font-family: var(--font-body); font-weight: 700; font-size: 16px; margin: 0; flex: 1 1 200px; min-width: 0; }
.pill { font-family: var(--font-mono); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.pill.read { background: var(--ok-soft); color: var(--ok); }
.pill.change { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.ps { background: var(--accent-soft); color: var(--accent); }
button { font: inherit; cursor: pointer; }
.btn { font-size: 14px; font-weight: 600; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 6px; padding: 5px 12px; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.done { border-color: var(--ok); color: var(--ok); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.btn.primary:hover { color: var(--surface); filter: brightness(1.08); }
.term { margin: 0; background: var(--term-bg); color: var(--term-ink); font-family: var(--font-mono); font-size: 13.5px; line-height: 1.65; padding: 14px 16px; overflow-x: auto; white-space: pre; tab-size: 2; border-top: 1px solid var(--term-line); }
.term .p { color: var(--term-path); }
.term .v { color: var(--term-verb); }
.term .k { color: var(--term-key); }
.term .s { color: var(--term-str); }
.term .c { color: var(--term-cmt); font-style: italic; }
.term .b { color: var(--term-path); }
.term .vv { background: var(--term-var); border-radius: 3px; box-shadow: 0 0 0 1px var(--term-var); }
.term .vv.ph { background: var(--term-ph); box-shadow: 0 0 0 1px var(--term-ph); }
.note { margin: 0; padding: 10px 16px 12px; font-size: 15px; color: var(--muted); border-top: 1px solid var(--line); }
.note strong { color: var(--ink); }

.callout { border-left: 3px solid var(--warn); background: var(--warn-soft); padding: 10px 14px; border-radius: 0 8px 8px 0; font-size: 15px; max-width: 72ch; }
.callout.info { border-color: var(--accent); background: var(--accent-soft); }
.callout.danger { border-color: var(--danger); background: var(--danger-soft); }

/* Port yönlendirme düzenleyici */
.pf { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 10px; }
.pf-wrap { overflow-x: auto; }
.pf table { border-collapse: collapse; width: 100%; min-width: 560px; }
.pf th { text-align: left; font-size: 12px; font-family: var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 0 6px 6px 0; }
.pf td { padding: 3px 6px 3px 0; vertical-align: middle; }
.pf td:last-child { width: 1%; }
.pf .tools { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.pf .tools label { display: inline-flex; gap: 6px; align-items: center; font-size: 15px; }
.pf .tools input[type=checkbox] { width: auto; }
.x { border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); border-radius: 6px; width: 32px; height: 32px; }
.x:hover { color: var(--danger); border-color: var(--danger); }

.legend-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 14px; color: var(--muted); }
.swatch { display: inline-block; font-family: var(--font-mono); font-size: 12px; padding: 0 6px; border-radius: 3px; background: var(--term-bg); color: var(--term-ink); }
.swatch.var { box-shadow: inset 0 0 0 100px var(--term-var); }
.swatch.ph { box-shadow: inset 0 0 0 100px var(--term-ph); }

/* Profil / senaryo çubuğu */
.profile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 12px; }
.profile-top { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; }
.who { display: flex; gap: 10px; align-items: center; min-width: 0; }
.who img { width: 36px; height: 36px; border-radius: 50%; flex: none; }
.hello { font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 1.2; }
.status { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.status[data-s="cloud"] .dot { background: var(--ok); }
.status[data-s="saving"] .dot { background: var(--warn); }
.status[data-s="error"] .dot { background: var(--danger); }
.scen { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.scen select { width: auto; min-width: 0; max-width: 100%; flex: 1 1 200px; font-weight: 600; }
.panel { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; padding: 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); }
.panel .field { flex: 1 1 200px; }
.panel.danger { background: var(--danger-soft); border-color: var(--danger); }
.panel p { margin: 0; flex: 1 1 240px; }
.btn.warn { background: var(--danger); border-color: var(--danger); color: var(--surface); }
.msg { margin: 0; font-size: 14px; color: var(--muted); }
.msg.err { color: var(--danger); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
details.admin { background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius); }
details.admin > summary { cursor: pointer; padding: 12px 16px; font-weight: 700; color: var(--accent); }
.admin-body { padding: 0 16px 16px; display: grid; gap: 12px; max-width: 76ch; }
.admin-body ol { margin: 0; padding-left: 20px; }
.admin-body li { margin-bottom: 4px; }
.tpl-list { display: grid; gap: 6px; }
.tpl-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; }
.tpl-row span { min-width: 0; overflow-wrap: anywhere; }

@media (max-width: 880px) {
  .shell { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  nav.toc { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; display: flex; overflow-x: auto; gap: 4px; background: var(--bg); padding-block: 8px; margin-inline: -4px; border-bottom: 1px solid var(--line); }
  nav.toc .label { display: none; }
  nav.toc a { white-space: nowrap; grid-template-columns: auto auto; font-size: 14px; }
  section.chap { scroll-margin-top: 64px; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, nav.toc a { transition: background .15s, color .15s, border-color .15s; }
  html { scroll-behavior: smooth; }
}

/* ---- Site ekleri ---- */
.topbar { max-width: 1200px; margin: 0 auto; padding-block: 14px 0; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; font-size: 14px; color: var(--muted); }
.topbar a { font-weight: 600; text-decoration: none; }
.brand { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.auth-card { max-width: 420px; margin: 8vh auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: grid; gap: 14px; }
.auth-card h1 { font-family: var(--font-display); font-size: 24px; margin: 0; }
.auth-card p { margin: 0; color: var(--muted); font-size: 15px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.rules { display: grid; gap: 18px; }
.rules h3 { font-family: var(--font-display); font-size: 18px; margin: 0 0 6px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.rules h3 code { font-weight: 400; }
.tbl-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.rt { border-collapse: collapse; width: 100%; font-size: 14px; }
table.rt th { text-align: left; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.rt td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; font-family: var(--font-mono); font-size: 13px; overflow-wrap: anywhere; min-width: 80px; }
table.rt tr:last-child td { border-bottom: 0; }
table.rt td.cm { font-family: var(--font-body); font-size: 14px; color: var(--ink); font-weight: 600; }
table.rt tr.off td { opacity: .5; text-decoration: line-through; }
.tag { display: inline-block; font-family: var(--font-mono); font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); margin: 1px 2px 1px 0; white-space: nowrap; }
.tag.accept, .tag.dst-nat, .tag.masquerade { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag.drop, .tag.reject { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.empty { padding: 28px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.ports-ref { margin-top: 4px; }
.ports-ref summary { cursor: pointer; font-weight: 600; color: var(--accent); padding: 4px 0; }
.file-btn { position: relative; overflow: hidden; display: inline-flex; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.shell.solo { grid-template-columns: minmax(0, 1fr); }

/* ---- RouterOS sürüm seçimi ---- */
.verbar { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 14px 16px; }
.verbar-txt { display: grid; gap: 4px; flex: 1 1 320px; min-width: 0; font-size: 15px; }
.verbar-txt strong { font-family: var(--font-display); font-size: 17px; }
.verbar-txt span { color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface-2); flex: none; }
.seg button { border: 0; background: none; color: var(--muted); font-family: var(--font-mono); font-weight: 600; font-size: 15px; padding: 8px 18px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent); color: var(--surface); }
.seg button:not(.on):hover { color: var(--accent); }
.seg-sm button { font-size: 12px; padding: 3px 10px; }
.pill.same { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.desc { margin: 0; padding: 0 16px 12px; font-size: 15px; color: var(--ink); max-width: 80ch; }

/* ---- Kompakt düzen ---- */
body { font-size: 15px; line-height: 1.5; }
.top { padding-block: 22px 14px; gap: 6px; }
.top h1 { font-size: clamp(26px, 4vw, 36px); }
.top p { font-size: 15px; }
.shell { gap: 28px; }
main { gap: 26px; }
nav.toc a { padding: 5px 10px; font-size: 14px; }
section.chap { gap: 12px; }
.chap-head h2 { font-size: clamp(20px, 2.4vw, 24px); }
.lead { font-size: 15px; }
.lead ul { margin-top: 2px; }
.cmd-head { padding: 8px 10px 6px 14px; gap: 6px 8px; }
.cmd-head h3 { font-size: 15px; flex-basis: 180px; }
.desc { font-size: 14px; line-height: 1.45; padding: 0 14px 10px; }
.term { font-size: 13px; line-height: 1.55; padding: 10px 14px; }
.note { font-size: 13.5px; line-height: 1.45; padding: 7px 14px 9px; }
.btn { font-size: 13px; padding: 4px 10px; }
.pill { font-size: 10.5px; padding: 2px 7px; }
details.settings > summary { padding: 12px 16px; }
details.settings > summary h2 { font-size: 18px; }
.groups { padding: 14px 16px; gap: 14px 20px; }
fieldset { gap: 8px; }
.field label { font-size: 13.5px; }
.field small { font-size: 12.5px; }
input, select { padding: 6px 9px; font-size: 14px; }
.settings-foot { padding: 0 16px 14px; font-size: 13px; }
.verbar { padding: 10px 14px; }
.verbar-txt { font-size: 14px; }
.verbar-txt strong { font-size: 16px; }
.seg button { padding: 6px 16px; font-size: 14px; }
.seg-sm button { padding: 2px 9px; font-size: 12px; }
.pf { padding: 12px 14px; }
.legend-row { font-size: 13px; }
.profile { padding: 12px 14px; gap: 10px; }
.callout { font-size: 14px; padding: 8px 12px; }

/* ---- Sayfanın başına dön ---- */
.totop { position: fixed; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 30;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--accent);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18); display: grid; place-items: center; cursor: pointer;
  opacity: 0; pointer-events: none; transform: translateY(8px); }
.totop svg { width: 20px; height: 20px; }
.totop.show { opacity: 1; pointer-events: auto; transform: none; }
.totop:hover { border-color: var(--accent); }
@media (prefers-reduced-motion: no-preference) { .totop { transition: opacity .2s, transform .2s; } }

/* ---- Bal küpü alanı: insanlar görmez, botlar doldurur ---- */
.hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---- Güvenlik kaydı ---- */
.sec { display: grid; gap: 10px; }
.sec h3 { margin: 0; font-family: var(--font-display); font-size: 18px; }
