:root {
  --bg: #F7F9FE;
  --surface: #FFFFFF;
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-light: #EEF3FF;
  --primary-mid: #DBEAFE;
  --text: #111827;
  --text-2: #4B5563;
  --text-3: #9CA3AF;
  --border: #E5E7EB;
  --border-2: #D1D5DB;
  --success: #059669;
  --success-bg: #ECFDF5;
  --warn: #D97706;
  --warn-bg: #FFFBEB;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 4px 20px rgba(37,99,235,.09), 0 1px 4px rgba(0,0,0,.05);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --font-jp: 'Noto Sans JP', sans-serif;
  --font-ui: 'DM Sans', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-jp); background: var(--bg); color: var(--text); min-height: 100vh; -webkit-font-smoothing: antialiased; text-size-adjust: 100%; -webkit-text-size-adjust: 100%; }

/* ── NAV ── */
nav { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-xs); }
.nav-inner { max-width: 1100px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; height: 60px; gap: 8px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-ui); font-weight: 700; font-size: 17px; color: var(--primary); text-decoration: none; flex-shrink: 0; letter-spacing: .01em; }
.logo-icon { width: 38px; height: 38px; border-radius: 11px; background: url("../assets/favicon.svg") center / cover no-repeat; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; box-shadow: 0 8px 18px rgba(29,78,216,.22); }
.logo-icon svg { display: none; }
.logo-icon::before, .logo-icon::after { content: none; }
.logo > span:first-of-type { display: none; }
.logo > span:last-of-type { font-family: var(--font-jp); font-weight: 700; letter-spacing: .02em; }
.nav-links { display: flex; align-items: center; gap: 2px; margin-left: 20px; flex: 1; overflow-x: auto; }
.nav-links a { font-size: 13px; color: var(--text-2); text-decoration: none; padding: 6px 10px; border-radius: var(--radius-xs); white-space: nowrap; transition: all .15s; font-weight: 500; }
.nav-links a:hover { background: var(--primary-light); color: var(--primary); }
.nav-links a.active { background: var(--primary-light); color: var(--primary); }
.nav-cta { margin-left: auto; flex-shrink: 0; background: var(--primary); color: white; border: none; font-size: 13px; font-weight: 500; font-family: var(--font-jp); padding: 7px 14px; border-radius: var(--radius-xs); cursor: pointer; text-decoration: none; transition: background .15s; }
.nav-cta:hover { background: var(--primary-dark); }

