/* ==========================================================================
   Adeta — tasarim sistemi
   ========================================================================== */

:root {
  color-scheme: light;

  /* Yuzeyler */
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --surface-3: #f1f3f5;
  --surface-hover: #f4f6f8;
  --overlay: rgba(15, 23, 32, .48);

  /* Kenarlar */
  --line: #e4e8ec;
  --line-soft: #eef1f4;
  --line-strong: #d3dae0;

  /* Metin */
  --ink: #0f1b24;
  --ink-2: #576672;
  --ink-3: #8996a2;
  --ink-4: #aab5bf;

  /* Marka */
  --accent: #14795f;
  --accent-hover: #0f6650;
  --accent-soft: #e8f4f0;
  --accent-line: #b9ded2;
  --accent-ink: #0c5240;

  /* Durum */
  --ok: #0f8a52;
  --ok-soft: #e6f5ed;
  --warn: #b26a00;
  --warn-soft: #fdf3e2;
  --danger: #c62f23;
  --danger-soft: #fdeceb;
  --info: #1963b3;
  --info-soft: #e9f1fb;

  /* Sohbet */
  --chat-bg: #eceff1;
  --bubble-in: #ffffff;
  --bubble-out: #dff3e9;
  --bubble-line: rgba(15, 27, 36, .07);

  /* Golge */
  --sh-1: 0 1px 2px rgba(15, 27, 36, .05);
  --sh-2: 0 1px 3px rgba(15, 27, 36, .07), 0 4px 12px rgba(15, 27, 36, .05);
  --sh-3: 0 12px 36px rgba(15, 27, 36, .16), 0 2px 8px rgba(15, 27, 36, .08);

  /* Olcu */
  --r-xs: 5px;
  --r-sm: 7px;
  --r-md: 10px;
  --r-lg: 14px;
  --rail-w: 60px;
  --list-w: 336px;
  --side-w: 320px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          "Noto Sans", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1418;
  --surface: #131c21;
  --surface-2: #182228;
  --surface-3: #1f2c33;
  --surface-hover: #1c272e;
  --overlay: rgba(0, 0, 0, .62);

  --line: #24333b;
  --line-soft: #1c272e;
  --line-strong: #33454f;

  --ink: #e6edf1;
  --ink-2: #9aabb5;
  --ink-3: #74868f;
  --ink-4: #5b6c75;

  --accent: #1fa37c;
  --accent-hover: #25b98d;
  --accent-soft: #102c25;
  --accent-line: #1d4a3d;
  --accent-ink: #4fd1aa;

  --ok: #35b47a;
  --ok-soft: #10281d;
  --warn: #d59440;
  --warn-soft: #2b2011;
  --danger: #e2685c;
  --danger-soft: #2e1512;
  --info: #4c9bef;
  --info-soft: #10202f;

  --chat-bg: #0a1116;
  --bubble-in: #1b262d;
  --bubble-out: #0f4437;
  --bubble-line: rgba(255, 255, 255, .06);

  --sh-1: 0 1px 2px rgba(0, 0, 0, .4);
  --sh-2: 0 1px 3px rgba(0, 0, 0, .45), 0 4px 12px rgba(0, 0, 0, .35);
  --sh-3: 0 12px 36px rgba(0, 0, 0, .6), 0 2px 8px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; min-width: 0; }

html, body {
  height: 100%;
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv05", "ss01";
}

button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { display: block; flex: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.012em; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-4); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-xs); }

.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .92em; }

/* ==========================================================================
   Giris
   ========================================================================== */

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  background: var(--surface);
}
@media (min-width: 900px) { .auth { grid-template-columns: 1fr 1.05fr; } }

