/* Ortak çekirdek: ön yüz ve yönetim paneli birlikte kullanır. Yalnızca token kullanır; tema seçicisi yoktur. */

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + var(--space-4)); }
  body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: var(--fs-base);
    line-height: var(--lh-base);
    -webkit-font-smoothing: antialiased;
  }
  img, svg { display: block; max-width: 100%; }
}

@layer base {
  a { color: var(--primary-text); text-underline-offset: 2px; }
  a:hover { color: var(--primary-hover); }
  /* Başlıklar: Bricolage Grotesque 700/800; h1 sayfa başlığı (40/28), h2 bölüm (26/22). Admin boyutları .admin-body'de ezer. */
  h1, h2, h3, h4 { font-family: var(--font-display); line-height: var(--lh-tight); margin: 0 0 var(--space-3); letter-spacing: -.015em; font-weight: 700; }
  h1 { font-size: var(--fs-h1); font-weight: 800; letter-spacing: -.02em; }
  h2 { font-size: var(--fs-h2); }
  h3 { font-size: var(--fs-lg); }
  h4 { font-size: var(--fs-h4); }
  p { margin: 0 0 var(--space-4); }
  code, pre { font-family: var(--font-mono); font-size: .9em; }
  hr { border: 0; border-top: 1px solid var(--border); margin: var(--space-5) 0; }
  kbd { font: 600 var(--fs-xs) var(--font-mono); padding: 1px var(--space-1-5); border-radius: var(--radius-xs); border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); }
  :focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
  ::selection { background: var(--accent); color: var(--on-accent); }
  main[tabindex="-1"]:focus { outline: none; }
  html.dialog-open { overflow: hidden; }
}

