/* Added to every module page by the build (src/pages/modules.11ty.js):
   the account link in the site bar, the plan tag on the Calculation note
   button, and the plan dialog. Uses the module's own colour tokens. */

.set-vh {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* site bar: Sign in / Account */
.set-acct {
  margin-left: auto; display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px;
  border: 1px solid var(--rule, #ccd6dc); border-radius: 6px; font-size: 13px; line-height: 20px;
  color: var(--ink, #111a20); background: var(--sheet, #fff);
}
.set-acct:hover { border-color: var(--blue, #14456b); text-decoration: none; }

/* plan tag on the Calculation note button: same as the site's Basic badge */
.set-plan-tag {
  display: inline-flex; align-items: center; height: 18px; padding: 0 6px;
  border: 1px solid #8fb0cb; border-radius: 9px; background: #dbe7f1; color: #14456b;
  font-size: 10px; line-height: 1; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}

/* plan dialog */
.set-dialog {
  position: fixed; inset: 0; margin: auto; height: fit-content; max-height: calc(100vh - 32px); overflow: auto;
  width: min(480px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--rule, #ccd6dc); border-radius: 6px;
  color: var(--ink, #111a20); background: var(--sheet, #fff);
  box-shadow: 0 2px 4px rgba(17,26,32,.08), 0 16px 48px rgba(17,26,32,.18);
  font: 15px/22px "Helvetica Neue", Helvetica, Inter, "Segoe UI", system-ui, sans-serif;
}
.set-dialog::backdrop { background: rgba(17,26,32,.45); }
.set-dialog .in { padding: 24px; }
.set-dialog h2 { margin: 12px 0 8px; font-size: 20px; line-height: 28px; font-weight: 600; }
.set-dialog p { margin: 0 0 12px; color: var(--ink2, #3d4a53); }
.set-dialog ul { margin: 0 0 16px; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; line-height: 20px; color: var(--ink2, #3d4a53); }
.set-dialog li { display: flex; gap: 8px; }
.set-dialog li::before { content: "✓"; color: var(--blue, #14456b); font-weight: 700; }
.set-dialog .price { margin: 0 0 16px; font-size: 14px; color: var(--ink3, #59666f); }
.set-dialog .price b { font-size: 18px; color: var(--ink, #111a20); }
.set-dialog .acts { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.set-dialog .go {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: 6px;
  background: var(--blue, #14456b); color: #fff; font-weight: 600; text-decoration: none; border: 0; font: inherit; font-weight: 600; cursor: pointer;
}
.set-dialog .go:hover { background: var(--blue-700, #0b2c47); color: #fff; text-decoration: none; }
.set-dialog .alt { color: var(--blue, #14456b); font-weight: 500; }
.set-dialog .x {
  float: right; width: 36px; height: 36px; margin: -8px -8px 0 0; border: 0; border-radius: 6px;
  background: transparent; color: var(--ink3, #59666f); font-size: 22px; line-height: 1; cursor: pointer;
}
.set-dialog .x:hover { background: #f3f5f6; color: var(--ink, #111a20); }
.set-dialog .small { margin: 12px 0 0; font-size: 13px; line-height: 18px; color: var(--ink3, #59666f); }

/* "your calculation is back" message after sign-up or sign-in */
.set-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
  display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px);
  padding: 12px 12px 12px 16px; border-radius: 6px; background: #1f6b3a; color: #fff;
  font: 15px/22px "Helvetica Neue", Helvetica, Inter, "Segoe UI", system-ui, sans-serif;
  box-shadow: 0 8px 24px rgba(17,26,32,.25);
}
.set-toast button { border: 0; background: transparent; color: #fff; font-size: 20px; width: 32px; height: 32px; cursor: pointer; border-radius: 4px; }
.set-toast button:hover { background: rgba(255,255,255,.15); }
.set-dialog .acts .alt + .alt { margin-left: 4px; }

/* the calculation runs on the server (assets/js/compute.js):
   while an answer takes longer than a moment, the results are dimmed and
   "Calculating…" is shown and announced */
.set-busy #board [id^="cell-out-"], .set-busy #board [id^="cell-fig-"] { opacity: .55; transition: opacity .15s; }
.set-busy-msg:empty { display: none; }
.set-busy-msg {
  position: fixed; right: 16px; bottom: 16px; z-index: 40; padding: 6px 12px; border-radius: 6px;
  background: var(--ink, #111a20); color: #fff; font: 13px/20px "Helvetica Neue", Helvetica, Inter, "Segoe UI", system-ui, sans-serif;
}
/* a message about the server: connection lost, account in use */
.set-alert {
  position: fixed; left: 50%; top: 16px; transform: translateX(-50%); z-index: 60;
  width: min(560px, calc(100vw - 32px)); padding: 14px 16px; border-radius: 6px;
  border: 1px solid #e0b4b4; border-left: 4px solid #a3262a; background: #fff7f7; color: var(--ink, #111a20);
  font: 15px/22px "Helvetica Neue", Helvetica, Inter, "Segoe UI", system-ui, sans-serif;
  box-shadow: 0 8px 24px rgba(17,26,32,.18);
}
.set-alert p { margin: 0 0 10px; }
.set-alert-acts { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.set-alert-acts button {
  min-height: 36px; padding: 0 14px; border: 0; border-radius: 6px; background: var(--blue, #14456b); color: #fff;
  font: inherit; font-weight: 600; cursor: pointer;
}
.set-alert-acts button:hover { background: var(--blue-700, #0b2c47); }
.set-alert-acts a { color: var(--blue, #14456b); font-weight: 500; }
@media print { .set-busy-msg, .set-alert { display: none !important; } }

/* site bar of a module, signed in: "Basir's account" in the colour of the plan */
.set-acct[data-signed-in] { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; line-height: 30px; }
.set-acct.acct-free { border-color: #14456b; color: #14456b; }
.set-acct.acct-basic { background: #dbe7f1; border-color: #8fb0cb; color: #14456b; }
.set-acct.acct-pro { background: #2a6aa0; border-color: #2a6aa0; color: #fff; }
.set-acct.acct-expert { background: #0b2c47; border-color: #0b2c47; color: #fff; }
.set-acct.acct-pro:hover, .set-acct.acct-expert:hover { color: #fff; }

/* "About this check": the page text, folded at the foot of the page
   (scripts/module-text.js). Deliberately quiet: small type, the page's grey a
   shade darker, no white sheet, so it never competes with the calculator. */
.set-about { max-width: 1632px; margin: 24px auto 16px; padding: 0 24px; color: var(--ink3, #59666f); font-size: 12px; line-height: 18px; }
.set-about > summary {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; cursor: pointer; list-style: none;
  padding: 8px 12px; border-radius: 4px; background: #dfe5e8; color: var(--ink3, #59666f);
}
.set-about > summary::-webkit-details-marker { display: none; }
.set-about > summary::before { content: "▸"; font-size: 10px; color: var(--ink4, #8a99a3); }
.set-about[open] > summary::before { content: "▾"; }
.set-about > summary:hover { color: var(--ink2, #3d4a53); }
.set-about > summary:focus-visible { outline: 2px solid var(--blue, #14456b); outline-offset: 2px; }
.set-about h2 { display: inline; font-size: 12px; line-height: 18px; font-weight: 600; margin: 0; }
.set-about .set-sum-hint { font-size: 12px; font-weight: 400; }
.set-about-in { background: #dfe5e8; border-radius: 0 0 4px 4px; margin-top: -4px; padding: 8px 12px 12px 26px; }
.set-about h3 { font-size: 12px; line-height: 18px; font-weight: 600; color: var(--ink2, #3d4a53); margin: 14px 0 4px; }
.set-about h4 { font-size: 12px; line-height: 18px; font-weight: 600; margin: 10px 0 2px; }
.set-about p, .set-about ul { margin: 0 0 8px; max-width: 110ch; }
.set-about ul { padding-left: 16px; }
.set-about li { margin: 0 0 3px; }
.set-about b, .set-about strong { font-weight: 600; }
.set-about a { color: var(--ink2, #3d4a53); text-decoration: underline; }
.set-about .set-lead { font-size: 12px; color: var(--ink2, #3d4a53); }
.set-about .set-dates { margin: 12px 0 0; }
.set-ex-wrap { overflow-x: auto; margin: 0 0 8px; }
.set-ex { width: 100%; max-width: 900px; border-collapse: collapse; margin: 0 0 10px; font-size: 12px; line-height: 16px; }
.set-ex caption { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; padding: 0 0 4px; }
.set-ex th, .set-ex td { text-align: left; vertical-align: top; padding: 3px 6px; border-top: 1px solid #ccd6dc; font-weight: 400; }
.set-ex thead th { border-top: 0; font-size: 11px; }
.set-ex tbody th { width: 52%; }
.set-ex td.r { white-space: nowrap; }
.set-ex .f { display: block; font-size: 11px; }
.set-ex td { font-variant-numeric: tabular-nums; }
.set-ex tr.chk th, .set-ex tr.chk td { font-weight: 600; }
@media (max-width: 640px) {
  .set-about { padding: 0 16px; }
  .set-ex tbody th { width: auto; }
}

/* the page text is not part of the printed calculation note */
@media print { .set-about { display: none !important; } }
