/* ==========================================================================
   DorukCRM — stylesheet
   Hand-authored rather than generated: there is no Node toolchain in this
   project, so a build-step CSS framework would be a dependency the runtime
   cannot satisfy.
   ========================================================================== */

:root {
  --bg:            #f0f2f5;
  --surface:       #ffffff;
  --surface-2:     #f7f8fa;
  --surface-3:     #eef0f3;
  --border:        #e3e6ea;
  --border-strong: #cdd3da;

  --text:          #111b21;
  --text-muted:    #667781;
  --text-faint:    #8696a0;

  --brand:         #128c7e;
  --brand-dark:    #075e54;
  --brand-light:   #dcf8c6;
  --accent:        #25d366;

  --danger:        #d92d20;
  --danger-bg:     #fef3f2;
  --warning:       #b54708;
  --warning-bg:    #fffaeb;
  --success:       #067647;
  --success-bg:    #ecfdf3;
  --info:          #175cd3;
  --info-bg:       #eff8ff;

  /* Tipografi de bir token: ayarlar > tema ekranı bunları kiracı başına
     değiştirebiliyor ve gövdeye sabit yazılmış bir yazı tipini değiştiremezdi. */
  --font-family:   -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                   "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-heading-weight: 600;

  /* Küçük ve büyük yarıçap tek bir ölçekten türüyor: yuvarlaklık bir tercih,
     üç ayrı tercih değil. 10px için değerler 6px ve 14px — yani elle yazılmış
     hâlleriyle birebir aynı. */
  --radius:        10px;
  --radius-sm:     calc(var(--radius) * .6);
  --radius-lg:     calc(var(--radius) * 1.4);
  --shadow-sm:     0 1px 2px rgba(16, 24, 40, .06);
  --shadow:        0 4px 12px rgba(16, 24, 40, .08);
  --shadow-lg:     0 12px 32px rgba(16, 24, 40, .12);

  --sidebar-w:     236px;
  --list-w:        360px;
  --header-h:      60px;
}

/* Koyu palet iki kez yazılıyor ve bu kaçınılmaz.
   İlk blok işletim sisteminin tercihini izler, ikincisi kiracının ayarlar >
   tema ekranından koyu modu *zorlamasını* karşılar. CSS bir bildirim
   bloğunu iki seçici arasında paylaştırmanın yolunu vermiyor; seçicilerden
   biri medya sorgusunun içinde olmak zorunda olduğu için tek kurala
   birleştirilemiyorlar. Birini değiştiriyorsanız diğerini de değiştirin —
   ve src/Support/Theme.php içindeki kopyasını da. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #0b141a;
    --surface:       #111b21;
    --surface-2:     #182229;
    --surface-3:     #202c33;
    --border:        #222d34;
    --border-strong: #2f3b43;

    --text:          #e9edef;
    --text-muted:    #8696a0;
    --text-faint:    #667781;

    --brand:         #00a884;
    --brand-dark:    #005c4b;
    --brand-light:   #005c4b;

    --danger-bg:     #2a1614;
    --warning-bg:    #2a2114;
    --success-bg:    #10241c;
    --info-bg:       #10202e;
  }
}

:root[data-theme="dark"] {
  --bg:            #0b141a;
  --surface:       #111b21;
  --surface-2:     #182229;
  --surface-3:     #202c33;
  --border:        #222d34;
  --border-strong: #2f3b43;

  --text:          #e9edef;
  --text-muted:    #8696a0;
  --text-faint:    #667781;

  --brand:         #00a884;
  --brand-dark:    #005c4b;
  --brand-light:   #005c4b;

  --danger-bg:     #2a1614;
  --warning-bg:    #2a2114;
  --success-bg:    #10241c;
  --info-bg:       #10202e;
}

/* Renk şeması tarayıcıya da bildiriliyor: kaydırma çubukları, form
   denetimleri ve otomatik doldurma zemini yoksa açık kalır. */
:root[data-theme="dark"]  { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

/* Arayüzün ölçek kaldıracı burası: stil dosyasındaki boyutların neredeyse
   tamamı `rem`, yani köke bağlı. Gövdeye yazılan bir boyut onları
   ölçekleyemezdi.

   Varsayılan `100%` ve `--font-size` bilerek `:root`'ta tanımsız: tanımlı
   olsaydı, yazıları büyütmüş bir kullanıcının tarayıcı tercihi sessizce
   ezilirdi. Tema ekranından bir değer seçilene kadar tercih kullanıcının
   kalır. */
html { font-size: var(--font-size, 100%); }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-family);
  font-size: .875rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   Icon sizing safety net.

   icon() emits inline SVG with a viewBox and deliberately no width/height, so
   size is a CSS decision. But an SVG with neither is not "as big as its box" —
   it falls back to the replaced-element default of 300x150 and wrecks whatever
   contains it. Every container therefore needs a rule, and forgetting one is
   invisible until someone opens the page.

   This is that rule for everything not covered below: an icon is sized to the
   text it sits with, and never grows past its box.
   -------------------------------------------------------------------------- */
