:root {
  --page: #eef1f4;
  --card: #ffffff;
  --ink: #1c2430;
  --muted: #6b7682;
  --line: #e4e8ee;
  --soft: #f4f6f8;
  --head: #1a1d21;
  --head-ink: #f5f7f8;
  --green: #1f9d55;
  --link: #1d6fd6;
  --shadow: 0 10px 40px rgba(20, 28, 38, 0.16);
  --y: #ffe56a;
  --b: #c5dcff;
  --o: #ffd0a6;
  --lot-on: #e8ecef;
  --count-bg: #f6d4c4;
  --count-ink: #c56a42;
  --pill: #f1f1f4;
  --pill-ink: #1c2430;
  --row-head: #e8ecef;
  color-scheme: light;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}
:root[data-theme="dark"] {
  --page: #12171c;
  --card: #1c242c;
  --ink: #e7eef4;
  --muted: #9aabba;
  --line: #2d3944;
  --soft: #24303a;
  --lot-on: #2a3540;
  --count-bg: #5a3a2c;
  --count-ink: #ffd0b8;
  --pill: #2c3842;
  --pill-ink: #e4ebf1;
  --row-head: #24303a;
  --head: #0e1216;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--page);
  color: var(--ink);
  min-height: 100vh;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.top {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 64px;
  padding: 0 18px;
  background: var(--head);
  color: var(--head-ink);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.grid {
  width: 22px; height: 22px; border-radius: 5px;
  background:
    linear-gradient(#d7dde3, #d7dde3) 0 0 / 9px 9px no-repeat,
    linear-gradient(#d7dde3, #d7dde3) 13px 0 / 9px 9px no-repeat,
    linear-gradient(#d7dde3, #d7dde3) 0 13px / 9px 9px no-repeat,
    linear-gradient(#d7dde3, #d7dde3) 13px 13px / 9px 9px no-repeat;
}
.brand-name { font-weight: 700; font-size: 16px; line-height: 1.1; }
.brand-sub { color: #aeb6be; font-size: 12px; margin-top: 2px; }
.mode {
  display: flex;
  padding: 3px;
  border-radius: 10px;
  background: #2a2f35;
  gap: 2px;
}
.mode button {
  border: 0;
  background: transparent;
  color: #d5dbe1;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 14px;
}
.mode button.is-on { background: #f4f6f8; color: #1a1d21; font-weight: 650; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; position: relative; }
.ghost, .icon, .btn, .btn-line {
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
}
.ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #f2f5f7;
  padding: 7px 10px;
  border-radius: 8px;
}
.ghost:hover, .icon:hover { background: rgba(255,255,255,.08); }
.ghost svg, .icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.icon {
  width: 36px; height: 36px; border-radius: 8px; color: #f2f5f7;
  display: grid; place-items: center;
}
.search-pop {
  position: absolute;
  right: 0;
  top: 46px;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  width: 320px;
  box-shadow: var(--shadow);
}
.search-pop input, .lots-q, .kit-q {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
}
.search-pop input:focus, .lots-q:focus, .kit-q:focus { border-color: #8eb4e8; }
.lead {
  margin: 0;
  padding: 12px 22px 0;
  color: var(--muted);
  font-size: 13px;
}
.shell { display: grid; grid-template-columns: 280px 1fr; gap: 16px; padding: 14px 18px 28px; align-items: start; }
.lots, .result {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.lots { padding: 16px 12px 12px; position: sticky; top: 78px; }
.lots-h { display: flex; justify-content: space-between; align-items: center; font-size: 12px; letter-spacing: .06em; color: var(--muted); font-weight: 650; padding: 0 8px 12px; }
.q-wrap { position: relative; margin: 0 4px 8px; }
.q-wrap svg {
  position: absolute; left: 12px; top: 50%; width: 16px; height: 16px;
  transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 1.8; pointer-events: none;
}
.q-wrap .lots-q { padding-left: 36px; }
.count {
  background: var(--count-bg);
  color: var(--count-ink);
  border-radius: 999px;
  min-width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  padding: 0 7px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}
.lot {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 12px;
  padding: 10px 12px 9px;
  margin-top: 2px;
  font-weight: 400;
}
.lot.is-on { background: var(--lot-on); }
.lot.is-on .lot-name { font-weight: 400; }
.lot-name { display: block; font-weight: 400; font-size: 15px; line-height: 1.3; color: var(--ink); }
.lot-id, .tid, .tail, .unit, .empty { color: var(--muted); font-weight: 400; }
.lot-meta { display: block; margin-top: 3px; font-size: 13px; font-weight: 700; color: var(--ink); }
.lot-id { display: block; font-size: 12px; margin-top: 1px; }
.lots-empty { color: var(--muted); padding: 16px 8px; font-size: 14px; }
.panel { padding: 4px 4px 0; min-width: 0; background: transparent; border: 0; }
.panel-h { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.panel h1 { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.15; }
.subline { margin: 10px 0 0; font-size: 15px; color: #5c6770; }
.tid { margin: 6px 0 0; font-size: 13px; }
.badge {
  background: var(--green);
  color: white;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}
.chip { border-radius: 4px; padding: 0 4px; color: #1a1d21; font-weight: 400; }
.c0, .m-y { background: var(--y); }
.c1, .m-b { background: var(--b); }
.c2, .m-o { background: var(--o); }
.m-q { background: transparent; box-shadow: inset 0 -2px 0 #1f9d55; }
.table-card {
  margin-top: 16px;
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
}
table { width: 100%; border-collapse: collapse; margin: 0; }
th {
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  color: #5c6770;
  background: var(--row-head);
  padding: 14px 16px;
}
td { padding: 16px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14.5px; background: var(--card); }
.bill th:nth-child(1), .bill td:nth-child(1) { width: 46%; }
.bill th:nth-child(2), .bill td:nth-child(2) { width: 22%; }
.bill th:nth-child(3), .bill td:nth-child(3) { width: 10%; }
.bill th:nth-child(4), .bill td:nth-child(4) { width: 22%; }
.th-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: #5c6770; }
.th-label svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.th-label svg.tag { fill: currentColor; stroke: none; }
.cat {
  display: inline-block;
  font-size: 12px;
  font-weight: 400;
  color: var(--pill-ink);
  background: var(--pill);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 8px;
}
.name { line-height: 1.45; font-weight: 400; }
mark, mark.m-y, mark.m-b, mark.m-o, mark.m-q {
  font-weight: 400;
  border-radius: 3px;
  padding: 0 1px;
  color: #1a1d21;
}
.qty { font-weight: 700; white-space: nowrap; }
.unit { font-weight: 400; margin-left: 4px; color: var(--muted); }
.src-cell { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: baseline; }
.src {
  color: var(--link);
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.reqs { color: var(--muted); }
.kit { max-width: 1100px; margin: 0 auto; padding: 28px 18px 40px; }
.kit h1 { text-align: center; font-size: 32px; font-weight: 700; margin: 8px 0 18px; }
.kit-bar { display: flex; gap: 10px; align-items: center; }
.kit-wrap { flex: 1; margin: 0; }
.kit-wrap .kit-q { padding-left: 40px; }
.kit-q { width: 100%; padding: 12px 14px; border-radius: 12px; }
.btn {
  background: #1a1d21;
  color: white;
  border-radius: 12px;
  padding: 12px 18px;
  border: 0;
  font-weight: 600;
  white-space: nowrap;
}
:root[data-theme="dark"] .btn { background: #f2f5f7; color: #14181c; }
.btn-line {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  padding: 11px 16px;
  white-space: nowrap;
}
.examples { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 18px; }
.examples button {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}
.result { padding: 14px 16px 10px; }
.result-h {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-bottom: 8px;
}
.result-h h2 { margin: 0; font-size: 18px; font-weight: 700; }
.result-actions { display: flex; gap: 8px; }
.result-actions button {
  border: 1px solid var(--line); background: var(--soft); color: var(--ink);
  border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 400;
}
.obj { margin: 4px 0 8px; font-size: 14px; font-weight: 400; }
.obj .lab { font-weight: 700; margin-right: 4px; }
.found { color: var(--ink); font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; font-weight: 400; }
.found b { font-weight: 700; }
.filepill {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--soft); color: var(--ink);
  border-radius: 999px; padding: 4px 8px 4px 10px; font-size: 12px; font-weight: 400;
}
.filepill .dot {
  min-width: 18px; height: 18px; border-radius: 999px;
  display: inline-grid; place-items: center;
  background: #34c759; color: #fff; font-size: 11px; font-weight: 700; padding: 0 5px;
}
.vol {
  display: inline-flex; align-items: center; justify-content: center;
  width: max-content; min-width: 32px; height: 32px; padding: 0 10px;
  border-radius: 999px; background: var(--soft); color: var(--ink);
  font-size: 13px; font-weight: 400; line-height: 1; white-space: nowrap;
}
.kit-table td:first-child { white-space: nowrap; }
.cipher { font-weight: 700; white-space: nowrap; }
.type { font-weight: 400; color: #4a5560; line-height: 1.35; }
.tons { display: flex; gap: 6px; flex-wrap: wrap; }
.ton {
  border: 0; border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 400;
  background: #e8f0fe; color: #1d4ed8; cursor: pointer;
}
.ton:hover { background: #d7e6fd; text-decoration: underline; }
.none { color: var(--muted); font-size: 13px; font-weight: 400; }
.pages { display: flex; gap: 8px; flex-wrap: wrap; }
.pages button, .filelink {
  border: 0; background: none; color: var(--link); padding: 0;
  font-weight: 400; text-decoration: underline; text-underline-offset: 2px;
}
.kit-table { margin-top: 4px; }
.kit-table th { font-weight: 500; color: #5c6770; }
.miss { padding: 18px; color: var(--muted); }
.drawer {
  position: fixed; top: 64px; right: 0; bottom: 0; width: min(420px, 100%);
  background: var(--card); border-left: 1px solid var(--line);
  z-index: 30; padding: 16px; overflow: auto;
}
.drawer h2 { margin: 0 0 12px; font-size: 18px; }
.file {
  width: 100%; text-align: left; border: 1px solid var(--line); background: var(--soft);
  border-radius: 12px; padding: 10px 12px; margin-bottom: 8px;
}
.file b { display: block; font-weight: 650; }
.file span { color: var(--muted); font-size: 12px; }
.shade { position: fixed; inset: 64px 0 0 0; background: rgba(12,16,20,.35); z-index: 25; }
.modal {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center; padding: 24px;
  background: rgba(12,16,20,.45);
}
.box {
  width: min(920px, 100%);
  max-height: min(80vh, 720px);
  overflow: auto;
  background: var(--card);
  border-radius: 16px;
  padding: 16px 16px 18px;
  box-shadow: var(--shadow);
}
.box-h { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.box h3 { margin: 0; font-size: 16px; }
.box .sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.x { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 7px 12px; }
.preview { width: 100%; margin-top: 12px; }
.preview td, .preview th { font-size: 13px; }
.preview tr.is-on td { background: #fff4cc; font-weight: 700; }
:root[data-theme="dark"] .preview tr.is-on td { background: #3d3420; color: #fff8e8; }
:root[data-theme="dark"] .subline,
:root[data-theme="dark"] .cat { color: var(--muted); }
.page-mock {
  margin-top: 14px; border: 1px solid var(--line); border-radius: 12px;
  min-height: 220px; padding: 28px 22px; background: var(--soft);
}
.page-no { color: var(--muted); font-size: 12px; margin-bottom: 16px; }
.quote { font-size: 16px; line-height: 1.45; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .lots { position: static; }
  .top { gap: 10px; }
  .brand-sub { display: none; }
}
