:root {
  --ink: #172554;
  --muted: #62747b;
  --line: #dbeafe;
  --soft: #f8fafc;
  --paper: #fff;
  --brand: #2563eb;
  --brand-dark: #1e3a8a;
  --accent: #f59e0b;
  --danger: #b42318;
  --warning: #8a5a00;
  --shadow: 0 16px 36px rgba(30, 58, 138, .09);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  color: var(--ink);
  background: #eff6ff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; line-height: 1.65; background: linear-gradient(180deg, #eff6ff 0, #f8fafc 440px, #f8fafc 100%); }
button, input, select { font: inherit; }
button, select, label { cursor: pointer; }
a { color: var(--brand-dark); }
img { max-width: 100%; }
.site-header { padding: 14px 20px 11px; border-bottom: 1px solid rgba(37, 99, 235, .14); background: rgba(255, 255, 255, .86); }
.header-inner, .page-main, .site-footer { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { color: var(--brand-dark); text-decoration: none; font-size: .98rem; font-weight: 850; letter-spacing: .04em; }
.brand small { margin-left: 7px; color: var(--muted); font-size: .77rem; font-weight: 500; letter-spacing: 0; }
.header-nav { display: flex; gap: 13px; font-size: .8rem; }
.header-nav a { font-weight: 700; text-decoration: none; }
.hero { padding: 45px 0 23px; }
.eyebrow { margin: 0 0 8px; color: var(--brand-dark); font-size: .77rem; font-weight: 850; letter-spacing: .13em; }
h1 { max-width: 760px; margin: 0; font-size: clamp(1.8rem, 5vw, 2.75rem); line-height: 1.25; letter-spacing: -.045em; }
h2, h3 { line-height: 1.35; }
.lead { max-width: 760px; margin: 15px 0 0; color: #42575d; font-size: 1.02rem; }
.privacy-note { display: inline-flex; align-items: center; gap: 8px; margin: 19px 0 0; padding: 8px 13px; border: 1px solid #bfdbfe; border-radius: 999px; background: #eff6ff; color: #1e40af; font-size: .84rem; font-weight: 800; }
.privacy-note::before { content: "✓"; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--brand); color: #fff; font-size: .75rem; }
.ad-slot { display: grid; min-height: 72px; place-items: center; margin: 17px 0; border: 1px dashed #cbd5e1; background: rgba(255, 255, 255, .5); color: #9aa9aa; font-size: .74rem; letter-spacing: .08em; }
.tool-card, .info-card, .content-card { border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); }
.tool-card { padding: clamp(18px, 3vw, 30px); }
.tool-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.tool-header h2 { margin: 0; font-size: 1.22rem; }
.tool-kicker { margin: 3px 0 0; color: var(--muted); font-size: .82rem; }
.local-badge { flex: 0 0 auto; padding: 5px 9px; border: 1px solid #bfdbfe; border-radius: 999px; background: #eff6ff; color: var(--brand-dark); font-size: .74rem; font-weight: 800; }
.upload-panel { padding: 16px; border: 1px solid #dbeafe; border-radius: 14px; background: #f8fbff; text-align: center; }
#fileInput { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.upload-button { display: inline-flex; min-height: 52px; align-items: center; justify-content: center; gap: 9px; padding: 9px 17px; border: 1px solid var(--brand); border-radius: 10px; background: var(--brand); color: #fff; font-weight: 800; }
.upload-button:hover { background: var(--brand-dark); }
.upload-button small { margin-left: 2px; color: #fff; font-size: .72rem; font-weight: 500; }
.upload-icon { font-size: 1.4rem; line-height: 1; }
.file-count { min-height: 25px; margin: 9px 0 0; color: var(--muted); font-size: .82rem; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-top: 20px; }
.field > label { display: block; margin-bottom: 6px; color: #40555b; font-size: .85rem; font-weight: 800; }
input, select { width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 9px; background: #fff; color: var(--ink); }
input:focus, select:focus, button:focus-visible, a:focus-visible, .upload-button:focus-within { outline: 3px solid rgba(245, 158, 11, .45); outline-offset: 2px; border-color: var(--brand); }
.custom-field { display: flex; align-items: center; gap: 7px; margin-top: 8px; }
.custom-field input { flex: 1; }
.custom-field span { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.settings-summary { margin: 12px 0 0; color: var(--brand-dark); font-size: .82rem; font-weight: 800; }
.button-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
button { min-height: 44px; padding: 8px 15px; border: 1px solid #cbd5e1; border-radius: 9px; background: #fff; color: #1e293b; font-weight: 800; }
button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand-dark); }
button:disabled { cursor: not-allowed; opacity: .48; }
button.primary { border-color: var(--brand); background: var(--brand); color: #fff; }
button.primary:hover:not(:disabled) { background: var(--brand-dark); color: #fff; }
.action-button { min-width: 132px; }
.status-line { min-height: 28px; margin: 15px 0 0; color: var(--muted); font-size: .84rem; }
.status-line.is-warning { color: var(--warning); }
.results-section { margin-top: 19px; padding-top: 21px; border-top: 1px solid #e2e8f0; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-heading h2 { margin: 0; font-size: 1.07rem; }
.section-heading p { margin: 0; color: var(--muted); font-size: .77rem; }
.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 14px; margin-top: 12px; }
.empty-state { grid-column: 1 / -1; padding: 29px 18px; border: 1px dashed #cbd5e1; border-radius: 13px; color: var(--muted); text-align: center; font-size: .84rem; }
.empty-state strong { color: #40555b; }
.entry-card { min-width: 0; overflow: hidden; border: 1px solid #e2e8f0; border-radius: 13px; background: #fff; }
.entry-card.is-error { border-color: #efb8b3; background: #fff8f7; }
.entry-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 11px; border-bottom: 1px solid #f1f5f9; }
.entry-card-head > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; }
.icon-button { min-width: 44px; min-height: 44px; padding: 3px; border: 0; color: var(--muted); font-size: 1.25rem; line-height: 1; }
.icon-button:hover { color: var(--danger); }
.image-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: #e2e8f0; }
.image-compare > div { display: flex; min-width: 0; min-height: 135px; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 9px; background: #f8fafc; }
.image-compare span { color: var(--muted); font-size: .7rem; font-weight: 800; }
.image-compare img { display: block; width: 100%; max-height: 150px; object-fit: contain; }
.preview-placeholder { display: grid; width: 100%; min-height: 100px; place-items: center; color: #9aa9aa !important; font-weight: 500 !important; }
.entry-meta { padding: 11px; }
.before-line { margin: 0 0 8px; color: var(--muted); font-size: .76rem; }
.entry-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.entry-stats > div { padding: 8px; border-radius: 8px; background: #f8fafc; }
.entry-stats span, .entry-stats small { display: block; color: var(--muted); font-size: .7rem; }
.entry-stats strong { display: block; color: var(--brand-dark); font-size: .94rem; }
.entry-waiting, .entry-error, .entry-progress, .entry-warning { margin: 8px 0 0; font-size: .78rem; }
.entry-waiting { color: var(--muted); }
.entry-error { color: var(--danger); }
.entry-progress { color: var(--brand-dark); }
.entry-warning { color: var(--warning); }
.card-actions { display: flex; gap: 8px; margin-top: 10px; }
.card-actions button { flex: 1; min-height: 44px; padding: 6px 9px; font-size: .8rem; }
.intro-card { margin-top: 17px; padding: clamp(19px, 3vw, 29px); }
.info-card h2 { margin: 0 0 16px; font-size: 1.1rem; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.feature-grid > div { padding: 13px; border-radius: 11px; background: #f8fafc; }
.feature-number { color: #b45309; font-size: .78rem; font-weight: 900; letter-spacing: .08em; }
.feature-grid h3 { margin: 2px 0 5px; font-size: .94rem; }
.feature-grid p { margin: 0; color: var(--muted); font-size: .79rem; }
.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 205px; gap: 22px; align-items: start; }
.content-card { padding: clamp(20px, 3vw, 35px); }
.article-body { color: #334155; }
.article-body h2 { margin: 30px 0 10px; color: var(--ink); font-size: 1.2rem; }
.article-body h2:first-child { margin-top: 0; }
.article-body h3 { margin: 22px 0 8px; color: var(--ink); font-size: 1.02rem; }
.article-body p, .article-body li { font-size: .94rem; }
.article-body p { margin: 0 0 14px; }
.article-body ol, .article-body ul { margin: 8px 0 17px; padding-left: 1.45em; }
.article-body li { margin: 5px 0; }
.article-body a { font-weight: 700; }
.notice { padding: 13px 15px; border-left: 4px solid var(--accent); background: #fff8e9; color: #6d5008; }
.operator-details { margin: 0 0 22px; border-top: 1px solid #e2e8f0; }
.operator-details div { display: grid; grid-template-columns: 7em 1fr; gap: 14px; padding: 10px 0; border-bottom: 1px solid #e2e8f0; }
.operator-details dt { color: var(--muted); font-size: .85rem; font-weight: 800; }
.operator-details dd { margin: 0; overflow-wrap: anywhere; font-size: .9rem; }
.spec-table { width: 100%; margin: 12px 0 17px; border-collapse: collapse; font-size: .84rem; }
.spec-table th, .spec-table td { padding: 9px 10px; border: 1px solid #dbeafe; text-align: left; vertical-align: top; }
.spec-table thead th { background: #eff6ff; color: var(--brand-dark); }
.site-footer { margin: 34px auto 0; padding: 25px 0 38px; border-top: 1px solid #e2e8f0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 17px; font-size: .82rem; }
.footer-links a { font-weight: 700; }
.footer-note { margin: 13px 0 0; color: var(--muted); font-size: .78rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
[hidden] { display: none !important; }

@media (max-width: 760px) {
  .content-layout { grid-template-columns: 1fr; }
  .content-layout > aside { display: none; }
}

@media (max-width: 560px) {
  .header-inner, .page-main, .site-footer { width: min(100% - 22px, 1180px); }
  .site-header { padding-inline: 11px; }
  .header-inner { align-items: flex-start; }
  .header-nav { gap: 8px; }
  .header-nav a { font-size: .74rem; }
  .brand small { display: block; margin: 1px 0 0; }
  .hero { padding-top: 29px; }
  .tool-header { display: block; }
  .local-badge { display: inline-block; margin-top: 9px; }
  .upload-button { width: 100%; flex-wrap: wrap; }
  .upload-button small { flex-basis: 100%; }
  .settings-grid, .feature-grid { grid-template-columns: 1fr; }
  .settings-grid { gap: 14px; }
  .button-row { flex-direction: column; }
  .action-button { width: 100%; }
  .section-heading { display: block; }
  .section-heading p { margin-top: 3px; }
  .results { grid-template-columns: 1fr; }
}
