/* 手取り計算機：蛍光ペンの黄色 × 伝票 */
.page-hero .lead strong, .prose .lead strong { background: linear-gradient(transparent 58%, var(--yellow) 58%, var(--yellow) 92%, transparent 92%); }
:root[data-theme="dark"] .page-hero .lead strong { background: linear-gradient(transparent 58%, rgba(255, 214, 10, .45) 58%, rgba(255, 214, 10, .45) 92%, transparent 92%); }

.tedori-tool { display: grid; gap: 28px; margin: 8px 0 48px; align-items: start; }
@media (min-width: 900px) {
  .tedori-tool { grid-template-columns: minmax(330px, 410px) 1fr; gap: 32px; }
  .tool-inputs { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; }
}
.tool-inputs { padding: 0; display: grid; gap: 0; }
.tool-inputs > * { padding-left: 18px; padding-right: 18px; }
.tool-head { background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: .78rem; font-weight: 700; letter-spacing: .08em; padding-top: 8px; padding-bottom: 8px; display: flex; justify-content: space-between; }
.tool-body { display: grid; gap: 20px; padding-top: 18px; padding-bottom: 20px; }
.tool-inputs .seg { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
.tool-inputs fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.tool-inputs legend { margin-bottom: 8px; padding: 0; }

.amount-input { position: relative; }
.amount-input > span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-weight: 700; color: var(--ink); font-size: 1.5rem; pointer-events: none; }
.amount-input .input { padding-left: 42px; font-family: var(--mono); font-size: 2rem; font-weight: 700; min-height: 68px; letter-spacing: -.02em; background: var(--accent-soft); }
.amount-input .input:focus { background: var(--surface); }
.amount-input.sm > span { font-size: 1rem; left: 13px; }
.amount-input.sm .input { font-size: 16px; min-height: 46px; padding-left: 32px; background: var(--surface); }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick .btn { font-family: var(--mono); font-weight: 700; min-height: 34px; padding: 0 10px; font-size: .82rem; }

.conditions { border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.conditions summary { cursor: pointer; padding: 11px 14px; font-weight: 700; font-size: .92rem; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; list-style: none; }
.conditions summary::-webkit-details-marker { display: none; }
.conditions summary::before { content: "+"; font-family: var(--mono); font-weight: 700; width: 20px; height: 20px; display: inline-grid; place-items: center; border: 2px solid var(--line); border-radius: 3px; background: var(--surface); align-self: center; line-height: 1; }
.conditions[open] summary::before { content: "−"; }
.conditions[open] summary { border-bottom: 2px dashed var(--line-soft); }
.cond-summary { font-weight: 500; }
.cond-body { padding: 14px 14px 16px; display: grid; gap: 16px; }
.platform-options, .custom-options { display: grid; gap: 14px; }

/* ----- 結果（伝票） ----- */
.results-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.results-title { margin: 0; }
.results-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .78rem; color: var(--ink-2); margin: 0 0 14px; font-weight: 700; }
.lg::before { content: ""; display: inline-block; width: 12px; height: 12px; border: 1.5px solid var(--line); margin-right: 5px; vertical-align: -2px; }
.lg.net::before { background: var(--mint); } .lg.fee::before { background: var(--fee); } .lg.wh::before { background: var(--yellow); }
.lg.tax::before { background: repeating-linear-gradient(45deg, var(--ink) 0 1.5px, transparent 1.5px 4px); }

