/* インボイス値下げ、応じる前に相手へ聞く3問チェック（/invoice-nebiki/）。日英共通。
   上に3問（押すと即座に下が変わる）、その下に「今の時期」の大きな判定と値下げとの比べ、時期別の表、前提、確認文、共有の画像 */
[hidden] { display: none !important; }
.nb { --n-line: var(--hairline, #e5e7eb); --n-soft: var(--ink-soft, #4b5563); --n-acc: var(--accent, #b45309);
  --n-diff: #b45309; --n-diff-bg: #fff7ed; --n-none: #15803d; --n-none-bg: #f0fdf4; --n-check: #4b5563; --n-check-bg: #f3f4f6;
  border: 1px solid var(--n-line); background: var(--panel, #fff); margin-bottom: 8px; }
.nb-from { margin: 0; padding: 10px 18px; border-bottom: 1px solid var(--n-line); background: var(--accent-wash, #fffbeb); font-size: 14px; }

/* 3問 */
.nb-form { padding: 6px 18px 0; }
.nb-q { margin: 0; padding: 14px 0 12px; border: 0; border-bottom: 1px solid var(--n-line); min-width: 0; transition: opacity .15s; }
.nb-q.is-muted { opacity: .55; }
.nb-q.is-muted:focus-within, .nb-q.is-muted:hover { opacity: 1; }
.nb-q legend { display: flex; align-items: center; gap: 10px; padding: 0; margin-bottom: 10px; font-size: 16px; font-weight: 700; }
.nb-step { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink, #1f2937); color: #fff; font-family: var(--mono); font-size: 14px; font-weight: 500; }
.nb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.nb-chips label { position: relative; }
.nb-chips input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.nb-chips span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--hairline-strong, #d1d5db); background: #fff;
  font-size: 15px; font-weight: 500; color: var(--ink, #1f2937); cursor: pointer; transition: transform .08s ease, background-color .12s, border-color .12s; user-select: none; }
.nb-chips label:hover span { border-color: var(--ink, #1f2937); }
.nb-chips input:active + span { transform: scale(.97); }
.nb-chips input:checked + span { border-color: var(--ink, #1f2937); background: var(--ink, #1f2937); color: #fff; font-weight: 700; }
.nb-chips input:focus-visible + span { outline: 2px solid var(--n-acc); outline-offset: 2px; }
.nb-help { margin: 8px 0 0; font-size: 13px; line-height: 1.6; color: var(--n-soft); }

/* 任意の金額 */
.nb-opt { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 18px; padding: 14px 0 16px; }
.nb-opt-h { flex-basis: 100%; margin: 0; font-size: 14px; font-weight: 700; }
.nb-opt-h span { margin-left: 10px; font-size: 12px; font-weight: 500; color: var(--n-soft); }
.nb-num { display: grid; gap: 4px; font-size: 13px; color: var(--n-soft); }
.nb-in { display: flex; align-items: stretch; border: 1px solid var(--hairline-strong, #d1d5db); background: #fff; }
.nb-in:focus-within { border-color: var(--ink, #1f2937); box-shadow: 0 0 0 1px var(--ink, #1f2937); }
.nb-in input { width: 9.5em; min-height: 42px; padding: 0 10px; border: 0; background: transparent; font: inherit; font-family: var(--mono); font-size: 17px; color: var(--ink, #1f2937); text-align: right; outline: none; }
#nb-cut { width: 5em; }
.nb-in i, .nb-in select { display: grid; place-items: center; padding: 0 10px; border: 0; border-left: 1px solid var(--n-line); background: #f9fafb; font: inherit; font-style: normal; font-size: 14px; color: var(--ink, #1f2937); }
.nb-in select { cursor: pointer; }
.nb-clear { min-height: 42px; padding: 0 12px; border: 1px solid var(--n-line); background: #fff; font: inherit; font-size: 13px; color: var(--n-soft); cursor: pointer; }
.nb-err { margin: 0 0 14px; padding: 8px 12px; border-left: 3px solid var(--ng, #c03434); background: #fef2f2; font-size: 14px; }

/* 今の時期 */
.nb-out { border-top: 1px solid var(--n-line); }
.nb-now { position: relative; padding: 18px 18px 16px; border-left: 6px solid var(--n-diff); background: var(--n-diff-bg); }
.nb-now[data-status="none"] { border-left-color: var(--n-none); background: var(--n-none-bg); }
.nb-now[data-status="check"] { border-left-color: var(--n-check); background: var(--n-check-bg); }
.nb-now-when { margin: 0; font-size: 13px; font-weight: 700; color: var(--n-soft); letter-spacing: .02em; }
.nb-now-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 4px 0 6px; }
.nb-now-badge { font-size: 30px; font-weight: 700; line-height: 1.2; color: var(--n-diff); }
.nb-now[data-status="none"] .nb-now-badge { color: var(--n-none); }
.nb-now[data-status="check"] .nb-now-badge { color: var(--ink, #1f2937); }
.nb-now-value { font-family: var(--mono); font-size: 24px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--ink, #1f2937); }
.nb-now[data-status="check"] .nb-now-value { font-family: inherit; font-size: 15px; font-weight: 500; color: var(--n-soft); }
.nb-now-note { margin: 0; font-size: 14px; line-height: 1.7; color: var(--ink, #1f2937); max-width: 46em; }
.nb-cut-text { margin: 10px 0 0; font-size: 15px; font-weight: 700; line-height: 1.6; }
.nb-ms { position: absolute; top: 18px; right: 18px; font-family: var(--mono); font-size: 11px; color: #9ca3af; }
.nb-bars { display: grid; gap: 6px; margin: 14px 0 0; max-width: 620px; }
.nb-bar { display: grid; grid-template-columns: 8.5em 1fr auto; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; }
.nb-bar i { display: block; height: 16px; background: rgba(31, 41, 55, .06); }
.nb-bar b { display: block; height: 100%; background: var(--ink, #1f2937); transform-origin: left center; transition: transform .25s ease; }
.nb-bar.is-diff b { background: var(--n-diff); }
.nb-bar em { min-width: 7.5em; font-family: var(--mono); font-style: normal; font-size: 14px; font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }

/* 時期別の表 */
.nb-table-wrap { padding: 4px 18px 0; }
.nb-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.nb-table caption { padding: 14px 0 8px; text-align: left; font-size: 13px; font-weight: 700; color: var(--n-soft); }
.nb-table th, .nb-table td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--n-line); text-align: left; vertical-align: top; }
.nb-table thead th { padding-top: 0; font-size: 12px; font-weight: 700; color: var(--n-soft); }
.nb-table tbody th { white-space: nowrap; font-weight: 700; padding-left: 10px; border-left: 4px solid var(--n-diff); }
.nb-table tr.s-none th { border-left-color: var(--n-none); }
.nb-table tr.s-check th { border-left-color: #9ca3af; }
.nb-table tr.is-now th::after { content: "NOW"; display: inline-block; margin-left: 8px; padding: 0 5px; background: var(--ink, #1f2937); color: #fff; font-family: var(--mono); font-size: 10px; line-height: 16px; vertical-align: 2px; }
.nb-badge { display: inline-block; padding: 1px 8px; font-size: 13px; font-weight: 700; white-space: nowrap; background: var(--n-diff-bg); color: var(--n-diff); border: 1px solid currentColor; }
.s-none .nb-badge { background: var(--n-none-bg); color: var(--n-none); }
.s-check .nb-badge { background: #fff; color: var(--n-check); }
.nb-re { display: block; margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--ink, #1f2937); }
.nb-val { font-family: var(--mono); font-variant-numeric: tabular-nums; min-width: 9em; }
.nb-val b { display: block; font-size: 16px; font-weight: 500; white-space: nowrap; }
.nb-val small { display: block; font-family: "IBM Plex Sans JP", sans-serif; font-size: 12px; color: var(--n-soft); }
.s-check .nb-val { font-family: inherit; font-size: 13px; color: var(--n-soft); }
.nb-why { font-size: 13px; line-height: 1.6; color: var(--n-soft); }

/* 前提 */
.nb-premise { margin: 14px 18px 18px; padding: 10px 14px; border-left: 3px solid var(--ink, #1f2937); background: #f9fafb; }
.nb-premise h3 { margin: 0 0 2px; font-size: 13px; }
.nb-premise ul { margin: 0; padding-left: 1.2em; font-size: 13px; line-height: 1.7; color: var(--ink, #1f2937); }

/* 確認文・共有 */
.nb-msg-box, .nb-share { padding: 16px 18px 18px; border-top: 1px solid var(--n-line); }
.nb-h { margin: 0 0 10px; font-size: 16px; font-weight: 700; }
#nb-msg { display: block; width: 100%; min-height: 300px; padding: 12px 14px; border: 1px solid var(--hairline-strong, #d1d5db); background: #fff; font: inherit; font-size: 14px; line-height: 1.75; color: var(--ink, #1f2937); resize: vertical; }
#nb-msg:focus { outline: 2px solid var(--ink, #1f2937); outline-offset: -1px; }
.nb-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 10px; }
.nb-btn { min-height: 46px; padding: 0 18px; border: 1px solid var(--ink, #1f2937); background: #fff; font: inherit; font-size: 15px; font-weight: 700; color: var(--ink, #1f2937); cursor: pointer; transition: transform .08s ease, background-color .12s; }
.nb-btn:hover { background: #f3f4f6; }
.nb-btn:active { transform: scale(.97); }
.nb-btn.is-main { border-color: var(--n-acc); background: var(--n-acc); color: #fff; }
.nb-btn.is-main:hover { background: var(--accent-dark, #92400e); }
.nb-msg-status { font-size: 13px; font-weight: 700; color: var(--n-none); }
.nb-fine { margin: 10px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--n-soft); }
.nb-share-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px 20px; align-items: start; }
.nb-share-grid canvas { display: block; width: 100%; height: auto; border: 1px solid var(--n-line); }
.nb-share-grid > div { display: grid; gap: 10px; justify-items: start; }
.nb-check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.nb-check input { width: 18px; height: 18px; }
.nb-link-warn { margin: 0; padding: 6px 10px; border-left: 3px solid var(--n-line); font-size: 12.5px; line-height: 1.6; color: var(--n-soft); }
.nb-link-warn.is-money { border-left-color: var(--n-acc); background: var(--accent-wash, #fffbeb); color: var(--ink, #1f2937); }
.nb-share .nb-msg-status { margin: 0; }

/* 次に使う */
.nb-next { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--n-line); }
.nb-next a { display: grid; gap: 2px; padding: 14px 18px; color: var(--ink, #1f2937); text-decoration: none; }
.nb-next a + a { border-left: 1px solid var(--n-line); }
.nb-next a:hover b { text-decoration: underline; }
.nb-next b { font-size: 14px; }
.nb-next span { font-size: 12.5px; color: var(--n-soft); }
.nb-about-h { margin: 18px 0 6px; font-size: 16px; }
.nb-all { margin: 12px 0 0; font-size: 14px; }

@media (max-width: 720px) {
  .nb-form, .nb-table-wrap { padding-left: 14px; padding-right: 14px; }
  .nb-now, .nb-msg-box, .nb-share { padding-left: 14px; padding-right: 14px; }
  .nb-premise { margin-left: 14px; margin-right: 14px; }
  .nb-chips span { padding: 0 12px; font-size: 14px; }
  .nb-now-badge { font-size: 26px; }
  .nb-now-value { font-size: 20px; }
  .nb-ms { position: static; display: block; margin-top: 8px; }
  .nb-bar { grid-template-columns: auto 1fr auto; font-size: 12px; white-space: nowrap; }
  .nb-bar em { min-width: 0; }
  /* 表は1行を1枚のカードに */
  .nb-table thead { display: none; }
  .nb-table, .nb-table tbody, .nb-table tr, .nb-table th, .nb-table td { display: block; }
  .nb-table caption { display: block; width: 100%; }
  .s-none .nb-val { display: none; }
  .nb-table tr { padding: 10px 0 10px 12px; border-bottom: 1px solid var(--n-line); border-left: 4px solid var(--n-diff); margin-bottom: 8px; }
  .nb-table tr.s-none { border-left-color: var(--n-none); }
  .nb-table tr.s-check { border-left-color: #9ca3af; }
  .nb-table tbody th, .nb-table td { padding: 2px 0; border: 0; }
  .nb-table tbody th { border-left: 0; padding-left: 0; }
  .nb-val { min-width: 0; }
  .nb-share-grid { grid-template-columns: 1fr; }
  .nb-next { grid-template-columns: 1fr; }
  .nb-next a + a { border-left: 0; border-top: 1px solid var(--n-line); }
}
@media (prefers-reduced-motion: reduce) {
  .nb-chips span, .nb-btn, .nb-bar b, .nb-q { transition: none; }
}
