/* Kitap Atölyesi — workspace modes. Siyah ağırlıklı tema.
   Tüm seçiciler #creativeWorkspace kapsamındadır: modül kendi alanı dışına stil sızdırmaz.
   Kontrast hedefi: gövde metni >= 7:1, ikincil metin >= 4.5:1 (WCAG AA). */

#creativeWorkspace {
  --wsx-black: #070708;
  --wsx-bg: #0b0b0d;
  --wsx-surface: #121214;
  --wsx-surface-2: #17171a;
  --wsx-line: #2a2a2e;
  --wsx-line-strong: #3c3c42;
  --wsx-ink: #f4f4f1;
  --wsx-ink-soft: #b4b4ae;
  --wsx-ink-dim: #8f8f89;
  --wsx-gold: #d7b06a;
  --wsx-gold-soft: #f0d8a8;
  --wsx-gold-ink: #1a1305;
  --wsx-gold-wash: #241c0d;
  --wsx-ok: #b6d7a0;
  --wsx-ok-wash: #16210f;
  --wsx-danger: #f3a99b;
  --wsx-danger-wash: #26100d;
  --wsx-radius: 14px;
  --wsx-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 18px 40px -28px #000;
  color-scheme: dark;
}

#creativeWorkspace .wsx-module,
#creativeWorkspace .wsx-module * { box-sizing: border-box; }

#creativeWorkspace .wsx-module {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 22px;
  color: var(--wsx-ink);
  background:
    radial-gradient(120% 90% at 88% -10%, #1c1b16 0%, transparent 58%),
    var(--wsx-bg);
  border: 1px solid var(--wsx-line);
  border-radius: calc(var(--wsx-radius) + 4px);
  box-shadow: var(--wsx-shadow);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

/* --- başlık ve mod kontrolü --- */
#creativeWorkspace .wsx-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; }
/* Başlık tek satırda kalmalı: dar taban yüzünden "Çalışma alanı" iki satıra kırılıyordu. */
#creativeWorkspace .wsx-head-titles { flex: 1 1 44ch; min-width: 0; }
#creativeWorkspace .wsx-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.3rem, 1.05rem + .9vw, 1.72rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
  color: #fbfbf8;
  /* Kelime ortasından kırılma yok (overflow-wrap: anywhere mirası "alanı"yı bölüyordu):
     yeterli yer varsa tek satır, daralınca yalnız boşluktan sarar; kırpılmaz. */
  overflow-wrap: normal;
  word-break: keep-all;
  hyphens: none;
  white-space: normal;
}
#creativeWorkspace .wsx-lede { margin: 6px 0 0; max-width: 58ch; color: var(--wsx-ink-soft); }
#creativeWorkspace .wsx-segmented { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#creativeWorkspace .wsx-seg { min-width: 78px; }
#creativeWorkspace .wsx-status {
  flex: 1 1 100%;
  margin: 0;
  padding-top: 4px;
  border-top: 1px solid var(--wsx-line);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--wsx-ink-soft);
}
#creativeWorkspace .wsx-status::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--wsx-gold);
  vertical-align: 1px;
}

/* --- düğmeler --- */
#creativeWorkspace .wsx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--wsx-line-strong);
  border-radius: 10px;
  background: var(--wsx-surface-2);
  color: var(--wsx-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
#creativeWorkspace .wsx-btn:hover { border-color: var(--wsx-gold); background: #1e1d18; color: #fffdf7; }
#creativeWorkspace .wsx-btn.is-on,
#creativeWorkspace .wsx-btn[aria-pressed="true"] {
  background: var(--wsx-gold-wash);
  border-color: var(--wsx-gold);
  color: var(--wsx-gold-soft);
  box-shadow: inset 0 0 0 1px rgba(215, 176, 106, .3);
}
#creativeWorkspace .wsx-btn[disabled] { opacity: .42; cursor: not-allowed; }
#creativeWorkspace .wsx-btn-small { min-height: 34px; padding: 6px 10px; font-size: .82rem; }
#creativeWorkspace .wsx-btn-ghost { border-color: var(--wsx-line); background: transparent; color: var(--wsx-ink-soft); }
#creativeWorkspace .wsx-btn-ghost:hover { color: #fffdf7; }
#creativeWorkspace .wsx-icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--wsx-line-strong);
  border-radius: 9px;
  background: var(--wsx-surface-2);
  color: var(--wsx-ink);
  font: inherit;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}
#creativeWorkspace .wsx-icon:hover:not([disabled]) { border-color: var(--wsx-gold); background: #1e1d18; }
#creativeWorkspace .wsx-icon[disabled] { opacity: .35; cursor: not-allowed; }
#creativeWorkspace .wsx-module button:focus-visible,
#creativeWorkspace .wsx-module a:focus-visible {
  outline: 3px solid var(--wsx-gold);
  outline-offset: 2px;
  border-radius: 8px;
}

