/* ═══════════════════════════════════════════════════════════
   ikigöz — sunucu paneli
   Sıcak koyu palet: mürekkep + kâğıt + okra. Şablon değil.
   ═══════════════════════════════════════════════════════════ */

:root {
  --ink-900: #14130f;
  --ink-850: #191815;
  --ink-800: #1e1c18;
  --ink-750: #24221d;
  --ink-700: #2b2823;
  --line:    #38342c;
  --line-soft: #2a2721;

  --paper:      #e9e4d8;
  --paper-dim:  #a8a093;
  --paper-faint:#6e6758;

  --okra:      #d79243;
  --okra-dim:  #a86f30;
  --okra-soft: rgba(215,146,67,.13);
  --olive:     #8aa35c;
  --clay:      #c6604c;
  --sky:       #6d93a8;

  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;

  --term-h: 260px;
}

* { box-sizing: border-box; }

/* hidden niteliği her zaman kazansın (.gate/.app display kuralları ezmesin) */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--ink-900);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body.booting::before {
  content: '';
  position: fixed; inset: 0;
  background: var(--ink-900);
  z-index: 999;
}

button { font-family: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
code { font-family: var(--mono); font-size: .92em; }

::selection { background: rgba(215,146,67,.3); }

/* ── ince kaydırma çubuğu ── */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: #3b372e; border-radius: 6px;
  border: 3px solid transparent; background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: #4d483c; background-clip: content-box; }

/* ═══════════ Butonlar ═══════════ */
.btn {
  border: 1px solid var(--line);
  background: var(--ink-750);
  color: var(--paper);
  padding: 6px 13px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .01em;
  transition: background .13s, border-color .13s, color .13s, opacity .13s;
}
.btn:hover:not(:disabled) { background: var(--ink-700); border-color: #474236; }
.btn:disabled { opacity: .38; cursor: default; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--paper-dim); }
.btn-ghost:hover:not(:disabled) { background: var(--ink-750); color: var(--paper); border-color: transparent; }
.btn-primary {
  background: var(--okra); border-color: var(--okra); color: #1b1407; font-weight: 600;
}
.btn-primary:hover:not(:disabled) { background: #e5a052; border-color: #e5a052; }
.btn-danger:hover:not(:disabled) { color: var(--clay); background: rgba(198,96,76,.1); }
.btn-block { width: 100%; padding: 10px; font-size: 14px; }

.icon-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 4px 8px;
  border-radius: 6px;
}
.icon-btn:hover { background: var(--ink-750); color: var(--paper); }

.link-btn {
  border: 0; background: none; color: var(--okra);
  font-size: 11.5px; padding: 0; text-decoration: underline;
  text-decoration-color: rgba(215,146,67,.35); text-underline-offset: 2px;
}
.link-btn:hover { text-decoration-color: var(--okra); }

/* ═══════════ Giriş ekranı ═══════════ */
.gate {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background:
    radial-gradient(1100px 620px at 50% -10%, #241f17 0%, transparent 60%),
    var(--ink-900);
  z-index: 100;
  padding: 24px;
}
.gate-art {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex; gap: 90px;
  opacity: .055; pointer-events: none;
}
.gate-art .eye {
  width: 210px; height: 210px; border-radius: 50%;
  border: 2px solid var(--paper);
  position: relative;
}
.gate-art .eye::after {
  content: ''; position: absolute; inset: 42%;
  background: var(--paper); border-radius: 50%;
}

.gate-card {
  position: relative;
  width: 100%; max-width: 374px;
  background: var(--ink-850);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 34px 32px 26px;
  box-shadow: 0 30px 70px -30px rgba(0,0,0,.8);
}
.gate-kicker {
  margin: 0 0 10px;
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--paper-faint);
}
.gate-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 46px; font-weight: 400;
  font-variation-settings: 'SOFT' 0, 'WONK' 1;
  letter-spacing: -.02em;
  line-height: 1;
}
.gate-sub {
  margin: 12px 0 26px;
  color: var(--paper-dim); font-size: 13px; line-height: 1.55;
  max-width: 30ch;
}

