:root {
  color-scheme: light dark;
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-muted: #eef3fa;
  --text: #14213d;
  --muted: #66728a;
  --line: #dbe3ef;
  --brand: #2357e8;
  --brand-strong: #173ca4;
  --accent: #7855d6;
  --safe: #11845b;
  --warn: #a85f00;
  --danger: #b33243;
  --shadow: 0 18px 45px rgb(24 42 78 / 10%);
  --radius: 18px;
}

/* TR: Ortak giriş tercihleri gerçek 44px kontrollerdir; yalnız bu yeni header formuna uygulanır. */
[data-preferences-form] { flex-wrap: wrap; max-inline-size: 100%; }
[data-preferences-form] select { min-block-size: 44px; min-inline-size: 72px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); font: inherit; }
.sr-only { position: absolute; inline-size: 1px; block-size: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1422;
    --surface: #151f31;
    --surface-muted: #1b2940;
    --text: #f2f6ff;
    --muted: #aab7ce;
    --line: #2d3d58;
    --brand: #7897ff;
    --brand-strong: #a8bcff;
    --accent: #b39bff;
    --safe: #59c99c;
    --warn: #f0b35b;
    --danger: #ff8997;
    --shadow: 0 18px 45px rgb(0 0 0 / 25%);
  }
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-muted: #eef3fa;
  --text: #14213d;
  --muted: #66728a;
  --line: #dbe3ef;
  --brand: #2357e8;
  --brand-strong: #173ca4;
  --accent: #7855d6;
  --safe: #11845b;
  --warn: #a85f00;
  --danger: #b33243;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1422;
  --surface: #151f31;
  --surface-muted: #1b2940;
  --text: #f2f6ff;
  --muted: #aab7ce;
  --line: #2d3d58;
  --brand: #7897ff;
  --brand-strong: #a8bcff;
  --accent: #b39bff;
  --safe: #59c99c;
  --warn: #f0b35b;
  --danger: #ff8997;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.skip-link {
  position: fixed;
  z-index: 20;
  left: 1rem;
  top: -5rem;
  padding: .75rem 1rem;
  background: var(--surface);
  border: 2px solid var(--brand);
  border-radius: 10px;
}

.skip-link:focus { top: 1rem; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 1.5rem 1.25rem;
  background: #111a2b;
  color: #f7f9ff;
}

.brand { display: flex; gap: .8rem; align-items: center; text-decoration: none; }
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, #4b75f2, #7659d4);
  font-weight: 900;
}
.brand strong, .brand small { display: block; }
.brand small { margin-top: .18rem; color: #aebbd4; font-size: .69rem; letter-spacing: .14em; }
.sidebar nav { display: grid; gap: .35rem; }
.nav-item {
  display: flex;
  gap: .75rem;
  align-items: center;
  padding: .75rem;
  border-radius: 11px;
  color: #bdc8dc;
  text-decoration: none;
}
.nav-item span { display: grid; width: 24px; height: 24px; place-items: center; }
.nav-item:hover, .nav-item.active { background: #25334d; color: #ffffff; }
.secure-note { margin: auto 0 0; color: #9daac1; font-size: .78rem; line-height: 1.55; }
.secure-note span { color: #53d79c; }

.workspace { min-width: 0; display: flex; min-height: 100vh; flex-direction: column; }
.topbar {
  min-height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 93%, transparent);
}
.surface-pill { color: var(--safe); font-weight: 750; font-size: .85rem; }
.topbar-actions { display: flex; align-items: center; gap: .75rem; }
.locale-link { color: var(--brand-strong); font-weight: 750; }
.theme-switcher { display: flex; padding: .2rem; border: 1px solid var(--line); border-radius: 11px; }
.theme-option { padding: .42rem .6rem; border-radius: 8px; text-decoration: none; color: var(--muted); font-size: .8rem; }
.theme-option.selected { background: var(--surface-muted); color: var(--text); font-weight: 750; }

.content { width: min(1180px, 100%); margin: 0 auto; padding: clamp(2rem, 5vw, 4.5rem); }
.hero { max-width: 760px; margin-bottom: 2rem; }
.eyebrow { margin: 0 0 .65rem; color: var(--brand); font-weight: 850; text-transform: uppercase; letter-spacing: .12em; font-size: .76rem; }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 4rem); line-height: 1.02; letter-spacing: -.045em; }
.hero > p:last-child { margin-top: 1rem; color: var(--muted); font-size: 1.05rem; line-height: 1.7; }

.access-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
  margin: 2rem 0;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-left: 5px solid var(--warn);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.access-card.state-ready { border-left-color: var(--safe); }
.access-card.state-forbidden { border-left-color: var(--danger); }
.access-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; background: var(--surface-muted); font-weight: 900; }
.access-card strong { font-size: 1rem; }
.access-card p { margin: .35rem 0 0; color: var(--muted); line-height: 1.55; }

