:root {
  --kagit: #f4e8cf;
  --kagit2: #ead8b3;
  --kagit3: #dfc795;
  --murekkep: #33251a;
  --kahve: #5b4128;
  --kahve2: #7a5a39;
  --amber: #c27d22;
  --lacivert: #22365a;
  --cizgi: rgba(91, 65, 40, .18);
  --kirmizi: #a3361d;
  --golge: 0 1px 0 rgba(255,255,255,.6) inset, 0 6px 18px rgba(60, 40, 20, .12);
  --el: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --yazi: "Lora", Georgia, "Times New Roman", serif;
}
html { font-size: 20px; -webkit-text-size-adjust: 100%; }
html[data-yazi="1"] { font-size: 18px; }
html[data-yazi="2"] { font-size: 20px; }
html[data-yazi="3"] { font-size: 24px; }
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--kagit2);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(255,250,235,.7), transparent 60%),
    radial-gradient(ellipse at 100% 100%, rgba(150,105,55,.18), transparent 55%);
  background-attachment: fixed;
  color: var(--murekkep);
  font-family: var(--yazi);
  line-height: 1.55;
  min-height: 100vh;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
p { margin: 0 0 .8em; }
a { color: var(--lacivert); }
button, input, textarea { font: inherit; color: inherit; }
.el { font-family: var(--el); font-weight: 600; color: var(--kahve2); font-size: 1.5rem; line-height: 1.1; margin: 0 0 .2em; }
.kucuk { font-size: .82rem; color: var(--kahve2); }
.gizli { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* Üst şerit */
.ekran-ust {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 760px; margin: 0 auto; padding: 14px 16px 4px;
}
.logo { font-family: var(--el); font-weight: 600; font-size: 1.6rem; color: var(--kahve); text-decoration: none; }
.boyut { display: flex; align-items: center; gap: 4px; font-size: .8rem; color: var(--kahve2); }
.boyut button {
  border: 1.5px solid var(--kahve2); background: transparent; border-radius: 8px; cursor: pointer;
  width: 2.1em; height: 2.1em; padding: 0; color: var(--kahve); font-weight: 600; line-height: 1;
}
.boyut button:nth-of-type(1) { font-size: .75rem; }
.boyut button:nth-of-type(2) { font-size: .95rem; }
.boyut button:nth-of-type(3) { font-size: 1.15rem; }
.boyut button[aria-pressed="true"] { background: var(--kahve); color: var(--kagit); }

main { max-width: 760px; margin: 0 auto; padding: 8px 16px 64px; }

/* Kutular */
.kutu, .defter-ust, .kapak-giris {
  background: var(--kagit);
  border-radius: 6px;
  box-shadow: var(--golge);
  padding: 22px 20px;
  margin: 16px 0;
  position: relative;
}
.kutu-ince { padding: 12px 16px; margin: 12px 0; border-radius: 6px; }

/* Düğmeler */
button { cursor: pointer; }
.birincil, .ikincil, .tehlike, .tehlike-ince {
  border-radius: 12px; padding: .7em 1.1em; font-weight: 600; border: 2px solid transparent;
  min-height: 52px; touch-action: manipulation; transition: transform .06s, background .15s;
}
.birincil { background: var(--kahve); color: #fff8ea; border-color: var(--kahve); }
.birincil:hover { background: #4a3420; }
.ikincil { background: transparent; color: var(--kahve); border-color: var(--kahve2); }
.ikincil:hover { background: rgba(122, 90, 57, .08); }
.tehlike { background: var(--kirmizi); color: #fff; }
.tehlike-ince { background: transparent; color: var(--kirmizi); border-color: rgba(163, 54, 29, .4); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.buyuk-dugme { width: 100%; font-size: 1.1rem; min-height: 60px; }
.genis { width: 100%; margin-top: 14px; }
.dugmeler { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.dugmeler.dikey { flex-direction: column; }
.baglanti { background: none; border: 0; padding: 0; color: var(--lacivert); text-decoration: underline; font-weight: 600; }
.geri { background: none; border: 0; padding: 6px 0; color: var(--kahve2); font-weight: 600; margin-bottom: 6px; min-height: 44px; }

/* Giriş */
.kapak-giris {
  text-align: center; padding: 34px 22px 26px;
  background:
    repeating-linear-gradient(transparent 0 2.1rem, var(--cizgi) 2.1rem calc(2.1rem + 1px)),
    var(--kagit);
  border-left: 10px solid var(--kahve);
}
.kapak-giris h1 { font-family: var(--el); font-size: 3.6rem; color: var(--kahve); margin: 0 0 .25em; font-weight: 600; }
.ust-not { transform: rotate(-2deg); }
.giris-metin { font-size: 1.1rem; max-width: 30em; margin: 0 auto 1.2em; }
.ozellik { list-style: none; padding: 0; margin: 22px auto 0; text-align: left; max-width: 26em; }
.ozellik li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px dashed var(--cizgi); }
.ozellik span { width: 1.6em; flex: none; }

.defter-listesi { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.defter-kart {
  width: 100%; text-align: left; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px;
  background: #fbf3e1; border: 1.5px solid var(--kagit3); border-left: 8px solid var(--amber);
  border-radius: 8px; padding: 14px 16px; min-height: 64px;
}
.dk-ad { font-weight: 600; font-size: 1.1rem; }
.dk-alt { grid-column: 1; font-size: .85rem; color: var(--kahve2); }
.dk-ok { grid-row: 1 / 3; grid-column: 2; align-self: center; font-size: 1.3rem; color: var(--kahve); }

.gizlilik { border-top: 6px solid var(--lacivert); }
.dikkat { background: rgba(194, 125, 34, .14); border-left: 4px solid var(--amber); padding: 10px 12px; border-radius: 4px; }
.hatirlat { background: #fff4d8; border: 1.5px dashed var(--amber); padding: 10px 12px; border-radius: 8px; font-weight: 600; }
.sss ol { padding-left: 1.3em; margin: 0; }
.sss li { margin: .35em 0; }

/* Form */
.form fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.form legend { font-weight: 600; margin-bottom: 8px; font-size: 1.1rem; }
.secimler { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5em, 1fr)); gap: 8px; }
.secim { position: relative; }
.secim input { position: absolute; opacity: 0; inset: 0; }
.secim span {
  display: block; padding: 12px 14px; border: 2px solid var(--kagit3); border-radius: 10px; background: #fbf3e1;
  min-height: 52px; display: flex; align-items: center; cursor: pointer;
}
.secim input:checked + span { border-color: var(--kahve); background: var(--kahve); color: #fff8ea; }
.secim input:focus-visible + span { outline: 3px solid var(--amber); outline-offset: 2px; }
.alan { display: block; font-weight: 600; margin: 0 0 16px; }
.alan input {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px; font-weight: 400;
  border: 2px solid var(--kagit3); border-radius: 10px; background: #fffaf0; min-height: 54px;
}

/* Konular */
.defter-ust { text-align: center; border-left: 10px solid var(--kahve); }
.defter-ust .geri { position: absolute; left: 18px; top: 10px; }
.defter-ust .el { margin-top: 26px; }
.defter-ust h1 { font-size: 2rem; }
.ilerleme-yazi { color: var(--kahve2); }
.konu-izgara { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5em, 1fr)); gap: 10px; }
.konu-izgara.tek { grid-template-columns: 1fr; margin-bottom: 8px; }
.konu-kart {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; gap: 2px 10px; text-align: left;
  background: #fbf3e1; border: 1.5px solid var(--kagit3); border-radius: 10px; padding: 12px 14px; min-height: 84px;
}
.konu-kart:hover { border-color: var(--kahve2); }
.konu-kart .simge { grid-row: 1 / 3; font-size: 1.6rem; line-height: 1; align-self: center; }
.konu-ad { font-weight: 600; }
.konu-sayi { font-size: .8rem; color: var(--kahve2); }
.cubuk { grid-column: 1 / 3; height: 6px; background: var(--kagit3); border-radius: 3px; overflow: hidden; margin-top: 6px; display: block; }
.cubuk i { display: block; height: 100%; background: var(--amber); border-radius: 3px; }
.cubuk.ince { height: 5px; margin: 0 0 14px; }
.hassas-kutu { border: 1.5px dashed var(--kahve2); background: #f6eedd; }
.konu-kart.hassas { background: #f2ece2; }
.etiket { font-size: .7rem; font-weight: 600; background: var(--kagit3); color: var(--kahve); padding: 2px 8px; border-radius: 99px; vertical-align: middle; font-family: var(--yazi); }

/* Soru */
.soru-ust { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.soru-yer { font-size: .85rem; color: var(--kahve2); font-weight: 600; }
.soru-kart {
  background:
    linear-gradient(90deg, transparent 2.2rem, rgba(163, 54, 29, .25) 2.2rem calc(2.2rem + 1.5px), transparent calc(2.2rem + 1.5px)),
    var(--kagit);
  border-radius: 4px; box-shadow: var(--golge); padding: 22px 18px 18px calc(2.2rem + 16px);
  position: relative;
}
.konu-etiket { font-family: var(--el); font-weight: 600; font-size: 1.35rem; color: var(--amber); display: block; transform: rotate(-1.5deg); margin-bottom: 6px; }
.soru-metin { font-size: 1.75rem; font-weight: 600; color: var(--murekkep); margin-bottom: 18px; }
.cevap-alan {
  width: 100%; border: 0; resize: vertical; background-color: transparent; display: block;
  background-image: repeating-linear-gradient(transparent 0 calc(1.7em - 1px), var(--cizgi) calc(1.7em - 1px) 1.7em);
  background-attachment: local;
  line-height: 1.7em; font-size: 1.1rem; padding: 0 2px; min-height: 150px;
  border-bottom: 2px solid var(--kagit3);
}
.cevap-alan:focus { outline: none; border-bottom-color: var(--amber); }
.cevap-alan::placeholder { color: rgba(91, 65, 40, .5); font-style: italic; }
.foto-yer { margin-top: 14px; }
.foto-ekle { min-height: 48px; }
.kayit-satir { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.soru-dugmeler { display: grid; grid-template-columns: 1fr 1fr 1.6fr; gap: 10px; margin-top: 16px; }
.soru-dugmeler .birincil { font-size: 1.1rem; }
.hassas-not { background: #f2ece2; border-left: 4px solid var(--kahve2); padding: 8px 12px; border-radius: 4px; font-size: .9rem; }

/* Fotoğraf köşelikleri */
.kose { position: relative; display: inline-block; margin: 0; padding: 0; max-width: 100%; }
.kose img { display: block; max-width: 100%; max-height: 22rem; border: 8px solid #fffaf0; box-shadow: 0 3px 10px rgba(50, 30, 10, .25); transform: rotate(-.6deg); }
.kose::after {
  content: ""; position: absolute; inset: -5px; pointer-events: none;
  --k: #2d2219;
  background:
    linear-gradient(135deg, var(--k) 50%, transparent 50%) top left / 30px 30px no-repeat,
    linear-gradient(225deg, var(--k) 50%, transparent 50%) top right / 30px 30px no-repeat,
    linear-gradient(45deg, var(--k) 50%, transparent 50%) bottom left / 30px 30px no-repeat,
    linear-gradient(315deg, var(--k) 50%, transparent 50%) bottom right / 30px 30px no-repeat;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.foto figcaption { font-size: .85rem; margin-top: 8px; }

.bitti { text-align: center; }
.buyuk-el { font-size: 2.6rem; color: var(--kahve); }

/* Pencere */
.pencere { position: fixed; inset: 0; background: rgba(40, 26, 14, .55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.pencere-ic { background: var(--kagit); border-radius: 10px; padding: 22px 20px; max-width: 30rem; width: 100%; box-shadow: 0 20px 50px rgba(0,0,0,.35); max-height: 90vh; overflow: auto; }
.pencere-ic textarea { width: 100%; border: 2px solid var(--kagit3); border-radius: 10px; padding: 10px 12px; background: #fffaf0; }
.pencere-ic .dugmeler { justify-content: flex-end; }
.nazik { padding-left: 1.2em; }
.nazik li { margin: .3em 0; }
.bildirim {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 30;
  background: var(--murekkep); color: #fff8ea; padding: 12px 18px; border-radius: 10px; max-width: calc(100% - 32px);
  box-shadow: 0 8px 24px rgba(0,0,0,.3); font-size: .95rem;
}

/* Defter görünümü (ekranda) */
.arac h1 { font-size: 1.5rem; }
.nasil { margin-top: 14px; }
.nasil summary { font-weight: 600; cursor: pointer; color: var(--lacivert); min-height: 44px; display: flex; align-items: center; }
.defter {
  background: #f1e3c4;
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(255,250,235,.55), transparent 70%),
    radial-gradient(ellipse at 0% 100%, rgba(140, 95, 45, .14), transparent 50%);
  border-radius: 4px 10px 10px 4px;
  box-shadow: -8px 0 0 var(--kahve), var(--golge);
  padding: 26px 22px 36px 30px;
  margin: 18px 0 18px 8px;
  font-size: 1rem;
}
.sayfa.kapak {
  min-height: 70vh; display: flex; align-items: center; justify-content: center; text-align: center;
  border-bottom: 2px dashed var(--kagit3); margin-bottom: 26px; padding-bottom: 26px;
}
.kapak-cerceve { border: 2px solid var(--kahve2); outline: 1px solid var(--kahve2); outline-offset: 6px; padding: 36px 26px; width: 100%; max-width: 24rem; }
.kapak-ust { letter-spacing: .25em; text-transform: uppercase; font-size: .85rem; color: var(--kahve2); }
.kapak-cizgi { width: 60px; height: 2px; background: var(--amber); margin: 18px auto; }
.kapak-etiket { font-family: var(--el); font-weight: 600; font-size: 2rem; color: var(--kahve2); margin: 0; }
.kapak-ad { font-family: var(--el); font-weight: 600; font-size: 3.6rem; color: var(--kahve); margin: 0; line-height: 1; overflow-wrap: anywhere; }
.kapak-tarih { font-style: italic; }
.kapak-yazan { font-size: .85rem; color: var(--kahve2); }
.bolum-ad { font-family: var(--el); font-weight: 600; font-size: 2.2rem; color: var(--kahve); text-align: center; margin: 10px 0 18px; }
.bolum-ad span { border-bottom: 3px solid var(--amber); padding: 0 10px; }
.girdi { margin: 0 0 26px; }
.g-soru { font-size: 1.05rem; color: var(--kahve); font-style: italic; margin-bottom: 6px; }
.g-soru::before { content: "— "; color: var(--amber); }
.g-cevap {
  line-height: 1.9em;
  background-image: repeating-linear-gradient(transparent 0 calc(1.9em - 1px), var(--cizgi) calc(1.9em - 1px) 1.9em);
  padding-left: 4px;
}
.g-cevap p { margin: 0; }
.g-cevap p + p { text-indent: 1.4em; }
.g-foto { margin: 14px 0 4px 12px; }
.g-foto img { max-height: 16rem; }
.son-not { text-align: center; color: var(--kahve2); margin-top: 30px; padding-top: 20px; border-top: 1px dashed var(--kagit3); }

@media (max-width: 520px) {
  html[data-yazi="2"] { font-size: 19px; }
  .kapak-giris h1 { font-size: 3rem; }
  .soru-metin { font-size: 1.5rem; }
  .soru-dugmeler { grid-template-columns: 1fr 1fr; }
  .soru-dugmeler .birincil { grid-column: 1 / 3; grid-row: 1; }
  .soru-kart { padding-left: calc(1.2rem + 12px); background: linear-gradient(90deg, transparent 1.2rem, rgba(163, 54, 29, .25) 1.2rem calc(1.2rem + 1.5px), transparent calc(1.2rem + 1.5px)), var(--kagit); }
  .defter { padding: 20px 14px 28px 18px; }
  .kapak-ad { font-size: 2.9rem; }
  .boyut span { display: none; }
}

/* ---------- Yazdırma ---------- */
@page { size: A5; margin: 0; }
@media print {
  html { font-size: 11.5pt !important; background: #f3e6c9; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #f3e6c9 !important; min-height: 0; }
  .kagit-disi, .bildirim, .pencere, .arac { display: none !important; }
  main { max-width: none; padding: 0; margin: 0; }
  body:not([data-ekran="defter"]) main > * { display: none; }
  .defter { box-shadow: none; margin: 0; padding: 0; background: none; border-radius: 0; }
  .sayfa.kapak { height: 210mm; min-height: 0; border: 0; margin: 0; padding: 16mm 14mm; break-after: page; }
  .kapak-cerceve { max-width: none; height: 100%; display: flex; flex-direction: column; justify-content: center; }
  .kapak-ad { font-size: 44pt; }
  .defter-ic { padding: 14mm 14mm 15mm 16mm; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
  .bolum + .bolum { margin-top: 9mm; }
  .bolum-ad { break-after: avoid; margin-top: 0; }
  .girdi { break-inside: avoid; }
  .g-soru { break-after: avoid; }
  .g-foto { break-inside: avoid; }
  .g-foto img { max-height: 70mm; box-shadow: none; }
  .son-not { break-inside: avoid; }
}
