:root {
  --bg: #16130e; --bg2: #1f1b14; --card: #24201a; --line: #3a3326; --line2: #4a4131;
  --text: #f1ebe0; --muted: #a59a86; --accent: #f2a93b; --accent-ink: #1b1306;
  --ok: #6fcf8f; --warn: #f2c14e; --danger: #ef6b5b; --code-bg: #120f0b; --code: #f6e7c8;
  --r: 12px; --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f3ec; --bg2: #efe8dc; --card: #fffdf9; --line: #e3d9c7; --line2: #d3c6ae;
    --text: #231d12; --muted: #7a6d57; --accent: #d98a10; --accent-ink: #fff;
    --code-bg: #1d1912; --code: #f6e7c8; color-scheme: light;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--sans); }
[hidden] { display: none !important; }
a { color: var(--accent); }
input, textarea, button, select { font: inherit; color: inherit; }
input, textarea {
  width: 100%; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; outline: none; min-width: 0;
}
input:focus, textarea:focus { border-color: var(--accent); }

/* klavye odağı görünür olsun (fare tıklamasında gösterme) — R-32 */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
input:focus-visible, textarea:focus-visible { outline-offset: 0; }
/* fareyle odak halkasını bastır, klavyede koru */
:focus:not(:focus-visible) { outline: none; }
textarea { font-family: var(--mono); font-size: 13.5px; resize: vertical; }
h2 { font-size: 18px; margin: 0 0 6px; }
h3 { font-size: 14px; margin: 16px 0 4px; }
code { font-family: var(--mono); font-size: 12.5px; background: var(--bg2); padding: 1px 5px; border-radius: 5px; }
.muted { color: var(--muted); }
.tiny { font-size: 12.5px; }
.err { color: var(--danger); min-height: 1.2em; margin: 6px 0 0; }

/* marka */
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: -.02em; font-size: 19px; }
.brand.big { font-size: 32px; justify-content: center; }
.hex { width: 22px; height: 24px; background: var(--accent);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); display: inline-block; }
.brand.big .hex { width: 34px; height: 38px; }

/* butonlar */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--bg2); border: 1px solid var(--line2); border-radius: 10px;
  padding: 9px 14px; cursor: pointer; text-decoration: none; color: var(--text); white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 650; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.danger { color: var(--danger); }
.btn.wide { width: 100%; }
.btn.done { background: var(--ok); border-color: var(--ok); color: #0c1a10; }

/* giriş */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 28px 22px; text-align: center; }
.login-card label { display: block; text-align: left; font-size: 13px; color: var(--muted); margin: 18px 0 6px; }
.login-card .btn { margin-top: 12px; padding: 12px; }

/* üst bar */
.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.tabs { display: flex; gap: 4px; flex: 1; }
.tabs button { background: none; border: 0; padding: 8px 12px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 600; }
.tabs button.on { color: var(--text); background: var(--bg2); }
.me { display: flex; align-items: center; gap: 10px; }
.me-name { font-weight: 600; }
.live { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); }
.live.on { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 25%, transparent); }

main { max-width: 980px; margin: 0 auto; padding: 16px 16px 100px; }
.tab { display: none; }
.tab.on { display: block; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 14px; }
.row { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.wrap > * { flex: 1 1 200px; }
.row.end { justify-content: flex-end; }
.filter { margin: 4px 0 12px; }
.list { display: flex; flex-direction: column; gap: 12px; }

/* çevrimiçi */
.online { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; font-size: 13px; color: var(--muted); align-items: center; }
.online .u { background: var(--bg2); border: 1px solid var(--line); padding: 2px 9px; border-radius: 99px; color: var(--text); }
.online .u::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 6px; vertical-align: 1px; }

