/* ==========================================================================
   YouRhema first-party Admin shell
   ========================================================================== */

:root {
  --yr-shell-bg: #f6f6f7;
  --yr-panel: #ffffff;
  --yr-panel-subtle: #fafafa;
  --yr-sidebar: #111216;
  --yr-sidebar-raised: #181a1f;
  --yr-sidebar-text: #f5f6f8;
  --yr-sidebar-muted: #9b9ea7;
  --yr-topbar: #111216;
  --yr-text: #18191d;
  --yr-muted: #696d76;
  --yr-border: #e2e4e9;
  --yr-border-strong: #d4d7de;
  --yr-focus: rgba(240, 78, 83, .34);
  --yr-shadow-sm: 0 1px 2px rgba(17, 18, 22, .04), 0 6px 20px rgba(17, 18, 22, .04);
  --yr-shadow-md: 0 14px 40px rgba(17, 18, 22, .08);
  --yr-radius-sm: 10px;
  --yr-radius-md: 14px;
  --yr-radius-lg: 18px;
  --yr-sidebar-width: 272px;
}

html,
body {
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

body {
  background: var(--yr-shell-bg);
  color: var(--yr-text);
}

#container {
  min-height: 100vh;
  background: var(--yr-shell-bg);
}

#header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px clamp(18px, 2.6vw, 34px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: var(--yr-topbar);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .24);
}

#branding {
  flex: 1 1 auto;
  min-width: 0;
}

#yourhema-brand a {
  gap: 11px;
  min-width: 0;
}

.yourhema-mark {
  width: 34px;
  height: 34px;
  display: block;
  flex: 0 0 34px;
  object-fit: contain;
}

.yourhema-brand-copy {
  display: inline-flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.yourhema-wordmark {
  color: #fff;
  font-size: 18px;
  font-weight: 760;
  line-height: 1.05;
  letter-spacing: -.015em;
}

.yourhema-admin-label {
  color: rgba(255, 255, 255, .58);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .11em;
  text-transform: uppercase;
}

#user-tools.yourhema-topbar-tools {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 0;
  color: #fff;
  font-size: 13px;
  letter-spacing: normal;
  text-transform: none;
}

.yourhema-staff-identity {
  display: inline-flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  padding-right: 4px;
}

.yourhema-staff-identity-label {
  color: rgba(255, 255, 255, .54);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.yourhema-staff-identity strong {
  max-width: 180px;
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yourhema-topbar-links {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
}

#user-tools .yourhema-topbar-links a,
.yourhema-logout-form button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, .86);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

#user-tools .yourhema-topbar-links a:hover,
#user-tools .yourhema-topbar-links a:focus-visible,
.yourhema-logout-form button:hover,
.yourhema-logout-form button:focus-visible {
  background: rgba(255, 255, 255, .09);
  color: #fff;
}

.yourhema-logout-form {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
}

#user-tools .theme-toggle {
  width: 34px;
  height: 34px;
  padding: 7px;
  border: 0;
  border-radius: 9px;
  background: transparent !important;
  box-shadow: none !important;
  color: rgba(255, 255, 255, .82);
}

#user-tools .theme-toggle:hover,
#user-tools .theme-toggle:focus-visible {
  background: transparent !important;
  color: #fff;
}

#user-tools .theme-toggle:focus-visible {
  outline: 2px solid rgba(255, 255, 255, .58);
  outline-offset: 2px;
}

/* Breadcrumbs now read as part of the workspace rather than the global header. */
nav[aria-label="Breadcrumbs"] {
  border-bottom: 1px solid var(--yr-border);
  background: var(--yr-panel);
}

.breadcrumbs {
  max-width: 1600px;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 11px clamp(22px, 2.8vw, 38px);
  background: transparent;
  color: var(--yr-muted);
  font-size: 12px;
}

.breadcrumbs a {
  color: var(--yr-muted);
  font-weight: 650;
}