svg {
  width: 1.15em;
  height: 1.15em;
  max-width: 100%;
  flex-shrink: 0;
  vertical-align: middle;
}

h1, h2, h3, h4 { margin: 0 0 .5rem; font-weight: var(--font-heading-weight); line-height: 1.3; }
h1 { font-size: 1.375rem; }
h2 { font-size: 1.125rem; }
h3 { font-size: 1rem; }
p  { margin: 0 0 .75rem; }

/* --- application shell ---------------------------------------------------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar__brand {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: 0 1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: .9375rem;
  letter-spacing: -.01em;
  flex-shrink: 0;
}

/* İşaretin arkasında kutu yok: doğrudan kenar çubuğunun zemini üzerinde durur.
   Bu yüzden burada ne arka plan ne de köşe yuvarlaması verilir. */
.sidebar__logo img { width: 30px; height: 30px; display: block; }
.sidebar__logo {
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.sidebar__nav { padding: .75rem .625rem; flex: 1; overflow-y: auto; }

.nav-item {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .5rem .625rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 2px;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.nav-item--active { background: var(--brand); color: #fff; }
.nav-item--active:hover { background: var(--brand); color: #fff; }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #04231a;
  font-size: .6875rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}
.nav-item--active .nav-badge { background: rgba(255,255,255,.25); color: #fff; }

.sidebar__footer {
  border-top: 1px solid var(--border);
  padding: .75rem;
  flex-shrink: 0;
}

.user-chip { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.user-chip__avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-muted);
  display: grid; place-items: center;
  font-weight: 700; font-size: .75rem;
  flex-shrink: 0;
}
.user-chip__meta { min-width: 0; flex: 1; }
.user-chip__name { font-weight: 600; font-size: .8125rem; }
.user-chip__org  { font-size: .75rem; color: var(--text-muted); }
.user-chip__name, .user-chip__org { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

.topbar {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.25rem;
  flex-shrink: 0;
}
.topbar h1 { margin: 0; font-size: 1.0625rem; }
.topbar__spacer { flex: 1; }

.content { flex: 1; overflow-y: auto; padding: 1.25rem; }
.content--flush { padding: 0; overflow: hidden; display: flex; flex-direction: column; }

/* --- cards & panels ------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card__header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: .75rem;
}
.card__header > svg { width: 18px; height: 18px; color: var(--text-muted); }
.card__title { font-weight: 600; font-size: .9375rem; margin: 0; }
.card__body { padding: 1.25rem; }
.card__footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius) var(--radius);
}

.grid { display: grid; gap: 1rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.stat { padding: 1rem 1.25rem; }
.stat__label { font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.stat__value { font-size: 1.75rem; font-weight: 700; line-height: 1.2; margin-top: .25rem; }
.stat__hint  { font-size: .75rem; color: var(--text-faint); margin-top: .125rem; }

/* --- buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .5rem .875rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: .8125rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s ease, opacity .12s ease;
}
.btn:hover  { text-decoration: none; filter: brightness(.97); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }

.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); }
.btn--danger  { background: var(--danger); color: #fff; }
.btn--ghost   { background: transparent; border-color: var(--border-strong); color: var(--text-muted); }
.btn--ghost:hover { background: var(--surface-3); color: var(--text); }
.btn--lg { padding: .75rem 1.25rem; font-size: .9375rem; }
.btn--block { width: 100%; }

/* --- forms ---------------------------------------------------------------- */
.field { margin-bottom: 1rem; }
.label {
  display: block;
  font-size: .8125rem;
  font-weight: 600;
  margin-bottom: .375rem;
  color: var(--text);
}
.input, .textarea, .select {
  width: 100%;
  padding: .5625rem .75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .875rem;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
.textarea { resize: vertical; min-height: 76px; }
.help { font-size: .75rem; color: var(--text-muted); margin-top: .375rem; }
.field-error { font-size: .75rem; color: var(--danger); margin-top: .375rem; }

/* --- badges & pills ------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3125rem;
  padding: .1875rem .5rem;
  border-radius: 999px;
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  background: var(--surface-3);
  color: var(--text-muted);
  white-space: nowrap;
}
.badge--success { background: var(--success-bg); color: var(--success); }
.badge--danger  { background: var(--danger-bg);  color: var(--danger); }
.badge--warning { background: var(--warning-bg); color: var(--warning); }
.badge--info    { background: var(--info-bg);    color: var(--info); }
.badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* --- alerts --------------------------------------------------------------- */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  margin-bottom: 1rem;
  font-size: .875rem;
  display: flex;
  gap: .625rem;
  align-items: flex-start;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert--error   { background: var(--danger-bg);  border-color: color-mix(in srgb, var(--danger) 25%, transparent);  color: var(--danger); }
.alert--success { background: var(--success-bg); border-color: color-mix(in srgb, var(--success) 25%, transparent); color: var(--success); }
.alert--warning { background: var(--warning-bg); border-color: color-mix(in srgb, var(--warning) 25%, transparent); color: var(--warning); }
.alert--info    { background: var(--info-bg);    border-color: color-mix(in srgb, var(--info) 25%, transparent);    color: var(--info); }

/* --- tables --------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th {
  text-align: left;
  font-size: .6875rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  font-weight: 700;
  padding: .625rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  white-space: nowrap;
}
.table td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }

/* --- definition rows (settings) ------------------------------------------ */
.dl { display: grid; grid-template-columns: minmax(160px, 200px) 1fr; }
.dl > dt {
  padding: .75rem 0;
  color: var(--text-muted);
  font-size: .8125rem;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.dl > dd {
  padding: .75rem 0;
  margin: 0;
  font-size: .875rem;
  border-bottom: 1px solid var(--border);
  word-break: break-word;
}
.dl > dt:last-of-type, .dl > dd:last-of-type { border-bottom: none; }

.mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; font-size: .8125rem; }

/* --- inbox layout --------------------------------------------------------- */
.inbox {
  display: grid;
  grid-template-columns: var(--list-w) 1fr;
  /* Üstünde bir uyarı şeridi olabildiği için sabit yükseklik değil, kalan
     alanı kaplayan esnek bir kutu. min-height:0 olmadan grid içeriği
     kutuyu şişirir ve taşma iç listeler yerine sayfaya biner. */
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
}

.thread-list { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-width: 0; }

.thread-list__head { padding: .75rem; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.thread-list__search { position: relative; }
.thread-list__search .input { padding-left: 2.125rem; background: var(--surface-2); }
.thread-list__search svg {
  position: absolute; left: .6875rem; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-faint); pointer-events: none;
}

.thread-tabs { display: flex; gap: .25rem; margin-top: .625rem; }
.thread-tab {
  flex: 1;
  padding: .375rem .5rem;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}
.thread-tab--active { background: var(--surface-3); color: var(--text); }

.thread-list__items { flex: 1; overflow-y: auto; }

.thread {
  display: flex;
  gap: .75rem;
  padding: .75rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  min-width: 0;
}
.thread:hover { background: var(--surface-2); }
.thread--active { background: var(--surface-3); }
.thread--active:hover { background: var(--surface-3); }

.avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-muted);
  display: grid; place-items: center;
  font-weight: 700; font-size: .875rem;
  flex-shrink: 0;
  text-transform: uppercase;
}
.avatar--sm { width: 34px; height: 34px; font-size: .75rem; }

.thread__body { min-width: 0; flex: 1; }
.thread__top { display: flex; align-items: baseline; gap: .5rem; }
.thread__name { font-weight: 600; font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.thread__time { font-size: .6875rem; color: var(--text-faint); flex-shrink: 0; }
.thread__phone { font-size: .75rem; color: var(--text-faint); }
.thread__bottom { display: flex; align-items: center; gap: .5rem; margin-top: .125rem; }
.thread__preview {
  font-size: .8125rem; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
}
.thread__unread {
  background: var(--accent); color: #04231a;
  font-size: .6875rem; font-weight: 700;
  min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px;
  display: grid; place-items: center;
  flex-shrink: 0;
}

/* --- conversation panel --------------------------------------------------- */
.chat { display: flex; flex-direction: column; min-width: 0; background: var(--bg); }

.chat__head {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: .75rem;
  padding: 0 1rem;
  flex-shrink: 0;
}
.chat__title { font-weight: 600; font-size: .9375rem; }
.chat__sub   { font-size: .75rem; color: var(--text-muted); }
.chat__actions { margin-left: auto; display: flex; gap: .5rem; align-items: center; }

.chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.25rem .5rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.day-sep { text-align: center; margin: 1rem 0 .75rem; }
.day-sep span {
  background: var(--surface-3); color: var(--text-muted);
  font-size: .6875rem; font-weight: 600;
  padding: .25rem .75rem; border-radius: 999px;
}

.bubble {
  max-width: min(70%, 560px);
  padding: .5rem .625rem .375rem;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  align-self: flex-start;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  position: relative;
}
.bubble--out { align-self: flex-end; background: var(--brand-light); }
.bubble__text { white-space: pre-wrap; font-size: .875rem; }
.bubble__meta {
  display: flex; align-items: center; justify-content: flex-end;
  gap: .3125rem; margin-top: .125rem;
  font-size: .625rem; color: var(--text-faint);
}
.bubble__media { border-radius: var(--radius-sm); overflow: hidden; margin-bottom: .375rem; }
.bubble__media img, .bubble__media video { display: block; max-width: 100%; height: auto; }
.bubble__file {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem; background: rgba(0,0,0,.04);
  border-radius: var(--radius-sm); margin-bottom: .375rem;
}
.bubble__echo {
  font-size: .625rem; font-weight: 700; text-transform: uppercase;
  color: var(--text-faint); letter-spacing: .04em; margin-bottom: .125rem;
}
.bubble--failed { border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); }
.bubble__error { font-size: .6875rem; color: var(--danger); margin-top: .25rem; }

.tick { display: inline-flex; }
.tick svg { width: 15px; height: 15px; }
.tick--read { color: #53bdeb; }

.chat__composer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: .75rem 1rem;
  flex-shrink: 0;
}
.composer-row { display: flex; gap: .625rem; align-items: flex-end; }
.composer-row .textarea {
  min-height: 42px; max-height: 160px;
  border-radius: 20px; padding: .625rem 1rem;
  background: var(--surface-2);
}

.composer-locked {
  background: var(--warning-bg);
  border: 1px solid color-mix(in srgb, var(--warning) 25%, transparent);
  color: var(--warning);
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .8125rem;
}

/* --- empty states --------------------------------------------------------- */
.empty {
  display: grid;
  place-items: center;
  height: 100%;
  text-align: center;
  padding: 2rem;
}
.empty__inner { max-width: 380px; }
.empty__icon {
  width: 64px; height: 64px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-faint);
  display: grid; place-items: center;
}
.empty__icon svg { width: 30px; height: 30px; }
.empty h3 { margin-bottom: .375rem; }
.empty p { color: var(--text-muted); font-size: .875rem; }

/* --- auth screen ---------------------------------------------------------- */
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  /* Kart artık tek çocuk değil: altında hukuki bağlantı satırı var. İki satır
     varken align-content'in varsayılanı satırları yüksekliğe yayıyor ve bağlantı
     satırı kartın çok altında kalıyor; center ikisini tek blok olarak ortalıyor. */
  align-content: center;
  padding: 1.5rem;
  background: var(--bg);
}
.auth__card {
  width: 100%; max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
}
/* Giriş ekranında tam logo kullanılıyor: hem işaret hem kelime. Başlık
   metni buradan kaldırıldı, çünkü logo adı zaten taşıyor. */
.auth__logo {
  display: grid; place-items: center;
  margin: 0 auto 1.25rem;
}
.auth__logo img { width: 190px; max-width: 70%; height: auto; display: block; }
.auth__title { text-align: center; margin-bottom: .25rem; }
.auth__sub { text-align: center; color: var(--text-muted); font-size: .875rem; margin-bottom: 1.5rem; }
/* Giriş kartının altındaki hukuki bağlantı satırı. .auth bir grid olduğu için
   kartın ikinci satırı olarak yerleşiyor, ayrıca konumlandırma gerekmiyor. */
.auth__legal {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: .8125rem;
  color: var(--text-faint);
}
.auth__legal a { color: inherit; text-decoration: underline; }
.auth__legal a:hover { color: var(--text-muted); }

/* --- connect screen ------------------------------------------------------- */
.connect { max-width: 720px; margin: 0 auto; }
.connect__hero { text-align: center; padding: 2rem 1.5rem; }
.connect__icon {
  width: 72px; height: 72px;
  border-radius: 20px;
  background: var(--brand);
  color: #fff;
  display: grid; place-items: center;
  margin: 0 auto 1.25rem;
}
.connect__icon svg { width: 38px; height: 38px; }

/* --------------------------------------------------------------------------
   Connect screen
   -------------------------------------------------------------------------- */

.connect__lede {
  max-width: 46ch;
  margin: 0 auto 1.5rem;
  color: var(--text-muted);
  font-size: .9375rem;
}

.connect__meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
  margin-top: 1rem;
  font-size: .75rem;
  color: var(--text-faint);
}
.connect__meta span { display: inline-flex; align-items: center; gap: .375rem; }
.connect__meta svg { width: 14px; height: 14px; }