.projection-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 2.5rem 0 1rem; }
.projection-toolbar h2 { margin: 0; font-size: 1.15rem; }
.projection-toolbar button {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .65rem .85rem;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}
.projection-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.projection-card {
  min-height: 220px;
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.projection-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; background: var(--surface-muted); color: var(--brand); font-weight: 900; }
.projection-card h3 { margin: 1.1rem 0 .6rem; }
.projection-card p { min-height: 4.7rem; margin: 0; color: var(--muted); line-height: 1.55; }
.empty-state { display: inline-block; margin-top: 1rem; color: var(--warn); font-size: .82rem; font-weight: 750; }
footer { display: flex; justify-content: space-between; gap: 1rem; margin-top: auto; padding: 1rem clamp(1rem, 4vw, 3rem); border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }

@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; gap: 1rem; }
  .sidebar nav { display: flex; overflow-x: auto; }
  .nav-item { white-space: nowrap; }
  .secure-note { display: none; }
  .projection-grid { grid-template-columns: 1fr; }
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1.5rem;
  padding: 2rem 1rem;
}
.auth-brand { display: flex; align-items: center; gap: 0.75rem; }
.auth-brand strong, .auth-brand small { display: block; line-height: 1.1; }
.auth-brand small { color: var(--muted); font-size: 0.75rem; letter-spacing: 0.08em; }
.auth-card {
  width: min(100%, 26rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 1.75rem;
}
.auth-card h1 { margin: 0.25rem 0 0.5rem; font-size: 1.5rem; }
.auth-card > p { color: var(--muted); }
.auth-form { display: grid; gap: 1rem; margin-top: 1.25rem; }
.field { display: grid; gap: 0.35rem; font-size: 0.9rem; }
.field input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
  color: var(--text);
  font: inherit;
}
.field input:focus { outline: 2px solid var(--brand); outline-offset: 2px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.button-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.button-primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.button-ghost { background: transparent; }
.button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.result { padding: 0.75rem 0.9rem; border-radius: 12px; font-size: 0.9rem; margin-top: 0.75rem; }
.result.success { background: color-mix(in srgb, var(--safe) 14%, var(--surface)); color: var(--safe); }
.result.failure { background: color-mix(in srgb, var(--danger) 14%, var(--surface)); color: var(--danger); }
.auth-security, .auth-links { color: var(--muted); font-size: 0.8rem; margin-top: 1.25rem; }
.logout-form { display: inline-flex; margin: 0; }

.page-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; padding: 0.5rem 0 1.25rem; flex-wrap: wrap; }
.page-hero h1 { margin: 0.25rem 0 0.5rem; font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.1; }
.page-hero p { margin: 0; color: var(--muted); }
.form-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); padding: 1.5rem; margin: 0 0 1.25rem; min-width: 0; }
fieldset.form-card { padding: 1rem 1.25rem 1.25rem; }
legend { padding: 0 0.4rem; font-weight: 700; color: var(--text); }
.card-heading { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; }
.card-heading h2 { margin: 0; font-size: 1.2rem; }
.card-heading p { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.step-number { display: grid; place-items: center; flex: 0 0 44px; height: 44px; border-radius: 14px; color: var(--brand-strong); background: var(--surface-muted); font-size: 0.9rem; font-weight: 900; }
.summary-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.summary-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.9rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.summary-list small { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 0.2rem; }
.chip-list { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.75rem 0 0; padding: 0; }
.chip-list form { margin: 0; }
.chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.75rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-muted); font-size: 0.85rem; }
.button-secondary { color: var(--brand-strong); border-color: var(--line); background: var(--surface); white-space: nowrap; }
.empty-preview { padding: 1.25rem; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; }
.submit-help { margin: 0; color: var(--muted); font-size: 0.8rem; }
.form-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-fields h3 { margin: 0.5rem 0 0; }
.field-wide { grid-column: 1 / -1; }
.field select { width: 100%; padding: 0.7rem 0.9rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-muted); color: var(--text); font: inherit; }
.field select:focus { outline: 2px solid var(--brand); outline-offset: 2px; }