/* --- bölüm başlıkları --- */
#creativeWorkspace .wsx-section { display: grid; gap: 10px; }
#creativeWorkspace .wsx-section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
/* .wsx-module içindeki h3, ata `h3` kuralını miras alıp 15px/normal kalıyordu:
   bölüm başlıkları gövde metniyle aynı ağırlıkta görünüyordu. */
#creativeWorkspace .wsx-h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.14rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: #f6f6f2;
}
#creativeWorkspace .wsx-section + .wsx-section { margin-top: 4px; }
#creativeWorkspace .wsx-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* --- Basit mod: dört adım --- */
#creativeWorkspace .wsx-steps { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); margin: 0; padding: 0; list-style: none; }
#creativeWorkspace .wsx-step {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 16px;
  background: var(--wsx-surface);
  border: 1px solid var(--wsx-line);
  border-radius: var(--wsx-radius);
}
#creativeWorkspace .wsx-step-no {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--wsx-gold);
  color: var(--wsx-gold-ink);
  font-size: .85rem;
  font-weight: 800;
}
#creativeWorkspace .wsx-step-title { margin: 2px 0 0; font-size: 1rem; font-weight: 700; color: #fbfbf8; }
#creativeWorkspace .wsx-step-text { margin: 0; font-size: .9rem; color: var(--wsx-ink-soft); }
#creativeWorkspace .wsx-step .wsx-row { margin-top: 6px; }

/* --- Pro mod: paneller --- */
#creativeWorkspace .wsx-panels { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); align-items: start; }
#creativeWorkspace .wsx-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 16px;
  background: var(--wsx-surface);
  border: 1px solid var(--wsx-line);
  border-radius: var(--wsx-radius);
}

/* --- kartlar --- */
#creativeWorkspace .wsx-stack { display: grid; gap: 10px; }
#creativeWorkspace .wsx-card {
  display: grid;
  gap: 6px;
  padding: 13px;
  background: var(--wsx-surface-2);
  border: 1px solid #2f2f34;
  border-radius: 12px;
}
#creativeWorkspace .wsx-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
#creativeWorkspace .wsx-card-title { margin: 0; font-size: .98rem; font-weight: 700; color: #fbfbf8; }
#creativeWorkspace .wsx-meta { margin: 0; font-size: .83rem; color: var(--wsx-ink-soft); font-variant-numeric: tabular-nums; }
#creativeWorkspace .wsx-tag {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid #35353a;
  border-radius: 999px;
  background: #1c1c20;
  color: #cfcfc8;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
}

/* --- referans / bütçe / uyarı --- */
#creativeWorkspace .wsx-ref { margin: 0; font-size: .84rem; color: var(--wsx-ink-soft); }
#creativeWorkspace .wsx-badge {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}
#creativeWorkspace .wsx-badge.is-warn { background: var(--wsx-danger-wash); color: var(--wsx-danger); }
#creativeWorkspace .wsx-badge.is-ok { background: var(--wsx-ok-wash); color: var(--wsx-ok); }
#creativeWorkspace .wsx-caution {
  margin: 0;
  padding: 8px 10px;
  border-left: 3px solid var(--wsx-gold);
  border-radius: 0 8px 8px 0;
  background: var(--wsx-gold-wash);
  color: var(--wsx-gold-soft);
  font-size: .82rem;
  font-weight: 600;
}
#creativeWorkspace .wsx-budget {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  margin: 0;
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
}
#creativeWorkspace .wsx-budget strong { font-weight: 700; color: #fbfbf8; }
#creativeWorkspace .wsx-budget-label { color: var(--wsx-ink-soft); }

/* --- kuyruk --- */
#creativeWorkspace .wsx-queue { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
#creativeWorkspace .wsx-queue-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--wsx-line);
  font-size: .82rem;
}
#creativeWorkspace .wsx-queue-row:last-child { border-bottom: 0; }
#creativeWorkspace .wsx-queue-seq { font-weight: 700; font-variant-numeric: tabular-nums; color: #f0f0ea; }
#creativeWorkspace .wsx-queue-job { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .76rem; color: #a7a7a1; }
#creativeWorkspace .wsx-queue-msg { color: var(--wsx-ink-soft); }