.breadcrumbs a:hover,
.breadcrumbs a:focus-visible {
  color: var(--link-fg);
}

/* Shell layout. */
#main {
  min-height: calc(100vh - 72px);
  align-items: stretch;
  background: var(--yr-shell-bg);
}

.main > #nav-sidebar + .content,
.main.shifted > #nav-sidebar + .content {
  min-width: 0;
  max-width: none;
  flex: 1 1 auto;
}

.content {
  min-width: 0;
  background: transparent;
}

#content {
  width: auto;
  max-width: 1600px;
  margin: 0 auto;
  padding: clamp(24px, 3vw, 40px) clamp(22px, 3vw, 42px) 48px;
}

/* First-party left rail. */
#nav-sidebar.yourhema-side-rail {
  z-index: 20;
  flex: 0 0 var(--yr-sidebar-width);
  width: var(--yr-sidebar-width);
  left: calc(-1 * var(--yr-sidebar-width));
  margin-left: calc(-1 * var(--yr-sidebar-width));
  max-height: calc(100vh - 72px);
  top: 72px;
  box-sizing: border-box;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, .06);
  background: var(--yr-sidebar);
  color: var(--yr-sidebar-text);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.main.shifted > #nav-sidebar.yourhema-side-rail {
  margin-left: 0;
}

.yourhema-sidebar-toggle {
  top: 72px;
  flex: 0 0 36px;
  width: 36px;
  border: 0;
  border-right: 1px solid var(--yr-border);
  background: var(--yr-panel);
  color: var(--yr-text);
}

.yourhema-sidebar-toggle::before {
  content: "›";
  font-size: 23px;
  line-height: 1;
}

.main.shifted .yourhema-sidebar-toggle::before {
  content: "‹";
}

.yourhema-sidebar-toggle:hover,
.yourhema-sidebar-toggle:focus-visible {
  background: var(--yr-panel-subtle);
  color: var(--link-fg);
}

.yourhema-side-rail-header,
.yourhema-side-rail-filter,
.yourhema-side-rail-footer {
  padding-right: 16px;
  padding-left: 16px;
}

.yourhema-side-rail-header {
  padding-top: 18px;
  padding-bottom: 14px;
}

.yourhema-side-rail-kicker {
  display: block;
  margin: 0 0 8px;
  color: var(--yr-sidebar-muted);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.yourhema-side-rail-home {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 42px;
  box-sizing: border-box;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--yr-sidebar-text);
  font-size: 13px;
  font-weight: 720;
  text-decoration: none;
}

.yourhema-side-rail-home:hover,
.yourhema-side-rail-home:focus-visible,
.yourhema-side-rail-home.is-active {
  background: var(--yr-sidebar-raised);
  color: #fff;
  text-decoration: none;
}

.yourhema-side-rail-home.is-active {
  box-shadow: inset 3px 0 0 var(--yourhema-accent);
}

.yourhema-side-rail-filter {
  padding-top: 4px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.yourhema-side-rail-filter label {
  display: block;
  margin: 0 0 7px;
  color: var(--yr-sidebar-muted);
  font-size: 11px;
  font-weight: 650;
}

#nav-sidebar #nav-filter {
  width: 100%;
  min-height: 38px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 9px;
  outline: none;
  background: rgba(255, 255, 255, .055);
  color: #fff;
  font-size: 13px;
}

#nav-sidebar #nav-filter::placeholder {
  color: rgba(255, 255, 255, .42);
}

#nav-sidebar #nav-filter:focus {
  border-color: rgba(240, 78, 83, .78);
  box-shadow: 0 0 0 3px rgba(240, 78, 83, .16);
}

.yourhema-side-rail-apps {
  padding: 16px 10px 20px;
}

#nav-sidebar .module {
  margin: 0 0 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

#nav-sidebar .module:last-child {
  margin-bottom: 0;
}

