/* PostPencil — design system. Cream paper, cobalt ink, stamp yellow, signal red. */
:root {
  --paper: #FAF3E6;
  --paper-2: #FFFCF5;
  --ink: #14161A;
  --ink-soft: #4A4A46;
  --cobalt: #1F3FCB;
  --cobalt-deep: #142A8C;
  --yellow: #FFC81E;
  --red: #E33B2C;
  --green: #1E7A4B;
  --line: rgba(20, 22, 26, .16);
  --line-strong: rgba(20, 22, 26, .34);
  --shadow: 0 1px 0 rgba(20,22,26,.06), 0 12px 28px -18px rgba(20,22,26,.55);
  --radius: 14px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  background-image:
    radial-gradient(circle at 12% 8%, rgba(255,200,30,.16), transparent 42%),
    radial-gradient(circle at 88% 4%, rgba(31,63,203,.10), transparent 40%);
  background-attachment: fixed;
}
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
a { color: var(--cobalt); }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 18px; }
.wrap-narrow { width: 100%; max-width: 620px; margin: 0 auto; padding: 0 18px; }

/* ---------- masthead ---------- */
.masthead {
  border-bottom: 2px solid var(--ink);
  background: var(--paper-2);
  position: sticky; top: 0; z-index: 40;
}
.masthead-in {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 18px; max-width: 1080px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 34px; height: 34px; flex: none;
  background: var(--cobalt); color: #fff;
  display: grid; place-items: center;
  border-radius: 9px; box-shadow: 3px 3px 0 var(--yellow);
  font-family: var(--serif); font-weight: 700; font-size: 19px;
}
.brand-name { font-family: var(--serif); font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.brand-sub { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-soft); }
.masthead-nav { display: flex; gap: 8px; align-items: center; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 2px solid var(--ink); background: var(--paper-2); color: var(--ink);
  padding: 11px 18px; border-radius: 999px; font-weight: 650;
  text-decoration: none; transition: transform .12s ease, box-shadow .12s ease;
  box-shadow: 2px 2px 0 var(--ink);
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
.btn-primary { background: var(--cobalt); color: #fff; box-shadow: 2px 2px 0 var(--ink); }
.btn-yellow { background: var(--yellow); color: var(--ink); }
.btn-ghost { box-shadow: none; border-width: 1px; border-color: var(--line-strong); }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 7px 13px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none !important; }

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--serif); letter-spacing: -.02em; margin: 0; }
h1 { font-size: clamp(34px, 8vw, 62px); line-height: 1.02; font-weight: 700; }
h2 { font-size: clamp(24px, 4.6vw, 34px); line-height: 1.12; }
h3 { font-size: 19px; }
.eyebrow {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .18em; color: var(--cobalt);
}
.lede { font-size: clamp(16px, 2.6vw, 19px); color: var(--ink-soft); }
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
.tiny { font-size: 11px; }
.mono { font-family: var(--mono); }

/* ---------- hero ---------- */
.hero { padding: 34px 0 8px; }
.hero h1 .hl {
  background: var(--yellow); padding: 0 .12em;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.hero-grid { display: grid; gap: 26px; }
@media (min-width: 900px) {
  .hero { padding: 56px 0 16px; }
  .hero-grid { grid-template-columns: 1.05fr .95fr; align-items: start; gap: 40px; }
}

/* ---------- drop zone ---------- */
.drop {
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper-2);
  padding: 26px 20px; text-align: center;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
  position: relative; overflow: hidden;
}
.drop.dragover { border-color: var(--cobalt); background: #FFF9E8; transform: scale(1.005); }
.drop-icon {
  width: 54px; height: 54px; margin: 0 auto 12px;
  border-radius: 12px; background: var(--yellow);
  border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  display: grid; place-items: center; font-size: 24px;
}
.drop h3 { margin-bottom: 6px; }
.drop .btn { margin-top: 14px; }
.drop-hint { margin-top: 12px; }

.filelist { list-style: none; padding: 0; margin: 14px 0 0; text-align: left; }
.filelist li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); padding: 9px 12px; margin-bottom: 7px; font-size: 14px;
}
.filelist .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filelist .fsize { color: var(--ink-soft); font-family: var(--mono); font-size: 12px; flex: none; }
.filelist .fdel { border: 0; background: none; color: var(--red); font-weight: 700; flex: none; }

