/* Reusable components. */

.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }

/* Buttons -------------------------------------------------------------------- */

.button {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--control); padding: 0.5rem 1.05rem;
  border: 1px solid transparent; border-radius: var(--r-sm);
  font: 600 var(--fs-base)/1.25 var(--font-sans); letter-spacing: -0.005em; text-decoration: none; cursor: pointer; text-align: center;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
    box-shadow var(--t) var(--ease), transform var(--t-fast) var(--ease), color var(--t-fast);
}
.button:active { transform: translateY(1px); }
.button .icon { width: 1.1rem; height: 1.1rem; }
.button-primary {
  background: var(--accent-600); color: #fff; border-color: var(--accent-700);
}
.button-primary:hover { background: var(--accent-800); color: #fff; }
.button-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--e1); }
.button-secondary:hover { background: var(--surface-2); border-color: var(--border-control); color: var(--text); }
.button-quiet { background: transparent; color: var(--text-2); }
.button-quiet:hover { background: var(--surface-3); color: var(--text); }
.button-danger { background: var(--surface); color: var(--bad); border-color: var(--bad-line); }
.button-danger:hover { background: var(--bad); border-color: var(--bad); color: #fff; }
.button-light { background: #fff; color: var(--navy-900); }
.button-light:hover { background: var(--accent-100); color: var(--navy-900); }
.button-sm { min-height: var(--control-sm); padding: 0.3rem 0.75rem; font-size: var(--fs-sm); }
.button-lg { min-height: 3.1rem; padding: 0.7rem 1.35rem; font-size: var(--fs-md); }
.button-block { width: 100%; }
.button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Loading state, added while a form is being submitted. */
.button.is-loading { color: transparent !important; pointer-events: none; }
.button.is-loading > * { visibility: hidden; }
.button.is-loading::after {
  content: ''; position: absolute; width: 1.05rem; height: 1.05rem; border-radius: 50%;
  border: 2px solid rgb(255 255 255 / 0.45); border-top-color: #fff; animation: spin 0.7s linear infinite;
}
.button-secondary.is-loading::after, .button-quiet.is-loading::after, .button-light.is-loading::after, .button-danger.is-loading::after {
  border-color: var(--border-strong); border-top-color: var(--accent-600);
}
@keyframes spin { to { transform: rotate(360deg); } }

.link-button {
  display: inline-flex; align-items: center; gap: var(--s2); background: none; border: 0; padding: 0.35rem 0; min-height: 2rem;
  font: 600 var(--fs-sm) var(--font-sans); color: var(--accent-700); cursor: pointer;
}
.link-button:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.inline-form { display: inline-flex; margin: 0; }
.button-row, .add-row { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }

.icon-button {
  display: inline-grid; place-items: center; width: var(--control); height: var(--control); flex: none;
  background: transparent; border: 1px solid transparent; border-radius: var(--r-sm); color: var(--text-2); cursor: pointer; text-decoration: none;
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.icon-button:hover { background: var(--surface-3); color: var(--text); }
.icon-button .icon { width: 1.2rem; height: 1.2rem; }
.icon-button-bordered { border-color: var(--border); background: var(--surface); }

.arrow-link { display: inline-flex; align-items: center; gap: var(--s1); font-weight: 600; font-size: var(--fs-sm); text-decoration: none; min-height: 1.75rem; }
.arrow-link .icon { transition: transform var(--t) var(--ease); }
.arrow-link:hover .icon { transform: translateX(3px); }

/* Tooltips ------------------------------------------------------------------- */

[data-tip] { position: relative; }
[data-tip]::before {
  content: attr(data-tip); position: absolute; z-index: 60; bottom: calc(100% + 6px); left: 50%; transform: translate(-50%, 4px);
  background: var(--navy-900); color: #fff; font: 500 var(--fs-xs)/1.3 var(--font-sans); padding: 0.35rem 0.55rem; border-radius: var(--r-xs);
  white-space: nowrap; pointer-events: none; opacity: 0; visibility: hidden; box-shadow: var(--e2);
  transition: opacity var(--t-fast), transform var(--t-fast), visibility var(--t-fast);
}
[data-tip]:hover::before, [data-tip]:focus-visible::before { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 250ms; }

/* Forms ---------------------------------------------------------------------- */

label, legend { font-weight: 600; font-size: var(--fs-sm); color: var(--text); }
.field { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.hint { font-size: var(--fs-sm); color: var(--text-3); margin: 0; font-weight: 400; line-height: 1.5; }

input[type='text'], input[type='email'], input[type='password'], input[type='search'], input[type='url'], input[type='date'], input[type='time'], input[type='file'], input:not([type]), select, textarea {
  width: 100%; min-height: var(--control); padding: 0.55rem 0.8rem;
  font: 400 var(--fs-md)/1.4 var(--font-sans); color: var(--text);
  background: var(--surface); border: 1px solid var(--border-control); border-radius: var(--r-sm);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
select {
  appearance: none; padding-right: 2.3rem; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat;
}
textarea { resize: vertical; line-height: 1.6; }
textarea[name='body_md'] { font-family: var(--font-mono); font-size: 0.875rem; }
input[type='file'] { padding: 0.5rem; border-style: dashed; background: var(--surface-2); font-size: var(--fs-sm); }
input::file-selector-button {
  font: 600 var(--fs-sm) var(--font-sans); margin-right: var(--s3); padding: 0.35rem 0.75rem;
  border: 1px solid var(--border-strong); border-radius: var(--r-xs); background: var(--surface); color: var(--text); cursor: pointer;
}
input:hover, select:hover, textarea:hover { border-color: var(--text-2); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--accent-600); box-shadow: 0 0 0 3px rgb(15 114 89 / 0.22); }
input::placeholder { color: var(--text-3); opacity: 1; }
[aria-invalid='true'], [aria-invalid='true']:hover { border-color: var(--bad) !important; }
.field-error { display: flex; gap: var(--s2); align-items: flex-start; margin: 0; font-size: var(--fs-sm); font-weight: 500; color: var(--bad); }
.field-error:empty { display: none; }
.field-error .icon { margin-top: 0.15rem; }

.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > .icon { position: absolute; left: 0.85rem; width: 1.1rem; height: 1.1rem; color: var(--text-3); pointer-events: none; }
.input-wrap > .icon ~ input { padding-left: 2.65rem; }
.input-wrap > .icon-button { position: absolute; right: 2px; width: 2.5rem; height: 2.5rem; }
.input-wrap > .icon-button:not([hidden]) ~ input, .input-wrap input:has(~ .icon-button) { padding-right: 3rem; }
.input-wrap:focus-within > .icon { color: var(--accent-600); }

.stack { display: flex; flex-direction: column; gap: var(--s5); align-items: stretch; }
.stack > .button, .stack > .button-row { align-self: flex-start; }
.stack > .button-block { align-self: stretch; }
.stack > .notice { margin-bottom: 0; }
.check { display: flex; gap: var(--s3); align-items: flex-start; font-weight: 400; font-size: var(--fs-base); cursor: pointer; padding: var(--s1) 0; }
.check input { width: 1.15rem; height: 1.15rem; margin: 0.2rem 0 0; accent-color: var(--accent-600); flex: none; }
.check small { display: block; color: var(--text-3); font-size: var(--fs-xs); line-height: 1.45; }
fieldset { border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s4); margin: 0; min-width: 0; display: flex; flex-direction: column; gap: var(--s4); background: var(--surface); }
legend { float: left; width: 100%; padding: 0; font: 700 var(--fs-md) var(--font-display); }
legend + * { clear: left; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: var(--s4); align-items: end; }
.upload-status { font-size: var(--fs-sm); color: var(--good); margin: 0; font-weight: 500; }
.upload-status:empty { display: none; }
.upload-status.is-error { color: var(--bad); }
.upload-status.is-busy { display: flex; align-items: center; gap: var(--s2); color: var(--text-2); }
.upload-status.is-busy::before { content: ''; width: 0.9rem; height: 0.9rem; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent-600); animation: spin 0.7s linear infinite; }

.choices { gap: var(--s1); max-height: 24rem; overflow-y: auto; }
.choice-title { font-size: var(--fs-xs); font-weight: 700; color: var(--text-3); margin: var(--s3) 0 var(--s1); }
.presets { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* Segmented control and tabs ------------------------------------------------- */

.tabs { display: flex; gap: var(--s1); overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: var(--s6); scrollbar-width: thin; }
.tabs a {
  display: inline-flex; align-items: center; gap: var(--s2); white-space: nowrap; min-height: var(--control);
  padding: 0 var(--s3); font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); text-decoration: none;
  border-bottom: 2px solid transparent; transition: color var(--t-fast), border-color var(--t-fast);
}
.tabs a:hover { color: var(--text); border-bottom-color: var(--border-strong); }
.tabs a[aria-current] { color: var(--accent-700); border-bottom-color: var(--accent-600); }
.tabs .count { font-size: var(--fs-xs); font-weight: 600; background: var(--surface-3); color: var(--text-2); border-radius: var(--r-xs); padding: 0 0.4rem; }
.tabs a[aria-current] .count { background: var(--accent-100); color: var(--accent-800); }

.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--r-md); margin: 0; }
.segmented a { display: inline-flex; align-items: center; min-height: var(--control-sm); padding: 0 var(--s3); border-radius: var(--r-sm); font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); text-decoration: none; }
.segmented a:hover { color: var(--text); }
.segmented a[aria-current] { background: var(--surface); color: var(--accent-700); box-shadow: var(--e1); }

