/* ==========================================================================
   RAIN — design system
   One palette, one type family, one shell for every role.
   Brand: the black-and-gold circuit chip of the RAIN mark.
   Signature element: the gold "trace" — a line ending in a solder pad —
   used for the active menu item and section rules. Nothing else is loud.
   ========================================================================== */

:root {
  /* brand */
  --ink:        #111214;   /* chip black — sidebar, headings            */
  --ink-2:      #1B1D21;
  --ink-3:      #2A2D33;
  --gold:       #B8913A;   /* metallic gold — the only accent           */
  --gold-hi:    #D9B45B;   /* gold on dark surfaces                     */
  --gold-text:  #86671F;   /* gold that passes contrast on white        */
  --gold-wash:  #F6EFDD;

  /* surfaces */
  --canvas:     #F4F5F7;
  --paper:      #FFFFFF;
  --line:       #E3E5EA;
  --line-2:     #CFD3DA;

  /* text */
  --text:       #16181C;
  --text-2:     #4D525C;
  --text-3:     #868B95;
  --on-ink:     #ECEDEF;
  --on-ink-2:   #9A9EA7;

  /* status — used only to carry meaning, never decoration */
  --ok:         #1E7A4C;  --ok-wash:   #E6F3EC;
  --bad:        #B42318;  --bad-wash:  #FBEAE8;
  --warn:       #9A5B06;  --warn-wash: #FBF1DF;
  --info:       #2A5B9C;  --info-wash: #E8EFF8;

  /* type */
  --font:       "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono:       "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* scale (1.2 minor third) */
  --t-xs: .75rem; --t-sm: .8125rem; --t-md: .9375rem; --t-lg: 1.125rem;
  --t-xl: 1.375rem; --t-2xl: 1.75rem; --t-3xl: 2.25rem;

  /* geometry */
  --r-sm: 6px; --r: 10px; --r-lg: 14px;
  --sidebar-w: 256px;
  --topbar-h: 60px;
  --ease: cubic-bezier(.2,.7,.2,1);
  --shadow-pop: 0 12px 32px -12px rgba(17,18,20,.28);

  /* ── compatibility aliases for templates written against the old admin base ── */
  --bg: var(--canvas); --bg2: #ECEEF2; --surface: var(--paper); --surface2: #F7F8FA; --surface3: #EEF0F3;
  --border: var(--line); --border2: var(--line-2);
  --text2: var(--text-2); --text3: var(--text-3);
  --gold-dim: var(--gold-text); --gold-s: var(--gold-wash); --gold-glow: var(--gold-wash);
  --green: var(--ok); --green-s: var(--ok-wash); --red: var(--bad); --red-s: var(--bad-wash);
  --blue: var(--info); --blue-s: var(--info-wash); --purple: var(--ink-3);
  /* old student theme names */
  --rain-navy: var(--ink); --rain-blue: var(--ink-2); --rain-accent: var(--gold-text); --rain-gold: var(--gold);
  --rain-green: var(--ok); --rain-red: var(--bad); --rain-surface: var(--canvas); --rain-card: var(--paper);
  --rain-border: var(--line); --rain-text: var(--text); --rain-muted: var(--text-3);
  color-scheme: light;
}

/* ── reset ───────────────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: var(--t-md); line-height: 1.55;
  color: var(--text); background: var(--canvas);
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
h1,h2,h3,h4 { margin: 0; line-height: 1.2; color: var(--ink); font-stretch: 112%; letter-spacing: -.01em; }
h1 { font-size: var(--t-2xl); font-weight: 700; }
h2 { font-size: var(--t-xl);  font-weight: 700; }
h3 { font-size: var(--t-lg);  font-weight: 650; }
h4 { font-size: var(--t-md);  font-weight: 650; }
p  { margin: 0 0 .75em; }
a  { color: var(--gold-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
img, svg { max-width: 100%; }
code, .mono { font-family: var(--mono); font-size: .92em; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ── shell ───────────────────────────────────────────────────────────── */
.rs-shell { min-height: 100vh; }
.rs-side {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40; height: 100vh; height: 100dvh;
  background: var(--ink); color: var(--on-ink);
  display: flex; flex-direction: column;
  transition: transform .25s var(--ease);
}
.rs-brand {
  display: flex; align-items: center; gap: 12px; padding: 18px 20px 16px;
  color: var(--on-ink); text-decoration: none; border-bottom: 1px solid var(--ink-3);
}
.rs-brand img { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; }
.rs-brand b { display: block; font-size: 1.05rem; font-stretch: 125%; letter-spacing: .02em; }
.rs-brand small { display: block; font-size: var(--t-xs); color: var(--on-ink-2); }

