/* ============================================================
   ATÖLYE CV — Uygulama Arayüzü · "Studio Graphite"
   İki tonlu atölye: koyu grafit editör, açık noktalı kanvas.
   Tek vurgu rengi yalnızca eylem/seçim durumlarında kullanılır.
   ============================================================ */

:root {
  /* Grafit nötrler (maviye çalan ton, hue 255) */
  --bg-app: oklch(0.155 0.012 255);
  --bg-panel: oklch(0.185 0.012 255);
  --bg-field: oklch(0.13 0.01 255);
  --bg-raise: oklch(0.95 0.01 255 / 0.05);
  --bg-raise-2: oklch(0.95 0.01 255 / 0.09);
  --line: oklch(0.95 0.01 255 / 0.1);
  --line-strong: oklch(0.95 0.01 255 / 0.2);

  --text: oklch(0.93 0.008 255);
  --text-dim: oklch(0.74 0.015 255);
  --text-faint: oklch(0.62 0.02 255);

  /* Vurgu: elektrik mavisi — eylem, seçim, odak */
  --accent: oklch(0.58 0.18 255);
  --accent-hover: oklch(0.64 0.18 255);
  --accent-down: oklch(0.53 0.17 255);
  --accent-text: oklch(0.74 0.13 255);
  --accent-soft: oklch(0.58 0.18 255 / 0.12);
  --on-accent: oklch(0.985 0.005 255);

  /* Açık kanvas (önizleme tarafı) */
  --canvas: oklch(0.945 0.004 255);
  --canvas-dot: oklch(0.875 0.006 255);
  --canvas-line: oklch(0.87 0.006 255);
  --canvas-panel: oklch(0.97 0.004 255 / 0.92);
  --canvas-text: oklch(0.3 0.015 255);
  --canvas-text-dim: oklch(0.48 0.015 255);
  --canvas-white: oklch(0.99 0.002 255);

  /* Durum renkleri */
  --ok: oklch(0.62 0.14 155);
  --warn: oklch(0.56 0.18 28);
  --mid: oklch(0.72 0.14 80);
  --ok-text: oklch(0.75 0.12 155);
  --mid-text: oklch(0.78 0.12 80);
  --bad-text: oklch(0.72 0.15 28);

  --font-ui: "Geist", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Geist Mono", Consolas, monospace;

  --r-sm: 7px;
  --r-md: 9px;
  --r-lg: 12px;
  --ease: cubic-bezier(0.25, 1, 0.5, 1); /* ease-out-quart */
  --t-fast: 150ms;
  --t-med: 200ms;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font-ui);
  background: var(--bg-app);
  color: var(--text);
  font-size: 13.5px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app { display: flex; flex-direction: column; height: 100vh; }

/* ---------------- Üst Çubuk ---------------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  height: 54px;
  flex: 0 0 auto;
  background: var(--bg-app);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  background: oklch(0.97 0.004 255);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
}
.brand-mark img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  display: block;
}

.brand-text { display: flex; align-items: center; gap: 9px; min-width: 0; }

.brand-name {
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand-name em { font-style: normal; color: var(--accent-text); }

.brand-sub {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px 2px;
  white-space: nowrap;
}

.topbar-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }

/* ---------------- Profil Grubu ---------------- */

.profile-group { display: flex; align-items: center; gap: 3px; min-width: 0; }

.profile-select {
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text);
  background: var(--bg-field);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 6px 8px;
  max-width: 170px;
  cursor: pointer;
  outline: none;
  transition: border-color var(--t-fast) var(--ease);
}
.profile-select:hover { border-color: var(--line-strong); }
.profile-select:focus-visible { border-color: var(--accent); }
.profile-select option { background: var(--bg-panel); }

.btn {
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 550;
  border-radius: var(--r-sm);
  padding: 7px 12px;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease);
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--line);
}
.btn-ghost:hover { color: var(--text); background: var(--bg-raise); border-color: var(--line-strong); }
.btn-ghost:active { background: var(--bg-raise-2); }

