/* ============================================================
   Shared styles — used by both index.html and admin.html
   :root tokens and shared components live here; page-specific
   rules are scoped under body.page-index / body.page-admin so
   the two pages can't leak generic tag styles into each other.
   ============================================================ */

:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --border: #d9e2ef;
  --ink: #0f172a;
  --muted: #475569;
  --accent: #2563eb;
  --danger: #dc2626;
  --ok: #16a34a;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

/* --- Hamburger menu button ---
   Each page positions this itself (fixed on index.html, in-flow on
   admin.html), so no position/top/right rules live here. */
.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 38px;
  height: 34px;
  padding: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.hamburger-btn:hover {
  border-color: var(--accent);
}

.hamburger-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
}

/* --- Dropdown panel opened by the hamburger button ---
   Each page positions and sizes this itself; this just covers the look. */
.dropdown-panel {
  display: none;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 12px;
  z-index: 50;
}

.dropdown-panel.open {
  display: block;
}

/* ============================================================
   Page: Timeline (index.html)
   ============================================================ */

body.page-index {
  padding: 28px 20px 36px;
  line-height: 1.6;
  display: flex;
  justify-content: center;
}

.page-index .page {
  width: min(1200px, 100%);
}

.page-index .hero {
  margin-bottom: 18px;
  text-align: left;
}

.page-index h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.page-index .lede {
  margin: 0;
  color: var(--muted);
}

.page-index .timeline-shell {
  margin-top: 18px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.page-index #timeline-container {
  width: 100%;
  height: 600px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

@media (max-width: 720px) {
  body.page-index {
    padding: 18px 14px 24px;
  }

  .page-index h1 {
    font-size: 24px;
  }

  .page-index .timeline-shell {
    padding: 12px;
  }

  .page-index #timeline-container {
    height: 440px;
  }
}

/* --- Hamburger menu (index instance: fixed top-right) --- */

#menu-toggle {
  position: fixed;
  top: 20px;
  right: 16px;
  z-index: 40;
}

#site-menu {
  position: fixed;
  top: 70px;
  right: 16px;
  min-width: 180px;
}

#site-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

#site-menu a:hover {
  background: var(--bg);
  color: var(--accent);
}

/* --- Info page (mimics Histropedia Sheets' intro panel) --- */

.info-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 40;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.info-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.info-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.info-modal[hidden] {
  display: none;
}

.info-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.info-modal__panel {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: min(82vh, 720px);
  overflow-y: auto;
  background: var(--panel);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 32px;
}

.info-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.info-modal__close:hover {
  color: var(--ink);
  border-color: var(--accent);
}

.info-modal__image {
  display: block;
  max-width: 100%;
  max-height: 260px;
  margin: 0 auto 20px;
  border-radius: 10px;
}

.info-modal__title {
  margin: 0 0 4px;
  font-size: 22px;
}

.info-modal__subtitle {
  margin: 0 0 18px;
  color: var(--muted);
  font-style: italic;
}

.info-modal__body {
  white-space: pre-wrap;
  color: var(--ink);
  font-size: 15px;
}

.info-modal__dismiss {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}

.info-modal__dismiss input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

@media (max-width: 720px) {
  .info-modal__panel {
    padding: 22px;
  }
}

/* --- Toolbar / Search --- */

.timeline-toolbar {
  margin-bottom: 10px;
}

.search-box {
  position: relative;
  max-width: 360px;
}

.search-box input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--panel);
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
}

.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-height: 260px;
  overflow-y: auto;
  padding: 4px;
}

.search-result {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: none;
  background: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

.search-result:hover {
  background: var(--bg);
  color: var(--accent);
}

.search-result__sub {
  font-weight: 400;
  color: var(--muted);
  margin-left: 6px;
}

/* --- Timeline overlay layer (content panel, zoom, legend/filter) --- */

#timeline-wrap {
  position: relative;
}

/* --- Content panel (click-to-preview, top-left over the canvas) --- */

.content-panel {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 20;
  width: min(340px, calc(100% - 28px));
  max-height: min(70%, 480px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 14px 16px 16px;
}

.content-panel__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.content-panel__close:hover {
  color: var(--ink);
  border-color: var(--accent);
}

.content-panel__header {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding-right: 26px;
}

.content-panel__image {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex: none;
}

.content-panel__title {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
}

.content-panel__subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.content-panel__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
}