@layer components {
  /* Yerleşim ilkelleri */
  .icon { display: inline-block; flex-shrink: 0; vertical-align: middle; }
  .container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 max(var(--space-4), env(safe-area-inset-right)) 0 max(var(--space-4), env(safe-area-inset-left)); }
  .stack { display: flex; flex-direction: column; gap: var(--space-4); }
  .stack-sm { display: flex; flex-direction: column; gap: var(--space-2); }
  .row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
  .row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
  .grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: var(--space-4); }
  .plain-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
  .plain-list li.row { flex-wrap: nowrap; gap: var(--space-2-5); align-items: center; }
  .skip-link { position: absolute; left: var(--space-4); top: -60px; z-index: 100; background: var(--navy); color: var(--on-navy); padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm); }
  .skip-link:focus { top: var(--space-3); }

  /* Düğmeler */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
    min-height: var(--btn-h); padding: 0 var(--btn-px);
    border: var(--control-border-w) solid var(--input-border); border-radius: var(--btn-radius);
    font: 700 var(--btn-fs)/1 var(--font-body); text-decoration: none; cursor: pointer;
    background: var(--surface); color: var(--text);
    transition: background-color .15s, border-color .15s, color .15s;
  }
  .btn:hover { border-color: var(--text); color: var(--text); }
  .btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
  .btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }
  .btn-accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
  .btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
  .btn-navy { background: var(--navy); border-color: var(--navy); color: var(--on-navy); }
  .btn-navy:hover { color: var(--on-navy); opacity: .92; }
  .btn-ghost { background: transparent; border-color: transparent; color: var(--text); }
  .btn-ghost:hover { background: var(--surface-2); border-color: var(--border); }
  .btn-danger { background: var(--danger-soft); border-color: var(--danger-soft); color: var(--danger); }
  .btn-danger:hover { border-color: var(--danger); color: var(--danger); }
  .btn-sm { min-height: var(--btn-h-sm); padding: 0 var(--btn-px-sm); font-size: var(--btn-fs-sm); }
  .btn-block { width: 100%; }
  .btn-icon { width: var(--btn-h); padding: 0; }
  .btn[disabled], .btn:disabled, .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; cursor: not-allowed; }
  .link-button { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
  .alert .link-button { color: inherit; }

  /* Form alanları */
  .field { display: flex; flex-direction: column; gap: var(--field-gap); }
  .field > label, .label { font-weight: 600; font-size: var(--label-fs); }
  .label-text { display: block; font-weight: 600; margin-bottom: var(--field-gap); }
  .input, .select, .textarea {
    width: 100%; min-height: var(--control-h); padding: var(--control-py) var(--control-px);
    border: var(--control-border-w) solid var(--input-border); border-radius: var(--control-radius);
    background: var(--surface); color: var(--text);
    font: 400 var(--control-fs)/1.4 var(--font-body);
  }
  .textarea { min-height: 110px; resize: vertical; }
  .textarea.code { font-family: var(--font-mono); font-size: var(--fs-sm); min-height: 160px; }
  .select-sm { min-height: var(--control-h-sm); padding: var(--space-1-5) var(--space-3); width: auto; font-size: var(--fs-ui); }
  .input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
  .input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
  .input-group { position: relative; display: flex; }
  .input-group .input { padding-right: calc(var(--btn-h) + var(--space-2)); }
  .input-group .input-addon { position: absolute; right: 2px; top: 2px; bottom: 2px; width: var(--btn-h); display: flex; align-items: center; justify-content: center; background: none; border: 0; color: var(--text-muted); cursor: pointer; border-radius: var(--control-radius); }
  .help { font-size: var(--help-fs); color: var(--text-muted); margin: 0; }
  .field-error { font-size: var(--help-fs); color: var(--danger); font-weight: 600; margin: 0; }
  .check { display: flex; align-items: flex-start; gap: var(--space-3); font-size: var(--fs-ui); cursor: pointer; }
  .check input { width: var(--check-size); height: var(--check-size); margin: 2px 0 0; accent-color: var(--primary); flex-shrink: 0; }
  .otp-input { font-family: var(--font-mono); font-size: var(--fs-3xl); letter-spacing: .35em; text-align: center; }
  .form-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); align-items: start; }
  .form-grid .span-all { grid-column: 1 / -1; }
  .picker-list { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: var(--space-1) 0 0; padding: var(--space-1); list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); max-height: 300px; overflow-y: auto; }
  .picker-list li { padding: var(--space-2-5) var(--space-3); border-radius: var(--radius-sm); cursor: pointer; display: flex; justify-content: space-between; gap: var(--space-2); }
  .picker-list li[aria-selected="true"], .picker-list li:hover { background: var(--surface-2); }
  .picker-list li .small { color: var(--text-muted); text-align: right; }

  /* Kart, uyarı, rozet */
  .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--panel-p); }
  .card-tight { padding: var(--space-4); border-radius: var(--radius); }
  .card h2:first-child, .card h3:first-child { margin-top: 0; }

  .alert { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border-radius: var(--radius); font-weight: 500; margin: 0; }
  .alert .icon { margin-top: 2px; }
  .alert-success { background: var(--success-soft); color: var(--success); }
  .alert-error, .alert-danger { background: var(--danger-soft); color: var(--danger); }
  .alert-warning { background: var(--warning-soft); color: var(--warning-text); }
  .alert-info { background: var(--info-soft); color: var(--info); }
  .alert p { margin: 0; color: inherit; }
  .flash-stack { display: flex; flex-direction: column; gap: var(--space-2); margin: var(--space-4) 0; }

  .notice { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3-5) var(--space-4); border-radius: var(--radius); margin: 0 0 var(--space-4); font-weight: 500; }
  .notice p { margin: 0; }
  .notice .icon { margin-top: 2px; }
  .notice a { color: inherit; }
  .notice-warning { background: var(--warning-soft); color: var(--warning-text); }
  .notice-info { background: var(--info-soft); color: var(--info); }
  .notice-success { background: var(--success-soft); color: var(--success); }

  .badge { display: inline-flex; align-items: center; gap: var(--space-1-5); padding: var(--badge-py) var(--badge-px); border-radius: var(--radius-pill); font-size: var(--badge-fs); font-weight: 700; line-height: var(--lh-snug); white-space: nowrap; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
  .badge-primary { background: var(--primary-soft); color: var(--primary-text); border-color: transparent; }
  .badge-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
  .badge-warning { background: var(--warning-soft); color: var(--warning-text); border-color: transparent; }
  .badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
  .badge-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
  .badge-official { background: var(--navy); color: var(--on-navy); border-color: transparent; }
  .badge-official .icon { color: var(--accent); }
  .badge-expert { background: var(--success-soft); color: var(--success); border-color: transparent; }
  .user-badge { display: inline-flex; align-items: center; gap: var(--space-1-5); padding: var(--badge-py) var(--badge-px); border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--text); font-size: var(--badge-fs); font-weight: 700; }
  .user-badge .icon { color: var(--warning-text); }

  /* İçerik türleri: renk + etiket + simge. .type-* / .post-type-* bir --type rengi tanımlar, bileşenler onu kullanır. */
  .type-review, .post-type-review { --type: var(--type-review); --type-soft: var(--type-review-soft); }
  .type-complaint, .post-type-complaint { --type: var(--type-complaint); --type-soft: var(--type-complaint-soft); }
  .type-question, .post-type-question { --type: var(--type-question); --type-soft: var(--type-question-soft); }
  .type-guide, .post-type-guide { --type: var(--type-guide); --type-soft: var(--type-guide-soft); }
  .type-expert_article, .post-type-expert_article { --type: var(--type-article); --type-soft: var(--type-article-soft); }
  .post-type { display: inline-flex; align-items: center; gap: var(--space-1-5); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--type, var(--text-muted)); }
  .badge.type-review, .badge.type-complaint, .badge.type-question, .badge.type-guide, .badge.type-expert_article { background: var(--type-soft); color: var(--type); border-color: transparent; }

  /* Tablo */
  .table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
  .table { width: 100%; border-collapse: collapse; font-size: var(--table-fs); }
  .table th, .table td { padding: var(--table-py) var(--table-px); text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
  .table th { font-size: var(--table-head-fs); font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); white-space: nowrap; }
  .table tbody tr:hover > td { background: var(--row-hover); }
  .table tr:last-child td { border-bottom: 0; }
  .table .actions { text-align: right; white-space: nowrap; }
  .kv { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: var(--space-2) var(--space-4); margin: 0; }
  .kv dt { color: var(--text-muted); font-size: var(--fs-sm); }
  .kv dd { margin: 0; font-weight: 600; word-break: break-word; }

  .pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-2); margin-top: var(--space-5); }
  .pagination .current { font-weight: 700; padding: 0 var(--space-3); }

  /* Marka ve logo */
  .brand { display: inline-flex; align-items: center; gap: var(--space-2-5); color: var(--text); text-decoration: none; font-family: var(--font-display); font-weight: 800; letter-spacing: -.015em; flex-shrink: 1; min-width: 0; }
  .brand:hover { color: var(--text); }
  .brand .logo-mark { height: 44px; width: auto; flex-shrink: 0; }
  .brand img { height: 44px; width: auto; }
  .brand-text { display: flex; flex-direction: column; justify-content: center; height: 44px; min-width: 0; font-size: var(--fs-2xl); line-height: .98; }
  .brand-text > span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand-text.single { font-size: var(--fs-2xl); }
  .logo-mark .logo-back { fill: var(--accent); }
  .logo-mark .logo-front { fill: var(--primary); }
  .logo-mark .logo-dot { fill: var(--on-primary); }
  @media (max-width: 419.98px) {
    .brand .logo-mark, .brand img { height: 36px; }
    .brand-text { height: 36px; font-size: var(--fs-md); }
  }
  .logo-img-dark { display: var(--show-dark); }
  .logo-img-light.has-dark { display: var(--show-light); }

  /* Tema düğmesi */
  .theme-toggle .icon-sun { display: var(--show-dark); }
  .theme-toggle .icon-moon { display: var(--show-light); }

  /* Avatar ve kullanıcı menüsü */
  .avatar { width: 40px; height: 40px; border-radius: var(--radius-pill); background: var(--avatar-bg); color: var(--on-avatar); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: var(--fs-sm); flex-shrink: 0; }
  .avatar-img { object-fit: cover; padding: 0; background: var(--surface-2); }
  .avatar-sm { width: 24px; height: 24px; font-size: var(--fs-xs); }
  .avatar-lg { width: 64px; height: 64px; font-size: var(--fs-xl); }
  .avatar-xl { width: 96px; height: 96px; font-size: var(--fs-4xl); }
  .user-chip { display: inline-flex; align-items: center; gap: var(--space-2); text-decoration: none; color: var(--text); font-weight: 600; font-size: var(--fs-ui); }
  .user-menu { position: relative; }
  .avatar-button { display: inline-flex; padding: 2px; border: 0; background: none; border-radius: var(--radius-pill); cursor: pointer; }
  .avatar-button .avatar-img { width: 40px; height: 40px; }
  .avatar-button:hover .avatar, .avatar-button[aria-expanded="true"] .avatar { box-shadow: 0 0 0 3px var(--primary-soft); }
  .dropdown { position: absolute; right: 0; top: calc(100% + var(--space-2)); z-index: 60; min-width: 250px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--space-2); }
  .dropdown-head { display: flex; flex-direction: column; padding: var(--space-2) var(--space-3) var(--space-3); margin-bottom: var(--space-2); border-bottom: 1px solid var(--border); }
  .dropdown-head span { color: var(--text-muted); font-size: var(--fs-sm); }
  .dropdown-list { list-style: none; margin: 0; padding: 0; }
  .dropdown-list a, .dropdown-item { display: flex; align-items: center; gap: var(--space-3); width: 100%; padding: var(--space-2-5) var(--space-3); border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); font: 600 var(--fs-ui)/var(--lh-snug) var(--font-body); text-align: left; text-decoration: none; cursor: pointer; }
  .dropdown-list a:hover, .dropdown-item:hover { background: var(--surface-2); color: var(--text); }
  .dropdown-list .icon, .dropdown-item .icon { color: var(--text-muted); }
  .dropdown-foot { margin-top: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--border); }
  .author-link { color: inherit; text-decoration: none; font-weight: 600; }
  .author-link:hover { color: var(--primary-text); text-decoration: underline; }

  /* Bölüm başlığı ve içerik kutuları (admin önizlemelerinde de kullanılır) */
  .section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
  .section-head h2 { display: flex; align-items: center; gap: var(--space-2-5); margin: 0; font-size: var(--fs-h2); }
  .section-head h2 .icon { color: var(--type, var(--primary)); }
  .section-head > a { display: inline-flex; gap: var(--space-1); align-items: center; font-weight: 700; text-decoration: none; }
  .content-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--panel-p); margin-bottom: var(--space-5); }
  .content-section .section-head h2 { font-size: var(--fs-2xl); }
  .subsection { margin-top: var(--space-5); }
  .subsection h3 { font-size: var(--fs-md); }
  .info-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); }
  .info-box h2 { font-family: var(--font-body); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: var(--fs-xs); margin: 0 0 var(--space-1); }

  /* Uzun metin */
  .prose p { margin: 0 0 1em; max-width: 72ch; }
  .prose p:last-child { margin-bottom: 0; }
  .legal-body { max-width: 760px; }
  .legal-body h2, .legal-body h3 { margin-top: var(--space-5); }
  .guide-body { font-size: var(--fs-md); }
  .guide-body h2 { font-size: var(--fs-3xl); margin: 1.6em 0 .5em; }
  .guide-body h3 { font-size: var(--fs-xl); margin: 1.4em 0 .4em; }
  .guide-body h4 { font-size: var(--fs-md); margin: 1.2em 0 .4em; }
  .guide-body ul, .guide-body ol { margin: 0 0 1em; padding-left: 1.4em; max-width: 72ch; }
  .guide-body li { margin: .3em 0; }
  .guide-body blockquote { margin: 0 0 1em; padding: var(--space-3) var(--space-4); border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--radius) var(--radius) 0; }

  /* Kurulum / sistem denetim listesi */
  .install-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
  .install-checks li { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); background: var(--surface-2); font-size: var(--fs-ui); }
  .install-checks .ok { color: var(--success); }
  .install-checks .fail { color: var(--danger); }
  .install-checks .warn { color: var(--warning-text); }
  .install-checks span.detail { margin-left: auto; color: var(--text-muted); text-align: right; }

  /* Bildirim balonu ve çerez bandı (base düzeninde her sayfada) */
  .toast { position: fixed; left: 50%; bottom: calc(var(--space-5) + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 60; max-width: min(92vw, 480px); padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--navy); color: var(--on-navy); box-shadow: var(--shadow); font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
  .toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
  .consent { position: fixed; left: var(--space-4); right: var(--space-4); bottom: calc(var(--space-4) + env(safe-area-inset-bottom)); z-index: 25; max-width: 560px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
  .consent p { margin: 0; font-size: var(--fs-ui); }

  @media (prefers-reduced-motion: reduce) {
    .toast { transition: none; }
  }
}

@layer utilities {
  [hidden] { display: none !important; }
  .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
  .muted { color: var(--text-muted); }
  .small { font-size: var(--fs-sm); }
  .mt-0 { margin-top: 0; }
  .mb-0 { margin-bottom: 0; }
  .text-center { text-align: center; }
  .hide-xs { display: inline-flex; }
  .hide-sm { display: none; }
  @media (max-width: 419.98px) { .hide-xs { display: none; } }
  @media (min-width: 720px) { .hide-sm { display: inline-flex; } }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
  }
}

