/* Mobile primitive layer.
 * This stays separate from desktop primitives and sets the baseline for:
 * - auth shell pages
 * - staff mobile dashboard shell
 * - shared mobile typography/controls
 *
 * Later phases should move page-specific `staff-*` and `app-auth-*` styling
 * toward this layer rather than inventing new component families.
 */
.portal-shell.app-auth-body,
.portal-shell.staff-theme {
  background: var(--ui-surface);
  color: var(--ui-text);
}

.portal-shell.app-auth-body :where(.app-auth-card-title),
.portal-shell.staff-theme :where(.staff-home-title, .staff-screen-title) {
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ui-text);
}

.portal-shell.applicant-theme :where(.app-mobile-topbar-title) {
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--mobile-topbar-ink);
}

.portal-shell.app-auth-body :where(.app-auth-card-copy),
.portal-shell.staff-theme :where(.staff-screen-subtitle, .staff-home-subtitle, .staff-copy-body, .staff-home-stat-meta) {
  color: var(--ui-text-muted);
}

.portal-shell.app-auth-body :where(.app-auth-field-label, .app-auth-card-kicker),
.portal-shell.staff-theme :where(.staff-screen-eyebrow, .staff-section-kicker, .staff-home-date-label, .staff-home-stat-label, .staff-field label) {
  font-size: var(--ui-size-small);
  line-height: var(--ui-line-small);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ui-text-muted) 94%, white 6%);
}

.portal-shell.app-auth-body :where(.app-auth-input),
.portal-shell.staff-theme :where(.staff-input, .staff-select, .staff-textarea) {
  border-radius: var(--ui-radius-control);
  border-color: var(--ui-border);
  background: var(--ui-surface);
  color: var(--ui-text);
  min-height: var(--ui-height-control);
}

.portal-shell.staff-theme :where(.staff-btn.primary, .staff-hours-toggle, .staff-rota-open-btn.accept),
.portal-shell.app-auth-body :where(.app-auth-primary) {
  border-color: var(--ui-btn-primary-border);
  background: var(--ui-btn-primary-bg);
  color: var(--ui-btn-primary-ink);
}

.portal-shell.staff-theme :where(.staff-btn.secondary, .staff-rota-open-btn.reject),
.portal-shell.app-auth-body :where(.app-auth-secondary) {
  border-color: var(--ui-btn-secondary-border);
  background: var(--ui-btn-secondary-bg);
  color: var(--ui-btn-secondary-ink);
}

.portal-shell.staff-theme :where(.staff-card-kicker, .staff-screen-eyebrow, .staff-section-kicker, .staff-home-date-label, .staff-home-stat-label, .staff-field label) {
  font-size: var(--ui-size-small);
  line-height: var(--ui-line-small);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ui-text-muted) 94%, white 6%);
}

.portal-shell.applicant-theme :where(.app-mobile-topbar-meta) {
  font-size: var(--ui-size-small);
  line-height: var(--ui-line-small);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mobile-topbar-muted);
}

.portal-shell.staff-theme :where(.staff-panel-title, .staff-home-section-title, .staff-screen-title) {
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ui-text);
}

.portal-shell.staff-theme :where(.staff-topbar-action) {
  border-radius: var(--ui-radius-control);
}

.portal-shell.staff-theme :where(.staff-topbar-meta) {
  font-size: var(--ui-size-small);
  line-height: var(--ui-line-small);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mobile-topbar-muted);
}

.portal-shell.staff-theme :where(.staff-topbar-title) {
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--mobile-topbar-ink);
}

.portal-shell.applicant-theme :where(.app-mobile-topbar-action) {
  border-radius: var(--ui-radius-control);
}

.portal-shell.applicant-theme {
  background: var(--ui-surface);
  color: var(--ui-text);
}

.portal-shell.applicant-theme :where(.app-mobile-topbar) {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--mobile-topbar-border);
  background: var(--mobile-bottom-nav-bg);
  color: var(--mobile-topbar-ink);
  border-radius: 0 0 20px 20px;
  overflow: hidden;
}

