:root {
  --rp-bg: #f6f7f9;
  --rp-surface: #ffffff;
  --rp-surface-soft: #eef4f7;
  --rp-ink: #16202a;
  --rp-text: #27313c;
  --rp-muted: #66717e;
  --rp-line: #dce3e8;
  --rp-line-strong: #c7d1d8;
  --rp-cyan: #00a8d7;
  --rp-magenta: #d8246a;
  --rp-gold: #c9982f;
  --rp-green: #1d8f64;
  --rp-red: #bc3342;
  --rp-blue: #3267d6;
  --rp-purple: #5b3d87;
  --rp-shadow: 0 20px 56px rgba(22, 32, 42, 0.12);
  --rp-radius: 8px;
  --rp-control: 36px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--rp-bg);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--rp-text);
  background:
    linear-gradient(180deg, rgba(0, 168, 215, 0.05), transparent 260px),
    var(--rp-bg);
  font-family: Inter, Arial, Helvetica, "Noto Sans TC", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.rp-auth-page,
.rp-shell {
  min-height: 100vh;
}

.rp-auth-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.96), rgba(246, 247, 249, 0.86)),
    url("../cih/hero-kv.png") center / cover no-repeat;
}

.rp-auth-brief {
  display: grid;
  align-content: end;
  min-height: 100vh;
  padding: clamp(32px, 6vw, 84px);
  color: var(--rp-ink);
}

.rp-brand {
  display: inline-grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  max-width: 520px;
  text-decoration: none;
}

.rp-brand img {
  width: 44px;
  height: 54px;
  object-fit: contain;
}

.rp-brand strong {
  display: block;
  color: var(--rp-ink);
  font-size: 15px;
  line-height: 1.1;
}

.rp-brand span span,
.rp-brand small {
  display: block;
  margin-top: 3px;
  color: var(--rp-muted);
  font-size: 12px;
  line-height: 1.3;
}

.rp-auth-brief h1 {
  max-width: 680px;
  margin: 42px 0 18px;
  color: var(--rp-ink);
  font-size: clamp(38px, 5.8vw, 76px);
  line-height: 0.98;
  font-weight: 760;
}

.rp-auth-brief p {
  max-width: 620px;
  margin: 0;
  color: #43505c;
  font-size: 17px;
  line-height: 1.6;
}

.rp-auth-stage {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 680px;
  margin-top: 34px;
}

.rp-auth-stage span {
  border: 1px solid rgba(22, 32, 42, 0.12);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.72);
  color: #384654;
  font-size: 12px;
  font-weight: 720;
}

.rp-auth-panel {
  display: grid;
  align-content: center;
  min-height: 100vh;
  padding: clamp(18px, 4vw, 46px);
  background: rgba(255, 255, 255, 0.92);
  border-left: 1px solid rgba(22, 32, 42, 0.12);
  backdrop-filter: blur(14px);
}

.rp-auth-box {
  display: grid;
  gap: 18px;
  width: 100%;
}

.rp-auth-head h2,
.rp-auth-head p {
  margin: 0;
}

.rp-auth-head h2 {
  color: var(--rp-ink);
  font-size: 25px;
  line-height: 1.2;
}

.rp-auth-head p {
  margin-top: 8px;
  color: var(--rp-muted);
  font-size: 14px;
  line-height: 1.45;
}

.rp-mode-tabs,
.rp-segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rp-mode-tabs button,
.rp-segmented button {
  min-height: 34px;
  border: 1px solid var(--rp-line);
  border-radius: 6px;
  padding: 7px 11px;
  background: var(--rp-surface);
  color: var(--rp-muted);
  font-size: 12px;
  font-weight: 760;
}

.rp-mode-tabs button.active,
.rp-segmented button.active {
  border-color: rgba(0, 168, 215, 0.42);
  background: #e9f8fc;
  color: #075c75;
}

.rp-form {
  display: grid;
  gap: 12px;
}

.rp-form-grid,
.rp-form-grid.two,
.rp-form-grid.three {
  display: grid;
  gap: 12px;
}

.rp-form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rp-form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.rp-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.rp-field span,
.rp-field em {
  color: #4d5b68;
  font-size: 12px;
  line-height: 1.25;
  font-style: normal;
  font-weight: 730;
}

.rp-field input,
.rp-field select,
.rp-field textarea {
  width: 100%;
  min-width: 0;
  min-height: var(--rp-control);
  border: 1px solid var(--rp-line);
  border-radius: 6px;
  padding: 9px 10px;
  background: var(--rp-surface);
  color: var(--rp-ink);
  font-size: 14px;
  line-height: 1.35;
  outline: none;
}

