/* WebKaptan seçili işletme editörü — dengeli ürün arayüzü / teknik çalışma masası. */
.wk-editor {
  --wk-ink: #15202b;
  --wk-muted: #65717d;
  --wk-line: #d9e0e5;
  --wk-panel: #f4f7f8;
  --wk-paper: #ffffff;
  --wk-accent: #d97706;
  --wk-accent-dark: #9a4f00;
  --wk-focus: #155e75;
  --wk-good: #176b43;
  --wk-bad: #a32d2d;
  --wk-shadow: 0 12px 28px rgba(21, 32, 43, .08);
  min-width: 0;
  color: var(--wk-ink);
  background: var(--wk-paper);
  border: 1px solid var(--wk-line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--wk-shadow);
}

.wk-editor *, .wk-editor *::before, .wk-editor *::after { box-sizing: border-box; }
.wk-editor button, .wk-editor input, .wk-editor textarea { font: inherit; }
.wk-editor button, .wk-editor textarea, .wk-editor a { min-height: 44px; }
.wk-editor button {
  border: 1px solid #c8d1d7;
  border-radius: 7px;
  background: #fff;
  color: var(--wk-ink);
  cursor: pointer;
  padding: 9px 13px;
  transition: border-color .16s ease, background-color .16s ease, color .16s ease, transform .16s ease;
}
.wk-editor button:hover:not(:disabled) { border-color: #9eabb4; background: #f7fafb; }
.wk-editor button:active:not(:disabled) { transform: translateY(1px); }
.wk-editor button:focus-visible, .wk-editor textarea:focus-visible, .wk-editor input:focus-visible,
.wk-editor [tabindex]:focus-visible { outline: 3px solid rgba(21, 94, 117, .35); outline-offset: 2px; }
.wk-editor button:disabled { opacity: .48; cursor: not-allowed; }
.wk-editor .wk-primary { background: var(--wk-ink); border-color: var(--wk-ink); color: #fff; }
.wk-editor .wk-primary:hover:not(:disabled) { background: #273745; border-color: #273745; }
.wk-editor .wk-accent { background: var(--wk-accent); border-color: var(--wk-accent); color: #fff; }
.wk-editor .wk-accent:hover:not(:disabled) { background: var(--wk-accent-dark); border-color: var(--wk-accent-dark); }
.wk-editor .wk-danger { color: var(--wk-bad); border-color: #e0b8b8; }
.wk-editor .wk-quiet { color: var(--wk-muted); }

.wk-editor__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  background: var(--wk-ink);
  color: #fff;
}
.wk-editor__identity { min-width: 0; }
.wk-editor__identity strong { display: block; font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; }
.wk-editor__identity small { display: block; color: #b8c4cc; margin-top: 3px; font-size: 12px; overflow-wrap: anywhere; }
.wk-editor__actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.wk-editor__actions button { min-height: 44px; border-color: rgba(255,255,255,.25); background: transparent; color: #fff; }
.wk-editor__actions button:hover:not(:disabled) { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.5); }
.wk-editor__actions button[aria-pressed="true"] { background: #fff; color: var(--wk-ink); border-color: #fff; }
.wk-editor__actions .wk-accent { border-color: var(--wk-accent); background: var(--wk-accent); }

.wk-editor__status {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-bottom: 1px solid var(--wk-line);
  background: #fbfcfc;
  color: var(--wk-muted);
  font-size: 12px;
}
.wk-editor__status[data-tone="good"] { color: var(--wk-good); background: #f1faf5; }
.wk-editor__status[data-tone="bad"] { color: var(--wk-bad); background: #fff5f5; }
.wk-editor__status[data-tone="working"] { color: #8a4c00; background: #fff9ec; }
.wk-editor__status::before { content: ''; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: currentColor; }

.wk-editor__workspace {
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr) minmax(210px, 250px);
  min-height: 680px;
  background: var(--wk-panel);
}
.wk-editor__chat, .wk-editor__versions { min-width: 0; padding: 15px; }
.wk-editor__chat { display: flex; flex-direction: column; border-right: 1px solid var(--wk-line); background: #fff; }
.wk-editor__versions { border-left: 1px solid var(--wk-line); background: #fbfcfc; }
.wk-editor__preview { min-width: 0; display: flex; flex-direction: column; padding: 15px; gap: 10px; }
.wk-editor__section-title { margin: 0 0 8px; font-size: 12px; letter-spacing: .03em; text-transform: uppercase; color: var(--wk-muted); }
.wk-editor__chat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.wk-editor__chat-head h2, .wk-editor__versions h2 { margin: 0; font-size: 15px; line-height: 1.25; }
.wk-editor__chat-head p { margin: 4px 0 0; color: var(--wk-muted); font-size: 12px; }
.wk-editor__selected {
  margin-bottom: 12px;
  padding: 10px 11px;
  border: 1px solid #e5c58d;
  border-radius: 8px;
  background: #fff9ec;
  color: #774800;
  font-size: 12px;
}
.wk-editor__selected strong { display: block; margin-bottom: 3px; }
.wk-editor__selected span { display: block; color: #896b45; overflow-wrap: anywhere; }
.wk-editor__messages {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 9px;
  min-height: 180px;
  max-height: 390px;
  overflow: auto;
  padding: 2px 2px 6px;
}
.wk-editor__message { max-width: 95%; padding: 9px 10px; border-radius: 8px; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.wk-editor__message[data-role="assistant"] { align-self: flex-start; border: 1px solid var(--wk-line); background: #f7fafb; }
.wk-editor__message[data-role="user"] { align-self: flex-end; background: #e9f3f6; color: #124557; }
.wk-editor__message[data-role="error"] { align-self: stretch; border: 1px solid #e6baba; background: #fff5f5; color: var(--wk-bad); }
.wk-editor__message strong { display: block; margin-bottom: 3px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.wk-editor__chat-form { margin-top: 12px; }
.wk-editor__chat-form textarea { display: block; width: 100%; min-height: 92px; resize: vertical; padding: 10px; border: 1px solid #c8d1d7; border-radius: 8px; background: #fff; color: var(--wk-ink); }
.wk-editor__chat-form textarea::placeholder { color: #7b8790; }
.wk-editor__chat-form .wk-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.wk-editor__hint { color: var(--wk-muted); font-size: 11px; line-height: 1.35; }

.wk-editor__preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.wk-editor__preview-label { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; color: var(--wk-muted); }
.wk-editor__preview-label strong { color: var(--wk-ink); overflow-wrap: anywhere; }
.wk-editor__dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--wk-good); }
.wk-editor__dot[data-state="draft"] { background: var(--wk-accent); }
.wk-editor__dot[data-state="error"] { background: var(--wk-bad); }
.wk-editor__frame-shell { position: relative; flex: 1 1 auto; min-height: 580px; border: 1px solid #bac6cd; border-radius: 9px; background: #dce4e8; padding: 12px; }
.wk-editor__frame-shell iframe { display: block; width: 100%; height: 100%; min-height: 555px; border: 0; border-radius: 5px; background: #fff; box-shadow: 0 4px 16px rgba(21,32,43,.12); }
.wk-editor__frame-shell[data-loading="true"]::after { content: 'Önizleme yükleniyor…'; position: absolute; inset: 12px; display: grid; place-items: center; border-radius: 5px; background: rgba(255,255,255,.84); color: var(--wk-muted); font-size: 13px; }
.wk-editor__selection { display: flex; align-items: flex-start; gap: 9px; min-height: 46px; padding: 9px 11px; border: 1px solid var(--wk-line); border-radius: 8px; background: #fff; font-size: 12px; }
.wk-editor__selection-mark { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 1px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.wk-editor__selection strong { display: block; font-size: 12px; }
.wk-editor__selection span { display: block; margin-top: 2px; color: var(--wk-muted); overflow-wrap: anywhere; }
.wk-editor__selection[data-empty="true"] { color: var(--wk-muted); }

.wk-editor__publish-confirm { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px; border: 1px solid #e5c58d; border-radius: 8px; background: #fff9ec; color: #774800; font-size: 12px; }
.wk-editor__publish-confirm p { flex: 1 1 180px; margin: 0; }
.wk-editor__versions h2 { margin-bottom: 5px; }
.wk-editor__versions-intro { margin: 0 0 12px; color: var(--wk-muted); font-size: 12px; line-height: 1.4; }
.wk-editor__version-list { display: flex; flex-direction: column; gap: 8px; }
.wk-editor__version { padding: 10px; border: 1px solid var(--wk-line); border-radius: 8px; background: #fff; }
.wk-editor__version strong { display: block; font-size: 12px; }
.wk-editor__version small { display: block; margin: 4px 0 8px; color: var(--wk-muted); font-size: 11px; }
.wk-editor__version button { width: 100%; min-height: 44px; font-size: 12px; }
.wk-editor__empty { padding: 10px; border: 1px dashed #cbd5da; border-radius: 8px; color: var(--wk-muted); font-size: 12px; line-height: 1.45; }
.wk-editor__plan { margin-top: 10px; padding: 10px; border: 1px solid #b9d5dc; border-radius: 8px; background: #f1fafc; color: #124557; font-size: 12px; }
.wk-editor__plan strong { display: block; margin-bottom: 5px; }
.wk-editor__plan ul { margin: 0 0 9px; padding-left: 18px; }
.wk-editor__plan button { width: 100%; min-height: 40px; }
.wk-editor__revision { margin-top: 10px; color: var(--wk-muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; overflow-wrap: anywhere; }
.wk-editor [hidden] { display: none !important; }

@media (max-width: 1080px) {
  .wk-editor__workspace { grid-template-columns: minmax(245px, 290px) minmax(0, 1fr); }
  .wk-editor__versions { grid-column: 1 / -1; border-top: 1px solid var(--wk-line); border-left: 0; }
  .wk-editor__version-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
}
@media (max-width: 760px) {
  .wk-editor__topbar { align-items: flex-start; flex-direction: column; }
  .wk-editor__actions { width: 100%; justify-content: flex-start; }
  .wk-editor__actions button { flex: 1 1 110px; }
  .wk-editor__workspace { display: flex; flex-direction: column; min-height: 0; }
  .wk-editor__chat { border-right: 0; border-bottom: 1px solid var(--wk-line); }
  .wk-editor__preview { order: 2; }
  .wk-editor__versions { order: 3; }
  .wk-editor__messages { max-height: 250px; }
  .wk-editor__frame-shell { min-height: 440px; padding: 8px; }
  .wk-editor__frame-shell iframe { min-height: 420px; }
}
@media (max-width: 420px) {
  .wk-editor__topbar, .wk-editor__status, .wk-editor__chat, .wk-editor__preview, .wk-editor__versions { padding-left: 11px; padding-right: 11px; }
  .wk-editor__actions button { flex-basis: 100%; }
  .wk-editor__frame-shell { padding: 5px; }
  .wk-editor__frame-shell iframe { min-height: 390px; }
}