.auth-aside {
  display: none;
  padding: 56px;
  background: linear-gradient(155deg, #0d3d31 0%, #0f1b24 100%);
  color: #fff;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
@media (min-width: 900px) { .auth-aside { display: flex; } }
.auth-aside::after {
  content: "";
  position: absolute; inset: auto -120px -160px auto;
  width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle, rgba(31,163,124,.28), transparent 68%);
}
.auth-brand { display: flex; align-items: center; gap: 11px; font-weight: 650; font-size: 15px; letter-spacing: -.01em; }
.auth-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.18);
  display: grid; place-items: center;
}
.auth-pitch { position: relative; z-index: 1; }
.auth-pitch h2 { font-size: 30px; line-height: 1.22; letter-spacing: -.025em; margin-bottom: 14px; font-weight: 600; }
.auth-pitch p { color: rgba(255,255,255,.62); max-width: 30ch; margin: 0 0 26px; }
.auth-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 11px; }
.auth-list li { display: flex; gap: 11px; align-items: flex-start; color: rgba(255,255,255,.8); font-size: 13.5px; }
.auth-list svg { margin-top: 2px; color: #4fd1aa; }
.auth-foot { position: relative; z-index: 1; color: rgba(255,255,255,.38); font-size: 12px; }

.auth-main { display: grid; place-items: center; padding: 32px 24px; }
.auth-form { width: 100%; max-width: 348px; }
.auth-form h1 { font-size: 22px; letter-spacing: -.02em; margin-bottom: 5px; }
.auth-form .lede { color: var(--ink-2); font-size: 13.5px; margin: 0 0 28px; }

/* ==========================================================================
   Form
   ========================================================================== */

.field { margin-bottom: 14px; }
.field > label {
  display: block; font-size: 12.5px; font-weight: 550;
  color: var(--ink-2); margin-bottom: 6px;
}

.input, .select, .textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color .13s, box-shadow .13s;
  appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-4); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { resize: vertical; min-height: 78px; line-height: 1.5; }
.select {
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) center, calc(100% - 10px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
  color: var(--ink);
}
input[type="color"] { padding: 2px; height: 34px; cursor: pointer; }
.hint { font-size: 12.5px; color: var(--ink-3); margin: 6px 0 0; line-height: 1.5; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px; font-weight: 550;
  cursor: pointer; white-space: nowrap;
  transition: background .13s, border-color .13s, color .13s;
}
.btn:hover { background: var(--surface-hover); border-color: var(--ink-4); }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn svg { opacity: .8; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-primary svg { opacity: 1; }
.btn-danger { color: var(--danger); border-color: var(--line-strong); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-quiet:hover { background: var(--surface-3); border-color: transparent; color: var(--ink); }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 9px; font-size: 12.5px; gap: 5px; }
.btn-ico { padding: 0; width: 32px; height: 32px; }
.btn-ico.btn-sm { width: 27px; height: 27px; }

.alert {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 10px 12px; border-radius: var(--r-sm);
  font-size: 13px; margin-bottom: 14px; line-height: 1.45;
  border: 1px solid;
}
.alert svg { margin-top: 1px; flex: none; }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 28%, transparent); }
.alert-ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 28%, transparent); }
.alert-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 28%, transparent); }
.alert-warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; font-size: 13px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 32px; height: 19px; border-radius: 99px;
  background: var(--line-strong); position: relative; transition: background .16s; flex: none;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 15px; height: 15px; border-radius: 50%;
  background: #fff; box-shadow: var(--sh-1); transition: transform .16s;
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(13px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--accent-soft); }

/* ==========================================================================
   Kabuk
   ========================================================================== */

.app { display: flex; height: 100vh; overflow: hidden; }

.rail {
  width: var(--rail-w); flex: none;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center;
  padding: 11px 0 9px; gap: 2px; z-index: 30;
}
.rail-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; margin-bottom: 12px; flex: none;
}
.rail-btn {
  width: 42px; height: 40px; flex: none;
  border: 0; background: transparent; cursor: pointer;
  border-radius: var(--r-sm); display: grid; place-items: center;
  position: relative; color: var(--ink-3);
  transition: background .13s, color .13s;
}
.rail-btn:hover { background: var(--surface-3); color: var(--ink); }
.rail-btn.on { background: var(--accent-soft); color: var(--accent-ink); }
.rail-btn .dot {
  position: absolute; top: 6px; right: 6px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 99px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px;
  border: 2px solid var(--surface); box-sizing: content-box;
}
.rail-gap { flex: 1; }
.rail-me {
  width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer;
  color: #fff; font-weight: 650; font-size: 11.5px; letter-spacing: .02em;
  display: grid; place-items: center; flex: none;
}