#nav-sidebar .module caption,
#nav-sidebar .module h2 {
  padding: 0 8px 7px;
  border: 0;
  background: transparent;
  color: var(--yr-sidebar-muted);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .09em;
  text-align: left;
  text-transform: uppercase;
}

#nav-sidebar .module caption a,
#nav-sidebar .module caption a:visited {
  color: var(--yr-sidebar-muted);
}

#nav-sidebar .module table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 3px;
}

#nav-sidebar .module tr,
#nav-sidebar .module th,
#nav-sidebar .module td {
  border: 0;
  background: transparent;
}

#nav-sidebar .module th,
#nav-sidebar .module td {
  padding: 0;
}

#nav-sidebar .module th[scope="row"] a {
  display: block;
  min-height: 38px;
  box-sizing: border-box;
  padding: 9px 11px;
  border-radius: 9px;
  color: #e7e8eb;
  font-size: 12px;
  font-weight: 620;
  line-height: 1.45;
  text-decoration: none;
}

#nav-sidebar .module th[scope="row"] a:hover,
#nav-sidebar .module th[scope="row"] a:focus-visible {
  background: var(--yr-sidebar-raised);
  color: #fff;
}

#nav-sidebar .module .current-model th[scope="row"] a {
  background: rgba(240, 78, 83, .15);
  box-shadow: inset 3px 0 0 var(--yourhema-accent);
  color: #fff;
  font-weight: 720;
}

#nav-sidebar .current-app .section:link,
#nav-sidebar .current-app .section:visited {
  color: #fff;
}

.yourhema-side-rail-footer {
  margin-top: auto;
  padding-top: 16px;
  padding-bottom: 22px;
  border-top: 1px solid rgba(255, 255, 255, .07);
}

.yourhema-side-rail-footer a {
  display: block;
  padding: 9px 11px;
  border-radius: 9px;
  color: #e7e8eb;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.yourhema-side-rail-footer a:hover,
.yourhema-side-rail-footer a:focus-visible {
  background: var(--yr-sidebar-raised);
  color: #fff;
}

/* Page titles and controls. */
.titles-and-tools {
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}

.titles-and-tools .titles {
  min-width: 0;
}

.titles-and-tools h1,
#content > h1 {
  margin: 0;
  color: var(--yr-text);
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 760;
  line-height: 1.15;
  letter-spacing: -.025em;
}

.titles-and-tools h2 {
  margin-top: 6px;
  color: var(--yr-muted);
  font-size: 14px;
  font-weight: 520;
}

.object-tools {
  margin: 0;
}

.object-tools a:link,
.object-tools a:visited,
.button,
input[type="submit"],
input[type="button"],
.submit-row input,
a.button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 8px 13px;
  border-radius: 9px;
  box-shadow: none;
  font-weight: 700;
  line-height: 1.2;
}

.object-tools a:link,
.object-tools a:visited,
.button.default,
input[type="submit"].default,
.submit-row input.default {
  background: var(--button-bg);
}

.object-tools a:hover,
.object-tools a:focus-visible,
.button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  filter: brightness(.96);
}

/* Dashboard. */
.dashboard #content {
  width: 100%;
  max-width: 1040px;
  box-sizing: border-box;
}

.dashboard #content-related {
  float: none;
  position: static;
  width: 100%;
  max-width: 1040px;
  box-sizing: border-box;
  margin: 0 auto 48px;
  padding: 0 clamp(22px, 3vw, 42px);
}

.dashboard #recent-actions-module {
  width: min(100%, 640px);
  box-sizing: border-box;
  margin: 0 auto;
}

.dashboard #recent-actions-module h2 {
  margin: 0;
}

.yourhema-admin-hero {
  align-items: center;
  margin-bottom: 32px;
  padding: clamp(24px, 3vw, 36px);
  border: 1px solid var(--yr-border);
  border-radius: 22px;
  background: var(--yr-panel);
  box-shadow: var(--yr-shadow-sm);
}

.yourhema-admin-hero h1 {
  margin-top: 5px;
  font-size: clamp(32px, 4.5vw, 46px);
  font-weight: 780;
}