.rp-field textarea {
  min-height: 90px;
  resize: vertical;
}

.rp-field input:focus,
.rp-field select:focus,
.rp-field textarea:focus {
  border-color: rgba(0, 168, 215, 0.7);
  box-shadow: 0 0 0 3px rgba(0, 168, 215, 0.14);
}

.rp-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.rp-button,
.rp-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: var(--rp-control);
  border: 1px solid var(--rp-line);
  border-radius: 6px;
  padding: 8px 12px;
  background: var(--rp-surface);
  color: var(--rp-ink);
  font-size: 13px;
  font-weight: 780;
  line-height: 1.2;
  text-decoration: none;
}

.rp-button.primary {
  border-color: #096780;
  background: #0b7895;
  color: #ffffff;
}

.rp-button.danger {
  border-color: rgba(188, 51, 66, 0.45);
  background: #fff1f2;
  color: #9b2532;
}

.rp-button.gold {
  border-color: rgba(201, 152, 47, 0.5);
  background: #fff7df;
  color: #705210;
}

.rp-button.ghost {
  background: transparent;
}

.rp-icon-button {
  width: 36px;
  padding: 0;
}

.rp-button svg,
.rp-icon-button svg,
.rp-rail svg,
.rp-stage-icon svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.rp-status {
  min-height: 20px;
  margin: 0;
  color: var(--rp-muted);
  font-size: 13px;
  line-height: 1.45;
}

.rp-status[data-tone="success"] {
  color: var(--rp-green);
}

.rp-status[data-tone="alert"] {
  color: var(--rp-red);
}

.rp-shell {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
}

.rp-rail {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 100vh;
  padding: 16px 12px;
  border-right: 1px solid var(--rp-line);
  background: #17212b;
  color: #e8eef2;
}

.rp-rail-logo {
  display: grid;
  place-items: center;
  width: 52px;
  min-height: 58px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.rp-rail-logo img {
  width: 34px;
  height: 42px;
  object-fit: contain;
}

.rp-rail nav {
  display: grid;
  align-content: start;
  gap: 8px;
  margin-top: 24px;
}

.rp-rail button,
.rp-rail a {
  display: grid;
  place-items: center;
  width: 52px;
  height: 46px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(232, 238, 242, 0.72);
  text-decoration: none;
}

.rp-rail button.active {
  background: #223340;
  color: #ffffff;
  box-shadow: inset 3px 0 0 var(--rp-cyan);
}

.rp-rail-footer {
  display: grid;
  gap: 8px;
}

.rp-main {
  min-width: 0;
  padding: 18px clamp(14px, 3vw, 30px) 30px;
}

.rp-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding-bottom: 12px;
}

.rp-title h1,
.rp-title p {
  margin: 0;
}

.rp-title h1 {
  color: var(--rp-ink);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.12;
  font-weight: 780;
}

.rp-title p {
  margin-top: 5px;
  color: var(--rp-muted);
  font-size: 14px;
  line-height: 1.45;
}

.rp-user {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.rp-user-label {
  display: grid;
  justify-items: end;
  line-height: 1.25;
}

.rp-user-label strong {
  color: var(--rp-ink);
  font-size: 13px;
}

.rp-user-label span {
  color: var(--rp-muted);
  font-size: 12px;
}

.rp-lifecycle {
  display: grid;
  grid-template-columns: repeat(var(--stage-count, 6), minmax(148px, 1fr));
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 14px;
  scrollbar-width: thin;
}

.rp-stage {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 76px;
  min-width: 148px;
  border: 1px solid var(--rp-line);
  border-radius: 8px;
  padding: 10px;
  background: var(--rp-surface);
  text-align: left;
}

.rp-stage.active {
  border-color: rgba(0, 168, 215, 0.48);
  background: #edfaff;
  box-shadow: inset 0 -3px 0 var(--rp-cyan);
}

.rp-stage-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--rp-surface-soft);
  color: #1a6178;
}

.rp-stage strong,
.rp-stage span {
  display: block;
}

.rp-stage strong {
  color: var(--rp-ink);
  font-size: 13px;
  line-height: 1.15;
  overflow-wrap: normal;
  word-break: normal;
}

.rp-stage span {
  margin-top: 3px;
  color: var(--rp-muted);
  font-size: 11px;
  line-height: 1.2;
}

