:root { --negative-value: #a72a30; color-scheme: light; font-family: "Instrument Sans", "Hiragino Sans", Meiryo, system-ui, sans-serif; color: #17263a; background: #f5f8fc; }
* { box-sizing: border-box; }
body { margin: 0; }
.wrap { width: min(1140px, calc(100% - 36px)); margin-inline: auto; }
.mast { background: #fff; border-bottom: 1px solid #dbe3ef; }
.mast .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-block: 17px; }
.mark { display: block; width: 52px; height: 52px; object-fit: contain; flex-shrink: 0; }
.copyright { text-align: right; color: #4b6078; font-size: 12px; padding-bottom: 16px; }
small { display: block; color: #4b6078; margin-top: 2px; }
.brand-text { flex: 1 1 210px; min-width: 0; }
.brand-subtitle { color: #4b6078; font-size: smaller; margin-top: 2px; }
.brand-subtitle h1 { display: inline; font: inherit; }
.mast .language-choice { margin: 0 0 0 auto; white-space: nowrap; }
.usage-link { color: #1456a0; font-size: 13px; padding: 6px 10px; border: 1px solid #9faec2; border-radius: 6px; }
.usage-notice { border: 1px solid #9faec2; scroll-margin-top: 20px; }
.usage-notice h3 { margin-top: 0; }
.usage-notice h4 { font-size: 14px; margin: 20px 0 6px; }
.usage-notice p { font-size: 13px; line-height: 1.8; margin: 6px 0; }
#usage-consent { width: min(640px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 20px; border: 1px solid #9faec2; border-radius: 14px; color: inherit; }
#usage-consent[open] { display: flex; flex-direction: column; gap: 14px; }
#usage-consent::backdrop { background: rgb(23 38 58 / 55%); }
html:has(#usage-consent[open]) { overflow: hidden; }
#usage-consent-heading { margin: 0; }
#usage-consent-body { min-height: 0; overflow: auto; overscroll-behavior: contain; border: 0; padding: 0 6px; }
#usage-consent-body h4:first-child { margin-top: 0; }
#accept-usage-consent { flex-shrink: 0; align-self: center; }
main { padding-block: 30px 55px; }
h1 { font-size: clamp(26px, 4vw, 38px); margin: 0; }
.intro, .note { color: #4b6078; line-height: 1.7; }
section { background: white; border: 1px solid #dbe3ef; border-radius: 14px; margin-top: 18px; padding: clamp(16px, 3vw, 28px); }
h2 { font-size: 20px; margin-top: 0; }
h3 { font-size: 16px; margin-top: 24px; }
.note { font-size: 13px; }
.grid, .cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 185px), 1fr)); }
.cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 185px), 1fr)); }
.retention-choice { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: end; gap: 8px 14px; }
.retention-choice label { width: min(100%, 240px); }
.retention-choice .note { margin: 0; padding-block: 8px; }
.stacked-fields { display: grid; gap: 14px; width: min(100%, 240px); }
#audience { margin-bottom: 18px; }
#preregistration-users { padding: 9px; border-radius: 6px; background: #eff5fc; }
label { display: grid; align-content: start; gap: 6px; font-size: 13px; font-weight: 600; }
input, select { width: 100%; min-width: 77px; padding: 9px; border: 1px solid #9faec2; border-radius: 6px; color: inherit; background: white; font: inherit; }
:focus-visible { outline: 3px solid #4589d1; outline-offset: 2px; }
[aria-invalid=true] { border-color: #a72a30; }
.field-error, #error { color: #9a2027; font-size: 13px; }
.field-error:empty { display: none; }
button { background: #1456a0; color: #fff; padding: 12px 20px; border: 0; border-radius: 8px; font: inherit; font-weight: 700; cursor: pointer; }
.actions { margin-block: 20px; }
.form-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
button.secondary { background: #fff; color: #1456a0; border: 1px solid #9faec2; }
.views { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.views button { background: #fff; color: #1456a0; border: 1px solid #9faec2; }
.views button[aria-pressed=true] { background: #1456a0; color: #fff; border-color: #1456a0; }
.scroll { overflow-x: auto; }
.monthly-inputs .field-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.monthly-inputs th:first-child { position: sticky; left: 0; z-index: 1; }
.monthly-inputs table { table-layout: fixed; min-width: 2024px; }
.monthly-inputs th:first-child { width: 174px; }
#monthly-plan thead th:last-child { width: 186px; }
#monthly-plan th:last-child, #monthly-plan td:last-child {
  padding-inline: 8px;
  white-space: nowrap;
  overflow-wrap: normal;
}
.monthly-inputs th, .monthly-inputs td { padding-inline: 2px; }
.monthly-inputs thead th:nth-child(n + 2) { text-align: center; }
.monthly-inputs input { min-width: 0; padding-inline: 3px; text-align: right; }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { text-align: right; white-space: nowrap; padding: 9px 10px; border-bottom: 1px solid #e2e9f2; }
th { background: #eff5fc; }
th:first-child, td:first-child { text-align: left; }
td label { text-align: left; }
.card { background: #eff5fc; padding: 12px; border-radius: 8px; }
.negative-value { color: var(--negative-value); }
.card strong { display: block; margin-top: 6px; font-size: 1.14rem; }
.pattern-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 180px)); gap: 14px; margin-bottom: 14px; }
.pattern-fixed { display: grid; align-content: start; gap: 6px; font-size: 13px; font-weight: 600; }
.pattern-fixed strong { padding-block: 9px; }
#detail-columns { margin: 12px 0 18px; border: 1px solid #dbe3ef; border-radius: 8px; padding: 12px; }
.column-options { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.column-options label { display: flex; align-items: center; gap: 6px; }
.column-options input { width: 16px; min-width: 16px; height: 16px; padding: 0; margin: 0; }
.summary-group { padding: 14px; }
.summary-group h3, .retention-summary h4 { margin: 0 0 10px; }
.summary-group .cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 172px), 1fr)); }
.retention-summary { margin-top: 14px; }
.retention-summary dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 66px), 1fr)); gap: 8px; margin: 0; }
.retention-summary dt { color: #4b6078; font-size: 13px; }
.retention-summary dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
canvas { width: 100%; height: auto; display: block; }
.scenario { width: max-content; margin-top: 15px; }
[hidden] { display: none !important; }

.card .roi-definition { font-size: 11px; line-height: 1.6; margin-top: 8px; }

#other-settings { width: 100%; }
#other-settings > label { max-width: 240px; }
.payment-choice { display: flex; align-items: flex-end; gap: 20px; }
.payment-choice > label { width: 340px; max-width: 100%; flex-shrink: 0; }
.payment-choice > .note { margin: 0 0 10px; }
@media (max-width: 700px) {
  .payment-choice { flex-wrap: wrap; gap: 8px; }
}

/* Keep mobile notice typography independent of the previously displayed table. */
:root { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (max-width: 700px) {
  .usage-notice { min-width: 0; overflow-wrap: anywhere; }
  .usage-notice p { font-size: 16px; line-height: 1.8; }
  .usage-notice h3 { font-size: 18px; }
  .usage-notice h4 { font-size: 16px; }
}

.retention-guide { grid-column: 1 / -1; min-width: 0; }
.retention-guide .note { margin: 6px 0 12px; }

.retention-choice label { flex-shrink: 0; }
#attribute-description { flex: 1 1 240px; min-width: 0; }

#calculate-income { background: #c62828; color: #fff; }

.copyright a { display: inline-block; margin-bottom: 6px; color: inherit; }

/* Absolute accessibility labels must stay within the table scroll container. */
.monthly-inputs td label { position: relative; }
@media (max-width: 700px) {
  .grid > *, .cards > *, .scroll, #report, #detail-columns { min-width: 0; max-width: 100%; }
  #other-settings { grid-template-columns: minmax(0, 1fr); }
  #other-settings > * { min-width: 0; max-width: 100%; }
  .payment-choice { width: 100%; min-width: 0; }
  .payment-choice > label { min-width: 0; width: 100%; flex-shrink: 1; }
  .payment-choice select { min-width: 0; max-width: 100%; }
  .form-buttons { flex-wrap: wrap; }
}

#royaltyRate:disabled, #incentiveRate:disabled, #returning-retention input:disabled {
  background: #e5e7eb;
  color: #6b7280;
  border-color: #c5cbd3;
  cursor: not-allowed;
  opacity: 1;
}
#returning-retention-heading { font-size: 13px; font-weight: 600; }
.retention-summary dl + h4 { margin-top: 14px; }
@media (min-width: 1050px) {
  #conditions-summary { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.language-choice { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; }
.language-choice select { width: auto; padding: 5px 8px; }
#usage-consent .language-choice { align-self: flex-start; margin: 0; }