.yourhema-admin-hero-copy {
  max-width: 760px;
  color: var(--yr-muted);
  font-size: 15px;
}

.yourhema-dashboard-section,
.yourhema-admin-modules {
  margin-bottom: 34px;
}

.yourhema-section-heading {
  align-items: center;
  margin-bottom: 14px;
}

.yourhema-section-heading h2 {
  margin-top: 4px;
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -.015em;
}

.yourhema-section-count {
  padding: 5px 9px;
  border: 1px solid var(--yr-border);
  border-radius: 999px;
  background: var(--yr-panel);
  color: var(--yr-muted);
  font-size: 11px;
  font-weight: 680;
}

.yourhema-ops-cards {
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 16px;
}

.yourhema-ops-card {
  min-height: 154px;
  padding: 20px;
  border: 1px solid var(--yr-border);
  border-radius: 17px;
  background: var(--yr-panel);
  box-shadow: var(--yr-shadow-sm);
}

a.yourhema-ops-card,
a.yourhema-ops-card:link,
a.yourhema-ops-card:visited,
a.yourhema-ops-card:hover,
a.yourhema-ops-card:focus-visible {
  color: var(--yr-text);
  text-decoration: none;
}

.yourhema-ops-card:hover {
  border-color: var(--yr-border-strong);
  box-shadow: var(--yr-shadow-md);
}

.yourhema-ops-count {
  color: var(--yr-text);
  font-size: 34px;
  font-weight: 790;
}

.yourhema-ops-card--attention .yourhema-ops-count {
  color: #9f2228;
}

.yourhema-ops-card--security .yourhema-ops-count {
  color: #6d3e8e;
}

.yourhema-ops-label {
  font-size: 14px;
  font-weight: 760;
}

.yourhema-ops-description {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
}

.yourhema-all-clear {
  border: 1px solid var(--yr-border);
  background: var(--yr-panel);
  box-shadow: var(--yr-shadow-sm);
}

/* Permission-aware model navigation on the landing page. */
.yourhema-admin-app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 16px;
}

.yourhema-admin-app-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--yr-border);
  border-radius: 16px;
  background: var(--yr-panel);
  box-shadow: var(--yr-shadow-sm);
}

.yourhema-admin-app-card-heading {
  padding: 15px 16px 12px;
  border-bottom: 1px solid var(--yr-border);
  background: var(--yr-panel-subtle);
}

.yourhema-admin-app-card h3 {
  margin: 0;
  color: var(--yr-text);
  font-size: 13px;
  font-weight: 780;
  letter-spacing: .01em;
}

.yourhema-admin-app-card ul {
  margin: 0;
  padding: 6px;
  list-style: none;
}

.yourhema-admin-app-card li {
  margin: 0;
}

.yourhema-admin-app-card li + li {
  border-top: 1px solid var(--yr-border);
}

.yourhema-admin-app-card li a,
.yourhema-admin-app-disabled {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-sizing: border-box;
  padding: 10px 11px;
  border-radius: 9px;
  color: var(--yr-text);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.yourhema-admin-app-card li a:hover,
.yourhema-admin-app-card li a:focus-visible {
  background: rgba(240, 78, 83, .07);
  color: var(--link-fg);
}

.yourhema-admin-app-disabled {
  color: var(--yr-muted);
}

/* Changelists and filters. */
#changelist {
  min-width: 0;
}

#changelist .changelist-form-container {
  min-width: 0;
}

#changelist .results,
#changelist-filter,
fieldset.module,
.inline-group,
.submit-row,
#changelist .actions {
  border-color: var(--yr-border);
  background: var(--yr-panel);
  box-shadow: var(--yr-shadow-sm);
}

#changelist .results {
  border-radius: var(--yr-radius-md);
}

#changelist table {
  min-width: 760px;
  background: var(--yr-panel);
}