.rp-stage em {
  min-width: 24px;
  color: var(--rp-ink);
  font-style: normal;
  font-size: 18px;
  font-weight: 820;
  text-align: right;
}

.rp-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 14px;
  align-items: start;
}

.rp-panel,
.rp-drawer,
.rp-strip {
  border: 1px solid var(--rp-line);
  border-radius: var(--rp-radius);
  background: var(--rp-surface);
}

.rp-panel {
  min-width: 0;
}

.rp-drawer {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
  padding: 14px;
}

.rp-drawer > *,
.rp-drawer-head > *,
.rp-detail-sections,
.rp-detail-section {
  min-width: 0;
}

.rp-detail-sections {
  display: grid;
  gap: 12px;
}

.rp-detail-section {
  display: grid;
  gap: 7px;
}

.rp-detail-section h3 {
  margin: 0;
  color: var(--rp-ink);
  font-size: 14px;
  line-height: 1.3;
}

.rp-panel-head,
.rp-drawer-head,
.rp-section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--rp-line);
}

.rp-panel-head h2,
.rp-drawer-head h2,
.rp-section-head h3 {
  margin: 0;
  color: var(--rp-ink);
  font-size: 16px;
  line-height: 1.25;
}

.rp-panel-head p,
.rp-drawer-head p,
.rp-section-head p {
  max-width: 680px;
  margin: 4px 0 0;
  color: var(--rp-muted);
  font-size: 13px;
  line-height: 1.45;
}

.rp-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--rp-line);
}

.rp-toolbar .rp-field {
  min-width: min(260px, 100%);
}

.rp-user-management-tools {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--rp-line);
  background: #fbfcfd;
}

.rp-user-management-tools .rp-segmented button span {
  display: inline-flex;
  min-width: 20px;
  justify-content: center;
  margin-left: 4px;
  border-radius: 999px;
  padding: 2px 6px;
  background: var(--rp-surface-soft);
  color: inherit;
  font-size: 10px;
}

.rp-user-search {
  display: grid;
  grid-template-columns: minmax(220px, 420px) auto auto;
  align-items: end;
  gap: 8px;
}

.rp-user-search .rp-field {
  min-width: 0;
}

.rp-table-wrap {
  overflow-x: auto;
}

.rp-entry-toolbar {
  align-items: end;
}

.rp-material-group {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  min-width: 0;
}

.rp-material-group strong,
.rp-score-review strong {
  overflow-wrap: anywhere;
}

.rp-score-review {
  display: grid;
  gap: 7px;
  padding: 10px 0;
  border-top: 1px solid var(--rp-line);
}

.rp-score-review small {
  color: var(--rp-muted);
}

.rp-score-review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px 10px;
  font-size: 0.84rem;
}

.rp-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.rp-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--rp-line);
  background: #fbfcfd;
}

.rp-filter-tabs .rp-button {
  min-height: 38px;
}

.rp-filter-tabs .rp-button strong {
  margin-left: 4px;
}

.rp-table th,
.rp-table td {
  border-bottom: 1px solid var(--rp-line);
  padding: 11px 12px;
  color: var(--rp-text);
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
  word-break: normal;
}

.rp-table th,
.rp-chip {
  white-space: nowrap;
}

.rp-table th {
  color: #4a5967;
  background: #f8fafb;
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.rp-table tr[data-select-row] {
  cursor: pointer;
}

.rp-table tr.active td {
  background: #f0faff;
}

.rp-table strong {
  color: var(--rp-ink);
}

.rp-table small {
  display: block;
  margin-top: 3px;
  color: var(--rp-muted);
  font-size: 12px;
}

.rp-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 24px;
  border: 1px solid var(--rp-line);
  border-radius: 999px;
  padding: 4px 8px;
  background: #f8fafb;
  color: #42515e;
  font-size: 11px;
  font-weight: 780;
  line-height: 1.1;
  white-space: nowrap;
}

.rp-chip[data-tone="success"] {
  border-color: rgba(29, 143, 100, 0.26);
  background: #edf8f3;
  color: #126145;
}

.rp-chip[data-tone="warning"] {
  border-color: rgba(201, 152, 47, 0.34);
  background: #fff8e5;
  color: #72530e;
}

.rp-chip[data-tone="alert"] {
  border-color: rgba(188, 51, 66, 0.26);
  background: #fff1f2;
  color: #912534;
}