.rs-nav { flex: 1; overflow-y: auto; padding: 10px 0 18px; scrollbar-width: thin; scrollbar-color: var(--ink-3) transparent; }
.rs-group { padding: 12px 0 2px; }
.rs-group > span {
  display: block; padding: 0 20px 6px; font-size: var(--t-xs); color: var(--on-ink-2);
  font-weight: 600; font-stretch: 112%;
}
.rs-link {
  position: relative; display: flex; align-items: center; gap: 11px;
  padding: 8px 20px 8px 22px; color: var(--on-ink); text-decoration: none;
  font-size: var(--t-sm); font-weight: 500; opacity: .82;
}
.rs-link svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: .75; }
.rs-link:hover { opacity: 1; background: var(--ink-2); }
/* the trace: active item gets a gold line with a solder pad */
.rs-link.is-active { opacity: 1; color: #fff; background: var(--ink-2); }
.rs-link.is-active::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 12px; height: 2px;
  background: var(--gold-hi); transform: translateY(-50%);
}
.rs-link.is-active::after {
  content: ""; position: absolute; left: 11px; top: 50%; width: 6px; height: 6px;
  border: 2px solid var(--gold-hi); background: var(--ink); transform: translateY(-50%);
}
.rs-link.is-active svg { color: var(--gold-hi); opacity: 1; }
.rs-link .rs-count {
  margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 10px;
  background: var(--gold); color: var(--ink); font-size: var(--t-xs); font-weight: 700; text-align: center;
}