.content-panel__tab {
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.content-panel__tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.content-panel__body {
  margin-top: 10px;
  font-size: 13px;
}

.content-panel__text {
  white-space: pre-wrap;
  color: var(--ink);
}

.content-panel__link {
  display: inline-block;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.content-panel__link:hover {
  text-decoration: underline;
}

.content-panel__video {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
}

.content-panel__video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 8px;
}

.content-panel__empty {
  margin: 0;
  color: var(--muted);
  font-style: italic;
}

/* --- Zoom controls (top-right over the canvas) --- */

.zoom-controls {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.zoom-controls button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.zoom-controls button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Legend / Filter (bottom-left over the canvas) --- */

.legend-toggle {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 20;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.legend-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.legend-panel {
  position: absolute;
  bottom: 58px;
  left: 14px;
  z-index: 20;
  width: min(300px, calc(100% - 28px));
  max-height: min(60%, 420px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 14px;
}

.legend-panel__row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.legend-panel__row label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.legend-panel__row select {
  flex: 1;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
}

.legend-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 12px;
}

.legend-swatch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--ink);
}

.legend-swatch__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}

.filter-group {
  margin-bottom: 12px;
}

.filter-group h4 {
  margin: 0 0 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 3px 0;
  cursor: pointer;
}

.filter-checkbox input {
  cursor: pointer;
}

.filter-clear-btn {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #e5e9f2;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.filter-clear-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 720px) {
  .content-panel,
  .legend-panel {
    width: calc(100% - 24px);
  }
}

/* ============================================================
   Page: Admin (admin.html)
   ============================================================ */

body.page-admin {
  height: 100%;
  padding: 20px 16px 16px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* the page itself never scrolls — only .scroll-area does */
  min-height: 0;
}

/* Everything above the table (heading, converter, connect panel, status).
   Normally far shorter than this cap, so it's invisible in practice — it's
   just a safety valve so this section scrolls itself instead of ever
   reintroducing a second, page-level scrollbar. */
#top-stack {
  flex: none;
  max-height: 45vh;
  overflow-y: auto;
}

.page-admin h1 {
  font-size: 22px;
  margin: 0 0 4px;
}

.sub {
  color: var(--muted);
  margin: 0 0 16px;
  font-size: 14px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.header-menu {
  position: relative;
  flex: none;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.back-link {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.back-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Hamburger instance for admin (in-flow, dropdown anchored below it) */
#menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
}

.menu-status {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 10px;
}

.menu-status.connected {
  color: var(--ok);
}

#menu-dropdown button {
  width: 100%;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

#connect-panel {
  max-width: 700px;
}

.page-admin label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--muted);
}

.page-admin input[type=password] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 10px;
}

.page-admin button {
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-secondary {
  background: #e5e9f2;
  color: var(--ink);
}

.page-admin button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hint {
  font-size: 12px;
  color: var(--muted);
  margin: -6px 0 10px;
}

.status-ok {
  color: var(--ok);
}

.status-err {
  color: var(--danger);
}

.status-busy {
  color: var(--muted);
}

#table-wrap {
  display: none;
  /* toggled to "flex" once events are loaded */
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  /* required so a flex child can shrink and scroll internally */
}

.toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: nowrap;
  align-items: center;
  flex: none;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.toolbar .spacer {
  flex: 1 1 auto;
  min-width: 6px;
}

.toolbar button {
  flex: 0 0 auto;
}

.toolbar .spacer {
  flex: 1;
}