/* pano kayıtları */
.paste { padding: 0; overflow: hidden; }
.paste.new { animation: flash 1.6s ease-out; }
@keyframes flash { from { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); } }
.p-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 10px 14px 0; font-size: 13px; }
.p-user { font-weight: 700; }
.p-meta { color: var(--muted); }
.p-title { padding: 4px 14px 0; font-weight: 650; }
.badge { font-size: 11.5px; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line2); color: var(--muted); }
.badge.win { color: #7cb8ff; border-color: #2f4f75; }
.badge.mac { color: #d0d0d0; border-color: #555; }
.badge.arac { color: var(--accent); border-color: var(--accent); }
.badge.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.badge.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.p-actions { display: flex; gap: 8px; padding: 10px 14px 12px; justify-content: flex-end; }
.code-wrap { position: relative; }
.code {
  margin: 10px 0 0; background: var(--code-bg); color: var(--code); font: 12.8px/1.5 var(--mono);
  padding: 12px 14px; overflow: auto; white-space: pre; max-height: 420px; border-radius: 10px;
  -webkit-overflow-scrolling: touch;
}
.paste .code { border-radius: 0; margin: 10px 0 0; }
.paste .code.collapsed { max-height: 220px; }
.code-wrap .code { padding-right: 100px; white-space: pre-wrap; word-break: break-all; }
.code-wrap .copy-btn { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); margin-top: 5px; }
.more { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 6px 14px 0; font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }

/* komut oluşturucu */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12.5px; color: var(--muted); }
.seg { display: flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { flex: 1; border: 0; background: none; padding: 7px 10px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 600; white-space: nowrap; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.hint { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 4px; scrollbar-width: none; }
.chips button { flex: none; background: var(--bg2); border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; cursor: pointer; color: var(--muted); font-size: 13.5px; }
.chips button.on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.cmd { padding: 0; }
.cmd > summary { list-style: none; cursor: pointer; padding: 12px 14px; display: flex; gap: 10px; align-items: center; }
.cmd > summary::-webkit-details-marker { display: none; }
.cmd > summary::after { content: "›"; margin-left: auto; color: var(--muted); font-size: 20px; transition: transform .15s; }
.cmd[open] > summary::after { transform: rotate(90deg); }
.cmd .c-name { font-weight: 600; }
.cmd .c-cat { font-size: 12px; color: var(--muted); }
.cmd .c-body { padding: 0 14px 14px; }
.cmd .c-desc { color: var(--muted); font-size: 13.5px; margin: 0 0 8px; }
.cmd .params { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin-bottom: 4px; }
.cmd .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; flex-wrap: wrap; }
.warnbox { font-size: 13px; color: var(--warn); margin-top: 8px; }

/* indirmeler */
.dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 12px 0; }
.dl-grid a { display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 1px solid var(--line2); border-radius: 10px; text-decoration: none; color: var(--text); background: var(--bg2); }
.dl-grid a:hover { border-color: var(--accent); }
.dl-grid a small { color: var(--muted); }
.note { margin-top: 12px; font-size: 13.5px; color: var(--muted); }
.note summary { cursor: pointer; color: var(--text); }
.note li { margin: 6px 0; }

/* kayıtlar */
.table-wrap { padding: 0; overflow-x: auto; }
.logs { width: 100%; border-collapse: collapse; font-size: 13px; }
.logs th, .logs td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.logs td:last-child { white-space: normal; min-width: 200px; color: var(--muted); }
.logs th { color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--card); }
.logs tr.new td { animation: flash2 1.6s; }
@keyframes flash2 { from { background: color-mix(in srgb, var(--accent) 20%, transparent); } }
.act { font-weight: 600; }
.act.giris_reddedildi, .act.rapor_reddedildi, .act.silme { color: var(--danger); }
.act.yapistirma, .act.rapor { color: var(--accent); }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600;
  opacity: 0; transition: .2s; pointer-events: none; z-index: 50; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* hareket hassasiyeti: animasyonları kıs — yeni kayıt vurgusu dışında hareket yok */
@media (prefers-reduced-motion: reduce) {
  .paste.new, .logs tr.new td { animation: none !important; }
  .toast { transition: opacity .2s; }
  .cmd > summary::after { transition: none; }
  * { scroll-behavior: auto !important; }
}

/* giriş ekranı: kovan kimliği (tek petek motifi, sayfa geneli ızgara değil) */
.login-card { position: relative; overflow: hidden; }
.login-card .brand.big { font-size: clamp(28px, 7vw, 34px); }
.login-card::before {
  content: ""; position: absolute; top: -26px; right: -26px; width: 92px; height: 100px;
  background: var(--accent); opacity: .10; pointer-events: none;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}

/* telefon: sekmeler alta */
@media (max-width: 720px) {
  .top { gap: 10px; backdrop-filter: none; background: var(--bg); }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; justify-content: space-around;
    background: var(--bg2); border-top: 1px solid var(--line); padding: 6px 6px max(6px, env(safe-area-inset-bottom));
  }
  .tabs button { flex: 1; padding: 10px 4px; font-size: 13.5px; }
  .brand { flex: 1; }
  .me-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  main { padding: 12px 12px 110px; }
}
