.app { display: grid; grid-template-columns: 276px minmax(0, 1fr); height: 100dvh; }

/* Kenar çubuğu */
.sidebar {
  position: relative;
  z-index: var(--z-side);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  padding: 14px 12px;
  border-right: 1px solid var(--line);
  background: var(--side);
}
.side-head { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.brand svg { flex: none; width: 32px; height: 32px; color: var(--ink); }
.brand-text { display: grid; line-height: 1.15; }
.brand-name { font-family: var(--font-display); font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.brand-sub { color: var(--ink-2); font-size: 12px; font-weight: 500; }
.new-chat {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
  text-align: left;
  transition: background-color 0.18s, transform 0.18s var(--ease);
}
.new-chat:hover { background: color-mix(in srgb, var(--accent) 22%, var(--side)); }
.new-chat:active { transform: scale(0.98); }
.search { position: relative; display: block; }
.search svg { position: absolute; top: 50%; left: 12px; color: var(--ink-2); transform: translateY(-50%); pointer-events: none; }
.search input {
  width: 100%;
  min-height: 40px;
  padding: 0 12px 0 38px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--hover);
  font-size: 14.5px;
}
.search input:focus { border-color: var(--accent); outline: 0; }
.history { flex: 1; min-height: 0; overflow: auto; margin: 0 -4px; padding: 0 4px; }
.history-group { margin: 16px 8px 6px; color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.history-empty { margin: 12px 8px; color: var(--ink-2); font-size: 14px; }
.hist-item { display: flex; align-items: center; border-radius: var(--r-sm); transition: background-color 0.15s; }
.hist-item:hover, .hist-item.active { background: var(--hover); }
.hist-item.active { box-shadow: inset 3px 0 0 var(--accent); }
.hist-open {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  background: none;
  font-size: 14.5px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hist-del { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: none; color: var(--ink-2); opacity: 0; transition: opacity 0.15s, color 0.15s; }
.hist-item:hover .hist-del, .hist-del:focus-visible { opacity: 1; }
.hist-del:hover { color: var(--danger); }
.side-foot { position: relative; padding-top: 8px; border-top: 1px solid var(--line); }
.side-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--r-sm); background: none; color: var(--ink-2); }
.side-btn:hover { background: var(--hover); color: var(--ink); }

/* Ayarlar paneli */
.popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: var(--z-menu);
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-2);
  animation: pop-in 0.2s var(--ease);
}
@keyframes pop-in { from { opacity: 0; transform: translateY(6px) scale(0.98); } }
.pop-row { display: grid; gap: 6px; font-size: 14px; }
.pop-label { font-weight: 600; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 3px; border-radius: 999px; background: var(--hover); }
.seg button { min-height: 34px; border: 0; border-radius: 999px; background: none; color: var(--ink-2); font-size: 13.5px; }
.seg button[aria-checked='true'] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-1); }
.seg-2 { grid-template-columns: repeat(2, 1fr); }
.seg button[data-accent-option]::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 7px; border-radius: 50%; background: var(--dot); }
.seg button[data-accent-option='violet'] { --dot: #6a4df4; }
.seg button[data-accent-option='rooster'] { --dot: #db2f37; }
.pop-row select { min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); }
.switch-row { grid-template-columns: 1fr auto; align-items: center; }
.switch-row input {
  position: relative;
  width: 42px;
  height: 24px;
  margin: 0;
  border-radius: 999px;
  background: var(--line);
  appearance: none;
  cursor: pointer;
  transition: background-color 0.2s;
}
.switch-row input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.2s var(--ease); }
.switch-row input:checked { background: var(--accent); }
.switch-row input:checked::after { transform: translateX(18px); }

/* Ana alan */
.main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 6px 12px; }
.scrim { display: none; }
.drop {
  position: fixed;
  inset: 12px;
  z-index: var(--z-menu);
  display: grid;
  place-items: center;
  border: 2px dashed var(--accent);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(6px);
  color: var(--accent-ink);
  font-size: 20px;
  font-weight: 600;
  pointer-events: none;
}

@media (max-width: 720px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(310px, 86vw); transform: translateX(-100%); transition: transform 0.28s var(--ease); }
  body.side-open .sidebar { transform: none; box-shadow: var(--shadow-2); }
  body.side-open .scrim { position: fixed; inset: 0; z-index: 10; display: block; background: rgba(10, 8, 24, 0.5); }
  .mobile-only { display: inline-grid; }
}

/* Görev raporları (ekip kanalı): sohbet listesinin üstünde, kendi içinde kayar */
.reports { flex: none; max-height: 30vh; overflow: auto; margin: 0 -4px 4px; padding: 0 4px 6px; border-bottom: 1px solid var(--line); }
.reports[hidden] { display: none; }
.reports .history-group { margin-top: 12px; }
.report-open {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 44px;
  padding: 6px 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  text-align: left;
  transition: background-color 0.15s;
}
.report-open:hover, .report-open[aria-current='page'] { background: var(--hover); }
.report-open[aria-current='page'] { box-shadow: inset 3px 0 0 var(--accent); }
.report-title { overflow: hidden; color: var(--ink); font-size: 14.5px; text-overflow: ellipsis; white-space: nowrap; }
.report-date { color: var(--ink-2); font-size: 12.5px; }
