/* Layout and components. Colours come from themes.css tokens only. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--page-bg);
  background-image: var(--page-bg-image);
  background-attachment: fixed;
}

h1, h2, h3 {
  font-family: var(--font-head);
  line-height: 1.2;
  margin: 0 0 0.5em;
}

a {
  color: var(--accent);
}
a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 16px;
  top: 8px;
  z-index: 100;
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
}

.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.muted {
  color: var(--text-muted);
}
.nowrap {
  white-space: nowrap;
}

/* ---------- nav ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--nav-bg);
  border-bottom: var(--nav-border-bottom);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.nav-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding-top: 8px;
  padding-bottom: 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--nav-text);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
}
.brand:hover {
  color: var(--nav-text-hover);
}
.brand img {
  width: 44px;
  height: 44px;
}
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  flex: 1;
}
.nav-links a {
  color: var(--nav-text);
  text-decoration: none;
  font-weight: 600;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover {
  color: var(--nav-text-hover);
}
.nav-links a[aria-current="page"] {
  border-bottom-color: currentColor;
}

.theme-switch {
  display: inline-flex;
  border: 1px solid color-mix(in srgb, var(--nav-text) 45%, transparent);
  border-radius: var(--pill-radius);
  overflow: hidden;
}
.theme-switch button {
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: transparent;
  color: var(--nav-text);
  border: 0;
  padding: 5px 10px;
  cursor: pointer;
}
.theme-switch button[aria-pressed="true"] {
  background: var(--nav-text);
  color: var(--nav-bg);
}
[data-theme="slop"] .theme-switch button[aria-pressed="true"] {
  background: var(--btn-bg);
  color: #fff;
}
[data-theme="dark"] .theme-switch button[aria-pressed="true"] {
  background: #972324;
  color: #fff5f2;
}

/* ---------- page ---------- */

main {
  flex: 1;
  padding-top: 24px;
  padding-bottom: 48px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-bottom: 20px;
}
.page-head h1 {
  color: var(--page-text);
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  font-weight: 800;
  margin: 0;
}
.page-head p {
  color: var(--page-text-2);
  margin: 4px 0 0;
}

[data-theme="slop"] .page-head h1 {
  background: linear-gradient(90deg, #c4b5fd, #f0abfc 45%, #67e8f9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
[data-theme="slop"] .page-head h1::after {
  content: " ✨";
  -webkit-text-fill-color: initial;
}

.card {
  background: var(--surface);
  color: var(--text);
  border: var(--card-border);
  border-top: var(--card-top);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  -webkit-backdrop-filter: var(--card-blur);
  backdrop-filter: var(--card-blur);
  padding: 20px;
  min-width: 0;
}
.card + .card {
  margin-top: 20px;
}
.card h1,
.card h2 {
  color: var(--heading, var(--text));
}
.card h2 {
  font-size: 1.2rem;
  font-weight: 700;
}
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-bottom: 12px;
}
.card-head h2 {
  margin: 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
  align-items: start;
}
.grid-2 > .stack > .card + .card {
  margin-top: 20px;
}
@media (max-width: 880px) {
  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- buttons & forms ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
  padding: 9px 16px;
  border: 2px solid var(--btn-border);
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: var(--btn-text);
  cursor: pointer;
  text-decoration: none;
}
.btn:hover {
  background: var(--btn-bg-hover);
  color: var(--btn-text-hover, var(--btn-text));
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid currentColor;
}
.btn-danger:hover {
  background: var(--danger-bg);
  color: var(--danger);
}
.btn-sm {
  padding: 4px 10px;
  font-size: 0.85rem;
}
.btn-icon {
  padding: 4px 8px;
  min-width: 32px;
}
.inline-form {
  display: inline;
}

label {
  font-weight: 600;
  font-size: 0.9rem;
}
input[type="text"],
input[type="search"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
input[type="number"],
input[type="email"],
select,
textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  width: 100%;
  min-width: 0;
}
[data-theme="data"] input,
[data-theme="data"] select,
[data-theme="data"] textarea {
  background: #ffffff;
  border-color: #9ca3af;
}
select option {
  background: var(--page-bg);
  color: var(--text);
}
[data-theme="data"] select option {
  background: #fff;
}
textarea {
  min-height: 12rem;
  resize: vertical;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}
.field small {
  color: var(--text-muted);
}
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0 16px;
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

/* ---------- flash / badges ---------- */

.flashes {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}
.flash {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-weight: 600;
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid currentColor;
}
[data-theme="data"] .flash {
  background: #fff;
}
.flash-error {
  background: var(--danger-bg);
  color: var(--danger);
}
.flash-warning {
  background: var(--warn-bg);
  color: var(--warn);
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--pill-radius);
  white-space: nowrap;
  border: 1px solid currentColor;
}
.badge-active {
  color: var(--ok);
  background: var(--ok-bg);
}
.badge-soon,
.badge-pending {
  color: var(--warn);
  background: var(--warn-bg);
}
.badge-expired,
.badge-never {
  color: var(--danger);
  background: var(--danger-bg);
}