/* ---------- docket ---------- */
.docket {
  background: var(--paper-2);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
}
.docket-head {
  background: var(--cobalt); color: #fff;
  padding: 14px 18px; border-radius: 12px 12px 0 0;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.docket-head .ref { font-family: var(--mono); font-size: 13px; opacity: .95; }
.docket-body { padding: 16px 18px 18px; }
.rule {
  border: 0; border-top: 2px dashed var(--line-strong);
  margin: 14px 0; position: relative;
}
.row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; padding: 7px 0; border-bottom: 1px dotted var(--line);
}
.row:last-child { border-bottom: 0; }
.row .n { font-family: var(--mono); font-weight: 700; font-size: 17px; }
.row .lbl { color: var(--ink-soft); }
.total {
  display: flex; align-items: baseline; justify-content: space-between;
  background: var(--yellow); border: 2px solid var(--ink); border-radius: 12px;
  padding: 13px 16px; margin-top: 14px;
}
.total .amt { font-family: var(--serif); font-size: 30px; font-weight: 700; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 3px 10px; font-size: 12px; font-weight: 650; background: var(--paper);
}
.chip-warn { background: #FFF0C9; border-color: #C99A00; }
.chip-danger { background: #FFE2DE; border-color: var(--red); color: #8E1E13; }
.chip-ok { background: #DFF3E7; border-color: var(--green); color: #14522F; }

/* ---------- stamp ---------- */
.stamp {
  display: inline-grid; place-items: center; text-align: center;
  padding: 10px 14px; background: var(--paper);
  border: 2px solid var(--cobalt); color: var(--cobalt);
  border-radius: 6px; font-family: var(--serif); font-weight: 700;
  transform: rotate(-2.2deg);
  mask-image: radial-gradient(circle at 0 0, transparent 5px, #000 6px);
}
.stamp.red { border-color: var(--red); color: var(--red); transform: rotate(2.4deg); }

/* ---------- steps ---------- */
.steps { display: grid; gap: 16px; margin: 26px 0; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step {
  border: 2px solid var(--ink); border-radius: var(--radius);
  background: var(--paper-2); padding: 18px; box-shadow: 3px 3px 0 var(--ink);
}
.step .num {
  width: 30px; height: 30px; border-radius: 50%; background: var(--cobalt); color: #fff;
  display: grid; place-items: center; font-family: var(--mono); font-weight: 700; margin-bottom: 10px;
}
.step:nth-child(2) .num { background: var(--red); }
.step:nth-child(3) .num { background: var(--ink); }

/* ---------- price table ---------- */
.prices { width: 100%; border-collapse: collapse; margin-top: 12px; }
.prices th, .prices td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.prices th { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-soft); }
.prices td.n { font-family: var(--mono); text-align: right; font-weight: 700; }
@media (max-width: 520px) { .prices td.n { font-size: 14px; } }

/* ---------- progress ---------- */
.bar { height: 12px; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--paper); }
.bar > i { display: block; height: 100%; width: 0%; background: var(--cobalt); transition: width .25s ease; }
.spin {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--line-strong); border-top-color: var(--cobalt);
  animation: spin .8s linear infinite; display: inline-block; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .55 } }

/* ---------- panels / cards ---------- */
.card {
  border: 2px solid var(--ink); border-radius: var(--radius);
  background: var(--paper-2); padding: 16px; box-shadow: 2px 2px 0 var(--ink);
}
.stack > * + * { margin-top: 14px; }
.grid2 { display: grid; gap: 12px; }
@media (min-width: 620px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 14px; }
.kv b { font-family: var(--mono); }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft); padding: 8px 6px; border-bottom: 2px solid var(--ink); }
table.list td { padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
input[type=text], input[type=password], input[type=number], textarea, select {
  width: 100%; border: 2px solid var(--ink); border-radius: 10px; background: var(--paper-2);
  padding: 11px 12px; font: inherit; color: var(--ink);
}
label { font-size: 13px; font-weight: 650; display: block; margin-bottom: 5px; }
footer { margin-top: 40px; padding: 22px 0 34px; border-top: 2px solid var(--ink); color: var(--ink-soft); font-size: 13px; }
.hidden { display: none !important; }
.center { text-align: center; }
.tape {
  position: absolute; top: -12px; left: 22px; width: 74px; height: 22px;
  background: rgba(255,200,30,.75); transform: rotate(-3deg);
  border-left: 2px solid rgba(20,22,26,.2); border-right: 2px solid rgba(20,22,26,.2);
}