/* === Bileşen: Metin editörü ve biçimli metin (Faz 6, Ajan C) — editor.js; ön yüz ve yönetim ortak === */
@layer components {
  .rte { --rte-pad-x: 16px; --rte-pad-y: 14px; position: relative; display: flex; flex-direction: column; background: var(--surface); border: var(--control-border-w) solid var(--input-border); border-radius: var(--control-radius); }
  .rte.is-focused { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
  .rte.is-invalid { border-color: var(--danger); }
  .rte-toolbar { position: sticky; top: var(--rte-sticky, 0px); z-index: 3; display: flex; align-items: center; gap: 2px; padding: 4px; background: var(--surface-2); border-bottom: 1px solid var(--border); border-radius: calc(var(--control-radius) - 2px) calc(var(--control-radius) - 2px) 0 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
  .rte-toolbar::-webkit-scrollbar { display: none; }
  .rte-group { display: flex; gap: 2px; flex: none; }
  .rte-group:last-child { margin-left: auto; }
  .rte-sep { flex: none; width: 1px; height: 22px; margin: 0 4px; background: var(--border-strong); }
  .rte-sep:nth-last-child(2) { display: none; }
  .rte-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none; min-width: 36px; height: 36px; padding: 0 8px; border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--text-muted); font: inherit; cursor: pointer; }
  .rte-btn:hover:not(:disabled) { background: var(--bg-2); color: var(--text); }
  .rte-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
  .rte-btn[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary-text); }
  .rte-btn:disabled { opacity: .4; cursor: default; }
  .rte-btn svg { flex: none; }
  .rte-btn-text { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-sm); letter-spacing: -.01em; line-height: 1; }
  .rte-btn-source .rte-btn-text { font-family: var(--font-body); font-weight: 600; font-size: var(--fs-xs); letter-spacing: 0; }
  .rte-btn-source svg { width: 18px; height: 18px; }

  .rte-linkbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
  .rte-linkbar[hidden] { display: none; }
  .rte-linkbar-label { font-weight: 600; font-size: var(--fs-sm); }
  .rte-linkbar-input { flex: 1 1 220px; width: auto; min-height: var(--control-h-sm); }
  .rte-linkbar-error { flex-basis: 100%; margin: 0; color: var(--danger); font-size: var(--fs-xs); font-weight: 600; }
  .rte-linkbar-error:empty { display: none; }

  .rte-surface { position: relative; min-height: calc(var(--rte-rows, 8) * 1.6em + 2 * var(--rte-pad-y)); padding: var(--rte-pad-y) var(--rte-pad-x); color: var(--text); font: 400 var(--control-fs)/1.6 var(--font-body); overflow-wrap: anywhere; outline: none; caret-color: var(--primary); }
  .rte-surface[hidden] { display: none; }
  .rte-surface.is-empty::before { content: attr(data-placeholder); position: absolute; top: var(--rte-pad-y); left: var(--rte-pad-x); right: var(--rte-pad-x); color: var(--text-faint); pointer-events: none; }
  .rte-surface > * { margin: 0 0 .75em; }
  .rte-surface > :last-child { margin-bottom: 0; }
  .rte-surface :is(ul, ol) { padding-left: 1.4em; }
  .rte-surface li + li { margin-top: .2em; }
  .rte-surface blockquote { padding: .5em .9em; border-left: 3px solid var(--border-strong); background: var(--surface-2); color: var(--text-muted); border-radius: 0 var(--radius-xs) var(--radius-xs) 0; }
  .rte-surface blockquote p { margin: 0; }
  .rte-surface h2 { font-size: var(--fs-xl); margin: 1em 0 .4em; }
  .rte-surface h3 { font-size: var(--fs-lg); margin: .9em 0 .35em; }
  .rte-surface > :is(h2, h3):first-child { margin-top: 0; }
  .rte-surface hr { border: 0; border-top: 2px solid var(--border); margin: 1.2em 0; }
  .rte-surface a { color: var(--primary-text); text-decoration: underline; }
  .rte-surface strong, .rte-surface b { font-weight: 700; }

  /* Kaynak textarea: normalde görünmez (form ve taslak bunu okur); Markdown kipinde yüzeyin yerini alır. */
  .rte-source { position: absolute; bottom: 0; left: 0; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; opacity: 0; overflow: hidden; clip-path: inset(50%); pointer-events: none; resize: none; }
  .rte.is-source > .textarea { min-height: calc(var(--rte-rows, 8) * 1.6em + 2 * var(--rte-pad-y)); padding: var(--rte-pad-y) var(--rte-pad-x); border: 0; border-radius: 0; box-shadow: none; background: var(--surface); font-family: var(--font-mono); font-size: var(--fs-sm); line-height: 1.6; }
  .rte.is-source > .textarea:focus { box-shadow: none; }

  .rte-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 12px 8px var(--rte-pad-x); border-top: 1px solid var(--border); color: var(--text-faint); font-size: var(--fs-xs); }
  .rte-hint { min-width: 0; }
  .rte-count { margin: 0 0 0 auto; flex: none; color: var(--text-muted); font-variant-numeric: tabular-nums; }
  .rte-count.is-short { color: var(--warning-text); font-weight: 600; }
  .rte-count.is-over { color: var(--danger); font-weight: 600; }

  @media (max-width: 760px) {
    .rte { --rte-pad-x: 14px; --rte-pad-y: 12px; }
    .rte-btn { min-width: 44px; height: 44px; }
    .rte-sep { height: 26px; margin: 0 2px; }
  }
  @media (max-width: 440px) {
    .rte-hint { display: none; }
  }

  /* Biçimli metin gösterimi (Markdown çıktısı): içerik sayfası, moderasyon, kurum yanıt sayfaları */
  .rich-text > :is(ul, ol, blockquote) { margin: 14px 0 0; }
  .rich-text > :first-child { margin-top: 0; }
  .rich-text > :is(ul, ol, blockquote) + p { margin-top: 14px; }
  .rich-text :is(ul, ol) { padding-left: 1.4em; }
  .rich-text li + li { margin-top: .3em; }
  .rich-text blockquote { padding: .6em 1em; border-left: 3px solid var(--border-strong); background: var(--surface-2); color: var(--text-muted); border-radius: 0 var(--radius-xs) var(--radius-xs) 0; }
  .rich-text blockquote p { margin: 0; }
  .rich-text strong { font-weight: 700; }
}