/* ---------- tables ---------- */

.table-scroll {
  overflow-x: auto;
  margin: 0 -4px;
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
table.data th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data th.num {
  text-align: right;
}
table.data td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data tbody tr:hover {
  background: var(--surface-hover);
}
table.data tr.is-selected {
  background: var(--surface-hover);
  box-shadow: inset 3px 0 0 var(--chart-selected);
}
table.data a.sort {
  color: inherit;
  text-decoration: none;
}
table.data a.sort[aria-current="true"] {
  color: var(--text);
}
tr.clickable {
  cursor: pointer;
}
.rank {
  width: 3ch;
  font-weight: 800;
}
.rank-1,
.rank-2,
.rank-3 {
  font-size: 1.05rem;
}
.player-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.line-key {
  display: inline-block;
  width: 16px;
  height: 3px;
  border-radius: 2px;
  flex: none;
  background: var(--chart-muted);
}
.player-btn {
  font: inherit;
  color: var(--text);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
  font-weight: 600;
}
.player-btn:hover {
  text-decoration: underline;
}

/* ---------- standings page ---------- */

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.controls select {
  width: auto;
  min-width: 150px;
  font-weight: 700;
}
.search {
  position: relative;
  width: min(320px, 100%);
}
.search input {
  padding-left: 34px;
}
.search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}
.suggest {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  max-height: 320px;
  overflow-y: auto;
}
[data-theme="slop"] .suggest {
  background: #1a1636;
}
.suggest li {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.suggest li[aria-selected="true"],
.suggest li:hover {
  background: var(--surface-hover);
}
.suggest .sub {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.suggest .empty {
  cursor: default;
  color: var(--text-muted);
}

.chart-wrap {
  position: relative;
  height: 440px;
}
@media (max-width: 640px) {
  .chart-wrap {
    height: 320px;
  }
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
  color: var(--text-2);
}
.legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}
.legend .line-key {
  width: 18px;
}
.chart-empty {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--text-muted);
  text-align: center;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
}
.stat {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  border: 1px solid var(--border);
}
.stat .label {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.stat .value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}
.stat .value small {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}
.player-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.player-head h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.player-head .line-key {
  width: 22px;
  height: 4px;
  background: var(--chart-selected);
}
.coming-soon {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}
.placeholder {
  color: var(--text-muted);
  margin: 0;
}

/* ---------- news / about ---------- */

.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.news-list li + li {
  border-top: 1px solid var(--border);
}
.news-list a {
  display: block;
  padding: 10px 0;
  text-decoration: none;
  color: var(--text);
}
.news-list a:hover strong {
  text-decoration: underline;
}
.news-list time {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.prose {
  max-width: 70ch;
}
.prose img {
  max-width: 100%;
}
.prose h1,
.prose h2,
.prose h3 {
  margin-top: 1.2em;
}
.prose :first-child {
  margin-top: 0;
}
.article-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: -4px;
}

