:root {
  color-scheme: light;
  --ink: #17342f;
  --ink-soft: #47615a;
  --muted: #72847e;
  --line: #dce6e1;
  --line-strong: #c7d5ce;
  --paper: #f4f7f5;
  --surface: #ffffff;
  --mint: #e7f1eb;
  --mint-strong: #d7e9df;
  --green: #1a6257;
  --green-dark: #154f46;
  --amber: #9c5c10;
  --amber-bg: #fff5e8;
  --red: #a53c37;
  --red-bg: #fff0ef;
  --shadow: 0 8px 26px rgba(26, 66, 55, .055);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); font-size: 16px; line-height: 1.55; }
button, input, select { font: inherit; }
button, select, input[type="checkbox"], label.file-button { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: var(--green); }
.site-header { min-height: 72px; max-width: 1280px; margin: 0 auto; padding: 12px 30px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--green); }
.brand-mark svg { width: 26px; height: 26px; fill: none; stroke: white; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.15; }
.brand-copy strong { font-size: 19px; letter-spacing: -.035em; }
.brand-copy small { margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.header-actions { display: flex; align-items: center; gap: 16px; }
.privacy-chip { display: flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.lock-icon { width: 8px; height: 8px; display: inline-block; border-radius: 50%; background: #2b9a72; color: transparent; box-shadow: 0 0 0 3px #def1e8; }
.language-toggle { height: 44px; min-width: 150px; max-width: 190px; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 11px; background: white; color: var(--green); font-size: 14px; font-weight: 650; }
.numeric-format-note { color: var(--muted); font-size: .875rem; margin: -8px 0 20px; }
@media (max-width: 620px) { .header-actions { flex-wrap: wrap; justify-content: flex-end; } .header-actions .privacy-chip { display: none; } .header-actions .language-toggle { min-width: 130px; max-width: 165px; height: 44px; } }
.page-shell { width: min(100% - 60px, 1220px); margin: 0 auto; }
.intro { min-height: 190px; padding: 27px 36px 31px; margin: 14px 0 22px; border: 1px solid #dce9e1; border-radius: 22px; background: linear-gradient(113deg, #e8f2ec 0%, #eff5f1 59%, #e2efe7 100%); display: flex; align-items: center; justify-content: space-between; overflow: hidden; position: relative; }
.intro::after { content: ""; position: absolute; width: 310px; height: 310px; right: 145px; top: -220px; border: 1px solid rgba(26, 98, 87, .11); border-radius: 50%; box-shadow: 0 0 0 30px rgba(26, 98, 87, .025), 0 0 0 68px rgba(26, 98, 87, .025); }
.eyebrow { margin: 0 0 6px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .14em; line-height: 1.4; }
.intro h1 { margin: 0; font-family: "Noto Serif JP", "Yu Mincho", serif; font-size: clamp(24px, 3vw, 34px); font-weight: 650; letter-spacing: -.045em; line-height: 1.35; }
.intro-text { max-width: 720px; margin: 10px 0 0; color: var(--ink-soft); font-size: 15px; }
.intro-stamp { width: 116px; height: 116px; flex: 0 0 116px; margin: 0 46px 0 24px; border: 1px solid rgba(26,98,87,.27); border-radius: 50%; color: var(--green); display: flex; align-items: center; justify-content: center; flex-direction: column; transform: rotate(-10deg); position: relative; z-index: 1; }
.intro-stamp span { font-family: Georgia, serif; font-size: 31px; line-height: 1; }
.intro-stamp small { margin-top: 7px; text-align: center; font-size: 8px; font-weight: 800; line-height: 1.2; letter-spacing: .09em; }
.tool-tabs { display: flex; gap: 5px; padding: 5px; margin: 0 0 24px; border: 1px solid var(--line); border-radius: 15px; background: #ebf0ed; }
.tool-tab { flex: 1; min-height: 49px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 12px; border: 0; border-radius: 11px; background: transparent; color: var(--ink-soft); font-size: 14px; font-weight: 700; white-space: nowrap; }
.tool-tab.active { background: white; color: var(--green-dark); box-shadow: 0 2px 8px rgba(24,65,53,.09); }
.tab-icon { color: #438276; font-size: 16px; font-weight: 800; line-height: 1; }
.view-panel { display: none; }
.view-panel.active { display: block; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 0 2px 17px; }
.section-heading h2 { margin: 0; font-size: 25px; font-weight: 720; letter-spacing: -.035em; line-height: 1.3; }
.section-heading > div > p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); font-size: 14px; }
.panel { position: relative; margin: 0 0 17px; padding: 23px 25px 22px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 19px; }
.panel-heading-between { justify-content: space-between; }
.heading-cluster { display: flex; align-items: flex-start; gap: 13px; min-width: 0; }
.step-badge { width: 29px; height: 29px; flex: 0 0 29px; display: grid; place-items: center; border-radius: 9px; background: var(--mint); color: var(--green); font-size: 12px; font-weight: 800; }
.panel-heading h3 { margin: 0; font-size: 17px; letter-spacing: -.015em; line-height: 1.35; }
.panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.field-grid { display: grid; gap: 14px 16px; }
.dilution-target-field { max-width: 460px; margin-bottom: 20px; }
.dilution-rows { display: grid; gap: 12px; max-width: 820px; }
.field.dilution-row { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(110px, 1.3fr) 125px; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 1rem; }
.dilution-row.is-target { background: var(--mint); border-color: #89b89f; }
.dilution-row input:disabled { opacity: 1; color: var(--green-dark); background: #f4f8f5; }
.dilution-unit-note { font-size: .875rem; color: var(--muted); margin: 12px 0 20px; }
@media (max-width: 620px) {
  .field.dilution-row { grid-template-columns: minmax(90px, 1fr) minmax(80px, 1fr) 88px; gap: 6px; padding: 8px 6px; font-size: .875rem; }
  .dilution-row select { padding-left: 6px; padding-right: 22px; background-position: right 7px center; }
}
.field-grid.composition-select-row { grid-template-columns: repeat(2, minmax(0,1fr)); max-width: 760px; margin-bottom: 12px; }
.field-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; min-width: 0; flex-direction: column; gap: 6px; color: var(--ink-soft); font-size: 13px; font-weight: 650; }
.field input, .field select, .input-unit select { width: 100%; min-width: 0; height: 44px; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: 9px; outline: 0; background-color: #fff; color: var(--ink); font-size: 15px; font-weight: 500; box-shadow: inset 0 1px 1px rgba(15,55,44,.025); }
.field input:focus, .field select:focus, .input-unit select:focus { border-color: #4e9884; box-shadow: 0 0 0 3px rgba(52,141,113,.12); }
.field input::placeholder { color: #9aa9a2; font-size: 13px; }
.field select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%235c786e' stroke-width='1.7'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.field.compact { min-width: 180px; max-width: 240px; }
.input-unit { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; }
.input-unit select { width: auto; min-width: 82px; appearance: none; padding-right: 28px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%235c786e' stroke-width='1.7'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.button-row.end { justify-content: flex-end; margin-top: 17px; }
.button { min-height: 41px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 13px; border: 1px solid transparent; border-radius: 9px; font-size: 13px; font-weight: 700; line-height: 1.25; text-decoration: none; transition: background-color .12s ease, border-color .12s ease, transform .12s ease; }
.button:active { transform: translateY(1px); }
.button-primary { background: var(--green); color: white; }
.button-primary:hover { background: var(--green-dark); }
.button-outline { border-color: var(--line-strong); background: white; color: var(--ink-soft); }
.button-outline:hover, .button-soft:hover { border-color: #8db7a7; background: #f2f8f4; color: var(--green-dark); }
.button-soft { border-color: #d5e8dc; background: var(--mint); color: var(--green); }
.button-danger { border-color: #f0d5d2; background: white; color: var(--red); }
.button-danger:hover { background: var(--red-bg); }
.file-button { cursor: pointer; }
.table-scroll { width: 100%; }
.data-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.data-table th { padding: 8px 10px; color: var(--muted); font-size: 12px; font-weight: 700; text-align: left; }
.data-table td { padding: 5px 10px; border-top: 1px solid #edf1ee; }
.data-table th:first-child, .data-table td:first-child { width: 58px; }
.data-table th:last-child, .data-table td:last-child { width: 54px; text-align: right; }
.data-table#unknown-table th:nth-child(2) { width: 27%; }
.data-table#unknown-table th:nth-child(3) { width: 27%; }
.data-table#unknown-table th:nth-child(4) { width: 22%; }
.data-table input { width: 100%; height: 41px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; outline: 0; background: #fff; font-size: 15px; color: var(--ink); }
.data-table input:focus { border-color: #4e9884; box-shadow: 0 0 0 3px rgba(52,141,113,.1); }
.row-number { color: #8a9c94; font-size: 13px; text-align: center; }
.row-remove { width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: #8b9b94; font-size: 20px; line-height: 1; }
.row-remove:hover { background: var(--red-bg); color: var(--red); }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 9px; }
.muted-note, .paste-hint { color: var(--muted); font-size: 12px; }
.paste-hint { text-align: right; }
.chart-panel { padding-bottom: 14px; }
.chart-heading { align-items: center; }
.advanced-settings { position: relative; z-index: 3; }
.advanced-settings summary { padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--ink-soft); background: white; font-size: 13px; font-weight: 650; cursor: pointer; list-style: none; white-space: nowrap; }
.advanced-settings summary::-webkit-details-marker { display: none; }
.advanced-settings summary::after { content: "⌄"; margin-left: 10px; color: var(--green); }
.advanced-settings[open] summary::after { content: "⌃"; }
.settings-popover { position: absolute; right: 0; top: 45px; width: min(580px, calc(100vw - 52px)); padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: 0 12px 28px rgba(19,54,44,.15); }
.settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 11px; }
.settings-grid .field { font-size: 12px; }
.settings-grid .field input, .settings-grid .field select { height: 38px; font-size: 14px; }
.check-row { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 14px; }
.check-row label, .check-label { display: flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: 13px; }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--green); }
.chart-wrap { min-height: 260px; position: relative; padding: 4px 0 0; }
#curve-chart { display: block; width: 100%; height: auto; max-height: 570px; overflow: visible; }
.chart-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; padding: 0 8px 3px; color: var(--ink-soft); font-size: 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); }
.legend-line { width: 18px; border-top: 2px solid var(--green); }
.regression-options { display: flex; flex-wrap: wrap; align-items: end; gap: 13px; padding: 13px; margin-bottom: 14px; border-radius: 12px; background: #f5f8f6; }
.weight-note { flex: 1; min-width: 220px; margin: 0 0 6px; color: var(--muted); font-size: 12px; }
.result-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.metric-card { min-height: 91px; padding: 13px 15px; border: 1px solid #e4ece7; border-radius: 11px; background: #fbfdfb; }
.metric-label { color: var(--muted); font-size: 12px; font-weight: 650; }
.metric-value { margin-top: 5px; color: var(--ink); font-size: 20px; font-weight: 720; letter-spacing: -.025em; overflow-wrap: anywhere; }
.metric-subtitle { margin-top: 3px; color: var(--muted); font-size: 11px; }
.definition-note { margin-top: 12px; padding: 10px 12px; border-left: 3px solid #adcdbf; background: #f4f8f5; color: var(--ink-soft); font-size: 12px; }
.inline-alert { padding: 10px 12px; margin: 9px 0; border: 1px solid #f0d6c0; border-radius: 9px; background: var(--amber-bg); color: #75450e; font-size: 13px; }
.inline-alert.error { border-color: #efcfcc; background: var(--red-bg); color: #8d332e; }
.inline-alert.hidden { display: none; }
.results-table-wrap { width: 100%; margin-top: 16px; overflow-x: auto; }
.results-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.results-table th { padding: 10px 9px; background: #f3f7f4; color: var(--ink-soft); font-size: 12px; font-weight: 700; text-align: left; white-space: nowrap; }
.results-table td { padding: 10px 9px; border-bottom: 1px solid #edf1ee; color: var(--ink); font-size: 13px; }
.results-table tbody tr:hover { background: #fbfdfb; }
.empty-results { color: var(--muted) !important; text-align: center; }
.range-badge { display: inline-flex; padding: 3px 8px; border-radius: 100px; background: #e9f4ee; color: #267451; font-size: 11px; font-weight: 700; white-space: nowrap; }
.range-badge.out { background: var(--amber-bg); color: var(--amber); }
.negative-value { color: var(--red) !important; font-weight: 700; }
.output-panel { padding-bottom: 19px; }
.output-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.action-status { min-height: 18px; margin: 9px 0 0; color: var(--green); font-size: 12px; }
.empty-state { padding: 18px; color: var(--muted); text-align: center; font-size: 14px; }
.calculation-guide { margin: 4px 0 10px; padding: 14px; border: 1px solid #dce9e1; border-radius: 12px; background: #f6faf7; }
.goal-equation { display: grid; grid-template-columns: minmax(170px, .9fr) auto minmax(250px, 1.5fr); gap: 10px; align-items: stretch; }
.goal-box { display: flex; min-width: 0; flex-direction: column; justify-content: center; gap: 6px; padding: 11px 13px; border: 1px solid #dfe9e3; border-radius: 10px; background: #fff; }
.goal-box > span { color: var(--muted); font-size: 11px; font-weight: 750; }
.goal-box strong { color: var(--ink); font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.goal-box.target { border-color: #8bbba2; background: #eff8f2; }
.goal-box.target strong { color: var(--green-dark); }
.goal-arrow { display: grid; place-items: center; color: var(--green); font-size: 23px; font-weight: 750; }
.goal-route-select { margin-top: 10px; }
.goal-route-select > span { display: block; margin-bottom: 6px; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.goal-route-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.goal-route { display: flex; min-width: 0; min-height: 54px; flex-direction: column; align-items: flex-start; gap: 3px; padding: 9px 11px; border: 1px solid #dfe9e3; border-radius: 9px; background: white; color: var(--ink-soft); text-align: left; cursor: pointer; }
.goal-route span { color: var(--muted); font-size: 10px; font-weight: 750; }
.goal-route strong { font-size: 12px; line-height: 1.4; }
.goal-route.active { border-color: #62a082; background: #f1f8f4; box-shadow: inset 0 0 0 1px #62a082; }
.goal-note { margin: 9px 0 0; color: var(--muted); font-size: .875rem; line-height: 1.55; }
.composition-input-note { margin: 0 0 10px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.composition-fields { gap: 14px 16px; }
.field-label-row { display: flex; min-height: 18px; align-items: center; justify-content: space-between; gap: 6px; }
.field-status { flex: 0 0 auto; padding: 2px 6px; border-radius: 999px; background: #e7f3eb; color: #2b7453; font-size: 10px; font-weight: 750; white-space: nowrap; }
.field-status.target { background: #eef0f4; color: #566175; }
.field.is-required .input-unit input, .field.is-required > input { border-color: #89b89f; background: #fbfefc; }
.field.is-target input:disabled { border-color: #cbd6d0; background: #f0f4f2; color: #6d7e75; cursor: not-allowed; }
.field input:disabled + .sign-toggle, .field input:disabled ~ .sign-toggle, .field input:disabled ~ .exponent-toggle, .field .sign-toggle:disabled, .field .exponent-toggle:disabled { opacity: .4; cursor: not-allowed; }
.composition-extra-fields { margin-top: 16px; border-top: 1px solid var(--line); }
.composition-extra-fields summary { padding: 12px 2px 8px; color: var(--green-dark); font-size: 13px; font-weight: 700; cursor: pointer; }
.composition-extra-fields .field-grid { padding-top: 10px; }
.composition-goal-result { grid-column: 1 / -1; display: flex; min-height: 92px; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 17px; border: 1px solid #b9d9c7; border-radius: 12px; background: #f1f8f4; text-align: center; }
.composition-goal-result span { color: var(--green-dark); font-size: 13px; font-weight: 750; }
.composition-goal-result strong { color: var(--ink); font-size: 25px; line-height: 1.25; overflow-wrap: anywhere; }
.results-heading { margin: 15px 0 -7px; color: var(--ink-soft); font-size: 14px; font-weight: 750; }
.composition-results { grid-template-columns: repeat(3, minmax(0,1fr)); margin-top: 15px; }
.composition-results .empty-state { grid-column: 1/-1; }
.conversion-result { margin-top: 16px; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: #f8fbf9; color: var(--ink); font-size: 23px; font-weight: 740; text-align: center; overflow-wrap: anywhere; }
.unit-family-note { display: flex; flex-direction: column; gap: 3px; margin-top: 17px; color: var(--muted); font-size: 12px; }
.unit-family-note strong { color: var(--ink-soft); font-size: 13px; }
.site-footer { display: flex; justify-content: space-between; gap: 18px; padding: 24px 4px 34px; color: var(--muted); font-size: 12px; }
.site-footer p, .site-footer div { display: flex; align-items: center; flex-wrap: wrap; gap: 15px; margin: 0; }
.site-footer strong { color: var(--ink-soft); font-size: 14px; }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.import-dialog { width: min(760px, calc(100vw - 28px)); max-height: min(88vh, 800px); padding: 22px; border: 1px solid var(--line); border-radius: 17px; color: var(--ink); box-shadow: 0 20px 60px rgba(11,43,33,.23); }
.import-dialog::backdrop { background: rgba(12,35,28,.44); backdrop-filter: blur(2px); }
.import-dialog form { display: flex; flex-direction: column; }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; }
.dialog-heading h2 { margin: 0; font-size: 21px; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--ink-soft); font-size: 23px; }
.dialog-intro { margin: 7px 0 12px; color: var(--muted); font-size: 13px; }
.check-label { min-height: 30px; }
.preview-table-wrap { max-height: 260px; margin-top: 14px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; }
.preview-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.preview-table th, .preview-table td { max-width: 190px; padding: 7px 9px; border-bottom: 1px solid #e9efeb; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-table th { position: sticky; top: 0; background: #f3f7f4; color: var(--ink-soft); }
.dialog-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); max-width: calc(100vw - 28px); padding: 11px 16px; border: 1px solid rgba(255,255,255,.15); border-radius: 10px; background: #173e35; color: white; box-shadow: 0 8px 26px rgba(12,47,37,.25); font-size: 13px; opacity: 0; transform: translate(-50%, 10px); pointer-events: none; transition: .18s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.print-report { display: none; }
body.print-report-mode { background: white; }
body.print-report-mode > *:not(#print-report) { display: none !important; }
body.print-report-mode #print-report { display: block; }
body.print-chart-mode { background: white; }
body.print-chart-mode > *:not(main) { display: none !important; }
body.print-chart-mode main > *:not(#view-curve) { display: none !important; }
body.print-chart-mode #view-curve > *:not(.chart-panel) { display: none !important; }
body.print-chart-mode .chart-panel { display: block !important; border: 0; box-shadow: none; }
body.print-chart-mode .chart-panel > *:not(.chart-wrap) { display: none !important; }
#print-report h1 { margin: 0 0 4px; color: #183b33; font-size: 22px; }
#print-report h2 { margin: 18px 0 7px; color: #183b33; font-size: 15px; }
#print-report p { margin: 4px 0; font-size: 11px; }
#print-report .report-meta { color: #596d65; font-size: 10px; }
#print-report .report-equation { padding: 9px 11px; border-left: 3px solid #1a6257; background: #f1f6f3; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
#print-report svg { width: 100%; height: auto; max-height: 430px; }
#print-report table { width: 100%; border-collapse: collapse; font-size: 9px; }
#print-report th, #print-report td { padding: 4px 5px; border: 1px solid #ccd8d1; text-align: left; }
#print-report th { background: #eef4f0; }
#print-report .warning { color: #86480f; }
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: white !important; color: #152d27; font-size: 10pt; }
  body.print-report-mode > *:not(#print-report) { display: none !important; }
  body.print-report-mode #print-report { display: block !important; }
  body.print-chart-mode > *:not(main) { display: none !important; }
  body.print-chart-mode main > *:not(#view-curve), body.print-chart-mode #view-curve > *:not(.chart-panel) { display: none !important; }
  body.print-chart-mode .chart-panel, body.print-chart-mode .chart-wrap { display: block !important; border: 0; box-shadow: none; }
  body.print-chart-mode .chart-panel > *:not(.chart-wrap) { display: none !important; }
}
@media (max-width: 900px) {
  .page-shell { width: min(100% - 36px, 760px); }
  .field-grid.four { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .result-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .data-table#unknown-table th:nth-child(2), .data-table#unknown-table th:nth-child(3), .data-table#unknown-table th:nth-child(4) { width: auto; }
  .site-footer { flex-direction: column; }
}
@media (max-width: 620px) {
  .site-header { min-height: 64px; padding: 10px 17px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 11px; }
  .brand-copy strong { font-size: 17px; }
  .brand-copy small { font-size: 10px; }
  .privacy-chip { max-width: 132px; font-size: 11px; line-height: 1.25; }
  .header-actions { gap: 10px; }
  .language-toggle { height: 38px; min-width: 43px; }
  .page-shell { width: calc(100% - 26px); }
  .intro { min-height: 156px; padding: 22px 18px; margin: 9px 0 14px; border-radius: 17px; }
  .intro h1 { max-width: 300px; font-size: clamp(22px, 6vw, 29px); }
  .intro-text { max-width: 390px; font-size: 13px; line-height: 1.6; }
  .intro-stamp { display: none; }
  .tool-tabs { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 4px; padding: 4px; margin-bottom: 16px; border-radius: 12px; }
  .tool-tab { min-height: 42px; flex-direction: column; gap: 1px; padding: 5px 3px; border-radius: 9px; font-size: 12px; }
  .tool-icon { font-size: 14px; }
  .tab-icon { font-size: 14px; }
  .section-heading { align-items: center; margin-bottom: 12px; }
  .section-heading h2 { font-size: 21px; }
  .section-heading > .button { flex: 0 0 auto; }
  .section-heading > div > p:not(.eyebrow) { font-size: 13px; }
  .panel { padding: 17px 14px 16px; margin-bottom: 12px; border-radius: 14px; }
  .panel-heading { gap: 9px; margin-bottom: 14px; }
  .heading-cluster { gap: 9px; }
  .panel-heading h3 { font-size: 16px; }
  .panel-heading p { font-size: 12px; line-height: 1.45; }
  .step-badge { width: 27px; height: 27px; flex-basis: 27px; }
  .field-grid.four, .field-grid.three { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px 10px; }
  .field-grid.composition-select-row { grid-template-columns: 1fr; max-width: none; }
  .field { gap: 5px; font-size: 12px; }
  .field input, .field select, .input-unit select { height: 44px; padding: 8px 9px; font-size: 16px; }
  .field input::placeholder { font-size: 12px; }
  .input-unit { gap: 5px; }
  .input-unit select { min-width: 75px; padding-left: 8px; padding-right: 24px; }
  .button { min-height: 43px; padding: 8px 10px; font-size: 13px; }
  .panel-heading-between { align-items: flex-start; }
  .panel-heading-between > .button-row { flex: 0 0 auto; }
  .panel-heading-between > .button-row .button { min-height: 37px; padding: 7px 8px; font-size: 12px; }
  .panel-heading-between > .button-row .button span:not([aria-hidden]) { white-space: nowrap; }
  .data-table { table-layout: auto; }
  .data-table thead { display: none; }
  .data-table tbody { display: flex; flex-direction: column; gap: 8px; }
  .data-table tr { display: grid; grid-template-columns: 1fr 1fr 36px; gap: 7px; padding: 10px; border: 1px solid #e5ece8; border-radius: 10px; background: #fcfdfc; }
  .data-table#unknown-table tr { grid-template-columns: 1fr 1fr 36px; }
  .data-table td { display: block; min-width: 0; padding: 0; border: 0; }
  .data-table td:first-child { display: none; }
  .data-table td:last-child { width: auto; text-align: right; }
  .data-table td[data-label]::before { content: attr(data-label); display: block; min-height: 18px; margin: 0 0 3px; color: var(--muted); font-size: 11px; font-weight: 650; }
  #unknown-table td[data-label="Dilution factor"], #unknown-table td[data-label="希釈倍率"] { grid-column: 1 / 2; }
  #unknown-table td:last-child { grid-column: 3; grid-row: 1; align-self: end; }
  #standards-table td:last-child { grid-column: 3; grid-row: 1; align-self: end; }
  .data-table input { height: 42px; padding: 7px 8px; font-size: 16px; }
  .row-remove { width: 32px; height: 34px; margin-top: 18px; }
  .table-footer { align-items: flex-start; flex-direction: column; gap: 3px; margin-top: 10px; }
  .paste-hint { text-align: left; }
  .chart-heading { align-items: flex-start; }
  .advanced-settings summary { min-height: 38px; padding: 8px 9px; font-size: 12px; }
  .settings-popover { right: -2px; top: 43px; width: min(490px, calc(100vw - 40px)); }
  .settings-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .chart-wrap { min-height: 190px; margin: 0 -6px; }
  #curve-chart { min-height: 210px; }
  .chart-legend { gap: 6px 12px; font-size: 11px; }
  .regression-options { align-items: stretch; gap: 9px; padding: 10px; }
  .field.compact { min-width: 0; max-width: none; flex: 1 1 130px; }
  .weight-note { flex: 1 1 100%; min-width: 0; margin: 0; }
  .metric-card { min-height: 78px; padding: 10px 11px; }
  .metric-label { font-size: 11px; }
  .metric-value { font-size: 17px; }
  .metric-subtitle { font-size: 10px; }
  .definition-note { font-size: 11px; line-height: 1.6; }
  .goal-equation { grid-template-columns: 1fr; gap: 7px; }
  .goal-box { padding: 10px 11px; }
  .goal-arrow { transform: rotate(-90deg); font-size: 20px; }
  .goal-route-list { grid-template-columns: 1fr; }
  .goal-route strong { font-size: 12px; }
  .composition-input-note { font-size: 11px; }
  .composition-goal-result strong { font-size: 22px; }
  .results-table-wrap { margin-left: -3px; width: calc(100% + 6px); }
  .results-table th { font-size: 11px; }
  .results-table td { font-size: 12px; }
  .output-actions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; }
  .output-actions .button, .output-actions .file-button { min-width: 0; white-space: nowrap; }
  .site-footer { padding: 17px 3px 26px; }
  .site-footer p, .site-footer div { gap: 11px; }
  .import-dialog { padding: 17px 14px; }
  .dialog-actions { align-items: stretch; flex-direction: column; }
  .dialog-actions .button { width: 100%; }
  .conversion-result { font-size: 19px; }
}
@media (max-width: 370px) {
  .privacy-chip { max-width: 90px; }
  .intro h1 { font-size: 21px; }
  .panel-heading-between { flex-wrap: wrap; }
  .panel-heading-between > .button-row { width: 100%; padding-left: 36px; }
  .field-grid.four, .field-grid.three { grid-template-columns: 1fr; }
  .result-grid, .composition-results { grid-template-columns: 1fr 1fr; }
}
.numeric-wrap { display: flex; align-items: stretch; gap: 4px; min-width: 0; }
.numeric-wrap input { width: auto; flex: 1 1 auto; min-width: 0; }
.sign-toggle { flex: 0 0 35px; min-width: 35px; border: 1px solid var(--line-strong); border-radius: 8px; background: #f7faf8; color: var(--green); font-size: 14px; font-weight: 750; }
.sign-toggle:hover { background: var(--mint); }
.exponent-toggle { min-height: 41px; flex: 0 0 38px; min-width: 38px; padding: 0 3px; border: 1px solid var(--line-strong); border-radius: 8px; background: #f7faf8; color: var(--green); font-size: 11px; font-weight: 750; }
.exponent-toggle:hover { background: var(--mint); }
.conversion-result small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; font-weight: 500; }
body.print-chart-mode #view-curve { display: block !important; }
.policy-page { padding-bottom: 36px; }
.policy-page .section-heading { margin-top: 22px; }
.policy-page .section-heading h1 { font-size: 27px; }
.policy-page .panel h2 { margin: 0 0 14px; color: var(--green); font-size: 20px; }
.policy-page .panel h3 { margin: 20px 0 5px; font-size: 15px; }
.policy-page .panel h3:first-of-type { margin-top: 0; }
.policy-page .panel p { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.8; }
