:root {
  --board: #cfd8e3;      /* архивный картон */
  --board-deep: #b5c2d1;
  --sheet: #ffffff;
  --ink: #1c2733;
  --muted: #5c6877;
  --stamp: #3a3aa6;      /* штемпельная краска */
  --amber: #a85a10;
  --tile-blue: #eef3f8;
  --tile-orange: #fbefe3;
  --line: #d5d8dd;
  --serif: "PT Serif", Georgia, "Times New Roman", serif;
  --sans: "PT Sans", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--board); color: var(--ink); font: 400 17px/1.5 var(--sans); }
h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--stamp); outline-offset: 2px; }

.top { display: flex; justify-content: space-between; align-items: center; max-width: 1180px; margin: 0 auto; padding: 18px 24px; }
.brand { font: 700 19px/1 var(--serif); }
.link { background: none; border: 0; padding: 4px 0; color: var(--ink); text-decoration: underline; cursor: pointer; }

/* Папка дела: вкладка сверху и картонный корешок */
.folder { position: relative; background: var(--sheet); border-radius: 0 6px 6px 6px; padding: 36px 40px 40px; }
.folder::before { content: ""; position: absolute; left: 0; top: -22px; width: 210px; height: 23px; background: var(--sheet); border-radius: 6px 26px 0 0; }

body.login { min-height: 100vh; display: grid; place-items: center; padding: 48px 16px; }
.login-folder { width: 100%; max-width: 430px; }
.login-folder h1 { font: 700 38px/1.1 var(--serif); }
.lead { color: var(--muted); margin: 8px 0 28px; }
label { display: block; font-weight: 700; margin-bottom: 6px; }
input[type=password] { width: 100%; padding: 12px 14px; border: 1px solid var(--muted); border-radius: 3px; background: var(--sheet); }
.error { color: #a32020; margin-top: 10px; }
button[type=submit]:not(.link), .btn { display: inline-block; margin-top: 18px; padding: 12px 22px; border: 0; border-radius: 3px; background: var(--stamp); color: #fff; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn.quiet { background: none; color: var(--ink); text-decoration: underline; padding: 8px 0; margin-top: 6px; font-weight: 400; }

#root { max-width: 1180px; margin: 0 auto; padding: 22px 24px 64px; }

.drop { min-height: 56vh; display: flex; flex-direction: column; justify-content: center; transition: background .15s; cursor: pointer; }
.drop.over { background: var(--tile-blue); }
.drop h1 { font: 700 clamp(30px, 5vw, 52px)/1.08 var(--serif); max-width: 16em; }
.drop p { color: var(--muted); margin-top: 14px; max-width: 34em; }

.run { max-width: 640px; }
.run h1 { font: 700 30px/1.15 var(--serif); margin-bottom: 4px; overflow-wrap: anywhere; }
.run .sub { color: var(--muted); margin-bottom: 24px; }
ol.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
ol.steps li { counter-increment: s; display: flex; gap: 14px; padding: 9px 0; border-top: 1px solid var(--line); color: var(--muted); }
ol.steps li::before { content: counter(s); width: 1.6em; text-align: right; font-variant-numeric: tabular-nums; }
ol.steps li.done { color: var(--ink); }
ol.steps li.done::before { content: "✓"; color: var(--stamp); font-weight: 700; }
ol.steps li.active { color: var(--ink); font-weight: 700; }
ol.steps li.failed { color: #a32020; font-weight: 700; }
.notice { margin-top: 22px; padding: 14px 16px; background: var(--tile-orange); border-radius: 3px; }

.result { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 14px; }
.side .btn { margin-top: 0; text-align: center; }
.check { position: relative; background: var(--sheet); border-radius: 6px; padding: 18px; min-height: 124px; }
.check p { position: relative; z-index: 1; font-size: 15px; }
.stamp { position: absolute; right: 12px; top: 14px; padding: 6px 10px; border: 3px solid var(--stamp); border-radius: 5px; color: var(--stamp); font: 700 15px/1.1 var(--serif); text-align: center; transform: rotate(-7deg); opacity: .78; animation: land .28s cubic-bezier(.2, 1.3, .4, 1) both; }
.check p.first { padding-right: 128px; }
@keyframes land { from { transform: rotate(-7deg) scale(1.9); opacity: 0; } to { transform: rotate(-7deg) scale(1); opacity: .78; } }
@media (prefers-reduced-motion: reduce) { .stamp { animation: none; } }
details { background: var(--sheet); border-radius: 6px; padding: 12px 18px; font-size: 15px; }
summary { cursor: pointer; font-weight: 700; }
details ul { margin: 10px 0 0; padding-left: 18px; }
details li { margin-bottom: 8px; }
details .why { color: var(--muted); display: block; font-size: 14px; }
.tablewrap { overflow-x: auto; margin-top: 10px; }
.cmp { border-collapse: collapse; font-size: 13px; width: 100%; }
.cmp th, .cmp td { padding: 4px 6px; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; }
.cmp th:nth-child(-n+2), .cmp td:nth-child(-n+2) { text-align: left; white-space: normal; }
.cmp tr.bad td { background: var(--tile-orange); }

/* Лист записки */
.sheet { background: var(--sheet); border-radius: 2px; padding: 44px 48px 52px; font: 400 15px/1.45 Arial, sans-serif; color: #2e333a; }
.sheet h1 { font: 700 23px/1.2 Arial, sans-serif; color: #22262c; }
.sheet .subt { color: #80868f; font-size: 13px; margin: 3px 0 14px; }
.sheet h2 { font: 700 16px/1.25 Arial, sans-serif; color: #1f4e79; margin: 20px 0 6px; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.tile { padding: 9px 11px 11px; }
.tile.blue { background: var(--tile-blue); } .tile.orange { background: var(--tile-orange); }
.tile .l { font-size: 12px; font-weight: 700; color: #80868f; line-height: 1.25; }
.tile .v { font-size: clamp(17px, 1.75vw, 21px); white-space: nowrap; font-weight: 700; color: #22262c; margin: 4px 0 2px; line-height: 1.15; }
.tile .s { font-size: 12px; line-height: 1.3; }
.law { display: flex; gap: 3px; margin: 8px 0; font-size: 12px; align-items: stretch; }
.law .t { flex: none; width: 112px; font-weight: 700; color: #80868f; padding: 4px 0; }
.law .seg { padding: 4px 7px; background: var(--tile-blue); color: #22262c; white-space: nowrap; }
.law .seg.none { background: var(--tile-orange); }
.dyn { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 4px; }
.dyn th, .dyn td { padding: 4px 7px; border-top: 1px solid var(--line); text-align: right; }
.dyn tr:last-child td { border-bottom: 1px solid var(--line); }
.dyn th { background: #f2f3f5; color: #80868f; font-size: 12px; }
.dyn th:first-child, .dyn td:first-child { text-align: left; }
.dyn td.b { font-weight: 700; color: #22262c; }
.sheet ul { margin: 0; padding: 0; list-style: none; }
.sheet li { padding-left: 14px; position: relative; margin-bottom: 5px; }
.sheet li::before { content: "•"; position: absolute; left: 0; color: #1f4e79; }
.sheet li b { color: #22262c; }

@media (max-width: 900px) {
  .result { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; order: -1; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet { padding: 24px 16px 32px; }
  .folder { padding: 28px 20px 30px; }
  #root { padding: 18px 16px 48px; }
  .top { padding: 14px 16px; }
  .law { flex-wrap: wrap; } .law .t { width: 100%; padding-bottom: 0; }
}