.rp-chip[data-tone="info"] {
  border-color: rgba(50, 103, 214, 0.24);
  background: #eef4ff;
  color: #244c9c;
}

.rp-chip[data-tone="cms"] {
  border-color: rgba(91, 61, 135, 0.25);
  background: #f3effa;
  color: #4a316e;
}

.rp-empty {
  margin: 0;
  padding: 24px 14px;
  color: var(--rp-muted);
  font-size: 14px;
  line-height: 1.5;
}

.rp-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  padding: 14px;
}

.rp-metric {
  display: grid;
  gap: 3px;
  min-height: 66px;
  border: 1px solid var(--rp-line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfd;
}

.rp-metric span {
  color: var(--rp-muted);
  font-size: 11px;
  font-weight: 780;
  text-transform: uppercase;
}

.rp-metric strong {
  color: var(--rp-ink);
  font-size: 24px;
  line-height: 1.1;
}

.rp-dl {
  display: grid;
  gap: 0;
  margin: 0;
  border: 1px solid var(--rp-line);
  border-radius: 8px;
  overflow: hidden;
}

.rp-dl div {
  display: grid;
  grid-template-columns: minmax(110px, 0.42fr) minmax(0, 1fr);
  gap: 10px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--rp-line);
}

.rp-dl div:last-child {
  border-bottom: 0;
}

.rp-dl dt {
  color: var(--rp-muted);
  font-size: 12px;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.rp-dl dd {
  min-width: 0;
  margin: 0;
  color: var(--rp-ink);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.rp-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--rp-line);
  border-radius: 8px;
  overflow: hidden;
}

.rp-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid var(--rp-line);
  background: var(--rp-surface);
}

.rp-list-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.rp-list-row > span:last-child {
  max-width: 100%;
  justify-self: end;
}

.rp-list-row:last-child {
  border-bottom: 0;
}

.rp-list-row strong {
  display: block;
  color: var(--rp-ink);
  font-size: 13px;
  line-height: 1.25;
}

.rp-list-row small {
  display: block;
  margin-top: 3px;
  color: var(--rp-muted);
  font-size: 12px;
  line-height: 1.3;
}

.rp-drawer-section {
  display: grid;
  gap: 10px;
}

.rp-drawer-section h3 {
  margin: 0;
  color: var(--rp-ink);
  font-size: 14px;
}

.rp-score-grid {
  display: grid;
  gap: 10px;
}

.rp-score-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 220px) 44px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--rp-line);
  border-radius: 8px;
  background: #fbfcfd;
}

.rp-score-row label {
  display: grid;
  gap: 3px;
}

.rp-score-row strong {
  color: var(--rp-ink);
  font-size: 13px;
}

.rp-score-row small {
  color: var(--rp-muted);
  font-size: 12px;
}

.rp-score-row input[type="range"] {
  width: 100%;
}

.rp-score-row output {
  color: var(--rp-ink);
  font-weight: 820;
  text-align: right;
}

.rp-score-total {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(0, 168, 215, 0.28);
  border-radius: 8px;
  padding: 12px;
  background: #edfaff;
}

.rp-score-total strong {
  color: #075c75;
  font-size: 26px;
  line-height: 1;
}

.rp-score-summary {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: grid;
  gap: 10px;
  margin: 10px -4px -4px;
  border-top: 1px solid var(--rp-line);
  padding: 12px 4px 4px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -8px 18px rgba(24, 32, 43, 0.06);
  backdrop-filter: blur(8px);
}

.rp-json {
  min-height: 180px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.rp-file-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rp-file-item {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--rp-line);
  border-radius: 6px;
  background: #fbfcfd;
  overflow: hidden;
}

.rp-file-links .rp-file-item > a,
.rp-file-links .rp-file-item > span {
  border: 0;
  border-radius: 0;
}

.rp-file-remove {
  min-width: 32px;
  border: 0;
  border-left: 1px solid var(--rp-line);
  background: #fff;
  color: #a23b43;
  cursor: pointer;
  font-size: 18px;
  font-weight: 760;
}

.rp-file-remove:hover,
.rp-file-remove:focus-visible {
  background: #fff1f2;
  outline: none;
}

