/* RATS — reusable UI components.
   Linked on every content/form page (the landing hubs use theme.css only).
   Tokens come from theme.css — style everything through those vars so a
   single change propagates across the whole app. */

/* ---- rows ---- */
.row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap }
.frow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap }

/* ---- page title + gold line-SVG icon (matches the hub tiles; SVG uses stroke="currentColor") ---- */
h1 { display: inline-flex; align-items: center; gap: 9px }
h1 .hicon { width: 22px; height: 22px; flex: 0 0 auto; color: var(--accent) }

/* ---- buttons ----
   <button>            primary, gold
   <button class=dark> dark fill
   a.btn / button.btn  secondary, outlined
   .icon-btn           square icon-only (var(--ctl-h)) */
button {
  background: var(--accent);
  color: var(--surface-2);
  border: 0;
  border-radius: var(--radius);
  height: var(--ctl-h);
  padding: 0 14px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
button:hover { filter: brightness(1.1) }
button:disabled { opacity: .4; cursor: not-allowed; filter: none }
button.dark { background: var(--border-2); color: var(--white) }
button.dark:hover { background: #4a4d55; filter: none }

a.btn, button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  height: var(--ctl-h);
  padding: 0 12px;
  cursor: pointer;
  white-space: nowrap;
}
a.btn:hover, button.btn:hover { border-color: var(--accent); color: var(--white); filter: none }

.icon-btn { padding: 0; width: var(--ctl-h); justify-content: center }

/* on/off toggle button — gold when .active, dark when off (used on lore, comp) */
.tbtn { background: var(--surface); border: 1px solid var(--border); color: var(--text-dim); font-weight: 700 }
.tbtn:hover { color: var(--white); filter: none }
.tbtn.active { background: var(--accent); border-color: var(--accent); color: var(--surface-2) }

/* ---- fields ---- */
input[type=text], input[type=date], input[type=number], input[type=password], select, textarea {
  background: var(--field);
  color: var(--white);
  border: 1px solid var(--field-border);
  border-radius: var(--radius);
  font-size: 13px;
  color-scheme: dark;
}
input[type=text], input[type=date], input[type=number], input[type=password], select {
  height: var(--ctl-h);
  padding: 0 12px;
}
textarea { padding: 8px 12px; font-family: var(--font); resize: vertical }
input:focus, select:focus, textarea:focus { border-color: var(--accent) }
input[type=checkbox], input[type=radio] { accent-color: var(--accent) }
/* keep a real, visible focus ring for keyboard users (mouse clicks don't trigger :focus-visible) */
input:focus-visible, select:focus-visible, textarea:focus-visible,
button:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

select {
  -webkit-appearance: none;
  appearance: none;
  min-width: 150px;
  padding-right: 34px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8d93' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

/* ---- status message ---- */
.msg:not(:empty) { margin: 8px 0 0; font-size: 13px; color: var(--ok) }

/* ---- panel card ---- */
.card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 12px 14px;
  margin-top: 14px;
}

/* danger / delete button (outlined red) */
.del {
  background: none; border: 1px solid #5a2e2e; color: #ff9b9b; border-radius: var(--radius);
  padding: 5px 10px; font-weight: 700; font-size: 12px; cursor: pointer; height: auto;
}
.del:hover { background: #3a2626; color: var(--white) }

/* collapsible section header (h2.sec + caret + count) */
h2.sec { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 8px }
h2.sec:hover { color: var(--accent-hi) }
.caret { font-size: 11px; color: var(--text-dim-2) }
.cnt { color: #6e7178; font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0 }

/* gold accent text — emphasize a keyword/hint in gold (matches the hub) */
.gold { color: var(--accent) }

/* ---- pill ---- */
.pill {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .4px;
  border-radius: 9px;
  padding: 1px 8px;
}

/* ---- collapsible scroll list ---- */
.seclist {
  max-height: 300px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-3);
  padding: 0 12px 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--surface-3);
}
.seclist table { margin-top: 0 }
.seclist thead th { position: sticky; top: 0; background: var(--surface-3); z-index: 1 }

/* ---- segmented toggle: the site standard (a few choices in one pill, the picked one lifted) ----
   Markup: <span class="segs"><button class="seg active">A</button>…</span>, or
   <span class="sg"><button aria-pressed="true">A</button>…</span>. One definition for every
   page: pages never restyle .segs/.seg, they only size or colour a variant. */
.segs, .sg {
  display: inline-flex; align-items: center;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; padding: 2px;
}
.segs .seg, .sg > button {
  box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: auto; min-width: 0; padding: 5px 11px; border: 0; border-radius: 5px;
  background: transparent; color: var(--text-dim-2); filter: none;
  font: 600 13px/1.3 var(--body, var(--font)); white-space: nowrap; cursor: pointer;
}
.segs .seg:hover, .sg > button:hover { color: var(--white); filter: none }
.segs .seg.active, .sg > button[aria-pressed="true"] {
  background: var(--surface); color: var(--accent-hi); box-shadow: inset 0 0 0 1px var(--line-warm, #3a3530);
}
.segs .seg:focus, .sg > button:focus { outline: none }
.segs .seg:focus-visible, .sg > button:focus-visible { outline: 1px solid var(--accent); outline-offset: 1px }
/* a choice with nothing behind it yet (a raid with no loot): dim, still clickable */
.segs .seg.empty { opacity: .5 }
.segs .seg.empty.active { opacity: 1 }

/* ---- underline tabs: the site standard ---- */
.tabs { display: flex; gap: 22px; flex-wrap: wrap; border-bottom: 1px solid var(--border) }
.tabs .tab {
  height: auto; padding: 9px 2px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  background: transparent; color: var(--text-dim-2); filter: none;
  font: 600 14px var(--body, var(--font)); cursor: pointer;
}
.tabs .tab:hover { color: var(--white); filter: none }
.tabs .tab.active { color: var(--accent-hi); border-bottom-color: var(--accent) }
.tabs .tab:focus { outline: none }
.tabs .tab:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px }