/* --- durum metinleri --- */
#creativeWorkspace .wsx-note { margin: 0; font-size: .78rem; color: var(--wsx-ink-dim); }
#creativeWorkspace .wsx-empty,
#creativeWorkspace .wsx-loading {
  margin: 0;
  padding: 10px 12px;
  border: 1px dashed var(--wsx-line-strong);
  border-radius: 10px;
  background: var(--wsx-surface);
  font-size: .86rem;
  font-weight: 600;
  color: var(--wsx-ink-soft);
}
#creativeWorkspace .wsx-loading { animation: wsx-breathe 1.6s ease-in-out infinite; }
@keyframes wsx-breathe { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
#creativeWorkspace .wsx-error {
  display: grid;
  gap: 6px;
  justify-items: start;
  padding: 12px;
  border: 1px solid #5a332b;
  border-radius: 12px;
  background: var(--wsx-danger-wash);
}
#creativeWorkspace .wsx-error-title { margin: 0; font-size: .9rem; font-weight: 700; color: var(--wsx-danger); }
#creativeWorkspace .wsx-error-text { margin: 0; font-size: .84rem; color: #e8c9c1; }
/* Veri biçimi hatası, istek hatasından ayrı görünür */
#creativeWorkspace .wsx-error.wsx-shape { border-color: #5a4b26; background: #1f1a0d; }
#creativeWorkspace .wsx-shape .wsx-error-title { color: var(--wsx-gold-soft); }
#creativeWorkspace .wsx-shape .wsx-error-text { color: #e3d3ae; }

/* --- görünüm / sıra özelleştirmesi (yalnız Pro) --- */
#creativeWorkspace .wsx-custom {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  background: #101012;
  border: 1px solid var(--wsx-line);
  border-radius: var(--wsx-radius);
}
#creativeWorkspace .wsx-order { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
#creativeWorkspace .wsx-order-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 6px 8px;
  background: var(--wsx-surface-2);
  border: 1px solid var(--wsx-line);
  border-radius: 10px;
}
#creativeWorkspace .wsx-order-name { flex: 1 1 130px; min-width: 0; font-size: .88rem; font-weight: 700; color: #f4f4f1; }

/* --- araç gezinme kartları --- */
#creativeWorkspace .wsx-nav { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
#creativeWorkspace .wsx-nav-card {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--wsx-line-strong);
  border-radius: 12px;
  background: var(--wsx-surface-2);
  color: var(--wsx-ink);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
#creativeWorkspace .wsx-nav-card:hover { border-color: var(--wsx-gold); background: #1e1d18; }
#creativeWorkspace .wsx-nav-hint {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--wsx-gold);
}

/* --- yoğunluk: sıkı --- */
#creativeWorkspace .wsx-module.wsx-tight { gap: 12px; padding: 16px; }
#creativeWorkspace .wsx-tight .wsx-step,
#creativeWorkspace .wsx-tight .wsx-card,
#creativeWorkspace .wsx-tight .wsx-panel,
#creativeWorkspace .wsx-tight .wsx-custom { padding: 10px; }
#creativeWorkspace .wsx-tight .wsx-steps,
#creativeWorkspace .wsx-tight .wsx-stack,
#creativeWorkspace .wsx-tight .wsx-panels,
#creativeWorkspace .wsx-tight .wsx-order { gap: 8px; }
#creativeWorkspace .wsx-tight .wsx-step-text { font-size: .85rem; }

/* --- responsive: Pro'da iki kolon, mobilde tek kolon --- */
@media (min-width: 760px) {
  #creativeWorkspace .wsx-mode-simple .wsx-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 880px) {
  #creativeWorkspace .wsx-mode-pro .wsx-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 520px) {
  #creativeWorkspace .wsx-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 559px) {
  #creativeWorkspace .wsx-module { gap: 14px; padding: 14px; }
  #creativeWorkspace .wsx-head { align-items: flex-start; }
  #creativeWorkspace .wsx-head-titles { flex: 1 1 100%; }
  #creativeWorkspace .wsx-title { white-space: normal; }
  #creativeWorkspace .wsx-segmented { width: 100%; }
  #creativeWorkspace .wsx-seg { flex: 1 1 0; }
  #creativeWorkspace .wsx-order-name { flex: 1 1 100%; }
  #creativeWorkspace .wsx-queue-row { gap: 3px 8px; }
  /* Dokunma hedefi: dar ekranda ok düğmeleri en az 44 px (WCAG 2.5.5 hedefi). */
  #creativeWorkspace .wsx-icon {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    font-size: 1rem;
  }
  #creativeWorkspace .wsx-btn-small { min-height: 40px; }
  #creativeWorkspace .wsx-status { margin-top: 2px; }
}

/* --- hareket azaltma --- */
@media (prefers-reduced-motion: reduce) {
  #creativeWorkspace .wsx-module *,
  #creativeWorkspace .wsx-module *::before,
  #creativeWorkspace .wsx-module *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  #creativeWorkspace .wsx-loading { animation: none !important; }
}
