:root {
  --bg: #020617;
  --bg-elevated: #020617;
  --bg-elevated-soft: #020617;
  --border-soft: rgba(148, 163, 184, 0.35);
  --accent: #6366f1;
  --accent-soft: rgba(99, 102, 241, 0.12);
  --text: #e5e7eb;
  --text-soft: #9ca3af;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-pill: 999px;
}

.theme-light {
  --bg: #f9fafb;
  --bg-elevated: #f9fafb;
  --bg-elevated-soft: #f9fafb;
  --border-soft: rgba(148, 163, 184, 0.6);
  --accent: #4f46e5;
  --accent-soft: rgba(79, 70, 229, 0.08);
  --text: #111827;
  --text-soft: #6b7280;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text',
    'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 18px;
}

.app-shell {
  max-width: 1200px;
  width: 100%;
  background: var(--bg-elevated);
  border-radius: 20px;
  border: 1px solid var(--border-soft);
  padding: 16px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 10px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.logo-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--accent);
}

.brand-text {
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-size: 0.83rem;
}

.brand-sub {
  font-size: 0.78rem;
  color: var(--text-soft);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-soft);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.font-size-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--text-soft);
}

.font-size-control select {
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: transparent;
  color: var(--text);
  font-size: 0.78rem;
  padding: 4px 10px;
  outline: none;
}

.font-size-control select:focus-visible {
  border-color: var(--accent);
}

.history-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--text-soft);
}

.history-control select {
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: transparent;
  color: var(--text);
  font-size: 0.78rem;
  padding: 4px 10px;
  outline: none;
}

.history-control select:focus-visible {
  border-color: var(--accent);
}

button {
  border: none;
  outline: none;
  cursor: pointer;
  font: inherit;
}

.ghost-btn,
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  transition: all 0.16s ease-out;
}

.ghost-btn {
  background: transparent;
  color: var(--text-soft);
  border: 1px solid var(--border-soft);
}

.ghost-btn:hover {
  background: var(--accent-soft);
  color: var(--text);
}

.primary-btn {
  background: var(--accent);
  color: white;
}

.primary-btn:hover {
  opacity: 0.9;
}

.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.1fr);
  gap: 12px;
  padding: 2px 2px 0;
  flex: 1 1 auto;
  min-height: 0;
}

.panel {
  background: var(--bg-elevated-soft);
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  padding: 10px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 2px 4px 8px;
}

.panel-title {
  font-size: 0.88rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-soft);
}

.panel-subtitle {
  font-size: 0.78rem;
  color: var(--text-soft);
  opacity: 0.9;
}

.panel-left {
  background: var(--bg-elevated-soft);
}

.panel-right {
  background: var(--bg-elevated-soft);
}

.editor,
.preview {
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  background: var(--bg);
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.6;
  overflow: auto;
}

.editor {
  resize: none;
  font-family: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, 'Liberation Mono', 'Courier New', monospace;
  background: var(--bg);
  caret-color: var(--accent);
}

.editor:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.7);
}

.preview {
  background: var(--bg);
}

.placeholder {
  color: var(--text-soft);
}

/* Seçim (highlight) renkleri */
::selection {
  background: rgba(96, 165, 250, 0.35);
  color: #f9fafb;
}

.editor::selection,
.preview::selection,
.markdown-body ::selection {
  background: rgba(96, 165, 250, 0.45);
  color: #f9fafb;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px 2px;
  font-size: 0.75rem;
  color: var(--text-soft);
}

.app-shell.full-width {
  max-width: none;
}

.dot-separator {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.7);
}

/* Markdown içerik stilleri */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  font-weight: 650;
  margin: 0.2rem 0 0.35rem;
}

.markdown-body h1 {
  font-size: 1.4rem;
  letter-spacing: 0.02em;
}

.markdown-body h2 {
  font-size: 1.15rem;
}

.markdown-body h3 {
  font-size: 1.02rem;
}

.markdown-body p {
  margin: 0.25rem 0 0.35rem;
}

.markdown-body a {
  color: #38bdf8;
  text-decoration: none;
}

.markdown-body a:hover {
  text-decoration: underline;
}

.markdown-body code {
  background: rgba(15, 23, 42, 0.92);
  padding: 2px 5px;
  border-radius: 6px;
  font-size: 0.82em;
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.markdown-body pre code {
  display: block;
  padding: 10px 11px;
  border-radius: 10px;
  background: #020617;
  border: 1px solid rgba(30, 64, 175, 0.9);
}

.theme-light .markdown-body code {
  background: #e5e7eb;
  color: #111827;
  border-color: rgba(148, 163, 184, 0.8);
}

.theme-light .markdown-body pre code {
  background: #f3f4f6;
  color: #111827;
  border-color: rgba(148, 163, 184, 0.8);
}

.theme-light .markdown-body th {
  background: #e5e7eb;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.2rem;
  margin: 0.2rem 0 0.4rem;
}

.markdown-body blockquote {
  border-left: 3px solid rgba(148, 163, 184, 0.8);
  padding-left: 0.6rem;
  color: var(--text-soft);
  margin: 0.25rem 0 0.4rem;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.35rem 0;
  font-size: 0.8rem;
}

.markdown-body th,
.markdown-body td {
  padding: 6px 8px;
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.markdown-body th {
  background: rgba(15, 23, 42, 0.9);
}

.markdown-body hr {
  border: none;
  border-top: 1px dashed rgba(148, 163, 184, 0.6);
  margin: 0.5rem 0;
}

@media (max-width: 900px) {
  body {
    padding: 10px;
  }

  .app-shell {
    border-radius: 16px;
  }

  .editor-layout {
    grid-template-columns: 1fr;
  }

  .panel {
    min-height: 230px;
  }
}