/* Method choice. The two ways of connecting are not a setting with a sensible
   default: one leaves the number on the customer's phone, the other takes it
   off. A dropdown would let someone pick without reading; two cards make the
   consequence part of the click. */
.choice { display: grid; gap: .75rem; }
.choice__card {
  display: grid;
  grid-template-columns: 44px 1fr 20px;
  gap: 1rem;
  align-items: start;
  padding: 1.125rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: border-color .12s ease, background .12s ease;
}
.choice__card:hover,
.choice__card:focus-visible {
  border-color: var(--brand);
  background: var(--surface-2);
}
.choice__icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--brand);
  display: grid; place-items: center;
}
.choice__card:hover .choice__icon { background: var(--surface); }
.choice__icon svg { width: 22px; height: 22px; }
.choice__title { font-weight: 700; margin-bottom: .25rem; }
.choice__lede {
  margin: 0;
  font-size: .875rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.choice__for {
  margin-top: .5rem;
  font-size: .75rem;
  color: var(--text-faint);
}
.choice__go { color: var(--text-faint); align-self: center; }
.choice__go svg { width: 20px; height: 20px; }

/* Prerequisites. Presented before the button, because the flow needs a phone
   in hand and finding that out halfway through means starting over. */
.prereq { list-style: none; margin: 0; padding: 0; display: grid; gap: .625rem; }
.prereq li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: .75rem;
  align-items: start;
  font-size: .875rem;
}
.prereq li > svg {
  width: 18px; height: 18px;
  color: var(--brand);
  margin-top: .125rem;
}
.prereq strong { display: block; font-weight: 600; }
.prereq span small { color: var(--text-muted); font-size: .8125rem; }