/* ── PAGE FADE ── */
body { animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* ── HERO ── */
.hero { background: linear-gradient(135deg, #EEF3FF 0%, #F7F9FE 50%, #DBEAFE 100%); padding: 64px 24px 56px; text-align: center; }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; background: white; border: 1px solid var(--border); border-radius: 20px; padding: 4px 12px; font-size: 12px; color: var(--text-2); font-weight: 500; margin-bottom: 20px; box-shadow: var(--shadow-xs); }
.hero-badge span { width: 6px; height: 6px; border-radius: 50%; background: var(--success); display: inline-block; }
.hero h1 { font-size: clamp(28px,5vw,42px); font-weight: 700; color: var(--text); line-height: 1.25; margin-bottom: 16px; }
.hero h1 em { color: var(--primary); font-style: normal; }
.hero p { font-size: 16px; color: var(--text-2); max-width: 520px; margin: 0 auto 32px; line-height: 1.7; }
.hero-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.hero-tool-btn { display: flex; align-items: center; gap: 8px; background: white; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 16px; cursor: pointer; font-family: var(--font-jp); font-size: 13px; font-weight: 500; color: var(--text); transition: all .18s; box-shadow: var(--shadow-xs); text-decoration: none; }
.hero-tool-btn:hover { border-color: var(--primary); color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }
.hero-tool-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.badge-new { font-size: 10px; background: var(--primary); color: white; padding: 1px 6px; border-radius: 10px; }

/* ── HOME TOOL GRID ── */
.home-tools { max-width: 1100px; margin: 0 auto; padding: 56px 24px; }
.section-label { font-size: 12px; font-weight: 600; color: var(--primary); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
.section-title { font-size: 24px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.section-desc { font-size: 14px; color: var(--text-2); margin-bottom: 32px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.tool-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; cursor: pointer; transition: all .2s; text-decoration: none; display: block; position: relative; overflow: hidden; }
.tool-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--primary); transform: scaleX(0); transform-origin: left; transition: transform .2s; }
.tool-card:hover { box-shadow: var(--shadow); border-color: var(--primary-mid); transform: translateY(-2px); }
.tool-card:hover::before { transform: scaleX(1); }
.tool-card-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--primary-light); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.tool-card-icon svg { width: 22px; height: 22px; color: var(--primary); }
.tool-card h3 { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; line-height: 1.4; }
.tool-card p { font-size: 13px; color: var(--text-2); line-height: 1.6; }
.tool-card-meta { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.tag { font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 20px; }
.tag-live { background: var(--success-bg); color: var(--success); }
.tag-vol { background: var(--primary-light); color: var(--primary); }

/* ── TOOL PAGE LAYOUT ── */
.tool-page { max-width: 1100px; margin: 0 auto; padding: 40px 24px 64px; }
.tool-header { margin-bottom: 28px; }
.breadcrumb { font-size: 12px; color: var(--text-3); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.breadcrumb a { color: var(--text-3); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }
.tool-title { font-size: 26px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.tool-desc-text { font-size: 14px; color: var(--text-2); line-height: 1.7; max-width: 680px; }
.tool-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.form-side, .preview-side { min-width: 0; }

/* ── FORM COMPONENTS ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; min-width: 0; }
.card-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.card-title svg { width: 16px; height: 16px; color: var(--primary); }
.form-section { margin-bottom: 20px; }
.form-section-title { font-size: 12px; font-weight: 600; color: var(--primary); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
label { font-size: 12px; font-weight: 500; color: var(--text-2); }
input, select, textarea { font-family: var(--font-jp); font-size: 13px; color: var(--text); background: var(--bg); border: 1px solid var(--border-2); border-radius: var(--radius-xs); padding: 9px 11px; outline: none; transition: border-color .15s, box-shadow .15s; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); background: white; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
textarea { resize: vertical; min-height: 60px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: var(--radius-xs); font-family: var(--font-jp); font-size: 13px; font-weight: 500; cursor: pointer; transition: all .15s; border: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: white; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost { background: var(--bg); color: var(--text-2); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--border); }
.btn-sm { padding: 7px 13px; font-size: 12px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ── LINE ITEMS TABLE ── */
.line-items { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.line-items th { font-size: 11px; font-weight: 600; color: var(--text-3); padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.line-items td { padding: 5px 4px; vertical-align: middle; }
.line-items td input, .line-items td select { font-size: 12px; padding: 7px 8px; }
.item-del { background: none; border: none; cursor: pointer; color: var(--text-3); font-size: 16px; line-height: 1; padding: 4px; border-radius: 4px; }
.item-del:hover { color: #DC2626; background: #FEF2F2; }
.add-item { font-size: 13px; color: var(--primary); background: none; border: none; cursor: pointer; font-family: var(--font-jp); font-weight: 500; padding: 4px 0; }
.add-item:hover { opacity: .75; }

/* ── INVOICE / RECEIPT PREVIEW ── */
.preview-container { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.preview-topbar { background: var(--bg); border-bottom: 1px solid var(--border); padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; }
.preview-topbar-label { font-size: 12px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.invoice-paper { padding: 32px 36px; font-size: 13px; min-height: 500px; }
.inv-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 28px; }
.inv-title { font-size: 22px; font-weight: 700; color: var(--text); }
.inv-num { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.inv-seller-block { text-align: right; }
.inv-seller-name { font-size: 15px; font-weight: 600; color: var(--text); }
.inv-seller-detail { font-size: 12px; color: var(--text-2); line-height: 1.6; margin-top: 4px; }
.inv-reg { display: inline-block; background: var(--primary-light); color: var(--primary); font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px; margin-top: 4px; }
.inv-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.inv-meta-label { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.inv-meta-value { font-size: 13px; color: var(--text); font-weight: 500; }
.inv-client-name { font-size: 16px; font-weight: 600; }
.inv-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; font-size: 12px; }
.inv-table th { background: var(--bg); padding: 8px 10px; text-align: left; font-size: 11px; font-weight: 600; color: var(--text-2); border-bottom: 1px solid var(--border); }
.inv-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); color: var(--text); }
.inv-table td.num { text-align: right; }
.inv-table tbody tr:last-child td { border-bottom: none; }
.inv-totals { display: flex; justify-content: flex-end; }
.inv-totals-table { min-width: 220px; font-size: 13px; }
.inv-totals-table tr td { padding: 5px 8px; }
.inv-totals-table tr td:last-child { text-align: right; font-weight: 500; }
.inv-totals-table .total-row td { font-size: 15px; font-weight: 700; color: var(--primary); border-top: 2px solid var(--primary); padding-top: 10px; }
.inv-tax-note { font-size: 11px; color: var(--text-3); margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); line-height: 1.6; }
.inv-placeholder { color: var(--text-3); font-style: italic; }

/* ── RECEIPT SPECIFIC ── */
.receipt-amount-box { text-align: center; margin: 20px 0; padding: 16px; border: 2px solid var(--text); border-radius: 4px; }
.receipt-amount-label { font-size: 11px; color: var(--text-2); margin-bottom: 4px; }
.receipt-amount-val { font-size: 28px; font-weight: 700; color: var(--text); letter-spacing: .04em; }

/* ── LOOKUP ── */
.lookup-wrap { max-width: 700px; margin: 0 auto; }
.lookup-input-row { display: flex; gap: 10px; margin-bottom: 20px; }
.lookup-input-row input { flex: 1; font-size: 15px; padding: 12px 16px; border-radius: var(--radius-sm); border: 1.5px solid var(--border-2); font-family: var(--font-ui); letter-spacing: .05em; }
.lookup-input-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); background: white; }
.lookup-input-row .btn { padding: 12px 24px; font-size: 14px; border-radius: var(--radius-sm); flex-shrink: 0; }
.lookup-hint { font-size: 13px; color: var(--text-3); margin-bottom: 24px; }
.lookup-hint code { font-family: monospace; background: var(--border); padding: 1px 5px; border-radius: 3px; font-size: 12px; color: var(--text-2); }
.lookup-result { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.result-header { background: var(--success-bg); border-bottom: 1px solid #D1FAE5; padding: 16px 20px; display: flex; align-items: center; gap: 12px; }
.result-header.error { background: #FEF2F2; border-bottom-color: #FECACA; }
.result-status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--success); flex-shrink: 0; }
.result-status-dot.error { background: #DC2626; }
.result-status-text { font-size: 13px; font-weight: 600; color: var(--success); }
.result-status-text.error { color: #DC2626; }
.result-body { padding: 20px; }
.result-row { display: flex; gap: 16px; margin-bottom: 14px; font-size: 13px; }
.result-row:last-child { margin-bottom: 0; }
.result-key { font-weight: 600; color: var(--text-2); min-width: 140px; flex-shrink: 0; }
.result-val { color: var(--text); }
.result-val.reg-num { font-family: monospace; font-size: 14px; font-weight: 700; color: var(--primary); letter-spacing: .05em; }
.result-val.status-active { color: var(--success); font-weight: 600; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.api-notice { background: var(--warn-bg); border: 1px solid #FDE68A; border-radius: var(--radius-sm); padding: 14px 16px; margin-top: 20px; font-size: 13px; color: #92400E; line-height: 1.6; }
.api-notice strong { font-weight: 600; }

/* ── RADIO CARDS ── */
.radio-card { border: 1.5px solid var(--border-2); border-radius: var(--radius-sm); cursor: pointer; transition: all .15s; display: block; }
.radio-card:hover { border-color: var(--primary); background: var(--primary-light); }
.radio-card.selected { border-color: var(--primary); background: var(--primary-light); }
.radio-card-inner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.radio-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-2); flex-shrink: 0; transition: all .15s; background: white; }
.radio-dot.active { border-color: var(--primary); background: var(--primary); box-shadow: inset 0 0 0 3px white; }

/* ── VERDICT & CALC ── */
.verdict-box { border-radius: var(--radius-sm); padding: 18px 20px; margin-bottom: 16px; }
.verdict-box.yes { background: var(--success-bg); border: 1.5px solid #A7F3D0; }
.verdict-box.no { background: #FEF2F2; border: 1.5px solid #FECACA; }
.verdict-box.partial { background: var(--warn-bg); border: 1.5px solid #FDE68A; }
.verdict-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.verdict-box.yes .verdict-title { color: var(--success); }
.verdict-box.no .verdict-title { color: #DC2626; }
.verdict-box.partial .verdict-title { color: var(--warn); }
.verdict-desc { font-size: 13px; line-height: 1.7; }
.verdict-box.yes .verdict-desc { color: #065F46; }
.verdict-box.no .verdict-desc { color: #991B1B; }
.verdict-box.partial .verdict-desc { color: #92400E; }
.calc-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.calc-row:last-child { border-bottom: none; }
.calc-row.total { font-weight: 700; font-size: 15px; color: var(--primary); padding-top: 12px; }
.calc-label { color: var(--text-2); }
.calc-val { font-weight: 500; color: var(--text); }
.compare-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: var(--radius-xs); margin-bottom: 6px; }
.compare-row.active-method { background: var(--primary-light); border: 1px solid var(--primary-mid); }
.compare-row:not(.active-method) { background: var(--bg); }
.compare-label { font-size: 13px; color: var(--text-2); }
.compare-val { font-size: 14px; font-weight: 600; color: var(--text); }
.compare-row.active-method .compare-label { color: var(--primary); font-weight: 500; }
.compare-row.active-method .compare-val { color: var(--primary); }

/* ── SEO CONTENT ── */
.seo-content { margin-top: 48px; padding-top: 40px; border-top: 1px solid var(--border); }
.seo-content h2 { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.seo-content h3 { font-size: 16px; font-weight: 600; color: var(--text); margin: 20px 0 8px; }
.seo-content p { font-size: 14px; color: var(--text-2); line-height: 1.8; margin-bottom: 12px; }
.seo-content ul { font-size: 14px; color: var(--text-2); line-height: 1.8; padding-left: 20px; margin-bottom: 12px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; overflow: hidden; }
.faq-q { font-size: 14px; font-weight: 600; color: var(--text); padding: 14px 16px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; background: var(--surface); }
.faq-q:hover { background: var(--bg); }
.faq-q svg { width: 16px; height: 16px; color: var(--text-3); transition: transform .2s; }
.faq-q.open svg { transform: rotate(180deg); }
.faq-a { font-size: 13px; color: var(--text-2); line-height: 1.7; padding: 0 16px; max-height: 0; overflow: hidden; transition: all .25s; }
.faq-a.open { max-height: 220px; padding: 14px 16px; border-top: 1px solid var(--border); }

/* ── FOOTER ── */
footer { background: var(--surface); border-top: 1px solid var(--border); margin-top: 64px; }
.footer-inner { max-width: 1100px; margin: 0 auto; padding: 40px 24px; display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 32px; }
.footer-brand p { font-size: 13px; color: var(--text-3); margin-top: 10px; line-height: 1.6; }
.footer-col h4 { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 12px; }
.footer-col a { display: block; font-size: 13px; color: var(--text-3); text-decoration: none; margin-bottom: 8px; }
.footer-col a:hover { color: var(--primary); }
.footer-bottom { max-width: 1100px; margin: 0 auto; padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.footer-bottom p { font-size: 12px; color: var(--text-3); }

/* ── RESPONSIVE ── */
/* ── HAMBURGER BUTTON (hidden on desktop) ── */
.nav-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  cursor: pointer;
  margin-left: auto;
  flex-shrink: 0;
  transition: background .15s;
  color: var(--text-2);
}
.nav-hamburger:hover { background: var(--bg); color: var(--primary); }
.nav-hamburger svg { width: 20px; height: 20px; }
.nav-hamburger .icon-close { display: none; }
.nav-hamburger.open .icon-open { display: none; }
.nav-hamburger.open .icon-close { display: block; }

/* ── MOBILE DRAWER OVERLAY ── */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,.35);
  z-index: 98;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: overlayIn .2s ease;
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
.nav-overlay.open { display: block; }

/* ── MOBILE DRAWER ── */
.nav-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(280px, 85vw);
  background: var(--surface);
  z-index: 99;
  box-shadow: -8px 0 32px rgba(0,0,0,.15);
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.nav-drawer.open { transform: translateX(0); }

.nav-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.nav-drawer-close {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-xs); cursor: pointer; color: var(--text-2);
}
.nav-drawer-close:hover { color: var(--primary); background: var(--primary-light); }
.nav-drawer-close svg { width: 18px; height: 18px; }

.nav-drawer-section-label {
  font-size: 10px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .1em;
  padding: 18px 20px 8px;
}
.nav-drawer-links { flex: 1; padding: 0 12px 12px; }
.nav-drawer-links a {
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; font-weight: 500; color: var(--text-2);
  text-decoration: none;
  padding: 11px 12px;
  border-radius: var(--radius-xs);
  transition: all .15s;
  margin-bottom: 2px;
}
.nav-drawer-links a:hover { background: var(--primary-light); color: var(--primary); }
.nav-drawer-links a.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.nav-drawer-links a svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .7; }

.nav-drawer-divider { height: 1px; background: var(--border); margin: 10px 20px; }

.nav-drawer-cta {
  margin: 12px 20px 20px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--primary); color: white;
  font-size: 14px; font-weight: 600; font-family: var(--font-jp);
  padding: 13px 20px; border-radius: var(--radius-xs);
  text-decoration: none; transition: background .15s;
  flex-shrink: 0;
}
.nav-drawer-cta:hover { background: var(--primary-dark); }
.nav-drawer-cta svg { width: 16px; height: 16px; }

@media (max-width: 768px) {
  nav { position: sticky; }
  .nav-inner { height: 56px; padding: 0 14px; }
  .logo { font-size: 16px; }
  .logo-icon { width: 30px; height: 30px; }
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav-hamburger { display: flex; }
  .hero { padding: 42px 16px 38px; }
  .hero p { font-size: 14px; margin-bottom: 24px; }
  .hero-tools { flex-direction: column; align-items: stretch; }
  .hero-tool-btn { min-height: 48px; justify-content: space-between; padding: 12px 14px; }
  .home-tools { padding: 40px 16px; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-card { padding: 18px; }
  .tool-page { padding: 28px 16px 56px; }
  .tool-header { margin-bottom: 20px; }
  .tool-title { font-size: 22px; line-height: 1.35; }
  .tool-desc-text { font-size: 13px; }
  .tool-body { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .preview-side .preview-container { position: static !important; }
  .preview-container { border-radius: var(--radius-sm); }
  .invoice-paper { min-height: auto; padding: 22px 18px; overflow-x: auto; }
  .inv-header { display: block; margin-bottom: 20px; }
  .inv-seller-block { text-align: left; margin-top: 16px; }
  .inv-meta { grid-template-columns: 1fr; gap: 12px; margin-bottom: 18px; padding-bottom: 16px; }
}

@media (max-width: 640px) {
  body { padding-bottom: env(safe-area-inset-bottom); }
  .footer-inner { grid-template-columns: 1fr; padding: 32px 16px; }
  .footer-bottom { display: block; padding: 16px; }
  .footer-bottom p + p { margin-top: 6px; }
  .form-row { grid-template-columns: 1fr; gap: 14px; }
  .card { padding: 16px; border-radius: var(--radius-sm); }
  .card-title { margin-bottom: 16px; padding-bottom: 12px; line-height: 1.45; }
  .form-section { margin-bottom: 18px; }
  label { font-size: 12px; line-height: 1.45; }
  input, select, textarea { min-height: 48px; font-size: 16px; padding: 12px 13px; border-radius: var(--radius-sm); }
  textarea { min-height: 92px; }
  .btn { min-height: 48px; font-size: 14px; padding: 12px 16px; border-radius: var(--radius-sm); }
  .btn-sm { min-height: 40px; padding: 9px 13px; }
  .btn-row { position: sticky; bottom: 0; z-index: 30; margin: 18px -16px -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); border-top: 1px solid var(--border); box-shadow: 0 -10px 24px rgba(17,24,39,.08); backdrop-filter: blur(10px); }
  .btn-row .btn { flex: 1 1 140px; }
  .add-item { min-height: 44px; width: 100%; text-align: left; padding: 10px 4px; }
  .lookup-input-row { flex-direction: column; gap: 12px; }
  .lookup-input-row input, .lookup-input-row .btn { width: 100%; min-height: 52px; }
  .result-row { display: block; }
  .result-key { display: block; min-width: 0; margin-bottom: 3px; }
  .radio-card-inner { min-height: 58px; padding: 13px 12px; }
  .radio-dot { width: 18px; height: 18px; }
  .verdict-box { padding: 15px; }
  .seo-content { margin-top: 36px; padding-top: 28px; }
  .faq-q { min-height: 52px; padding: 14px; gap: 10px; line-height: 1.5; }
  .faq-a.open { max-height: 360px; padding: 14px; }

  .line-items, .line-items tbody, .line-items tr, .line-items td,
  .ex-table, .ex-table tbody, .ex-table tr, .ex-table td { display: block; width: 100%; }
  .line-items, .ex-table { max-width: 100%; }
  .ex-table[style] { min-width: 0 !important; }
  .line-items thead, .ex-table thead { display: none; }
  .line-items { border-collapse: separate; border-spacing: 0; margin-bottom: 8px; }
  .line-items tr, .ex-table tr { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 12px; }
  .line-items td, .ex-table td { border: none; padding: 0 0 12px; }
  .line-items td:last-child, .ex-table td:last-child { padding-bottom: 0; }
  .line-items td::before, .ex-table td::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 600; color: var(--text-3); margin-bottom: 5px; line-height: 1.4; }
  .line-items td:empty::before, .ex-table td:empty::before { display: none; }
  .line-items td input, .line-items td select, .ex-table td input, .ex-table td select { min-height: 46px; font-size: 16px !important; padding: 11px 12px !important; }
  .line-items td[style], .ex-table td[style] { text-align: left !important; }
  .item-del { width: 44px; height: 44px; background: #FEF2F2; color: #DC2626; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; }
  .inv-table { min-width: 520px; }
  .inv-table th, .inv-table td { padding: 8px; }
  .inv-totals { justify-content: stretch; }
  .inv-totals-table { min-width: 0; width: 100%; }
  .preview-topbar { padding: 10px 12px; }
  .card div[style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
  .tool-page > div[style*="max-width"] { max-width: none !important; }
  .tool-page div[style*="grid-template-columns:1.1fr 0.9fr"] { display: block !important; }
  .tool-page div[style*="position:sticky;top:76px"] { position: static !important; margin-top: 16px; }
}

/* ── PRINT ── */
@media print {
  nav, .preview-topbar, .tool-header, .form-side, footer, .seo-content, .btn-row { display: none !important; }
  .tool-body { display: block !important; }
  .preview-container { border: none !important; box-shadow: none !important; }
  .invoice-paper { padding: 0 !important; }
  body { background: white; animation: none; }
}

/* ── 最終更新日 badge ─────────────────────────────── */
.tool-updated {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-3);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
}
