:root {
  color: #172033;
  background: #f3f6f8;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.55;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: #0f4c81; }
header {
  background: #fff;
  border-bottom: 1px solid #d5dee7;
  position: sticky;
  top: 0;
  z-index: 2;
}
header a { color: #17324d; text-decoration: none; }
.wrap { width: min(1080px, calc(100% - 32px)); margin: 0 auto; }
.bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px 16px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  min-height: 56px;
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: -0.03em; font-size: 18px; }
.brand img { width: 30px; height: 30px; display: block; }
nav { display: flex; flex-wrap: nowrap; gap: 6px 8px; font-size: 15px; }
nav a {
  border-radius: 999px;
  padding: 6px 10px;
  color: #24364a;
}
nav a[aria-current="page"] { background: #17324d; color: #fff; }
.menu-button { display: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.bars, .bars::before, .bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: #17324d;
  border-radius: 2px;
  position: relative;
}
.bars::before, .bars::after { content: ""; position: absolute; left: 0; }
.bars::before { top: -6px; }
.bars::after { top: 6px; }
nav.scenarios {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 12px;
}
nav.scenarios a {
  background: #e7eef4;
  font-size: 15px;
}
.langs { display: flex; flex-wrap: wrap; gap: 8px; }
.langs a { font-size: 15px; }
.langs a[aria-current="true"], .lang-menu a[aria-current="true"] { font-weight: 700; text-decoration: underline; }
.bar-end { display: contents; }
.lang-slot { display: none; position: relative; }
.lang-button {
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 4px 8px;
  border: 1px solid #c5d2de;
  border-radius: 999px;
  background: #fff;
  color: #17324d;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}
.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 8rem;
  padding: 8px;
  background: #fff;
  border: 1px solid #d5dee7;
  border-radius: 12px;
}
.mini { display: grid; gap: 14px; margin-top: 14px; }
.mini-set { display: grid; gap: 6px; }
.mini-label { margin: 0; font-size: 15px; font-weight: 700; }
.mini-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.mini-raw {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #c5d2de;
  border-radius: 8px;
  background: #f4f7fa;
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 13px;
  white-space: pre;
}
table.sheet { width: auto; border-collapse: collapse; }
table.sheet th, table.sheet td { border: 1px solid #b7c6d4; padding: 4px 8px; }
table.sheet th.corner, table.sheet th.idx { background: #e7eef3; color: #5c6b73; text-align: center; font-weight: 600; }
.scenario-qa h3 { margin: 14px 0 4px; font-size: 18px; font-weight: 700; }
.scenario-qa p { margin: 0; }
h1 {
  font-size: 44px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
}
h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 8px; }
.lead, .explain p, .faq p, .cards p, .reassure, .trust { font-size: 18px; font-weight: 400; }
.lead { color: #24364a; max-width: 44rem; }
main { padding: 28px 0 56px; }
.cards { display: grid; grid-template-columns: 1fr; gap: 20px; }
.cards a, .panel, .faq details {
  background: #fff;
  border: 1px solid #d7e0e8;
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(23, 32, 51, 0.06);
}
.cards a { display: block; padding: 22px; text-decoration: none; color: inherit; }
.tool-card { display: grid; grid-template-columns: 52px 1fr; column-gap: 14px; row-gap: 6px; align-items: start; }
.tool-card h2, .tool-card p { grid-column: 2; }
.tool-card h2 { grid-row: 1; }
.tool-card p { grid-row: 2; }
.mark {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
}
.mark svg { width: 26px; height: 26px; }
.mark-combine { background: #c2410c; }
.mark-convert { background: #0f6e56; }
.mark-split { background: #1d4ed8; }
.mark-large { background: #7c3aed; }
.mark-dedupe { background: #3e5c8a; }
.cards a:hover { border-color: #8eb0c8; }
.cards h2 { color: #12324d; }
.more { margin-top: 28px; }
.panel, .howto, .faq, .explain { margin-top: 18px; }
.panel { padding: 18px; }
.howto ol { padding-left: 1.3rem; }
.faq details { padding: 12px 16px; margin-top: 10px; }
.faq summary { cursor: pointer; font-weight: 700; }
label, button, select, input, textarea { font: inherit; }
.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 12px;
  min-height: 180px;
  margin-bottom: 16px;
  padding: 22px 18px;
  border-radius: 18px;
  background: #17324d;
  color: #f7fbff;
  text-align: center;
  cursor: pointer;
}
.drop.over { outline: 3px solid #8fd0c6; }
.file-hero { display: flex; justify-content: center; color: #fff; }
.file-hero svg { width: 48px; height: 48px; }
.choose svg { width: 20px; height: 20px; }
.drop-copy, .size-hint, .note, footer, nav, .langs { font-size: 15px; }
.drop-copy { font-weight: 400; }
.size-hint { font-weight: 400; }
.choose {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: min(320px, 100%);
  align-self: center;
  min-height: 56px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #fff;
  color: #17324d;
  font-weight: 700;
  font-size: 18px;
}
.reassure, .trust { margin: 14px 0 10px; font-weight: 600; }
.nowrap { white-space: nowrap; }
.chosen { display: block; font-weight: 600; }
.chosen:empty { display: none; }
.guide { margin-top: 22px; }
.guide ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.guide li { display: flex; gap: 10px; align-items: flex-start; }
.step-icon { width: 28px; height: 28px; flex: none; }
.mini table { border-collapse: collapse; font-size: 13px; background: #fff; }
.mini th, .mini td { border: 1px solid #c5d2de; padding: 2px 6px; }
.scenario-note { margin-top: 22px; }
.trademark { margin: 10px 0 0; }
.save-as { display: inline-flex; gap: 8px; align-items: center; }
#parts { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
#parts li { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
#download-all, #parts button { display: inline-flex; align-items: center; gap: 6px; }
#download-all[hidden] { display: none; }
.trust { display: flex; gap: 8px; align-items: center; }
.drop input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.controls { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: center; width: 100%; min-width: 0; max-width: 100%; }
.panel, .results { max-width: 100%; min-width: 0; }
button, select, input[type="number"], input[type="search"] {
  min-height: 46px;
  border-radius: 10px;
}
select, input[type="number"], input[type="search"] {
  border: 1px solid #c5d2de;
  background: #fff;
  color: inherit;
  padding: 8px 10px;
  max-width: 100%;
  min-width: 0;
}
@media (max-width: 767px) {
  .controls select { width: 100%; max-width: 100%; min-width: 0; }
}
button {
  border: 0;
  padding: 10px 16px;
  background: #d7e4ee;
  color: #17324d;
  font-weight: 600;
  font-size: 18px;
  cursor: pointer;
}
button.primary {
  min-height: 56px;
  padding: 12px 22px;
  background: #0f6e56;
  color: #fff;
  font-weight: 700;
}
button.primary:disabled { background: #c5d0d6; color: #5c6b73; cursor: default; }
button.text-link {
  background: transparent;
  color: #0f4c81;
  font-weight: 600;
  font-size: 15px;
  min-height: 0;
  padding: 4px 0;
  text-decoration: underline;
}
button.quiet { background: #e7eef3; color: #17324d; }
.results { display: grid; gap: 12px; margin-top: 16px; }
.results:not(:has(:not(:empty):not([hidden]))) { display: none; margin: 0; }
#parts:empty, .preview:empty, .results p:empty { display: none; margin: 0; }
.readback { margin: 0; font-weight: 700; }
.preview { max-width: 100%; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: #fff; }
th, td { border-bottom: 1px solid #e1e8ef; text-align: left; padding: 8px 10px; overflow-wrap: anywhere; vertical-align: top; }
th { background: #f7fafc; }
.note { color: #314455; }
.csv-hint { margin: 0; max-width: 40rem; font-size: 15px; font-weight: 400; }
.error:empty { display: none; }
.error {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fde8e4;
  color: #8a2e22;
  font-weight: 700;
}
#parts { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
#parts li { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
#columns { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.pager { display: inline-flex; gap: 8px; }
footer {
  border-top: 1px solid #d5dee7;
  padding: 22px 0 32px;
  color: #1c2834;
  font-size: 15px;
  background: #fff;
}
footer a { margin-right: 14px; font-weight: 600; }
footer .footer-links { font-size: 15px; }
@media (min-width: 840px) {
  .cards { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 768px) {
  .site-menu { display: contents; }
  .bar { align-items: center; }
}
@media (max-width: 767px) {
  header { position: sticky; }
  .wrap { width: min(1080px, calc(100% - 20px)); }
  .bar { flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; min-height: 0; }
  .bar-end { display: flex; align-items: center; gap: 6px; flex: none; }
  .lang-slot { display: block; flex: none; }
  .lang-button, .menu-button {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    min-height: 40px;
    max-height: 40px;
    line-height: 1;
    flex: none;
  }
  .lang-button { padding: 0 8px; }
  .menu-button { width: 40px; padding: 0; }
  .site-menu .langs { display: none; }
  .brand { min-width: 0; font-size: 16px; line-height: 1; }
  .brand img { width: 30px; height: 30px; }
  .site-menu { display: none; }
  header.is-open .site-menu {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: #fff;
    border-bottom: 1px solid #d5dee7;
    padding: 8px 16px 16px;
    max-height: calc(100vh - 64px);
    overflow: auto;
  }
  nav.scenarios { overflow: visible; }
  main { padding-top: 6px; }
  h1 { font-size: 32px; margin-bottom: 4px; }
  .lead { margin: 0 0 6px; }
  .drop { min-height: 112px; padding: 10px 12px; gap: 6px; margin-bottom: 8px; }
  .panel { padding: 12px; }
  .file-hero svg { width: 32px; height: 32px; }
  .choose { width: 100%; }
  .controls { flex-direction: column; align-items: stretch; }
  button.primary { width: 100%; }
  footer a, footer .footer-links a { white-space: nowrap; }
}