.scroll-area {
  overflow-x: auto;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.page-admin table {
  border-collapse: collapse;
  font-size: 12px;
}

.page-admin th,
.page-admin td {
  border: 1px solid var(--border);
  padding: 4px;
  vertical-align: top;
}

.page-admin th {
  background: #eef2f9;
  position: sticky;
  top: 0;
  z-index: 2;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  white-space: nowrap;
  padding: 6px 4px;
}

.page-admin td {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

td.narrow {
  max-width: 70px;
}

td.medium {
  max-width: 140px;
}

td.title-cell {
  max-width: 220px;
  font-weight: 600;
  white-space: normal;
}

tr.row-editable {
  cursor: pointer;
}

tr.row-editable:hover td {
  background: #f8fafc;
}

tr.row-locked {
  color: var(--muted);
  font-style: italic;
}

td.cell-dirty {
  background: #fff7cc;
  box-shadow: inset 0 0 0 1px #f2c94c;
}

tr.row-editable:hover td.cell-dirty {
  background: #fdecb0;
}

.row-actions {
  white-space: nowrap;
  text-align: center;
}

.row-locked-label {
  text-align: center;
  color: var(--muted);
}

.row-num {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  background: #f8fafc;
}

.pending-badge {
  font-size: 12px;
  font-weight: 700;
  color: #b45309;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 38vw;
}

/* Edit popover / modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 100;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 16px;
  overflow-y: auto;
}

.modal-panel {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow);
  width: min(780px, 100%);
  padding: 20px 24px 24px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
}

.modal-tabs {
  display: flex;
  gap: 6px;
  margin-top: 14px;
}

.modal-tab {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #eef2f9;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.modal-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.modal-tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.modal-section {
  margin-top: 18px;
}

.image-field {
  grid-column: 1 / -1;
}

.image-field .image-preview {
  max-width: 180px;
  max-height: 130px;
  display: block;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 6px;
  object-fit: cover;
  background: #f2f4f8;
}

.image-field .image-current {
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
  margin-bottom: 8px;
}

.image-field .image-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.image-field .file-btn {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.image-field #image-url-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.image-field #image-url-row input {
  flex: 1;
}

.modal-section h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px 14px;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.15s;
}

.modal-field.field-dirty {
  background: #fff7cc;
  box-shadow: inset 0 0 0 1px #f2c94c;
}

.modal-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.modal-field .required-mark {
  color: var(--danger);
  margin-left: 2px;
}

.modal-field input,
.modal-field select,
.modal-field textarea {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
}

.modal-field textarea {
  grid-column: 1 / -1;
  min-height: 60px;
  resize: vertical;
}

.ro-value {
  font-size: 13px;
  padding: 6px 8px;
  background: #f8fafc;
  border: 1px dashed var(--border);
  border-radius: 6px;
  color: var(--muted);
  min-height: 15px;
}

.required-hint {
  color: var(--danger);
  font-size: 12px;
  margin-top: 12px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  align-items: center;
}

#delete-section {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.delete-warning {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: #7f1d1d;
}

.delete-warning .warn-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

/* Date converter */
#converter-panel {
  padding: 0;
  overflow: hidden;
}

#converter-panel summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 700;
  font-size: 15px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

#converter-panel summary::-webkit-details-marker {
  display: none;
}

#converter-panel summary::before {
  content: "▶";
  font-size: 11px;
  color: var(--muted);
  transition: transform 0.15s;
}

#converter-panel[open] summary::before {
  transform: rotate(90deg);
}

#converter-panel .conv-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}

.conv-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin: 12px 0;
}

.conv-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.conv-field label {
  margin: 0;
}

.conv-field input,
.conv-field select {
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
}

.conv-field.year input,
.conv-field.jdn input {
  width: 110px;
}

.conv-field.month input,
.conv-field.day input {
  width: 70px;
}

.conv-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.conv-result {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.conv-result .conv-label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.conv-result .conv-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.conv-result button {
  padding: 2px 8px;
  font-size: 11px;
  background: #e5e9f2;
  color: var(--ink);
}

.conv-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 6px;
}

.conv-note {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 4px;
}

@media (max-width: 480px) {
  .toolbar button {
    font-size: 12px;
    padding: 7px 10px;
  }

  .pending-badge {
    max-width: 30vw;
  }
}

/* Status notifications fade out on their own after a short delay instead
   of sitting there indefinitely. */
#status {
  font-size: 14px;
  margin-top: 4px;
  min-height: 20px;
  transition: opacity 0.6s ease;
  opacity: 1;
}

#status.status-fade {
  opacity: 0;
}

/* --- Configuration modal --- */

.config-props-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 14px;
}

.config-props-table th,
.config-props-table td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}

.config-props-table th {
  background: #eef2f9;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.config-props-table td:not(:first-child) {
  text-align: center;
  width: 90px;
}

.config-props-table input[type=checkbox] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.config-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 10px;
  cursor: pointer;
}

.config-checkbox-row input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

#config-yfa-increment-row input {
  max-width: 140px;
}
