/* Vụ án Mai Diệp: the papers on the board. Rebuilt from the printed case file as live text. */

.cc-shell {
  /* Margin boxes on the scene report and Part B sections of the code table share this row height,
     so the folded table lines up with the boxes when docked. */
  --sr-row: 104px;
  --sr-ink: #23407f;
  --sr-arrow: 34px;
}

/* ───────── 01 · cover ───────── */
.doc-cover-doc { --w: 560px; }
.doc-cover {
  overflow: hidden;
  padding: 34px 32px 30px;
  background: #f6f6f4;
}
.doc-cover::after {
  content: "";
  position: absolute;
  top: 150px;
  right: -10px;
  width: 150px;
  height: 190px;
  background-image: radial-gradient(circle, rgba(0, 0, 0, 0.16) 1.4px, transparent 1.7px);
  background-size: 14px 14px;
  pointer-events: none;
}
.doc-cover__mark { display: block; width: 100%; height: auto; }
.doc-cover__title { margin: 30px 0 6px; font: 700 70px/0.95 "Barlow Condensed", sans-serif; letter-spacing: -0.01em; }
.doc-cover__meta { margin: 0; font: 400 20px/1.3 "Barlow Condensed", sans-serif; }
.doc-cover__meta span { margin: 0 12px; }
.doc-cover__card { position: relative; z-index: 1; margin: 26px -4px 0; padding: 24px 24px 22px; background: #fff; }
.doc-cover__card::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 0;
  left: 0;
  height: 8px;
  background: linear-gradient(-45deg, #fff 4px, transparent 0) 0 0 / 10px 8px repeat-x, linear-gradient(45deg, #fff 4px, transparent 0) 0 0 / 10px 8px repeat-x;
}
.doc-cover__mission { padding: 18px 22px 20px; background: #fbd116; }
.doc-cover__mission p { margin: 0 0 6px; font: 600 17px/1 "Barlow Condensed", sans-serif; letter-spacing: 0.02em; text-transform: uppercase; }
.doc-cover__mission strong { display: block; font: 700 34px/1.04 "Barlow Condensed", sans-serif; letter-spacing: -0.01em; }
.doc-cover__how { margin: 24px 0 10px; font: 700 21px/1 "Barlow Condensed", sans-serif; text-transform: uppercase; }
.doc-cover__steps { margin: 0; padding: 0; list-style: none; }
.doc-cover__steps li { display: flex; gap: 16px; padding: 3px 0; font: 400 20px/1.4 "Barlow Condensed", sans-serif; }
.doc-cover__steps span { flex: none; width: 24px; }

/* ───────── 02 / 06 · photos ───────── */
.doc-photo-doc { --w: 300px; }
.doc-photo { margin: 0; padding: 14px 14px 22px; background: #fff; }
.doc-photo--id { padding: 12px; background: #fafafa; }
.doc-photo__frame { position: relative; }
.doc-photo img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; pointer-events: none; }
.doc-photo__name { position: absolute; margin: 0; pointer-events: none; }
.doc-photo__name--print {
  bottom: 12%;
  left: 7%;
  color: #e9d9a7;
  font: italic 400 21px/1 "Noto Serif", Georgia, serif;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.doc-photo__name--hand {
  top: 57%;
  left: 18%;
  color: #121212;
  font: 400 27px/1.05 "Patrick Hand", cursive;
  transform: rotate(-3deg);
}

/* ───────── 03 · newspaper ───────── */
.doc-news-doc { --w: 600px; }
.doc-news { padding: 30px 32px 34px; background: #ebe9e4; color: #1e1e1c; }
.doc-news__mast {
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid #8a8985;
  color: #6b6a66;
  font: 700 15px/1 "Roboto Condensed", sans-serif;
  letter-spacing: 0.02em;
}
.doc-news__mast span { margin: 0 6px; }
.doc-news figure { margin: 0; }
.doc-news img { display: block; width: 100%; height: auto; filter: grayscale(1) contrast(1.04); pointer-events: none; }
.doc-news figcaption { margin-top: 8px; font: 700 12.5px/1.4 "Roboto Condensed", sans-serif; }
.doc-news__head { margin: 30px 0 28px; font: 400 40px/1.16 "Noto Serif", Georgia, serif; letter-spacing: -0.01em; }
.doc-news__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.doc-news__col p {
  margin: 0 0 14px;
  font: 400 15px/1.5 "Noto Serif", Georgia, serif;
  text-align: justify;
  hyphens: auto;
}
.doc-news__portrait { margin-bottom: 16px !important; }
.doc-news__portrait img { aspect-ratio: 3 / 4; object-fit: cover; }

/* ───────── 04 · scene report, page 1 ───────── */
.doc-form-doc { --w: 940px; }
.doc-form { padding: 24px 22px 22px 32px; background: #fff; color: #111; }
.doc-form__code { margin: 0; font: 400 12.5px/1 "Roboto Condensed", sans-serif; }
.doc-form__org { margin: 24px 0 2px; font: 400 23px/1.2 "Roboto Condensed", sans-serif; text-align: center; }
.doc-form__title { margin: 0 0 24px; font: 700 31px/1.15 "Roboto Condensed", sans-serif; letter-spacing: 0.01em; text-align: center; }
.doc-form__body { display: grid; grid-template-columns: minmax(0, 1fr) 76px; gap: 0 18px; align-items: start; }
.doc-form__table { border: 1.5px solid #222; }
.fr { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1.5px solid #222; }
.fr:last-child { border-bottom: 0; }
.fr > .f + .f { border-left: 1.5px solid #222; }
.fr--top { grid-template-columns: 2.1fr 1.35fr 1.4fr 0.75fr 0.95fr 2.6fr; }
.fr--people { grid-template-columns: 2.4fr 0.5fr 0.6fr 0.7fr 2.6fr; }
.fr--one { grid-template-columns: 1fr; }
.fr--sketch { grid-template-columns: 1.1fr 3.3fr 1.1fr; }
.f { display: flex; flex-direction: column; gap: 3px; box-sizing: border-box; min-height: 66px; margin: 0; padding: 8px 10px 9px; }
.f__l { font: 400 11.5px/1.25 "Roboto Condensed", sans-serif; color: #222; }
.f__l--strong { font-weight: 700; }
.f__v { color: var(--sr-ink); font: 400 21px/1.12 "Patrick Hand", cursive; letter-spacing: 0.01em; }
.f--sketch { padding: 8px 4px 6px; }
.sketch { display: block; width: 100%; height: auto; margin-top: 6px; }
.sketch__road path { fill: none; stroke: var(--sr-ink); stroke-width: 2.6; }
.sketch__dash path { fill: none; stroke: var(--sr-ink); stroke-width: 1.6; stroke-dasharray: 12 10; opacity: 0.7; }
.sketch__zebra rect { fill: #8d8d8d; }
.sketch__ink path,
.sketch__bike * { fill: none; stroke: var(--sr-ink); stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; }
.sketch__car { fill: var(--sr-ink); stroke: none !important; }
.sketch__carline { stroke: #fff !important; stroke-width: 2 !important; }
.sketch__x { stroke-width: 4.5 !important; }
.sketch__compass path { fill: none; stroke: var(--sr-ink); stroke-width: 2.4; stroke-linecap: round; }
.sketch__compass text { fill: var(--sr-ink); font: 500 18px "Roboto Condensed", sans-serif; text-anchor: middle; }
.sketch__legend { margin: 0 0 0 8px; color: var(--sr-ink); font: 400 17px/1.2 "Patrick Hand", cursive; }

.doc-form__boxes { position: relative; display: grid; grid-auto-rows: var(--sr-row); }
.bx {
  position: relative;
  display: grid;
  place-items: center;
  align-self: center;
  justify-self: start;
  box-sizing: border-box;
  width: 48px;
  height: 56px;
  border: 1.5px solid #222;
  background: #fff;
}
.bx i { position: absolute; top: -4px; left: calc(100% + 4px); color: #333; font: 400 11px/1 "Roboto Condensed", sans-serif; font-style: normal; }
.bx b { color: var(--sr-ink); font: 400 33px/1 "Patrick Hand", cursive; }
.doc-form__foot { margin: 20px 0 0; font: 400 12px/1.4 "Roboto Condensed", sans-serif; }
.cc-doc.is-dock-hot .doc-form__boxes { outline: 3px dashed var(--cc-accent); outline-offset: 8px; }

/* ───────── 05 · code table (page 2), foldable ───────── */
.doc-codes-doc { --w: 960px; }
.doc-codes-doc.is-folded { width: max-content; }
.doc-codes { padding: 24px calc(var(--sr-arrow) + 18px) 30px 32px; background: #fff; color: #111; }
.doc-codes-doc.is-folded .doc-codes { padding: 22px 0 24px 22px; }
.doc-codes__code { margin: 0 0 8px; font: 400 12.5px/1 "Roboto Condensed", sans-serif; }
.doc-codes-doc.is-folded :is(.doc-codes__code, .doc-codes__a, .doc-codes__fold) { display: none; }
.doc-codes__cols { display: flex; align-items: stretch; }
.doc-codes__a {
  flex: none;
  width: 410px;
  padding-right: 24px;
  transform-origin: right center;
  backface-visibility: hidden;
  transition: transform 450ms cubic-bezier(0.5, 0, 0.3, 1), opacity 450ms;
}
.doc-codes-doc.is-folding .doc-codes__a { opacity: 0.15; transform: perspective(1800px) rotateY(-176deg); }
.doc-codes-doc.is-unfolding .doc-codes__a { animation: md-unfold 480ms cubic-bezier(0.3, 0, 0.2, 1); }
@keyframes md-unfold { from { opacity: 0.15; transform: perspective(1800px) rotateY(-176deg); } }
.doc-codes__fold {
  position: relative;
  flex: none;
  width: 2px;
  margin-right: 24px;
  background: repeating-linear-gradient(to bottom, #333 0 9px, transparent 9px 16px);
}
.doc-codes__fold span {
  position: absolute;
  top: 46%;
  left: 50%;
  padding: 4px 8px;
  background: #fff;
  color: #555;
  font: 700 11px/1 "Roboto Condensed", sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translate(-50%, -50%) rotate(-90deg);
}
.doc-codes__b { flex: none; width: 436px; }
.doc-codes__part { margin: 4px 0 22px; font: 700 46px/1 "Roboto Condensed", sans-serif; text-align: center; }
.doc-codes__sub { margin: 0 0 22px; font: 700 13.5px/1.5 "Roboto Condensed", sans-serif; text-align: center; }
.doc-codes__lead { margin: 0 0 18px; font: 700 17px/1.42 "Roboto Condensed", sans-serif; }
.doc-codes__rules { margin: 0 0 22px; padding: 0; list-style: none; counter-reset: rule; }
.doc-codes__rules li { margin-bottom: 14px; font: 400 15.5px/1.5 "Noto Serif", Georgia, serif; counter-increment: rule; }
.doc-codes__rules li::before { content: counter(rule) ". "; }
.doc-codes__legend-title { margin: 0 0 12px; font: 700 18px/1 "Roboto Condensed", sans-serif; }
.doc-codes__legend { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; margin: 0 0 22px; font: 400 16px/1.45 "Noto Serif", Georgia, serif; }
.doc-codes__legend div { display: flex; gap: 6px; }
.doc-codes__legend .wide { grid-column: 1 / -1; }
.doc-codes__legend dt::after { content: " —"; }
.doc-codes__legend dd { margin: 0; }
.doc-codes__must { margin: 0; font: 700 13px/1.4 "Roboto Condensed", sans-serif; }

.doc-codes__sections { position: relative; border: 1.5px solid #222; }
.doc-codes__anchor { position: absolute; top: 0; left: calc(100% + var(--sr-arrow)); width: 0; height: 0; }
.cb {
  position: relative;
  box-sizing: border-box;
  height: calc(var(--rows, 1) * var(--sr-row));
  padding: 9px 20px 8px 12px;
  border-bottom: 1.5px solid #222;
}
.cb:last-of-type { border-bottom: 0; }
.cb--double { --rows: 2; }
.cb h4 { margin: 0 0 6px; font: 700 13px/1.2 "Roboto Condensed", sans-serif; text-align: center; }
.cb ol { display: grid; grid-template-columns: 1fr 1fr; gap: 1px 12px; margin: 0; padding: 0; list-style: none; font: 400 13.5px/1.32 "Roboto Condensed", sans-serif; }
.cb[data-boxes="2"] ol,
.cb[data-boxes="3"] ol { font-size: 12.5px; }
.cb ol.cb--3 { grid-template-columns: repeat(3, auto); justify-content: start; gap: 1px 26px; }
.cb--double ol { gap: 6px 12px; margin-top: 10px; font-size: 14.5px; }
.cb li { position: relative; padding: 1px 3px; }
.cb__arrow {
  position: absolute;
  z-index: 2;
  top: calc((var(--at) + 0.5) * var(--sr-row) - 18px);
  right: calc(var(--sr-arrow) * -1);
  display: flex;
  align-items: center;
  box-sizing: border-box;
  width: calc(var(--sr-arrow) + 16px);
  height: 36px;
  padding-left: 13px;
  font: 700 11.5px/1 "Roboto Condensed", sans-serif;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 36'%3E%3Cpath d='M1 9h30V1.5L48.5 18 31 34.5V27H1' fill='white' stroke='%23222' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.cb li.is-decoded { color: #b3141d; font-weight: 700; }
.cb li.is-decoded::before {
  content: "";
  position: absolute;
  top: -3px;
  left: -5px;
  width: 1.9em;
  height: 1.55em;
  border: 2px solid #c4262e;
  border-radius: 50%;
  transform: rotate(-8deg);
  pointer-events: none;
}
.cb li.is-decoded::after {
  content: attr(data-for);
  position: absolute;
  top: -8px;
  left: 1.5em;
  padding: 0 3px;
  background: #fff;
  color: #c4262e;
  font: 400 13px/1 "Patrick Hand", cursive;
  white-space: nowrap;
  transform: rotate(-4deg);
  pointer-events: none;
}
.doc-codes-doc.is-docked .doc-codes__sections { box-shadow: 0 0 0 3px rgba(255, 218, 61, 0.9); }

/* ───────── 07 / 08 · statement ───────── */
.doc-st-doc { --w: 700px; }
.doc-st { padding: 24px; background: #efe3c8; color: #1e1c18; }
.doc-st__frame { padding: 22px 30px 18px; border: 1.5px solid #d8c69a; }
.doc-st__head { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 14px; border-bottom: 1.5px solid #9c8f74; }
.doc-st__badge { width: 42px; height: 54px; }
.doc-st__badge path { fill: none; stroke: #4a443a; stroke-width: 1.8; }
.doc-st__badge .fill { fill: #4a443a; stroke: none; }
.doc-st__org { display: flex; flex-direction: column; font: 400 13.5px/1.55 "Roboto Condensed", sans-serif; text-align: right; }
.doc-st__org strong { margin-bottom: 4px; font: 700 18px/1.2 "Roboto Condensed", sans-serif; }
.doc-st__title { margin: 22px 0 14px; font: 700 27px/1.2 "Roboto Slab", Georgia, serif; }
.doc-st__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 24px; margin: 0 0 20px; font: 400 13.5px/1.5 "Roboto Slab", Georgia, serif; }
.doc-st__meta div { display: flex; gap: 5px; }
.doc-st__meta dd { margin: 0; }
.doc-st__lines { margin: 0; padding: 0; list-style: none; }
.doc-st__lines li { position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: baseline; margin: 0 -8px; padding: 4px 8px; }
.doc-st__lines .n { position: relative; color: #6f6656; font: 400 13px/1 "Roboto Condensed", sans-serif; }
.doc-st__lines p { margin: 0; font: 400 17px/1.45 "Roboto Slab", Georgia, serif; }
.doc-st__lines b { font-weight: 700; }
.doc-st__lines li.is-marked .n::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -9px;
  width: 44px;
  height: 30px;
  border: 2.5px solid #c4262e;
  border-radius: 50%;
  transform: translateY(-50%) rotate(-7deg);
}
.doc-st__lines li.is-marked p { text-decoration: underline wavy #c4262e; text-decoration-thickness: 1.5px; text-underline-offset: 6px; }
.doc-st__lines li.is-proven::after {
  content: "NÓI DỐI";
  position: absolute;
  top: 50%;
  right: -4px;
  padding: 3px 8px 2px;
  border: 2.5px solid #c4262e;
  background: rgba(239, 227, 200, 0.85);
  color: #c4262e;
  font: 700 15px/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.12em;
  transform: translateY(-50%) rotate(-7deg);
}
.doc-st__foot { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 28px; color: #3b372f; font: 400 12.5px/1.3 "Roboto Condensed", sans-serif; }
.doc-st__org-line { font-size: 11.5px; letter-spacing: 0.34em; }

/* ───────── intro and solution ───────── */
.md-tips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 0; list-style: none; }
.md-tips li { padding: 14px 16px; background: var(--cc-field); }
.md-tips b { display: block; margin-bottom: 4px; font: 600 18px/1.2 "Barlow Condensed", sans-serif; }
.md-tips span { color: var(--cc-muted); font-size: 14px; line-height: 1.5; }
.md-secret { margin: 18px 0 0; padding-left: 14px; border-left: 3px solid var(--cc-red); color: #34342b; font: 400 21px/1.35 "Patrick Hand", cursive; }

.cc-dialog--wide { width: min(880px, calc(100% - 24px)); }
.cc-q.is-solved .cc-q__help { display: none; }
.md-sun { margin: 0 0 22px; padding: 12px 12px 10px; background: #efe9dc; }
.md-sun svg { display: block; width: 100%; height: auto; }
.md-sun figcaption { margin-top: 6px; color: var(--cc-muted); font-size: 13px; }
.md-sun__road { fill: #d8d0bd; }
.md-sun__street { fill: #7b725f; font: 600 12px "Be Vietnam Pro", sans-serif; letter-spacing: 0.1em; }
.md-sun__cone { fill: rgba(255, 210, 40, 0.55); }
.md-sun__path { fill: none; stroke: #191c19; stroke-width: 3.5; stroke-linecap: round; }
.md-sun__car { fill: #191c19; }
.md-sun__sun circle { fill: #ffb400; }
.md-sun__sun path { stroke: #ffb400; stroke-width: 3.5; stroke-linecap: round; }
.md-sun__ray { fill: none; stroke: #d99a00; stroke-width: 2; stroke-dasharray: 6 6; }
.md-sun__label { fill: #191c19; font: 600 14px "Be Vietnam Pro", sans-serif; }
.md-sun__label--soft { fill: #4b514a; font-weight: 400; }
.md-sun__label--sun { text-anchor: middle; }
.md-sun__label--end { text-anchor: end; }
.md-sun__compass path { fill: none; stroke: #191c19; stroke-width: 2; }
.md-sun__compass .md-sun__compass-head { fill: #191c19; }
.md-sun__compass text { fill: #191c19; font: 600 14px "Be Vietnam Pro", sans-serif; text-anchor: middle; }
.md-steps { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.md-steps li { position: relative; min-height: 32px; padding-left: 46px; font-size: 15.5px; line-height: 1.6; counter-increment: step; }
.md-steps li::before { content: counter(step); position: absolute; top: 0; left: 0; display: grid; place-items: center; width: 32px; height: 32px; background: var(--cc-accent); font: 700 17px/1 "Barlow Condensed", sans-serif; }
.md-open { margin-top: 26px; padding: 20px 22px; background: var(--cc-dark); color: var(--cc-ground); }
.md-open h3 { margin: 0 0 12px; font: 600 23px/1.1 "Barlow Condensed", sans-serif; }
.md-open ul { display: grid; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; }
.md-open li { font-size: 14.5px; line-height: 1.5; }
.md-open li span { display: inline-block; min-width: 112px; color: var(--cc-accent); font-weight: 600; }
.md-open p { margin: 0; color: rgba(242, 233, 212, 0.75); font-size: 14px; }

@media (max-width: 640px) {
  .md-tips { grid-template-columns: 1fr; }
  .md-open li span { display: block; }
}