.btn-danger:hover {
  color: oklch(0.78 0.12 28);
  border-color: oklch(0.56 0.18 28 / 0.5);
  background: oklch(0.56 0.18 28 / 0.1);
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: transparent;
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { background: var(--accent-down); }

/* ---------------- Çalışma Alanı ---------------- */

.workspace {
  display: grid;
  grid-template-columns: minmax(380px, 460px) 1fr;
  flex: 1;
  min-height: 0;
}

/* ---------------- Editör Paneli ---------------- */

.editor-pane {
  background: var(--bg-app);
  border-right: 1px solid var(--line);
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ---------------- ATS Puanı Paneli ---------------- */

.score-panel {
  border-bottom: 1px solid var(--line);
  background: var(--bg-app);
  flex: 0 0 auto;
}

.score-details > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  user-select: none;
  transition: background var(--t-fast) var(--ease);
}
.score-details > summary::-webkit-details-marker { display: none; }
.score-details > summary:hover { background: var(--bg-raise); }
.score-details[open] .ed-chevron { transform: rotate(180deg); }

.score-ring { flex: 0 0 auto; }
.score-ring .ring-bg { fill: none; stroke: var(--line); stroke-width: 3.5; }
.score-ring .ring-val {
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset var(--t-med) var(--ease);
}
.score-ring .ring-text {
  fill: var(--text);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
}
.score-ring.tone-ok .ring-val   { stroke: var(--ok); }
.score-ring.tone-good .ring-val { stroke: var(--accent); }
.score-ring.tone-mid .ring-val  { stroke: var(--mid); }
.score-ring.tone-bad .ring-val  { stroke: var(--warn); }

.score-head { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.score-title { font-size: 13px; font-weight: 600; }
.score-grade { font-size: 11.5px; font-weight: 550; }
.score-grade.tone-ok   { color: var(--ok-text); }
.score-grade.tone-good { color: var(--accent-text); }
.score-grade.tone-mid  { color: var(--mid-text); }
.score-grade.tone-bad  { color: var(--bad-text); }

.score-list {
  list-style: none;
  margin: 0;
  padding: 2px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: 34vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: oklch(0.4 0.015 255) transparent;
}

.score-item { display: flex; gap: 9px; font-size: 12px; }
.score-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 4px; flex: 0 0 auto; }
.score-item.fail .score-dot { background: var(--warn); }
.score-item.warn .score-dot { background: var(--mid); }
.score-item.info .score-dot { background: var(--accent-text); }
.score-item-label { font-weight: 600; color: var(--text); }
.score-item-tip { color: var(--text-dim); line-height: 1.45; margin-top: 1px; }

.score-clean { padding: 0 16px 12px; font-size: 12px; color: var(--ok-text); }

.editor-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px 60px;
  scrollbar-width: thin;
  scrollbar-color: oklch(0.4 0.015 255) transparent;
}

/* Bölümler: kutu yerine ince ayraçlı düz liste */

.ed-section { border-bottom: 1px solid var(--line); }
.ed-section:last-of-type { border-bottom: none; }

.ed-section > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 8px;
  border-radius: var(--r-md);
  user-select: none;
  transition: background var(--t-fast) var(--ease);
}
.ed-section > summary::-webkit-details-marker { display: none; }
.ed-section > summary:hover { background: var(--bg-raise); }

.ed-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-faint);
  min-width: 20px;
  transition: color var(--t-fast) var(--ease);
}
.ed-section[open] .ed-num { color: var(--accent-text); }

.ed-title { font-size: 13.5px; font-weight: 600; flex: 1; letter-spacing: -0.005em; }

.ed-chevron {
  color: var(--text-faint);
  transition: transform var(--t-med) var(--ease);
  flex: 0 0 auto;
}
.ed-section[open] .ed-chevron { transform: rotate(180deg); }

.sec-tools { display: flex; gap: 2px; flex: 0 0 auto; }

.ed-body { padding: 2px 8px 18px 40px; }

.ed-hint {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.55;
  margin: 2px 0 12px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--bg-raise);
}
.ed-hint b { color: var(--text); font-weight: 600; }

/* Form alanları */

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.field label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="url"],
.field textarea,
.field select {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text);
  background: var(--bg-field);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  outline: none;
  width: 100%;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.field textarea { resize: vertical; min-height: 72px; line-height: 1.5; }
.field select { cursor: pointer; }
.field select option { background: var(--bg-panel); }

