/* cscaseopening.com — ledger: cream ruled paper, dark slate ink, brick-red margin line and accent. */
:root {
  --bg: #fbf8f1;
  --paper: #fffdf8;
  --ink: #22303c;
  --ink-2: #4a5764;
  --muted: #66707b;
  --line: #e7e0d0;
  --rule: #dbe5ee;
  --red: #b23a2f;
  --red-2: #93291f;
  --green: #2f7d4f;
  --milspec: #4b69ff; --restricted: #8847ff; --classified: #d32ce6; --covert: #eb4b4b; --rare: #d6a12e;
  --font: "Charter", "Bitstream Charter", "Iowan Old Style", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.65 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.12; }
p { margin: 0; }
[hidden] { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.page { width: min(1140px, 100% - 40px); margin-inline: auto; }
.skip { position: absolute; inset-inline-start: -999px; top: 8px; z-index: 50; background: var(--red); color: #fff; padding: 8px 14px; }
.skip:focus { inset-inline-start: 8px; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.fine { font: 14px/1.5 var(--sans); color: var(--muted); }
.link { background: none; border: 0; color: var(--red); font: 14px var(--sans); cursor: pointer; text-decoration: underline; padding: 0; }

.topline { position: sticky; top: 0; z-index: 20; background: rgba(251, 248, 241, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topline-row { display: flex; align-items: center; gap: 22px; height: 62px; font-family: var(--sans); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 19px var(--font); white-space: nowrap; }
.brand b { color: var(--red); }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 600; padding: 6px 10px; border-radius: 4px; }
.nav a:hover { background: #f1ebdd; }
.topline-end { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.lang { position: relative; }
.lang summary { list-style: none; display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 6px 10px; border: 1px solid var(--line); border-radius: 4px; font-size: 14px; }
.lang summary::-webkit-details-marker { display: none; }
.lang nav { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); width: 220px; max-height: 60vh; overflow: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 6px; display: grid; }
.lang nav a { padding: 7px 10px; color: var(--ink); text-decoration: none; font-size: 14px; }

.stamp { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 4px; font: 700 15px var(--sans); text-decoration: none; border: 1px solid transparent; cursor: pointer; white-space: nowrap; transition: background .15s; }
.stamp-red { background: var(--red); color: #fff; }
.stamp-red:hover { background: var(--red-2); }
.stamp:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
/* DatDrop: slate-ink main button; on hover a brick-red rule underneath, like the ledger's total line. */
.stamp-ink { background: var(--ink); color: #fff; }
.stamp-ink:hover { background: #121c25; box-shadow: inset 0 -3px 0 var(--red); }
.stamp-ink .arrow-ne { opacity: .85; display: inline-block; margin-inline-start: 8px; vertical-align: -2px; }
/* The DatDrop label is one inline run, so when it wraps on a phone the icon stays with the last word. */
.stamp-label { display: block; }
/* Header DatDrop link: plain text in the nav's voice, not a second filled button next to the hero's. */
.topline-link { display: inline-flex; align-items: center; gap: 6px; font: 600 14px var(--sans); color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 4px; white-space: nowrap; }
.topline-link:hover { color: var(--red); }

.hero { padding: 48px 0 64px; border-bottom: 1px solid var(--line); }
/* The phrase runs across the page; under it the ledger sits on the left and the words on the right. */
.h1 { font-size: clamp(52px, 9vw, 120px); font-weight: 700; letter-spacing: -.025em; line-height: .95; }
.hero-row { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 56px; align-items: start; margin-top: 34px; }
.h1-sub { font-size: clamp(21px, 2.3vw, 26px); font-style: italic; color: var(--ink); line-height: 1.3; }
.lead { margin-top: 14px; font-size: 18px; color: var(--ink-2); max-width: 60ch; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 24px; }
.hero-more { margin-top: 14px; font: 600 15px var(--sans); }
.hero-more a { color: var(--ink); text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.hero-more a:hover { color: var(--red); }
.ledger-art { position: relative; background: var(--paper) repeating-linear-gradient(transparent 0 37px, var(--rule) 37px 38px); border: 1px solid var(--line); border-inline-start: 3px double var(--red); background-position: 0 22px; padding: 22px 22px 14px; box-shadow: 0 30px 50px -36px rgba(34, 48, 60, .5); font-family: var(--mono); }
.ledger-tab { position: absolute; top: -13px; inset-inline-start: 18px; padding: 3px 10px; background: var(--red); color: #fff; font: 600 12px var(--sans); letter-spacing: .03em; }
.ledger-art ol { list-style: none; margin: 0; padding: 0; }
.ledger-art li { display: grid; grid-template-columns: 30px 1fr auto auto; gap: 10px; align-items: center; height: 38px; font-size: 14px; }
.ledger-art em, .ledger-art strong { white-space: nowrap; }
.ledger-art li b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ledger-art li > span { color: var(--muted); }
.ledger-art li b { font: 600 15px var(--font); border-inline-start: 4px solid var(--c); padding-inline-start: 8px; }
.ledger-art em { font-style: normal; color: var(--red); }
.ledger-art strong { color: var(--green); }
.ledger-net { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 2px solid var(--ink); font-weight: 700; }
.ledger-net b { color: var(--red); }
.g-milspec { --c: var(--milspec); } .g-restricted { --c: var(--restricted); } .g-classified { --c: var(--classified); } .g-covert { --c: var(--covert); } .g-rare { --c: var(--rare); }

.section { padding: 76px 0; }
.alt { background: #f4efe3; border-block: 1px solid var(--line); }
.section-head { max-width: 760px; margin-bottom: 26px; }
.section-head h2 { font-size: clamp(30px, 4vw, 44px); font-weight: 700; }
.section-head p { margin-top: 12px; color: var(--ink-2); }

.tracker { background: var(--paper); border: 1px solid var(--line); border-inline-start: 3px double var(--red); padding: 22px; font-family: var(--sans); }
.entry { display: grid; grid-template-columns: 2fr 1fr 1fr minmax(max-content, 1.2fr) 2fr 1fr auto; gap: 10px; align-items: end; }
.entry label span { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 5px; }
.entry input, .entry select, .field select { width: 100%; height: 42px; border: 1px solid #d6cdb8; border-radius: 4px; background: #fff; padding: 0 10px; font: 15px var(--sans); color: var(--ink); }
.entry input[type="number"] { font-family: var(--mono); }
.tools { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 12px; }
.totals { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 18px; border-block: 2px solid var(--ink); }
.totals div { padding: 12px 14px; }
.totals div + div { border-inline-start: 1px solid var(--line); }
.totals span { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.totals output { display: block; font: 700 24px var(--mono); }
.totals .up { color: var(--green); }
.totals .down { color: var(--red); }
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 22px; margin-top: 18px; }
.log { max-height: 440px; overflow: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 8px 10px; text-align: start; border-bottom: 1px solid var(--rule); }
.table thead th { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; position: sticky; top: 0; background: var(--paper); }
.log tbody tr td:nth-child(3) { border-inline-start: 4px solid var(--c); }
.log td:nth-child(4) { font-family: var(--mono); }
.log-item { display: block; margin-top: 2px; font-size: 12px; line-height: 1.35; color: var(--muted); overflow-wrap: anywhere; }
.x { border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; }
.x:hover { color: var(--red); }
.vs td { font-family: var(--mono); font-weight: 700; }
.sw { display: inline-block; width: 10px; height: 10px; background: var(--c); margin-inline-end: 8px; }
.sub { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; margin-bottom: 6px; }
.practice-out { margin-top: 10px; padding: 10px 12px; background: #f6f1e4; border-inline-start: 3px solid var(--ink); font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.practice-out a { font-weight: 700; }
.keep { white-space: nowrap; }
.practice-out .arrow-ne { display: inline-block; margin-inline-start: 4px; vertical-align: -2px; }
.log tr.is-practice td { color: var(--muted); font-style: italic; }
.log tr.is-practice td:nth-child(4) { font: 600 11px var(--sans); text-transform: uppercase; letter-spacing: .05em; }
#other-note { margin-top: 8px; }
.vs-dd { margin-top: 18px; padding: 14px 16px 16px; background: #f6f1e4; border-inline-start: 3px double var(--red); }
.vs-dd p { font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.vs-dd .stamp { margin-top: 12px; }

.guide { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 2px solid var(--ink); }
.guide li { padding: 20px 20px 22px 0; padding-inline: 0 20px; border-bottom: 1px solid var(--line); }
.guide li:nth-child(3n+2), .guide li:nth-child(3n) { padding-inline-start: 20px; border-inline-start: 1px solid var(--line); }
.guide span { font: 700 13px var(--mono); color: var(--red); }
.guide h3 { margin-top: 6px; font-size: 21px; }
.guide p { margin-top: 8px; color: var(--ink-2); font-size: 16px; }
/* FAQ: ledger rows, the question in the margin column and the answer on the ruled line beside it. */
.notes { margin: 0; border-top: 2px solid var(--ink); }
.notes > div { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 28px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.notes dt { font-weight: 700; font-size: 18px; line-height: 1.35; padding-inline-end: 14px; border-inline-end: 3px double var(--red); }
.notes dd { margin: 0; color: var(--ink-2); }
.foot { padding: 36px 0 52px; font: 14px var(--sans); color: var(--muted); }
.foot-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.foot-grid > div { max-width: 560px; }
.foot-grid p { margin-top: 10px; }
.foot .brand { color: var(--ink); }
.foot a:not(.brand) { color: var(--muted); }

@media (max-width: 1060px) {
  .nav { display: none; }
  .hero-row, .split { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .hero-row .ledger-art { order: 2; max-width: 560px; }
  .entry { grid-template-columns: 1fr 1fr 1fr; }
  .entry .wide { grid-column: span 3; }
  .entry .stamp { grid-column: span 2; }
  .guide { grid-template-columns: 1fr 1fr; }
  .guide li, .guide li:nth-child(3n+2), .guide li:nth-child(3n) { padding-inline: 0 16px; border-inline-start: 0; }
  .totals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .totals div:nth-child(3n+1) { border-inline-start: 0; }
  .totals div:nth-child(n+4) { border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .page { width: calc(100% - 32px); }
  .topline-link { display: none; }
  .notes > div { grid-template-columns: 1fr; gap: 6px; }
  .notes dt { border-inline-end: 0; padding-inline-end: 0; }
  .log thead th { white-space: nowrap; }
  .hero { padding: 34px 0 46px; }
  .lead { font-size: 17px; }
  .tracker { padding: 14px; }
  .entry { grid-template-columns: 1fr 1fr; }
  .entry .wide, .entry label:nth-child(4) { grid-column: span 2; }
  .entry .stamp { grid-column: span 1; }
  .totals { grid-template-columns: 1fr 1fr; }
  .totals div:nth-child(3n+1) { border-inline-start: 1px solid var(--line); }
  .totals div:nth-child(2n+1) { border-inline-start: 0; }
  .totals div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .totals div:last-child { grid-column: span 2; }
  .totals output { font-size: 19px; }
  .table { font-size: 13px; }
  .table th, .table td { padding: 7px 5px; }
  .guide { grid-template-columns: 1fr; }
  .section { padding: 54px 0; }
}
@media (max-width: 560px) {
  .actions .stamp, .vs-dd .stamp { width: 100%; }
  .hero-more { text-align: center; }
  .stamp-ink { white-space: normal; text-align: center; line-height: 1.3; padding-block: 10px; }
  .keep { white-space: normal; }
}
/* Small phones: the wordmark stays, a size smaller. */
@media (max-width: 380px) { .topline .brand { font-size: 17px; gap: 8px; } }
/* Below 380px the long case names need the room; the log headers may wrap again. */
@media (max-width: 380px) { .log thead th { white-space: normal; } }
/* Phones: the row number column goes (the totals keep the count) and, below 360px, the cells tighten, so a log with
   long case and item names, knife-or-gloves rows and four-digit values still fits without sideways scroll. */
@media (max-width: 420px) { .log th:first-child, .log td:first-child { display: none; } }
@media (max-width: 359px) { .log .table th, .log .table td { padding-inline: 3px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media (max-width: 340px) { .log td:nth-child(4) { font-size: 12px; letter-spacing: -.02em; } }
/* Very small phones: the sample ledger tightens so each row keeps to its ruled line. */
@media (max-width: 359px) { .ledger-art { padding-inline: 14px; } .ledger-art li { gap: 6px; font-size: 12.5px; grid-template-columns: 22px 1fr auto auto; } .ledger-art li b { font-size: 13.5px; padding-inline-start: 6px; } }

/* Blue pencil rules and a folded file keep the sample visually separate from the editable ledger. */
.topline { background: #f9f4e7; backdrop-filter: none; }
.hero { background: #f5eedb; padding-block: clamp(24px, 3.8vw, 56px); border-bottom: 4px double #ad9f85; }
.hero .page { border-block-start: 4px double #786c55; padding-top: 16px; }
.h1 { font-family: Georgia,serif; font-weight: 400; font-size: clamp(48px, 7.8vw, 112px); letter-spacing: -.061em; color: #442917; }
.hero-row { grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); align-items: center; gap: clamp(24px, 4vw, 64px); margin-top: 24px; }
.receipt-folder { position: relative; margin: 0 0 0 0; padding: 28px clamp(15px,3vw,40px) 12px; color: #fff3d4; background: repeating-linear-gradient(90deg, #671e1b 0 2px, #782b24 2px 4px); border-radius: 2px 12px 3px 4px; box-shadow: inset 8px 0 0 #4c1916; }
.ledger-art { transform: rotate(-1.5deg); background-color: #fff9e9; padding: 15px 16px 10px; color: var(--ink); border: 0; box-shadow: 0 5px 8px #36150c77; }
.ledger-tab { position: static; background: none; color: #8e3023; border-bottom: 1px dashed #9d8a70; margin: 0; padding: 0 0 9px; font: 650 11px/1.5 var(--mono); text-transform: uppercase; }
.ledger-art li { height: auto; min-height: 34px; grid-template-columns: 35px minmax(0,1fr) auto auto; }
.ledger-art li img { width: 35px; }
.ledger-art .ledger-net { border-top: 3px double #9d8a70; }
.receipt-folder figcaption { margin-top: 16px; font: 650 14px/1.5 var(--sans); }
.receipt-folder figcaption a { color: #fff3d4; text-underline-offset: 3px; }
.hero-copy .h1-sub { font-size: clamp(23px, 2.4vw, 35px); color: #5b2b1d; }
.hero-copy .lead { line-height: 1.55; }
.stamp { border-radius: 1px; }
@media (max-width: 760px) {
  .hero-row { grid-template-columns: minmax(0,1fr); gap: 20px; }
  .hero-copy { grid-row: 1; }
  .receipt-folder { padding: 16px 16px 9px; }
  .receipt-folder figcaption { margin-top: 10px; }
}

@media (max-width: 760px) {
  .hero-copy { display: contents; }
  .hero-row { gap: 16px; }
  .hero-copy .actions { margin: 0; }
  .receipt-folder { order: 1; }
  .hero-copy .lead { order: 2; margin: 0; }
}

.ledger-spread { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(0,1fr); border-block:2px solid #29302d; }
.posting-slip,.statement { min-width:0; padding:clamp(15px,2.4vw,27px); }
.posting-slip { background:#eee8d7; }
.statement { background:#fffcf3; border-inline-start:5px double #b68070; }
.posting-slip .entry { grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; align-items:end; }
.posting-slip .entry .wide { grid-column:auto; }
.posting-slip .entry .wide:first-child,.posting-slip .entry .stamp { grid-column:1/-1; }
.entry label { min-width:0; }
.posting-slip .entry label span { color:#475046; }
.posting-slip .entry input,.posting-slip .entry select { border:0; border-bottom:1px solid #696c60; border-radius:0; background:#fffdf6; }
.statement .totals { display:flex; flex-direction:column; border:0; margin:0; height:100%; }
.statement .totals div { display:flex; justify-content:space-between; align-items:baseline; gap:14px; padding:8px 0; border:0; border-bottom:1px solid #bbb39f; }
.statement .totals div:nth-child(4) { flex:1; flex-wrap:wrap; align-content:center; padding:12px 0; }
.statement .totals #t-net { font:600 clamp(28px,4vw,62px)/1.05 var(--serif,Georgia,serif); overflow-wrap:anywhere; max-width:100%; }
.statement .totals span { color:#454940; }
.statement .totals output { font-size:clamp(15px,1.6vw,23px); min-width:0; }
.tracker .tools { margin:0; padding-block:14px; border-bottom:1px solid #93988b; }
.log-case { float:inline-start; width:44px; height:34px; margin-inline-end:7px; object-fit:contain; }
.log { scrollbar-color:#a9a18b #f7f2e6; }
.tracker .log td { border-bottom-color:#b9c9cc; }
.tracker .log tbody tr:nth-child(even) { background:#f0ede2; }
.tracker .vs { border-block:2px solid #353d37; padding-block:13px; }
.tracker .vs .table td:nth-child(2) { background:#efe8d5; }
.tracker .sub { font:600 19px var(--serif,Georgia,serif); text-transform:none; color:var(--ink); }
@media(max-width:720px) {
  .ledger-spread { grid-template-columns:minmax(0,1fr); }
  .statement { border:0; border-top:4px double #b68070; }
  .statement .totals { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:3px 14px; }
  .statement .totals div { display:block; }
  .statement .totals div:nth-child(4) { padding:8px 0; grid-column:1/-1; grid-row:1; }
  .tracker .log .log-case { float:none; width:36px; height:25px; display:block; }
}

h1 { overflow-wrap: anywhere; }
header :has(> .lang) > a:not(.brand) { min-inline-size: 0; white-space: normal; overflow-wrap: anywhere; text-align: center; }

@media (max-width: 640px) {
  main, footer { overflow-wrap: anywhere; }
  main .btn { white-space: normal; text-align: center; }
  header > div:has(.lang) { position: relative; gap: 8px; min-height: 58px; height: auto; padding-block: 6px; }
  header:has(.lang) .brand { min-inline-size: 0; white-space: normal; overflow-wrap: anywhere; }
  header:has(.lang) .brand .mark { flex: 0 0 auto; }
  header .lang { position: static; flex: 0 0 auto; }
  header .lang summary > span { display: none; }
  header .lang nav { max-inline-size: 100%; z-index: 20; }
}
