:root {
  --ink: #172033;
  --ink-soft: #4c566c;
  --muted: #758097;
  --line: #e2e7f0;
  --line-strong: #cfd7e6;
  --canvas: #f6f8fc;
  --surface: #ffffff;
  --surface-soft: #fafbfe;
  --sidebar: #172a66;
  --sidebar-soft: #20366f;
  --primary: #246bfd;
  --primary-strong: #1854d8;
  --primary-soft: #eaf1ff;
  --success: #159a6b;
  --success-soft: #e6f7f0;
  --warning: #f26b1d;
  --warning-soft: #fff4df;
  --danger: #d92d20;
  --danger-soft: #fff0ef;
  --info: #4f6bdc;
  --info-soft: #edf4ff;
  --shadow-sm: 0 1px 2px rgba(18, 44, 35, 0.06);
  --shadow-md: 0 12px 32px rgba(18, 44, 35, 0.09);
  --shadow-lg: 0 24px 64px rgba(14, 40, 32, 0.16);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --font:
    "Noto Sans SC", Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.runtime-pending {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

.auth-root {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
  background:
    radial-gradient(circle at 18% 12%, rgba(36, 107, 253, 0.16), transparent 32%),
    radial-gradient(circle at 82% 88%, rgba(21, 154, 107, 0.12), transparent 34%),
    var(--canvas);
}

.auth-card {
  width: min(100%, 440px);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow-lg);
}

.auth-card h1 {
  margin-bottom: 8px;
  font-size: 27px;
  line-height: 1.25;
}

.auth-card > p:not(.eyebrow) {
  margin-bottom: 24px;
  color: var(--ink-soft);
}

.auth-brand {
  display: flex;
  width: 46px;
  height: 46px;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  margin-bottom: 22px;
  padding: 10px;
  border-radius: 14px;
  background: var(--sidebar);
  box-shadow: 0 12px 28px rgba(23, 42, 102, 0.2);
}

.auth-brand span {
  width: 6px;
  border-radius: 3px 3px 1px 1px;
  background: #fff;
}

.auth-brand span:nth-child(1) {
  height: 10px;
  opacity: 0.7;
}

.auth-brand span:nth-child(2) {
  height: 18px;
}

.auth-brand span:nth-child(3) {
  height: 14px;
  opacity: 0.85;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form .button {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
}

.auth-form-status {
  min-height: 22px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

.auth-api-note {
  margin: 20px 0 0 !important;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted) !important;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.auth-loading-bar {
  height: 4px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--line);
}

.auth-loading-bar span {
  display: block;
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  animation: auth-loading 1.1s ease-in-out infinite alternate;
}

@keyframes auth-loading {
  from {
    transform: translateX(-30%);
  }
  to {
    transform: translateX(190%);
  }
}

.runtime-state {
  display: grid;
  min-height: min(62vh, 560px);
  place-items: center;
  padding: 40px 18px;
}

.runtime-state-card {
  width: min(100%, 480px);
  padding: 30px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.runtime-state-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  margin: 0 auto 16px;
  border-radius: 16px;
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 800;
  font-size: 20px;
}

.runtime-state-card h2 {
  margin-bottom: 8px;
}

.runtime-state-card p {
  color: var(--ink-soft);
}

.runtime-trace {
  display: block;
  margin: 14px 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.environment-status.is-api .status-pulse {
  background: var(--success);
}

.environment-status.is-demo .status-pulse {
  background: var(--warning);
}

.read-only-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 16px;
  padding: 11px 14px;
  border: 1px solid #cddafd;
  border-radius: var(--radius);
  color: #24458f;
  background: #f2f6ff;
}

.read-only-banner strong {
  display: block;
}

.read-only-banner p {
  margin: 2px 0 0;
  font-size: 12px;
}

[data-runtime-disabled="true"] {
  cursor: not-allowed !important;
  opacity: 0.48 !important;
}

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

button {
  color: inherit;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

table {
  border-collapse: collapse;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 9px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--primary);
  transform: translateY(-150%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  overflow-y: auto;
  padding: 22px 16px 16px;
  color: #dceae4;
  background:
    radial-gradient(circle at 20% 0%, rgba(80, 135, 255, 0.2), transparent 32%),
    var(--sidebar);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 7px 22px;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  background: linear-gradient(145deg, #4f87ff, #1854d8);
  box-shadow: 0 8px 20px rgba(25, 83, 208, 0.28);
}

.brand-mark span {
  position: absolute;
  width: 15px;
  height: 3px;
  border-radius: 2px;
  background: #effff8;
}

.brand-mark span:nth-child(1) {
  transform: translateY(-6px);
}

.brand-mark span:nth-child(3) {
  transform: translateY(6px);
}

.brand-name {
  color: #fff;
  font-size: 15px;
  font-weight: 720;
  letter-spacing: 0.03em;
}

.brand-subtitle {
  margin-top: 1px;
  color: #8eaaa0;
  font-size: 11px;
}

.workspace-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 21px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.045);
}

.workspace-avatar,
.operator-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  color: #dff8ec;
  background: #2e478d;
  font-size: 12px;
  font-weight: 700;
}

.workspace-avatar {
  width: 31px;
  height: 31px;
}

.workspace-chip strong,
.workspace-chip small,
.operator strong,
.operator small {
  display: block;
}

.workspace-chip strong {
  color: #eaf4f0;
  font-size: 12px;
  font-weight: 650;
}

.workspace-chip small {
  margin-top: 1px;
  color: #8ba59c;
  font-size: 10px;
}

.main-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-label {
  margin: 0 10px 7px;
  color: #65877b;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.nav-item {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 43px;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 0;
  border-radius: 10px;
  color: #a9beb6;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

.nav-item:hover {
  color: #eff8f4;
  background: rgba(255, 255, 255, 0.055);
}

.nav-item:active {
  transform: translateY(1px);
}

.nav-item.is-active {
  color: #fff;
  background: linear-gradient(90deg, rgba(36, 107, 253, 0.42), rgba(36, 107, 253, 0.14));
  box-shadow: inset 2px 0 #7aa6ff;
}

.nav-icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 8px;
  color: #b9d8cc;
  background: rgba(255, 255, 255, 0.065);
  font-size: 11px;
  font-weight: 750;
}

.nav-item.is-active .nav-icon {
  color: #e8fff5;
  background: rgba(116, 161, 255, 0.22);
}

.nav-badge {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  color: #bbdacf;
  background: rgba(255, 255, 255, 0.08);
  font-size: 10px;
  text-align: center;
}

.nav-badge-danger {
  color: #ffd7d4;
  background: rgba(221, 90, 80, 0.22);
}

.nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.nav-dot-warning {
  background: #efad4e;
  box-shadow: 0 0 0 3px rgba(239, 173, 78, 0.11);
}

.nav-dot-danger {
  background: #ed7168;
  box-shadow: 0 0 0 3px rgba(237, 113, 104, 0.11);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 18px;
}

.safety-note {
  display: flex;
  gap: 9px;
  margin: 0 4px 13px;
  padding: 10px;
  border: 1px solid rgba(118, 162, 255, 0.19);
  border-radius: 10px;
  background: rgba(36, 107, 253, 0.12);
}

.safety-icon {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: #a8c4ff;
  background: rgba(82, 133, 242, 0.18);
  font-size: 10px;
  font-weight: 750;
}

.safety-note strong {
  color: #d8e5ff;
  font-size: 10px;
}

.safety-note p {
  margin: 2px 0 0;
  color: #94a9da;
  font-size: 9px;
}

.operator {
  display: grid;
  width: 100%;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
  color: #9eb5ac;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.operator-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #754e8b;
}

.operator strong {
  color: #ecf4f1;
  font-size: 11px;
}

.operator small {
  color: #779288;
  font-size: 9px;
}

.main-column {
  min-width: 0;
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(214, 223, 219, 0.9);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.breadcrumb strong {
  color: var(--ink);
  font-weight: 670;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.environment-status {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid #d5e9df;
  border-radius: 999px;
  color: #31745a;
  background: #f2faf6;
  font-size: 10px;
  font-weight: 650;
}

.status-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #26a876;
  box-shadow: 0 0 0 3px rgba(38, 168, 118, 0.12);
}

.icon-button,
.help-button,
.button,
.text-button {
  border: 0;
  cursor: pointer;
}

.icon-button {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #4b5c56;
  background: var(--surface);
  font-size: 17px;
}

.icon-button:hover,
.help-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.notification-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: var(--danger);
}

.help-button {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #42534d;
  background: #fff;
  font-size: 11px;
}

.mobile-nav-button {
  display: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}

#main-content {
  min-height: calc(100vh - 66px);
  outline: none;
}

