/* Rescue Listings: layout for the rescue dashboard (/for-rescues/) and the owner page (/admin/).
   Loads after shell.css. The look (type, colors, buttons, cards, tags, notices) comes from the
   shared classes in shell.css; this file only arranges them and keeps long text inside the page.
   Built for a 320 px phone first: nothing here may make the page scroll sideways. Long emails,
   links, keys and error text wrap; a wide table scrolls inside its own box. */

/* Keep everything inside the page */
#rs-dashboard,
#rs-signedout,
#ad-app { min-width: 0; max-width: 100%; }
#rs-dashboard :where(p, h1, h2, h3, h4, dd, dt, li, a, span, strong, label, button),
#rs-signedout :where(p, h1, h2, h3, li, span, strong),
#ad-app :where(p, h1, h2, h3, h4, dd, dt, li, a, span, strong, label, button, td, th) {
  overflow-wrap: anywhere;
  min-width: 0;
}
#rs-dashboard :where(.rl-btn, .rl-tag),
#ad-app .rl-btn { max-width: 100%; white-space: normal; }
#rs-dashboard .rl-tag { text-align: left; }
/* Short status words stay on one line, also inside the scrolling accounts table. */
#ad-app .rl-tag { overflow-wrap: normal; }
#rs-dashboard .rl-card,
#ad-app .rl-card { min-width: 0; }
.rd-gap { margin-bottom: 16px; }
.rd-break { overflow-wrap: anywhere; word-break: break-word; }
.rd-list { list-style: none; padding: 0; display: grid; gap: 0; border-bottom: 1px solid #dce4dd; }
.rd-row > div:first-child { flex: 1 1 220px; }
.rd-row strong { display: block; }

/* Signed out: the claim banner, the steps beside the form, and the systems band */
.rd-claim { margin-bottom: 36px; padding: 30px 32px; }
.rd-claim h2 { font-size: clamp(1.9rem, 3vw, 2.6rem); }
.rd-start { padding-top: 12px; }
.rd-start .rl-pitch .rl-steps { margin-top: 0; }
.rd-start > div:last-child > .rl-card { padding: 30px; }
@media (max-width: 700px) {
  .rd-claim { padding: 24px 20px; }
  .rd-start > div:last-child > .rl-card { padding: 22px 18px; }
}
/* Arriving to claim a profile on a phone: the forms come straight after the banner. */
@media (max-width: 939px) {
  .rd-claiming .rl-pitch { order: 2; }
}
/* "Systems you can connect": the home page's warm support band (.home-support) with its row of
   topics (.home-support-topics: a hairline on top, thin rules between, a light title and text) */
.rd-systems { margin-top: 84px; }
.rd-topics { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0; border-top: 1px solid #d6dbce; border-bottom: 0; }
.rd-topics > .rl-blocked { display: block; align-items: start; padding: 28px 28px 14px 0; border-top: 0; font-size: .86rem; }
.rd-topics > .rl-blocked + .rl-blocked { padding-left: 28px; border-left: 1px solid #d6dbce; }
.rd-topics .rl-blocked strong { display: block; margin-bottom: 12px; font-size: 1.34rem; font-weight: 500; letter-spacing: -.025em; line-height: 1.22; color: #173f38; }
.rd-topics .rl-blocked .rl-muted { display: block; max-width: 35ch; font-size: .86rem; line-height: 1.7; color: #51685d; }
@media (max-width: 700px) {
  .rd-systems { margin-top: 56px; }
  .rd-topics { grid-template-columns: minmax(0, 1fr); }
  .rd-topics > .rl-blocked,
  .rd-topics > .rl-blocked + .rl-blocked { padding: 22px 0; border-left: 0; border-bottom: 1px solid #d6dbce; }
  .rd-topics .rl-blocked strong { font-size: 1.3rem; margin-bottom: 8px; }
}

/* Dashboard frame: section buttons beside (or above) the open section */
.rd-head { margin-bottom: 20px; }
.rd-head .rl-account-bar { margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid #dce4dd; font-size: .8rem; }
.rd-head .rl-kicker { margin-bottom: 14px; font-size: .72rem; font-weight: 500; letter-spacing: .11em; text-transform: uppercase; color: #64786d; }
.rd-head h2 { margin-bottom: 18px; font-size: clamp(1.9rem, 3vw, 2.75rem); line-height: 1.12; }
.rd-shell { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); align-items: start; margin-top: 22px; }
/* Section switcher: the original's page tabs (the open one filled pine, the others plain text) */
.rd-nav { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 14px; border-bottom: 1px solid #dce4dd; }
.rd-tab.rl-btn { gap: 8px; min-height: 44px; padding: 10px 16px; font-size: .86rem; font-weight: 500; }
.rd-tab.rl-btn--secondary { background: transparent; border-color: transparent; color: #173f38; }
.rd-tab.rl-btn--secondary:hover { background: #f5f8f8; border-color: transparent; text-decoration: underline; text-underline-offset: 5px; }
.rd-tab .rd-tab__count { background: #fdf4ea; border-color: #ecd3bf; color: #8a4a2f; }
@media (min-width: 960px) {
  .rd-shell { grid-template-columns: 232px minmax(0, 1fr); gap: 48px; }
  .rd-nav { flex-direction: column; flex-wrap: nowrap; gap: 4px; position: sticky; top: 16px; padding: 0; border: 0; }
  .rd-tab.rl-btn { width: 100%; justify-content: space-between; text-align: left; }
}
.rd-panel { min-width: 0; }
.rd-panel > * + * { margin-top: 18px; }
.rd-panel > h2 { font-size: clamp(2rem, 3vw, 2.6rem); line-height: 1.12; }
.rd-panel h3 { font-size: 1.4rem; }
.rd-panel h3.rd-sub { padding-top: 22px; border-top: 1px solid #dce4dd; }
.rd-panel > h2:focus,
.rd-panel h3:focus { outline: none; }
.rd-sub { margin-top: 30px !important; }

/* Connections */
.rd-conn__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin-bottom: 14px; }
.rd-conn__head h3 { font-size: 1.55rem; }
.rd-conn > * + * { margin-top: 14px; }
.rd-picker { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
/* Provider choices: the home page's pathway card (hairline card, light title, small text) */
.rd-provider {
  display: grid;
  gap: 8px;
  align-content: start;
  justify-items: start;
  width: 100%;
  padding: 22px 20px;
  border-radius: 8px;
  color: #173f38;
  text-align: left;
  line-height: 1.45;
  font-size: .84rem;
  transition: border-color 180ms, background-color 180ms;
}
button.rd-provider:hover { border-color: #9db4a5; background: #fbfcfa; }
.rd-provider[aria-pressed='true'] { border-color: var(--forest); box-shadow: 0 0 0 2px var(--forest); }
.rd-provider--off { border-style: dashed; background: transparent; }
.rd-provider__name { font-size: 1.3rem; font-weight: 500; letter-spacing: -.025em; line-height: 1.22; }
.rd-provider .rl-muted { color: #51685d; }
@media (prefers-reduced-motion: reduce) { .rd-provider { transition: none; } }
.rd-steps { padding-left: 1.25em; display: grid; gap: 6px; }
.rd-columns dl { display: grid; gap: 8px; margin-top: 6px; }
.rd-columns dt { font-weight: 600; }
.rd-columns summary { cursor: pointer; }
.rd-problems { padding-left: 1.2em; margin-top: 8px; display: grid; gap: 4px; }

/* Activity */
.rd-logrow { display: grid; gap: 4px; justify-content: stretch; }
.rd-log__top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }

/* Directory profile */
.rd-search { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); align-items: end; }
@media (min-width: 620px) {
  .rd-search { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
}

/* Owner page */
.ad-claim { display: grid; gap: 14px; }
.ad-claim__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; }
.ad-compare { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) {
  .ad-compare { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.ad-conns { list-style: none; padding: 0; display: grid; gap: 12px; }
#ad-app .rl-table-wrap { max-width: 100%; }
#ad-app .rl-table td { overflow-wrap: anywhere; }
#ad-app .rl-table__actions { white-space: normal; }
#ad-app .rl-table td .rl-btn { margin: 0 6px 6px 0; }
#ad-app .rl-table td .rl-btn + .rl-btn { margin-left: 0; }