.field { display: block; margin-bottom: 14px; }
.field > span {
  display: block; margin-bottom: 6px;
  font-size: 11.5px; color: var(--paper-dim); letter-spacing: .02em;
}
.field input {
  width: 100%;
  background: var(--ink-900);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--paper);
  padding: 10px 12px;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus {
  outline: 0; border-color: var(--okra-dim);
  box-shadow: 0 0 0 3px var(--okra-soft);
}

.gate-error {
  margin: 0 0 14px;
  color: #e9937f; font-size: 12.5px;
  background: rgba(198,96,76,.1);
  border-left: 2px solid var(--clay);
  padding: 8px 11px; border-radius: 0 6px 6px 0;
}
.gate-foot {
  margin: 18px 0 0; text-align: center;
  font-family: var(--mono); font-size: 10.5px; color: var(--paper-faint);
}

/* ═══════════ Uygulama kabuğu ═══════════ */
.app {
  height: 100%;
  display: grid;
  grid-template-columns: 286px 1fr;
  grid-template-rows: 46px 1fr;
  grid-template-areas: "top top" "side main";
}

/* ── Üst bar ── */
.topbar {
  grid-area: top;
  display: flex; align-items: center; gap: 18px;
  padding: 0 14px 0 16px;
  background: var(--ink-850);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 9px; }
.brand-mark { display: flex; gap: 3px; align-self: center; }
.brand-mark i {
  width: 7px; height: 7px; border-radius: 50%;
  border: 1.5px solid var(--okra); display: block;
}
.brand-name {
  font-family: var(--serif); font-size: 21px; font-weight: 400;
  letter-spacing: -.01em;
  font-variation-settings: 'SOFT' 0, 'WONK' 1;
}
.brand-sub {
  font-family: var(--mono); font-size: 10px; color: var(--paper-faint);
  letter-spacing: .1em; text-transform: uppercase;
}