.page {
  max-width: 1560px;
  margin: 0 auto;
  padding: 26px 28px 52px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.page-title-wrap {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.page-header h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(22px, 2.3vw, 30px);
  font-weight: 740;
  letter-spacing: -0.025em;
}

.page-description {
  max-width: 720px;
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.page-actions,
.card-actions,
.inline-actions,
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 670;
  white-space: nowrap;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease,
    opacity 0.16s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button-primary {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 5px 13px rgba(23, 124, 93, 0.15);
}

.button-primary:hover:not(:disabled) {
  background: var(--primary-strong);
}

.button-secondary {
  border-color: var(--line);
  color: #31453e;
  background: #fff;
}

.button-secondary:hover:not(:disabled) {
  border-color: #bfcac5;
  background: #f8faf9;
}

.button-danger {
  color: #fff;
  background: var(--danger);
}

.button-warning {
  border-color: #eacb9a;
  color: #8c5810;
  background: #fff9ed;
}

.button-ghost {
  color: var(--primary);
  background: var(--primary-soft);
}

.button-sm {
  min-height: 29px;
  padding: 5px 9px;
  border-radius: 7px;
  font-size: 10px;
}

.button:disabled,
.button.is-disabled {
  border-color: #e1e5e3;
  color: #9ba49f;
  background: #eef1ef;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.text-button {
  padding: 3px 0;
  color: var(--primary);
  background: transparent;
  font-size: 11px;
  font-weight: 650;
}

.text-button:hover {
  color: var(--primary-strong);
  text-decoration: underline;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card {
  position: relative;
  min-height: 126px;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.metric-card::after {
  position: absolute;
  right: -22px;
  bottom: -28px;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: var(--metric-glow, rgba(35, 142, 102, 0.06));
  content: "";
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.metric-label {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 620;
}

.metric-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 9px;
  color: var(--metric-color, var(--primary));
  background: var(--metric-background, var(--primary-soft));
  font-size: 10px;
  font-weight: 800;
}

.metric-value {
  margin-top: 14px;
  font-size: 28px;
  font-weight: 760;
  letter-spacing: -0.04em;
}

.metric-foot {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.metric-foot strong {
  color: var(--metric-color, var(--primary));
  font-weight: 730;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.9fr);
  gap: 16px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 17px;
  border-bottom: 1px solid #edf0ee;
}

.card-header h2,
.card-header h3 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 720;
}

.card-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.card-body {
  padding: 17px;
}

.card-body-flush {
  padding: 0;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid;
  border-radius: 10px;
  font-size: 11px;
}

.notice + .notice {
  margin-top: 8px;
}

.notice strong {
  display: block;
  margin-bottom: 2px;
  font-weight: 700;
}

.notice p {
  margin: 0;
  color: inherit;
  opacity: 0.84;
  font-size: 10px;
}

.notice-icon {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
}

.notice-danger {
  border-color: #f0cbc8;
  color: #9e3430;
  background: var(--danger-soft);
}

.notice-danger .notice-icon {
  background: #f9d5d2;
}

.notice-warning {
  border-color: #efd8af;
  color: #88550f;
  background: var(--warning-soft);
}

.notice-warning .notice-icon {
  background: #f8e4be;
}

.notice-info {
  border-color: #cbdcf4;
  color: #315f9c;
  background: var(--info-soft);
}

.notice-info .notice-icon {
  background: #dae8fb;
}

.notice-success {
  border-color: #bfdfd2;
  color: #226b51;
  background: var(--success-soft);
}

.notice-success .notice-icon {
  background: #cfeddf;
}

.task-list,
.queue-list,
.activity-list,
.gate-list,
.compact-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-item,
.queue-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 12px 17px;
  border-bottom: 1px solid #eef1ef;
}

.task-item:last-child,
.queue-item:last-child {
  border-bottom: 0;
}

.task-marker,
.file-type,
.resource-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  font-weight: 750;
}

.task-marker {
  width: 31px;
  height: 31px;
  color: var(--marker-color, var(--primary));
  background: var(--marker-bg, var(--primary-soft));
  font-size: 10px;
}

.task-title {
  margin: 0;
  color: var(--ink);
  font-size: 11px;
  font-weight: 660;
}

.task-meta {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.status-bar {
  display: flex;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1ef;
}

.status-bar span {
  min-width: 2px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.health-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.health-summary-files {
  grid-template-columns: repeat(4, 1fr);
}

.health-summary div {
  padding: 10px;
  border: 1px solid #edf0ee;
  border-radius: 9px;
  background: var(--surface-soft);
}

.health-summary strong {
  display: block;
  font-size: 16px;
}

.health-summary span {
  color: var(--muted);
  font-size: 9px;
}

.risk-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.calendar-label {
  color: #9aa49f;
  font-size: 8px;
  text-align: center;
}

.calendar-day {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 7px;
  color: #59655f;
  background: #f3f6f4;
  font-size: 9px;
}

.calendar-day.is-today {
  color: #fff;
  background: var(--primary);
}

.calendar-day.has-warning {
  color: #8d590f;
  background: var(--warning-soft);
  box-shadow: inset 0 0 0 1px #ebcf9d;
}

.calendar-day.has-danger {
  color: #a23934;
  background: var(--danger-soft);
  box-shadow: inset 0 0 0 1px #efc9c6;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.filter-row {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.field {
  min-width: 0;
}

.field label,
.field-label {
  display: block;
  margin-bottom: 5px;
  color: #4d5d57;
  font-size: 10px;
  font-weight: 650;
}

.field-hint {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.input,
.select {
  height: 36px;
  padding: 0 10px;
}

.textarea {
  min-height: 98px;
  padding: 10px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: #7ba7ff;
  box-shadow: 0 0 0 3px rgba(36, 107, 253, 0.1);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
  color: #8e9994;
  background: #f3f5f4;
}

.search-control {
  position: relative;
  min-width: min(270px, 100%);
  flex: 1 1 260px;
}

.search-control::before {
  position: absolute;
  top: 9px;
  left: 11px;
  color: #8a9791;
  content: "⌕";
  font-size: 15px;
}

.search-control .input {
  padding-left: 32px;
}

.filter-select {
  width: 140px;
}

.table-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 900px;
}

.data-table th {
  height: 41px;
  padding: 0 13px;
  border-bottom: 1px solid var(--line);
  color: #718079;
  background: #fafcfa;
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.04em;
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 12px 13px;
  border-bottom: 1px solid #edf1ef;
  color: #42514c;
  font-size: 10px;
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 0.14s ease;
}

.data-table tbody tr:hover {
  background: #f8fbf9;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.checkbox {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
}

.resource-cell {
  display: flex;
  min-width: 250px;
  align-items: center;
  gap: 10px;
}

.resource-avatar {
  width: 35px;
  height: 35px;
  color: #285bcf;
  background: #eaf1ff;
  font-size: 10px;
}

.resource-name {
  display: block;
  color: var(--ink);
  font-size: 11px;
  font-weight: 680;
}

.resource-id,
.muted {
  color: var(--muted);
  font-size: 9px;
}

.badge,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge {
  min-height: 23px;
  padding: 3px 8px;
  font-size: 9px;
  font-weight: 670;
}

.badge::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  opacity: 0.68;
}

.badge-success {
  color: #287357;
  background: var(--success-soft);
}

.badge-warning {
  color: #956011;
  background: var(--warning-soft);
}

.badge-danger {
  color: #ae403b;
  background: var(--danger-soft);
}

.badge-info {
  color: #3a69a8;
  background: var(--info-soft);
}

.badge-neutral {
  color: #65736d;
  background: #eff2f0;
}

.tag {
  padding: 2px 7px;
  color: #58655f;
  background: #f0f3f1;
  font-size: 8px;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.pagination {
  display: flex;
  gap: 5px;
}

.page-button {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #5b6963;
  background: #fff;
  cursor: pointer;
  font-size: 9px;
}

.page-button.is-current {
  border-color: var(--primary);
  color: #fff;
  background: var(--primary);
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
}

.form-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.form-section + .form-section {
  margin-top: 25px;
  padding-top: 23px;
  border-top: 1px solid #edf0ee;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.section-heading h2,
.section-heading h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 720;
}

.section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.form-grid .field-full {
  grid-column: 1 / -1;
}

.input-prefix {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: stretch;
}

.input-prefix span {
  display: grid;
  min-width: 40px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-right: 0;
  border-radius: 9px 0 0 9px;
  color: var(--muted);
  background: #f6f8f7;
}

.input-prefix .input {
  border-radius: 0 9px 9px 0;
}

.char-count {
  float: right;
  color: #99a29e;
  font-size: 8px;
}

.radio-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.radio-card {
  position: relative;
  display: block;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}

.radio-card:has(input:checked) {
  border-color: #6f9eff;
  background: #f3f7ff;
  box-shadow: inset 0 0 0 1px #6f9eff;
}

.radio-card input {
  position: absolute;
  opacity: 0;
}

.radio-card strong {
  display: block;
  font-size: 10px;
}

.radio-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.sticky-card {
  position: sticky;
  top: 84px;
}

.summary-block {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.summary-block + .summary-block {
  margin-top: 12px;
}

.summary-block h3 {
  margin-bottom: 12px;
  font-size: 12px;
}

.summary-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid #eff2f0;
  color: var(--muted);
  font-size: 9px;
}

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

.summary-row strong {
  color: var(--ink);
  font-weight: 650;
  text-align: right;
}

.progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1ef;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.completion-score {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.completion-score strong {
  font-size: 20px;
}

.completion-score span {
  color: var(--muted);
  font-size: 9px;
}

.file-cell {
  display: flex;
  min-width: 230px;
  align-items: center;
  gap: 9px;
}

.file-type {
  width: 31px;
  height: 35px;
  border: 1px solid currentColor;
  border-radius: 6px;
  font-size: 8px;
}

.file-type-pdf {
  color: #c34d49;
  background: #fff5f4;
}

.file-type-xlsx {
  color: #277858;
  background: #eff9f4;
}

.file-type-pptx {
  color: #b46228;
  background: #fff6ee;
}

.file-type-docx {
  color: #366bad;
  background: #f0f6ff;
}

.file-name {
  display: block;
  max-width: 230px;
  overflow: hidden;
  color: var(--ink);
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.mini-check {
  padding: 2px 5px;
  border-radius: 5px;
  font-size: 8px;
}

.mini-check-pass {
  color: #2f765a;
  background: #eaf6f0;
}

.mini-check-warn {
  color: #926013;
  background: #fff4de;
}

.mini-check-fail {
  color: #a6413c;
  background: #fff0ef;
}

.file-job-meta {
  display: flex;
  min-width: 118px;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 8px;
}

.file-job-meta code {
  max-width: 150px;
  overflow: hidden;
  color: var(--danger);
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-job-time {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

.overview-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 15px;
}

.overview-strip-files {
  grid-template-columns: repeat(5, 1fr);
}

.overview-item {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.overview-item span {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.overview-item strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.credential-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.credential-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

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

.credential-card h3 {
  margin: 0;
  font-size: 11px;
}

.credential-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.days-value {
  margin: 16px 0 3px;
  font-size: 21px;
  font-weight: 760;
}

.days-label {
  color: var(--muted);
  font-size: 8px;
}

.rights-scope {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 12px;
}

.delivery-patrol-panel {
  margin-bottom: 13px;
  padding: 16px;
  border: 1px solid #dfe8e3;
  border-radius: var(--radius);
  background: #fff;
}

.delivery-patrol-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.delivery-patrol-header h2 {
  margin: 3px 0 0;
  font-size: 14px;
}

.delivery-patrol-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.delivery-patrol-findings {
  display: grid;
  gap: 8px;
  margin-top: 13px;
}

.delivery-patrol-finding {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  border: 1px solid #e7ece9;
  border-left: 3px solid var(--warning);
  border-radius: 9px;
  background: #fbfcfb;
}

.delivery-patrol-finding.is-critical {
  border-left-color: var(--danger);
}

.delivery-patrol-finding strong {
  margin-left: 7px;
  font-size: 10px;
}

.delivery-patrol-finding p,
.delivery-patrol-finding small {
  display: block;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

.delivery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.delivery-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.delivery-card.is-degraded {
  border-color: #e7cb99;
  box-shadow: inset 3px 0 #d7922d;
}

.delivery-card.is-invalid {
  border-color: #ecc0bd;
  box-shadow: inset 3px 0 var(--danger);
}

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

.delivery-card h3 {
  margin: 0;
  font-size: 12px;
}

.delivery-card-header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.delivery-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 16px 14px;
}

.delivery-detail {
  min-width: 0;
  padding: 9px;
  border: 1px solid #edf0ee;
  border-radius: 8px;
  background: #fafcfa;
}

.delivery-detail span {
  display: block;
  color: var(--muted);
  font-size: 8px;
}

.delivery-detail strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-verification-panel {
  margin: 0 16px 14px;
  padding: 12px;
  border: 1px solid #dfe8e3;
  border-radius: 9px;
  background: #f7faf8;
}

.delivery-verification-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.delivery-verification-heading span,
.delivery-verification-facts span {
  display: block;
  color: var(--muted);
  font-size: 8px;
}

.delivery-verification-heading strong {
  display: block;
  margin-top: 2px;
  font-size: 10px;
}

.delivery-verification-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.delivery-verification-facts > div {
  min-width: 0;
}

.delivery-verification-facts strong,
.delivery-verification-facts code {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 8px;
  white-space: normal;
}

.delivery-verification-empty,
.delivery-verification-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.55;
}

.delivery-verification-note {
  padding-top: 8px;
  border-top: 1px dashed #dfe8e3;
}

.delivery-verification-actions {
  margin-top: 9px;
}

.hash-value {
  display: block;
  padding: 9px;
  overflow-wrap: anywhere;
  border: 1px solid #e2e9e5;
  border-radius: 7px;
  background: #f7faf8;
  color: var(--ink);
  font-size: 9px;
  line-height: 1.5;
  white-space: normal;
}

.hash-input {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.02em;
}

.manifest-file-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  margin-top: 12px;
  overflow: auto;
}

.manifest-file-list article {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid #e2e9e5;
  border-radius: 8px;
  background: #fff;
}

.manifest-file-list article strong,
.manifest-file-list article span,
.manifest-file-list article code {
  display: block;
  overflow-wrap: anywhere;
  font-size: 8px;
  white-space: normal;
}

.manifest-file-list article span {
  margin-top: 3px;
  color: var(--muted);
}

.delivery-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 16px;
  border-top: 1px solid #edf0ee;
  background: #fbfcfb;
}

.security-copy {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 8px;
}

.review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  gap: 16px;
}

.resource-selector {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding-bottom: 3px;
}

.resource-option {
  min-width: 210px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.resource-option:hover {
  border-color: #b9c8c1;
}

.resource-option.is-selected {
  border-color: #6f9eff;
  background: #f3f7ff;
  box-shadow: inset 0 0 0 1px #6f9eff;
}

.resource-option strong {
  display: block;
  font-size: 10px;
}

.resource-option small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.gate-item {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
  border-bottom: 1px solid #eef1ef;
}

.gate-item:last-child {
  border-bottom: 0;
}

.gate-icon {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
}

.gate-pass .gate-icon {
  color: #287359;
  background: #e4f5ed;
}

.gate-warning .gate-icon {
  color: #8d5b15;
  background: #fff0d6;
}

.gate-block .gate-icon {
  color: #a63d38;
  background: #ffe7e5;
}

.gate-title {
  margin: 0;
  font-size: 10px;
  font-weight: 680;
}

.gate-detail {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 8px;
}

.block-panel {
  padding: 17px;
  border: 1px solid #efc9c6;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 245, 244, 0.94)),
    var(--danger-soft);
}

.block-panel.is-ready {
  border-color: #bfe0d2;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(238, 250, 245, 0.95)),
    var(--success-soft);
}

.block-icon-large {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin-bottom: 13px;
  border-radius: 12px;
  color: #a43d38;
  background: #f9d7d4;
  font-size: 15px;
  font-weight: 800;
}

.block-panel.is-ready .block-icon-large {
  color: #287457;
  background: #cfece0;
}

.block-panel h2 {
  margin: 0;
  font-size: 15px;
}

.block-panel > p {
  margin: 6px 0 14px;
  color: var(--ink-soft);
  font-size: 10px;
}

.block-reasons {
  margin: 0 0 15px;
  padding: 0;
  list-style: none;
}

.block-reasons li {
  display: flex;
  gap: 7px;
  padding: 7px 0;
  border-top: 1px solid rgba(190, 90, 80, 0.12);
  color: #7c403c;
  font-size: 9px;
}

.block-panel.is-ready .block-reasons li {
  color: #396955;
  border-top-color: rgba(48, 132, 95, 0.12);
}

.declaration-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 14px 0;
}

.declaration {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #4b5b55;
  font-size: 9px;
}

.declaration input {
  margin-top: 1px;
  accent-color: var(--primary);
}

.rights-scope-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 10px;
}

.rights-scope-options .declaration {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.rights-scope-options .declaration span,
.rights-scope-options .declaration small {
  display: block;
}

.rights-scope-options .declaration small {
  margin-top: 3px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 7px;
}

.audit-drawer {
  position: fixed;
  z-index: 80;
  top: 0;
  right: 0;
  width: min(420px, 92vw);
  height: 100vh;
  overflow-y: auto;
  padding: 20px;
  border-left: 1px solid var(--line);
  background: #fff;
  box-shadow: -20px 0 55px rgba(14, 38, 31, 0.16);
  transform: translateX(105%);
  transition: transform 0.24s ease;
}

.audit-drawer.is-open {
  transform: translateX(0);
}

.drawer-header,
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.drawer-header h2,
.modal-header h2 {
  margin: 0;
  font-size: 18px;
}

.privacy-banner {
  display: flex;
  gap: 10px;
  margin: 18px 0;
  padding: 12px;
  border: 1px solid #cce4d9;
  border-radius: 10px;
  color: #2f6e55;
  background: #f0faf5;
  font-size: 9px;
}

.privacy-banner span {
  font-weight: 800;
}

.privacy-banner p {
  margin: 0;
}

.audit-entry {
  position: relative;
  padding: 0 0 19px 25px;
}

.audit-entry::before {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 7px;
  height: 7px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #5f8ef0;
  box-shadow: 0 0 0 1px #b4c9f6;
  content: "";
}

.audit-entry::after {
  position: absolute;
  top: 16px;
  bottom: 0;
  left: 9px;
  width: 1px;
  background: #dde6e2;
  content: "";
}

.audit-entry:last-child::after {
  display: none;
}

.audit-entry h3 {
  margin: 0;
  font-size: 10px;
}

.audit-entry p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 9px;
}

.audit-entry time {
  display: block;
  margin-top: 4px;
  color: #97a09c;
  font-size: 8px;
}

.audit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  padding: 20px;
  place-items: center;
  background: rgba(10, 26, 21, 0.46);
  backdrop-filter: blur(3px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(560px, 100%);
  max-height: min(760px, 92vh);
  overflow-y: auto;
  padding: 20px;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-lg);
}

.modal-body {
  margin-top: 18px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.toast-region {
  position: fixed;
  z-index: 120;
  right: 20px;
  bottom: 20px;
  display: flex;
  width: min(360px, calc(100vw - 40px));
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  box-shadow: var(--shadow-md);
  animation: toast-in 0.22s ease;
}

.toast-icon {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: var(--primary);
  font-size: 10px;
  font-weight: 800;
}

.toast-error .toast-icon {
  background: var(--danger);
}

.toast-warning .toast-icon {
  background: var(--warning);
}

.toast strong {
  display: block;
  font-size: 10px;
}

.toast p {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 8px;
}

.toast button {
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.empty-state {
  padding: 50px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
}

.empty-state p {
  max-width: 360px;
  margin: 6px auto 0;
  font-size: 9px;
}

.skeleton-line {
  height: 8px;
  border-radius: 999px;
  background: #edf1ef;
}

.mobile-overlay {
  position: fixed;
  z-index: 35;
  inset: 0;
  background: rgba(5, 16, 12, 0.38);
}

.mobile-overlay[hidden] {
  display: none;
}

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid,
  .split-layout,
  .review-layout {
    grid-template-columns: 1fr;
  }

  .sticky-card {
    position: static;
  }

  .credential-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
  }

  .sidebar.is-mobile-open {
    transform: translateX(0);
  }

  .mobile-nav-button {
    display: block;
  }

  .topbar {
    padding: 0 18px;
  }

  .page {
    padding: 22px 18px 44px;
  }

  .delivery-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .topbar {
    gap: 10px;
  }

  .breadcrumb span,
  .environment-status,
  .help-button {
    display: none;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .button {
    flex: 1;
  }

  .metric-grid,
  .overview-strip,
  .credential-card-grid {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .radio-cards {
    grid-template-columns: 1fr;
  }

  .rights-scope-options {
    grid-template-columns: 1fr;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-row {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-select,
  .search-control {
    width: 100%;
  }

  .delivery-details,
  .delivery-verification-facts,
  .manifest-file-list article {
    grid-template-columns: 1fr;
  }

  .delivery-patrol-header,
  .delivery-patrol-finding {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

.file-input {
  height: auto;
  padding: 9px 10px;
}

.upload-workflow-status {
  margin-top: 15px;
  padding: 13px 14px;
  border: 1px solid #b7cdfd;
  border-radius: 10px;
  background: #f3f7ff;
  color: var(--text);
}

.upload-workflow-status[data-tone="danger"] {
  border-color: #f5b8b3;
  background: var(--danger-soft);
}

.upload-workflow-status strong,
.upload-workflow-status small {
  display: block;
}

.upload-workflow-status small {
  margin-top: 7px;
  color: var(--muted);
}

.upload-workflow-status progress {
  display: block;
  width: 100%;
  height: 8px;
  margin-top: 10px;
  accent-color: var(--primary);
}

.nav-label-commerce {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #8fa9e8;
}

.commerce-environment {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  padding: 13px 15px;
  border: 1px solid;
  border-radius: var(--radius);
}

.commerce-environment.is-demo {
  border-color: #efd8af;
  color: #7e510f;
  background: #fff8e9;
}

.commerce-environment.is-live {
  border-color: #badfce;
  color: #1d654b;
  background: #ecf9f3;
}

.commerce-environment-label {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--warning);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.commerce-environment.is-live .commerce-environment-label {
  background: var(--success);
}

.commerce-environment strong,
.commerce-environment p {
  display: block;
  margin: 0;
}

.commerce-environment p {
  margin-top: 2px;
  opacity: 0.84;
  font-size: 10px;
}

.commerce-overview {
  margin-bottom: 13px;
}

.commerce-table {
  min-width: 1040px;
}

.money-value {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.masked-value {
  color: #41536f;
  background: #f0f4fb;
  font-size: 9px;
  white-space: nowrap;
}

.commerce-reason {
  display: block;
  max-width: 260px;
  color: var(--ink-soft);
}

.text-danger {
  color: var(--danger);
}

.field small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.commerce-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.commerce-detail-grid > div {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.commerce-detail-grid span,
.commerce-detail-grid strong,
.commerce-detail-grid small {
  display: block;
}

.commerce-detail-grid span:first-child {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 9px;
}

.commerce-detail-grid strong {
  overflow-wrap: anywhere;
  font-size: 10px;
}

.commerce-detail-grid small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
  overflow-wrap: anywhere;
}

.reconciliation-exceptions {
  display: grid;
  gap: 8px;
}

.reconciliation-exceptions article {
  padding: 11px 12px;
  border: 1px solid #efd1ce;
  border-radius: 9px;
  background: var(--danger-soft);
}

.reconciliation-exceptions article div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.reconciliation-exceptions article strong,
.reconciliation-exceptions article span {
  font-size: 10px;
}

.reconciliation-exceptions article span,
.reconciliation-exceptions article p {
  color: #9a4843;
}

.reconciliation-exceptions article p {
  margin: 4px 0 0;
  font-size: 9px;
}

.operations-alerts-card {
  margin: 0 0 20px;
  overflow: hidden;
  border-color: #d7dfed;
}

.operations-alert-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-block: 1px solid var(--line);
}

.operations-alert-summary span {
  display: grid;
  gap: 4px;
  padding: 12px 16px;
  background: var(--surface);
}

.operations-alert-summary small,
.operations-alerts-table small {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.operations-alert-summary strong {
  color: var(--ink);
  font-size: 19px;
}

.operations-alert-summary .is-danger strong {
  color: var(--danger);
}

.operations-alert-run,
.operations-alert-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  font-size: 9px;
}

.operations-alert-run > span:last-child {
  flex: 1;
  color: var(--muted);
}

.operations-alerts-table {
  min-width: 1100px;
}

.operations-alerts-table tr.is-dead-letter td {
  background: var(--danger-soft);
}

.operations-alerts-table td code,
.operations-alerts-table td span,
.operations-alerts-table td strong {
  display: block;
  overflow-wrap: anywhere;
}

.operations-alerts-table th:first-child,
.operations-alerts-table td:first-child,
.operations-alerts-table th:nth-child(4),
.operations-alerts-table td:nth-child(4),
.operations-alerts-table th:last-child,
.operations-alerts-table td:last-child {
  width: 100px;
}

.operations-alert-footnote {
  margin: 0;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.operational-events-card {
  margin: 0 0 20px;
  overflow: hidden;
  border-color: #d9dfeb;
}

.operational-events-toolbar,
.operational-events-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.operational-events-pagination {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.operational-event-type-select {
  width: min(300px, 42vw);
}

.operational-events-table {
  min-width: 1180px;
}

.operational-events-table th:first-child,
.operational-events-table td:first-child {
  width: 88px;
}

.operational-events-table th:nth-child(2),
.operational-events-table td:nth-child(2) {
  width: 220px;
}

.operational-events-table th:nth-child(3),
.operational-events-table td:nth-child(3) {
  width: 280px;
}

.operational-events-table th:last-child,
.operational-events-table td:last-child {
  width: 156px;
  white-space: nowrap;
}

.operational-associations {
  display: grid;
  gap: 5px;
}

.operational-associations span {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: baseline;
  gap: 6px;
}

.operational-associations small {
  color: var(--muted);
  font-size: 9px;
}

.operational-associations code {
  overflow-wrap: anywhere;
  color: #41536f;
  font-size: 9px;
}

.operational-detail-list {
  display: grid;
  gap: 5px;
  min-width: 260px;
  margin: 0;
}

.operational-detail-list > div {
  display: grid;
  grid-template-columns: minmax(78px, auto) minmax(0, 1fr);
  gap: 8px;
}

.operational-detail-list dt {
  color: var(--muted);
  font-size: 9px;
}

.operational-detail-list dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 9px;
  overflow-wrap: anywhere;
}

.commerce-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 9px;
}

.commerce-section-heading h2,
.commerce-section-heading p {
  margin: 0;
}

.commerce-section-heading h2 {
  font-size: 15px;
}

.commerce-section-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 680px) {
  .commerce-environment {
    flex-direction: column;
  }

  .commerce-detail-grid {
    grid-template-columns: 1fr;
  }

  .operational-events-toolbar,
  .operational-events-pagination,
  .operations-alert-run,
  .operations-alert-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .operations-alert-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .operational-events-toolbar .filter-row,
  .operational-event-type-select {
    width: 100%;
  }

  .operational-events-pagination .inline-actions {
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
.analytics-window {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.analytics-window .select {
  min-width: 112px;
}

.analytics-metric-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr);
  gap: 16px;
}

.analytics-chart {
  display: flex;
  height: 250px;
  align-items: end;
  gap: 5px;
  padding: 30px 20px 18px;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  background:
    linear-gradient(to top, rgba(36, 107, 253, 0.04), transparent 70%),
    repeating-linear-gradient(to top, transparent 0 49px, rgba(98, 116, 108, 0.09) 50px);
}

.analytics-bar {
  position: relative;
  display: grid;
  min-width: 20px;
  height: 100%;
  flex: 1 0 20px;
  grid-template-rows: 18px minmax(0, 1fr) 18px;
  align-items: end;
  justify-items: center;
}

.analytics-bar i {
  width: min(72%, 22px);
  min-height: 2px;
  border-radius: 5px 5px 1px 1px;
  background: linear-gradient(180deg, #4f83ff, #246bfd);
  box-shadow: 0 6px 16px rgba(36, 107, 253, 0.18);
}

.analytics-bar__value,
.analytics-bar small {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
}

.analytics-guardrails {
  display: grid;
  gap: 0;
}

.analytics-guardrails > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 15px 18px;
  border-top: 1px solid var(--line);
}

.analytics-guardrails > div:first-child {
  border-top: 0;
}

.analytics-guardrails span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 680;
}

.analytics-guardrails strong {
  color: var(--primary);
  font-size: 18px;
}

.analytics-guardrails small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10px;
}

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

.analytics-definition-grid > div {
  padding: 18px;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.analytics-definition-grid > div:last-child {
  border-right: 0;
}

.analytics-definition-grid strong {
  font-size: 12px;
}

.analytics-definition-grid p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.analytics-exclusion-form {
  display: grid;
  grid-template-columns: minmax(230px, 0.8fr) minmax(300px, 1.4fr) auto;
  gap: 10px;
  padding: 16px 18px;
  border-top: 1px solid var(--line);
}

.analytics-exclusion-card .data-table td:first-child {
  min-width: 260px;
}

.analytics-exclusion-card .data-table small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .analytics-metric-grid,
  .analytics-definition-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .analytics-definition-grid > div {
    border-bottom: 1px solid var(--line);
  }

  .analytics-exclusion-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .analytics-metric-grid,
  .analytics-definition-grid {
    grid-template-columns: 1fr;
  }
}

.cost-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.cost-summary > div,
.cost-category-list > div {
  padding: 14px;
  background: var(--surface-subtle, #f7f9fc);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.cost-summary span,
.cost-summary strong {
  display: block;
}

.cost-summary span {
  color: var(--muted);
  font-size: 12px;
}

.cost-summary strong {
  margin-top: 6px;
  color: var(--text);
  font-size: 20px;
}

.cost-category-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.cost-category-list > div:not(.empty-state) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.cost-category-list strong {
  color: var(--text);
}

.admin-mfa-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.admin-mfa-layout p {
  max-width: 760px;
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.mfa-secret-input,
.mfa-recovery-output {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.06em;
}

.mfa-recovery-output {
  resize: none;
  line-height: 1.7;
}

@media (max-width: 700px) {
  .admin-mfa-layout {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-mfa-layout .inline-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

.cost-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.cost-entry-form {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.cost-ledger-table {
  margin-top: 14px;
}

.support-evidence {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.support-evidence > header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.support-evidence-item {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(180px, 1.4fr) minmax(160px, 1fr);
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.support-evidence-item span,
.support-evidence-item small {
  color: var(--muted);
}

.support-message-thread {
  display: grid;
  gap: 10px;
  max-height: 320px;
  margin-top: 16px;
  overflow: auto;
}

.support-message {
  padding: 12px 14px;
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-left: 4px solid #88a5d8;
  border-radius: 10px;
}

.support-message--internal {
  background: #fff8e8;
  border-left-color: #d6a13b;
}

.support-message header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.support-message p {
  margin: 8px 0 0;
  color: var(--text);
  line-height: 1.55;
  white-space: pre-wrap;
}

.danger-text {
  color: var(--danger);
}

.status-danger {
  color: var(--danger);
}

@media (max-width: 700px) {
  .support-evidence-item {
    grid-template-columns: 1fr;
  }

  .cost-summary {
    grid-template-columns: 1fr;
  }
}