.field input:hover, .field textarea:hover, .field select:hover { border-color: var(--line-strong); }

.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field input::placeholder, .field textarea::placeholder { color: oklch(0.5 0.015 255); }

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-dim);
  cursor: pointer;
  margin-bottom: 10px;
}
.check-line input { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }
.check-line:hover { color: var(--text); }

/* Tekrarlanabilir öğe kartları */

.item-card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 12px 4px;
  margin-bottom: 10px;
  background: var(--bg-raise);
}

.item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.item-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.item-tools { display: flex; gap: 3px; }

.icon-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 12px;
  line-height: 1;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.icon-btn:hover { color: var(--text); background: var(--bg-raise-2); }
.icon-btn.del:hover { color: oklch(0.78 0.12 28); background: oklch(0.56 0.18 28 / 0.12); }
.icon-btn:disabled { opacity: 0.3; cursor: default; }
.icon-btn:disabled:hover { color: var(--text-faint); background: transparent; }

.add-btn {
  width: 100%;
  padding: 9px;
  border-radius: var(--r-sm);
  border: 1px dashed var(--line-strong);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease);
}
.add-btn:hover {
  color: var(--accent-text);
  border-color: oklch(0.58 0.18 255 / 0.55);
  background: var(--accent-soft);
}

/* Fotoğraf yükleme */

.photo-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }

.photo-thumb {
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg-field);
  object-fit: cover;
  display: grid;
  place-items: center;
  color: var(--text-faint);
  font-size: 18px;
  overflow: hidden;
  flex: 0 0 auto;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }

.photo-actions { display: flex; flex-direction: column; gap: 6px; }

.mini-btn {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 550;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease);
}
.mini-btn:hover { color: var(--text); border-color: var(--line-strong); background: var(--bg-raise); }

/* ---------------- Önizleme Alt Bilgi (Geliştirici & Gizlilik) ---------------- */

.tool-divider {
  width: 1px;
  height: 16px;
  background: var(--canvas-line);
  margin: 0 4px;
}
.pf-tip {
  display: flex;
  align-items: center;
  color: var(--canvas-text-dim);
  cursor: help;
  transition: color var(--t-fast) var(--ease);
}
.pf-tip:hover { color: var(--canvas-text); }
.pf-sof {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.pf-sof:hover { opacity: 0.8; transform: scale(1.03); }
.pf-sof img {
  height: 18px;
  width: auto;
  opacity: 0.9;
}

/* ---------------- Önizleme Paneli ---------------- */

.preview-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background-color: var(--canvas);
  background-image: radial-gradient(var(--canvas-dot) 1px, transparent 1px);
  background-size: 22px 22px;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 9px 18px;
  background: var(--canvas-panel);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--canvas-line);
  color: var(--canvas-text);
}

.tool-group { display: flex; align-items: center; gap: 8px; }
.tool-group-right { margin-left: auto; }

.tool-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--canvas-text-dim);
}

.segmented {
  display: flex;
  background: oklch(0.895 0.006 255);
  border-radius: var(--r-sm);
  padding: 2px;
  gap: 2px;
}
.segmented button {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 550;
  padding: 4px 11px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--canvas-text-dim);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.segmented button:hover { color: var(--canvas-text); }
.segmented button.active {
  background: var(--canvas-white);
  color: var(--canvas-text);
  box-shadow: 0 1px 2px oklch(0.2 0.02 255 / 0.14);
}

.swatches { display: flex; gap: 6px; }

.swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--c);
  border: 2px solid var(--canvas-white);
  outline: 1px solid var(--canvas-line);
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease), outline-color var(--t-fast) var(--ease);
}
.swatch:hover { transform: scale(1.1); }
.swatch.active { outline: 2px solid var(--accent); outline-offset: 1px; }

.tool-select {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 550;
  color: var(--canvas-text);
  background: var(--canvas-white);
  border: 1px solid var(--canvas-line);
  border-radius: var(--r-sm);
  padding: 4px 7px;
  cursor: pointer;
  outline: none;
  transition: border-color var(--t-fast) var(--ease);
}
.tool-select:hover { border-color: oklch(0.72 0.01 255); }
.tool-select:focus-visible { border-color: var(--accent); }