.portal-shell.applicant-theme :where(.app-mobile-topbar-inner) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: calc(0.8rem + env(safe-area-inset-top, 0px)) 1rem 0.9rem;
}

.portal-shell.applicant-theme :where(.app-mobile-topbar-copy) {
  min-width: 0;
}

.portal-shell.applicant-theme :where(.app-mobile-topbar-title) {
  margin: 0.2rem 0 0;
  font-size: 1.18rem;
  line-height: 1.16;
  font-weight: 700;
  color: var(--mobile-topbar-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-shell.applicant-theme :where(.app-mobile-topbar-subtitle) {
  margin: 0.26rem 0 0;
  font-size: var(--ui-size-small);
  line-height: var(--ui-line-small);
  color: var(--mobile-topbar-muted);
}

.portal-shell.applicant-theme :where(.app-mobile-topbar-action) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid color-mix(in srgb, white 22%, transparent);
  background: var(--mobile-topbar-surface);
  color: var(--mobile-topbar-ink);
  font-size: var(--ui-size-small);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  box-shadow: none;
  backdrop-filter: blur(10px);
}

.portal-shell.applicant-theme :where(.app-mobile-topbar-action:hover) {
  background: color-mix(in srgb, white 18%, transparent);
  color: var(--mobile-topbar-ink);
}

.portal-shell.applicant-theme :where(.app-mobile-main) {
  background: var(--ui-bg);
  min-height: calc(100dvh - 74px);
  padding-bottom: 0.35rem;
}

.portal-shell.applicant-theme :where(.app-mobile-wrap) {
  width: min(100%, 32rem);
  margin-inline: auto;
  padding-inline: 0.9rem;
}

.portal-shell.applicant-theme :where(.app-mobile-stack) {
  display: grid;
  gap: 12px;
  padding-top: 10px;
}

.portal-shell.applicant-theme :where(.app-mobile-card, .app-mobile-card-muted) {
  position: relative;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-panel);
  background: var(--mobile-card-fill);
  box-shadow: none;
  overflow: hidden;
  padding: 13px;
}

.portal-shell.applicant-theme :where(.app-mobile-card-muted) {
  background: var(--mobile-card-fill-muted);
}

.portal-shell.applicant-theme :where(.app-mobile-card, .app-mobile-card-muted)::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: var(--mobile-card-topline);
  background: var(--mobile-card-accent);
}

.portal-shell.applicant-theme :where(.app-mobile-card-stack) {
  display: grid;
  gap: 12px;
}

.portal-shell.applicant-theme :where(.app-mobile-card-stack-sm) {
  display: grid;
  gap: 6px;
}

.portal-shell.applicant-theme :where(.app-mobile-row-between) {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.portal-shell.applicant-theme :where(.app-mobile-row-copy) {
  min-width: 0;
}

.portal-shell.applicant-theme :where(.app-mobile-meta) {
  font-size: var(--ui-size-small);
  line-height: var(--ui-line-small);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ui-text-muted) 94%, white 6%);
}

.portal-shell.applicant-theme :where(.app-mobile-card-title, .app-mobile-link-title) {
  font-size: var(--ui-size-section);
  line-height: var(--ui-line-section);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ui-text);
}

.portal-shell.applicant-theme :where(.app-mobile-copy, .app-mobile-progress-copy) {
  font-size: var(--ui-size-body);
  line-height: var(--ui-line-body);
  color: var(--ui-text-muted);
}

.portal-shell.applicant-theme :where(.app-mobile-copy-small) {
  font-size: var(--ui-size-small);
  line-height: var(--ui-line-small);
  color: var(--ui-text-muted);
}

.portal-shell.applicant-theme :where(.app-mobile-status-pill) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--ui-border);
  background: var(--ui-surface-muted);
  color: var(--ui-text-muted);
  font-size: var(--ui-size-small);
  line-height: 1;
  font-weight: 700;
  text-transform: capitalize;
  white-space: nowrap;
}

.portal-shell.applicant-theme :where(.app-mobile-status-pill[data-tone="info"]) {
  border-color: color-mix(in srgb, var(--ui-accent) 28%, white 72%);
  background: var(--ui-accent-soft);
  color: var(--ui-accent-ink);
}

