.righaul-shell [hidden],
[hidden] {
  display: none !important;
}

body.auth-only .righaul-nav,
body.auth-only .righaul-hero,
body.auth-only #portal-panel {
  display: none !important;
}

body.auth-only .righaul-shell {
  width: min(100%, 560px);
}

.righaul-shell {
  min-height: 100%;
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 30px 22px 54px;
}

.righaul-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 24px;
}

.righaul-brand .brand-title-stack {
  min-height: 48px;
}

.righaul-brand .brand-title-back {
  font-size: 2.46rem;
}

.righaul-brand .brand-title-front {
  font-size: 2.4rem;
}

.righaul-nav {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: flex-end;
}

.righaul-nav a,
.text-action {
  color: var(--muted-strong);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.text-action {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.righaul-main {
  display: grid;
  gap: 18px;
}

.righaul-hero {
  max-width: 780px;
  padding: 14px 0 4px;
}

.righaul-kicker,
.panel-kicker {
  color: var(--gold);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .2em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.righaul-hero h1,
.panel-heading h2,
.portal-toolbar h2,
.route-section-heading h2 {
  margin: 0;
  color: var(--text);
  letter-spacing: 0;
}

.righaul-hero h1 {
  font-size: clamp(2.15rem, 6vw, 4.45rem);
  line-height: .95;
}

.righaul-hero-copy,
.muted-line {
  color: var(--muted-strong);
  line-height: 1.55;
}

.righaul-hero-copy {
  max-width: 660px;
  margin: 16px 0 0;
  font-size: 1rem;
}

.righaul-panel,
.righaul-notice {
  border: 1px solid var(--gold-border);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(7, 8, 11, .78), rgba(5, 6, 8, .7));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.045),
    0 18px 42px rgba(0,0,0,.28);
  backdrop-filter: blur(12px);
}

.righaul-panel {
  padding: 20px;
}

.righaul-notice {
  padding: 14px 16px;
  color: var(--text);
}

.righaul-notice.error {
  border-color: rgba(255, 92, 92, .48);
  color: #ffd7d7;
}

.righaul-notice.success {
  border-color: rgba(78, 214, 143, .46);
  color: #d8ffe9;
}

.panel-heading,
.route-section-heading,
.portal-toolbar,
.list-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading {
  margin-bottom: 18px;
}

.righaul-form,
.upload-form {
  display: grid;
  gap: 14px;
}

.compact-form {
  margin-bottom: 20px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted-strong);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--gold-border);
  border-radius: 12px;
  background: rgba(0,0,0,.36);
  color: var(--text);
  font: inherit;
  letter-spacing: 0;
  padding: 0 13px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--gold-border-strong);
  box-shadow: 0 0 0 3px rgba(212,168,75,.12);
}

.button-row,
.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

button {
  font: inherit;
}

.primary-action,
.ghost-action {
  min-height: 48px;
  border-radius: 12px;
  padding: 0 16px;
  font-weight: 900;
  letter-spacing: 0;
  cursor: pointer;
}

.primary-action {
  border: 1px solid rgba(255,255,255,.16);
  background: linear-gradient(180deg, #f1c765, #b9872c);
  color: #0b0b0d;
}

.ghost-action {
  border: 1px solid var(--gold-border);
  background: rgba(0,0,0,.24);
  color: var(--gold);
}

.primary-action:disabled,
.ghost-action:disabled,
.apple-signin-button:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.apple-signin-button {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid #000;
  border-radius: 9px;
  background: #000;
  color: #fff;
  cursor: pointer;
  font: 600 17px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  letter-spacing: 0;
  padding: 0 16px;
}

.apple-signin-button:hover {
  background: #111;
}

.apple-signin-button:focus-visible {
  outline: 3px solid rgba(255,255,255,.34);
  outline-offset: 3px;
}

.apple-mark {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex: 0 0 auto;
  transform: translateY(-1px);
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .16em;
  margin: 16px 0;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: var(--white-border);
}

.righaul-portal {
  display: grid;
  gap: 18px;
}

.portal-toolbar,
.organization-select-row {
  border: 1px solid var(--white-border);
  border-radius: 16px;
  padding: 16px;
  background: rgba(0,0,0,.2);
}

.workflow-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: start;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--gold-border);
  border-radius: 12px;
  padding: 4px;
  background: rgba(0,0,0,.28);
  margin-bottom: 16px;
}