#changelist table thead th {
  padding-top: 11px;
  padding-bottom: 11px;
  border-bottom-color: var(--yr-border);
  background: var(--yr-panel-subtle);
  color: var(--yr-muted);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .025em;
}

#changelist table tbody td,
#changelist table tbody th {
  padding-top: 12px;
  padding-bottom: 12px;
  border-bottom-color: var(--yr-border);
}

#changelist table tbody tr:hover {
  background: rgba(240, 78, 83, .025);
}

#changelist-filter {
  border-radius: var(--yr-radius-md);
  overflow: hidden;
}

#changelist-filter h2 {
  margin: 0;
  padding: 13px 14px;
  border-bottom-color: var(--yr-border);
  background: var(--yr-panel-subtle);
  color: var(--yr-text);
  font-size: 12px;
  font-weight: 760;
}

#changelist-filter h3 {
  padding-right: 14px;
  padding-left: 14px;
  color: var(--yr-muted);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .04em;
  text-transform: uppercase;
}

#changelist-filter ul {
  padding-right: 8px;
  padding-left: 8px;
}

#changelist-filter li a {
  display: block;
  padding: 6px 7px;
  border-radius: 7px;
}

#changelist-filter li.selected a,
#changelist-filter li a:hover {
  background: rgba(240, 78, 83, .07);
}

#changelist .actions {
  margin-bottom: 12px;
  border-radius: var(--yr-radius-sm);
}

#toolbar {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--yr-border);
  border-radius: var(--yr-radius-sm);
  background: var(--yr-panel);
}

#toolbar form input[type="text"] {
  min-height: 38px;
}

/* Forms. */
fieldset.module {
  margin-bottom: 18px;
  border-radius: var(--yr-radius-md);
  overflow: hidden;
}

.module h2,
.module caption,
.inline-group h2 {
  padding: 12px 15px;
  border-bottom: 1px solid var(--yr-border);
  background: var(--yr-panel-subtle);
  color: var(--yr-text);
  font-size: 12px;
  font-weight: 780;
}

fieldset.module .form-row {
  padding: 15px 17px;
  border-bottom-color: var(--yr-border);
}

fieldset.module .form-row:last-child {
  border-bottom: 0;
}

.aligned label {
  color: var(--yr-text);
  font-weight: 690;
}

input,
textarea,
select {
  border-color: var(--yr-border-strong);
  border-radius: 9px;
  background: var(--yr-panel);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--yourhema-accent-deep);
  box-shadow: 0 0 0 3px var(--yr-focus);
  outline: 0;
}

.submit-row {
  position: sticky;
  bottom: 10px;
  z-index: 8;
  margin-top: 22px;
  padding: 12px;
  border-radius: var(--yr-radius-md);
  box-shadow: 0 10px 30px rgba(17, 18, 22, .10);
}

.errornote,
ul.errorlist {
  border-radius: 9px;
}

.messagelist li {
  border: 1px solid var(--yr-border);
  background-color: var(--yr-panel);
  box-shadow: var(--yr-shadow-sm);
}

/* Security/self-service cards belong to the same shell. */
.yourhema-security-shell {
  padding-top: 0;
}

.yourhema-security-card {
  border-color: var(--yr-border);
  background: var(--yr-panel);
  box-shadow: var(--yr-shadow-md);
}

.yourhema-account-boundary,
.yourhema-recovery-status,
.yourhema-confirm-list > div,
.yourhema-recovery-code-list code {
  border-color: var(--yr-border);
  background: var(--yr-panel-subtle);
}

/* Login becomes a separate branded staff entry point. */
.yourhema-admin-login {
  background:
    radial-gradient(circle at 15% 12%, rgba(240, 78, 83, .12), transparent 26%),
    #101115;
}

.yourhema-admin-login #container {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.yourhema-admin-login #header {
  position: static;
  min-height: 70px;
  background: transparent;
  border-bottom: 0;
  box-shadow: none;
}

.yourhema-admin-login .content {
  display: grid;
  flex: 1 1 auto;
  place-items: center;
}