.page-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--canvas-white);
  border: 1px solid var(--canvas-line);
  color: var(--canvas-text);
  white-space: nowrap;
}
.page-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
}
.page-badge.warn { color: var(--warn); border-color: oklch(0.56 0.18 28 / 0.35); }
.page-badge.warn::before { background: var(--warn); }

.preview-scroll {
  flex: 1;
  overflow: auto;
  padding: 36px;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: oklch(0.72 0.01 255) transparent;
}

.sheet-wrap { margin: 0 auto; position: relative; }

.sheet-scaler { transform-origin: top left; position: relative; }

.sheet-scaler .cv-doc {
  box-shadow:
    0 0 0 1px var(--canvas-line),
    0 2px 8px oklch(0.2 0.02 255 / 0.07),
    0 24px 56px -16px oklch(0.2 0.02 255 / 0.28);
  border-radius: 3px;
}

/* Sayfa sonu kılavuz çizgileri */

.page-guides { position: absolute; inset: 0; pointer-events: none; }

.page-guide {
  position: absolute;
  left: -10px;
  right: -10px;
  border-top: 1px dashed oklch(0.56 0.18 28 / 0.6);
}
.page-guide span {
  position: absolute;
  right: 0;
  top: -21px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--warn);
  background: var(--canvas-white);
  border: 1px solid oklch(0.56 0.18 28 / 0.3);
  padding: 2px 7px;
  border-radius: 5px;
}

/* ---------------- Mobil Bileşenler (varsayılan gizli) ---------------- */

.m-topbar, .m-nav, .m-menu, .m-sheet { display: none; }

/* ---------------- Orta Ekran (tablet: 720px - 1080px) ---------------- */

@media (min-width: 721px) and (max-width: 1080px) {
  body { overflow: auto; }
  .app { height: auto; }
  .workspace { grid-template-columns: 1fr; }
  .editor-pane { border-right: none; border-bottom: 1px solid var(--line); }
  .editor-scroll { max-height: 58vh; padding-bottom: 24px; }
  .preview-scroll { padding: 20px 12px; }
  .topbar { height: auto; padding: 10px 14px; flex-wrap: wrap; }
}

/* ============================================================
   MOBİL (≤ 720px): Tamamen yerli deneyim
   Alt sekme navigasyonu + 4 tam ekran görünüm + bottom sheet
   ============================================================ */