/* Surfaces ------------------------------------------------------------------- */

.surface, .panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--e1); min-width: 0; }
.panel { padding: var(--s5) clamp(var(--s4), 2.2vw, var(--s6)); }
.panel > :last-child { margin-bottom: 0; }
.panel h3 { margin-top: var(--s5); }
.panel > h2 { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.surface-pad { padding: var(--s5); }

.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s2) var(--s4); margin-bottom: var(--s4); }
.section-head h2 { display: flex; align-items: center; gap: var(--s3); margin: 0; }

.chip-icon {
  display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; flex: none;
  color: var(--tone-ink, var(--accent-700));
}
.chip-icon .icon { width: 1.15rem; height: 1.15rem; }
.chip-icon-lg { width: 3rem; height: 3rem; border-radius: var(--r-md); }
.chip-icon-lg .icon { width: 1.5rem; height: 1.5rem; }

/* Status --------------------------------------------------------------------- */

.badge {
  display: inline-flex; align-items: center; gap: 0.35rem; font: 600 var(--fs-xs)/1 var(--font-sans);
  padding: 0.35rem 0.5rem; border-radius: 2px; border: 1px solid; vertical-align: middle; white-space: nowrap;
}
.badge::before { content: ''; width: 0.4rem; height: 0.4rem; border-radius: 50%; background: currentColor; }
.badge-neutral { background: var(--surface-3); border-color: var(--border); color: var(--text-2); }
.badge-good { background: var(--good-bg); border-color: var(--good-line); color: var(--good); }
.badge-warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.badge-bad { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }
.badge-info { background: var(--info-bg); border-color: var(--info-line); color: var(--info); }