@media (max-width: 560px) {
  .topbar, .topbar-actions, footer { align-items: flex-start; flex-direction: column; }
  .theme-switcher { max-width: 100%; overflow-x: auto; }
  .content { padding: 1.5rem 1rem 2.5rem; }
  .access-card { grid-template-columns: 1fr; }
  .form-fields { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* TR: Abonelik kontrol ve yardım satırları responsive ve logical yerleşimdir. */
.billing-nav { display: flex; flex-wrap: wrap; gap: .8rem; margin-block: 1rem; }
.billing-nav a, .billing-panel button { min-block-size: 44px; display: inline-flex; align-items: center; }
.billing-help summary { cursor: pointer; min-block-size: 44px; font-weight: 700; }
.billing-help li { margin-block: .8rem; line-height: 1.6; }

/* TR: Ortak kabuk: kullanılamayan modül gezinmede soluk ve rozetli; durum çipleri renge ek olarak metin taşır. */
.nav-item.nav-unavailable { color: var(--muted); }
.nav-label { flex: 1 1 auto; min-width: 0; }
.nav-badge, .status-chip {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.75rem;
  white-space: nowrap;
}
.status-available { color: var(--safe); border-color: var(--safe); }
.status-local_only { color: var(--warn); border-color: var(--warn); }
.status-unavailable { color: var(--muted); }
.capability-list { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.capability-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  display: grid;
  gap: 0.5rem;
  align-content: start;
}
.capability-card header { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.capability-card h3 { margin: 0; flex: 1 1 auto; }
.capability-need { color: var(--muted); }
.text-link { color: var(--brand); }
footer[data-shell-footer] { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* TR: Salt okunur yetki matrisi dar ekranda yatay kayar; sayfa taşmaz. */
.table-scroll { overflow-x: auto; }
.access-matrix { width: 100%; border-collapse: collapse; }
.access-matrix th, .access-matrix td { text-align: start; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--line); }
/* TR: Super-Developer profili ek stilleri: ortak styles.css'ten sonra yuklenir; super-admin sayfalarini etkilemez.
   TR: 44 px dokunma hedefi, 320 px mobilde tasmasiz tek sutun, RTL'de mantiksal yon (inline) ozellikleri. */
.nav-item .nav-label { display: inline; width: auto; height: auto; white-space: normal; }
.topbar { flex-wrap: wrap; gap: .75rem; }
.topbar-group { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; }
.topbar-group a, .auth-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: .75rem;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
}
.topbar-group a[aria-current="page"], .auth-links a[aria-current="page"] { background: var(--surface-muted); font-weight: 750; }
.topbar-group a:focus-visible, .auth-links a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.auth-links { display: flex; flex-wrap: wrap; gap: .25rem; }
.content { min-width: 0; overflow-wrap: anywhere; }
.content > h1 { font-size: clamp(1.75rem, 3.2vw, 2.75rem); line-height: 1.15; }
.card {
  margin-block-start: 1.25rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius, 14px);
  background: var(--surface);
}
.card h2 { margin-block: 0 .75rem; font-size: 1.15rem; }
.card dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .4rem 1rem; margin: 0 0 1rem; }
.card dt { color: var(--muted); font-weight: 650; }
.card dd { margin: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.auth-form select, .auth-form input:not([type="radio"]):not([type="checkbox"]) { width: 100%; min-height: 44px; }
fieldset.field { margin: 0; padding: .75rem 1rem; border: 1px solid var(--line); border-radius: 12px; }
fieldset.field label { display: flex; align-items: center; justify-content: flex-start; gap: .6rem; min-height: 44px; }
fieldset.field input[type="radio"], fieldset.field input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  min-height: 0;
  margin: 0;
  padding: 0;
}
.empty { color: var(--muted); }
/* TR: Dil fieldset'leri icindeki alanlar normal .field gibi alt alta kalir; radyo/onay kutusu satir kurali onlara uygulanmaz. */
fieldset[data-l10n] { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; }
fieldset.field label.field { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; gap: .35rem; min-height: 0; }
fieldset.field + fieldset.field { margin-block-start: .75rem; }
.field textarea {
  width: 100%;
  min-height: 5.5rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
  color: var(--text);
  font: inherit;
  resize: vertical;
}
.field textarea:focus { outline: 2px solid var(--brand); outline-offset: 2px; }
.card h3 { margin-block: 1.25rem .5rem; font-size: 1rem; }
.localization { margin-block-start: .75rem; padding-block-start: .75rem; border-block-start: 1px solid var(--line); }
.localization h4 { margin-block: 0 .35rem; font-size: .95rem; color: var(--muted); }
.localization-name { margin-block: 0 .5rem; }
.localization-text { white-space: pre-wrap; }
@media (max-width: 820px) {
  .sidebar nav { flex-wrap: wrap; overflow-x: visible; }
  .nav-item { white-space: normal; }
}
@media (max-width: 560px) {
  .card dl { grid-template-columns: 1fr; }
  .card dd { margin-block-end: .5rem; }
  .content h1 { font-size: clamp(1.6rem, 8vw, 2.4rem); }
}