.rs-me {
  display: flex; align-items: center; gap: 10px; padding: 14px 20px;
  border-top: 1px solid var(--ink-3); font-size: var(--t-sm);
}
.rs-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--ink-3); color: var(--gold-hi); font-weight: 700; overflow: hidden;
}
.rs-avatar img { width: 100%; height: 100%; object-fit: cover; }
.rs-me .who { min-width: 0; flex: 1; }
.rs-me .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.rs-me .who small { color: var(--on-ink-2); text-transform: capitalize; }
.rs-me a { color: var(--on-ink-2); }
.rs-signout { display: flex; align-items: center; gap: 10px; margin: 0 16px 14px; padding: 10px 14px; border: 1px solid var(--ink-3); border-radius: var(--r); color: var(--on-ink); text-decoration: none; font-size: var(--t-sm); font-weight: 600; }
.rs-signout svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.rs-signout:hover { border-color: var(--gold-hi); color: var(--gold-hi); }
/* account menu (top right) */
.rs-acct { position: relative; }
.rs-acct summary { list-style: none; cursor: pointer; display: grid; place-items: center; }
.rs-acct summary::-webkit-details-marker { display: none; }
.rs-avatar.sm { width: 34px; height: 34px; background: var(--ink); color: var(--gold-hi); font-size: .9rem; }
.rs-acct-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 220px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); padding: 6px; }
.rs-acct-menu .who { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.rs-acct-menu .who b { display: block; color: var(--ink); }
.rs-acct-menu .who small { color: var(--text-3); text-transform: capitalize; }
.rs-acct-menu a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r); color: var(--text); text-decoration: none; font-size: var(--t-sm); font-weight: 500; }
.rs-acct-menu a:hover { background: var(--surface3); }
.rs-acct-menu a.out { color: #A5382A; font-weight: 600; }
.rs-acct-menu svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.rs-me a:hover { color: var(--gold-hi); }

.rs-top {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  margin-left: var(--sidebar-w); padding: 0 28px;
  display: flex; align-items: center; gap: 16px;
  background: rgba(244,245,247,.92); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.rs-top h1 { font-size: var(--t-lg); font-weight: 650; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-burger { display: none; background: none; border: 0; padding: 8px; margin-left: -8px; cursor: pointer; color: var(--ink); }
.rs-burger svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.8; fill: none; }

/* notifications bell */
.rs-bell { position:relative; display:inline-grid; place-items:center; width:38px; height:38px; border-radius:50%; color:var(--ink); }
.rs-bell:hover { background:var(--surface3); }
.rs-bell svg { width:21px; height:21px; stroke:currentColor; fill:none; stroke-width:1.7; stroke-linejoin:round; }
.rs-bell b { position:absolute; top:3px; right:1px; min-width:17px; height:17px; padding:0 4px; border-radius:9px; background:var(--gold); color:var(--ink); font-size:10px; line-height:17px; text-align:center; }

/* calendar countdown chip */
.rs-next {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 8px;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--paper);
  font-size: var(--t-sm); color: var(--text-2); text-decoration: none; white-space: nowrap;
}
.rs-next b { color: var(--ink); font-weight: 650; }
.rs-next i { width: 8px; height: 8px; border: 2px solid var(--gold); display: inline-block; }

.rs-main { margin-left: var(--sidebar-w); padding: 28px 28px 64px; max-width: calc(1240px + var(--sidebar-w)); }
.rs-scrim { display: none; }

/* mobile: drawer + bottom tabs (app-like) */
.rs-tabs { display: none; }
@media (max-width: 960px) {
  .rs-side { transform: translateX(-100%); box-shadow: var(--shadow-pop); }
  .rs-shell.is-open .rs-side { transform: none; }
  .rs-shell.is-open .rs-scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(17,18,20,.45); }
  .rs-top, .rs-main { margin-left: 0; }
  .rs-top { padding: 0 16px; }
  .rs-burger { display: inline-flex; }
  .rs-main { padding: 20px 16px 96px; }
  .rs-next span.long { display: none; }
  .rs-tabs {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--paper); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .rs-tabs a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px;
    font-size: .6875rem; color: var(--text-3); text-decoration: none; font-weight: 600;
  }
  .rs-tabs a svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; }
  .rs-tabs a.is-active { color: var(--ink); }
  .rs-tabs a.is-active svg { color: var(--gold); }
}

/* ── page header ─────────────────────────────────────────────────────── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head p { color: var(--text-2); margin: 6px 0 0; max-width: 64ch; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* section rule with the trace motif */
.trace {
  display: flex; align-items: center; gap: 10px; margin: 28px 0 14px;
  font-size: var(--t-md); font-weight: 650; color: var(--ink); font-stretch: 112%;
}
.trace::before { content: ""; width: 18px; height: 2px; background: var(--gold); }
.trace::after  { content: ""; flex: 1; height: 1px; background: var(--line); }
.trace small { font-weight: 500; color: var(--text-3); font-stretch: 100%; }

/* ── cards ───────────────────────────────────────────────────────────── */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; margin-bottom: 16px; }
.card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: var(--t-md); font-weight: 650; color: var(--ink);
  margin: -2px 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.card.flush { padding: 0; overflow: hidden; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid-side { grid-template-columns: minmax(0,1fr) 340px; align-items: start; }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .grid-side { grid-template-columns: 1fr; } }
@media (max-width: 720px)  { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* figures: number first, label under */
.fig { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; }
.fig b { display: block; font-size: var(--t-2xl); font-weight: 700; color: var(--ink); font-stretch: 112%; line-height: 1.1; }
.fig span { font-size: var(--t-sm); color: var(--text-2); }

/* key/value lists */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; font-size: var(--t-sm); }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; color: var(--text); font-weight: 500; }
.kv dd small { color: var(--text-3); font-weight: 400; }

/* ── buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 8px 16px; border-radius: var(--r); border: 1px solid transparent;
  font: 600 var(--t-sm)/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.btn:disabled, .btn[aria-disabled=true] { opacity: .5; cursor: not-allowed; }
.btn-primary   { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-3); }
.btn-gold      { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: var(--gold-hi); }
.btn-secondary, .btn-ghost { background: var(--paper); color: var(--ink); border-color: var(--line-2); }
.btn-secondary:hover, .btn-ghost:hover { border-color: var(--ink); }
.btn-danger    { background: var(--paper); color: var(--bad); border-color: #EBC2BD; }
.btn-danger:hover { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn-success   { background: var(--paper); color: var(--ok); border-color: #BFDDCB; }
.btn-success:hover { background: var(--ok); color: #fff; }
.btn-quiet     { background: transparent; color: var(--text-2); padding-inline: 10px; }
.btn-quiet:hover { color: var(--ink); background: var(--surface3); }
.btn-sm { min-height: 30px; padding: 5px 11px; font-size: var(--t-xs); border-radius: var(--r-sm); }
.btn-lg { min-height: 46px; padding: 12px 22px; font-size: var(--t-md); }
.btn-block { width: 100%; }

/* ── forms ───────────────────────────────────────────────────────────── */
.form-group, .field { margin-bottom: 14px; }
.form-label, .field > label { display: block; margin-bottom: 6px; font-size: var(--t-sm); font-weight: 600; color: var(--text); }
.form-control, .input {
  width: 100%; min-height: 40px; padding: 8px 12px; border-radius: var(--r);
  background: var(--paper); border: 1px solid var(--line-2); color: var(--text);
  font: 400 var(--t-md)/1.4 var(--font);
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184,145,58,.18); }
.form-control::placeholder, .input::placeholder { color: var(--text-3); }
textarea.form-control, textarea.input { min-height: 90px; resize: vertical; }
select.form-control, select.input {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%23868B95' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.form-hint, .hint { font-size: var(--t-xs); color: var(--text-3); margin-top: 5px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 160px; }

/* ── tables ──────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.table th {
  text-align: left; padding: 10px 14px; background: var(--surface2); color: var(--text-2);
  font-weight: 600; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FAFAFB; }
.table .num { text-align: right; }
.table .code { font-family: var(--mono); font-size: .85em; color: var(--ink); white-space: nowrap; }

/* ── badges ──────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
  font-size: var(--t-xs); font-weight: 600; line-height: 1.6; border: 1px solid transparent; white-space: nowrap;
}
.badge-gold  { background: var(--gold-wash); color: var(--gold-text); }
.badge-green { background: var(--ok-wash);   color: var(--ok); }
.badge-red   { background: var(--bad-wash);  color: var(--bad); }
.badge-blue  { background: var(--info-wash); color: var(--info); }
.badge-warn  { background: var(--warn-wash); color: var(--warn); }
.badge-muted, .badge-purple { background: var(--surface3); color: var(--text-2); }
.badge-ink   { background: var(--ink); color: var(--gold-hi); }

/* ── flashes / alerts ────────────────────────────────────────────────── */
.flashes { display: grid; gap: 8px; margin-bottom: 18px; }
.flash, .alert {
  display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--r);
  font-size: var(--t-sm); border: 1px solid; background: var(--paper);
}
.flash-success, .alert-success { border-color: #BFDDCB; background: var(--ok-wash);  color: #135233; }
.flash-error,   .alert-error, .alert-danger { border-color: #EBC2BD; background: var(--bad-wash); color: #7A170F; }
.flash-warning, .alert-warning { border-color: #EBD3A7; background: var(--warn-wash); color: #6B3F04; }
.flash-info,    .alert-info    { border-color: #C3D3EA; background: var(--info-wash); color: #1C3F6E; }

/* ── tabs / segmented ────────────────────────────────────────────────── */
.seg { display: inline-flex; padding: 3px; background: var(--surface3); border-radius: var(--r); gap: 2px; }
.seg a, .seg button {
  border: 0; background: none; padding: 6px 12px; border-radius: 7px; cursor: pointer;
  font: 600 var(--t-sm) var(--font); color: var(--text-2); text-decoration: none;
}
.seg .is-active { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(17,18,20,.1); }

/* ── empty states ────────────────────────────────────────────────────── */
.empty { text-align: center; padding: 40px 20px; color: var(--text-2); }
.empty h3 { margin-bottom: 6px; }
.empty p { margin: 0 auto 16px; max-width: 46ch; }

/* ── dialog / drawer ─────────────────────────────────────────────────── */
dialog.sheet {
  border: 0; padding: 0; border-radius: var(--r-lg); width: min(560px, calc(100vw - 32px));
  box-shadow: var(--shadow-pop); color: var(--text);
}
dialog.sheet::backdrop { background: rgba(17,18,20,.5); }
dialog.sheet header { padding: 18px 22px 0; }
dialog.sheet .body { padding: 16px 22px; }
dialog.sheet footer { padding: 14px 22px 18px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }

/* ── toast ───────────────────────────────────────────────────────────── */
.toast-host { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: grid; gap: 8px; }
.toast {
  background: var(--ink); color: #fff; padding: 11px 16px; border-radius: var(--r);
  font-size: var(--t-sm); box-shadow: var(--shadow-pop); max-width: 360px;
  border-left: 3px solid var(--gold-hi);
}
.toast.is-bad { border-left-color: #F0776B; }
@media (max-width: 960px) { .toast-host { left: 16px; right: 16px; bottom: 76px; } }

/* ── progress ────────────────────────────────────────────────────────── */
.meter { height: 6px; border-radius: 3px; background: var(--surface3); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--gold); transition: width .3s var(--ease); }

/* ── utilities ───────────────────────────────────────────────────────── */
.muted { color: var(--text-3); } .soft { color: var(--text-2); }
.small { font-size: var(--t-sm); } .xs { font-size: var(--t-xs); }
.right { text-align: right; } .nowrap { white-space: nowrap; }
.stack > * + * { margin-top: 12px; }
.flex { display: flex; gap: 10px; align-items: center; } .flex-wrap { flex-wrap: wrap; } .grow { flex: 1; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

@media print {
  .rs-side, .rs-top, .rs-tabs, .no-print, .flashes { display: none !important; }
  .rs-main { margin: 0; padding: 0; max-width: none; }
  body { background: #fff; }
}

/* Legacy pages inside the shell: brand buttons, never neon gradients */
.rs-main .btn-primary:not(.btn-gold) { background:var(--ink) !important; background-image:none !important; color:#fff !important; border-color:var(--ink) !important; }
.rs-main .lp .back-link, .rs-main .lp a.back { color:var(--text-2) !important; }

/* ── phone fit: nothing on a signed-in page should need sideways scrolling ── */
.seg { flex-wrap: wrap; max-width: 100%; }
@media (max-width: 960px) {
  .rs-top { gap: 8px; }
  .rs-main > * { max-width: 100%; }
  .rs-main .main-content, .rs-main .container, .rs-main .profile-container, .rs-main .content-wrapper, .rs-main .page {
    width: auto !important; max-width: 100% !important; margin-left: 0 !important; margin-right: 0 !important;
  }
  .rs-main .main-content, .rs-main .container, .rs-main .profile-container { padding-left: 0 !important; padding-right: 0 !important; }
  .rs-main img, .rs-main video, .rs-main iframe, .rs-main canvas { max-width: 100%; }
  .rs-main table:not(.table) { display: block; overflow-x: auto; max-width: 100%; }
  /* tab / filter bars wrap into chips instead of running off the edge */
  .rs-main .tabs, .rs-main .tab-bar, .rs-main .nav-tabs, .rs-main .filter-tabs, .rs-main .filters, .rs-main .chips { flex-wrap: wrap !important; overflow-x: visible !important; }
}
@media (max-width: 560px) {
  .rs-next { display: none; }
  .rs-top h1 { font-size: var(--t-md); }
}
