:root {
  --ink: #17202a;
  --muted: #607080;
  --line: #d9e2ea;
  --soft: #f4f8fb;
  --paper: #fff;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --accent: #f59e0b;
  --danger: #b42318;
  --warning: #9a6700;
  --shadow: 0 12px 30px rgba(20, 55, 75, .08);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  color: var(--ink);
  background: #edf4f6;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; line-height: 1.65; background: linear-gradient(180deg, #eaf5f4 0, #f6f8f6 430px, #f8fafb 100%); }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
a { color: var(--brand-dark); }
.site-header { padding: 16px 20px 12px; background: rgba(255,255,255,.84); border-bottom: 1px solid rgba(15, 118, 110, .12); }
.header-inner, .page-main, .site-footer { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.brand { color: var(--brand-dark); text-decoration: none; font-weight: 800; letter-spacing: .04em; font-size: .92rem; }
.brand small { color: var(--muted); font-weight: 500; letter-spacing: 0; margin-left: 8px; }
.hero { padding: 42px 0 22px; }
.eyebrow { margin: 0 0 8px; color: var(--brand-dark); font-size: .78rem; font-weight: 800; letter-spacing: .12em; }
h1 { margin: 0; max-width: 800px; font-size: clamp(1.75rem, 4vw, 2.65rem); line-height: 1.25; letter-spacing: -.03em; }
.lead { max-width: 790px; margin: 16px 0 0; color: #435464; font-size: 1.03rem; }
.privacy-note { display: inline-flex; align-items: center; gap: 8px; margin: 20px 0 0; padding: 9px 13px; border: 1px solid #b8ddd8; border-radius: 999px; background: #effbf8; color: #145e59; font-size: .88rem; font-weight: 700; }
.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 { min-height: 78px; display: grid; place-items: center; margin: 18px 0; border: 1px dashed #cbd7de; background: rgba(255,255,255,.48); color: #9aa8b2; font-size: .78rem; letter-spacing: .08em; }
.ad-slot[data-slot="side"] { min-height: 170px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 205px; gap: 22px; align-items: start; }
.tool-card, .info-card { padding: clamp(18px, 3vw, 28px); border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); }
.tool-card h2, .info-card h2 { margin: 0 0 18px; font-size: 1.18rem; }
.tool-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.tool-kicker { margin: 2px 0 0; color: var(--muted); font-size: .84rem; }
.field-label { display: block; margin-bottom: 6px; color: #3f5260; font-size: .86rem; font-weight: 700; }
.single-form { display: grid; grid-template-columns: 1.25fr 1fr .75fr .55fr auto; gap: 10px; padding: 16px; border: 1px solid #dfe9ed; border-radius: 13px; background: #f7fbfb; }
input, select, textarea { width: 100%; border: 1px solid #bdccd4; border-radius: 9px; background: #fff; color: var(--ink); }
input, select { min-height: 42px; padding: 8px 10px; }
textarea { min-height: 210px; resize: vertical; padding: 12px; line-height: 1.7; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(245,158,11,.45); outline-offset: 2px; border-color: var(--brand); }
.batch-block { margin-top: 20px; }
.batch-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 7px; }
.batch-heading .field-label { margin: 0; }
.batch-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.batch-footer .hint { margin: 5px 0 0; }
.hint { margin: 5px 0 0; color: var(--muted); font-size: .8rem; }
.controls { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(150px, .7fr) auto; gap: 12px; align-items: end; margin-top: 16px; }
.toggle { display: flex; align-items: center; gap: 8px; min-height: 42px; color: #405361; font-size: .88rem; }
.toggle input { width: 18px; height: 18px; accent-color: var(--brand); }
.button-row { display: flex; flex-wrap: wrap; gap: 9px; }
.range-control { margin-top: 16px; }
.range-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.range-heading .field-label { margin: 0; }
output { color: var(--brand-dark); font-size: .86rem; font-weight: 800; white-space: nowrap; }
input[type="range"] { display: block; width: 100%; min-height: 44px; padding: 0; border: 0; border-radius: 0; background: transparent; accent-color: var(--brand); cursor: pointer; }
button { min-height: 42px; padding: 8px 15px; border: 1px solid #b8c9d0; border-radius: 9px; background: #fff; color: #20333e; font-weight: 700; }
button:hover { border-color: var(--brand); color: var(--brand-dark); }
button.primary { border-color: var(--brand); background: var(--brand); color: #fff; }
button.primary:hover { background: var(--brand-dark); color: #fff; }
button.subtle { min-height: 36px; padding: 5px 10px; font-size: .82rem; }
button.danger { color: var(--danger); }
.status-line { min-height: 26px; margin: 17px 0 2px; color: var(--muted); font-size: .88rem; }
.status-line.is-warning { color: var(--warning); }
.status-line.is-error { color: var(--danger); }
.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 16px; }
.empty-state { grid-column: 1 / -1; padding: 32px 20px; border: 1px dashed #cbd7de; border-radius: 13px; color: var(--muted); text-align: center; }
.entry-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid #dce5e9; border-radius: 13px; background: #fff; }
.entry-card.is-error { border-color: #efb8b3; background: #fff8f7; }
.entry-preview { display: grid; place-items: center; min-height: 132px; padding: 12px; background: #fbfcfc; }
.entry-preview canvas { max-width: 100%; height: auto; }
.entry-meta { padding: 12px; border-top: 1px solid #edf1f2; }
.entry-code { margin: 0; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .95rem; font-weight: 800; }
.entry-name { margin: 2px 0 0; overflow-wrap: anywhere; color: #51636e; font-size: .86rem; }
.entry-price { margin: 2px 0 10px; color: #c26a00; font-size: .9rem; font-weight: 800; }
.entry-error { margin: 0; color: var(--danger); font-size: .82rem; }
.entry-warning { margin: 2px 0 10px; color: var(--warning); font-size: .8rem; }
.quantity-control { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; color: #3f5260; font-size: .82rem; font-weight: 700; }
.quantity-control input { width: 86px; min-height: 36px; padding: 6px 8px; }
.card-actions { display: flex; gap: 8px; margin-top: 10px; }
.card-actions button { flex: 1; }
.panel-section { margin-top: 22px; padding-top: 22px; border-top: 1px solid #e2e9ec; }
.panel-section.is-highlight { padding: 19px; border: 1px solid #cae5e1; border-radius: 13px; background: #f1fbf9; }
.panel-title { margin: 0 0 4px; font-size: 1.07rem; }
.panel-copy { margin: 0 0 14px; color: var(--muted); font-size: .85rem; }
.label-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.label-fields.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.label-fields .wide { grid-column: span 2; }
.field-note { margin: 3px 0 0; color: var(--muted); font-size: .75rem; }
.custom-settings { display: none; margin-top: 13px; padding-top: 13px; border-top: 1px solid #dbece9; }
.custom-settings.is-visible { display: block; }
.custom-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.custom-grid h4 { grid-column: 1 / -1; margin: 4px 0 -3px; font-size: .84rem; }
.label-adjustments { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.label-adjustments .range-control { margin-top: 0; }
.label-preview { margin-top: 18px; padding-top: 16px; border-top: 1px solid #dbece9; }
.label-preview-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.label-preview h4 { margin: 0; font-size: .96rem; }
.label-preview-dimensions { color: var(--brand-dark); font-size: .84rem; font-weight: 800; }
.label-preview .field-note { margin: 3px 0 10px; }
.label-preview-surface { display: flex; align-items: center; justify-content: center; width: min(100%, 430px); min-height: 92px; padding: 5%; border: 1px solid #bcd2d0; border-radius: 8px; background: #fff; box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .08); }
.label-preview-label { display: flex; overflow: hidden; width: 100%; height: 100%; flex-direction: column; align-items: center; justify-content: center; padding: 2mm; color: #111; text-align: center; }
.label-preview-label img { display: block; max-width: 100%; object-fit: contain; }
.label-preview-label .print-name, .label-preview-label .print-price, .label-preview-label .print-code { max-width: 100%; overflow: hidden; line-height: 1.15; white-space: nowrap; text-overflow: ellipsis; }
.label-preview-label .print-price { font-weight: 700; }
.label-preview-empty { padding: 18px 12px; color: var(--muted); font-size: .8rem; text-align: center; }
.sheet-preview { margin-top: 18px; padding-top: 16px; border-top: 1px solid #dbece9; }
.sheet-preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-preview h4 { margin: 0; font-size: .96rem; }
.sheet-preview-nav { display: flex; align-items: center; gap: 8px; color: var(--brand-dark); font-size: .82rem; font-weight: 800; }
.sheet-preview-nav button { min-height: 34px; padding: 4px 9px; }
.sheet-preview-surface { position: relative; width: min(100%, 560px); margin-top: 10px; overflow: hidden; border: 1px solid #bcd2d0; border-radius: 8px; background: #fff; box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .08); }
.sheet-preview-label { position: absolute; box-sizing: border-box; display: flex; overflow: hidden; flex-direction: column; align-items: center; justify-content: center; padding: 0.95%; color: #111; text-align: center; }
.sheet-preview-label:not(.is-empty) { border: 1px solid rgba(15, 118, 110, .2); }
.sheet-preview-label.is-empty { border: 1px dashed #c6d3d5; background: rgba(239, 247, 247, .3); }
.sheet-preview-label img { display: block; max-width: 100%; object-fit: contain; }
.sheet-preview-label .print-name, .sheet-preview-label .print-price, .sheet-preview-label .print-code { max-width: 100%; overflow: hidden; line-height: 1.15; white-space: nowrap; text-overflow: ellipsis; }
.sheet-preview-label .print-price { font-weight: 700; }
.print-summary { margin: 16px 0 0; padding: 10px 12px; border: 1px solid #cae5e1; border-radius: 9px; background: #fff; color: var(--brand-dark); font-size: .92rem; font-weight: 800; }
.print-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.info-card h2 { font-size: 1rem; }
.info-card p, .info-card li { color: var(--muted); font-size: .84rem; }
.info-card ul { padding-left: 1.2em; }
.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 205px; gap: 22px; align-items: start; }
.content-card { min-width: 0; padding: clamp(20px, 3vw, 34px); border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); }
.article-body { color: #334754; }
.article-body h2 { margin: 28px 0 10px; color: var(--ink); font-size: 1.22rem; line-height: 1.35; }
.article-body h2:first-of-type { margin-top: 0; }
.article-body h3 { margin: 22px 0 8px; color: var(--ink); font-size: 1.04rem; }
.article-body p, .article-body li { font-size: .94rem; }
.article-body p { margin: 0 0 13px; }
.article-body ol, .article-body ul { margin: 8px 0 16px; padding-left: 1.45em; }
.article-body li { margin: 5px 0; }
.article-body a { font-weight: 700; }
.article-date { color: var(--muted); font-size: .82rem !important; }
.operator-details { margin: 0 0 22px; border-top: 1px solid #e2e9ec; }
.operator-details div { display: grid; grid-template-columns: 8em 1fr; gap: 14px; padding: 10px 0; border-bottom: 1px solid #e2e9ec; }
.operator-details dt { color: var(--muted); font-size: .86rem; font-weight: 700; }
.operator-details dd { margin: 0; overflow-wrap: anywhere; font-size: .92rem; }
.contact-address { font-size: 1.08rem !important; font-weight: 800; }
.notice { padding: 13px 15px; border-left: 4px solid var(--accent); background: #fff8e8; color: #6f5000; }
.spec-table { width: 100%; margin: 12px 0 16px; border-collapse: collapse; font-size: .86rem; }
.spec-table th, .spec-table td { padding: 9px 10px; border: 1px solid #d9e2ea; text-align: left; vertical-align: top; }
.spec-table thead th { background: #eff8f7; color: var(--brand-dark); font-weight: 800; }
.spec-table tbody th { white-space: nowrap; background: #fbfcfc; }
.site-footer { margin: 35px auto 0; padding: 25px 0 40px; border-top: 1px solid #d7e1e5; }
.footer-links { display: flex; flex-wrap: wrap; gap: 9px 17px; font-size: .85rem; }
.footer-note { margin: 14px 0 0; color: var(--muted); font-size: .8rem; }
.toast { position: fixed; z-index: 20; right: 18px; bottom: 18px; max-width: min(360px, calc(100% - 36px)); padding: 11px 14px; border-radius: 10px; background: #17323a; color: #fff; box-shadow: var(--shadow); font-size: .86rem; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
#printRoot { display: none; }

@media (max-width: 880px) {
  .layout, .content-layout { grid-template-columns: 1fr; }
  .layout > aside { display: none; }
  .label-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .custom-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .header-inner, .page-main, .site-footer { width: min(100% - 22px, 1180px); }
  .hero { padding-top: 28px; }
  .single-form, .controls { grid-template-columns: 1fr; }
  .single-form button { width: 100%; }
  .tool-header { display: block; }
  .tool-header .button-row { margin-top: 10px; }
  .label-fields, .label-fields.compact, .custom-grid { grid-template-columns: 1fr 1fr; }
  .label-fields .wide { grid-column: span 2; }
  .label-adjustments { grid-template-columns: 1fr; }
  .batch-footer { align-items: flex-start; flex-direction: column; gap: 8px; }
  .batch-footer button { width: 100%; }
  .results { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}

@media print {
  @page { size: A4; margin: 0; }
  body.printing { background: #fff; }
  body.printing > :not(#printRoot) { display: none !important; }
  body.printing #printRoot { display: block; }
  .print-page { position: relative; width: 210mm; height: 297mm; overflow: hidden; page-break-after: always; background: #fff; }
  .print-page:last-child { page-break-after: auto; }
  .print-label { position: absolute; display: flex; overflow: hidden; flex-direction: column; align-items: center; justify-content: center; padding: 2mm; text-align: center; }
  .print-label.test-label { border: .25mm solid #222; }
  .print-label img { display: block; max-width: 100%; max-height: 70%; object-fit: contain; }
  .print-label .print-name { max-width: 100%; overflow: hidden; font-size: 3.1mm; line-height: 1.15; white-space: nowrap; text-overflow: ellipsis; }
  .print-label .print-price { color: #111; font-size: 3.3mm; font-weight: 700; line-height: 1.2; }
  .print-label .print-code { max-width: 100%; overflow: hidden; font-size: 2.5mm; line-height: 1.1; white-space: nowrap; text-overflow: ellipsis; }
}