/* The flow crosses two devices, and that is the part people get lost in:
   half of it happens in this browser, half on the phone. Splitting the
   columns says so before they start. */
.flow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
.flow__col { background: var(--surface); padding: 1rem 1.125rem 1.25rem; }
.flow__where {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: .875rem;
}
.flow__where svg { width: 15px; height: 15px; }
.flow ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.flow li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: .625rem;
  align-items: start;
  font-size: .875rem;
  line-height: 1.45;
}
.flow li b {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-muted);
  display: grid; place-items: center;
  font-size: .6875rem; font-weight: 700;
}
.flow li small { display: block; color: var(--text-muted); font-size: .8125rem; }

/* What survives the connection and what does not. This is consent material,
   not fine print: after coexistence the customer loses group chats, broadcast
   lists and more on their own phone. Hiding it behind a disclosure triangle
   would be the wrong call. */
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.compare__col { background: var(--surface); padding: 1rem 1.125rem 1.25rem; }
.compare__head {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .8125rem;
  font-weight: 700;
  margin-bottom: .75rem;
}
.compare__head svg { width: 16px; height: 16px; }
.compare__col--keep .compare__head { color: var(--success); }
.compare__col--lose .compare__head { color: var(--warning); }
.compare ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4375rem; }
/* İşaret ile metin ayrı sütunlarda: uzun bir madde ikinci satıra taştığında
   devamı çizginin altına değil, metnin hizasına gelsin. */
