/* Rehber sonucunun çizimi (guide-view.js): gizli önizleme ve herkese açık "Takvimini gör" aracı.
   styles.css'in üzerine eklenir. Önce telefon. */


/* ---------- Form parçaları (profil soruları, tarih, varsayımlar) ---------- */
.field-row { display: grid; gap: 14px; }
input[type="date"], input[type="number"] {
  width: 100%; min-height: 50px; padding: 10px 14px;
  font: inherit; font-size: 1rem; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
}
input[type="date"]:focus-visible, input[type="number"]:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.profile { border-top: 1px solid var(--line); padding-top: 12px; min-width: 0; }
.profile summary {
  cursor: pointer; font-weight: 700; font-size: 1.02rem; min-height: 44px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px;
}
.profile summary .muted { font-weight: 500; font-size: 0.88rem; }
.profile-fields { display: grid; gap: 14px; padding-top: 10px; }
.field-label { font-weight: 600; font-size: 0.95rem; }
.yesno { display: inline-flex; gap: 6px; }
.yesno button {
  min-height: 44px; min-width: 76px; padding: 8px 16px;
  font: inherit; font-weight: 600; color: var(--ink-2);
  background: #fff; border: 1.5px solid var(--line-strong); border-radius: 10px; cursor: pointer;
}
.yesno button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- Sonuç ---------- */
.result { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; transition: opacity 0.2s; }
.result.is-loading { opacity: 0.55; }
.guide-head { display: grid; gap: 6px; }
.guide-head h2 { font-size: 1.35rem; }
.guide-head p { color: var(--ink-2); }
.badge { justify-self: start; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em; padding: 4px 10px; border-radius: 999px; }
.badge-draft { background: var(--accent-soft); color: #7a4b05; border: 1px solid #f1d49d; }
.badge-ok { background: #e4f3ea; color: var(--success); border: 1px solid #b9dfc8; }
.badge-checked { background: #e7f0fb; color: #1d4f8a; border: 1px solid #bcd3ee; }
.status-text { margin: 0; color: var(--ink-2); }
.summary-from-today { margin: 6px 0 0; font-size: 0.9rem; }
.check-ok { font-size: 0.9rem; color: var(--success); font-weight: 500; }
.alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 0.92rem; display: grid; gap: 6px; overflow-wrap: anywhere; }
.alert ul { margin: 0; padding-left: 1.2em; }
.alert-error { background: var(--danger-soft); border: 1px solid #f3c3bd; color: #7a1a12; }
.alert-warn { background: var(--accent-soft); border: 1px solid #f1d49d; color: #5c3b00; }


.summary-card {
  display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start;
  padding: 16px; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--brand);
  border-radius: var(--radius);
}
.summary-card.is-late { border-left-color: var(--danger); background: #fffafa; }
.countdown { display: grid; justify-items: center; min-width: 72px; padding: 8px 6px; background: var(--tint); border-radius: 12px; }
.summary-card.is-late .countdown { background: var(--danger-soft); }
.countdown-num { font-size: 1.8rem; font-weight: 750; line-height: 1.1; }
.countdown-label { font-size: 0.78rem; color: var(--ink-2); }
.summary-body { display: grid; gap: 6px; min-width: 0; }
.summary-anchor { font-weight: 650; }
.summary-text { color: var(--ink-2); font-size: 0.95rem; }
.summary-counts { font-size: 0.85rem; color: var(--muted); }
.late-list { margin: 0; padding-left: 1.1em; font-size: 0.9rem; color: #7a1a12; display: grid; gap: 4px; }

.preview-section { display: grid; gap: 10px; scroll-margin-top: 120px; }
.preview-section > h2 { font-size: 1.25rem; }
.preview-section h3 { font-size: 1.02rem; margin-top: 6px; }

/* Takvim */
.tl { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; position: relative; }
.tl-item { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; }
.tl-item:not(:last-child)::before {
  content: ""; position: absolute; left: 10px; top: 26px; bottom: -14px; width: 2px; background: var(--line);
}
.tl-marker {
  position: relative; z-index: 1; margin-top: 18px;
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); background: #fff;
}
.state-do_now .tl-marker { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.state-done .tl-marker { background: var(--success); border-color: var(--success); }
.state-passed .tl-marker { border-color: var(--danger); }
.is-milestone .tl-marker { border-style: dashed; }
.tl-anchor .tl-marker { background: var(--brand); border-color: var(--brand); }
.tl-card {
  display: grid; gap: 6px; min-width: 0;
  padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.is-late .tl-card { border-color: #f3c3bd; box-shadow: inset 4px 0 0 var(--danger); }
.state-done .tl-card { opacity: 0.75; }
.tl-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.state-badge { font-size: 0.75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--bg); color: var(--ink-2); border: 1px solid var(--line); }
.state-do_now .state-badge { background: var(--accent-soft); color: #7a4b05; border-color: #f1d49d; }
.state-passed .state-badge { background: var(--danger-soft); color: #7a1a12; border-color: #f3c3bd; }
.state-done .state-badge { background: #e4f3ea; color: var(--success); border-color: #b9dfc8; }
.mini-tag { font-size: 0.72rem; font-weight: 600; color: var(--muted); padding: 2px 8px; border: 1px dashed var(--line-strong); border-radius: 999px; }
.tl-card h3 { font-size: 1.02rem; margin: 0; }
.tl-key { font-size: 0.93rem; color: var(--ink); }
.tl-late { font-size: 0.9rem; color: #7a1a12; font-weight: 600; }
.tl-window { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; font-size: 0.86rem; }
.tl-window dt { color: var(--muted); }
.tl-window dd { margin: 0; color: var(--ink-2); }
.tl-details summary { cursor: pointer; font-size: 0.9rem; font-weight: 600; color: var(--brand); min-height: 32px; display: flex; align-items: center; }
.tl-details[open] { display: grid; gap: 8px; font-size: 0.92rem; color: var(--ink-2); }
.tl-details ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
.window-notes { color: var(--muted); }
.done-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-size: 0.9rem; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.done-toggle input { width: 20px; height: 20px; accent-color: var(--success); }

/* Belgeler, ücretler, yerler, notlar */
.doc-list, .cost-list, .place-list, .note-list, .source-list, .question-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.question-list { list-style: decimal; padding-left: 1.3em; }
.doc, .cost, .place, .note-list > li, .source-list > li {
  display: grid; gap: 6px; min-width: 0;
  padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow-wrap: anywhere;
}
.doc h3 { margin: 0; }
.doc ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; font-size: 0.93rem; color: var(--ink-2); }
.doc-label { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.doc-label-warn { color: #8a5a10; }
.warn-list li::marker { color: var(--accent); }
.cost-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: space-between; }
.cost-label { font-weight: 650; }
.cost-amount { font-size: 1.05rem; font-weight: 650; }
.cost-total { font-weight: 650; padding: 10px 14px; background: var(--tint); border-radius: var(--radius-sm); }
.place-name { font-weight: 650; }
.question-list li { padding: 4px 0 8px 4px; }
.question-text { font-weight: 600; }
.sources { font-size: 0.82rem; color: var(--muted); overflow-wrap: anywhere; }
.sources a { color: var(--brand); }

/* "Bilmiyorum" açıklaması ve varsayımlar */
.yesno { flex-wrap: wrap; }
.answer-explain {
  display: grid; gap: 4px; padding: 10px 12px; font-size: 0.9rem; color: var(--ink-2);
  background: var(--tint); border: 1px solid #c5dedb; border-radius: var(--radius-sm);
}
.answer-explain p { margin: 0; }
.assumptions .field-hint { margin: 0; }
.assumption { padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
.assumption-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; justify-content: space-between; }
.assumption-head label { font-weight: 600; font-size: 0.95rem; }
.with-unit { display: flex; align-items: center; gap: 8px; }
.with-unit input { max-width: 120px; }
.unit { color: var(--ink-2); font-size: 0.95rem; }
.basis { font-size: 0.72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.basis-official { color: var(--brand); background: var(--brand-soft); border-color: #c5dedb; }
.basis-experience { color: #6b3fa0; background: #f3ecfb; border-color: #ddcdf2; }
.basis-unknown { color: #7a4b05; background: var(--accent-soft); border-color: #f1d49d; }
.basis-choice { color: var(--ink-2); background: var(--bg); border-color: var(--line-strong); border-style: dashed; }

/* Özet: güvenlik payı */
.summary-card.is-tight { border-left-color: var(--accent); }
.summary-card.is-tight .countdown { background: var(--accent-soft); }
.tight-list { color: #6b4300; }
.summary-margin { font-size: 0.85rem; color: var(--muted); }
.inline-link { color: var(--brand); font-weight: 600; }
.is-tight .tl-card { box-shadow: inset 4px 0 0 var(--accent); }
.tag-tight { color: #7a4b05; border-color: #f1d49d; border-style: solid; background: var(--accent-soft); }

/* Sorular: adımların ve belgelerin altında, kapalı */
.qa { border-top: 1px solid var(--line); padding-top: 4px; }
.qa > summary {
  cursor: pointer; min-height: 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px;
  font-size: 0.9rem; font-weight: 650; color: var(--brand);
}
.qa-waiting-count { font-weight: 500; color: var(--muted); }
.qa-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.q > details { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.q > details > summary {
  cursor: pointer; padding: 10px 12px; min-height: 44px; font-size: 0.92rem; font-weight: 600; color: var(--ink);
  list-style-position: inside;
}
.q.is-unanswered > details > summary::after { content: " · resmi kaynaklarda yok"; font-weight: 500; color: var(--muted); font-size: 0.82rem; }
.q.is-community > details > summary::after { content: " · başvuranların paylaştıkları var"; font-weight: 500; color: #5b2f91; font-size: 0.82rem; }
.q-body { display: grid; gap: 10px; padding: 0 12px 12px; font-size: 0.92rem; color: var(--ink-2); }
.q-body p { margin: 0; }
.q-official { display: grid; gap: 8px; }
.q-answer { display: grid; gap: 2px; }
.q-label { font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--brand); }
.q-gap { display: grid; gap: 4px; padding: 10px 12px; font-size: 0.88rem; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.status-community { color: #5b2f91; border-color: #c9b3ea; border-style: solid; }
.status-unanswered { color: var(--muted); }

/* Başvuranların paylaştıkları (2. katman): kurallardan görsel olarak ayrı */
.experience-block {
  display: grid; gap: 8px; padding: 12px; margin-top: 2px;
  background: #faf6ff; border: 1.5px dashed #c9b3ea; border-radius: var(--radius-sm);
}
.experience-title { font-size: 0.78rem; font-weight: 750; color: #5b2f91; letter-spacing: 0.02em; }
.experience-note { margin: 0; display: grid; gap: 2px; }
.experience-note blockquote { margin: 0; padding-left: 10px; border-left: 3px solid #c9b3ea; color: var(--ink); }
.experience-note figcaption { font-size: 0.8rem; color: var(--muted); }

/* Bazı kişiler için ek adımlar / belgeler: tek sessiz satır */
.extras { border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: transparent; }
.extras > summary {
  cursor: pointer; padding: 10px 12px; min-height: 44px; display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px;
  font-size: 0.9rem; font-weight: 600; color: var(--ink-2);
}
.extras-unsure { color: #7a4b05; font-weight: 600; }
.extras-list { list-style: none; margin: 0; padding: 0 12px 12px; display: grid; gap: 10px; }
.extra { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 0.92rem; }
.extra p { margin: 0; }
.extra-title { font-weight: 650; color: var(--ink); }
.extra-who, .extra-when { color: var(--ink-2); }
.btn-link {
  justify-self: start; min-height: 40px; padding: 6px 0; font: inherit; font-size: 0.9rem; font-weight: 600;
  color: var(--brand); background: none; border: 0; cursor: pointer; text-decoration: underline;
}

/* Form rehberi */
.form-sections { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: form; }
.form-section {
  display: grid; gap: 6px; min-width: 0; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  counter-increment: form;
}
.form-section h3 { margin: 0; }
.form-section h3::before { content: counter(form) ". "; color: var(--muted); }
.form-section ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; font-size: 0.93rem; color: var(--ink-2); }
.question-text .mini-tag { margin-left: 6px; }

/* ---------- Katmanlı rehber (ör. Schengen + ülke) ---------- */
.layer-line { font-size: 0.92rem; color: var(--ink-2); }
.tag-layer { color: var(--brand); border: 1px solid #c5dedb; background: var(--brand-soft); justify-self: start; }
.tag-layer.is-changed { border-style: dashed; background: transparent; }
.doc > .tag-layer, .form-section > .tag-layer { display: inline-block; margin-bottom: 2px; }

@media (min-width: 560px) {
  .field-row { grid-template-columns: 1fr 1fr; }
}


/* Özet parçaları, öne çıkan adım, kapalı günler */
.summary-headline { font-weight: 650; color: var(--ink); }
.summary-basis { display: grid; gap: 4px; font-size: 0.92rem; color: var(--ink-2); }
.summary-basis ul { margin: 0; padding-left: 1.2em; display: grid; gap: 2px; }
.tl-summary { font-size: 0.95rem; color: var(--ink); }
.tl-closed { margin: 0; padding-left: 1.2em; font-size: 0.86rem; color: #6b4300; display: grid; gap: 2px; }
.lead-step { display: grid; gap: 6px; }
.lead-step > .tl-card { border: 2px solid var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.lead-kicker { font-size: 0.78rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.05em; color: #8a5a10; }
.closures { border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); }
.closures > summary { cursor: pointer; padding: 10px 12px; min-height: 44px; display: flex; align-items: center; font-size: 0.9rem; font-weight: 600; color: var(--ink-2); }
.closures-body { display: grid; gap: 8px; padding: 0 12px 12px; font-size: 0.88rem; color: var(--ink-2); }
.closures-body ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }

/* Bilgilendirme kutusu ve kapalı başlayan bölümler (herkese açık araçta yerler, notlar, sorular, kaynaklar) */
.notice {
  padding: 12px 14px;
  background: var(--brand-soft); border: 1px solid #c5dedb; border-radius: var(--radius-sm);
  font-size: 0.92rem; color: var(--ink);
}
.preview-section.is-collapsible { border-top: 1px solid var(--line); padding-top: 4px; }
.preview-section.is-collapsible > summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; gap: 8px; }
.preview-section.is-collapsible > summary h2 { font-size: 1.12rem; display: inline; }
.preview-section.is-collapsible[open] { gap: 10px; }
/* Öne çıkan adım bir takvim satırı değil, sonucun başında ayrı bir kutu */
.lead-step.tl-item { grid-template-columns: minmax(0, 1fr); }
.lead-step.tl-item::before { display: none; }