@media (max-width: 720px) {
  body { overflow: hidden; font-size: 15px; }

  /* Mobil kabuk: üst çubuk ve alt navigasyon her zaman görünsün diye
     position: fixed. Aradaki çalışma alanı padding ile boşluklandırılır. */
  :root { --m-topbar-h: 54px; --m-nav-h: 60px; }

  .app { height: 100vh; height: 100dvh; display: block; }

  /* Masaüstü kabuğunun bir kısmını gizle */
  .topbar { display: none; }
  .preview-toolbar { display: none; }
  .page-badge { display: none; }
  /* mobilde SoF kartı menüde */
  /* score/job panelleri "editor" modunda gizli, "score" modunda görünür */
  .score-panel, .job-panel { display: none; }
  :root[data-mview="score"] .score-panel,
  :root[data-mview="score"] .job-panel { display: block; }

  /* Mobil çalışma alanı: viewport'tan üst/alt sabit çubuklar düşülerek
     tam yükseklik verilir. İçindeki görünümler mobil sürücüsüyle değişir. */
  .workspace {
    grid-template-columns: 1fr;
    position: fixed;
    top: var(--m-topbar-h);
    left: 0;
    right: 0;
    bottom: var(--m-nav-h);
    overflow: hidden;
    display: block;
  }

  /* ---- Mobil üst çubuk (fixed) ---- */
  .m-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-app);
    border-bottom: 1px solid var(--line);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--m-topbar-h);
    z-index: 15;
  }
  .m-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .m-logo {
    width: 32px;
    height: 32px;
    border-radius: var(--r-sm);
    background: oklch(0.97 0.004 255);
    padding: 3px;
    flex: 0 0 auto;
  }
  .m-profile-chip {
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    background: var(--bg-field);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    max-width: 55vw;
    overflow: hidden;
  }
  .m-profile-chip span {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 40vw;
  }
  .m-pdf-btn {
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    border-radius: var(--r-sm);
    padding: 9px 14px;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 2px 8px oklch(0.58 0.18 255 / 0.35);
  }
  .m-pdf-btn:active { transform: scale(0.97); }

  /* ---- Görünüm sürücüsü ---- */
  :root[data-mview="editor"]  .editor-pane { display: flex; }
  :root[data-mview="preview"] .preview-pane { display: flex; }

  .editor-pane, .preview-pane { display: none; }
  .editor-pane {
    border-right: none;
    border-bottom: none;
    height: 100%;
  }
  .preview-pane {
    height: 100%;
    background-color: oklch(0.925 0.004 255);
    background-image: none;
  }
  .preview-scroll { padding: 18px 12px 20px; }

  /* Editör mobil ergonomisi */
  .editor-scroll { padding: 12px 14px 24px; max-height: none; }
  .ed-section > summary { padding: 15px 6px; min-height: 52px; }
  .ed-title { font-size: 15px; }
  .ed-num { font-size: 12px; min-width: 22px; }
  .ed-body { padding: 4px 4px 20px 32px; }
  .ed-hint { font-size: 13px; padding: 10px 12px; }
  .field { margin-bottom: 14px; }
  .field label { font-size: 11px; }
  .field input, .field textarea, .field select {
    font-size: 16px !important;  /* iOS zoom engellemek için */
    padding: 11px 12px;
    min-height: 44px;
  }
  .field textarea { min-height: 100px; }
  .field-row { grid-template-columns: 1fr; gap: 8px; }
  .item-card { padding: 14px 14px 6px; margin-bottom: 14px; }
  .icon-btn { width: 34px; height: 34px; font-size: 15px; }
  .check-line { min-height: 40px; font-size: 14px; }
  .check-line input { width: 20px; height: 20px; }
  .add-btn { padding: 13px; font-size: 14px; }
  .sec-tools { display: none; }  /* mobilde bölüm sırasını sürükleme yerine menüde yönetiriz */

  /* Fotoğraf satırı */
  .photo-row { gap: 14px; }
  .photo-thumb { width: 60px; height: 60px; }
  .mini-btn { padding: 8px 12px; font-size: 13px; min-height: 36px; }

  /* Önizleme mobilde daha yüksek çözünürlük hissi */
  .sheet-scaler .cv-doc {
    box-shadow: 0 4px 20px oklch(0.2 0.02 255 / 0.15);
  }

  /* ---- ATS Puanı görünümü ---- */

  :root[data-mview="score"] .editor-pane { display: flex; }
  :root[data-mview="score"] .editor-scroll { display: none; }
  :root[data-mview="score"] .score-panel { border-bottom: 1px solid var(--line); }
  :root[data-mview="score"] .score-details > summary,
  :root[data-mview="score"] .job-details > summary {
    padding: 16px 14px;
    min-height: 60px;
  }
  :root[data-mview="score"] .score-list {
    max-height: none;
    padding: 10px 14px 18px;
  }
  :root[data-mview="score"] .job-body { padding: 0 14px 16px; }
  :root[data-mview="score"] .job-textarea { min-height: 130px; font-size: 15px; }
  :root[data-mview="score"] .score-item,
  :root[data-mview="score"] .score-item-tip { font-size: 13px; }

  /* ---- Mobil menü görünümü ---- */

  :root[data-mview="menu"] .m-menu { display: block; }
  .m-menu {
    position: absolute;
    inset: 0;
    background: var(--bg-app);
    z-index: 4;
    overflow: hidden;
  }
  .m-menu-scroll { height: 100%; overflow-y: auto; padding: 12px 0 24px; }

  .m-menu-group {
    margin-bottom: 20px;
    padding: 0 14px;
  }
  .m-menu-h {
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-faint);
    padding: 6px 4px 10px;
  }

  .m-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: var(--bg-raise);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 14.5px;
    font-weight: 500;
    padding: 14px 16px;
    margin-bottom: 6px;
    cursor: pointer;
    text-align: left;
    min-height: 52px;
    transition: background var(--t-fast) var(--ease);
  }
  .m-menu-item:active { background: var(--bg-raise-2); }
  .m-menu-item.accent { color: var(--accent-text); border-color: oklch(0.58 0.18 255 / 0.4); }
  .m-menu-item.danger { color: oklch(0.78 0.12 28); border-color: oklch(0.56 0.18 28 / 0.35); }

  .m-menu-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-raise);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    margin-bottom: 6px;
    font-size: 14px;
    min-height: 52px;
  }
  .m-menu-row > span:first-child { color: var(--text); font-weight: 500; }

  .m-tabs, .m-seg {
    display: flex;
    background: var(--bg-field);
    border-radius: var(--r-sm);
    padding: 3px;
    gap: 2px;
  }
  .m-tabs { width: 100%; }
  .m-tabs button, .m-seg button {
    flex: 1;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    min-height: 36px;
  }
  .m-tabs button.active, .m-seg button.active {
    background: var(--accent);
    color: var(--on-accent);
  }
  .m-seg { padding: 3px; }
  .m-seg button { padding: 6px 12px; min-height: 32px; }

  .m-swatches { display: flex; gap: 10px; }
  .m-swatch {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--c);
    border: 2px solid var(--bg-panel);
    outline: 2px solid transparent;
    cursor: pointer;
    padding: 0;
  }
  .m-swatch.active { outline-color: var(--accent); }

  .m-select {
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--text);
    background: var(--bg-field);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 8px 10px;
    min-height: 36px;
    cursor: pointer;
  }
  .m-select option { background: var(--bg-panel); }

  .m-mini-btn {
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    background: var(--bg-field);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 7px 12px;
    min-height: 36px;
    cursor: pointer;
  }

  .m-profiles { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
  .m-profile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-raise);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    min-height: 52px;
    cursor: pointer;
  }
  .m-profile-row.active { border-color: var(--accent); background: var(--accent-soft); }
  .m-profile-row-name { flex: 1; font-size: 14.5px; font-weight: 600; color: var(--text); }
  .m-profile-row-tools { display: flex; gap: 4px; }

  .m-menu-footer { padding: 24px 20px 40px; text-align: center; }
  .m-menu-brand { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 10px; }
  .m-menu-tip {
    font-size: 12px;
    color: var(--text-faint);
    line-height: 1.5;
    margin-bottom: 18px;
  }

  /* Software of Future imzası */
  .m-sof {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--bg-raise);
    color: var(--text-dim);
    text-decoration: none;
    font-size: 11.5px;
    letter-spacing: 0.02em;
    transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
  }
  .m-sof:active { background: var(--bg-raise-2); border-color: var(--line-strong); }
  .m-sof-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-faint);
  }
  .m-sof img { height: 26px; width: auto; opacity: 0.9; }
  .m-sof-url { color: var(--accent-text); font-weight: 600; }

  /* ---- Alt sekme navigasyonu (fixed) ---- */

  .m-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: var(--bg-app);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--m-nav-h);
    z-index: 15;
  }
  .m-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: transparent;
    border: none;
    color: var(--text-faint);
    font-family: var(--font-ui);
    font-size: 10.5px;
    font-weight: 600;
    padding: 8px 4px 10px;
    cursor: pointer;
    min-height: 58px;
    transition: color var(--t-fast) var(--ease);
  }
  .m-nav-item svg { opacity: 0.72; transition: opacity var(--t-fast) var(--ease); }
  .m-nav-item.active { color: var(--accent-text); }
  .m-nav-item.active svg { opacity: 1; }
  .m-nav-item:active { background: var(--bg-raise); }

  /* ---- Bottom sheet (profil listesi) ---- */

  .m-sheet {
    position: fixed;
    inset: 0;
    z-index: 80;
  }
  .m-sheet.show { display: block; }
  .m-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: oklch(0.08 0.01 255 / 0.55);
    opacity: 0;
    transition: opacity var(--t-med) var(--ease);
  }
  .m-sheet.show .m-sheet-backdrop { opacity: 1; }
  .m-sheet-card {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-panel);
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    padding: 8px 0 max(20px, env(safe-area-inset-bottom, 20px));
    transform: translateY(100%);
    transition: transform var(--t-med) var(--ease);
    max-height: 75vh;
    display: flex;
    flex-direction: column;
  }
  .m-sheet.show .m-sheet-card { transform: translateY(0); }
  .m-sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--line-strong);
    border-radius: 2px;
    margin: 6px auto 12px;
    flex: 0 0 auto;
  }
  .m-sheet-title {
    font-size: 15px;
    font-weight: 600;
    padding: 0 20px 12px;
    flex: 0 0 auto;
  }
  .m-sheet-body {
    padding: 4px 14px 8px;
    overflow-y: auto;
  }

  /* ---- Modal pencereleri mobilde tam alan kullansın ---- */
  .modal-card {
    width: 100%;
    max-width: 100%;
    border-radius: 14px;
  }
  .modal-overlay { padding: 14px; align-items: flex-end; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; min-height: 46px; font-size: 14px; }
  .bl-card, .history-card { max-width: 100%; }
  .bl-items { max-height: 50vh; }

  /* Bildirim (toast) alt navigasyon üstünde kalsın */
  .toast { bottom: 82px; }
}