.compare li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .4375rem;
  font-size: .8125rem;
  line-height: 1.45;
  color: var(--text-muted);
}
.compare li::before { content: "—"; color: var(--text-faint); }
.compare__col--keep li { color: var(--text); }

.limits {
  margin-top: .875rem;
  padding-top: .875rem;
  border-top: 1px solid var(--border);
  font-size: .8125rem;
  color: var(--text-muted);
}

/* Setup state. The operator cannot fix server configuration from this screen,
   so the technical keys are secondary to knowing what is missing and who acts. */
.setup-missing {
  display: flex;
  flex-wrap: wrap;
  gap: .375rem;
  margin-top: .625rem;
}
.setup-missing code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .6875rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: .1875rem .4375rem;
}

@media (max-width: 720px) {
  .flow, .compare { grid-template-columns: 1fr; }
  /* Dar ekranda ok işareti bir sütun yeri kaplamaya değmez; kartın tamamı
     zaten dokunulabilir bir hedef. */
  .choice__card { grid-template-columns: 44px 1fr; }
  .choice__go { display: none; }
}

.steps { list-style: none; padding: 0; margin: 1.5rem 0 0; counter-reset: step; }
.steps li {
  display: flex; gap: .875rem;
  padding: .75rem 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: .875rem;
}
.steps li:last-child { border-bottom: none; }
.steps li::before {
  counter-increment: step;
  content: counter(step);
  width: 24px; height: 24px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-muted);
  display: grid; place-items: center;
  font-weight: 700; font-size: .75rem;
}

/* --- flash toasts --------------------------------------------------------- */
.toasts {
  position: fixed;
  top: 1rem; right: 1rem;
  z-index: 60;
  display: flex; flex-direction: column; gap: .5rem;
  max-width: 380px;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-muted);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: .75rem 1rem;
  font-size: .875rem;
  animation: toast-in .18s ease-out;
}
.toast--error   { border-left-color: var(--danger); }
.toast--success { border-left-color: var(--success); }
.toast--warning { border-left-color: var(--warning); }
@keyframes toast-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }

/* --- misc ----------------------------------------------------------------- */
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.small { font-size: .8125rem; }
.tiny  { font-size: .75rem; }
.strong { font-weight: 600; }
.row { display: flex; align-items: center; gap: .625rem; }
.row--between { justify-content: space-between; }
.stack > * + * { margin-top: 1rem; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.hidden { display: none !important; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.conn-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.conn-dot--live { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.conn-dot--down { background: var(--text-faint); }

@media (max-width: 1024px) {
  .app { grid-template-columns: 64px 1fr; }
  .sidebar__brand span, .nav-item span, .user-chip__meta { display: none; }
  .sidebar__brand, .nav-item { justify-content: center; }
  .inbox { grid-template-columns: 300px 1fr; }
}
@media (max-width: 720px) {
  .inbox { grid-template-columns: 1fr; }
  .inbox--thread-open .thread-list { display: none; }
  .inbox:not(.inbox--thread-open) .chat { display: none; }
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

/* --- ayarlar kabuğu ------------------------------------------------------- */
/* Solda kalıcı bir bölüm rayı, sağda bölümün kendisi. Ray kenar çubuğunun
   değil sayfanın parçası: kenar çubuğu modüller arasında, bu ray modülün
   bölümleri arasında gezinir. Dar ekranda aynı DOM yatay bir şeride döner. */

/* Ayarların bölüm rayı sağda, bölümün kendisi solda. Ana menü (kenar çubuğu)
   solda kalır: o modüller arasında geziniyor ve uygulamanın her yerinde aynı
   yerde durmalı. Buradaki ray ise yalnızca ayarların içindeki bölümler için;
   ikisini aynı kenara koymak, iki ayrı seviyedeki gezinmeyi tek bir sütun
   gibi gösteriyordu.

   Sıra CSS ile veriliyor, DOM'la değil: ray belgede içerikten önce geliyor ve
   klavyeyle ya da ekran okuyucuyla gezen biri için bölüm bağlantılarının
   içerikten önce gelmesi doğru sıra. */
.settings {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 232px;
  gap: 1.75rem;
  max-width: 1180px;
  margin: 0 auto;
  align-items: start;
}

.settings__rail {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: 0;
  display: grid;
  gap: .125rem;
}

.settings__body { grid-column: 1; grid-row: 1; }

.settings__group-label {
  padding: 1rem .625rem .375rem;
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.settings__link {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .5rem .625rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
}

.settings__link svg { width: 17px; height: 17px; flex-shrink: 0; }
.settings__link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.settings__link:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

.settings__link--active {
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand);
  font-weight: 600;
}

.settings__body { min-width: 0; }

.settings__head {
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.settings__head h2 { margin: 0 0 .25rem; font-size: 1.125rem; }

.settings__lede {
  margin: 0;
  max-width: 72ch;
  color: var(--text-muted);
  font-size: .875rem;
  line-height: 1.55;
}

/* Üst çubuktaki kırıntı yolu. Bölüm başlığı iki kez görünüyor ve bu bilerek:
   üstteki nerede olduğunu, içerideki ne olduğunu söylüyor. */
.topbar__crumb { color: var(--text-muted); font-weight: 500; text-decoration: none; }
.topbar__crumb:hover { color: var(--text); }
.topbar__crumb-sep { display: inline-flex; color: var(--text-faint); vertical-align: -3px; }
.topbar__crumb-sep svg { width: 15px; height: 15px; }

@media (max-width: 900px) {
  .settings { grid-template-columns: 1fr; gap: 1rem; }

  /* Geniş ekranda ray sağdaki sütunda duruyor. Tek sütuna düşerken bu
     yerleştirme sıfırlanmalı: aksi hâlde "2. sütun" örtük olarak yeniden
     yaratılır ve ekranın yarısı boş kalırdı. Dar ekranda ray üstte, yatay
     bir şerit olarak duruyor — DOM sırası zaten öyle. */
  .settings__rail {
    grid-column: 1;
    grid-row: 1;
    position: static;
    display: flex;
    gap: .25rem;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
  }

  .settings__body { grid-column: 1; grid-row: 2; }

  /* Grup başlıkları dar ekranda kayboluyor: yatay bir şeritte ayıracak yer
     yok, ve sıra zaten gruplamayı koruyor. */
  .settings__group-label { display: none; }

  .settings__link {
    white-space: nowrap;
    border-radius: 0;
    padding: .625rem .75rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
  }

  .settings__link--active { background: transparent; border-bottom-color: var(--brand); }
}

/* --- ayarlar giriş ekranı ------------------------------------------------- */
/* Giriş ekranı bir menü değil — menü zaten solda duruyor. Burada her bölümün
   o anki durumu var: kaç numara bağlı, kaç anahtar etkin, hangi tema açık.
   Bir ayar ekranının cevaplayabileceği en faydalı soru bu. */

.settings-hub {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
  gap: .875rem;
}

.settings-tile {
  display: flex;
  flex-direction: column;
  gap: .625rem;
  padding: 1.125rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
}

.settings-tile:hover { border-color: var(--brand); text-decoration: none; }
.settings-tile:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.settings-tile__top { display: flex; align-items: center; gap: .625rem; }

.settings-tile__icon {
  width: 34px; height: 34px;
  flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--brand);
}

.settings-tile__icon svg { width: 17px; height: 17px; }
.settings-tile__title { font-weight: 600; font-size: .9375rem; }
.settings-tile__value { font-size: 1.375rem; font-weight: 700; line-height: 1.15; }
.settings-tile__sub { font-size: .8125rem; color: var(--text-muted); line-height: 1.5; }
.settings-tile__go { margin-left: auto; color: var(--text-faint); display: inline-flex; }
.settings-tile__go svg { width: 17px; height: 17px; }

/* --- ayar satırları ------------------------------------------------------- */
/* Kart içinde tıklanabilir satır listesi. Kanal listesi ve anahtar listesi
   bunu kullanıyor. */

.settings-row {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: 1rem 1.125rem;
  border-bottom: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
}

.settings-row:last-child { border-bottom: none; }
a.settings-row:hover { background: var(--surface-2); }
a.settings-row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

.settings-row__icon {
  width: 38px; height: 38px;
  border-radius: var(--radius);
  background: var(--surface-3);
  color: var(--brand);
  display: grid; place-items: center;
  flex-shrink: 0;
}

.settings-row__icon svg { width: 19px; height: 19px; }

.settings-row__body { display: flex; flex-direction: column; gap: .125rem; min-width: 0; flex: 1; }
.settings-row__title { font-weight: 600; font-size: .9375rem; }
.settings-row__sub { color: var(--text-muted); font-size: .8125rem; line-height: 1.45; }

/* --- kod ve kopyalanabilir değerler --------------------------------------- */
/* API ekranı bir belge gibi okunuyor: adresler, başlıklar ve gövde örnekleri.
   Hepsi kopyalanmak için var, o yüzden kopyalama düğmesi değerin yanında
   duruyor — ayrı bir yerde değil. */

.code-inline {
  display: inline-block;
  max-width: 100%;
  padding: .1875rem .4375rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .8125rem;
  overflow-x: auto;
  white-space: nowrap;
  vertical-align: middle;
}

.code-inline--wide { display: block; width: 100%; }

.code-verb { color: var(--brand); font-weight: 700; }

.copy-field { display: flex; align-items: center; gap: .375rem; min-width: 0; }
.copy-field .code-inline { flex: 1; min-width: 0; }

.btn--icon { padding: .375rem; }
.btn--sm { padding: .3125rem .5625rem; font-size: .75rem; }

/* --- ikon düğme + ipucu ---------------------------------------------------
   Satır işlemleri (düzenle, devre dışı bırak, sil) metin yerine ikon taşıyor:
   üç metin düğmesi tablo satırını taşırıyordu. İkonun ne yaptığı yalnızca
   biçimden anlaşılmamalı, o yüzden her düğme üzerine gelindiğinde ve klavyeyle
   odaklandığında adını yazıyor. aria-label ayrıca duruyor — ipucu görsel,
   erişilebilir ad ondan bağımsız olmalı. */
.btn--icon {
  padding: .3125rem;
  width: 1.875rem;
  justify-content: center;
}
.btn--icon svg { width: 15px; height: 15px; }

.tip { position: relative; }

.tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--surface);
  padding: .25rem .5rem;
  border-radius: 4px;
  font-size: .6875rem;
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity .12s ease;
  pointer-events: none;
  z-index: 40;
}

.tip:hover::after,
.tip:focus-visible::after { opacity: 1; visibility: visible; }

/* Dokunmatik cihazda "hover" kalıcı olabiliyor; orada ipucu hiç çıkmasın. */
@media (hover: none) {
  .tip::after { display: none; }
}
.btn--sm svg { width: 14px; height: 14px; }

.code-block {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.code-block pre {
  margin: 0;
  padding: .875rem 3rem .875rem 1rem;
  overflow-x: auto;
}

.code-block code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .8125rem;
  line-height: 1.6;
  white-space: pre;
}

/* Kopyalama düğmesi bloğun içinde duruyor ama metnin üstüne binmiyor: pre'nin
   sağ iç boşluğu düğme kadar. */
.code-block__copy { position: absolute; top: .5rem; right: .5rem; }

/* İptal edilmiş anahtarın satırı sönük: listede duruyor çünkü geçmişi
   taşıyor, ama okunacak satır o değil. */
.row--muted td { opacity: .55; }

/* --- tema özellikleri ekranı ---------------------------------------------- */
/* Bu ekran kendi ayarladığı tokenların içinde yaşıyor: bir renk seçtiğinizde
   seçicinin kendisi de o renge göre yeniden çiziliyor. Bu yüzden aşağıda
   sabit renk yok, hepsi token. */

.theme-modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .75rem;
}

.theme-mode {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "icon label" "icon help";
  column-gap: .75rem;
  row-gap: .125rem;
  align-items: center;
  padding: .875rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}

.theme-mode:hover { border-color: var(--border-strong); }

.theme-mode--active {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 7%, var(--surface));
}