.rp-file-links a,
.rp-file-links span {
  border: 1px solid var(--rp-line);
  border-radius: 6px;
  padding: 6px 8px;
  background: #fbfcfd;
  color: #2f4355;
  font-size: 12px;
  line-height: 1.25;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.rp-file-links .rp-file-unavailable {
  display: inline-grid;
  gap: 2px;
  border-style: dashed;
  background: #f6f7f8;
  color: #6d7780;
}

.rp-file-unavailable small {
  color: #a23b43;
  font-size: 10px;
  font-weight: 760;
}

.rp-auth-assist {
  margin: 14px 0 0;
  font-size: 13px;
}

.rp-auth-assist a {
  color: var(--rp-accent);
  font-weight: 700;
}

.rp-notice {
  border-left: 3px solid var(--rp-cyan);
  padding: 10px 12px;
  background: #edfaff;
  color: #244b57;
  font-size: 13px;
  line-height: 1.45;
}

.rp-mobile-stage {
  display: none;
}

.rp-cms-workbench {
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(0, 1fr);
  min-height: 720px;
}

.rp-cms-sections {
  padding: 18px 12px;
  border-right: 1px solid var(--rp-line);
  background: #f6f9fb;
}

.rp-cms-sections h3 {
  margin: 0 8px 12px;
  font-size: 14px;
}

.rp-cms-sections button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 0;
  border-left: 3px solid transparent;
  background: transparent;
  color: var(--rp-ink);
  text-align: left;
  cursor: pointer;
}

.rp-cms-sections button:hover {
  background: #edf5f8;
}

.rp-cms-sections button.active {
  border-left-color: var(--rp-cyan);
  background: #e5f6fb;
  color: #075d75;
  font-weight: 700;
}

.rp-cms-sections button small,
.rp-cms-copy-field > span small,
.rp-cms-actions small {
  color: var(--rp-muted);
}

.rp-cms-editor {
  min-width: 0;
  padding-bottom: 84px;
}

.rp-cms-language-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--rp-line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 4;
}

.rp-cms-language-tabs button {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--rp-line);
  background: #fff;
  color: var(--rp-ink);
  cursor: pointer;
}

.rp-cms-language-tabs button.active {
  border-color: var(--rp-cyan);
  background: #e9f8fc;
  color: #075d75;
}

.rp-cms-copy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.rp-cms-copy-field > span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.rp-cms-copy-field > span small {
  font-weight: 400;
}

.rp-cms-collection {
  margin: 0 18px 18px;
  border: 1px solid var(--rp-line);
  background: #fff;
}

.rp-cms-array,
.rp-cms-object {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.rp-cms-array-row,
.rp-cms-object-field {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--rp-line);
  background: #fbfcfd;
}

.rp-cms-array-row.dragging {
  opacity: 0.45;
  border-color: var(--rp-cyan);
}

.rp-cms-judge-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.rp-cms-judge-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--rp-line);
  background: #fbfcfd;
}

.rp-cms-judge-card.dragging {
  opacity: 0.45;
  border-color: var(--rp-cyan);
}

.rp-cms-judge-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--rp-line);
  background: #eef2f4;
}

.rp-cms-judge-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.rp-cms-judge-photo.missing,
.rp-cms-judge-photo:has(.rp-cms-image-warning) {
  display: grid;
  place-items: center;
  border-color: #c34040;
  background: #fff3f3;
}

.rp-cms-image-warning,
.rp-cms-judge-photo.missing::after {
  padding: 10px;
  color: #9f2424;
  content: "Portrait file missing";
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.rp-cms-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rp-cms-row-head .rp-actions {
  margin-left: auto;
}

.rp-cms-drag {
  width: 22px;
  color: var(--rp-muted);
  cursor: grab;
}

.rp-icon-button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--rp-line);
  background: #fff;
  cursor: pointer;
}

.rp-icon-button.danger {
  color: #a6222d;
}

.rp-cms-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 18px;
}

.rp-cms-section-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--rp-line);
  background: #fff;
  color: var(--rp-ink);
  text-align: left;
  cursor: pointer;
}

.rp-cms-section-card span:first-child,
.rp-cms-actions > span {
  display: grid;
  gap: 4px;
}

.rp-cms-section-card small {
  color: var(--rp-muted);
}

.rp-cms-change-review {
  margin: 18px 0 24px;
  padding: 18px;
  border: 1px solid var(--rp-line);
  border-left: 4px solid var(--rp-cyan);
  background: #f8fcfe;
}

.rp-cms-change-counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.rp-cms-change-counts span {
  display: flex;
  flex-direction: column;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--rp-line);
  background: #fff;
  color: var(--rp-muted);
}

.rp-cms-change-counts strong {
  color: var(--rp-ink);
  font-size: 1.2rem;
}