.notice {
  display: flex; gap: var(--s3); align-items: flex-start; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); padding: var(--s3) var(--s4); margin-bottom: var(--s5); font-size: var(--fs-base);
}
p.notice { display: block; }
p.notice:has(> .icon) { display: flex; }
.notice p, .notice ul { margin: 0; }
.notice ul { padding-left: 1.1rem; }
.notice > .icon { width: 1.2rem; height: 1.2rem; margin-top: 0.15rem; }
.notice-success { background: var(--good-bg); border-color: var(--good-line); }
.notice-success > .icon { color: var(--good); }
.notice-error { background: var(--bad-bg); border-color: var(--bad-line); }
.notice-error > .icon { color: var(--bad); }
.notice-error:focus-visible { outline-color: var(--bad); }
.notice-warn { background: var(--warn-bg); border-color: var(--warn-line); }
.notice-warn > .icon { color: var(--warn); }

/* Success messages appear as a toast. Without JavaScript they stay until the next page. */
.toast {
  position: fixed; z-index: 70; right: var(--s5); bottom: var(--s5); width: min(26rem, calc(100vw - 2rem)); margin: 0;
  align-items: center; background: var(--navy-900); border-color: var(--navy-700); color: var(--on-dark); box-shadow: var(--e3);
  animation: toast-in 320ms var(--ease) both;
}
.toast.notice-success > .icon { color: var(--teal-300); margin: 0; }
.toast p { flex: 1; }
.toast .icon-button { color: var(--on-dark-2); width: 2.25rem; height: 2.25rem; margin: -0.35rem -0.5rem -0.35rem 0; }
.toast .icon-button:hover { background: var(--navy-700); color: #fff; }
.toast :focus-visible { outline-color: var(--teal-300); }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: opacity var(--t), transform var(--t); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

/* Menus ---------------------------------------------------------------------- */

.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu[open] > summary.icon-button { background: var(--surface-3); color: var(--text); }
.menu-panel {
  position: absolute; z-index: 50; right: 0; top: calc(100% + 6px); min-width: 14rem; max-width: min(20rem, 85vw);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--e3); padding: var(--s2);
  animation: menu-in 160ms var(--ease);
}
.menu-panel a, .menu-panel button {
  display: flex; width: 100%; align-items: center; gap: var(--s3); min-height: 2.5rem; padding: 0 var(--s3);
  border: 0; background: none; border-radius: var(--r-sm); font: 500 var(--fs-sm) var(--font-sans); color: var(--text); text-decoration: none; cursor: pointer; text-align: left;
}
.menu-panel a:hover, .menu-panel button:hover { background: var(--surface-3); color: var(--text); }
.menu-panel form { margin: 0; }
.menu-head { padding: var(--s2) var(--s3) var(--s3); border-bottom: 1px solid var(--border); margin-bottom: var(--s2); overflow-wrap: anywhere; }
.menu-head strong { display: block; font-size: var(--fs-sm); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }

/* Dialog --------------------------------------------------------------------- */

.dialog { width: min(27rem, calc(100vw - 2rem)); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 0; box-shadow: var(--e3); color: var(--text); background: var(--surface); }
.dialog::backdrop { background: rgb(10 16 32 / 0.55); }
.dialog[open] { animation: menu-in 200ms var(--ease); }
.dialog-body { padding: var(--s6); display: flex; gap: var(--s4); align-items: flex-start; }
.dialog-body h2 { margin-bottom: var(--s1); }
.dialog-body p { margin: 0; color: var(--text-2); }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s3); padding: var(--s4) var(--s6); background: var(--surface-2); border-top: 1px solid var(--border); }

/* People and progress -------------------------------------------------------- */

.avatar {
  display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; flex: none; border-radius: var(--r-sm);
  background: var(--accent-700); color: #fff; font: 700 var(--fs-sm)/1 var(--font-display); letter-spacing: 0;
}
.avatar-lg { width: 4rem; height: 4rem; border-radius: var(--r-lg); font-size: var(--fs-xl); }

.progress { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.progress progress, .meter { -webkit-appearance: none; appearance: none; width: 100%; height: 0.45rem; border: 0; border-radius: 3px; overflow: hidden; background: var(--surface-3); display: block; }
.progress progress::-webkit-progress-bar, .meter::-webkit-progress-bar { background: var(--surface-3); }
.progress progress::-webkit-progress-value, .meter::-webkit-progress-value { background: var(--tone, var(--teal-600)); border-radius: 3px; }
.progress progress::-moz-progress-bar, .meter::-moz-progress-bar { background: var(--tone, var(--teal-600)); }
.progress-label { font-size: var(--fs-xs); font-weight: 500; color: var(--text-3); }

.ring { position: relative; display: inline-grid; place-items: center; width: 7.5rem; height: 7.5rem; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--surface-3); stroke-width: 9; }
.ring-value { fill: none; stroke: var(--tone, var(--teal-600)); stroke-width: 9; stroke-linecap: round; animation: ring-in 800ms var(--ease) both; }
.ring-text { position: absolute; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.ring-text strong { font: 800 1.6rem var(--font-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.ring-text span { font-size: var(--fs-xs); color: var(--text-3); font-weight: 500; }
.ring-sm { width: 4.75rem; height: 4.75rem; }
.ring-sm .ring-text strong { font-size: var(--fs-lg); }
@keyframes ring-in { from { stroke-dashoffset: 100; } }

/* Topic mark: a periodic-table tile. ----------------------------------------- */

.element {
  position: relative; display: grid; place-items: center; width: 3.25rem; height: 3.25rem; flex: none;
  background: var(--surface); border: 1.5px solid var(--tone-line); border-radius: var(--r-md); color: var(--tone-ink); box-shadow: var(--e1);
}
.element-number { position: absolute; top: 0.25rem; left: 0.35rem; font: 600 0.625rem/1 var(--font-sans); opacity: 0.85; font-variant-numeric: tabular-nums; }
.element-symbol { font: 800 1.15rem/1 var(--font-display); letter-spacing: -0.02em; margin-top: 0.4rem; }
.element-large { width: 6.5rem; height: 6.5rem; border-radius: var(--r-lg); }
.element-large .element-number { font-size: var(--fs-sm); top: 0.55rem; left: 0.65rem; }
.element-large .element-symbol { font-size: 2.35rem; }

/* Empty states --------------------------------------------------------------- */

.empty {
  display: flex; align-items: center; gap: var(--s3); margin: 0 0 var(--s4); padding: var(--s5);
  border: 1px dashed var(--border-strong); border-radius: var(--r-md); background: var(--surface-2); color: var(--text-2); font-size: var(--fs-base);
}
.empty .icon { width: 1.35rem; height: 1.35rem; color: var(--text-3); }

.empty-state { display: grid; justify-items: center; text-align: center; padding: clamp(var(--s6), 5vw, var(--s8)) var(--s5); }
.empty-state .art-scene { width: min(21rem, 100%); height: auto; margin-bottom: var(--s5); }
.empty-state h2 { font-size: var(--fs-2xl); margin-bottom: var(--s3); }
.empty-state > p { max-width: 34rem; color: var(--text-2); margin-bottom: var(--s5); }
.empty-state .button-row { justify-content: center; }
.empty-state .contact { align-items: center; text-align: center; }
.empty-state .contact-address { align-self: stretch; }
.empty-state .contact-address code { text-align: left; }
.empty-state-compact { padding: var(--s7) var(--s5); }
.empty-state-compact h2 { font-size: var(--fs-lg); }
.empty-state-compact .art-scene { width: 12rem; margin-bottom: var(--s4); }

/* Administrator contact ------------------------------------------------------ */

.contact { display: flex; flex-direction: column; gap: var(--s3); text-align: left; min-width: 0; }
.contact > :last-child { margin-bottom: 0; }
.contact p { margin: 0; color: var(--text-2); }
.contact-head { display: flex; gap: var(--s3); align-items: center; }
.contact-head h2 { margin: 0; }
.contact-address {
  display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s2) var(--s2) var(--s3);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); min-width: 0;
}
.contact-address code { flex: 1; min-width: 0; user-select: all; font: 600 var(--fs-base)/1.4 var(--font-sans); color: var(--text); overflow-wrap: anywhere; }
.contact-address > .icon { color: var(--teal-700); }
.contact-details { white-space: pre-line; overflow-wrap: anywhere; }
.contact-card { padding: var(--s5); }
.contact-wide { width: 100%; max-width: 30rem; }
.support-line { font-size: var(--fs-sm); color: var(--text-2); margin: 0; overflow-wrap: anywhere; }
.support-line a { font-weight: 600; }

/* Question and answer list --------------------------------------------------- */

.faq { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--e1); overflow: hidden; }
.faq details + details { border-top: 1px solid var(--border); }
.faq summary { display: flex; align-items: center; gap: var(--s3); min-height: 3.5rem; padding: var(--s3) var(--s5); cursor: pointer; font: 600 var(--fs-base)/1.4 var(--font-display); list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { background: var(--surface-2); }
.faq summary > .icon:last-child { margin-left: auto; color: var(--text-3); transition: transform var(--t) var(--ease); }
.faq details[open] summary > .icon:last-child { transform: rotate(180deg); }
.faq summary:focus-visible { outline-offset: -3px; }
.faq-body { padding: 0 var(--s5) var(--s5) calc(var(--s5) + 2.25rem + var(--s3)); color: var(--text-2); }
.faq-body > :last-child { margin-bottom: 0; }

/* Skeleton shimmer for content that is still arriving. */
.skeleton { background: linear-gradient(100deg, var(--surface-3) 30%, var(--surface-2) 50%, var(--surface-3) 70%) 0 0 / 220% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -220% 0; } }

