/* FiXAi — Apple esintili arayüz */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f2f2f7;
  --fill: rgba(120, 120, 128, .12);
  --fill-2: rgba(120, 120, 128, .2);
  --sep: rgba(60, 60, 67, .12);
  --text: #1d1d1f;
  --secondary: #6e6e73;
  --tertiary: #aeaeb2;
  --blue: #0071e3;
  --green: #34c759;
  --orange: #ff9500;
  --red: #ff3b30;
  --glass: rgba(255, 255, 255, .72);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 1px rgba(0, 0, 0, .02);
  --shadow: 0 2px 6px rgba(0, 0, 0, .04), 0 12px 32px rgba(0, 0, 0, .06);
  --shadow-lg: 0 8px 20px rgba(0, 0, 0, .06), 0 30px 60px rgba(0, 0, 0, .1);
  --r-sm: 10px; --r: 14px; --r-lg: 22px;
  /* modül renkleri */
  --accent: var(--blue);
  --accent-soft: rgba(0, 113, 227, .1);
  --accent-grad: linear-gradient(135deg, #0a84ff, #bf5af2);
  --bubble-user: #e9e9eb;
  --bubble-agent: #e5f0ff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e;
    --fill: rgba(120, 120, 128, .24); --fill-2: rgba(120, 120, 128, .36);
    --sep: rgba(84, 84, 88, .6);
    --text: #f5f5f7; --secondary: #98989d; --tertiary: #636366;
    --blue: #0a84ff; --green: #30d158; --orange: #ff9f0a; --red: #ff453a;
    --glass: rgba(28, 28, 30, .72);
    --shadow-sm: none; --shadow: 0 0 0 1px rgba(255, 255, 255, .06); --shadow-lg: 0 0 0 1px rgba(255, 255, 255, .08);
    --bubble-user: #26252a; --bubble-agent: #16304f;
    --accent-soft: rgba(10, 132, 255, .18);
  }
}
body[data-module="instagram"] {
  --accent: #d62976;
  --accent-soft: rgba(214, 41, 118, .1);
  --accent-grad: linear-gradient(45deg, #feda75 0%, #fa7e1e 25%, #d62976 55%, #962fbf 80%, #4f5bd5 100%);
}
body[data-module="trendyol"] {
  --accent: #f27a1a;
  --accent-soft: rgba(242, 122, 26, .12);
  --accent-grad: linear-gradient(135deg, #ff9a3c, #f27a1a 55%, #e05d00);
}
@media (prefers-color-scheme: dark) {
  body[data-module="instagram"] { --accent: #ff4f9a; --accent-soft: rgba(255, 79, 154, .16); }
  body[data-module="trendyol"] { --accent: #ff8a2a; --accent-soft: rgba(255, 138, 42, .16); }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.47 var(--font); letter-spacing: -.01em; background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
.hidden { display: none !important; }
.secondary { color: var(--secondary); }
.small { font-size: 13px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -.022em; }
svg.ico { width: 1em; height: 1em; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.125em; flex-shrink: 0; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 500 15px/1 var(--font);
  letter-spacing: -.01em; padding: 10px 18px; border-radius: 980px; border: 0; cursor: pointer; white-space: nowrap;
  background: var(--fill); color: var(--text); transition: background .15s, transform .1s, opacity .15s; text-decoration: none; }
.btn:hover { background: var(--fill-2); text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.danger { color: var(--red); }
.btn.sm { font-size: 13px; padding: 7px 14px; }
.btn.lg { font-size: 17px; padding: 14px 22px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }

/* ---------- Inputs ---------- */
input, textarea, select { width: 100%; font: 15px/1.4 var(--font); letter-spacing: -.01em; color: var(--text);
  background: var(--surface); border: 1px solid var(--sep); border-radius: var(--r-sm); padding: 10px 12px;
  transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: var(--tertiary); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
input[type="search"] { background: var(--fill); border-color: transparent; padding-left: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 16px; background-position: 11px center; }
textarea { resize: vertical; }
select { appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 16px; background-position: right 12px center; }
label { display: block; margin-bottom: 16px; font-size: 13px; font-weight: 500; color: var(--secondary); }
label > input, label > textarea, label > select, label > .copy-row { margin-top: 6px; }
label small { display: block; font-weight: 400; color: var(--tertiary); margin-top: 5px; font-size: 12px; }
label.check { display: flex; gap: 10px; align-items: flex-start; color: var(--text); font-size: 15px; font-weight: 400; }
label.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.error { color: var(--red); min-height: 1.2em; font-size: 13px; margin: 8px 0 0; }
.copy-row { display: flex; gap: 8px; }

/* ---------- Switch (iOS) ---------- */
.switch { position: relative; width: 51px; height: 31px; flex-shrink: 0; display: inline-block; margin: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch > span { position: absolute; inset: 0; background: var(--fill-2); border-radius: 99px; cursor: pointer; transition: background .25s; }
.switch > span::before { content: ""; position: absolute; width: 27px; height: 27px; left: 2px; top: 2px; background: #fff;
  border-radius: 50%; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16); transition: transform .25s cubic-bezier(.3, .7, .4, 1); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::before { transform: translateX(20px); }
.switch.sm { width: 42px; height: 26px; }
.switch.sm > span::before { width: 22px; height: 22px; }
.switch.sm input:checked + span::before { transform: translateX(16px); }

/* ---------- Segmented control ---------- */
.seg { display: inline-flex; padding: 2px; background: var(--fill); border-radius: 9px; gap: 2px; }
.seg button { border: 0; background: transparent; font: 500 13px var(--font); color: var(--text); padding: 6px 14px;
  border-radius: 7px; cursor: pointer; white-space: nowrap; transition: background .2s, box-shadow .2s; }
.seg button.active { background: var(--surface); box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04); }
@media (prefers-color-scheme: dark) { .seg button.active { background: #636366; } }
.seg.scroll { display: flex; overflow-x: auto; scrollbar-width: none; }
.seg.scroll::-webkit-scrollbar { display: none; }

/* ---------- Brand ---------- */
.app-icon { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #0a84ff, #bf5af2);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; letter-spacing: -.04em;
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .3); flex-shrink: 0; }
.app-icon.big { width: 76px; height: 76px; border-radius: 18px; font-size: 32px; margin: 0 auto 18px; box-shadow: var(--shadow-lg); }
.wordmark { font-size: 34px; font-weight: 700; letter-spacing: -.035em; }
.wordmark span { background: linear-gradient(135deg, #0a84ff, #bf5af2); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wordmark.sm { font-size: 19px; }
.brand-inline { display: flex; align-items: center; gap: 10px; }

/* ---------- Glass ---------- */
.glass { background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }

/* ---------- Login ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(10, 132, 255, .12), transparent 60%),
              radial-gradient(800px 500px at 90% 110%, rgba(191, 90, 242, .12), transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 360px; text-align: center; }
.login-card .secondary { margin: 4px 0 28px; font-size: 17px; }
.login-card input { margin-bottom: 12px; padding: 13px 14px; font-size: 17px; text-align: center; border-radius: 12px; }

/* ---------- Home ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: 10px max(16px, calc((100vw - 1040px) / 2)); border-bottom: 1px solid var(--sep); }
.top-actions { display: flex; gap: 4px; }
.home-main { max-width: 1040px; margin: 0 auto; padding: 56px 16px 80px; }
.eyebrow { color: var(--secondary); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; margin: 0 0 6px; }
.hero-title { font-size: clamp(40px, 6vw, 56px); font-weight: 700; letter-spacing: -.04em; line-height: 1.05; }
.hero-sub { font-size: clamp(19px, 2.4vw, 24px); color: var(--secondary); margin: 8px 0 36px; letter-spacing: -.02em; }
.modules { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.module-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-lg);
  padding: 28px; min-height: 280px; color: var(--text); box-shadow: var(--shadow); overflow: hidden;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s; text-decoration: none !important; }
.module-card::after { content: ""; position: absolute; inset: auto -30% -60% auto; width: 340px; height: 340px; border-radius: 50%;
  background: var(--mc-grad); opacity: .1; filter: blur(10px); transition: opacity .35s; pointer-events: none; }
.module-card:hover { transform: translateY(-4px) scale(1.005); box-shadow: var(--shadow-lg); }
.module-card:hover::after { opacity: .18; }
.module-card.ig { --mc-grad: linear-gradient(45deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5); --mc-accent: #d62976; }
.module-card.ty { --mc-grad: linear-gradient(135deg, #ff9a3c, #f27a1a, #e05d00); --mc-accent: #f27a1a; }
.mc-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 28px; }
.mc-icon { width: 60px; height: 60px; border-radius: 16px; background: var(--mc-grad); color: #fff; display: grid; place-items: center;
  font-size: 30px; box-shadow: 0 8px 20px -6px var(--mc-accent); }
.mc-icon svg.ico { stroke-width: 1.9; }
.module-card h2 { font-size: 28px; font-weight: 700; letter-spacing: -.03em; }
.module-card > p { color: var(--secondary); margin: 4px 0 22px; font-size: 17px; }
.mc-stats { display: flex; gap: 28px; margin-top: auto; padding-right: 56px; }
.mc-stats div b { display: block; font-size: 28px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.mc-stats div span { font-size: 12px; color: var(--secondary); }
.mc-stats div.hot b { color: var(--mc-accent); }
.mc-cta { position: absolute; right: 28px; bottom: 26px; color: var(--mc-accent); font-weight: 500; display: flex; align-items: center; gap: 2px; }
.pill { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: var(--fill); color: var(--secondary); display: inline-flex; align-items: center; gap: 6px; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--tertiary); }
.pill.on { color: var(--green); background: rgba(52, 199, 89, .12); }
.pill.on::before { background: var(--green); }
.pill.off::before { background: var(--orange); }
.section-title { font-size: 22px; font-weight: 700; margin: 48px 0 14px; letter-spacing: -.025em; }
.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--sep); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm); }
.tool-card { display: flex; align-items: center; gap: 14px; background: var(--surface); padding: 16px 18px; color: var(--text); text-decoration: none !important; transition: background .15s; }
.tool-card:hover { background: var(--surface-2); }
.tool-card b { display: block; font-weight: 600; }
.tool-card span { font-size: 13px; color: var(--secondary); }
.tool-icon { width: 36px; height: 36px; border-radius: 9px; background: linear-gradient(135deg, #0a84ff, #bf5af2); color: #fff; display: grid; place-items: center; font-size: 19px; flex-shrink: 0; }
svg.tool-chev { margin-left: auto; color: var(--tertiary); width: 16px; height: 16px; }

/* ---------- Shell / Sidebar ---------- */
.shell { display: flex; height: 100vh; }
.sidebar { width: 248px; flex-shrink: 0; border-right: 1px solid var(--sep); display: flex; flex-direction: column; padding: 14px 12px; z-index: 10; }
.back-link { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-size: 15px; padding: 4px 6px; margin-bottom: 14px; }
.back-link:hover { text-decoration: none; opacity: .75; }
.mod-head { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; }
.mod-icon { width: 40px; height: 40px; border-radius: 11px; background: var(--accent-grad); color: #fff; display: grid; place-items: center; font-size: 22px; flex-shrink: 0; }
.mod-head b { display: block; font-size: 17px; letter-spacing: -.02em; }
.mod-head small { color: var(--secondary); font-size: 12px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: var(--text); font-size: 15px; text-decoration: none; }
.sidebar nav a .ico { font-size: 19px; color: var(--accent); }
.sidebar nav a:hover { background: var(--fill); }
.sidebar nav a.active { background: var(--accent); color: #fff; }
.sidebar nav a.active .ico { color: #fff; }
.sidebar-foot { border-top: 1px solid var(--sep); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.switch-row { display: flex; justify-content: space-between; align-items: center; margin: 0; padding: 2px 8px; color: var(--text); font-size: 14px; font-weight: 500; }
.badge { margin-left: auto; background: var(--red); color: #fff; border-radius: 99px; font-size: 12px; font-weight: 600; min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; }
.sidebar nav a.active .badge { background: #fff; color: var(--accent); }

main#main { flex: 1; overflow-y: auto; }
.page { display: none; padding: 36px 40px 64px; max-width: 1120px; animation: fadeIn .25s ease; }
.page.active { display: block; }
.page-full.active { padding: 0; max-width: none; height: 100%; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: 34px; font-weight: 700; letter-spacing: -.035em; }
.page-head p { margin: 4px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.panel { background: var(--surface); border-radius: var(--r); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.panel h3 { font-size: 17px; font-weight: 600; margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input[type="search"] { margin-left: auto; max-width: 280px; }
.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 12px; background: rgba(255, 149, 0, .1); color: var(--text); font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.alert::before { content: ""; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--orange); flex-shrink: 0; }
.alert.ok { background: rgba(52, 199, 89, .1); }
.alert.ok::before { background: var(--green); }
.alert.bad { background: rgba(255, 59, 48, .1); }
.alert.bad::before { background: var(--red); }

/* ---------- Stat cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.cards.three { grid-template-columns: repeat(3, 1fr); }
.card { background: var(--surface); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.card .num { font-size: 32px; font-weight: 600; letter-spacing: -.035em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.card .lbl { color: var(--secondary); font-size: 13px; margin-top: 2px; }
.card.hot .num { color: var(--accent); }
.list-compact .row-item { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--sep); cursor: pointer; }
.list-compact .row-item:last-child { border: 0; }
.list-compact .row-item span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Form groups (iOS Settings) ---------- */
.form { max-width: 760px; }
.group { background: var(--surface); border-radius: var(--r); padding: 18px 20px 4px; margin-bottom: 22px; box-shadow: var(--shadow-sm); }
.group-title { font-size: 13px; font-weight: 600; color: var(--secondary); text-transform: uppercase; letter-spacing: .02em; margin: -2px 0 14px; }
.group label.check { margin-bottom: 14px; }

/* ---------- Inbox ---------- */
.inbox { display: flex; height: 100vh; }
.inbox-list { width: 360px; flex-shrink: 0; border-right: 1px solid var(--sep); background: var(--surface); display: flex; flex-direction: column; }
.inbox-tools { padding: 20px 16px 12px; display: flex; flex-direction: column; gap: 12px; }
.inbox-title { font-size: 28px; font-weight: 700; letter-spacing: -.03em; }
#convList { overflow-y: auto; flex: 1; }
.conv { display: flex; gap: 12px; padding: 11px 16px; cursor: pointer; position: relative; }
.conv::after { content: ""; position: absolute; left: 70px; right: 0; bottom: 0; border-bottom: 1px solid var(--sep); }
.conv:hover { background: var(--surface-2); }
.conv.active { background: var(--accent-soft); }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(180deg, #a1a1a6, #8e8e93); color: #fff;
  display: grid; place-items: center; font-weight: 600; font-size: 17px; flex-shrink: 0; }
.avatar.ig-grad { background: linear-gradient(45deg, #feda75, #fa7e1e, #d62976, #962fbf); }
.conv-main { flex: 1; min-width: 0; }
.conv-top { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.conv-top b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-top time { color: var(--secondary); font-size: 13px; flex-shrink: 0; }
.conv-last { color: var(--secondary); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 1px 0 4px; }
.conv.unread .conv-last { color: var(--text); font-weight: 500; }
.conv.unread::before { content: ""; position: absolute; left: 5px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--blue); }
.tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 99px; font-weight: 600; }
.tag.bot { background: rgba(52, 199, 89, .14); color: #248a3d; }
.tag.human { background: rgba(0, 113, 227, .12); color: var(--blue); }
.tag.wait { background: rgba(255, 149, 0, .16); color: #c93400; }
@media (prefers-color-scheme: dark) { .tag.bot { color: var(--green); } .tag.wait { color: var(--orange); } }
.inbox-chat { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.empty-state { margin: auto; text-align: center; color: var(--tertiary); }
.empty-state svg.ico { width: 56px; height: 56px; stroke-width: 1.2; }
.empty-state p { font-size: 15px; color: var(--secondary); }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--sep); flex-wrap: wrap; }
.chat-head .who { flex: 1; min-width: 140px; }
.chat-head .who b { font-weight: 600; }
.chat-head .who small { display: block; color: var(--secondary); font-size: 13px; }
.chat-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 3px; }
.msg { max-width: 68%; display: flex; flex-direction: column; margin-bottom: 6px; }
.msg .bubble { padding: 8px 14px; border-radius: 20px; white-space: pre-wrap; word-wrap: break-word; font-size: 15px; line-height: 1.38; }
.msg .meta { font-size: 11px; color: var(--secondary); margin: 3px 8px 0; display: flex; gap: 8px; align-items: center; }
.msg.user { align-self: flex-start; }
.msg.user .bubble { background: var(--bubble-user); border-bottom-left-radius: 6px; }
.msg.bot, .msg.agent { align-self: flex-end; align-items: flex-end; }
.msg.bot .bubble { background: var(--accent-grad); color: #fff; border-bottom-right-radius: 6px; }
.msg.agent .bubble { background: var(--blue); color: #fff; border-bottom-right-radius: 6px; }
.msg.system { align-self: center; max-width: 90%; }
.msg.system .bubble { background: transparent; color: var(--secondary); font-size: 12px; padding: 4px; text-align: center; }
.msg img { max-width: 240px; border-radius: 18px; display: block; margin-bottom: 4px; }
.fix-btn { border: 0; background: none; color: var(--accent); cursor: pointer; font: 500 11px var(--font); padding: 0; }
.chat-input { display: flex; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--sep); align-items: flex-end; }
.chat-input textarea { min-height: 40px; max-height: 140px; border-radius: 20px; padding: 9px 16px; }
.chat-note { padding: 8px 20px; background: rgba(255, 204, 0, .14); font-size: 13px; }

/* ---------- Knowledge / lists ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.kb-item { background: var(--surface); border-radius: var(--r); padding: 16px 18px; display: flex; gap: 16px; box-shadow: var(--shadow-sm); }
.kb-item.off { opacity: .5; }
.kb-item .body { flex: 1; min-width: 0; }
.kb-item .title { font-weight: 600; }
.kb-item .content { color: var(--secondary); white-space: pre-wrap; margin-top: 4px; max-height: 4.4em; overflow: hidden; font-size: 14px; }
.kb-item .foot { display: flex; gap: 10px; align-items: center; margin-top: 10px; font-size: 12px; color: var(--tertiary); flex-wrap: wrap; }
.kb-item .ops { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.kind { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 99px; }
.kind.qa { color: #8944ab; background: rgba(175, 82, 222, .12); }
.kind.product { color: #c93400; background: rgba(255, 149, 0, .14); }
.kind.text { color: var(--blue); background: rgba(0, 113, 227, .1); }
@media (prefers-color-scheme: dark) { .kind.qa { color: #da8fff; } .kind.product { color: #ffb340; } }
.kb-foot { display: flex; gap: 8px; margin-top: 20px; }

/* ---------- Trendyol ---------- */
.ty-item { background: var(--surface); border-radius: var(--r); padding: 18px; display: flex; gap: 16px; box-shadow: var(--shadow-sm); border: 1px solid transparent; }
.ty-item.unsure { border-color: rgba(255, 149, 0, .5); }
.ty-item img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; flex-shrink: 0; background: var(--surface-2); }
.ty-item .body { flex: 1; min-width: 0; }
.ty-prod { font-size: 13px; color: var(--secondary); }
.ty-prod a { color: var(--text); font-weight: 600; }
.ty-q { margin: 10px 0 12px; padding: 10px 14px; background: var(--bubble-user); border-radius: 18px; border-bottom-left-radius: 6px; white-space: pre-wrap; display: inline-block; max-width: 100%; }
.ty-a { padding: 10px 14px; background: var(--accent-soft); border-radius: 14px; white-space: pre-wrap; }
.ty-warn { color: #c93400; font-size: 13px; margin: 0 0 8px; }
@media (prefers-color-scheme: dark) { .ty-warn { color: var(--orange); } }
.ty-ops { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.ty-ops .count { margin-left: auto; font-size: 12px; color: var(--tertiary); font-variant-numeric: tabular-nums; }
.st { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--fill); }
.st.ok { color: var(--green); } .st.wait { color: var(--orange); } .st.bad { color: var(--red); }

/* ---------- Test (phone) ---------- */
.test-wrap { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 24px; align-items: start; }
.phone { background: var(--surface); border-radius: 36px; overflow: hidden; display: flex; flex-direction: column; height: 640px;
  box-shadow: var(--shadow-lg), 0 0 0 10px var(--surface-2); }
.phone-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; border-bottom: 1px solid var(--sep); }
.phone-head .avatar { width: 34px; height: 34px; font-size: 14px; }
.phone-head small { display: block; color: var(--secondary); font-size: 12px; }
.phone-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.phone-body .msg { max-width: 82%; }
.phone-body .msg.user { align-self: flex-end; align-items: flex-end; }
.phone-body .msg.user .bubble { background: var(--accent-grad); color: #fff; border-radius: 20px 20px 6px 20px; }
.phone-body .msg.bot { align-self: flex-start; align-items: flex-start; }
.phone-body .msg.bot .bubble { background: var(--bubble-user); color: var(--text); border-radius: 20px 20px 20px 6px; }
.hint { color: var(--secondary); font-size: 14px; text-align: center; margin: auto 16px; }
.phone-input { display: flex; gap: 8px; padding: 10px 12px 16px; align-items: center; }
.phone-input input { border-radius: 20px; padding: 9px 16px; background: var(--fill); border-color: transparent; }
.send-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; font-size: 17px; }
.typing { color: var(--secondary); font-size: 13px; margin: 4px 6px; }
.typing::after { content: "…"; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.test-side ol { padding-left: 20px; line-height: 1.7; }

/* ---------- Modal & toast ---------- */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .32); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: grid; place-items: center; z-index: 50; padding: 16px; animation: fadeIn .2s; }
.modal-card { background: var(--surface); border-radius: 20px; width: 100%; max-width: 600px; max-height: 90vh; overflow: auto; padding: 22px 24px; box-shadow: var(--shadow-lg); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-head h3 { font-size: 20px; font-weight: 700; }
.x { border: 0; background: var(--fill); width: 30px; height: 30px; border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer; color: var(--secondary); }
.modal pre { white-space: pre-wrap; background: var(--surface-2); padding: 14px; border-radius: 12px; font-size: 12px; max-height: 60vh; overflow: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); background: var(--glass); color: var(--text);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  padding: 12px 20px; border-radius: 99px; z-index: 60; font-weight: 500; box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px); }
.toast.err { color: var(--red); }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .modules, .tools, .grid2, .grid3, .test-wrap, .cards.three { grid-template-columns: 1fr; }
  .home-main { padding-top: 32px; }
  .module-card { min-height: 230px; padding: 22px; }
  .mc-stats { gap: 20px; padding-right: 0; }
  .mc-stats div b { font-size: 24px; }
  .mc-cta { position: static; margin-top: 16px; align-self: flex-end; }
  .shell { flex-direction: column; height: auto; min-height: 100vh; }
  .sidebar { width: 100%; position: sticky; top: 0; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 8px 12px; gap: 4px 8px; border-right: 0; border-bottom: 1px solid var(--sep); }
  .back-link { margin: 0; }
  .mod-head { padding: 0; order: 0; }
  .mod-head small, .mod-icon { display: none; }
  .sidebar nav { flex-direction: row; overflow-x: auto; order: 3; width: 100%; scrollbar-width: none; }
  .sidebar nav::-webkit-scrollbar { display: none; }
  .sidebar nav a { font-size: 14px; padding: 6px 10px; white-space: nowrap; }
  .sidebar-foot { border: 0; padding: 0; flex-direction: row; margin-left: auto; align-items: center; }
  .sidebar-foot .logout-btn { display: none; }
  .switch-row span:first-child { display: none; }
  .page { padding: 20px 16px 48px; }
  .page-head h1 { font-size: 28px; }
  .inbox { flex-direction: column; height: auto; }
  .inbox-list { width: 100%; max-height: 50vh; border-right: 0; }
  .inbox-chat { min-height: 70vh; }
  .msg { max-width: 86%; }
  .toolbar input[type="search"] { margin-left: 0; max-width: none; }
  .phone { height: 560px; }
}
