/* “Ona görə”: qovluq dilləri olan popup (ana səhifə) və qovluqda açılan sənəd (yazı səhifəsi) */
:root { --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace; }

/* ================================================================ Ana səhifə: sağdan çıxan popup */
.of-pop {
  position: fixed; right: 20px; bottom: 20px; z-index: 45; width: 410px; max-width: calc(100vw - 24px);
  padding: 16px 14px 14px; border-radius: 26px; background: #1c1b22; color: #f4efe6;
  box-shadow: 0 30px 70px -20px rgba(10, 10, 20, .6), 0 0 0 1px rgba(255, 255, 255, .06);
  transform: translateX(calc(100% + 40px)); opacity: 0; visibility: hidden;
  transition: transform .6s cubic-bezier(.2, .9, .25, 1.05), opacity .35s, visibility 0s .6s;
}
.of-pop.open { transform: none; opacity: 1; visibility: visible; transition: transform .6s cubic-bezier(.2, .9, .25, 1.05), opacity .35s; }
.of-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 4px 14px; }
.of-head small { display: block; font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: #9c96a8; }
.of-head strong { display: block; font-family: var(--serif); font-size: 1.6rem; font-weight: 500; line-height: 1.1; }
.of-ctrl { display: flex; gap: 6px; }
.of-ctrl button {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .06);
  color: #f4efe6; display: grid; place-items: center; cursor: pointer;
}
.of-ctrl button:hover { background: rgba(255, 255, 255, .16); }