/* Radyo düğmesi görsel olarak kaldırılıyor ama erişilebilirlik ağacında ve
   klavye sırasında kalıyor: display:none olsaydı ok tuşlarıyla mod
   değiştirilemezdi. */
.theme-mode input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

.theme-mode:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }

.theme-mode__icon {
  grid-area: icon;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--text-muted);
}

.theme-mode__icon svg { width: 17px; height: 17px; }
.theme-mode--active .theme-mode__icon { background: var(--brand); color: #fff; }

.theme-mode__label { grid-area: label; font-weight: 600; font-size: .875rem; }
.theme-mode__help  { grid-area: help;  font-size: .75rem; color: var(--text-muted); line-height: 1.4; }

/* --- açık/koyu palet sekmeleri -------------------------------------------- */

.theme-scheme-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  padding: .1875rem;
  margin-bottom: .875rem;
  background: var(--surface-3);
  border-radius: var(--radius-sm);
}

.theme-scheme-tab {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .375rem .75rem;
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: .8125rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.theme-scheme-tab svg { width: 14px; height: 14px; }

.theme-scheme-tab--active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* Adlandırılmış temanın sekmesinde simge yerine kendi marka rengi duruyor:
   adı okumadan hangisinin hangisi olduğu görülebilsin. */
.theme-scheme-tab__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15);
}