/* Definition rows ------------------------------------------------------------ */

.facts { margin: 0 0 var(--s4); }
.facts > div { display: grid; grid-template-columns: minmax(7rem, 11rem) minmax(0, 1fr); gap: var(--s4); padding: var(--s3) 0; border-bottom: 1px solid var(--border); }
.facts > div:last-child { border-bottom: 0; }
.facts dt { font-size: var(--fs-sm); color: var(--text-3); font-weight: 500; }
.facts dd { margin: 0; overflow-wrap: anywhere; font-weight: 500; }

/* Tables --------------------------------------------------------------------- */

.table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--e1); overflow: clip; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
.table th { text-align: left; font-size: var(--fs-xs); font-weight: 600; color: var(--text-3); background: var(--surface-2); border-bottom: 1px solid var(--border); padding: var(--s3) var(--s4); }
.table td { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); vertical-align: middle; overflow-wrap: anywhere; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color var(--t-fast); }
.table tbody tr:hover { background: var(--surface-2); }
.table td .meta { display: block; }
.table .cell-actions { text-align: right; width: 1%; }
.panel .table { margin: 0 calc(var(--s2) * -1); width: calc(100% + var(--s4)); }
.panel .table th, .panel .table td { padding-left: var(--s2); padding-right: var(--s2); }