.yourhema-admin-login #content {
  width: min(1120px, calc(100% - 36px));
  max-width: none;
  padding: 32px 0 56px;
}

.yourhema-login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 24px;
  background: rgba(255, 255, 255, .04);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .34);
}

.yourhema-login-intro {
  display: flex;
  min-height: 470px;
  flex-direction: column;
  justify-content: center;
  padding: clamp(34px, 6vw, 70px);
  background:
    linear-gradient(145deg, rgba(240, 78, 83, .16), transparent 56%),
    rgba(255, 255, 255, .025);
}

.yourhema-login-intro h1 {
  max-width: 560px;
  margin: 7px 0 16px;
  color: #fff;
  font-size: clamp(38px, 5vw, 58px);
  font-weight: 780;
  line-height: 1.02;
  letter-spacing: -.04em;
}

.yourhema-login-intro > p:not(.yourhema-eyebrow) {
  max-width: 560px;
  margin: 0;
  color: rgba(255, 255, 255, .68);
  font-size: 15px;
  line-height: 1.65;
}

.yourhema-login-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.yourhema-login-trust span {
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  color: rgba(255, 255, 255, .78);
  font-size: 11px;
  font-weight: 680;
}

.yourhema-login-panel {
  align-self: stretch;
  padding: clamp(34px, 5vw, 58px);
  background: #fff;
}

.yourhema-login-panel h2 {
  margin: 5px 0 9px;
  color: #18191d;
  font-size: 30px;
  font-weight: 770;
  letter-spacing: -.025em;
}

.yourhema-login-panel-copy {
  margin: 0 0 26px;
  color: #6b6e76;
  font-size: 13px;
  line-height: 1.55;
}

.yourhema-login-panel #login-form {
  margin-top: 20px;
}

.yourhema-login-panel #login-form .form-row {
  padding: 0 0 18px;
}

.yourhema-login-panel #login-form .form-row label {
  display: block;
  margin-bottom: 7px;
  color: #25262b;
  font-size: 12px;
  font-weight: 720;
}

.yourhema-login-panel #login-form input[type="text"],
.yourhema-login-panel #login-form input[type="password"] {
  width: 100%;
  min-height: 48px;
  box-sizing: border-box;
  padding: 11px 12px;
  border: 1px solid #d7dae0;
  border-radius: 10px;
  background: #fff;
  color: #18191d;
  font-size: 15px;
}

.yourhema-login-panel .submit-row {
  position: static;
  margin: 22px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.yourhema-login-panel .submit-row input {
  width: 100%;
  min-height: 48px;
  border-radius: 10px;
  background: #a92a30;
  font-size: 14px;
}

.yourhema-login-panel .password-reset-link {
  margin: -2px 0 0;
  text-align: left;
}

.yourhema-login-panel .password-reset-link a {
  font-size: 12px;
  font-weight: 650;
}

/* Dark mode. */
html[data-theme="dark"] {
  --yr-shell-bg: #171717;
  --yr-panel: #202020;
  --yr-panel-subtle: #262626;
  --yr-text: #f4f4f5;
  --yr-muted: #a8a8ad;
  --yr-border: #343434;
  --yr-border-strong: #464646;
}

html[data-theme="dark"] body,
html[data-theme="dark"] #container,
html[data-theme="dark"] #main {
  background: var(--yr-shell-bg);
}

html[data-theme="dark"] nav[aria-label="Breadcrumbs"],
html[data-theme="dark"] .yourhema-admin-hero,
html[data-theme="dark"] .yourhema-all-clear,
html[data-theme="dark"] .yourhema-ops-card,
html[data-theme="dark"] .yourhema-admin-app-card,
html[data-theme="dark"] #changelist .results,
html[data-theme="dark"] #changelist-filter,
html[data-theme="dark"] #changelist .actions,
html[data-theme="dark"] #toolbar,
html[data-theme="dark"] fieldset.module,
html[data-theme="dark"] .inline-group,
html[data-theme="dark"] .submit-row,
html[data-theme="dark"] .yourhema-security-card {
  background: var(--yr-panel);
  border-color: var(--yr-border);
}