.theme-scheme-tab--add { color: var(--brand); }
.theme-scheme-tab--add:hover { background: color-mix(in srgb, var(--brand) 10%, transparent); }

/* Yalnızca adlandırılmış bir tema düzenlenirken görünür: adını değiştirme ve
   silme, çekirdek açık/koyu paletlerde yapılamayacak iki iş. */
.theme-preset-bar {
  display: flex;
  align-items: flex-end;
  gap: .75rem;
  flex-wrap: wrap;
  padding: .875rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--brand) 6%, var(--surface));
}

/* --- renk grupları -------------------------------------------------------- */

.theme-group { margin-top: 1.5rem; }
.theme-group:first-of-type { margin-top: .5rem; }

.theme-group__head {
  display: flex;
  align-items: flex-start;
  gap: .625rem;
  padding-bottom: .75rem;
  margin-bottom: .875rem;
  border-bottom: 1px solid var(--border);
}

.theme-group__head > svg { width: 17px; height: 17px; color: var(--text-muted); margin-top: 2px; }
.theme-group__title { margin: 0; font-size: .875rem; }
.theme-group__help  { margin: .125rem 0 0; font-size: .75rem; color: var(--text-muted); line-height: 1.45; }

.theme-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .625rem;
}

.theme-swatch {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .5rem .625rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

/* Değiştirilmiş bir token işaretli duruyor: "varsayılana dön" düğmesi
   hangilerinin geri alınacak bir şeyi olduğunu göstermeden anlamsız. */
.theme-swatch--changed { border-color: var(--brand); }

/* Tarayıcının renk seçicisi kendi çerçevesini ve iç boşluğunu çiziyor;
   ikisi de kaldırılmazsa kutu içinde küçük bir kare gibi duruyor. */
.theme-swatch__picker {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.theme-swatch__picker::-webkit-color-swatch-wrapper { padding: 2px; }
.theme-swatch__picker::-webkit-color-swatch { border: none; border-radius: calc(var(--radius-sm) - 2px); }
.theme-swatch__picker::-moz-color-swatch    { border: none; border-radius: calc(var(--radius-sm) - 2px); }

.theme-swatch__body { min-width: 0; flex: 1; }

.theme-swatch__label {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: .25rem;
}

.theme-swatch__hex {
  padding: .25rem .5rem;
  height: auto;
  font-size: .8125rem;
  text-transform: lowercase;
}

.input--invalid { border-color: var(--danger); }

.theme-swatch__reset {
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
}

.theme-swatch__reset svg { width: 15px; height: 15px; }
.theme-swatch__reset:hover { background: var(--surface-3); color: var(--text); }

/* --- ölçü kaydırıcıları --------------------------------------------------- */

.theme-range {
  width: 100%;
  margin: .375rem 0 0;
  accent-color: var(--brand);
}

.theme-range__value {
  float: right;
  font-weight: 400;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* --- önizleme ------------------------------------------------------------- */

.theme-preview {
  padding: 1.125rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.theme-preview__chat {
  display: flex;
  flex-direction: column;
  gap: .375rem;
  margin-top: .875rem;
  padding: .875rem;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.theme-preview__chat .bubble { max-width: 78%; margin: 0; }