.person { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.person > div { min-width: 0; }

.row-title { font-weight: 600; color: var(--text); text-decoration: none; overflow-wrap: anywhere; line-height: 1.4; }
a.row-title:hover { color: var(--accent-700); text-decoration: underline; }

@media (max-width: 52rem) {
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: var(--s3) 0; border-bottom: 1px solid var(--border); }
  .table tbody tr:last-child { border-bottom: 0; }
  .table td { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: var(--s3); border: 0; padding: var(--s1) var(--s4); text-align: left; }
  .table td::before { content: attr(data-label); font-size: var(--fs-xs); font-weight: 600; color: var(--text-3); padding-top: 0.15rem; }
  .table td > * { grid-column: 2; justify-self: start; }
  .table .cell-actions { width: 100%; text-align: left; }
  /* Anchored to the row rather than the button, so the menu stays on screen. */
  .table .cell-actions { position: relative; }
  .table .cell-actions .menu { position: static; }
  .table .cell-actions .menu-panel { right: var(--s4); }
  .toast { left: var(--s4); right: var(--s4); width: auto; bottom: calc(var(--s4) + env(safe-area-inset-bottom)); }
  .has-tab-bar .toast { bottom: calc(var(--tabbar) + var(--s3) + env(safe-area-inset-bottom)); }
}

@media (max-width: 36rem) {
  .table .avatar { display: none; }
  .facts > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .faq-body { padding-left: var(--s5); }
}
