:root {
  --ink: #17251f;
  --muted: #64716b;
  --line: #dce4df;
  --paper: #ffffff;
  --canvas: #f3f6f4;
  --green: #197a55;
  --green-dark: #125d41;
  --green-soft: #e7f3ed;
  --amber: #a46213;
  --amber-soft: #fff1d8;
  --shadow: 0 14px 34px rgba(25, 56, 42, .08);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); font-family: "Noto Sans JP", "Yu Gothic UI", "Hiragino Kaku Gothic ProN", sans-serif; }
button, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }

.site-header { height: 62px; display: flex; align-items: center; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.9); }
.brand { width: min(1180px, calc(100% - 40px)); margin: auto; display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: white; background: var(--green); font-size: 11px; letter-spacing: 0; }
.brand i { display: inline-block; height: 11px; width: 1px; margin: 0 8px; background: #b7c2bc; vertical-align: -1px; }

.app-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 58px 0 42px; }
.hero { max-width: 760px; margin-bottom: 38px; }
.eyebrow { margin: 0 0 14px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .18em; }
h1 { margin: 0; font-size: clamp(32px, 5vw, 54px); line-height: 1.18; letter-spacing: -.045em; }
.lead { max-width: 680px; margin: 20px 0 16px; color: var(--muted); font-size: 15px; line-height: 1.8; }
.privacy-note { display: inline-flex; align-items: center; gap: 7px; color: var(--green-dark); font-size: 12px; font-weight: 700; }
.privacy-note span { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--green-soft); }

.workspace { display: grid; grid-template-columns: minmax(340px, .8fr) minmax(540px, 1.2fr); gap: 18px; align-items: start; }
.input-panel, .result-panel { border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: var(--shadow); overflow: hidden; }
.input-panel { padding: 22px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-heading > div:first-child { display: flex; align-items: center; gap: 10px; }
.section-heading h2 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.step { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 10px; font-weight: 800; }
.text-button { padding: 5px 0; border: 0; background: transparent; color: var(--green); font-size: 12px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
textarea { display: block; width: 100%; min-height: 244px; resize: vertical; padding: 16px; border: 1px solid #cfd9d3; border-radius: 9px; outline: none; color: var(--ink); background: #fbfcfb; font-size: 14px; line-height: 1.75; transition: border-color .2s, box-shadow .2s; }
textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(25,122,85,.12); }
textarea::placeholder { color: #98a39e; }
.input-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
#lineCount { color: var(--muted); font-size: 11px; }
.primary-button { display: flex; align-items: center; gap: 18px; padding: 11px 17px; border: 0; border-radius: 8px; background: var(--green); color: white; font-size: 13px; font-weight: 700; transition: background .2s, transform .15s; }
.primary-button:hover { background: var(--green-dark); }
.primary-button:active { transform: translateY(1px); }

.result-panel { min-height: 367px; }
.result-heading { min-height: 72px; margin: 0; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.count-badge { padding: 3px 8px; border-radius: 12px; background: #eef2ef; color: var(--muted); font-size: 10px; font-weight: 700; }
.result-actions { display: flex; gap: 7px; }
.secondary-button, .icon-button { min-height: 34px; padding: 7px 10px; border: 1px solid #cfd9d3; border-radius: 7px; background: white; color: #36463e; font-size: 11px; font-weight: 700; }
.secondary-button:not(:disabled):hover, .icon-button:not(:disabled):hover { border-color: var(--green); color: var(--green); }
.empty-state { min-height: 293px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); text-align: center; }
.empty-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 14px; border-radius: 50%; background: #eef2ef; color: #8e9b95; font-size: 25px; font-weight: 300; transform: rotate(90deg); }
.empty-state p { margin: 0 0 7px; color: #516059; font-size: 13px; font-weight: 700; }
.empty-state span { font-size: 11px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 13px 14px; border-bottom: 1px solid #e6ebe8; text-align: left; white-space: nowrap; }
th { background: #f8faf9; color: var(--muted); font-size: 10px; letter-spacing: .04em; }
td:nth-child(2) { max-width: 260px; white-space: normal; line-height: 1.55; }
td.amount { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.status { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.status.ok { background: var(--green-soft); color: var(--green-dark); }
.status.check { background: var(--amber-soft); color: var(--amber); }
.missing { color: var(--amber); font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 10; margin: 0; padding: 10px 15px; border-radius: 8px; background: var(--ink); color: white; box-shadow: var(--shadow); font-size: 12px; opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.mobile-only { display: none; }
.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; }
footer { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 22px 0 34px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: #84908a; font-size: 10px; letter-spacing: .08em; }

@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; }
  .result-panel { min-height: 330px; }
}
@media (max-width: 600px) {
  .site-header { height: 54px; }
  .brand, .app-shell, footer { width: min(100% - 28px, 1180px); }
  .brand { font-size: 9px; }
  .app-shell { padding-top: 38px; }
  .hero { margin-bottom: 28px; }
  .mobile-only { display: block; }
  .lead { font-size: 13px; }
  .input-panel { padding: 17px; }
  .result-heading { align-items: flex-start; flex-direction: column; }
  .result-actions { width: 100%; }
  .secondary-button { flex: 1; }
  textarea { min-height: 220px; }
  th, td { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