/* ==========================================================================
   Liste paneli
   ========================================================================== */

.list-pane {
  width: var(--list-w); flex: none;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}

.pane-top { padding: 13px 14px 0; }
.pane-title {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.pane-title h2 { font-size: 16px; letter-spacing: -.015em; flex: 1; }

.searchbar { position: relative; margin-bottom: 11px; }
.searchbar svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-4); pointer-events: none; }
.searchbar .input { padding-left: 32px; background: var(--surface-2); border-color: transparent; }
.searchbar .input:focus { background: var(--surface); border-color: var(--accent); }

.filters {
  display: flex; gap: 5px; overflow-x: auto; padding: 0 14px 11px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.filters::-webkit-scrollbar { display: none; }

.tab {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  border: 1px solid var(--line); background: var(--surface-2);
  padding: 4px 10px; border-radius: 99px;
  font-size: 12.5px; font-weight: 550; color: var(--ink-2);
  cursor: pointer; white-space: nowrap;
  transition: background .13s, color .13s, border-color .13s;
}
.tab:hover { background: var(--surface-3); color: var(--ink); }
.tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tab .n { font-size: 11px; font-weight: 700; opacity: .85; font-variant-numeric: tabular-nums; }

.chat-list { flex: 1; overflow-y: auto; border-top: 1px solid var(--line-soft); }

.row {
  display: flex; gap: 11px; padding: 10px 14px;
  cursor: pointer; position: relative;
  border-bottom: 1px solid var(--line-soft);
  transition: background .1s;
}
.row:hover { background: var(--surface-hover); }
.row.on { background: var(--accent-soft); }
.row.on::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 2px; background: var(--accent);
}

.ava {
  width: 40px; height: 40px; flex: none; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  font-weight: 650; font-size: 13px; letter-spacing: .01em;
  overflow: hidden; user-select: none;
}
.ava img { width: 100%; height: 100%; object-fit: cover; }
.ava.md { width: 32px; height: 32px; font-size: 11.5px; }
.ava.sm { width: 26px; height: 26px; font-size: 10px; }
.ava.xs { width: 20px; height: 20px; font-size: 8.5px; }
.ava.xl { width: 76px; height: 76px; font-size: 26px; }