.about-hero {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
}
.about-hero img {
  width: 100%;
  height: auto;
}
@media (max-width: 640px) {
  .about-hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .about-hero img {
    width: 160px;
    margin: 0 auto;
  }
}
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 16px 0 0;
}
.facts div {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.facts dt {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.facts dd {
  margin: 0;
  font-weight: 700;
  font-size: 1.1rem;
}

/* ---------- footer ---------- */

.site-footer {
  background: var(--nav-bg);
  color: var(--nav-text);
  border-top: var(--footer-border-top);
  padding: 24px 0;
  font-size: 0.9rem;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}
.site-footer a {
  color: var(--nav-text);
}
.site-footer a:hover {
  color: var(--nav-text-hover);
}

/* ---------- admin ---------- */

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
  align-items: center;
}
.admin-nav a {
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--page-text);
  border: 1px solid transparent;
}
.admin-nav a:hover {
  border-color: color-mix(in srgb, var(--page-text) 50%, transparent);
  color: var(--page-text);
}
.admin-nav a[aria-current="page"] {
  background: var(--surface);
  color: var(--text);
}
.admin-nav .spacer {
  flex: 1;
}
.admin-nav .who {
  color: var(--page-text-2);
  font-size: 0.85rem;
}
.admin-nav form button {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  background: none;
  border: 1px solid color-mix(in srgb, var(--page-text) 50%, transparent);
  color: var(--page-text);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.auth-card {
  max-width: 420px;
  margin: 24px auto;
}
.qr {
  background: #fff;
  padding: 12px;
  border-radius: 8px;
  width: fit-content;
  margin: 8px auto 12px;
}
.qr svg {
  display: block;
}
.secret {
  font-family: ui-monospace, monospace;
  word-break: break-all;
  background: var(--surface-2);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.kpis .card {
  padding: 14px 16px;
}
.kpis .card + .card {
  margin-top: 0;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.toolbar input[type="search"] {
  width: min(280px, 100%);
}
.filter-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.filter-links a {
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: var(--pill-radius);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.filter-links a[aria-current="true"] {
  border-color: var(--text);
  color: var(--text);
  background: var(--surface-hover);
}

/* table editor */
.editor-meta {
  display: grid;
  grid-template-columns: 180px 180px minmax(0, 1fr);
  gap: 0 16px;
}
@media (max-width: 640px) {
  .editor-meta {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .editor-meta .field:last-child {
    grid-column: 1 / -1;
  }
}
.tables {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr));
  gap: 20px;
  margin-top: 20px;
}
.tables .card + .card {
  margin-top: 0;
}
.seat-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}
.seat {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr) 4.2rem 3.4rem auto;
  gap: 8px;
  align-items: center;
  padding: 6px 4px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.seat.dragging {
  opacity: 0.5;
}
.seat.drop-before {
  box-shadow: inset 0 3px 0 var(--accent);
}
.seat .place {
  font-weight: 800;
  text-align: center;
  cursor: grab;
}
.seat .who {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.seat .who .sub {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-left: 6px;
}
.seat input[type="number"] {
  padding: 4px 6px;
  text-align: right;
}
.seat .pts {
  font-weight: 800;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.seat .pts.pending {
  color: var(--text-muted);
}
.seat .actions {
  display: flex;
  gap: 2px;
}
.seat .actions button {
  font: inherit;
  font-size: 0.85rem;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  padding: 0;
}
.seat .actions button:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.seat-head {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr) 4.2rem 3.4rem auto;
  gap: 8px;
  padding: 0 4px 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.seat-head span:nth-child(3),
.seat-head span:nth-child(4) {
  text-align: right;
}
.seat-head .actions-spacer {
  width: 90px;
}
@media (max-width: 480px) {
  .seat,
  .seat-head {
    grid-template-columns: 1.8rem minmax(0, 1fr) 3.4rem 2.6rem auto;
    gap: 6px;
  }
  .seat-head .actions-spacer {
    width: 60px;
  }
  .seat .actions .move {
    display: none;
  }
}
.add-player .search {
  width: 100%;
}
.error-box {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid currentColor;
  font-weight: 600;
  font-size: 0.9rem;
}
.error-box button,
.error-box a {
  margin-left: 6px;
}
.error-box ul {
  margin: 4px 0 0;
  padding-left: 18px;
}
.commit-bar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.commit-bar .summary {
  color: var(--text-2);
}

dialog {
  border: var(--card-border);
  border-top: var(--card-top);
  border-radius: var(--card-radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--card-shadow);
  padding: 20px;
  width: min(420px, calc(100vw - 32px));
}
[data-theme="slop"] dialog {
  background: #1a1636;
}
dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.pagination {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

@media (prefers-reduced-motion: no-preference) {
  [data-theme="slop"] body::before {
    content: "";
    position: fixed;
    inset: -20vmax;
    z-index: -1;
    background: conic-gradient(from 0deg at 50% 50%, rgba(124, 58, 237, 0.10), rgba(219, 39, 119, 0.10),
        rgba(8, 145, 178, 0.10), rgba(124, 58, 237, 0.10));
    filter: blur(60px);
    animation: slop-spin 40s linear infinite;
  }
  @keyframes slop-spin {
    to {
      transform: rotate(1turn);
    }
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.back-link {
  color: var(--page-text);
}
.back-link:hover {
  color: var(--page-text-2);
}

.page-head > div:first-child {
  flex: 1 1 320px;
}
.page-head > .controls {
  flex: 0 1 auto;
  justify-content: flex-end;
}
@media (max-width: 640px) {
  .page-head > .controls {
    flex: 1 1 100%;
    justify-content: stretch;
  }
  .controls select {
    flex: 1 1 140px;
  }
  .controls .search {
    flex: 2 1 200px;
  }
}

@media (max-width: 640px) {
  .site-nav {
    position: static;
  }
  .nav-inner {
    gap: 6px 12px;
  }
  .brand {
    flex: 1;
    font-size: 1.15rem;
  }
  .brand img {
    width: 36px;
    height: 36px;
  }
  .theme-switch button {
    padding: 4px 8px;
    font-size: 0.7rem;
  }
  .nav-links {
    order: 3;
    flex-basis: 100%;
    gap: 4px 16px;
  }
  main {
    padding-top: 16px;
  }
  .card {
    padding: 16px;
  }
}

.grid-2 > .card + .card,
.grid-2 > .stack + .card,
.grid-2 > .card + .stack {
  margin-top: 0;
}
.facts dd {
  overflow-wrap: anywhere;
}
.facts dd a {
  font-size: 0.95rem;
}
@media (max-width: 480px) {
  .hide-sm {
    display: none;
  }
}

.small {
  font-size: 0.85rem;
}
.table-foot {
  margin: 10px 0 0;
}
#pd-manual-note {
  margin: 0 0 12px;
}

/* ---------- static admin (damp/static/admin/) ---------- */

.site-footer .footer-admin {
  display: inline-flex;
  align-items: center;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.site-footer .footer-admin:hover,
.site-footer .footer-admin.is-open {
  opacity: 1;
}
.footer-admin .lock-open,
.footer-admin.is-open .lock-closed {
  display: none;
}
.footer-admin.is-open .lock-open {
  display: inline;
}
#admin-messages .flash {
  white-space: pre-line;
}
.kpis .stat-value {
  font-size: 1.4rem;
}
.field .label {
  font-weight: 600;
  font-size: 0.9rem;
}
.lp-value {
  margin: 0;
  padding: 8px 0;
  font-weight: 700;
}
.warn-box {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid currentColor;
  font-weight: 600;
  font-size: 0.9rem;
}
.warn-box ul {
  margin: 4px 0 0;
  padding-left: 18px;
}
.suggest li.create {
  font-weight: 700;
}
table.data tr.detail-row:hover {
  background: none;
}
table.data tr.detail-row > td {
  padding: 4px 0 20px;
}
.table-detail {
  max-width: 640px;
  padding: 4px 0 0 16px;
}
.table-card {
  max-width: 760px;
}
.history-details {
  margin: 4px 0 0;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.badge-lp {
  color: var(--text-2);
  background: var(--surface-hover);
}
.badge-lp + .badge-lp {
  margin-left: 4px;
}
table.data.history td {
  vertical-align: top;
}
[hidden] {
  display: none !important; /* .btn etc. set display, which would otherwise override the hidden attribute */
}
table.data td .btn + .btn {
  margin-left: 6px;
}
.card-head select {
  width: auto;
}
