:root {
  --desk: #4a4036;
  --paper: #fbf8f1;
  --ink: #2a2622;
  --manila: #e3c98f;
  --manila-dark: #c9ab6b;
  --red: #a2322b;
  --type: "Special Elite", "Courier New", monospace;
  --hand: "Caveat", "Segoe Print", cursive;
  --serif: "Source Serif 4", Georgia, serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 17px/1.55 var(--serif);
  color: var(--ink);
  background:
    repeating-linear-gradient(92deg, rgba(0,0,0,.05) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(88deg, rgba(255,255,255,.03) 0 1px, transparent 1px 23px),
    var(--desk);
  min-height: 100vh;
}

h1, h2, h3, nav button, .btn, .ftab { font-family: var(--type); font-weight: normal; }

/* header */
.top {
  position: relative;
  max-width: 1050px;
  margin: 24px auto 0;
  padding: 22px 28px 0;
  background: var(--manila);
  border-radius: 4px 4px 0 0;
  box-shadow: 0 3px 0 var(--manila-dark);
}
.top h1 { margin: 0 0 14px; font-size: 1.9rem; letter-spacing: .5px; }
.club { margin: 0; font-family: var(--hand); font-size: 1.4rem; color: #5b4a2c; }
.stamp {
  position: absolute; right: 26px; top: 18px;
  font-family: var(--type); color: var(--red);
  border: 3px solid var(--red); padding: 2px 10px;
  transform: rotate(-8deg); opacity: .75; letter-spacing: 2px;
}
nav { display: flex; flex-wrap: wrap; gap: 4px; }
nav button {
  font-size: .95rem; background: var(--manila-dark); border: 0;
  padding: 8px 14px 6px; border-radius: 6px 6px 0 0; cursor: pointer; color: var(--ink);
}
nav button.on { background: var(--paper); }
nav button:hover:not(.on) { background: #d8bc80; }

main { max-width: 1050px; margin: 0 auto 60px; }

.tab { display: none; }
.tab.on { display: block; }
#brief.on { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }

.paper {
  background: var(--paper);
  padding: 28px 34px;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
  margin-bottom: 20px;
}
.paper h2 { margin-top: 0; font-size: 1.6rem; border-bottom: 2px solid var(--ink); padding-bottom: 6px; }

.small { font-size: .88rem; color: #5d5650; }
.hint { color: #e8dcc6; font-family: var(--hand); font-size: 1.4rem; margin: 18px 4px 6px; }

.note {
  font-family: var(--hand); font-size: 1.35rem; line-height: 1.25;
  background: #fff59a; padding: 14px 18px; margin: 20px 0;
  width: fit-content; transform: rotate(-1.5deg);
  box-shadow: 2px 3px 5px rgba(0,0,0,.2);
}

.btn {
  background: var(--ink); color: var(--paper); border: 0;
  padding: 9px 16px 7px; cursor: pointer; font-size: .95rem;
}
.btn:hover { background: var(--red); }
.btn.ghost { background: transparent; color: #e8dcc6; border: 1px solid #e8dcc6; }
.btn.small { padding: 5px 10px 3px; font-size: .85rem; }

.map { margin-top: 0; transform: rotate(.8deg); }
.map h3 { margin-top: 0; font-size: 1rem; }
.map svg { width: 100%; }
.lbl { font-family: var(--type); font-size: 11px; fill: #3d4b52; }
.lbl.sm { font-size: 9px; }

/* case file drawer */
.drawer {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 26px 18px; padding: 10px 0;
}
.folder {
  position: relative; height: 140px; border: 0; cursor: pointer; text-align: left;
  background: var(--manila); padding: 34px 14px 12px;
  border-radius: 0 4px 4px 4px;
  transform: rotate(var(--tilt));
  box-shadow: 0 3px 5px rgba(0,0,0,.4);
  transition: transform .15s;
  font: inherit; color: var(--ink);
}
.folder:hover { transform: rotate(0) translateY(-4px); }
.ftab {
  position: absolute; top: -16px; left: 0;
  background: var(--manila); padding: 2px 12px 0; border-radius: 5px 5px 0 0;
  font-size: .8rem;
}
.flabel { font-family: var(--hand); font-size: 1.4rem; line-height: 1.1; display: block; }
.folder.seen::after {
  content: "✓"; position: absolute; right: 10px; top: 6px;
  font-family: var(--hand); font-size: 1.8rem; color: var(--red);
}
.fnote {
  position: absolute; bottom: 8px; right: 10px;
  font-family: var(--hand); color: var(--red); font-size: 1.15rem;
}

/* document viewer */
.viewer {
  position: fixed; inset: 0; background: rgba(20,16,12,.75);
  overflow-y: auto; padding: 30px 12px; z-index: 10;
}
.viewer[hidden] { display: none; }
.viewer-inner { max-width: 780px; margin: 0 auto; position: relative; }
.close {
  position: absolute; right: -6px; top: -18px; z-index: 2;
  background: var(--paper); border: 0; width: 36px; height: 36px; border-radius: 50%;
  font-size: 1.5rem; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.quicklog {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  color: #e8dcc6; font-family: var(--hand); font-size: 1.3rem; margin-top: 12px;
}

.doc {
  background: var(--paper); padding: 30px 38px 34px; position: relative;
  box-shadow: 0 4px 14px rgba(0,0,0,.5);
}
.exlabel {
  position: absolute; top: -12px; left: 24px;
  background: #fff; border: 1px solid #999; padding: 1px 10px;
  font-family: var(--hand); font-size: 1.2rem; transform: rotate(-2deg);
}
.doc table { border-collapse: collapse; width: 100%; font-size: .9rem; margin: 10px 0; }
.doc th, .doc td { border: 1px solid #b9b2a6; padding: 4px 8px; text-align: left; }
.doc th { background: #ece6da; }
.doc td.bad { color: var(--red); font-weight: 600; }
.doc tr.hl td { background: #fff3c4; }
.fine { font-size: .75rem; color: #777; margin-top: 18px; }

/* newspaper */
.doc.news { background: #f1ede2; font-family: Georgia, serif; }
.masthead { font: 700 2.4rem/1 "Times New Roman", serif; text-align: center; border-bottom: 3px double #333; padding-bottom: 6px; }
.dateline { text-align: center; font-size: .8rem; border-bottom: 1px solid #333; padding: 4px 0; margin-bottom: 12px; }
.headline { font: 700 1.6rem/1.15 "Times New Roman", serif; margin: 6px 0; }
.byline { font-style: italic; font-size: .9rem; margin: 0 0 10px; }
.cols { columns: 2 240px; column-gap: 24px; font-size: .93rem; text-align: justify; }
.cols p { margin: 0 0 10px; }

/* agency report */
.doc.report { font-family: Arial, Helvetica, sans-serif; font-size: .93rem; }
.rhead { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid #234; padding-bottom: 8px; font-size: .8rem; }
.rnum { text-align: right; }
.doc.report h3 { font-family: Arial, sans-serif; font-weight: bold; }

/* consultant report */
.doc.corp { padding-top: 0; }
.glossy { background: #1d5e8c; color: #fff; margin: 0 -38px 18px; padding: 26px 38px; }
.glossy h2 { font-family: Arial, sans-serif; margin: 10px 0 4px; border: 0; }
.glossy .small { color: #cfe3f2; }
.logo { font: 700 1.2rem Arial, sans-serif; letter-spacing: 3px; }
.logo span { display: block; font-weight: 400; font-size: .7rem; letter-spacing: 1px; }

/* blog */
.doc.blog { background: #111; color: #eee; font-family: Verdana, sans-serif; font-size: .9rem; }
.doc.blog h2 { color: #ff4040; font-family: Impact, "Arial Black", sans-serif; font-size: 1.6rem; letter-spacing: .5px; border: 0; }
.doc.blog .small { color: #999; }
.blogbar { background: #ff4040; color: #111; font-weight: bold; padding: 6px 10px; margin: -10px -18px 10px; }
.blogbar span { font-weight: normal; font-style: italic; }
.fakephoto { background: #333; border: 1px dashed #777; padding: 30px 18px; text-align: center; color: #bbb; font-style: italic; }

/* witness statements and memos */
.doc.statement, .doc.memo {
  background: repeating-linear-gradient(#fbf8f1 0 27px, #d9e4ee 27px 28px);
}
.form { font-family: Arial, sans-serif; font-size: .75rem; letter-spacing: .5px; border-bottom: 1px solid #333; padding-bottom: 6px; margin-bottom: 10px; }
.typed { font-family: var(--type); font-size: .95rem; line-height: 28px; }
.sig { font-family: var(--hand); font-size: 1.8rem; text-align: right; margin: 0; }

/* data sheet */
.doc.data { font-family: Arial, sans-serif; }
table.mono td { font-family: "Courier New", monospace; }

/* journal */
.doc.journal { font-family: "Times New Roman", serif; }
.jhead { font-size: .8rem; border-bottom: 1px solid #333; padding-bottom: 4px; }
.doc.journal h2 { border: 0; font-family: "Times New Roman", serif; font-weight: bold; font-size: 1.4rem; text-align: center; }
.authors { text-align: center; font-style: italic; }

/* facebook poll */
.doc.poll { background: #e9ebee; font-family: "Segoe UI", Arial, sans-serif; }
.fb { background: #fff; padding: 16px; border-radius: 8px; }
.fbhead { color: #385898; border-bottom: 1px solid #ddd; padding-bottom: 8px; margin-bottom: 10px; font-size: .85rem; }
.bar { position: relative; background: #f0f2f5; border-radius: 6px; margin: 6px 0; height: 32px; overflow: hidden; }
.bar span { position: absolute; inset: 0 auto 0 0; background: #c7d7f4; }
.bar em { position: relative; font-style: normal; line-height: 32px; padding-left: 10px; font-size: .9rem; }

/* flyer */
.doc.flyer { background: #fffbe0; text-align: center; font-family: "Arial Black", Arial, sans-serif; }
.flyer h2 { color: var(--red); font-size: 1.9rem; border: 0; font-family: "Arial Black", Arial, sans-serif; }
.vote { background: #1b3a7a; color: #fff; padding: 8px; font-size: 1.1rem; }
.flyer p { font-family: Arial, sans-serif; }

/* source log */
.logrow {
  display: grid; grid-template-columns: 220px 160px 1fr; gap: 10px; align-items: start;
  padding: 10px 0; border-bottom: 1px dashed #c8c0b2;
}
.logname a { color: var(--ink); }
select, textarea, input[type=range] { font: inherit; font-size: .92rem; }
select { padding: 4px; background: #fff; border: 1px solid #a69f93; }
textarea {
  width: 100%; padding: 6px 8px; border: 1px solid #c8c0b2; background: #fffef9;
  font-family: var(--serif); resize: vertical;
}

/* contradictions */
.conform { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.conform textarea, .conform .btn { grid-column: 1 / -1; }
.conform .btn { justify-self: start; }
.cork {
  background: #b88a5a radial-gradient(#9c7347 1px, transparent 1.5px) 0 0 / 7px 7px;
  border: 10px solid #6e4f31; min-height: 260px; padding: 26px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px;
}
.card {
  position: relative; background: #fffef6; padding: 18px 14px 12px; font-size: .9rem;
  transform: rotate(var(--tilt)); box-shadow: 1px 3px 6px rgba(0,0,0,.35);
}
.card::before {
  content: ""; position: absolute; top: -6px; left: 50%; width: 14px; height: 14px; margin-left: -7px;
  background: var(--red); border-radius: 50%; box-shadow: 1px 2px 2px rgba(0,0,0,.4);
}
.card .why { font-family: var(--hand); font-size: 1.25rem; color: #1f3f7a; line-height: 1.15; }
.card .x { position: absolute; right: 4px; top: 2px; border: 0; background: none; cursor: pointer; font-size: 1.1rem; color: #888; }
.empty { font-family: var(--hand); color: #f3e7d2; font-size: 1.5rem; }

/* verdict */
#verdict label { display: block; margin-bottom: 18px; font-weight: 600; }
#verdict textarea { margin-top: 4px; font-weight: normal; }
#verdict input[type=range] { width: 100%; margin-top: 6px; accent-color: var(--red); }

/* presentation */
#report h3 { margin-bottom: 4px; }
.blank { color: #aaa; font-style: italic; }
.rtable { border-collapse: collapse; width: 100%; font-size: .9rem; }
.rtable td { border-bottom: 1px solid #ddd; padding: 5px 8px; vertical-align: top; }
.actions { display: flex; gap: 10px; margin-bottom: 30px; }
.debrief { background: #2f2a25; color: #e8dcc6; padding: 14px 22px; border: 1px dashed #8a7c68; }
.debrief summary { cursor: pointer; font-family: var(--type); }
.debrief .small { color: #b8ab96; }

@media (max-width: 760px) {
  #brief.on { grid-template-columns: 1fr; }
  .logrow { grid-template-columns: 1fr; }
  .paper, .doc { padding: 20px; }
  .glossy { margin: 0 -20px 18px; padding: 20px; }
  .stamp { display: none; }
}

@media print {
  body { background: #fff; }
  .top, .actions, .debrief, .tab:not(#present) { display: none !important; }
  #present { display: block !important; }
  .paper { box-shadow: none; padding: 0; }
}
