:root {
  --ink: #263348;
  --muted: #7e8795;
  --line: #e8e3da;
  --paper: #ffffff;
  --cream: #fff9ef;
  --orange: #ef744b;
  --orange-dark: #c85836;
  --orange-pale: #fff0e7;
  --blue-pale: #edf2f7;
  --shadow: 0 20px 45px rgba(57, 47, 33, 0.08);
}

* { box-sizing: border-box; }
html { background: var(--cream); }
body { margin: 0; min-width: 320px; color: var(--ink); background: linear-gradient(180deg, #fffaf2 0%, #fffdfb 58%, #f7f8fa 100%); font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif; line-height: 1.55; }
button { font: inherit; }
.page-shell { width: min(100% - 28px, 880px); margin: 0 auto; padding: 34px 0 44px; }
.hero { display: flex; align-items: center; gap: 16px; padding: 0 6px 30px; }
.brand-mark { display: grid; place-items: center; width: 58px; height: 58px; border: 1px solid #f1b197; border-radius: 19px 19px 19px 7px; color: var(--orange-dark); background: #fff2e8; font-weight: 800; font-size: 13px; letter-spacing: .12em; transform: rotate(-4deg); }
.eyebrow { margin: 0 0 4px; color: var(--orange-dark); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 1px; font-size: clamp(28px, 7vw, 42px); letter-spacing: .03em; line-height: 1.15; }
.lead { margin-bottom: 0; color: var(--muted); font-size: 14px; }
.mode-section, .result-card { border: 1px solid var(--line); background: rgba(255, 255, 255, .88); box-shadow: var(--shadow); }
.mode-section { margin-bottom: 16px; padding: 20px; border-radius: 22px; }
.section-heading, .card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h2 { margin-bottom: 0; font-size: 19px; letter-spacing: .02em; }
.mode-caption { color: var(--muted); font-size: 12px; white-space: nowrap; }
.mode-tabs { display: flex; gap: 8px; margin-top: 16px; overflow-x: auto; padding: 2px 1px 5px; scrollbar-width: thin; }
.mode-tab { min-height: 42px; padding: 8px 13px; border: 1px solid #e2e4e7; border-radius: 999px; color: #687386; background: #fbfcfd; cursor: pointer; font-size: 13px; white-space: nowrap; transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease; }
.mode-tab:hover { border-color: #edb9a5; color: var(--orange-dark); transform: translateY(-1px); }
.mode-tab.is-active { border-color: var(--orange); color: #fff; background: var(--orange); box-shadow: 0 5px 13px rgba(239, 116, 75, .22); }
.result-card { position: relative; overflow: hidden; border-radius: 25px; }
.result-card::before { content: ""; position: absolute; top: -60px; right: -45px; width: 150px; height: 150px; border: 1px solid #f7d3c3; border-radius: 50%; opacity: .7; }
.card-heading { position: relative; padding: 24px 22px 8px; }
.hint { position: relative; margin: 0; padding: 0 22px 17px; color: var(--muted); font-size: 12px; }
.sparkle { color: var(--orange); font-size: 26px; }
.result-list { border-top: 1px solid var(--line); }
.result-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 67px; padding: 12px 18px 12px 22px; border-bottom: 1px solid #f0ede8; background: #fff; transition: background .18s ease; }
.result-row:last-child { border-bottom: 0; }
.result-row.is-locked { background: #fff8f3; }
.result-main { display: grid; grid-template-columns: minmax(88px, 126px) 1fr; align-items: baseline; gap: 12px; min-width: 0; flex: 1; }
.result-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.result-values { display: flex; flex-wrap: wrap; gap: 5px 7px; min-width: 0; }
.value-chip { display: inline; color: var(--ink); font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.value-chip + .value-chip::before { content: "・"; margin-right: 7px; color: #c7cbd1; font-weight: 400; }
.row-actions { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.row-button { min-height: 38px; padding: 7px 9px; border: 1px solid #e5e7eb; border-radius: 10px; color: #737d8b; background: #fff; cursor: pointer; font-size: 11px; white-space: nowrap; }
.row-button:hover, .row-button:focus-visible { border-color: #e9ab94; color: var(--orange-dark); background: var(--orange-pale); }
.is-locked .lock-button { border-color: #f1b197; color: var(--orange-dark); background: var(--orange-pale); }
.action-panel { margin: 0 0 16px; padding: 12px; border: 1px solid var(--line); border-radius: 19px; background: rgba(255,255,255,.84); box-shadow: 0 12px 28px rgba(57,47,33,.05); }
.primary-action, .secondary-action { min-height: 48px; border: 0; border-radius: 13px; cursor: pointer; font-weight: 800; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.primary-action { width: 100%; color: #fff; background: var(--orange); box-shadow: 0 7px 16px rgba(239,116,75,.22); font-size: 15px; }
.primary-action:hover, .primary-action:focus-visible { background: var(--orange-dark); transform: translateY(-1px); box-shadow: 0 10px 20px rgba(200,88,54,.23); }
.secondary-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.secondary-action { color: #697586; background: var(--blue-pale); font-size: 13px; }
.secondary-action:hover, .secondary-action:focus-visible { color: var(--ink); background: #e1e8f0; transform: translateY(-1px); }
.copied-label { display: none; }
#copy-button.is-copied .copy-label { display: none; }
#copy-button.is-copied .copied-label { display: inline; color: #46765f; }
.footer-note { padding: 20px 8px 0; color: #9aa0aa; text-align: center; font-size: 11px; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 10; max-width: calc(100% - 36px); padding: 9px 14px; border-radius: 999px; color: #fff; background: #303b4c; box-shadow: 0 8px 20px rgba(24,30,40,.2); font-size: 12px; opacity: 0; pointer-events: none; transform: translate(-50%, 8px); transition: opacity .18s ease, transform .18s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.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; }
:focus-visible { outline: 3px solid rgba(239,116,75,.45); outline-offset: 2px; }
@media (max-width: 600px) {
  .page-shell { width: min(100% - 18px, 880px); padding-top: 20px; }
  .hero { padding-bottom: 20px; }
  .brand-mark { width: 48px; height: 48px; border-radius: 16px 16px 16px 6px; }
  .mode-section { padding: 16px; border-radius: 18px; }
  .result-card { border-radius: 19px; }
  .card-heading { padding: 20px 16px 7px; }
  .hint { padding: 0 16px 14px; }
  .result-row { display: block; padding: 13px 14px 12px 16px; }
  .result-main { grid-template-columns: 92px 1fr; gap: 8px; }
  .result-label { padding-top: 2px; font-size: 11px; }
  .value-chip { font-size: 14px; }
  .row-actions { justify-content: flex-end; margin-top: 9px; }
  .row-button { min-height: 40px; padding: 7px 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