.rp-cms-change-review ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 20px;
  margin: 0;
  padding-left: 20px;
  color: var(--rp-muted);
}

.rp-cms-completion {
  color: #08718d;
  white-space: nowrap;
}

.rp-cms-visibility {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--rp-line);
  background: #f5fbfd;
}

.rp-cms-visibility input {
  width: 20px;
  height: 20px;
  accent-color: var(--rp-accent);
}

.rp-cms-visibility span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rp-cms-visibility small {
  color: var(--rp-muted);
}

.rp-cms-assets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 18px 90px;
}

.rp-cms-asset-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--rp-line);
  background: #fff;
}

.rp-cms-asset-preview {
  width: 150px;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--rp-line);
  background: #eef2f4;
}

.rp-cms-asset-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.rp-cms-asset-preview.missing::after {
  content: "";
  padding: 10px;
  color: var(--rp-muted);
  text-align: center;
}

.rp-cms-asset-preview.missing span {
  padding: 12px;
  color: var(--rp-muted);
  font-weight: 800;
  text-align: center;
}

.rp-cms-asset-status {
  margin: 6px 0 10px;
  color: #9b2c45;
  font-size: 12px;
  font-weight: 800;
}

.rp-file-button {
  position: relative;
  display: inline-flex;
  width: fit-content;
  cursor: pointer;
}

.rp-file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.rp-cms-actions {
  position: sticky;
  bottom: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-top: 1px solid var(--rp-line);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -8px 24px rgba(18, 38, 52, 0.08);
}

@media (max-width: 1180px) {
  .rp-workspace {
    grid-template-columns: 1fr;
  }

  .rp-drawer {
    position: static;
  }
}

@media (max-width: 900px) {
  .rp-cms-workbench {
    grid-template-columns: 1fr;
  }

  .rp-cms-sections {
    border-right: 0;
    border-bottom: 1px solid var(--rp-line);
    max-height: 220px;
    overflow: auto;
  }

  .rp-cms-copy-grid,
  .rp-cms-assets,
  .rp-cms-overview-grid,
  .rp-cms-judge-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .rp-cms-workbench {
    grid-template-columns: 1fr;
  }

  .rp-cms-sections {
    border-right: 0;
    border-bottom: 1px solid var(--rp-line);
    max-height: 220px;
    overflow: auto;
  }

  .rp-cms-copy-grid,
  .rp-cms-assets,
  .rp-cms-overview-grid,
  .rp-cms-judge-grid,
  .rp-cms-change-counts,
  .rp-cms-change-review ul {
    grid-template-columns: 1fr;
  }

  .rp-cms-language-tabs {
    position: static;
  }

  .rp-cms-asset-card {
    grid-template-columns: 100px minmax(0, 1fr);
  }

  .rp-cms-asset-preview {
    width: 100px;
  }

  .rp-cms-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .rp-cms-actions .rp-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .rp-auth-page {
    grid-template-columns: 1fr;
  }

  .rp-auth-brief {
    min-height: auto;
    padding: 28px 18px;
  }

  .rp-auth-brief h1 {
    margin-top: 28px;
  }

  .rp-auth-panel {
    min-height: auto;
    border-left: 0;
    border-top: 1px solid rgba(22, 32, 42, 0.12);
  }

  .rp-shell {
    grid-template-columns: 1fr;
  }

  .rp-rail {
    position: sticky;
    min-height: auto;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto;
    align-items: center;
    padding: 10px;
  }

  .rp-rail nav {
    grid-auto-flow: column;
    grid-auto-columns: 46px;
    overflow-x: auto;
    margin: 0;
  }

  .rp-rail button,
  .rp-rail a {
    width: 44px;
    height: 42px;
  }

  .rp-rail-footer {
    grid-auto-flow: column;
  }

  .rp-main {
    padding: 14px 12px 24px;
  }

  .rp-topbar {
    grid-template-columns: 1fr;
  }

  .rp-user {
    justify-content: flex-start;
  }

  .rp-user-label {
    justify-items: start;
  }

  .rp-form-grid.two,
  .rp-form-grid.three {
    grid-template-columns: 1fr;
  }

  .rp-mobile-stage {
    display: grid;
    margin-bottom: 10px;
  }

  .rp-lifecycle {
    display: none;
  }

  .rp-dl div,
  .rp-score-row,
  .rp-list-row {
    grid-template-columns: 1fr;
  }

  .rp-table {
    min-width: 660px;
  }

  .rp-user-search {
    grid-template-columns: 1fr;
  }
}