.segment {
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted-strong);
  font-weight: 900;
  cursor: pointer;
}

.segment.active {
  color: #0b0b0d;
  background: linear-gradient(180deg, #efc769, #be8d34);
}

.item-list,
.route-list {
  display: grid;
  gap: 10px;
}

.job-row,
.route-card,
.selected-card {
  border: 1px solid var(--white-border);
  border-radius: 14px;
  background: rgba(0,0,0,.28);
}

.job-row {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 13px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}

.job-row.active {
  border-color: var(--gold-border-strong);
  background: rgba(212,168,75,.11);
}

.job-row strong,
.route-title {
  color: var(--text);
  font-weight: 900;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.meta-box {
  border-radius: 12px;
  background: rgba(0,0,0,.24);
  border: 1px solid var(--white-border);
  padding: 11px;
}

.meta-label {
  display: block;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.meta-value {
  display: block;
  color: var(--text);
  font-weight: 900;
  margin-top: 4px;
}

.selected-card {
  color: var(--muted-strong);
  padding: 14px;
  margin-bottom: 14px;
}

.file-drop {
  position: relative;
  min-height: 214px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 22px;
  border: 1px dashed var(--gold-border-strong);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(212,168,75,.12), rgba(212,168,75,.045));
  color: var(--gold);
  text-align: center;
  cursor: pointer;
  transition:
    border-color .18s ease,
    background .18s ease,
    box-shadow .18s ease,
    transform .18s ease;
}

.file-drop:hover,
.file-drop:focus-within,
.file-drop.drag-over {
  border-color: rgba(244, 197, 92, .82);
  background:
    linear-gradient(180deg, rgba(212,168,75,.18), rgba(212,168,75,.065));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 18px 34px rgba(0,0,0,.22);
}

.file-drop.drag-over {
  transform: translateY(-1px);
}

.file-drop.has-file {
  border-style: solid;
  border-color: rgba(78, 214, 143, .44);
  background:
    linear-gradient(180deg, rgba(78, 214, 143, .08), rgba(212,168,75,.045));
}

.file-drop input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-drop-icon {
  display: inline-grid;
  place-items: center;
  min-width: 58px;
  min-height: 36px;
  border: 1px solid var(--gold-border-strong);
  border-radius: 10px;
  color: var(--text);
  background: rgba(0,0,0,.38);
  font-size: .74rem;
  font-weight: 950;
  letter-spacing: .14em;
}

.file-drop-title {
  color: var(--gold);
  font-size: .86rem;
  font-weight: 950;
  letter-spacing: .18em;
  line-height: 1.35;
  text-transform: uppercase;
}

.file-drop-subtitle {
  color: var(--muted-strong);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.4;
  text-transform: none;
}

.pdf-preview {
  width: 100%;
  height: 260px;
  margin-top: 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: rgba(0,0,0,.5);
  pointer-events: none;
}

.route-section {
  padding: 22px;
}

.route-card {
  display: grid;
  gap: 14px;
  padding: 15px;
}

.route-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.status-pill {
  border: 1px solid var(--gold-border);
  border-radius: 999px;
  color: var(--gold);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .12em;
  padding: 7px 10px;
  text-transform: uppercase;
  white-space: nowrap;
}

.route-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.route-link-box {
  display: grid;
  gap: 8px;
  border: 1px solid var(--white-border);
  border-radius: 12px;
  background: rgba(0,0,0,.24);
  padding: 12px;
  color: var(--muted-strong);
  overflow-wrap: anywhere;
}

@media (max-width: 820px) {
  .righaul-topbar,
  .portal-toolbar,
  .route-section-heading,
  .route-card-header {
    align-items: stretch;
    flex-direction: column;
  }

  .workflow-grid,
  .button-row,
  .two-column,
  .meta-grid,
  .route-actions {
    grid-template-columns: 1fr;
  }

  .righaul-brand .brand-title-back {
    font-size: 2.02rem;
  }

  .righaul-brand .brand-title-front {
    font-size: 1.98rem;
  }
}