.of-stack { display: flex; flex-direction: column; }
.of-folder { position: relative; z-index: var(--z); margin-top: -8px; filter: drop-shadow(0 -4px 6px rgba(0, 0, 0, .25)); }
.of-folder:first-child { margin-top: 0; }
.of-tab {
  position: relative; display: inline-flex; align-items: center; gap: 8px; max-width: 64%;
  padding: 9px 22px 7px; border: 0; cursor: pointer; color: #fff; background: var(--fc);
  font-family: var(--serif); font-size: .98rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-radius: 14px 14px 0 0; transition: padding .25s;
}
.of-tab::after { /* qovluq dilinin maili sağ kənarı */
  content: ""; position: absolute; right: -18px; bottom: 0; width: 20px; height: 100%; background: var(--fc);
  clip-path: polygon(0 0, 30% 0, 100% 100%, 0 100%);
}
.of-tab { overflow: visible; }
.of-tab:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
.of-folder.light .of-tab, .of-folder.light .of-inner { color: #2b1d08; }
.of-band { height: 10px; margin-top: -1px; background: var(--fc); border-radius: 0 12px 0 0; }
.of-body { display: grid; grid-template-rows: 0fr; background: var(--fc); border-radius: 0 0 14px 14px; transition: grid-template-rows .45s cubic-bezier(.3, .8, .3, 1); }
.of-folder.open .of-body { grid-template-rows: 1fr; }
.of-inner { overflow: hidden; min-height: 0; }
.of-folder:not(.open) .of-body { height: 8px; }
.of-folder.open .of-tab { padding-top: 12px; padding-bottom: 9px; }

/* Qovluğun içindəki vərəq */
.of-sheet {
  position: relative; display: flex; flex-direction: column; gap: 6px; margin: 2px 10px 12px; padding: 16px 16px 14px;
  background: #fbf7ee; color: #2b2118; border-radius: 4px 4px 10px 10px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .06), 0 8px 18px -10px rgba(0, 0, 0, .5);
  transform: translateY(14px); opacity: 0; transition: transform .45s cubic-bezier(.3, .9, .3, 1) .08s, opacity .3s .08s;
}
.of-folder.open .of-sheet { transform: none; opacity: 1; }
.of-stamp {
  position: absolute; right: 14px; top: 14px; padding: 3px 8px; border: 1.5px solid #3b4bd6; color: #3b4bd6;
  font-family: var(--mono); font-size: .66rem; font-weight: 700; letter-spacing: .04em; transform: rotate(4deg);
}
.of-who { display: flex; align-items: center; gap: 10px; padding-right: 80px; }
.of-who b { display: block; font-size: .88rem; }
.of-who small { display: block; font-family: var(--mono); font-size: .7rem; color: #7a6d5d; }
.of-title { font-family: var(--serif); font-style: italic; font-size: 1.32rem; line-height: 1.2; margin-top: 6px; }
.of-title.soon { color: #9a8770; }
.of-ex { font-size: .86rem; color: #6b5a48; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.of-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; padding-top: 10px; border-top: 1px dashed #d8c9ad; }
.of-mono { font-family: var(--mono); font-size: .72rem; color: #7a6d5d; }
.of-new { display: inline-block; margin-right: 6px; padding: 1px 6px; background: #c8452f; color: #fff; font-weight: 700; border-radius: 3px; }
.of-open {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; text-decoration: none;
  background: #1c1b22; color: #fff; font-size: .84rem; font-weight: 700; white-space: nowrap;
}
.of-open:hover { background: #3a3946; color: #fff; }
.of-sheet > .of-open { align-self: flex-start; margin-top: 6px; }
.of-dot { width: 8px; height: 8px; border-radius: 50%; background: #f2c14e; box-shadow: 0 0 0 3px rgba(242, 193, 78, .3); flex: none; }
.of-folder.light .of-dot { background: #c8452f; }

/* Bağlı halda sağ kənarda qovluq dili */
.of-handle {
  position: fixed; right: 0; bottom: 130px; z-index: 44; display: flex; align-items: center; gap: 8px;
  padding: 18px 10px; border: 0; border-radius: 14px 0 0 14px; cursor: pointer;
  background: #1c1b22; color: #f4efe6; font-family: var(--serif); font-size: .98rem;
  box-shadow: -6px 10px 24px -8px rgba(10, 10, 20, .5);
  transform: translateX(110%); transition: transform .4s cubic-bezier(.2, .9, .25, 1.05);
}
.of-handle span { writing-mode: vertical-rl; transform: rotate(180deg); }
.of-handle.show { transform: none; }
.of-handle:hover { background: #2c2b36; }
.of-handle { flex-direction: column; }

@media (max-width: 640px) {
  .of-pop { right: 10px; left: 10px; bottom: 10px; width: auto; padding: 12px 10px 10px; border-radius: 22px; }
  .of-head { padding-bottom: 10px; }
  .of-head strong { font-size: 1.3rem; }
  .of-tab { font-size: .9rem; padding: 8px 16px 6px; max-width: 60%; }
  .of-ex { display: none; }
  .of-sheet { padding: 12px; margin: 2px 8px 10px; }
  .of-title { font-size: 1.12rem; }
  .of-handle { bottom: 96px; padding: 14px 8px; font-size: .88rem; }
}
@media (max-height: 700px) and (min-width: 641px) { .of-ex { display: none; } }
@media (prefers-reduced-motion: reduce) { .of-pop, .of-handle, .of-sheet, .of-body { transition: none; } }

/* ================================================================ Yazı səhifəsi: qovluqda sənəd */
.dossier-page { padding-top: 56px; padding-bottom: 80px; }
.ds-crumbs { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 auto 26px; max-width: 1180px; }
.ds-crumbs a { font-weight: 700; text-decoration: none; font-size: .9rem; }
.ds-crumbs span { font-family: var(--mono); font-size: .74rem; color: var(--ink-faint); letter-spacing: .04em; }

.dossier { position: relative; max-width: 1180px; margin: 40px auto 0; perspective: 2400px; }
.ds-tab {
  position: absolute; right: 70px; top: -40px; z-index: 1; padding: 10px 30px 12px; border-radius: 16px 16px 0 0;
  background: var(--fc); color: #fff; font-family: var(--serif); font-style: italic; font-size: 1.05rem; white-space: nowrap; max-width: 60%; overflow: hidden; text-overflow: ellipsis;
}
.ds-folder {
  position: relative; padding: 26px 26px 34px 34px; border-radius: 6px 24px 24px 24px; background: var(--fc);
  box-shadow: 0 40px 80px -40px rgba(20, 15, 10, .6), inset 0 1px 0 rgba(255, 255, 255, .15);
}
.ds-folder::before { /* arxadakı ikinci vərəq */
  content: ""; position: absolute; left: 46px; right: 14px; top: 14px; bottom: 22px; border-radius: 4px;
  background: #efe7d6; transform: rotate(.8deg); box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}
.ds-paper {
  position: relative; display: grid; grid-template-columns: 170px minmax(0, 1fr) 250px; gap: 40px;
  padding: 48px 40px 60px 88px; border-radius: 4px; color: #2b2118;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, .7), transparent 40%),
    repeating-linear-gradient(0deg, rgba(120, 100, 70, .025) 0 2px, transparent 2px 4px),
    #faf6ec;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .05), 0 12px 30px -12px rgba(0, 0, 0, .45);
  animation: ds-paper-in .9s cubic-bezier(.2, .9, .3, 1) .55s both;
}
@keyframes ds-paper-in { from { transform: translateY(26px) rotate(-.6deg); } }
.ds-holes { position: absolute; left: 30px; top: 70px; display: flex; flex-direction: column; gap: 120px; }
.ds-holes i { width: 16px; height: 16px; border-radius: 50%; background: var(--fc); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .35); }
.ds-margin-line { position: absolute; left: 66px; top: 0; bottom: 0; width: 1px; background: rgba(200, 69, 47, .25); }

/* Ön qapaq — açılır */
.ds-cover {
  position: absolute; inset: 0; z-index: 3; border-radius: 6px 24px 24px 24px; background: var(--fc);
  transform-origin: 0 50%; display: grid; place-items: center; pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 30px 60px -30px rgba(0, 0, 0, .6);
  animation: ds-open 1.15s cubic-bezier(.55, .05, .3, 1) .35s forwards;
  backface-visibility: hidden;
}
.ds-cover-label {
  padding: 18px 26px; background: #faf6ec; color: #2b2118; border-radius: 4px; transform: rotate(-2deg); text-align: center;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .25); max-width: 80%;
}
.ds-cover-label small { display: block; font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: #7a6d5d; }
.ds-cover-label b { display: block; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.7rem; margin-top: 4px; }
@keyframes ds-open {
  0% { transform: rotateY(0); }
  70% { opacity: 1; }
  100% { transform: rotateY(-168deg); opacity: 0; visibility: hidden; }
}

/* Sol sütun: makina yazısı ilə qeydlər */
.ds-notes { font-family: var(--mono); font-size: .74rem; line-height: 1.55; color: #5b5246; padding-top: 104px; }
.ds-notes p { margin: 0 0 16px; }
.ds-notes b { display: block; font-weight: 700; color: #2b2118; text-transform: uppercase; letter-spacing: .06em; font-size: .68rem; }
.ds-notes a { color: inherit; }

/* Orta sütun */
.ds-main { min-width: 0; }
.ds-stamp {
  display: inline-block; padding: 6px 12px; border: 2px solid #3b4bd6; color: #3b4bd6; border-radius: 3px;
  font-family: var(--mono); font-size: .8rem; font-weight: 700; letter-spacing: .05em; transform: rotate(-4deg);
}
.ds-main h1 {
  font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(2.3rem, 4.6vw, 3.7rem);
  line-height: 1.08; letter-spacing: -.01em; margin-top: 22px; text-wrap: balance;
}
.ds-lead { font-family: var(--serif); font-size: 1.22rem; color: #5b4c3c; margin: 18px 0 0; line-height: 1.55; }
.ds-photo { position: relative; margin: 30px 0 4px; padding: 10px 10px 34px; background: #fff; transform: rotate(-1.2deg); box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .4); }
.ds-photo img { width: 100%; display: block; aspect-ratio: 16 / 8.5; object-fit: cover; }
.ds-photo figcaption { position: absolute; left: 14px; bottom: 8px; font-family: "Caveat", cursive; font-size: 1.15rem; color: #6b5a48; }
.ds-photo::before, .ds-photo::after { /* skotç */
  content: ""; position: absolute; top: -12px; width: 110px; height: 28px; background: rgba(255, 240, 190, .7);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .1);
}
.ds-photo::before { left: 30px; transform: rotate(-6deg); }
.ds-photo::after { right: 30px; transform: rotate(5deg); }
.ds-main .post-body { margin-top: 10px; }
.ds-main .post-body > p:first-child::first-letter {
  float: left; font-size: 3.4em; line-height: .9; padding: .06em .08em 0 0; font-weight: 700; color: var(--fc, #a8700f);
}
.ds-sign { margin-top: 36px; font-family: "Caveat", cursive; font-size: 2rem; color: #2b3a8c; transform: rotate(-3deg); display: inline-block; }

/* Sağ sütun: fayl kartı (qəbz) və post-it qeydlər */
.ds-side { display: flex; flex-direction: column; gap: 26px; padding-top: 20px; }
.ds-card {
  position: relative; padding: 26px 18px 20px; background: #f6dc7a; color: #2b1d08; font-family: var(--mono); font-size: .74rem;
  transform: rotate(2.5deg); box-shadow: 0 12px 24px -12px rgba(60, 40, 0, .55);
  clip-path: polygon(0 4%, 6% 0, 12% 3%, 19% 0, 26% 4%, 33% 1%, 40% 4%, 47% 0, 55% 3%, 62% 0, 70% 4%, 78% 1%, 86% 4%, 93% 0, 100% 3%, 100% 100%, 0 100%);
}
.ds-card h3 { font-family: var(--mono); font-size: 1.3rem; letter-spacing: .12em; margin-bottom: 12px; }
.ds-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; }
.ds-card dt { text-transform: uppercase; font-size: .62rem; letter-spacing: .08em; opacity: .7; padding-top: 2px; }
.ds-card dd { margin: 0; font-weight: 700; }
.ds-card .sig { margin-top: 14px; padding: 8px 10px; border: 1.5px dashed rgba(43, 29, 8, .45); font-family: "Caveat", cursive; font-size: 1.6rem; font-weight: 400; line-height: 1; }
.ds-clip { position: absolute; right: 24px; top: -30px; z-index: 2; transform: rotate(8deg); }
.ds-card-wrap { position: relative; }

.ds-notes-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-family: var(--mono); font-size: .72rem; color: #5b5246; text-transform: uppercase; letter-spacing: .06em; }
.ds-notes-head small { text-transform: none; letter-spacing: 0; color: #9a8770; }
.postits { display: flex; flex-direction: column; gap: 18px; }
.postit {
  --pc: #fde68a; position: relative; padding: 16px 14px 10px; background: var(--pc); min-height: 150px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .08), 0 14px 22px -12px rgba(60, 40, 0, .5);
  transform: rotate(var(--r, -1.5deg)); transition: transform .2s;
  animation: postit-in .35s cubic-bezier(.3, 1.4, .6, 1);
}
.postit:nth-child(even) { --r: 1.8deg; }
.postit:focus-within { transform: rotate(0) scale(1.02); z-index: 2; }
.postit::before { /* yapışqan zolaq */
  content: ""; position: absolute; left: 50%; top: -9px; width: 70px; height: 20px; margin-left: -35px;
  background: rgba(255, 255, 255, .55); box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.postit.pink { --pc: #f9c6d3; }
.postit.blue { --pc: #c9def7; }
.postit.green { --pc: #cfe9c8; }
@keyframes postit-in { from { transform: rotate(-12deg) scale(.6); opacity: 0; } }
.postit textarea {
  width: 100%; min-height: 104px; border: 0; background: transparent; resize: none; outline: none; padding: 0;
  font-family: "Caveat", cursive; font-size: 1.3rem; line-height: 1.25; color: #2b2118;
}
.postit textarea::placeholder { color: rgba(43, 33, 24, .45); }
.pi-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 4px; }
.pi-colors { display: flex; gap: 6px; }
.pi-colors button { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .8); cursor: pointer; padding: 0; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); }
.pi-colors button[aria-pressed="true"] { box-shadow: 0 0 0 2px #2b2118; }
.pi-state { font-family: var(--mono); font-size: .62rem; color: rgba(43, 33, 24, .6); }
.pi-del { width: 30px; height: 30px; border: 0; background: none; border-radius: 50%; cursor: pointer; color: rgba(43, 33, 24, .6); display: grid; place-items: center; }
.pi-del:hover { background: rgba(0, 0, 0, .08); color: #a33a2a; }
.pi-add {
  padding: 14px; border: 2px dashed #d8c9ad; background: rgba(255, 255, 255, .4); border-radius: 4px; cursor: pointer;
  font-family: "Caveat", cursive; font-size: 1.35rem; color: #6b5a48; text-align: center; text-decoration: none; display: block;
}
.pi-add:hover { border-color: #b9a47e; background: rgba(255, 255, 255, .7); color: #2b2118; }

/* Aşağı: yazar və digər fayllar */
.ds-after { max-width: 1180px; margin: 40px auto 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.ds-after .author-box { margin-top: 0; }
.ds-after .more-posts { margin-top: 0; padding: 22px 24px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); }
.ds-after .more-item:first-of-type { border-top: 0; }

@media (max-width: 1100px) {
  .ds-paper { grid-template-columns: minmax(0, 1fr) 230px; padding-left: 80px; }
  .ds-notes { grid-column: 1 / -1; padding-top: 0; display: flex; flex-wrap: wrap; gap: 4px 26px; order: -1; }
  .ds-notes p { margin: 0; }
}
@media (max-width: 820px) {
  .dossier-page { padding-top: 40px; }
  .ds-paper { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 30px 20px 36px 52px; }
  .ds-holes { left: 16px; gap: 90px; }
  .ds-holes i { width: 12px; height: 12px; }
  .ds-margin-line { left: 40px; }
  .ds-folder { padding: 14px 12px 18px 16px; border-radius: 6px 20px 20px 20px; }
  .ds-folder::before { left: 26px; right: 8px; }
  .ds-tab { right: 24px; top: -34px; padding: 8px 18px 10px; font-size: .92rem; }
  .ds-side { padding-top: 0; }
  .postits { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
  .ds-after { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .ds-paper { padding: 24px 14px 30px 40px; }
  .ds-holes { left: 12px; }
  .ds-margin-line { left: 32px; }
  .ds-notes { font-size: .7rem; }
  .ds-main h1 { font-size: 2rem; }
  .ds-crumbs span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ds-cover { display: none; }
  .ds-paper, .postit { animation: none; }
}
.pi-add[hidden] { display: none; }

/* ================================================================ Şərhlər */
.comments { max-width: 1180px; margin: 44px auto 0; padding: 28px 32px 30px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); scroll-margin-top: 80px; }
.cm-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.cm-head h2 { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.7rem; }
.cm-count { font-family: var(--mono); font-size: .78rem; color: var(--ink-faint); }
.cm-av {
  flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  color: #fbf5e8; font-family: var(--serif); font-weight: 700; font-size: .9rem;
}
.cm-form { display: flex; gap: 14px; align-items: flex-start; padding-bottom: 22px; border-bottom: 1px dashed var(--line); }
.cm-field { flex: 1; min-width: 0; }
.cm-field textarea {
  width: 100%; min-height: 86px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: #fff;
  font: inherit; font-size: .96rem; resize: vertical;
}
.cm-field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(224, 166, 58, .25); }
.cm-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.cm-left { font-family: var(--mono); font-size: .72rem; color: var(--ink-faint); }
.cm-login { display: block; padding: 16px; border: 2px dashed var(--line); border-radius: 14px; text-align: center; font-weight: 700; text-decoration: none; }
.cm-list { list-style: none; margin: 0; padding: 0; }
.cm-item { display: flex; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.cm-item:last-child { border-bottom: 0; padding-bottom: 0; }
.cm-item.fresh { animation: cm-in .5s ease-out; }
@keyframes cm-in { from { opacity: 0; transform: translateY(8px); background: #fdf3dc; } }
.cm-item.by-author .cm-body { padding: 12px 14px; border-radius: 4px 14px 14px 14px; background: #fdf6e3; border: 1px solid #f0dfb3; }
.cm-body { flex: 1; min-width: 0; }
.cm-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; font-size: .88rem; }
.cm-meta time { color: var(--ink-faint); font-size: .78rem; }
.cm-badge { padding: 1px 8px; border-radius: 999px; background: #f2c14e; color: #2b1d08; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.cm-del { margin-left: auto; border: 0; background: none; color: var(--ink-faint); font-size: .78rem; cursor: pointer; padding: 6px 4px; }
.cm-del:hover { color: var(--danger); }
.cm-body p { margin: 6px 0 0; color: #3a2e22; line-height: 1.6; overflow-wrap: anywhere; }
.cm-empty { padding: 18px 0 4px; color: var(--ink-faint); font-size: .92rem; }
@media (max-width: 640px) {
  .comments { padding: 20px 16px 22px; border-radius: 20px; margin-top: 30px; }
  .cm-head h2 { font-size: 1.4rem; }
  .cm-form { gap: 10px; }
  .cm-form > .cm-av { display: none; }
  .cm-item { gap: 10px; }
}