/* ---------------- Kanvas Teması (koyu mod) ---------------- */

/* Kullanıcı tercihi: "auto" (sistem), "light", "dark" */
:root[data-canvas="dark"] {
  --canvas: oklch(0.22 0.015 255);
  --canvas-dot: oklch(0.28 0.015 255);
  --canvas-line: oklch(0.32 0.015 255);
  --canvas-panel: oklch(0.19 0.015 255 / 0.92);
  --canvas-text: oklch(0.86 0.008 255);
  --canvas-text-dim: oklch(0.66 0.012 255);
  --canvas-white: oklch(0.26 0.015 255);
}
@media (prefers-color-scheme: dark) {
  :root[data-canvas="auto"] {
    --canvas: oklch(0.22 0.015 255);
    --canvas-dot: oklch(0.28 0.015 255);
    --canvas-line: oklch(0.32 0.015 255);
    --canvas-panel: oklch(0.19 0.015 255 / 0.92);
    --canvas-text: oklch(0.86 0.008 255);
    --canvas-text-dim: oklch(0.66 0.012 255);
    --canvas-white: oklch(0.26 0.015 255);
  }
}

/* ---------------- Belge Modu Anahtarı ---------------- */

.seg-mode {
  background: var(--bg-field);
  border: 1px solid var(--line);
}
.seg-mode button {
  color: var(--text-dim);
  padding: 5px 14px;
  font-weight: 600;
}
.seg-mode button.active {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: none;
}
.seg-mode button:hover:not(.active) { color: var(--text); }