html[data-theme="dark"] .yourhema-admin-app-card-heading,
html[data-theme="dark"] #changelist table thead th,
html[data-theme="dark"] #changelist-filter h2,
html[data-theme="dark"] .module h2,
html[data-theme="dark"] .module caption,
html[data-theme="dark"] .inline-group h2,
html[data-theme="dark"] .yourhema-account-boundary,
html[data-theme="dark"] .yourhema-recovery-status,
html[data-theme="dark"] .yourhema-confirm-list > div,
html[data-theme="dark"] .yourhema-recovery-code-list code {
  background: var(--yr-panel-subtle);
  border-color: var(--yr-border);
}

html[data-theme="dark"] #changelist table,
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  background: var(--yr-panel);
  color: var(--yr-text);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"],
  html:not([data-theme]) {
    --yr-shell-bg: #171717;
    --yr-panel: #202020;
    --yr-panel-subtle: #262626;
    --yr-text: #f4f4f5;
    --yr-muted: #a8a8ad;
    --yr-border: #343434;
    --yr-border-strong: #464646;
  }

  html[data-theme="auto"] body,
  html:not([data-theme]) body,
  html[data-theme="auto"] #container,
  html:not([data-theme]) #container,
  html[data-theme="auto"] #main,
  html:not([data-theme]) #main {
    background: var(--yr-shell-bg);
  }
}

/* Tablet. */
/* Tablet and mobile use the same compact shell: the navigation rail becomes a
   drawer, its toggle sits in the header immediately before the brand, and only
   theme/logout actions remain at the right edge. */
@media (max-width: 1024px) {
  :root {
    --yr-sidebar-width: 300px;
  }

  #header {
    position: sticky;
    min-height: 68px;
    gap: 12px;
    flex-wrap: nowrap;
    padding: 10px 14px 10px 60px;
  }

  #branding {
    flex: 1 1 auto;
    min-width: 0;
  }

  #yourhema-brand a {
    max-width: 100%;
  }

  .yourhema-staff-identity,
  .yourhema-topbar-links {
    display: none;
  }

  #user-tools.yourhema-topbar-tools {
    flex: 0 0 auto;
    gap: 4px;
    margin-left: auto;
  }

  #user-tools .theme-toggle {
    width: 34px;
    height: 34px;
    padding: 6px;
  }

  .yourhema-logout-form button {
    min-height: 34px;
    padding: 7px 9px;
  }

  #toggle-nav-sidebar.yourhema-sidebar-toggle {
    position: fixed;
    top: 16px;
    left: 14px;
    z-index: 70;
    display: flex !important;
    width: 32px;
    height: 36px;
    flex: 0 0 32px;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    box-shadow: none;
    color: rgba(255, 255, 255, .88);
  }

  #toggle-nav-sidebar.yourhema-sidebar-toggle:hover {
    background: transparent;
    color: #fff;
  }

  #toggle-nav-sidebar.yourhema-sidebar-toggle:focus-visible {
    outline: 2px solid rgba(255, 255, 255, .58);
    outline-offset: 2px;
  }

  .yourhema-sidebar-toggle::before {
    content: "☰";
    font-size: 17px;
    line-height: 1;
  }

  .main.shifted .yourhema-sidebar-toggle::before {
    content: "×";
    font-size: 22px;
  }

  #main {
    min-height: calc(100vh - 68px);
  }

  #nav-sidebar.yourhema-side-rail {
    position: fixed;
    top: 68px;
    bottom: 0;
    left: 0;
    z-index: 60;
    display: block !important;
    width: min(84vw, 320px);
    max-height: calc(100vh - 68px);
    margin: 0;
    visibility: visible;
    transform: translateX(-105%);
    transition: transform .18s ease;
    box-shadow: 18px 0 48px rgba(0, 0, 0, .28);
  }

  .main.shifted > #nav-sidebar.yourhema-side-rail {
    margin: 0;
    transform: translateX(0);
  }

  .main > #nav-sidebar + .content,
  .main.shifted > #nav-sidebar + .content {
    width: 100%;
    max-width: 100%;
  }

  .main.shifted::after {
    content: "";
    position: fixed;
    top: 68px;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 55;
    background: rgba(10, 10, 10, .40);
    pointer-events: none;
  }

  .yourhema-side-rail-header {
    padding-top: 18px;
  }

  #content {
    padding-right: 22px;
    padding-left: 22px;
  }

  .dashboard #content-related {
    padding-right: 22px;
    padding-left: 22px;
  }

  .yourhema-login-shell {
    grid-template-columns: minmax(0, .9fr) minmax(340px, 1.1fr);
  }

  .yourhema-admin-login #header {
    padding-right: 18px;
    padding-left: 18px;
  }
}

