html { scrollbar-gutter: stable; }
body { padding: 0; }
[hidden] { display: none !important; }
.tool-page { display: grid; gap: 18px; padding: 2px; }
.hero h1 { margin: 0 0 6px; font-size: 24px; font-weight: 800; }
.hero p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 16px; }
.card { min-width: 0; padding: 18px 20px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.section-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
h2 { margin: 0; font-size: 16px; font-weight: 700; }
.section-sub { margin: 10px 0 16px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.field-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; }
.input { display: block; width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: #fbfbfd; color: var(--text); font: 13px/1.8 "Noto Sans SC", sans-serif; resize: vertical; overflow-wrap: anywhere; }
.source-input { min-height: 360px; }
.result-output { min-height: 280px; background: #f8fafc; }
.result-count { margin-left: 6px; color: var(--accent); font-weight: 700; }
.headcount-result { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; margin-top: 18px; }
.headcount-output { width: 140px; color: var(--accent); font-size: 20px; font-weight: 700; }
.headcount-result p { flex: 1 1 160px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.btn { min-height: 38px; border: 0; border-radius: 10px; padding: 9px 14px; background: var(--accent); color: #fff; font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: opacity 150ms ease; }
.btn.secondary { background: #e5e7eb; color: var(--text); }
.btn.text-button { min-height: 34px; background: transparent; color: var(--accent); padding: 6px 0 6px 10px; }
.btn:hover:not(:disabled) { opacity: .82; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible, summary:focus-visible, .input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.msg { min-height: 20px; margin: 10px 0 0; color: #166534; font-size: 12px; line-height: 1.7; }
.msg.error { color: #b42318; }
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--border); gap: 12px; }
.summary dt { font-size: 12px; color: var(--muted); }
.summary dd { margin: 5px 0 0; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.summary div:last-child dd { color: var(--accent); }
.result-note { margin: 16px 0 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: #f8fafc; color: var(--muted); font-weight: 500; }
.removed-details { margin-top: 16px; font-size: 12px; }
.removed-details summary { width: fit-content; color: var(--accent); cursor: pointer; padding: 4px 0; }
.uid-list { margin-bottom: 0; color: var(--muted); overflow-wrap: anywhere; line-height: 1.8; }
@media (max-width: 820px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .source-input { min-height: 300px; }
  .result-output { min-height: 190px; }
}
@media (max-width: 420px) {
  .card { padding: 16px; }
  .hero h1 { font-size: 22px; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}
