:root {
  color-scheme: light;
  --ink: #17211b;
  --muted: #667269;
  --line: #d9e0db;
  --surface: #ffffff;
  --wash: #f4f7f4;
  --green: #12643b;
  --green-dark: #0b4d2c;
  --green-soft: #e7f3eb;
  --danger: #a33a2d;
  font-family: Inter, "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--wash); color: var(--ink); }
button, input, textarea { font: inherit; }
.tool-header { height: 68px; padding: 0 5vw; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid #dcd8ce; background: #fff; }
.header-brand { display: flex; align-items: center; gap: 24px; min-width: 0; }
.top-link { padding-right: 24px; border-right: 1px solid #d6d3ca; color: #66736b; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-decoration: none; white-space: nowrap; }
.top-link:hover { color: #c65d38; }
.tool-title { color: var(--ink); font-size: 18px; font-weight: 850; letter-spacing: -.02em; white-space: nowrap; }
.tool-title span { color: #c65d38; }
.header-privacy { color: #738078; font-size: 12px; white-space: nowrap; }
.app-shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 64px; }
.toolbar, .actions, .dialog-heading, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.eyebrow { margin: 0 0 6px; color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 5px; font-size: clamp(30px, 4vw, 48px); letter-spacing: -.045em; }
h2 { margin-bottom: 5px; font-size: 19px; }
.subtitle, .upload-card p, .muted { margin-bottom: 0; color: var(--muted); }
.upload-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; margin-bottom: 18px; padding: 22px; border: 1px dashed #9db8a6; border-radius: 16px; background: #f9fcfa; transition: .18s ease; }
.upload-card.dragover { border-color: var(--green); background: var(--green-soft); transform: translateY(-1px); }
.upload-actions { display: flex; align-items: center; gap: 8px; }
.upload-icon { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 12px; background: var(--green); color: white; font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.workspace { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 12px 35px rgba(22, 45, 31, .06); }
.toolbar { padding: 20px 22px; border-bottom: 1px solid var(--line); }
.search-tools { display: flex; align-items: center; gap: 8px; flex: 0 1 500px; }
.search-box { position: relative; flex: 1 1 330px; }
.button.compact { min-height: 42px; padding: 0 12px; font-size: 13px; }
.search-box input { width: 100%; min-height: 42px; padding: 0 38px 0 13px; border: 1px solid #bdc8c0; border-radius: 9px; background: white; }
.search-box input:focus { outline: 3px solid #d7ebdd; border-color: var(--green); }
.suggestions { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 5; overflow: auto; max-height: 270px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: 0 14px 35px rgba(22,45,31,.16); }
.suggestion { display: block; width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid #edf0ee; background: white; color: var(--ink); text-align: left; cursor: pointer; }
.suggestion:last-child { border-bottom: 0; }
.suggestion:hover, .suggestion:focus { background: var(--green-soft); outline: 0; }
.suggestion strong, .suggestion span { display: block; }
.suggestion span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.selection-summary { padding: 8px 12px; border-radius: 9px; background: var(--wash); font-size: 14px; }
.table-wrap { overflow: auto; max-height: 56vh; }
table { width: 100%; border-collapse: collapse; }
th { position: sticky; top: 0; z-index: 1; padding: 12px 14px; background: #f7f9f7; color: #516057; font-size: 12px; text-align: left; text-transform: uppercase; letter-spacing: .04em; }
td { padding: 13px 14px; border-top: 1px solid #edf0ee; font-size: 14px; vertical-align: middle; }
tbody tr:hover { background: #fafcfb; }
.check-col { width: 50px; text-align: center; }
.edit-col { width: 80px; text-align: right; }
.taxid-col { width: 160px; }
.copies-col { width: 150px; text-align: center; }
.copies-control { display: inline-grid; grid-template-columns: 30px 42px 30px; align-items: center; gap: 4px; }
.copies-control button, .copies-control input { height: 32px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--ink); text-align: center; }
.copies-control button { padding: 0; color: var(--green); font-size: 17px; font-weight: 800; cursor: pointer; }
.copies-control input { width: 42px; padding: 0 2px; appearance: textfield; }
.copies-control input::-webkit-inner-spin-button, .copies-control input::-webkit-outer-spin-button { margin: 0; appearance: none; }
.copies-control button:disabled, .copies-control input:disabled { opacity: .35; cursor: not-allowed; }
td.edit-col { text-align: right; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--green); cursor: pointer; }
.edit-button { border: 0; background: transparent; color: var(--green); font-weight: 750; cursor: pointer; }
.edit-button:hover { text-decoration: underline; }
.empty-row td { height: 130px; color: #849087; text-align: center; }
.actions { justify-content: flex-end; padding: 17px 22px; border-top: 1px solid var(--line); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 18px; border: 1px solid transparent; border-radius: 9px; font-weight: 750; cursor: pointer; transition: .15s ease; }
.button.primary { background: var(--green); color: white; }
.button.primary:hover { background: var(--green-dark); }
.button.secondary { border-color: var(--line); background: white; color: var(--ink); }
.button:disabled { opacity: .42; cursor: not-allowed; }
.error { margin: 16px 22px 0; padding: 11px 13px; border-radius: 8px; background: #fff1ef; color: var(--danger); font-size: 14px; }
dialog { width: min(680px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 16px; box-shadow: 0 30px 90px rgba(0,0,0,.22); }
dialog::backdrop { background: rgba(13, 24, 17, .52); backdrop-filter: blur(3px); }
.dialog-card { padding: 24px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.form-grid .full-width { grid-column: 1 / -1; }
.dialog-card label { display: grid; gap: 7px; font-size: 13px; font-weight: 800; }
.dialog-card textarea, .dialog-card input { width: 100%; padding: 11px 13px; border: 1px solid #bdc8c0; border-radius: 9px; font-weight: 400; line-height: 1.5; }
.dialog-card textarea { resize: vertical; }
.dialog-card textarea:focus, .dialog-card input:focus { outline: 3px solid #d7ebdd; border-color: var(--green); }
.dialog-card input::placeholder, .dialog-card textarea::placeholder { color: #9aa39d; opacity: 1; }
.icon-button { border: 0; background: transparent; color: #667269; font-size: 28px; cursor: pointer; }
.dialog-actions { justify-content: flex-end; margin-top: 20px; }
.small { font-size: 12px; }
.txt-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.txt-report { margin: 0 22px 16px; padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--wash); overflow-wrap: anywhere; }
.txt-report p { margin-bottom: 8px; }
.txt-report ul { padding-left: 20px; max-height: 280px; overflow: auto; }
.txt-report li { margin: 12px 0; }
.txt-candidates { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.txt-candidates button { white-space: normal; text-align: left; font-size: 12px; }
@media (max-width: 680px) {
  .tool-header { height: 60px; padding: 0 18px; }
  .header-brand { gap: 13px; }
  .top-link { padding-right: 13px; }
  .tool-title { font-size: 16px; }
  .header-privacy { font-size: 0; }
  .header-privacy::before { content: "Local processing"; font-size: 10px; }
  .app-shell { width: min(100% - 20px, 1120px); padding-top: 24px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-tools { align-items: stretch; flex-basis: auto; flex-direction: column; }
  .search-box { flex-basis: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full-width { grid-column: auto; }
  .upload-card { grid-template-columns: auto 1fr; }
  .upload-actions { grid-column: 1 / -1; align-items: stretch; flex-direction: column; }
  th:nth-child(3), td:nth-child(3) { display: none; }
  .copies-col { width: 132px; }
}
