:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --border: #e2e5ea;
  --text: #1b1f24;
  --muted: #667085;
  --accent: #2563eb;
  --accent-text: #ffffff;
  --accent-soft: #e8efff;
  --danger: #c4302b;
  --danger-soft: #fdecea;
  --ok: #18794e;
  --ok-soft: #e6f6ee;
  --warn: #9a6700;
  --warn-soft: #fff4d6;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418;
    --surface: #1a1e24;
    --surface-2: #222730;
    --border: #2e343e;
    --text: #e6e9ee;
    --muted: #98a2b3;
    --accent: #5b8cff;
    --accent-text: #0b1220;
    --accent-soft: #1d2a47;
    --danger: #ff6b63;
    --danger-soft: #3a1d1c;
    --ok: #4ccf8f;
    --ok-soft: #173326;
    --warn: #f2c14e;
    --warn-soft: #3a2f12;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; margin: 0 0 .25rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
p.lead { color: var(--muted); margin: 0 0 1.5rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- üst çubuk */
.topbar {
  display: flex; align-items: center; gap: 1.5rem;
  padding: .6rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .45rem; font-weight: 650; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand svg { width: 22px; height: 22px; fill: var(--accent); }
.topbar nav { display: flex; gap: .25rem; flex: 1; flex-wrap: wrap; }
.topbar nav a, .user-menu a {
  padding: .35rem .7rem; border-radius: 8px; color: var(--muted); font-weight: 500;
}
.topbar nav a:hover, .user-menu a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.topbar nav a.active, .user-menu a.active { background: var(--accent-soft); color: var(--accent); }
.user-menu { display: flex; align-items: center; gap: .5rem; }

.container { max-width: 980px; margin: 0 auto; padding: 1.75rem 1rem 4rem; }
.narrow { max-width: 420px; margin: 8vh auto; padding: 0 1rem; }

/* ---------- kartlar ve formlar */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1.25rem;
}
.grid { display: grid; gap: .9rem 1rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
label { display: block; font-size: .85rem; font-weight: 550; margin-bottom: .3rem; }
input[type=text], input[type=password], input[type=url], input[type=search], input[type=email],
input[type=number], input:not([type]), select, textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit;
}
textarea { resize: vertical; min-height: 300px; line-height: 1.6; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.field { margin-bottom: .9rem; }
.check { display: flex; align-items: center; gap: .45rem; font-weight: 500; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 550; cursor: pointer;
}
button:hover, .btn:hover { background: var(--surface-2); text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.primary:hover, .btn.primary:hover { filter: brightness(1.08); }
button.danger { color: var(--danger); }
button.danger:hover { background: var(--danger-soft); }
button.link { border: none; background: none; color: var(--muted); padding: .35rem .5rem; }
button.link:hover { color: var(--text); background: none; }
button:disabled { opacity: .55; cursor: not-allowed; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ---------- sekmeler */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; }
.tabs button {
  border: none; border-bottom: 2px solid transparent; border-radius: 0; background: none;
  color: var(--muted); padding: .6rem .9rem;
}
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- dosya bırakma alanı */
.drop {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 2rem 1rem;
  text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop strong { display: block; font-size: 1.05rem; margin-bottom: .25rem; }
.drop .file-name { margin-top: .6rem; font-weight: 600; color: var(--accent); }

/* ---------- ilerleme */
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); transition: width .4s; }

/* ---------- rozetler */
.badge {
  display: inline-block; padding: .1rem .55rem; border-radius: 99px; font-size: .78rem; font-weight: 600;
  background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.badge.done { background: var(--ok-soft); color: var(--ok); }
.badge.error, .badge.cancelled { background: var(--danger-soft); color: var(--danger); }
.badge.live { background: var(--danger-soft); color: var(--danger); }
.badge.queued, .badge.downloading, .badge.converting, .badge.transcribing { background: var(--warn-soft); color: var(--warn); }

/* ---------- liste */
.list { list-style: none; margin: 0; padding: 0; }
.list li { border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: none; }
.list a.item { display: block; padding: .85rem .25rem; color: var(--text); }
.list a.item:hover { background: var(--surface-2); text-decoration: none; }
.item-head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.item-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-preview { color: var(--muted); font-size: .88rem; margin-top: .2rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }

/* ---------- transkript */
.segments { line-height: 1.7; }
.seg { display: grid; grid-template-columns: 4.5rem 1fr; gap: .75rem; padding: .3rem 0; }
.seg time { color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; padding-top: .15rem; }
.plain-text { white-space: pre-wrap; line-height: 1.7; }
.meta { display: flex; gap: .4rem 1.1rem; flex-wrap: wrap; color: var(--muted); font-size: .88rem; margin: .4rem 0 1.25rem; }
.title-row { display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.alert { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.info { background: var(--accent-soft); color: var(--accent); }
mark { background: var(--warn-soft); color: inherit; padding: 0 .1em; border-radius: 3px; }
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: .3rem; min-width: 210px; z-index: 20; display: none;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a { display: block; padding: .45rem .7rem; border-radius: 6px; color: var(--text); }
.dropdown-menu a:hover { background: var(--surface-2); text-decoration: none; }

/* ---------- canlı */
.live-controls { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.rec-btn { min-width: 170px; padding: .75rem 1.25rem; font-size: 1rem; }
.rec-btn.recording { background: var(--danger); border-color: var(--danger); color: #fff; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.rec-btn.recording .rec-dot { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.meter { flex: 1; min-width: 140px; height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; position: relative; }
.meter > div { height: 100%; width: 0; background: var(--ok); transition: width .08s; }
.meter > div.speaking { background: var(--accent); }
.live-status { font-size: .88rem; color: var(--muted); min-width: 10rem; }
.live-output { min-height: 320px; max-height: 60vh; overflow-y: auto; }
.live-output .seg.new { animation: fadein .4s; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } }
.pending-line { color: var(--muted); font-style: italic; padding: .3rem 0 .3rem 5.25rem; }

/* ---------- tablo */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--border); font-size: .92rem; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.table-wrap { overflow-x: auto; }

.provider { border: 1px solid var(--border); border-radius: 8px; padding: 1rem; margin-bottom: .9rem; }
.provider-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; gap: .5rem; flex-wrap: wrap; }

#toast {
  position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%) translateY(150%);
  background: var(--text); color: var(--bg); padding: .65rem 1.1rem; border-radius: 8px;
  transition: transform .25s, opacity .25s, visibility .25s; z-index: 50; max-width: calc(100% - 2rem);
  opacity: 0; visibility: hidden; pointer-events: none;
}
#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }
#toast.error { background: var(--danger); color: #fff; }

@media (max-width: 640px) {
  .topbar { gap: .5rem; padding: .5rem .75rem; }
  .container { padding: 1.25rem 1rem 3rem; }
  .seg { grid-template-columns: 3.5rem 1fr; gap: .5rem; }
  .pending-line { padding-left: 4rem; }
}

/* ---------- yapay zekâ */
.ai-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.ai-head h2 { margin: 0; }
.ai-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.ai-out { border: 1px solid var(--border); border-radius: 8px; margin-top: 1rem; background: var(--surface); }
.ai-out > summary {
  list-style: none; cursor: pointer; padding: .7rem 1rem; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap;
}
.ai-out > summary::-webkit-details-marker { display: none; }
.ai-out > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
.ai-out[open] > summary::before { transform: rotate(90deg); }
.ai-out .ai-kind { font-weight: 650; }
.ai-out .ai-meta { color: var(--muted); font-size: .84rem; }
.ai-body { padding: 0 1rem 1rem; }
.ai-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .9rem; }
.ai-actions .btn, .ai-actions button { padding: .4rem .75rem; font-size: .88rem; }
.markdown { line-height: 1.65; }
.markdown h2 { font-size: 1.1rem; margin: 1.2rem 0 .4rem; }
.markdown h3, .markdown h4 { font-size: 1rem; margin: 1rem 0 .3rem; }
.markdown h2:first-child, .markdown p:first-child { margin-top: 0; }
.markdown ul, .markdown ol { padding-left: 1.4rem; margin: .4rem 0 .8rem; }
.markdown li { margin: .2rem 0; }
.markdown p { margin: .5rem 0; }
.markdown blockquote { margin: .6rem 0; padding: .4rem .9rem; border-left: 3px solid var(--accent); color: var(--muted); }
.markdown table { margin: .5rem 0 1rem; }

.slides { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.slide {
  container-type: inline-size; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; position: relative;
  background: #f8fafc; color: #1e293b; border: 1px solid var(--border); box-shadow: var(--shadow);
  font-family: "Segoe UI", system-ui, sans-serif;
}
.slide .in { position: absolute; inset: 6.5cqw 6.5cqw 6cqw 7cqw; display: flex; flex-direction: column; }
.slide .st { font-size: 4.4cqw; font-weight: 700; line-height: 1.2; border-left: .8cqw solid #2563eb; padding-left: 1.8cqw; margin: 0 0 3cqw -2.6cqw; }
.slide ul { margin: 0; padding-left: 3.4cqw; font-size: 2.7cqw; line-height: 1.35; }
.slide li { margin-bottom: 1.1cqw; }
.slide li::marker { color: #2563eb; }
.slide .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 4cqw; }
.slide .ch { font-weight: 700; color: #2563eb; font-size: 3cqw; border-top: .5cqw solid #2563eb; padding-top: 1cqw; margin-bottom: 1.5cqw; }
.slide .cols > div + div .ch { color: #1e293b; border-color: #64748b; }
.slide .num { position: absolute; right: 4cqw; bottom: 2.5cqw; font-size: 1.8cqw; color: #64748b; }
.slide.cover { background: #0f172a; color: #fff; border-left: 2cqw solid #2563eb; }
.slide.cover .in { justify-content: center; }
.slide.cover h3 { font-size: 6cqw; margin: 0 0 2.5cqw; line-height: 1.15; }
.slide.cover p { font-size: 3cqw; color: #cbd5e1; margin: 0; border-top: .6cqw solid #2563eb; padding-top: 2cqw; width: fit-content; }
.slide.section { background: #2563eb; color: #fff; }
.slide.section .in { justify-content: center; }
.slide.section h3 { font-size: 6cqw; margin: 0 0 1.5cqw; }
.slide.section p { font-size: 3cqw; color: #dbeafe; margin: 0; }
.slide .quote { font-size: 3.6cqw; font-style: italic; line-height: 1.4; margin: auto 0; padding-left: 4cqw; position: relative; }
.slide .quote::before { content: "“"; position: absolute; left: -1cqw; top: -4cqw; font-size: 12cqw; color: #2563eb; font-style: normal; font-weight: 700; }
.slide .attr { font-size: 2.4cqw; color: #64748b; padding-left: 4cqw; }
.slide-notes { font-size: .82rem; color: var(--muted); margin-top: .35rem; }

/* ---------- yönetim: model seçimi */
.mp { margin-top: .9rem; }
.mp-head { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.mp-head label { margin: 0; }
.mp-tools { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: .4rem 0; }
.mp-tools button { padding: .35rem .7rem; font-size: .88rem; }
.mp-tools .mp-filter { width: auto; flex: 1; min-width: 160px; max-width: 280px; padding: .35rem .6rem; }
.mp-list { border: 1px solid var(--border); border-radius: 8px; max-height: 260px; overflow-y: auto; padding: .25rem .5rem; background: var(--surface); }
.mp-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; padding: .3rem .1rem; margin: 0; font-weight: 400; cursor: pointer; border-bottom: 1px solid var(--border); }
.mp-row:last-child { border-bottom: none; }
.mp-row code { font-size: .86rem; }
.mp-row.missing code { text-decoration: line-through; color: var(--danger); }
.mp-others summary { cursor: pointer; color: var(--muted); font-size: .85rem; padding: .35rem .1rem; }
.mp-add { display: flex; gap: .5rem; margin-top: .45rem; }
.mp-add input { max-width: 320px; padding: .35rem .6rem; }
.mp-add button { padding: .35rem .7rem; font-size: .88rem; }

/* ---------- giriş ve hesap */
.sso { display: grid; gap: .6rem; margin-bottom: 1rem; }
.sso-btn { width: 100%; padding: .7rem 1rem; gap: .6rem; font-weight: 600; }
.sso-btn svg { width: 20px; height: 20px; flex: none; }
.login-alt { border-top: 1px solid var(--border); padding-top: .8rem; margin-top: .8rem; }
.login-alt > summary { cursor: pointer; color: var(--muted); font-weight: 550; margin-bottom: .8rem; }
.login-alt[open] > summary { color: var(--text); }
.nav-badge { display: inline-block; min-width: 1.3em; padding: 0 .4em; border-radius: 99px; background: var(--danger); color: #fff; font-size: .75rem; font-weight: 700; text-align: center; line-height: 1.5; }
.kv { width: 100%; margin: .5rem 0 1rem; }
.kv th { width: 9rem; text-transform: none; letter-spacing: 0; font-size: .88rem; }
.account-grid { display: grid; gap: 0 1.25rem; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }
.ident { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .55rem 0; }
.ident .btn { padding: .3rem .7rem; font-size: .88rem; }
.qr svg { width: 180px; height: 180px; background: #fff; border-radius: 8px; padding: 6px; }
.codes { font-size: 1rem; line-height: 1.7; background: var(--surface); color: var(--text); padding: .6rem .9rem; border-radius: 6px; margin: .6rem 0 0; columns: 2; }
.pending-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.pending-row:last-child { border-bottom: none; }
.settings-block { border: 1px solid var(--border); border-radius: 8px; padding: 1rem; margin-bottom: .9rem; }
.settings-block h3 { margin: 0 0 .3rem; font-size: 1rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.copy-field { display: flex; gap: .4rem; }
.copy-field input { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
@media (max-width: 640px) { .account-grid { grid-template-columns: 1fr; } }