/* Ön yazı modunda CV-özel kontroller gizlenir */
:root[data-mode="cover"] #tplSeg,
:root[data-mode="cover"] #langSeg,
:root[data-mode="cover"] #accentSwatches,
:root[data-mode="cover"] .tool-group:has(#tplSeg),
:root[data-mode="cover"] .tool-group:has(#langSeg),
:root[data-mode="cover"] .tool-group:has(#accentSwatches),
:root[data-mode="cover"] #btnSample,
:root[data-mode="cover"] #btnImport,
:root[data-mode="cover"] #btnWord {
  display: none;
}

.btn-icon-only {
  padding: 6px 10px;
  font-size: 15px;
  line-height: 1;
}

/* ---------------- İş İlanı Eşleşme Paneli ---------------- */

.job-panel {
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.job-panel:empty { display: none; }

.job-details > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  user-select: none;
  transition: background var(--t-fast) var(--ease);
}
.job-details > summary::-webkit-details-marker { display: none; }
.job-details > summary:hover { background: var(--bg-raise); }
.job-details[open] .ed-chevron { transform: rotate(180deg); }

.job-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  font-size: 15px;
  flex: 0 0 auto;
}

.job-head { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.job-title { font-size: 13px; font-weight: 600; }
.job-sub { font-size: 11.5px; color: var(--text-dim); }

.job-body { padding: 0 16px 14px; display: flex; flex-direction: column; gap: 10px; }

.job-textarea {
  width: 100%;
  min-height: 90px;
  font-family: var(--font-ui);
  font-size: 12.5px;
  color: var(--text);
  background: var(--bg-field);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  outline: none;
  resize: vertical;
  line-height: 1.5;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.job-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.job-textarea::placeholder { color: oklch(0.5 0.015 255); }

.job-cols { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 500px) { .job-cols { grid-template-columns: 1fr 1fr; } }

.job-col-h {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.job-col-h.ok { color: var(--ok-text); }
.job-col-h.miss { color: var(--warn); }

.job-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.job-chip {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-raise);
  color: var(--text-dim);
}
.job-chip.ok { color: var(--ok-text); border-color: oklch(0.62 0.14 155 / 0.35); background: oklch(0.62 0.14 155 / 0.08); }
.job-chip.miss { color: var(--warn); border-color: oklch(0.56 0.18 28 / 0.35); background: oklch(0.56 0.18 28 / 0.08); }

.job-empty { font-size: 11.5px; color: var(--text-faint); padding: 4px 0; }

.job-tip { font-size: 11.5px; color: var(--text-dim); line-height: 1.5; padding-top: 4px; border-top: 1px dashed var(--line); }

/* ---------------- Madde Etiket Satırı ---------------- */

.bullet-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bullet-label-row label { flex: 1; }

/* ---------------- Madde Kütüphanesi Modal ---------------- */

.bl-card { width: min(640px, 100%); }

.bl-body { margin-top: 12px; }

.bl-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: var(--bg-field);
  border-radius: var(--r-sm);
  margin-bottom: 12px;
}
.bl-tab {
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.bl-tab:hover { color: var(--text); }
.bl-tab.active { background: var(--accent); color: var(--on-accent); }

.bl-items { display: flex; flex-direction: column; gap: 6px; max-height: 44vh; overflow-y: auto; }
.bl-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.bl-item:hover { background: var(--bg-raise); border-color: var(--line-strong); }
.bl-item input { accent-color: var(--accent); width: 15px; height: 15px; margin-top: 2px; flex: 0 0 auto; cursor: pointer; }
.bl-item span { flex: 1; line-height: 1.5; }

/* ---------------- Geçmiş Penceresi ---------------- */

.history-card { width: min(520px, 100%); }

.history-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 50vh;
  overflow-y: auto;
}
.history-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg-raise);
}
.history-meta { font-size: 12px; color: var(--text); grid-column: 1 / 2; }
.history-preview { font-size: 11.5px; color: var(--text-dim); grid-column: 1 / 2; }
.history-item .mini-btn { grid-column: 2; grid-row: 1 / 3; }

