:root {
  --bg: #f4f6f9; --surface: #ffffff; --surface2: #eceff4; --text: #0f172a; --muted: #566175;
  --border: #d9dfe8; --accent: #0d9488; --accent-fg: #ffffff; --accent-soft: #d6f2ee;
  --danger: #dc2626; --danger-soft: #fde8e8; --warn: #b45309; --warn-soft: #fef3c7; --ok: #15803d; --ok-soft: #dcfce7;
  --info-soft: #e0ecff;
  --net: #2563eb; --sys: #d97706; --sec: #e11d48; --help: #16a34a;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 12px; --nav-w: 220px; --tab-h: 62px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 14px rgba(15, 23, 42, .06);
}
:root[data-theme="dark"] {
  --bg: #0b1120; --surface: #111a2e; --surface2: #18233b; --text: #e6ebf5; --muted: #93a0b8;
  --border: #25314b; --accent: #2dd4bf; --accent-fg: #06201c; --accent-soft: #0f3a37;
  --danger: #f87171; --danger-soft: #3a1618; --warn: #fbbf24; --warn-soft: #3a2c0b; --ok: #4ade80; --ok-soft: #0f2e1b;
  --info-soft: #14284a;
  --net: #60a5fa; --sys: #fbbf24; --sec: #fb7185; --help: #4ade80;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
code, pre, .mono { font-family: var(--mono); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); opacity: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Kabuk */
.shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .5rem; padding: .55rem .9rem; padding-top: calc(.55rem + env(safe-area-inset-top)); background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; text-decoration: none; color: var(--text); white-space: nowrap; }
.brand .logo { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-fg); }
.topsearch { flex: 1; min-width: 0; position: relative; }
.topsearch input { width: 100%; padding: .5rem .75rem .5rem 2.1rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface2); }
.topsearch svg { position: absolute; left: .65rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.top-actions { display: flex; gap: .15rem; align-items: center; }
.nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: flex; background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--tab-h); font-size: .72rem; color: var(--muted); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.nav .badge-dot { position: relative; }
.nav .badge-dot.on::after { content: ""; position: absolute; top: -2px; right: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
main { padding: 1rem .9rem calc(var(--tab-h) + 1.5rem + env(safe-area-inset-bottom)); max-width: 1000px; width: 100%; min-width: 0; margin: 0 auto; }
@media (min-width: 860px) {
  .shell { grid-template-columns: var(--nav-w) minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .topbar { grid-column: 1 / -1; }
  .nav { position: sticky; top: 58px; align-self: start; height: calc(100vh - 58px); flex-direction: column; justify-content: flex-start; gap: .15rem; padding: .75rem; border-top: 0; border-right: 1px solid var(--border); grid-row: 2; }
  .nav a { flex: none; flex-direction: row; justify-content: flex-start; gap: .65rem; min-height: 42px; padding: 0 .8rem; border-radius: 10px; font-size: .95rem; }
  .nav a[aria-current="page"] { background: var(--accent-soft); }
  main { padding: 1.5rem 1.5rem 3rem; grid-row: 2; }
}

/* Bileşenler */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 40px; padding: .45rem .95rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; text-decoration: none; color: var(--text); }
.btn:hover { background: var(--surface2); }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.sm { min-height: 32px; padding: .2rem .65rem; font-size: .88rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--surface2); color: var(--text); }
.icon-btn.on { color: var(--sys); }
.input, select.input, textarea.input { width: 100%; padding: .55rem .7rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }
textarea.input { resize: vertical; min-height: 90px; }
.input:focus { border-color: var(--accent); }
.input.bad { border-color: var(--danger); }
.field { display: grid; gap: .3rem; margin-bottom: .8rem; }
.field-label { font-size: .85rem; font-weight: 600; }
.hint { font-size: .8rem; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; gap: .8rem; grid-template-columns: 1fr; }
.grid3 { display: grid; gap: .8rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.card + .card { margin-top: .8rem; }
a.card { display: block; text-decoration: none; color: inherit; }
a.card:hover { border-color: var(--accent); }
.cards { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.cards .card + .card { margin-top: 0; }
.card h3 { display: flex; gap: .5rem; align-items: center; }
.card p { margin: 0; color: var(--muted); font-size: .9rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .25rem 0 1rem; }
.chip { padding: .3rem .8rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: .87rem; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.badge { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 600; background: var(--surface2); color: var(--muted); white-space: nowrap; }
.badge.net { background: color-mix(in srgb, var(--net) 16%, transparent); color: var(--net); }
.badge.sys { background: color-mix(in srgb, var(--sys) 18%, transparent); color: var(--sys); }
.badge.sec { background: color-mix(in srgb, var(--sec) 16%, transparent); color: var(--sec); }
.badge.help { background: color-mix(in srgb, var(--help) 16%, transparent); color: var(--help); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.banner { display: flex; gap: .6rem; padding: .7rem .85rem; border-radius: 10px; margin: 0 0 1rem; font-size: .9rem; align-items: flex-start; }
.banner svg { flex: none; margin-top: 2px; }
.banner.info { background: var(--info-soft); }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.danger { background: var(--danger-soft); color: var(--danger); }
.banner.ok { background: var(--ok-soft); color: var(--ok); }
.pagehead { display: flex; align-items: flex-start; gap: .6rem; margin-bottom: 1rem; }
.pagehead .grow { flex: 1; min-width: 0; }
.pagehead p { color: var(--muted); margin: 0; }
.back { margin-left: -.4rem; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: .55rem 1rem; border-radius: 10px; opacity: 0; pointer-events: none; transition: .2s; z-index: 100; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 860px) { .toast { bottom: 24px; } }

/* Hero / ana sayfa */
.hero { padding: 1.2rem 0 .6rem; }
.hero h1 { font-size: 1.7rem; }
.hero .big-search { position: relative; margin-top: 1rem; }
.hero .big-search input { width: 100%; padding: .85rem 1rem .85rem 2.8rem; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); font-size: 1.05rem; box-shadow: var(--shadow); }
.hero .big-search svg { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.role-tile { display: flex; gap: .8rem; align-items: center; }
.role-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; flex: none; }
.role-ico.net { background: color-mix(in srgb, var(--net) 16%, transparent); color: var(--net); }
.role-ico.sys { background: color-mix(in srgb, var(--sys) 18%, transparent); color: var(--sys); }
.role-ico.sec { background: color-mix(in srgb, var(--sec) 16%, transparent); color: var(--sec); }
.role-ico.help { background: color-mix(in srgb, var(--help) 16%, transparent); color: var(--help); }
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 1.5rem 0 .6rem; }
.section-title h2 { margin: 0; }

/* Sonuç satırları */
.res-row { display: flex; align-items: center; gap: .5rem; padding: .35rem 0; border-bottom: 1px dashed var(--border); }
.res-row:last-child { border-bottom: 0; }
.res-k { flex: 0 0 9.5rem; font-size: .85rem; color: var(--muted); }
.res-v { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.res-v.wrap { white-space: pre-wrap; }
@media (max-width: 520px) { .res-k { flex-basis: 6.8rem; } }
.err { color: var(--danger); font-size: .9rem; }
.ok-text { color: var(--ok); }

/* Tablolar */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { text-align: left; padding: .45rem .65rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface2); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.mono, td code { font-size: .84rem; }

/* Kütüphane listeleri */
.lib-row { display: grid; gap: .3rem; padding: .7rem .8rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin-bottom: .5rem; }
.lib-row .line { display: flex; gap: .5rem; align-items: flex-start; }
.lib-row .cmd { flex: 1; min-width: 0; margin: 0; padding: .45rem .6rem; border-radius: 8px; background: var(--surface2); font-size: .85rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.lib-row .desc { color: var(--muted); font-size: .88rem; }
.lib-row .meta { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.big-id { font-family: var(--mono); font-weight: 700; font-size: 1.05rem; min-width: 4.4rem; }
.count { color: var(--muted); font-size: .85rem; margin: 0 0 .6rem; }

/* Kasa */
.meter { height: 8px; border-radius: 999px; background: var(--surface2); overflow: hidden; }
.meter > i { display: block; height: 100%; width: 0; transition: width .2s, background .2s; background: var(--danger); }
.meter > i.l1 { background: var(--danger); } .meter > i.l2 { background: var(--warn); } .meter > i.l3 { background: #65a30d; } .meter > i.l4 { background: var(--ok); }
.vault-item { display: flex; gap: .6rem; align-items: center; padding: .7rem .8rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin-bottom: .5rem; cursor: pointer; }
.vault-item:hover { border-color: var(--accent); }
.vault-item .grow { flex: 1; min-width: 0; }
.vault-item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vault-item .snippet { color: var(--muted); font-size: .82rem; font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-body { font-family: var(--mono); font-size: .88rem; min-height: 240px; }
.checklist-preview label { display: flex; gap: .5rem; align-items: flex-start; padding: .25rem 0; }
.lockbox { max-width: 460px; margin: 1rem auto; }
.lockbox .big-ico { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); margin: 0 auto .8rem; }

/* Akışlar ve kontrol listeleri */
.flow-step { padding: .8rem 1rem; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; margin-bottom: .6rem; }
.flow-step.current { border-color: var(--accent); box-shadow: var(--shadow); }
.flow-step.done { opacity: .75; }
.flow-step .ans { font-size: .8rem; font-weight: 700; color: var(--accent); }
.flow-end { border-left: 4px solid var(--ok); }
.flow-end.escalate { border-left-color: var(--warn); }
.check-row { display: flex; gap: .6rem; align-items: flex-start; padding: .55rem .2rem; border-bottom: 1px solid var(--border); }
.check-row input { margin-top: .3rem; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.check-row.done span { text-decoration: line-through; color: var(--muted); }
.progress { height: 8px; background: var(--surface2); border-radius: 999px; overflow: hidden; margin: .4rem 0 1rem; }
.progress > i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.tmpl pre { margin: .5rem 0 0; padding: .6rem .75rem; background: var(--surface2); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--sans); font-size: .9rem; }

/* Araç özel */
.bits { font-family: var(--mono); font-size: .82rem; }
.bit-net { color: var(--accent); font-weight: 700; }
.perm-grid { display: grid; grid-template-columns: auto repeat(3, 1fr); gap: .4rem .9rem; align-items: center; max-width: 420px; }
.perm-grid label { display: flex; align-items: center; gap: .35rem; cursor: pointer; }
.perm-grid input { width: 18px; height: 18px; accent-color: var(--accent); }
.big-num { font-family: var(--mono); font-size: 2rem; font-weight: 700; letter-spacing: .05em; }
.cvss-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.seg { display: flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.seg button { flex: 1; padding: .45rem .3rem; border: 0; border-right: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: .85rem; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); font-weight: 600; }
.score-box { display: flex; align-items: center; gap: 1rem; }
.score { font-size: 2.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.sev-none { color: var(--muted); } .sev-low { color: #65a30d; } .sev-medium { color: var(--sys); } .sev-high { color: #ea580c; } .sev-critical { color: var(--sec); }
details { margin: .6rem 0; }
summary { cursor: pointer; font-weight: 600; padding: .3rem 0; }
.kbd { font-family: var(--mono); font-size: .8rem; padding: .05rem .35rem; border: 1px solid var(--border); border-radius: 5px; background: var(--surface2); }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }

/* Kart içi düzen ve yardımcılar */
.role-tile .grow { flex: 1; min-width: 0; }
.meta { display: flex; gap: .3rem; flex-wrap: wrap; align-items: center; margin-top: .4rem; }
.card h3 { margin-bottom: .2rem; }
.stack > * + * { margin-top: .8rem; }
.right { margin-left: auto; }
.chip-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.star-btn[aria-pressed="true"] { color: var(--sys); }
.star-btn[aria-pressed="true"] svg { fill: currentColor; }
.searchbox { position: relative; margin-bottom: .8rem; }
.searchbox input { width: 100%; padding: .65rem .9rem .65rem 2.4rem; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.searchbox svg { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.group-title { margin: 1.2rem 0 .5rem; font-size: .95rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.more-link { display: inline-block; margin: .2rem 0 .8rem; font-size: .9rem; }
@media (max-width: 520px) { .brand-name { display: none; } }
a.lib-row { text-decoration: none; color: inherit; }
a.lib-row:hover { border-color: var(--accent); }
.vault-item .type-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); flex: none; }
.vault-item .fav { color: var(--sys); }
.danger-zone { border: 1px solid var(--danger); border-radius: 10px; padding: .6rem .9rem; }
.pw-wrap { display: flex; gap: .4rem; }
.pw-wrap .input { flex: 1; }
.checklist-preview { border: 1px dashed var(--border); border-radius: 10px; padding: .4rem .7rem; margin: .5rem 0; }
.checklist-preview .done span { text-decoration: line-through; color: var(--muted); }
.lib-row .grow, .lib-row .desc, .card .grow { min-width: 0; overflow-wrap: anywhere; }
.big-id { overflow-wrap: anywhere; }