.results { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 14px; counter-reset: rank; }
.result { padding: 0; display: grid; position: relative; overflow: visible; }
.result > * { padding-left: 16px; padding-right: 16px; }
.r-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 10px; border-bottom: 2px dashed var(--line-soft); }
.r-rank { font-family: var(--mono); font-weight: 700; font-size: .78rem; background: var(--ink); color: var(--paper); padding: 2px 7px; border-radius: 3px; flex: none; }
.r-head h3 { margin: 0; font-size: 1.02rem; }
.r-diff { margin-left: auto; font-size: .82rem; color: var(--ink-3); font-family: var(--mono); }
.r-main { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 6px; }
.r-label { font-size: .8rem; color: var(--ink-2); font-weight: 700; }
.r-value { font-family: var(--mono); font-size: 2.1rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.05; }
.r-rate { font-size: .82rem; color: var(--ink-3); font-family: var(--mono); }
.bar { display: flex; height: 16px; margin: 4px 16px 12px; padding: 0 !important; border: 2px solid var(--line); border-radius: 3px; overflow: hidden; background: var(--surface-2); }
.bar span { height: 100%; transition: width .25s ease; }
.bar span + span { box-shadow: -2px 0 0 var(--line); }
.bar span[style*="width:0.00%"] { box-shadow: none; }
.bar .b-net { background: var(--mint); } .bar .b-fee { background: var(--fee); } .bar .b-wh { background: var(--yellow); }
.bar .b-tax { background: repeating-linear-gradient(45deg, var(--ink) 0 1.5px, transparent 1.5px 4px); }
.r-lines { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 0 20px; margin: 0; font-size: .86rem; padding-bottom: 10px; }
.r-lines div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dotted var(--line-soft); padding: 4px 0; }
.r-lines dt { color: var(--ink-2); } .r-lines dd { margin: 0; font-family: var(--mono); font-weight: 700; }
.r-lines .neg dd { color: var(--fee); }
.r-meta { margin: 0; font-size: .76rem; color: var(--ink-3); display: flex; gap: 6px 10px; flex-wrap: wrap; align-items: center; padding-top: 8px; padding-bottom: 4px; background: var(--surface-2); border-top: 2px solid var(--line); }
.r-meta a { color: var(--ink-2); }
.r-note { margin: 0; font-size: .78rem; color: var(--ink-3); background: var(--surface-2); padding-bottom: 10px; border-radius: 0 0 var(--radius) var(--radius); }

/* いちばん残る：黄色の伝票に朱色のはんこ */
.result.best { background: var(--accent-soft); box-shadow: var(--shadow-lg); }
.stamp {
  position: absolute; right: 14px; top: -16px; width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; text-align: center;
  font-size: .72rem; font-weight: 700; line-height: 1.2; color: var(--fee); border: 3px double var(--fee); background: color-mix(in srgb, var(--surface) 80%, transparent);
  transform: rotate(-12deg); padding: 0 !important; letter-spacing: .02em;
}
.best .r-diff { margin-right: 74px; }
@media (max-width: 520px) { .stamp { width: 62px; height: 62px; font-size: .64rem; top: -12px; right: 8px; } .best .r-diff { margin-right: 60px; } }

.empty { padding: 28px; text-align: center; color: var(--ink-3); border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface); }
.to-irai { margin-top: 6px; }

/* 販売先ごとの条件 */
.po-group { border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); padding: 10px 12px 12px; margin: 0; display: grid; gap: 10px; min-width: 0; }
.po-group legend { font-weight: 700; font-size: .85rem; padding: 0 6px; background: var(--ink); color: var(--paper); border-radius: 3px; }
/* 金額によって変わるポイント・下限の注意 */
.r-tip { margin: 0 0 10px; font-size: .82rem; background: var(--yellow); color: #121212; border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 6px 10px; margin-left: 16px; margin-right: 16px; padding-left: 10px !important; padding-right: 10px !important; }
.r-tip b { font-family: var(--mono); font-size: .72rem; background: #121212; color: #fffcf2; padding: 1px 6px; border-radius: 3px; margin-right: 8px; letter-spacing: .04em; }
.r-warn { margin: 0 16px 10px; padding: 6px 10px !important; font-size: .82rem; font-weight: 700; color: var(--fee); border: 2px dashed var(--fee); border-radius: var(--radius-sm); background: var(--fee-soft); }
.r-meta a { margin-left: 2px; }
.r-ratelabel { font-weight: 700; color: var(--ink-2); }