/* ---------------- Modal Pencereler ---------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: oklch(0.08 0.01 255 / 0.55);
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  transition: opacity var(--t-med) var(--ease);
}
.modal-overlay.show { opacity: 1; }

.modal-card {
  width: min(420px, 100%);
  background: var(--bg-panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: 0 20px 60px oklch(0 0 0 / 0.5);
  transform: translateY(8px) scale(0.985);
  transition: transform var(--t-med) var(--ease);
}
.modal-overlay.show .modal-card { transform: none; }

.modal-title { font-size: 14.5px; font-weight: 650; margin-bottom: 6px; }

.modal-msg { font-size: 13px; color: var(--text-dim); line-height: 1.55; }

.modal-input {
  margin-top: 12px;
  width: 100%;
  font-family: var(--font-ui);
  font-size: 13.5px;
  color: var(--text);
  background: var(--bg-field);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 9px 11px;
  outline: none;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.modal-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.btn-danger-solid {
  background: var(--warn);
  color: oklch(0.97 0.01 28);
  font-weight: 600;
  border-color: transparent;
}
.btn-danger-solid:hover { background: oklch(0.61 0.19 28); }
.btn-danger-solid:active { background: oklch(0.52 0.17 28); }

/* ---------------- Bildirim ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 12px);
  max-width: min(480px, calc(100vw - 40px));
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 10px 16px;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 8px 30px oklch(0 0 0 / 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease);
  z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: oklch(0.56 0.18 28 / 0.55); color: oklch(0.85 0.06 28); }

/* ---------------- Hareket azaltma ---------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
}

/* ---------------- Yazdırma ---------------- */

.print-area { display: none; }

@media print {
  body { overflow: visible; background: #fff; }
  .app { display: none !important; }
  .print-area { display: block !important; }
}