.row-body { flex: 1; }
.row-1 { display: flex; align-items: baseline; gap: 8px; }
.row-name {
  flex: 1; font-size: 13.5px; font-weight: 550;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row.unread .row-name { font-weight: 650; }
.row-time { font-size: 11.5px; color: var(--ink-4); flex: none; font-variant-numeric: tabular-nums; }
.row-2 { display: flex; align-items: center; gap: 7px; margin-top: 2px; }
.row-text {
  flex: 1; font-size: 12.5px; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: flex; align-items: center; gap: 4px;
}
.row-text svg { color: var(--ink-4); }
.row.unread .row-text { color: var(--ink); }
.row-3 { display: flex; align-items: center; gap: 4px; margin-top: 6px; flex-wrap: wrap; }

.count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  font-variant-numeric: tabular-nums; flex: none;
}

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 550; padding: 2px 7px;
  border-radius: var(--r-xs); background: var(--surface-3); color: var(--ink-2);
  white-space: nowrap; line-height: 1.5;
}
.chip svg { opacity: .75; }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.accent { background: var(--accent-soft); color: var(--accent-ink); }
.chip.solid { color: #fff; }
.chip .swatch { width: 7px; height: 7px; border-radius: 50%; flex: none; }

.empty {
  padding: 52px 26px; text-align: center; color: var(--ink-3);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.empty svg { color: var(--ink-4); opacity: .55; }
.empty .t { font-weight: 600; color: var(--ink-2); font-size: 14px; }
.empty .d { font-size: 13px; max-width: 34ch; line-height: 1.55; }

/* ==========================================================================
   Konusma
   ========================================================================== */

.conv { flex: 1; display: flex; flex-direction: column; background: var(--chat-bg); position: relative; }

.conv-blank {
  flex: 1; display: grid; place-items: center; background: var(--surface-2);
  border-left: 1px solid var(--line);
}
.conv-blank .inner { text-align: center; max-width: 350px; padding: 24px; }
.conv-blank .glyph {
  width: 62px; height: 62px; border-radius: 16px; margin: 0 auto 18px;
  background: var(--surface-3); color: var(--ink-4);
  display: grid; place-items: center;
}
.conv-blank h2 { font-size: 17px; margin-bottom: 7px; }
.conv-blank p { color: var(--ink-3); font-size: 13.5px; margin: 0; line-height: 1.55; }

.conv-top {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 14px; background: var(--surface);
  border-bottom: 1px solid var(--line); z-index: 5;
}
.conv-id { flex: 1; cursor: pointer; }
.conv-id .n { font-weight: 600; font-size: 14.5px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-id .s { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; margin-top: 1px; }
.conv-tools { display: flex; gap: 2px; align-items: center; }

.watchers { display: flex; align-items: center; padding-right: 4px; }
.watchers .ava { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.watchers .ava:first-child { margin-left: 0; }

.thread {
  flex: 1; overflow-y: auto; padding: 16px max(6%, 20px);
  scroll-behavior: smooth;
}

.daymark { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; }
.daymark::before, .daymark::after { content: ""; height: 1px; background: var(--bubble-line); flex: 1; }
.daymark span { font-size: 11.5px; font-weight: 600; color: var(--ink-3); letter-spacing: .01em; }

.msg { display: flex; margin-bottom: 4px; align-items: flex-end; gap: 4px; }
.msg.out { justify-content: flex-end; }
.msg.tight { margin-top: -2px; }

.bubble {
  max-width: min(70%, 620px);
  background: var(--bubble-in);
  border: 1px solid var(--bubble-line);
  border-radius: var(--r-md);
  padding: 7px 10px 5px;
  position: relative;
  overflow-wrap: anywhere;
  box-shadow: var(--sh-1);
}
.msg.out .bubble { background: var(--bubble-out); border-color: transparent; }
.bubble .who { font-size: 12px; font-weight: 650; margin-bottom: 3px; letter-spacing: -.005em; }
.bubble .body { font-size: 14px; line-height: 1.45; white-space: pre-wrap; }
.bubble .body a { text-decoration: underline; text-underline-offset: 2px; }
.bubble.gone .body { font-style: italic; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }

.stamp {
  float: right; margin: 5px 0 0 10px;
  font-size: 10.5px; color: var(--ink-4);
  display: inline-flex; align-items: center; gap: 3px;
  font-variant-numeric: tabular-nums;
}
.stamp svg { color: inherit; }
.stamp .read { color: #34a3dd; }
.stamp .fail { color: var(--danger); }

.author {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; margin-bottom: 3px;
}
.author .swatch { width: 6px; height: 6px; border-radius: 50%; flex: none; }

.cite {
  border-left: 2.5px solid var(--accent);
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  border-radius: var(--r-xs); padding: 5px 8px; margin-bottom: 5px; font-size: 12.5px;
}
.cite .w { font-weight: 650; color: var(--accent-ink); font-size: 11.5px; }
.cite .t { color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.xlate {
  margin-top: 7px; padding-top: 7px;
  border-top: 1px dashed var(--bubble-line);
  font-size: 13px; color: var(--ink-2); line-height: 1.45;
}
.xlate .lbl {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 700; color: var(--accent-ink);
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px;
}

.att img, .att video { max-width: 100%; max-height: 320px; border-radius: var(--r-sm); display: block; cursor: pointer; }
.att audio { width: 250px; max-width: 100%; height: 38px; }
.att.sticker img { max-width: 128px; }
.att + .body { margin-top: 6px; }

.attach-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  color: inherit; text-decoration: none;
}
.attach-card:hover { background: color-mix(in srgb, var(--ink) 9%, transparent); text-decoration: none; }
.attach-card .ic {
  width: 34px; height: 34px; border-radius: var(--r-xs); flex: none;
  background: var(--surface); color: var(--accent);
  display: grid; place-items: center;
}
.attach-card .nm { font-size: 12.5px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-card .sz { font-size: 11px; color: var(--ink-3); }

.emoji-mark {
  position: absolute; bottom: -10px; left: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 99px; padding: 0 5px; font-size: 12px; line-height: 18px;
  box-shadow: var(--sh-1);
}
.msg.out .emoji-mark { left: auto; right: 8px; }

.msg-acts { display: flex; gap: 1px; opacity: 0; transition: opacity .12s; align-self: flex-end; padding-bottom: 2px; }
.msg:hover .msg-acts { opacity: 1; }
.msg-acts button {
  width: 26px; height: 26px; border: 1px solid var(--line);
  background: var(--surface); border-radius: var(--r-xs);
  cursor: pointer; color: var(--ink-3);
  display: grid; place-items: center;
}
.msg-acts button:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

.thread-top {
  display: flex; justify-content: center; padding: 4px 0 10px;
}

/* ==========================================================================
   Yazma alani
   ========================================================================== */

.composer { background: var(--surface); border-top: 1px solid var(--line); padding: 9px 12px 10px; }

.reply-strip {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; margin-bottom: 8px;
  background: var(--surface-2); border-left: 2.5px solid var(--accent);
  border-radius: var(--r-xs); font-size: 12.5px;
}
.reply-strip .g { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-strip .k { font-size: 11px; font-weight: 650; color: var(--accent-ink); }

.compose-row { display: flex; align-items: flex-end; gap: 6px; }
.compose-box {
  flex: 1; border: 1px solid var(--line-strong); border-radius: 18px;
  background: var(--surface-2); padding: 9px 14px;
  max-height: 168px; overflow-y: auto; resize: none; outline: none;
  line-height: 1.45; font-size: 14px;
  transition: border-color .13s, background .13s;
}
.compose-box:focus { border-color: var(--accent); background: var(--surface); }

.send {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  background: var(--accent); color: #fff; border: 0; cursor: pointer;
  display: grid; place-items: center; transition: background .13s;
}
.send:hover { background: var(--accent-hover); }
.send:disabled { background: var(--line-strong); cursor: not-allowed; }
.rec-on { background: var(--danger) !important; animation: pulse 1.3s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }

.compose-meta {
  display: flex; align-items: center; gap: 12px; margin-top: 8px;
  font-size: 12px; color: var(--ink-3); flex-wrap: wrap;
}
.hint-slash { display: none; align-items: center; gap: 4px; }
@media (min-width: 1000px) { .hint-slash { display: inline-flex; } }

.xlate-preview {
  margin-top: 8px; padding: 8px 11px;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  border-radius: var(--r-sm); font-size: 13px; color: var(--ink);
}
.xlate-preview .lbl {
  display: flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700; color: var(--accent-ink);
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px;
}

.suggest {
  position: absolute; bottom: 100%; left: 12px; right: 12px; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--sh-3);
  max-height: 246px; overflow-y: auto; z-index: 40; padding: 4px;
}
.suggest-item { padding: 8px 10px; cursor: pointer; border-radius: var(--r-xs); }
.suggest-item:hover, .suggest-item.on { background: var(--accent-soft); }
.suggest-item .k { font-family: var(--mono); font-size: 11.5px; font-weight: 650; color: var(--accent-ink); }
.suggest-item .p { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================================================
   Yan panel
   ========================================================================== */

.side {
  width: var(--side-w); flex: none; background: var(--surface);
  border-left: 1px solid var(--line); overflow-y: auto;
}
.side.off { display: none; }

.side-bar {
  display: none; align-items: center; gap: 8px;
  padding: 9px 12px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--surface); z-index: 2;
}
@media (max-width: 860px) { .side-bar.m-only { display: flex; } }

.side-id { padding: 22px 18px 18px; text-align: center; border-bottom: 1px solid var(--line-soft); }
.side-id .ava { margin: 0 auto 12px; }
.side-id h3 { font-size: 16px; margin-bottom: 3px; }
.side-id .sub { color: var(--ink-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.side-id .acts { display: flex; gap: 6px; justify-content: center; margin-top: 14px; }

.block { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.block > h4 {
  display: flex; align-items: center; gap: 7px; margin-bottom: 11px;
  font-size: 10.5px; font-weight: 700; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .07em;
}
.block > h4 .g { flex: 1; }

.pair { display: flex; gap: 10px; padding: 4px 0; font-size: 13px; }
.pair .k { color: var(--ink-3); width: 88px; flex: none; }
.pair .v { flex: 1; word-break: break-word; }

.memo {
  background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 22%, transparent);
  border-radius: var(--r-sm); padding: 9px 11px; margin-bottom: 7px; font-size: 12.5px; line-height: 1.5;
}
.memo .meta { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 11px; color: var(--ink-3); }

.task {
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 9px 11px; margin-bottom: 7px; font-size: 12.5px; background: var(--surface-2);
}
.task.hot { border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: var(--danger-soft); }
.task .t { font-weight: 600; }
.task .w { font-size: 11.5px; color: var(--ink-2); margin-top: 3px; display: flex; align-items: center; gap: 5px; }
.task .acts { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; }

.tagbox { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-toggle {
  font-size: 11.5px; font-weight: 550; padding: 3px 9px;
  border-radius: var(--r-xs); cursor: pointer; border: 1px solid; background: transparent;
  transition: background .12s, color .12s;
}
.tag-toggle.on { color: #fff !important; }

/* ==========================================================================
   Sayfalar
   ========================================================================== */

.page { flex: 1; overflow-y: auto; padding: 22px 26px 40px; }
.page-top { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-top h1 { font-size: 20px; letter-spacing: -.02em; }
.page-top .g { flex: 1; }
.page-sub { color: var(--ink-3); font-size: 13px; margin: -14px 0 20px; max-width: 68ch; line-height: 1.55; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 16px;
}
.card.flush { padding: 0; overflow: hidden; }
.card-head { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 10px; }
.card-head h3 { font-size: 13.5px; flex: 1; }

.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); }

.metric .k {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .05em;
}
.metric .v { font-size: 25px; font-weight: 650; letter-spacing: -.03em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.metric .d { font-size: 12px; color: var(--ink-3); margin-top: 3px; }

table.grid-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid-table th {
  text-align: left; padding: 9px 14px; font-size: 10.5px; font-weight: 700;
  color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--line); background: var(--surface-2); position: sticky; top: 0;
}
table.grid-table td { padding: 9px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.grid-table tr:last-child td { border-bottom: 0; }
table.grid-table tbody tr:hover td { background: var(--surface-hover); }

.meter { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

.bars { display: flex; align-items: flex-end; gap: 2px; height: 96px; }
.bars .b { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 1px; min-width: 3px; border-radius: 2px; }
.bars .b i { display: block; border-radius: 2px 2px 0 0; min-height: 1px; }
.bars .b .in { background: var(--info); }
.bars .b .out { background: var(--accent); }
.legend { display: flex; gap: 16px; margin-top: 12px; font-size: 12px; color: var(--ink-2); }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 2px; }

/* Pipeline */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 14px; align-items: flex-start; }
.lane {
  flex: none; width: 278px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 11px; max-height: calc(100vh - 158px); display: flex; flex-direction: column;
}
.lane.hover { border-color: var(--accent); background: var(--accent-soft); }
.lane h3 { display: flex; align-items: center; gap: 7px; font-size: 12.5px; margin-bottom: 3px; }
.lane h3 .n { margin-left: auto; color: var(--ink-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.lane .sum { font-size: 11.5px; color: var(--ink-3); margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.lane .items { overflow-y: auto; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

.deal {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 9px 11px; cursor: grab; font-size: 12.5px;
  transition: border-color .12s, box-shadow .12s;
}
.deal:hover { border-color: var(--accent-line); box-shadow: var(--sh-1); }
.deal.moving { opacity: .4; }
.deal .n { font-weight: 600; margin-bottom: 4px; }
.deal .m { font-size: 11.5px; color: var(--ink-3); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ==========================================================================
   Katmanlar
   ========================================================================== */

.scrim {
  position: fixed; inset: 0; background: var(--overlay);
  display: grid; place-items: center; z-index: 200; padding: 20px;
  backdrop-filter: blur(3px);
  animation: fade .14s ease-out;
}
@keyframes fade { from { opacity: 0 } }

.sheet {
  background: var(--surface); border-radius: var(--r-lg);
  width: 100%; max-width: 452px; max-height: 88vh;
  display: flex; flex-direction: column; box-shadow: var(--sh-3);
  animation: rise .16s cubic-bezier(.2,.8,.3,1);
}
@keyframes rise { from { transform: translateY(10px) scale(.99); opacity: 0 } }
.sheet.wide { max-width: 720px; }
.sheet-top { padding: 15px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.sheet-top h3 { font-size: 15px; flex: 1; }
.sheet-body { padding: 18px; overflow-y: auto; }
.sheet-foot { padding: 13px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }

.viewer {
  position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 300;
  display: grid; place-items: center; cursor: zoom-out; padding: 32px;
}
.viewer img, .viewer video { max-width: 100%; max-height: 100%; border-radius: var(--r-sm); }

.notes {
  position: fixed; bottom: 18px; right: 18px; z-index: 400;
  display: flex; flex-direction: column; gap: 8px; max-width: 344px;
}
.note-card {
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--accent); border-radius: var(--r-sm);
  padding: 10px 13px; box-shadow: var(--sh-3); font-size: 13px; cursor: pointer;
  animation: slide .18s ease-out; line-height: 1.45;
}
.note-card.error { border-left-color: var(--danger); }
.note-card.warn { border-left-color: var(--warn); }
.note-card .t { font-weight: 650; margin-bottom: 2px; display: flex; align-items: center; gap: 6px; }
@keyframes slide { from { transform: translateX(20px); opacity: 0 } }

.spin {
  width: 16px; height: 16px; border: 2px solid var(--line-strong);
  border-top-color: var(--accent); border-radius: 50%;
  animation: rot .65s linear infinite; display: inline-block; flex: none;
}
@keyframes rot { to { transform: rotate(360deg) } }
.center { display: grid; place-items: center; height: 100%; min-height: 120px; }

/* Baglanti durumu */
.state { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.state.connected { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
.state.connecting, .state.reconnecting, .state.qr { background: var(--warn); }
.state.disconnected, .state.logged_out, .state.error { background: var(--danger); }

.qr-panel { text-align: center; padding: 4px 0; }
.qr-panel img {
  width: 232px; height: 232px; background: #fff; padding: 10px;
  border-radius: var(--r-md); border: 1px solid var(--line);
}
.steps { list-style: none; padding: 0; margin: 16px auto 0; max-width: 300px; text-align: left; display: grid; gap: 9px; }
.steps li { display: flex; gap: 10px; font-size: 12.5px; color: var(--ink-2); align-items: flex-start; }
.steps .i {
  width: 19px; height: 19px; border-radius: 50%; flex: none;
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: 10.5px; font-weight: 700; display: grid; place-items: center; margin-top: 1px;
}

/* ==========================================================================
   Duyarli
   ========================================================================== */

.m-only { display: none; }

@media (max-width: 1200px) {
  .side { position: absolute; right: 0; top: 0; bottom: 0; z-index: 25; box-shadow: var(--sh-3); }
  .thread { padding-left: 20px; padding-right: 20px; }
}

@media (max-width: 860px) {
  :root { --list-w: 100%; --rail-w: 54px; }
  .m-only { display: inline-flex; }
  .app.reading .list-pane { display: none; }
  .app:not(.reading) .conv, .app:not(.reading) .conv-blank { display: none; }
  .list-pane { border-right: 0; }
  .side { width: 100%; }
  .bubble { max-width: 88%; }
  .page { padding: 16px 14px 32px; }
  .compose-box { font-size: 16px; }        /* iOS'ta otomatik yakınlaştırmayı önler */

  /* Dokunmatikte eylem düğmeleri balonu daraltmasın: mesaja dokununca çıkar */
  .msg-acts { display: none; }
  .msg.tapped .msg-acts { display: flex; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
