:root {
  color-scheme: light;
  --paper: #f6f4ee;
  --card: #fffefa;
  --ink: #262927;
  --muted: #5c625e;
  --line: #d9d8d0;
  --accent: #103d36;
  --accent-strong: #0b302b;
  --mono: ui-monospace, "SF Mono", Consolas, "Liberation Mono", monospace;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible,
.file-pick:has(input:focus-visible), .folder-pick:has(input:focus-visible) {
  outline: 3px solid #166cbb;
  outline-offset: 3px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
}
.skip-link {
  position: absolute;
  z-index: 1;
  left: 1rem;
  top: -5rem;
  padding: .7rem;
  color: var(--ink);
  background: var(--card);
}
.skip-link:focus { top: 1rem; }

.page-width { width: min(1160px, calc(100% - 64px)); margin-inline: auto; }
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.header-content { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-size: 1.15rem; font-weight: 740; letter-spacing: -.025em; text-decoration: none; }
.brand-symbol {
  display: grid;
  grid-template-columns: repeat(2, 5px);
  grid-template-rows: repeat(2, 5px);
  gap: 3px;
  justify-content: center;
  align-content: center;
  width: 33px;
  height: 33px;
  color: #e8f0d1;
  background: var(--accent);
  border-radius: 7px;
}
.brand-symbol i { background: currentColor; border-radius: 1px; }
.brand-symbol i:first-child { grid-row: span 2; }
.brand-symbol i:last-child { background: #a9bc78; }
.maker { font: 650 .72rem var(--mono); letter-spacing: .1em; color: var(--accent); }

main.page-width { padding-bottom: 56px; }
.intro {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1.7rem;
  padding-block: 52px 29px;
}
.intro h1 {
  margin: 0 0 9px;
  color: #16332f;
  font-size: clamp(2.15rem, 5.4vw, 3.55rem);
  font-weight: 760;
  line-height: 1.02;
  letter-spacing: -.052em;
}
.intro p { max-width: 570px; margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.55; }
.intro-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 13px; flex: none; }
.action {
  display: inline-flex;
  gap: .75rem;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: .6rem .83rem;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: .89rem;
  font-weight: 690;
  white-space: nowrap;
}
.action-primary { color: #fbfff3; background: var(--accent); }
.action-primary:hover { background: var(--accent-strong); }
.action-primary:disabled { opacity: .69; }
.quiet-link { display: inline-flex; align-items: center; min-height: 42px; color: var(--accent); font-size: .84rem; text-underline-offset: 3px; }
.quiet-link:hover { color: #6c351a; }

.inputs-panel { padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.staging { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.source-card { min-width: 0; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.source-card:focus-within { overflow: visible; }
.source-card:has(.file-input:focus-visible) { border-color: transparent; }
.file-pick { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 62px; padding: 9px; border-radius: 6px; cursor: pointer; }
.file-pick:hover { background: #f1f3eb; }
.file-number {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 5px;
  color: var(--accent);
  background: #e6ece0;
  font: 740 .8rem var(--mono);
}
.file-content { display: grid; gap: 3px; }
.file-content strong { font-size: .86rem; font-weight: 700; }
.file-content small { margin-inline-start: 3px; color: var(--muted); font-size: .7rem; font-weight: 400; }
.file-name { overflow: hidden; color: var(--muted); font-size: .77rem; text-overflow: ellipsis; white-space: nowrap; }
.has-file .file-name { color: var(--accent); font-family: var(--mono); }
.file-plus { align-self: start; color: var(--accent); font-size: 1.05rem; margin-inline-end: 2px; }
.source-card.has-file { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: start; align-items: center; }
.source-card.has-file .file-pick { grid-template-columns: 32px minmax(0, 1fr); }
.has-file .file-plus { display: none; }
.source-clear {
  min-height: 34px;
  margin-right: 5px;
  padding: 0 6px;
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  font-size: .71rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.source-clear:hover { color: var(--accent); }
.source-options {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 0 12px;
  align-items: center;
  padding-inline: 10px;
  border-top: 1px solid var(--line);
}
.source-action {
  display: inline-flex;
  align-items: center;
  min-height: 39px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  color: var(--accent);
  background: transparent;
  font-size: .77rem;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.source-action:hover { color: #6c351a; }
.source-progress {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 9px;
  padding: 0 10px 8px;
  color: var(--muted);
  font: .74rem var(--mono);
}
.source-progress progress { flex: 1; min-width: 0; height: 8px; accent-color: var(--accent); }
.source-error { grid-column: 1 / -1; margin: 0; padding: 0 10px 8px; color: #813b24; font-size: .76rem; overflow-wrap: anywhere; }
.form-foot { display: flex; flex-wrap: wrap; gap: 9px 16px; align-items: center; padding-top: 10px; }
.input-help { flex: 1 1 215px; min-width: 0; color: var(--muted); font-size: .77rem; }
.privacy { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.folder-guidance { margin: 4px 0 0; line-height: 1.4; }
.privacy-mark { width: 7px; height: 7px; border-radius: 50%; background: #487840; }
.prefix-control { display: flex; gap: 7px; align-items: center; color: var(--muted); font-size: .76rem; }
.prefix-control input {
  width: 116px;
  min-height: 38px;
  padding: 5px 8px;
  border: 1px solid #b4b9ae;
  border-radius: 5px;
  color: var(--ink);
  background: var(--card);
}
.action-compare { min-height: 38px; border-color: #becbbd; color: var(--accent); background: #e7ede2; }
.action-compare:hover:not(:disabled) { background: #d8e4d1; }
.action-compare:disabled { color: #626d62; background: #f0f1eb; }
.error, .notice { margin: 10px 0 0; padding: 10px 13px; border-radius: 5px; font-size: .86rem; overflow-wrap: anywhere; }
.error { color: #813b24; background: #fce9dd; }
.notice { color: var(--accent); background: #e8eee3; }

.empty-result {
  display: flex;
  min-height: 136px;
  align-items: center;
  gap: 15px;
  margin-top: 17px;
  padding: 22px;
  border: 1px dashed #c5c7be;
  border-radius: 8px;
}
.empty-symbol { display: grid; gap: 4px; padding: 10px; border: 1px solid #c5cec1; border-radius: 5px; }
.empty-symbol i { width: 18px; height: 2px; background: #668172; }
.empty-symbol i:nth-child(2) { width: 12px; }
.empty-result h2 { margin: 0 0 4px; font-size: .98rem; }
.empty-result p { margin: 0; color: var(--muted); font-size: .87rem; }

.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-block: 17px 11px;
}
.summary-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .4rem;
  min-width: 0;
  min-height: 51px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--card);
  text-align: left;
}
.summary-stat:hover { border-color: #899888; }
.summary-stat[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.summary-label { display: inline-flex; align-items: center; gap: .46rem; font-size: .83rem; font-weight: 680; }
.summary-value { font: 730 1.32rem var(--mono); }
.status-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #768379; }
.is-added .status-dot, .is-matched .status-dot { background: #527744; }
.is-removed .status-dot, .is-missing .status-dot { background: #b44734; }
.is-modified .status-dot, .is-mismatched .status-dot { background: #a96d15; }
.report-controls { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px 12px; margin-block-end: 11px; }
.report-controls label { display: flex; align-items: center; gap: 6px; min-height: 38px; color: var(--muted); font-size: .78rem; }
.report-controls input { accent-color: var(--accent); }
.result-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-items: start; }
.result-grid.has-receipt { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.result-card { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 12px 13px; }
.card-head h2 { margin: 0; color: #16332f; font-size: 1rem; }
.card-head p { overflow-wrap: anywhere; margin: 4px 0 0; color: var(--muted); font-size: .77rem; line-height: 1.4; }
.text-button { flex: 0 0 auto; min-height: 33px; padding: 5px 7px; color: var(--accent); background: #edf1e8; border: 1px solid transparent; border-radius: 5px; font-size: .75rem; }
.text-button:hover { border-color: #899888; }
.text-button[aria-pressed="true"] { border-color: #a0ae98; }
.file-list { border-top: 1px solid var(--line); }
.file-entry:not(:last-child), .receipt-item { border-bottom: 1px solid #e8e8df; }
.file-entry summary, .receipt-item summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 9px;
  min-height: 38px;
  align-items: center;
  padding: 6px 13px;
  cursor: pointer;
  list-style: none;
}
.file-entry summary::-webkit-details-marker, .receipt-item summary::-webkit-details-marker { display: none; }
.file-entry summary:hover, .receipt-item summary:hover { background: #f0f2ea; }
.file-entry summary::after, .receipt-item summary::after { content: "›"; color: var(--muted); font-size: 1.2rem; line-height: 1; transform: rotate(90deg); }
.file-entry[open] summary::after, .receipt-item details[open] summary::after { transform: rotate(-90deg); }
.filename { min-width: 0; overflow-wrap: anywhere; font: .76rem/1.35 var(--mono); }
.file-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 13px;
  padding: 4px 13px 11px;
  color: var(--muted);
  background: #f8f8f2;
}
.file-detail dt { margin-top: 6px; font-size: .74rem; font-weight: 695; }
.file-detail dd { margin: 5px 0 0; font: .72rem/1.4 var(--mono); overflow-wrap: anywhere; }
.tag, .state-badge { width: fit-content; padding: 3px 5px; border-radius: 4px; color: #4e5f53; background: #e9eee7; font-size: .66rem; font-weight: 690; white-space: nowrap; }
.tag.is-added, .tag.is-matched, .state-badge.is-succeeded { color: #315b2d; background: #e4eedc; }
.tag.is-removed, .tag.is-missing, .state-badge.is-failed { color: #923f30; background: #f7e6df; }
.tag.is-modified, .tag.is-mismatched, .state-badge.is-incomplete { color: #785016; background: #f5ebd3; }
.receipt-totals { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 12px 9px; }
.receipt-totals .tag { padding: 5px 6px; }
.receipt-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.receipt-item .file-detail { margin: 0; }
.receipt-note { margin: 0; padding: 9px 12px; color: var(--muted); font-size: .73rem; line-height: 1.45; }
.show-more { margin: 8px 12px; }
.list-empty { margin: 0; padding: 12px; color: var(--muted); font-size: .79rem; }

@media (max-width: 900px) {
  .page-width { width: calc(100% - 44px); }
  .intro { align-items: start; flex-direction: column; gap: 13px; padding-block: 36px 21px; }
}
@media (max-width: 690px) {
  .page-width { width: calc(100% - 28px); }
  .header-content { min-height: 60px; }
  .staging, .result-grid.has-receipt { grid-template-columns: minmax(0, 1fr); }
  .inputs-panel { padding: 10px; }
  .file-pick { min-height: 52px; }
  .form-foot { justify-content: space-between; }
  .input-help { flex-basis: 100%; }
  .source-action { min-height: 44px; }
  .intro h1 { max-width: 335px; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .file-detail { grid-template-columns: minmax(0, 1fr); }
}