.portal-shell.applicant-theme :where(.app-mobile-status-pill[data-tone="warning"]) {
  border-color: color-mix(in srgb, var(--ui-warning) 28%, white 72%);
  background: var(--ui-warning-bg);
  color: var(--ui-warning);
}

.portal-shell.applicant-theme :where(.app-mobile-status-pill[data-tone="success"]) {
  border-color: color-mix(in srgb, var(--ui-success) 28%, white 72%);
  background: var(--ui-success-bg);
  color: var(--ui-success);
}

.portal-shell.applicant-theme :where(.app-mobile-status-pill[data-tone="danger"]) {
  border-color: color-mix(in srgb, var(--ui-danger) 28%, white 72%);
  background: var(--ui-danger-bg);
  color: var(--ui-danger);
}

.portal-shell.applicant-theme :where(.app-mobile-status-pill[data-tone="neutral"]) {
  border-color: var(--ui-border);
  background: var(--ui-surface-muted);
  color: var(--ui-text-muted);
}

.portal-shell.applicant-theme :where(.app-mobile-progress) {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.portal-shell.applicant-theme :where(.app-mobile-progress-head) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--ui-size-small);
  line-height: var(--ui-line-small);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ui-text-muted) 94%, white 6%);
}

.portal-shell.applicant-theme :where(.app-mobile-progress-track) {
  height: 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ui-border) 70%, white 30%);
  overflow: hidden;
}

.portal-shell.applicant-theme :where(.app-mobile-progress-bar) {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ui-primary) 0%, var(--ui-accent) 100%);
}

.portal-shell.applicant-theme :where(.app-mobile-actions) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.portal-shell.applicant-theme :where(.app-mobile-btn) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: var(--ui-height-control);
  font-size: var(--ui-size-body);
  font-weight: 600;
  line-height: 1;
  padding: 0 14px;
  border-radius: var(--ui-radius-control);
  border: 1px solid var(--ui-border);
  text-decoration: none;
  box-shadow: none;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.portal-shell.applicant-theme :where(.app-mobile-btn-primary) {
  border-color: var(--ui-btn-primary-border);
  background: var(--ui-btn-primary-bg);
  color: var(--ui-btn-primary-ink);
}

.portal-shell.applicant-theme :where(.app-mobile-btn-primary:hover) {
  border-color: var(--ui-btn-primary-bg-hover);
  background: var(--ui-btn-primary-bg-hover);
  color: var(--ui-btn-primary-ink);
}

.portal-shell.applicant-theme :where(.app-mobile-btn-secondary) {
  border-color: var(--ui-btn-secondary-border);
  background: var(--ui-btn-secondary-bg);
  color: var(--ui-btn-secondary-ink);
}

.portal-shell.applicant-theme :where(.app-mobile-btn-secondary:hover) {
  border-color: var(--ui-btn-secondary-border-hover);
  background: var(--ui-btn-secondary-bg-hover);
  color: var(--ui-btn-secondary-ink);
}

.portal-shell.applicant-theme :where(.app-mobile-list) {
  display: grid;
  gap: 8px;
}

.portal-shell.applicant-theme :where(.app-mobile-link-card, .app-mobile-history-card) {
  display: grid;
  gap: 6px;
  padding: 14px;
}

.portal-shell.applicant-theme :where(.app-mobile-link-card) {
  text-decoration: none;
}

.portal-shell.applicant-theme :where(.app-mobile-link-card:hover) {
  border-color: color-mix(in srgb, var(--ui-accent) 34%, white 66%);
}

.portal-shell.applicant-theme :where(.app-mobile-link-card .app-mobile-link-title) {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ui-text);
}

.portal-shell.applicant-theme :where(.app-mobile-empty-card) {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.portal-shell.applicant-theme :where(.app-mobile-empty-actions) {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.portal-shell.applicant-theme :where(.app-mobile-btn-icon, .app-mobile-link-icon) {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

@media (max-width: 360px) {
  .portal-shell.applicant-theme :where(.app-mobile-actions) {
    grid-template-columns: minmax(0, 1fr);
  }
}
