:root {
  color-scheme: light;
  --ink: #192c40;
  --subtle: #516478;
  --line: #d6dee6;
  --blue: #225da4;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font: 100%/1.5 "Inter", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: #f3f6f9;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button:focus-visible, input:focus-visible, select:focus-visible, .modes input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }
.wrap { width: min(77rem, calc(100% - 6rem)); margin-inline: auto; }
.masthead { background: #fff; border-bottom: 1px solid var(--line); }
.mast-inner, .brand, .page-heading, .card-heading, .section-heading, .quiet-button, .dipole-label, .dialog-heading { display: flex; align-items: center; }
.mast-inner { min-height: 4.5rem; justify-content: space-between; gap: 1rem; }
.brand { gap: .75rem; }
.brand strong { font-size: 1.45rem; letter-spacing: -.07em; line-height: 1; }
.brand-mark { position: relative; display: inline-block; width: 2.1rem; height: 2.1rem; background: #1c4d7f; border-radius: .5rem; overflow: hidden; }
.brand-mark i { position: absolute; width: 1.6rem; height: 1.6rem; border: 1.6px solid #fff; border-radius: 45%; right: -.25rem; top: -.16rem; transform: rotate(-32deg); }
.brand-mark i:nth-child(2) { right: .05rem; top: .18rem; }
.brand-mark i:nth-child(3) { right: .35rem; top: .52rem; }
.brand-divider { height: 1.2rem; width: 1px; margin-inline: .1rem; background: #c7d1dc; }
.brand-caption { font-size: .9375rem; color: var(--subtle); }
.quiet-button { justify-content: center; gap: .44rem; padding: .36rem .5rem; border: 1px solid transparent; border-radius: .35rem; background: transparent; color: #445d78; font-weight: 550; font-size: .875rem; line-height: 1.45; }
.quiet-button:hover:enabled { background: #eff4f9; color: #123e6e; }
.book-icon { width: .98rem; height: .85rem; position: relative; border: 1.4px solid currentColor; border-radius: .14rem; }
.book-icon::before, .book-icon::after { content: ""; position: absolute; background: currentColor; }
.book-icon::before { left: 38%; width: 1px; top: 0; bottom: 0; }
.book-icon::after { left: 0; right: 0; height: 1px; top: 32%; }
.page-heading { gap: 1.5rem; justify-content: space-between; margin: 2.55rem 0 1.6rem; }
.sheet-title { font-size: .8125rem; font-weight: 600; letter-spacing: .12em; color: #476d95; margin: 0 0 .3rem; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2.1rem, 3.5vw, 3.05rem); letter-spacing: -.055em; line-height: 1.14; font-weight: 650; }
h2 { font-size: 1.25rem; font-weight: 650; letter-spacing: -.035em; }
h3 { font-size: .985rem; font-weight: 650; letter-spacing: -.012em; }
.modes { margin: 0; padding: .24rem; display: inline-flex; gap: .15rem; align-self: flex-end; border: 1px solid #c9d5e0; border-radius: .55rem; background: #e8eef4; }
.modes label { position: relative; cursor: pointer; }
.modes input, .sr-only { position: absolute; overflow: hidden; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; white-space: nowrap; clip-path: inset(50%); }
.modes span { display: block; text-align: center; min-width: 4.55rem; padding: .41rem .92rem; color: var(--subtle); font-size: .9rem; font-weight: 600; border-radius: .32rem; }
.modes input:checked + span { color: #174b83; background: #fff; box-shadow: 0 1px 4px #18355427; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; margin-bottom: 3rem; }
.card { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: .8rem; box-shadow: 0 3px 12px #1a384907; overflow: hidden; }
.inputs-card { container: inputs / inline-size; }
.card-heading, .dialog-heading { justify-content: space-between; gap: .7rem; padding: 1.04rem 1.45rem; border-bottom: 1px solid var(--line); }
.saved-settings { grid-column: 1; }
.saved-body { padding: .8rem 1.45rem; }
.card-action { min-width: 4.5rem; color: #fff; background: #205789; border: 0; border-radius: .35rem; padding: .4rem .75rem; font-size: .875rem; font-weight: 600; }
.card-action:hover:enabled { background: #16456f; }
.settings-list { margin: 0; padding: 0; list-style: none; }
.settings-list li:first-child { border-top: 0; }
.settings-list li { display: flex; align-items: center; gap: .4rem; border-top: 1px solid var(--line); }
.setting-summary { display: flex; align-items: baseline; justify-content: space-between; gap: .35rem .65rem; flex-wrap: wrap; flex: 1; padding: .55rem .3rem; text-align: left; border: 0; border-radius: .2rem; background: transparent; color: var(--ink); font: .875rem/1.45 var(--mono); }
button.setting-summary:hover { background: #eaf1f7; }
.settings-status { color: var(--subtle); font-size: .875rem; }
#form-error, #export-error { margin: 0 1.45rem 1rem; }
.formula { display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; padding: .85rem 0 .95rem; color: #556a7e; font: 500 clamp(1.25rem, 2vw, 1.8rem)/1.4 var(--mono); }
.formula button { font: inherit; color: #1c466c; background: transparent; border: 0; border-bottom: 2px solid transparent; padding: .1rem .22rem; }
.formula button:hover { color: #0871ac; }
.formula sup { font-size: .64em; line-height: 0; }
.formula > sup { align-self: flex-start; margin-top: .65em; }
.formula button[aria-pressed="true"] { color: #154e84; border-bottom-color: currentColor; }
.formula[aria-invalid="true"] { box-shadow: inset 0 -2px #cf8074; }
.nuclide-editors { display: grid; gap: .5rem; }
.nuclide-editor { border: 1px solid #d8e2ea; border-radius: .45rem; padding: .65rem .8rem .85rem; background: #f5f8fb; }
.editor-heading { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; margin-bottom: .48rem; }
.editor-heading strong { font-size: .9rem; }
.editor-fields { display: grid; gap: .5rem; align-items: end; }
.editor-tip { margin-top: .5rem; color: var(--subtle); font-size: .8125rem; }
.editor-fields .field > label { font-weight: 550; }
.editor-fields .input-wrap { background: #fff; }
.picker { align-self: stretch; display: grid; place-items: center; border: 0; border-left: 1px solid #dae2eb; background: transparent; color: #295780; padding: 0 .5rem; border-radius: 0 .35rem .35rem 0; }
.picker:hover { background: #e8f0f8; }
#periodic-table { width: min(60rem,calc(100% - 1.5rem)); }
.elements-scroll { overflow-x: auto; padding: 1rem; }
.elements-grid { display: grid; grid-template-columns: repeat(18,minmax(2.35rem,1fr)); gap: .16rem; min-width: 47rem; }
.elements-grid button { padding: .2rem .1rem; background: #edf4fa; color: #1c4265; border: 1px solid #bdcfe0; border-radius: .23rem; font: 600 1rem/1.25 var(--mono); }
.elements-grid button:hover:enabled, .elements-grid button:focus-visible { background: #215987; color: white; }
.elements-grid button[aria-current="true"] { border: 2px solid #225a91; }
.elements-grid button:disabled { background: #f1f2f3; color: #586674; }
.elements-grid small { display: block; font: .72rem/1.15 var(--mono); }
.series { align-self: center; text-align: center; font: .72rem var(--mono); color: var(--subtle); }
.table-note { margin: 0 1rem 1rem; font-size: .875rem; color: var(--subtle); }
.form-section { padding: 1.05rem 0 1.15rem; margin: 0 1.45rem; border-bottom: 1px solid #e2e8ee; }
.form-section:last-of-type { border-bottom: 0; }
.section-heading { justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.reaction { color: #285b8a; font: 550 .9375rem/1.5 var(--mono); }
.reaction sup { font-size: .7em; }
.geometry-grid, .energy-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: .85rem 1rem; margin-top: .8rem; }
@container inputs (max-width: 25.99rem) {
  .editor-fields > .field { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: center; }
}
@container inputs (min-width: 19rem) {
  .geometry-grid, .energy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container inputs (min-width: 26rem) {
  .editor-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr); gap: .65rem; }
}
@container inputs (min-width: 30rem) {
  .energy-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.field { display: flex; flex-direction: column; gap: .31rem; min-width: 0; font-size: .875rem; color: #415368; }
.field > span:first-child { font-weight: 550; }
.field i, .kinematics i { font-family: Georgia, serif; color: #516f8d; margin-left: .15rem; }
.input-wrap { display: flex; align-items: center; border: 1px solid #c7d3de; border-radius: .36rem; background: #fbfcfd; min-width: 0; height: 2.45rem; transition: border-color .15s, box-shadow .15s; }
.input-wrap:focus-within { border-color: #5a86b7; box-shadow: 0 0 0 2px #477eba20; }
.input-wrap:has([aria-invalid="true"]) { border-color: #be5343; background: #fff9f7; }
.input-wrap input, .input-wrap select { font-family: var(--mono); font-size: 1rem; font-variant-numeric: tabular-nums; color: var(--ink); min-width: 0; width: 100%; height: 100%; padding: 0 .65rem; background: transparent; border: none; border-radius: inherit; }
.input-wrap :focus-visible { outline-offset: -2px; }
.input-wrap input[type=number] { appearance: textfield; -moz-appearance: textfield; }
.input-wrap input::-webkit-inner-spin-button, .input-wrap input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.unit { font: .8125rem var(--mono); padding: 0 .65rem 0 .2rem; color: #596f84; }
.mass-note { color: #637588; font: .77rem/1.5 var(--mono); min-height: 1.15rem; }
.geometry-note { font-size: .875rem; margin-top: .75rem; color: var(--subtle); }
.input-error { margin-top: .75rem; padding: .65rem .8rem; border-left: 3px solid #bf5747; background: #fff2ee; color: #863b2e; font-size: .9rem; }
#balance-fix { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem .8rem; margin-top: .55rem; }
.dipole { position: relative; isolation: isolate; overflow: hidden; margin: 1.2rem 1.35rem .8rem; border-radius: .55rem; background: linear-gradient(110deg,#152d48,#1b4166); color: #fff; }
.field-lines { pointer-events: none; position: absolute; inset: 0 0 0 30%; z-index: -1; opacity: .65; background: repeating-radial-gradient(ellipse at 109% -85%, transparent 0 15px, #78a2c643 15.5px 16.4px, transparent 17px 26px); mask-image: linear-gradient(90deg,transparent,#000); }
.main-field { padding: 1.05rem 1.15rem 1rem; }
.dipole-label { gap: .7rem; color: #d3e0ed; font-size: .875rem; }
.dipole-label strong { background: #355778; color: #fff; border: 1px solid #64809b; padding: .04rem .42rem; border-radius: .24rem; font: 600 .875rem/1.5 var(--mono); }
.primary-value { display: flex; align-items: baseline; gap: .6rem; margin: .5rem 0 .02rem; }
.primary-value output { font: 500 clamp(2rem,3.5vw,3.35rem)/1.13 var(--mono); letter-spacing: -.065em; }
.primary-value > span { color: #bfdaee; font: 1.35rem var(--mono); }
.gauss { color: #c8daea; font: .875rem/1.5 var(--mono); }
.linked-dipoles { display: flex; flex-wrap: wrap; gap: .35rem .85rem; padding: .54rem 1.15rem; background: #0a21375e; border-top: 1px solid #9cb7d12b; color: #cbdceb; font: .78rem/1.5 var(--mono); }
.linked-dipoles > span:first-child { font: .8rem/1.5 "Inter","Segoe UI",Arial,sans-serif; }
.linked-dipoles b { font-weight: 500; color: #fff; }
.table-wrap { margin: 0 1.35rem; }
table { width: 100%; border-collapse: collapse; text-align: left; font-variant-numeric: tabular-nums; }
thead th { font-size: .8125rem; font-weight: 550; color: #556a7e; background: #f0f4f8; }
th, td { padding: .49rem .7rem; }
td, tbody th { font: .95rem/1.48 var(--mono); border-bottom: 1px solid #e6ebf0; }
tbody th { font-weight: 600; }
td:last-child, thead th:last-child { text-align: right; }
.copy-setting { font: inherit; color: #205789; background: transparent; border: 0; border-radius: .2rem; padding: .12rem 0 .12rem .4rem; user-select: text; }
.copy-setting:enabled { text-decoration: underline dotted; text-underline-offset: .22em; cursor: copy; }
.copy-setting:enabled:hover, .copy-setting:focus-visible { text-decoration-style: solid; }
#copy-status:not(:empty) { margin-top: .35rem; text-align: right; }
.kinematics { display: grid; grid-template-columns: 1fr 1fr; margin: .84rem 1.35rem 1.17rem; padding: .72rem 0 0; }
.kinematics > div { padding: 0 .68rem; }
.kinematics > div + div { border-left: 1px solid var(--line); padding-left: 1.15rem; }
.kinematics span { color: var(--subtle); font-size: .84rem; }
.kinematics p { margin-top: .17rem; font: 500 1rem/1.4 var(--mono); }
.kinematics small { font-size: .78rem; color: var(--subtle); }
dialog { width: min(34rem,calc(100% - 2rem)); max-height: 85dvh; margin: auto; padding: 0; border: 1px solid var(--line); color: var(--ink); border-radius: .75rem; box-shadow: 0 14px 70px #0e20363b; }
dialog::backdrop { background: #142c4873; }
#export-preview { width: min(57rem, calc(100% - 1.25rem)); max-height: 92dvh; }
#export-preview[open] { display: flex; flex-direction: column; }
.preview-body { min-height: 0; overflow: auto; padding: .85rem; background: #e9eff1; }
#preview-image { display: block; width: 100%; max-height: 66dvh; object-fit: contain; }
#preview-image.enlarged { width: 1000px; max-height: none; }
.preview-actions { display: flex; align-items: center; justify-content: flex-end; gap: .75rem; padding: .75rem 1.45rem; border-top: 1px solid var(--line); }
.preview-actions a { text-align: center; text-decoration: none; }
.preview-actions a:hover { background: #16456f; }
.preview-actions a:focus-visible { outline: 3px solid #548bc7; outline-offset: 3px; }
.close-button { width: 2rem; height: 2rem; border: 0; color: var(--subtle); background: #f0f4f8; border-radius: .34rem; font-size: 1.4rem; line-height: 1; }
.reference-body { padding: 1.2rem 1.45rem 1.5rem; }
.reference-body h3 + p, .reference-body p + p { margin-top: .42rem; }
.reference-body p + h3 { margin-top: 1.05rem; }
.reference-body p { line-height: 1.6; color: #43576b; }
@media (min-width: 1500px) { .page-heading { margin-top: 3rem; } }
@media (max-width: 1040px) {
  .wrap { width: calc(100% - 3rem); }
  .workspace { gap: 1rem; }
  .card-heading { padding-inline: 1.1rem; }
  .form-section, .dipole, .table-wrap, .kinematics { margin-inline: 1.1rem; }
}
@media (max-width: 780px) {
  .wrap { width: min(42rem,calc(100% - 2rem)); }
  .workspace { grid-template-columns: minmax(0,1fr); }
  .page-heading { margin: 1.65rem 0 1.15rem; align-items: flex-start; flex-direction: column; gap: .9rem; }
  .modes { align-self: flex-start; }
  .primary-value output { font-size: 2.7rem; }
}
@media (max-width: 480px) {
  .mast-inner { min-height: 3.7rem; }
  .brand { gap: .45rem; }
  .brand-caption, .brand-divider { display: none; }
  .reaction { font-size: .84rem; }
  .primary-value output { font-size: clamp(1.9rem, 10.25vw, 2.7rem); }
  .kinematics { margin-inline: .75rem; }
}