@media (max-width: 767px) {
  #header {
    min-height: 64px;
    padding: 8px 10px 8px 54px;
  }

  .yourhema-wordmark {
    font-size: 16px;
  }

  .yourhema-admin-label {
    font-size: 9px;
  }

  #user-tools.yourhema-topbar-tools {
    gap: 2px;
  }

  #user-tools .theme-toggle {
    width: 32px;
    height: 32px;
    padding: 5px;
  }

  .yourhema-logout-form button {
    min-height: 32px;
    padding: 6px 7px;
    font-size: 11px;
  }

  #toggle-nav-sidebar.yourhema-sidebar-toggle {
    top: 14px;
    left: 10px;
    width: 30px;
    height: 36px;
  }

  #main {
    min-height: calc(100vh - 64px);
  }

  #nav-sidebar.yourhema-side-rail {
    top: 64px;
    width: min(88vw, 310px);
    max-height: calc(100vh - 64px);
  }

  .main.shifted::after {
    top: 64px;
  }

  nav[aria-label="Breadcrumbs"] {
    min-height: 42px;
  }

  .breadcrumbs {
    padding: 10px 14px;
    white-space: nowrap;
    overflow-x: auto;
  }

  #content {
    padding: 20px 14px 34px;
  }

  .dashboard #content-related {
    margin-bottom: 34px;
    padding-right: 14px;
    padding-left: 14px;
  }

  .titles-and-tools {
    align-items: flex-start;
    flex-direction: column;
  }

  .object-tools {
    width: 100%;
  }

  .object-tools li {
    flex: 1 1 auto;
  }

  .object-tools a:link,
  .object-tools a:visited {
    width: 100%;
    text-align: center;
  }

  .yourhema-admin-hero {
    padding: 22px 18px;
    border-radius: 16px;
  }

  .yourhema-admin-hero h1 {
    font-size: 31px;
  }

  .yourhema-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .yourhema-ops-cards,
  .yourhema-admin-app-grid {
    grid-template-columns: 1fr;
  }

  #changelist table {
    min-width: 680px;
  }

  fieldset.module .form-row {
    padding: 14px;
  }

  .submit-row {
    position: static;
    box-shadow: var(--yr-shadow-sm);
  }

  .yourhema-admin-login #header {
    min-height: 64px;
    padding: 8px 14px;
  }

  .yourhema-admin-login #content {
    width: min(100% - 24px, 620px);
    padding-top: 18px;
  }

  .yourhema-login-shell {
    grid-template-columns: 1fr;
    border-radius: 18px;
  }

  .yourhema-login-intro {
    min-height: auto;
    padding: 30px 24px;
  }

  .yourhema-login-intro h1 {
    font-size: 34px;
  }

  .yourhema-login-trust {
    margin-top: 18px;
  }

  .yourhema-login-panel {
    padding: 30px 24px 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #nav-sidebar.yourhema-side-rail {
    transition: none;
  }
}
