:root {
  color-scheme: light;
  --ink: #1f3033;
  --deep: #123f47;
  --deep-soft: #1d5960;
  --muted: #65716f;
  --line: #ddcfbd;
  --surface: #fffdf8;
  --canvas: #f4eee3;
  --paper: #faf4e9;
  --kraft: #bb7041;
  --kraft-dark: #854522;
  --mint: #0b7066;
  --mint-bg: #e3f3ed;
  --warning: #8b4b10;
  --warning-bg: #fff0d6;
  --danger: #a63b32;
  --danger-bg: #ffebe6;
  --shadow: 0 18px 38px rgba(53, 45, 33, 0.1);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  line-height: 1.6;
  font-weight: 400;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; background: var(--canvas); }
img { max-width: 100%; }
a { color: var(--deep-soft); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid #e6a23c;
  outline-offset: 3px;
}
button, input, select { font: inherit; }
button { cursor: pointer; }

.site-header {
  padding: 30px 20px 58px;
  color: #fffaf1;
  background:
    radial-gradient(circle at 100% 5%, rgba(225, 164, 102, .22), transparent 31%),
    linear-gradient(122deg, #10353d 0%, var(--deep) 62%, #21575b 100%);
}
.header-inner, .page { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.header-inner { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero-copy { display: grid; gap: 16px; }
.brand-mark { margin: 0; color: #dce9da; font-size: .78rem; letter-spacing: .2em; font-weight: 800; }
.hero-kicker { margin: 0; color: #e7ae70; font-size: .86rem; font-weight: 800; letter-spacing: .1em; }
.site-header h1 { max-width: 620px; margin: 0; color: #fffaf1; font-size: clamp(2rem, 5vw, 3.7rem); line-height: 1.14; letter-spacing: -.055em; }
.hero-title-line { display: block; white-space: nowrap; }
.lead { max-width: 610px; margin: 0; color: #dce8e2; font-size: clamp(1rem, 2vw, 1.16rem); }
.hero-note { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-note span { padding: 5px 10px; color: #f8dfbd; background: rgba(255, 249, 237, .08); border: 1px solid rgba(248, 223, 189, .28); border-radius: 999px; font-size: .78rem; font-weight: 700; }
.header-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.header-links a { display: inline-flex; min-height: 44px; align-items: center; padding: 8px 13px; color: #fffaf1; border: 1px solid rgba(255, 250, 241, .32); border-radius: 9px; font-size: .9rem; font-weight: 800; text-decoration: none; }
.header-links a:hover { color: var(--deep); background: #fffaf1; }
.hero-visual { min-width: 0; margin: 0; overflow: hidden; background: #d9bd9d; border: 1px solid rgba(255, 250, 241, .28); border-radius: 22px; box-shadow: 0 24px 50px rgba(6, 27, 31, .3); }
.hero-image { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: 69% center; }
.hero-visual figcaption { padding: 10px 15px 12px; color: #f7e6cd; background: rgba(18, 63, 71, .86); font-size: .78rem; }

.page { margin-top: -28px; padding-bottom: 60px; }
.card { margin-bottom: 24px; padding: clamp(22px, 4vw, 38px); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 8px; color: var(--deep); font-size: clamp(1.4rem, 3vw, 1.9rem); letter-spacing: -.03em; }
.section-intro { max-width: 780px; margin: 0 0 25px; color: var(--muted); }
.eyebrow { margin: 0 0 5px; color: var(--kraft-dark); font-size: .75rem; letter-spacing: .11em; font-weight: 900; }
.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; }

.calculator-layout { display: grid; grid-template-columns: minmax(0, .93fr) minmax(340px, 1.07fr); gap: clamp(22px, 4vw, 38px); align-items: start; }
.form-section, .shipping-form fieldset { min-width: 0; margin: 0 0 20px; padding: 0; border: 0; }
.form-section legend, .shipping-form legend { margin-bottom: 12px; padding: 0; color: var(--deep); font-size: .83rem; font-weight: 900; letter-spacing: .04em; }
.form-section--sale { margin-bottom: 22px; padding: 18px; background: var(--paper); border: 1px solid #e5d4bc; border-radius: 14px; }
.form-section--sale legend { margin-bottom: 9px; color: var(--kraft-dark); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: grid; min-width: 0; gap: 7px; }
.field--wide { grid-column: 1 / -1; }
.field label { color: var(--ink); font-size: .92rem; font-weight: 800; }
.field small, .field-hint { color: var(--muted); font-size: .78rem; line-height: 1.45; }
.field input, .field select { width: 100%; min-height: 48px; padding: 9px 12px; color: var(--ink); background: #fffefb; border: 1px solid #bcae9d; border-radius: 9px; font-size: 1rem; }
.field input::placeholder { color: #8a938f; }
.field input:focus, .field select:focus { border-color: var(--deep-soft); box-shadow: 0 0 0 3px rgba(29, 89, 96, .15); outline: none; }
.input-with-unit { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.unit { color: var(--muted); font-size: .92rem; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 5px; }
.primary-button, .secondary-button, .quiet-button { min-height: 46px; padding: 9px 16px; border-radius: 9px; font-weight: 800; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.primary-button { color: #fffaf1; background: var(--deep); border: 1px solid var(--deep); box-shadow: 0 5px 13px rgba(18, 63, 71, .2); }
.primary-button:hover { background: #0d3037; transform: translateY(-1px); }
.secondary-button { color: var(--deep); background: #eaf3ed; border: 1px solid #b9d7c7; }
.secondary-button:hover { background: #dcece2; }
.quiet-button { color: var(--muted); background: #fffefb; border: 1px solid var(--line); }
.quiet-button:hover { color: var(--ink); background: var(--paper); }
button:disabled { cursor: not-allowed; opacity: .52; }
.status-note, .muted-note { color: var(--muted); font-size: .85rem; }
.status-note { min-height: 1.5em; margin: 4px 0 0; }

.result-panel { min-width: 0; min-height: 420px; padding: clamp(18px, 3vw, 26px); background: #fcfaf4; border: 1px solid #d9cbb8; border-radius: 17px; }
.result-panel--positive { border-color: #b8d7c9; background: linear-gradient(145deg, #fffdf8 12%, var(--mint-bg)); }
.result-panel--negative { border-color: #e4b6ac; background: linear-gradient(145deg, #fffdf8 12%, var(--danger-bg)); }
.result-panel--invalid { background: #fff8ed; border-color: #e7c28f; }
.result-heading { display: flex; justify-content: space-between; gap: 14px; align-items: start; }
.result-heading h3 { margin: 0; color: var(--deep); font-size: 1.32rem; }
.result-heading .eyebrow { margin-bottom: 3px; }
.profit-flow-label { margin: 22px 0 9px; color: var(--muted); font-size: .77rem; font-weight: 800; letter-spacing: .04em; }
.profit-flow { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.2fr) auto minmax(0, 1fr); gap: 8px; align-items: stretch; }
.flow-step { display: flex; min-width: 0; min-height: 104px; flex-direction: column; justify-content: center; padding: 13px 12px; border: 1px solid #dccdb8; border-radius: 12px; background: rgba(255, 253, 248, .86); }
.flow-step--sale { background: #fff6e8; border-color: #e6cda8; }
.flow-step--cost { background: #f4f1e9; }
.flow-step--profit { color: var(--mint); background: #e6f4ed; border-color: #b8d7c9; }
.profit-flow--negative .flow-step--profit { color: var(--danger); background: #ffebe6; border-color: #e4b6ac; }
.flow-label { color: var(--muted); font-size: .78rem; font-weight: 800; }
.flow-step--profit .flow-label { color: currentColor; }
.flow-value, .profit-number { display: block; max-width: 100%; margin-top: 3px; color: inherit; font-size: clamp(1.3rem, 3vw, 2rem); font-variant-numeric: tabular-nums; letter-spacing: -.045em; line-height: 1.14; overflow-wrap: anywhere; }
.flow-meta { margin-top: 6px; color: var(--muted); font-size: .7rem; line-height: 1.35; }
.flow-status { display: inline-flex; align-self: flex-start; min-height: 24px; align-items: center; margin-top: 8px; padding: 2px 7px; color: currentColor; border: 1px solid currentColor; border-radius: 999px; font-size: .73rem; font-weight: 900; }
.flow-arrow { display: grid; place-items: center; color: var(--kraft); font-size: 1.2rem; font-weight: 900; }
.profit-rate { margin: 16px 0 20px; padding: 11px 13px; color: var(--ink); background: rgba(255, 255, 255, .66); border: 1px solid rgba(116, 135, 122, .2); border-radius: 9px; }
.profit-rate strong { margin-left: 6px; font-variant-numeric: tabular-nums; }
.breakdown-heading { margin: 0 0 8px; color: var(--deep); font-size: .86rem; font-weight: 900; }
.breakdown { margin: 0; border-top: 1px solid rgba(116, 135, 122, .3); }
.breakdown div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(116, 135, 122, .18); }
.breakdown dt, .breakdown dd { min-width: 0; margin: 0; }
.breakdown dd { text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.line-note { display: block; color: var(--muted); font-size: .7rem; font-weight: 400; }
.warning { margin: 17px 0 0; padding: 11px 13px; color: var(--warning); background: var(--warning-bg); border: 1px solid #edc990; border-radius: 9px; font-weight: 800; }
.muted-note { margin: 13px 0 0; }

.shipping-form { margin-bottom: 24px; padding: 19px; background: var(--paper); border: 1px solid #e5d4bc; border-radius: 15px; }
.shipping-form .form-grid { gap: 14px; }
.confirmation-grid { display: grid; gap: 9px; margin-top: 5px; }
.checkbox-label { display: flex; min-height: 44px; align-items: flex-start; gap: 8px; padding: 8px 0; color: var(--ink); font-size: .84rem; line-height: 1.45; }
.checkbox-label input { flex: 0 0 auto; width: 19px; min-height: 19px; margin: 2px 0 0; accent-color: var(--deep-soft); }
.shipping-summary { margin: 0 0 18px; color: var(--muted); }
.shipping-summary .warning { margin-top: 0; }
.shipping-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.shipping-card { display: flex; min-width: 0; flex-direction: column; gap: 11px; padding: 18px; border: 1px solid var(--line); border-top: 5px solid #c6c0b2; border-radius: 14px; background: #fffefb; }
.shipping-card[data-status="available"] { border-top-color: var(--mint); }
.shipping-card[data-status="additional"] { border-top-color: #c67c25; }
.shipping-card[data-status="unavailable"] { border-top-color: var(--danger); }
.shipping-card--recommended { box-shadow: 0 0 0 2px rgba(187, 112, 65, .16); }
.shipping-card__top { display: flex; min-width: 0; justify-content: space-between; align-items: start; gap: 12px; }
.shipping-card__top > div { min-width: 0; }
.shipping-card h3 { margin: 0; color: var(--deep); font-size: 1.1rem; line-height: 1.35; overflow-wrap: anywhere; }
.shipping-meta { margin: 5px 0 0; color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
.shipping-cost { margin: 0; color: var(--ink); font-size: .92rem; font-weight: 800; overflow-wrap: anywhere; }
.shipping-conditions { margin: 0; color: var(--muted); font-size: .83rem; overflow-wrap: anywhere; }
.reason-list { margin: -2px 0 0; padding-left: 20px; color: var(--warning); font-size: .82rem; overflow-wrap: anywhere; }
.available-note { margin: -2px 0 0; color: var(--mint); font-size: .82rem; font-weight: 800; }
.shipping-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.status, .expiry-badge, .candidate-badge, .checked-date { display: inline-flex; max-width: 100%; min-height: 28px; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: .73rem; font-weight: 900; overflow-wrap: anywhere; }
.status--available { color: #075e55; background: #d8f1e7; }
.status--unavailable { color: #8f2e28; background: #ffe1dc; }
.status--additional { color: #7a460d; background: #ffedc6; }
.expiry-badge { color: #8d2b16; background: #ffe4dd; }
.candidate-badge { color: #75421f; background: #f7e6ca; }
.checked-date { color: var(--muted); background: #f1eee7; font-weight: 700; }
.shipping-meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-top: 3px; }
.shipping-meta-item { min-width: 0; padding: 8px 9px; background: #f8f3eb; border-radius: 8px; color: var(--muted); font-size: .75rem; overflow-wrap: anywhere; }
.shipping-meta-item strong { display: block; color: var(--ink); font-size: .77rem; }
.shipping-card__actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; margin-top: auto; padding-top: 5px; }
.shipping-card__actions a { display: inline-flex; min-height: 44px; align-items: center; padding: 5px 0; font-size: .82rem; font-weight: 800; }
.shipping-card__actions .secondary-button { min-height: 44px; padding: 7px 11px; font-size: 1rem; }

.info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.info-grid details { padding: 16px 18px; background: var(--paper); border: 1px solid #e5d4bc; border-radius: 13px; }
.info-grid summary { min-height: 28px; cursor: pointer; color: var(--deep); font-weight: 900; }
.info-grid p, .info-grid ul, .info-grid ol { color: var(--muted); font-size: .9rem; }
.info-grid ul, .info-grid ol { padding-left: 20px; }
.site-footer { padding: 28px 20px 48px; color: var(--muted); text-align: center; font-size: .82rem; }

@media (max-width: 900px) {
  .calculator-layout { grid-template-columns: 1fr; }
  .result-panel { min-height: 0; }
  .info-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .header-inner { grid-template-columns: 1fr; gap: 28px; }
  .hero-visual { max-width: 700px; }
  .shipping-results { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .site-header { padding: 25px 16px 48px; }
  .header-inner, .page { width: min(100% - 22px, 1180px); }
  .site-header h1 { font-size: clamp(1.95rem, 10vw, 2.8rem); }
  .hero-image { aspect-ratio: 4 / 3; object-position: 73% center; }
  .hero-visual { border-radius: 16px; }
  .page { margin-top: -22px; }
  .card { padding: 20px 16px; border-radius: 17px; }
  .form-grid { grid-template-columns: 1fr; }
  .field--wide { grid-column: auto; }
  .form-section--sale { padding: 15px; }
  .shipping-form { padding: 15px; }
  .profit-flow { grid-template-columns: 1fr; gap: 6px; }
  .flow-step { min-height: 84px; }
  .flow-arrow { min-height: 22px; transform: rotate(90deg); }
  .flow-value, .profit-number { font-size: clamp(1.45rem, 8vw, 2rem); }
  .shipping-card__top { flex-direction: column; }
  .shipping-card__actions { align-items: stretch; flex-direction: column; }
  .shipping-card__actions .secondary-button { width: 100%; }
  .button-row > * { flex: 1 1 150px; }
}

@media print {
  @page { margin: 12mm; }
  body { color: var(--ink); background: #fff; }
  .site-header { padding: 0 0 16px; color: var(--ink); background: #fff; }
  .header-inner { display: block; width: 100%; }
  .hero-copy { display: block; }
  .brand-mark { color: var(--deep); }
  .hero-kicker { margin-top: 5px; color: var(--kraft-dark); }
  .site-header h1 { margin-top: 6px; color: var(--deep); }
  .lead { margin-top: 8px; color: var(--ink); }
  .hero-note { margin-top: 8px; }
  .hero-note span { color: var(--deep); background: #fff; border-color: var(--line); }
  .hero-visual, .header-links, .button-row, .shipping-card__actions, .site-footer { display: none; }
  .page { width: 100%; margin: 0; padding-bottom: 0; }
  .card { box-shadow: none; break-inside: avoid; }
  .result-panel { min-height: 0; }
}

/* Stage A: first-view compression and tool entry */
.site-header { padding: 18px 20px 28px; }
.header-inner { grid-template-columns: minmax(0, 1fr) minmax(0, .82fr); gap: 24px; }
.hero-copy { gap: 10px; }
.site-header h1 { max-width: 23ch; font-size: clamp(1.8rem, 3.8vw, 3rem); line-height: 1.15; word-break: auto-phrase; }
.hero-title-line { white-space: normal; }
.lead { font-size: .96rem; line-height: 1.5; }
.hero-image { max-height: 230px; }
.firstview-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin: 4px 0 6px; padding-left: 1.1rem; color: #e5eee8; font-size: 11px; font-weight: 700; line-height: 1.4; }
.firstview-steps li { min-width: 0; padding-right: 3px; }
.hero-note { gap: 6px; }
.hero-note span { padding: 4px 8px; font-size: .7rem; }
.header-links .firstview-cta { color: var(--deep); background: #f4c68b; border-color: #f4c68b; }
.header-links .firstview-cta:hover { color: var(--deep); background: #ffdfb6; }
.header-links .firstview-cta:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
@media (max-width: 640px) {
  .site-header { padding: 14px 16px 20px; }
  .header-inner { grid-template-columns: 1fr; gap: 8px; }
  .hero-visual { display: none; }
  .site-header h1 { font-size: clamp(1.6rem, 7.5vw, 2rem); }
  .lead { font-size: .85rem; }
  .firstview-steps { gap: 3px; margin: 2px 0 4px; padding-left: 1rem; font-size: 10px; }
  .firstview-steps li { padding-right: 1px; }
  .hero-note span { padding: 4px 7px; font-size: .66rem; }
  .header-links { gap: 6px; margin-top: 1px; }
  .header-links a { min-height: 42px; padding: 7px 9px; font-size: .77rem; }
  .header-links .firstview-cta { flex: 1 1 100%; justify-content: center; }
  .card#calculator > .eyebrow { display: none; }
  .card#calculator h2 { margin-bottom: 4px; font-size: 1.15rem; }
  .card#calculator .section-intro { margin-bottom: 14px; font-size: .82rem; line-height: 1.45; }
}