.topbar-stats { display: flex; gap: 16px; margin-left: 10px; }
.stat {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px; color: var(--paper-faint);
}
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--paper-faint); display: inline-block;
}
.dot.ok   { background: var(--olive); box-shadow: 0 0 7px rgba(138,163,92,.55); }
.dot.bad  { background: var(--clay);  box-shadow: 0 0 7px rgba(198,96,76,.5); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.who {
  font-family: var(--mono); font-size: 11.5px; color: var(--paper-dim);
  padding: 0 6px;
}

/* ── Kenar çubuğu ── */
.sidebar {
  grid-area: side;
  background: var(--ink-850);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  min-height: 0;
}
.side-tabs { display: flex; border-bottom: 1px solid var(--line-soft); }
.side-tab {
  flex: 1; border: 0; background: none;
  padding: 11px 0 9px;
  font-size: 12px; color: var(--paper-faint);
  border-bottom: 2px solid transparent;
  letter-spacing: .02em;
}
.side-tab:hover { color: var(--paper-dim); }
.side-tab.is-active { color: var(--paper); border-bottom-color: var(--okra); }

.side-pane { display: none; flex: 1; min-height: 0; flex-direction: column; }
.side-pane.is-active { display: flex; }

.side-actions {
  display: flex; align-items: center; gap: 2px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;
}
.toggle {
  margin-left: auto; display: flex; align-items: center; gap: 4px;
  font-family: var(--mono); font-size: 10.5px; color: var(--paper-faint);
  cursor: pointer; user-select: none;
}
.toggle input { accent-color: var(--okra); margin: 0; }

/* ── Dosya ağacı ── */
.tree {
  flex: 1; overflow: auto;
  padding: 6px 0 20px;
  font-family: var(--mono); font-size: 12.5px;
}
.row {
  display: flex; align-items: center; gap: 5px;
  padding: 2.5px 10px 2.5px 0;
  cursor: pointer; white-space: nowrap;
  color: var(--paper-dim);
  border-left: 2px solid transparent;
}
.row:hover { background: var(--ink-800); color: var(--paper); }
.row.is-sel {
  background: var(--okra-soft); color: var(--paper);
  border-left-color: var(--okra);
}
.row .tw {
  width: 13px; flex: none; text-align: center;
  color: var(--paper-faint); font-size: 9px;
  transition: transform .14s;
}
.row .tw.open { transform: rotate(90deg); }
.row .ic { flex: none; width: 15px; text-align: center; font-size: 11px; opacity: .8; }
.row .nm { overflow: hidden; text-overflow: ellipsis; }
.row.dir .nm { color: var(--paper); }
.row.is-loading .tw { opacity: .4; }
.children { display: none; }
.children.open { display: block; }
.tree-empty, .tree-msg {
  padding: 14px 16px; color: var(--paper-faint);
  font-family: var(--sans); font-size: 12px;
}

.side-foot {
  border-top: 1px solid var(--line-soft);
  padding: 7px 12px;
  font-family: var(--mono); font-size: 10.5px; color: var(--paper-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Arama ── */
.search-bar { gap: 6px; }
.search-bar input {
  flex: 1; min-width: 0;
  background: var(--ink-900); border: 1px solid var(--line);
  border-radius: 7px; color: var(--paper);
  padding: 7px 10px; font-size: 12.5px;
}
.search-bar input:focus { outline: 0; border-color: var(--okra-dim); }
.search-scope {
  padding: 7px 12px; font-size: 11px; color: var(--paper-faint);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line-soft);
}
.search-scope code { color: var(--paper-dim); }
.search-results { flex: 1; overflow: auto; padding: 4px 0 20px; }
.hit {
  padding: 7px 12px; cursor: pointer;
  border-bottom: 1px solid var(--line-soft);
}
.hit:hover { background: var(--ink-800); }
.hit-file {
  font-family: var(--mono); font-size: 11.5px; color: var(--okra);
  display: flex; justify-content: space-between; gap: 8px;
}
.hit-file span { color: var(--paper-faint); flex: none; }
.hit-line {
  font-family: var(--mono); font-size: 11.5px; color: var(--paper-dim);
  margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hit-line mark { background: rgba(215,146,67,.26); color: var(--paper); border-radius: 2px; }

/* ═══════════ Ana alan ═══════════ */
.main {
  grid-area: main;
  display: flex; flex-direction: column;
  min-width: 0; min-height: 0;
  background: var(--ink-900);
}

.crumbs {
  display: flex; align-items: center; gap: 12px;
  padding: 0 12px; height: 42px; flex: none;
  border-bottom: 1px solid var(--line);
  background: var(--ink-850);
}
.crumb-path {
  font-family: var(--mono); font-size: 12.5px; color: var(--paper-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.crumb-path b { color: var(--paper); font-weight: 500; }
.crumb-path .dirty { color: var(--okra); }
.crumb-actions { margin-left: auto; display: flex; align-items: center; gap: 5px; flex: none; }
.file-meta {
  font-family: var(--mono); font-size: 10.5px; color: var(--paper-faint);
  margin-right: 6px;
}

.stage { flex: 1; min-height: 0; position: relative; overflow: hidden; }

/* ── Karşılama ── */
.welcome { height: 100%; overflow: auto; padding: 46px 48px 60px; max-width: 860px; }
.welcome h2 {
  font-family: var(--serif); font-size: 34px; font-weight: 400;
  margin: 0 0 14px; letter-spacing: -.015em;
  font-variation-settings: 'SOFT' 0, 'WONK' 1;
}
.welcome p { color: var(--paper-dim); line-height: 1.65; margin: 0 0 24px; max-width: 62ch; }
.welcome code { color: var(--okra); }
.kbd-list { list-style: none; padding: 0; margin: 0 0 38px; display: grid; gap: 7px; }
.kbd-list li { font-size: 12.5px; color: var(--paper-faint); }
kbd {
  font-family: var(--mono); font-size: 10.5px;
  background: var(--ink-750); border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px; padding: 1px 5px; color: var(--paper-dim);
  margin: 0 1px;
}
.welcome-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 9px;
}
.proj-card {
  border: 1px solid var(--line-soft); border-radius: 9px;
  padding: 13px 14px; background: var(--ink-850);
  cursor: pointer; text-align: left;
  transition: border-color .14s, background .14s, transform .14s;
}
.proj-card:hover { border-color: var(--okra-dim); background: var(--ink-800); transform: translateY(-1px); }
.proj-card b {
  display: block; font-family: var(--mono); font-size: 12px;
  font-weight: 500; color: var(--paper); margin-bottom: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.proj-card span { font-size: 10.5px; color: var(--paper-faint); font-family: var(--mono); }

/* ── Editör ── */
.editor-wrap { position: absolute; inset: 0; }
.CodeMirror {
  height: 100% !important;
  background: var(--ink-900);
  color: #ddd7c8;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
}
.CodeMirror-gutters { background: var(--ink-900); border-right: 1px solid var(--line-soft); }
.CodeMirror-linenumber { color: #4a4538; font-size: 11px; }
.CodeMirror-cursor { border-left: 2px solid var(--okra); }
.CodeMirror-selected { background: rgba(215,146,67,.15) !important; }
.CodeMirror-activeline-background { background: rgba(255,255,255,.022); }
.CodeMirror-matchingbracket { color: var(--okra) !important; border-bottom: 1px solid var(--okra); font-weight: 600; }
.cm-s-default .cm-comment  { color: #6b6453; font-style: italic; }
.cm-s-default .cm-keyword  { color: #d98f68; }
.cm-s-default .cm-atom     { color: #c98fc0; }
.cm-s-default .cm-number   { color: #c0a86b; }
.cm-s-default .cm-def      { color: #9fc07e; }
.cm-s-default .cm-variable { color: #ddd7c8; }
.cm-s-default .cm-variable-2 { color: #9eb9c7; }
.cm-s-default .cm-variable-3, .cm-s-default .cm-type { color: #9eb9c7; }
.cm-s-default .cm-property { color: #cbbd8e; }
.cm-s-default .cm-operator { color: #b9a78a; }
.cm-s-default .cm-string   { color: #a6b97e; }
.cm-s-default .cm-string-2 { color: #a6b97e; }
.cm-s-default .cm-meta     { color: #8d8673; }
.cm-s-default .cm-builtin  { color: #d2a05c; }
.cm-s-default .cm-tag      { color: #d98f68; }
.cm-s-default .cm-attribute{ color: #c0a86b; }
.cm-s-default .cm-header   { color: var(--okra); font-weight: 600; }
.cm-s-default .cm-link     { color: var(--sky); }
.cm-s-default .cm-quote    { color: #8aa35c; }

/* ── Önizleme ── */
.preview-wrap {
  position: absolute; inset: 0; overflow: auto;
  display: grid; place-items: center; padding: 28px;
  background:
    repeating-conic-gradient(var(--ink-850) 0% 25%, var(--ink-900) 0% 50%) 50% / 22px 22px;
}
.preview-wrap img, .preview-wrap video {
  max-width: 100%; max-height: 100%;
  border-radius: 6px; box-shadow: 0 16px 50px -20px rgba(0,0,0,.85);
}
.preview-wrap iframe {
  width: 100%; height: 100%; border: 1px solid var(--line);
  border-radius: 6px; background: #fff;
}
.preview-note {
  text-align: center; color: var(--paper-dim); line-height: 1.7;
  font-size: 13px; max-width: 42ch;
}
.preview-note b { color: var(--paper); font-family: var(--mono); font-size: 12.5px; }

/* ── Terminal ── */
.term-resizer {
  height: 5px; flex: none; cursor: row-resize;
  background: var(--ink-900); border-top: 1px solid var(--line);
  transition: background .15s;
}
.term-resizer:hover, .term-resizer.dragging { background: var(--okra-dim); }

.terminal-panel {
  flex: none; height: var(--term-h);
  display: flex; flex-direction: column;
  background: #100f0c;
  min-height: 0;
}
.app.term-off .terminal-panel, .app.term-off .term-resizer { display: none; }

.term-head {
  display: flex; align-items: center; gap: 10px;
  padding: 0 10px; height: 31px; flex: none;
  background: var(--ink-850); border-bottom: 1px solid var(--line);
}
.term-title { font-family: var(--mono); font-size: 11px; color: var(--paper-dim); }
.term-state { font-family: var(--mono); font-size: 10px; color: var(--paper-faint); }
.term-state.ok { color: var(--olive); }
.term-state.bad { color: var(--clay); }
.term-spacer { margin-left: auto; }
.term-body { flex: 1; min-height: 0; overflow: hidden; padding: 7px 4px 4px 9px; }
.xterm .xterm-viewport { background: transparent !important; }

/* ── Bildirimler ── */
.toasts {
  position: fixed; right: 16px; bottom: 16px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 300; pointer-events: none;
}
.toast {
  background: var(--ink-750);
  border: 1px solid var(--line);
  border-left: 2px solid var(--paper-faint);
  border-radius: 7px;
  padding: 9px 14px;
  font-size: 12.5px; color: var(--paper);
  box-shadow: 0 14px 34px -14px rgba(0,0,0,.8);
  animation: toast-in .2s ease-out;
  max-width: 350px;
}
.toast.ok  { border-left-color: var(--olive); }
.toast.err { border-left-color: var(--clay); }
.toast b { font-family: var(--mono); font-size: 11.5px; font-weight: 500; }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } }

/* ── Sürükle-bırak örtüsü ── */
.drop-veil {
  position: fixed; inset: 0; z-index: 250;
  display: none; place-items: center;
  background: rgba(20,19,15,.82);
  border: 2px dashed var(--okra);
}
.drop-veil.on { display: grid; }
.drop-veil span {
  font-family: var(--serif); font-size: 26px; color: var(--paper);
}


/* ═══════════ Araçlar ═══════════ */
.tools-wrap {
  position: absolute; inset: 0; overflow: auto;
  padding: 26px 30px 48px;
  -webkit-overflow-scrolling: touch;
}
.tools-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 20px; }
.tools-head h2 { font-family: var(--serif); font-weight: 400; font-size: 30px; margin: 0; }

.tool-card {
  border: 1px solid var(--line-soft); border-radius: 11px;
  background: var(--ink-850);
  padding: 15px 16px 14px; margin-bottom: 15px;
}
.tool-card h3 {
  margin: 0 0 11px; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em; color: var(--paper-dim);
  display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap;
}
.tool-card h3 .hint {
  text-transform: none; letter-spacing: 0; font-weight: 400;
  font-size: 11.5px; color: var(--paper-faint); font-family: var(--mono);
}
.tool-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 12px; }
.tool-msg { font-family: var(--mono); font-size: 11.5px; color: var(--paper-faint); padding: 5px 0; }

/* ölçü ızgarası */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 10px; }
.metric {
  border: 1px solid var(--line-soft); border-radius: 9px;
  padding: 10px 12px; background: var(--ink-800);
}
.metric b { display: block; font-family: var(--mono); font-size: 17px; font-weight: 500; color: var(--paper); }
.metric span { display: block; font-size: 11px; color: var(--paper-faint); margin-top: 3px; }
.bar { height: 4px; border-radius: 3px; background: var(--ink-700); margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--okra); }
.bar.warn i { background: var(--clay); }

/* satır listesi (servis / oturum / site) */
.tool-row {
  display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
  padding: 9px 2px; border-top: 1px solid var(--line-soft);
}
.tool-row:first-child { border-top: 0; }
.tool-row .nm {
  font-family: var(--mono); font-size: 12.5px; color: var(--paper);
  flex: 1 1 150px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tool-row .sub { font-family: var(--mono); font-size: 11px; color: var(--paper-faint); }
.tool-row .acts { display: flex; gap: 5px; margin-left: auto; }
.pill {
  font-family: var(--mono); font-size: 10.5px; padding: 2px 7px; border-radius: 20px;
  border: 1px solid var(--line); color: var(--paper-dim); white-space: nowrap;
}
.pill.ok   { color: var(--olive); border-color: rgba(138,163,92,.4); }
.pill.bad  { color: var(--clay);  border-color: rgba(198,96,76,.4); }
.pill.warn { color: var(--okra);  border-color: rgba(215,146,67,.4); }

.logbox {
  margin-top: 9px; padding: 10px 11px; border-radius: 8px;
  background: #100f0c; border: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: 11px; line-height: 1.5; color: var(--paper-dim);
  white-space: pre-wrap; word-break: break-word;
  max-height: 320px; overflow: auto;
}

/* ── Claude kutusu ── */
.box-dir {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  margin-bottom: 11px;
}
.box-dir > span { font-size: 11.5px; color: var(--paper-faint); }
.box-dir code { font-family: var(--mono); font-size: 12px; color: var(--paper-faint); }
.box-dir input {
  flex: 1 1 150px; min-width: 110px;
  background: var(--ink-800); color: var(--paper);
  border: 1px solid var(--line); border-radius: 7px;
  font-family: var(--mono); font-size: 12.5px; padding: 6px 9px;
}
.box-dir input:focus { outline: none; border-color: var(--okra-dim); }

.box-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
  gap: 11px; margin-top: 11px;
}
.box-item {
  border: 1px solid var(--line-soft); border-radius: 9px;
  background: var(--ink-800); padding: 8px; overflow: hidden;
}
.box-thumb {
  height: 104px; border-radius: 6px; margin-bottom: 7px;
  background: #100f0c
    repeating-conic-gradient(#1a1813 0% 25%, #141310 0% 50%) 50% / 14px 14px;
  display: grid; place-items: center; cursor: pointer;
  font-family: var(--mono); font-size: 24px; color: var(--paper-faint);
}
.box-thumb img { max-width: 100%; max-height: 104px; display: block; object-fit: contain; }
.box-name {
  font-family: var(--mono); font-size: 11.5px; color: var(--paper);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.box-meta { font-family: var(--mono); font-size: 10.5px; color: var(--paper-faint); margin-top: 2px; }
.box-acts { display: flex; gap: 4px; margin-top: 7px; }
.box-acts .icon-btn { font-size: 10.5px; padding: 5px 7px; }

/* ═══════════ Terminal: oturum seçici + tuş çubuğu ═══════════ */
.term-session { display: flex; align-items: center; gap: 6px; }
.term-session select {
  background: var(--ink-800); color: var(--paper);
  border: 1px solid var(--line); border-radius: 6px;
  font-family: var(--mono); font-size: 11px; padding: 2px 6px; max-width: 180px;
}

.keybar { display: none; }
.keybar button {
  flex: none; min-width: 40px; height: 36px; padding: 0 11px;
  background: var(--ink-750); color: var(--paper-dim);
  border: 1px solid var(--line); border-radius: 7px;
  font-family: var(--mono); font-size: 12.5px;
  -webkit-tap-highlight-color: transparent;
}
.keybar button:active { background: var(--okra); color: #1b1407; border-color: var(--okra); }
.keybar button.on { background: var(--okra-soft); color: var(--okra); border-color: var(--okra-dim); }

/* ═══════════ Alt gezinme (telefon) ═══════════ */
.bottomnav { display: none; }

/* ═══════════ Küçük ekran ═══════════ */
@media (max-width: 880px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: 46px 1fr 56px;
    grid-template-areas: "top" "body" "nav";
  }
  .topbar-stats { display: none; }
  .topbar { padding: 0 12px; gap: 10px; }
  .brand-sub { display: none; }
  .topbar-right .who { display: none; }
  #btn-tools, #btn-terminal-toggle { display: none; }

  .sidebar, .main { grid-area: body; min-height: 0; }
  .sidebar { border-right: 0; }

  /* Görünüm alt menüden seçilir */
  .app[data-view="files"] .main,
  .app[data-view="edit"]  .sidebar,
  .app[data-view="term"]  .sidebar,
  .app[data-view="tools"] .sidebar { display: none; }

  .app[data-view="edit"]  .terminal-panel,
  .app[data-view="tools"] .terminal-panel,
  .app[data-view="files"] .terminal-panel,
  .term-resizer { display: none; }

  .app[data-view="term"] .crumbs,
  .app[data-view="tools"] .crumbs,
  .app[data-view="term"] .stage { display: none; }
  .app[data-view="term"] .terminal-panel { display: flex; flex: 1; height: auto; }
  .app[data-view="term"] .keybar {
    display: flex; gap: 6px; padding: 7px 8px calc(7px + env(safe-area-inset-bottom, 0px));
    overflow-x: auto; background: var(--ink-850); border-top: 1px solid var(--line);
    scrollbar-width: none;
  }
  .app[data-view="term"] .keybar::-webkit-scrollbar { display: none; }

  .bottomnav {
    grid-area: nav;
    display: grid; grid-template-columns: repeat(4, 1fr);
    background: var(--ink-850); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .bottomnav button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    background: none; border: 0; color: var(--paper-faint);
    font-family: var(--sans); font-size: 10.5px; letter-spacing: .02em;
    -webkit-tap-highlight-color: transparent;
  }
  .bottomnav button span { font-size: 16px; line-height: 1; }
  .bottomnav button.on { color: var(--okra); }

  /* Dokunma hedefleri büyüsün, iOS yakınlaştırmasın */
  .row { padding-top: 9px; padding-bottom: 9px; font-size: 14px; }
  .side-actions { padding: 9px 8px; gap: 4px; }
  .icon-btn { font-size: 13px; padding: 7px 10px; }
  .btn { padding: 8px 12px; font-size: 13px; }
  .field input, #search-input { font-size: 16px; }
  .crumbs { flex-wrap: wrap; gap: 7px; padding: 8px 12px; height: auto; }
  .crumb-actions { margin-left: 0; width: 100%; }
  .file-meta { display: none; }
  .welcome { padding: 24px 18px 36px; }
  .welcome h2 { font-size: 30px; }
  .welcome-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .kbd-list { display: none; }
  .tools-wrap { padding: 18px 14px 36px; }
  .tools-head h2 { font-size: 25px; }
  .metrics { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
  .metric { padding: 9px 10px; }
  .metric b { font-size: 13.5px; }
  .metric span { font-size: 10.5px; }
  .tool-row { padding: 11px 2px; }
  .tool-row .acts .icon-btn { padding: 7px 10px; }
  .gate-card { padding: 26px 20px; }
  .toasts { right: 10px; left: 10px; bottom: 74px; }
  .toast { max-width: none; }

  /* Terminal başlığı tek satıra sığsın */
  .term-head { height: 38px; gap: 8px; padding: 0 8px; flex-wrap: nowrap; }
  .term-head .icon-btn { font-size: 11px; padding: 6px 8px; white-space: nowrap; }
  .term-session select { max-width: 150px; font-size: 12px; padding: 3px 6px; }
  #btn-term-hide { display: none; }
  .term-state { font-size: 0; flex: none; }
  .term-state::before { content: '●'; font-size: 11px; color: var(--paper-faint); }
  .term-state.ok::before  { color: var(--olive); }
  .term-state.bad::before { color: var(--clay); }
  .term-body { padding: 5px 2px 2px 6px; }

  /* Uzun düğme adları yerine simge — başlık tek satıra sığsın */
  #btn-term-clear, #btn-term-reconnect { font-size: 0; padding: 6px 9px; }
  #btn-term-clear::after     { content: '⌫'; font-size: 14px; }
  #btn-term-reconnect::after { content: '⟳'; font-size: 14px; }
}
