/*
 * 息壤 V3 · 产品与官网共享的静态设计系统
 * 完全离线：无外部字体、无 CDN、无 @import。
 * 通过 .xr-scope[data-surface='c'|'ops'|'public'|'login'] 区分场景。
 */

:root {
  color-scheme: light;

  --xr-ink: #071510;
  --xr-ink-soft: #10271c;
  --xr-lime: #b8ff32;
  --xr-green: #3deb8a;
  --xr-green-deep: #0f5c37;
  --xr-cyan: #32dcc8;
  --xr-paper: #f6fff7;
  --xr-mist: #e5f1e8;
  --xr-white: #ffffff;

  --xr-font-sans: -apple-system, BlinkMacSystemFont, "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", "Noto Sans SC", sans-serif;
  --xr-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --xr-font-serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", Georgia, "Times New Roman", serif;

  --xr-space-1: 4px;
  --xr-space-2: 8px;
  --xr-space-3: 12px;
  --xr-space-4: 16px;
  --xr-space-5: 20px;
  --xr-space-6: 24px;
  --xr-space-8: 32px;
  --xr-space-10: 40px;
  --xr-space-12: 48px;
  --xr-space-16: 64px;
  --xr-space-20: 80px;

  --xr-radius-xs: 6px;
  --xr-radius-control: 10px;
  --xr-radius-card: 16px;
  --xr-radius-panel: 24px;
  --xr-radius-modal: 28px;
  --xr-radius-pill: 999px;

  --xr-duration-fast: 160ms;
  --xr-duration-base: 240ms;
  --xr-duration-story: 640ms;
  --xr-ease-standard: cubic-bezier(.2, .8, .2, 1);
  --xr-ease-enter: cubic-bezier(.16, 1, .3, 1);

  --xr-focus-ring-color: #32dcc8;
  --xr-focus-ring-width: 2px;
  --xr-focus-ring-offset: 2px;

  --xr-control-min: 44px;
  --xr-shadow-panel: 0 18px 50px rgba(7, 21, 16, .08);
  --xr-shadow-elev: 0 28px 80px rgba(7, 21, 16, .12);
}

/* Public surface (official site inside product) */
.xr-scope[data-surface="public"] {
  --xr-bg: var(--xr-ink);
  --xr-surface: #0c1e15;
  --xr-surface-soft: #12271e;
  --xr-text: var(--xr-paper);
  --xr-text-strong: var(--xr-paper);
  --xr-text-body: #b9c8c0;
  --xr-text-emphasis: var(--xr-lime);
  --xr-text-muted: #9fb0a7;
  --xr-border: rgba(246, 255, 247, .14);
  --xr-primary: var(--xr-lime);
  --xr-primary-text: var(--xr-ink);
  --xr-accent: var(--xr-cyan);
}

/* Login surface — quiet, editorial */
.xr-scope[data-surface="login"] {
  --xr-bg: #eef4ef;
  --xr-surface: var(--xr-white);
  --xr-surface-soft: var(--xr-paper);
  --xr-text: var(--xr-ink);
  --xr-text-strong: var(--xr-ink);
  --xr-text-body: #3d4f47;
  --xr-text-emphasis: var(--xr-green-deep);
  --xr-text-muted: #4b5e55;
  --xr-border: #dbe6de;
  --xr-primary: var(--xr-ink);
  --xr-primary-text: var(--xr-paper);
  --xr-accent: var(--xr-lime);
}

/* C workspace surface */
.xr-scope[data-surface="c"] {
  --xr-bg: #f2f7f3;
  --xr-surface: var(--xr-white);
  --xr-surface-soft: #f6faf7;
  --xr-text: var(--xr-ink);
  --xr-text-strong: var(--xr-ink);
  --xr-text-body: #3d4f47;
  --xr-text-emphasis: var(--xr-green-deep);
  --xr-text-muted: #4b5e55;
  --xr-border: #dbe6de;
  --xr-primary: var(--xr-ink);
  --xr-primary-text: var(--xr-paper);
  --xr-accent: var(--xr-lime);
  --xr-density-row: 52px;
}

/* Ops console surface */
.xr-scope[data-surface="ops"] {
  --xr-bg: #f6faf7;
  --xr-surface: var(--xr-white);
  --xr-surface-soft: #eef3ef;
  --xr-text: var(--xr-ink);
  --xr-text-strong: var(--xr-ink);
  --xr-text-body: #3d4f47;
  --xr-text-emphasis: var(--xr-green-deep);
  --xr-text-muted: #4b5e55;
  --xr-border: #dbe6de;
  --xr-primary: var(--xr-ink);
  --xr-primary-text: var(--xr-paper);
  --xr-accent: var(--xr-lime);
  --xr-density-row: 42px;
  --xr-side-bg: #071510;
  --xr-side-text: #d5e0d8;
  --xr-side-muted: #7c8e83;
  --xr-side-border: rgba(246, 255, 247, .1);
}

/* --- Base typography and reset --- */

.xr-scope {
  font-family: var(--xr-font-sans);
  color: var(--xr-text);
  background: var(--xr-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.xr-scope *,
.xr-scope *::before,
.xr-scope *::after {
  box-sizing: border-box;
}

.xr-scope a { color: inherit; }
.xr-scope ::selection { color: var(--xr-ink); background: var(--xr-lime); }

.xr-mono {
  font-family: var(--xr-font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.xr-serif { font-family: var(--xr-font-serif); font-weight: 700; letter-spacing: -.02em; }
.xr-display { font-family: var(--xr-font-serif); font-weight: 800; line-height: .95; letter-spacing: -.04em; }
.xr-section-title { font-family: var(--xr-font-serif); font-weight: 700; line-height: 1.05; letter-spacing: -.03em; }

/* --- Buttons --- */

.xr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--xr-control-min);
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--xr-radius-pill);
  background: transparent;
  color: var(--xr-text);
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--xr-duration-fast) var(--xr-ease-standard),
              background var(--xr-duration-fast) var(--xr-ease-standard),
              color var(--xr-duration-fast) var(--xr-ease-standard),
              border-color var(--xr-duration-fast) var(--xr-ease-standard);
}
.xr-btn:hover { transform: translateY(-1px); }
.xr-btn--primary { background: var(--xr-primary); color: var(--xr-primary-text); }
.xr-btn--accent  { background: var(--xr-accent);  color: var(--xr-ink); }
.xr-btn--ghost   { background: transparent; color: var(--xr-text); border-color: var(--xr-border); }
.xr-btn--danger  { background: #c43f3f; color: #fff; }
.xr-btn--sm { min-height: 36px; padding: 0 14px; font-size: 12px; }
.xr-btn:disabled, .xr-btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }

/* --- Forms --- */

.xr-scope input[type="text"],
.xr-scope input:not([type]),
.xr-scope input[type="password"],
.xr-scope input[type="email"],
.xr-scope input[type="url"],
.xr-scope input[type="search"],
.xr-scope input[type="number"],
.xr-scope select,
.xr-scope textarea,
.xr-input, .xr-select, .xr-textarea {
  width: 100%;
  min-height: var(--xr-control-min);
  padding: 10px 14px;
  border: 1px solid var(--xr-border);
  border-radius: var(--xr-radius-control);
  background: var(--xr-surface);
  color: var(--xr-text);
  font: inherit;
  font-size: 14px;
  transition: border-color var(--xr-duration-fast) var(--xr-ease-standard),
              box-shadow var(--xr-duration-fast) var(--xr-ease-standard);
}
.xr-scope textarea, .xr-textarea { min-height: 96px; padding: 12px 14px; line-height: 1.55; resize: vertical; }
.xr-scope input:hover, .xr-scope select:hover, .xr-scope textarea:hover { border-color: #a9bbb1; }
.xr-scope input:focus, .xr-scope select:focus, .xr-scope textarea:focus {
  outline: none;
  border-color: var(--xr-text);
  box-shadow: 0 0 0 3px rgba(50, 220, 200, .18);
}
.xr-label { display: block; margin-bottom: 6px; font-size: 12px; color: var(--xr-text-muted); font-weight: 600; }
.xr-field { margin-bottom: 14px; }
.xr-help { margin-top: 6px; color: var(--xr-text-muted); font-size: 12px; }

/* --- Focus ring (keyboard only) --- */

.xr-scope :focus-visible,
.xr-scope.xr-focus-keyboard :focus {
  outline: var(--xr-focus-ring-width) solid var(--xr-focus-ring-color);
  outline-offset: var(--xr-focus-ring-offset);
}

/* --- Cards & panels --- */

.xr-card {
  padding: 20px;
  background: var(--xr-surface);
  border: 1px solid var(--xr-border);
  border-radius: var(--xr-radius-card);
}
.xr-panel {
  padding: 28px;
  background: var(--xr-surface);
  border: 1px solid var(--xr-border);
  border-radius: var(--xr-radius-panel);
  box-shadow: var(--xr-shadow-panel);
}

/* --- Tables --- */

.xr-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.xr-table thead th {
  padding: 12px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--xr-text-muted);
  border-bottom: 1px solid var(--xr-border);
  background: var(--xr-surface-soft);
}
.xr-table tbody td {
  padding: 14px;
  border-bottom: 1px solid var(--xr-border);
  vertical-align: middle;
}
.xr-table tbody tr:hover td { background: var(--xr-surface-soft); }
.xr-scope[data-surface="ops"] .xr-table tbody td { padding-block: 10px; font-family: var(--xr-font-mono); font-size: 12px; }
.xr-scope[data-surface="ops"] .xr-table tbody td.xr-cell-text { font-family: inherit; font-size: 13px; }

/* --- Chips / badges --- */

.xr-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--xr-radius-pill);
  border: 1px solid var(--xr-border);
  background: var(--xr-surface-soft);
  color: var(--xr-text-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}
.xr-chip--live { background: var(--xr-lime); color: var(--xr-ink); border-color: var(--xr-lime); }
.xr-chip--warn { background: #fff2d6; color: #7d4d00; border-color: #f2d59a; }
.xr-chip--danger { background: #ffe1e1; color: #a12a2a; border-color: #f5c1c1; }
.xr-chip--info { background: #d9f2eb; color: #0f6a58; border-color: #b3e0d1; }

/* --- Nav bars --- */

.xr-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
  padding: 12px clamp(20px, 4vw, 40px);
  border-bottom: 1px solid var(--xr-border);
  background: var(--xr-surface);
}
.xr-topbar .xr-brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 800; font-size: 15px; }
.xr-topbar .xr-brand small { display: block; margin-top: 2px; color: var(--xr-text-muted); font: 700 10px/1 var(--xr-font-mono); }
.xr-topbar-links { display: inline-flex; align-items: center; gap: clamp(14px, 2vw, 28px); }
.xr-topbar-links a { color: var(--xr-text-muted); text-decoration: none; font-size: 13px; }
.xr-topbar-links a:hover, .xr-topbar-links a:focus-visible { color: var(--xr-text); }
.xr-topbar-actions { display: inline-flex; align-items: center; gap: 10px; }

/* --- Ops sidebar --- */

.xr-scope[data-surface="ops"] .xr-ops-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}
.xr-scope[data-surface="ops"] .xr-side {
  min-height: 100vh;
  padding: 24px 16px;
  background: var(--xr-side-bg);
  color: var(--xr-side-text);
  border-right: 1px solid var(--xr-side-border);
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.xr-scope[data-surface="ops"] .xr-side .xr-brand { color: var(--xr-side-text); font-weight: 800; }
.xr-scope[data-surface="ops"] .xr-side .xr-brand small { color: var(--xr-side-muted); }
.xr-scope[data-surface="ops"] .xr-side-nav { display: grid; gap: 2px; }
.xr-scope[data-surface="ops"] .xr-side-nav a,
.xr-scope[data-surface="ops"] .xr-side-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--xr-radius-control);
  background: transparent;
  color: var(--xr-side-muted);
  font: inherit;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}
.xr-scope[data-surface="ops"] .xr-side-nav a:hover,
.xr-scope[data-surface="ops"] .xr-side-nav button:hover,
.xr-scope[data-surface="ops"] .xr-side-nav a:focus-visible,
.xr-scope[data-surface="ops"] .xr-side-nav button:focus-visible {
  color: var(--xr-paper);
  background: rgba(246, 255, 247, .06);
}
.xr-scope[data-surface="ops"] .xr-side-nav a.is-active,
.xr-scope[data-surface="ops"] .xr-side-nav button.is-active {
  color: var(--xr-ink);
  background: var(--xr-lime);
  font-weight: 700;
}
.xr-scope[data-surface="ops"] .xr-workspace {
  min-width: 0;
  padding: clamp(20px, 3vw, 40px);
  background: var(--xr-bg);
}

/* --- C shell --- */

.xr-scope[data-surface="c"] .xr-c-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.xr-scope[data-surface="c"] .xr-c-nav { display: flex; align-items: center; gap: 18px; overflow-x: auto; }
.xr-scope[data-surface="c"] .xr-c-nav a {
  padding: 10px 12px;
  border-radius: var(--xr-radius-control);
  color: var(--xr-text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.xr-scope[data-surface="c"] .xr-c-nav a:hover { color: var(--xr-text); }
.xr-scope[data-surface="c"] .xr-c-nav a.is-active { color: var(--xr-text); background: var(--xr-mist); }
.xr-scope[data-surface="c"] .xr-workspace {
  flex: 1;
  padding: clamp(20px, 3vw, 40px);
  background: var(--xr-bg);
}

/* --- Toast --- */

.xr-toast-host {
  position: fixed;
  inset: auto 20px 20px auto;
  z-index: 500;
  display: grid;
  gap: 10px;
  pointer-events: none;
}
.xr-toast {
  min-width: 220px;
  padding: 12px 16px;
  border-radius: var(--xr-radius-control);
  background: rgba(7, 21, 16, .92);
  color: var(--xr-paper);
  font-size: 13px;
  box-shadow: 0 18px 44px rgba(7, 21, 16, .28);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--xr-duration-base) var(--xr-ease-standard),
              transform var(--xr-duration-base) var(--xr-ease-standard);
  pointer-events: auto;
}
.xr-toast.is-visible { opacity: 1; transform: translateY(0); }

/* --- Login layout --- */

.xr-scope[data-surface="login"] .xr-login {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100vh;
}
.xr-scope[data-surface="login"] .xr-login-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  padding: clamp(40px, 6vw, 96px);
  background: var(--xr-surface);
}
.xr-scope[data-surface="login"] .xr-login-visual {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(160deg, #eef4ef 0%, #dfe8e2 60%, #cfe0d3 100%);
}
.xr-scope[data-surface="login"] .xr-login-visual::before {
  content: "";
  position: absolute;
  width: 62%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(184, 255, 50, .5), rgba(184, 255, 50, 0) 65%);
  animation: xr-breath 6s ease-in-out infinite;
}
.xr-scope[data-surface="login"] .xr-login-guardian {
  --xr-gaze-x: 0px;
  --xr-gaze-y: 0px;
  position: relative;
  width: min(72%, 520px);
  height: auto;
  will-change: transform;
  transform: translate3d(var(--xr-gaze-x), var(--xr-gaze-y), 0);
  animation: xr-grow 12s ease-in-out infinite;
}

@keyframes xr-breath {
  0%, 100% { transform: scale(.94); opacity: .78; }
  50%      { transform: scale(1.05); opacity: 1; }
}
@keyframes xr-grow {
  0%, 100% { transform: translate3d(var(--xr-gaze-x), var(--xr-gaze-y), 0) scale(1); }
  50%      { transform: translate3d(var(--xr-gaze-x), var(--xr-gaze-y), 0) scale(1.035); }
}

.xr-scope[data-surface="login"] .xr-login-title {
  font-family: var(--xr-font-serif);
  font-weight: 700;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1;
  letter-spacing: -.03em;
  margin: 0;
}
.xr-scope[data-surface="login"] .xr-login-sub {
  color: var(--xr-text-muted);
  font-size: 15px;
  line-height: 1.7;
  margin: 0;
}
.xr-scope[data-surface="login"] .xr-login-error {
  padding: 10px 14px;
  border-radius: var(--xr-radius-control);
  background: #ffe4e4;
  color: #a12a2a;
  font-size: 13px;
}

@media (max-width: 860px) {
  .xr-scope[data-surface="login"] .xr-login { grid-template-columns: 1fr; }
  .xr-scope[data-surface="login"] .xr-login-visual { min-height: 260px; order: -1; }
  .xr-scope[data-surface="ops"] .xr-ops-shell { grid-template-columns: 1fr; }
  .xr-scope[data-surface="ops"] .xr-side { position: sticky; top: 0; min-height: auto; padding: 12px 16px; flex-direction: row; overflow-x: auto; }
}

/* --- Motion & accessibility guards --- */

@media (prefers-reduced-motion: reduce) {
  :root {
    --xr-duration-fast: 0ms;
    --xr-duration-base: 0ms;
    --xr-duration-story: 0ms;
  }
  .xr-scope *, .xr-scope *::before, .xr-scope *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .xr-scope[data-surface="login"] .xr-login-visual::before,
  .xr-scope[data-surface="login"] .xr-login-guardian { animation: none; }
}

/* --- Flask product bridge -------------------------------------------------
 * The current application still renders a small set of legacy class names
 * from app.py.  These scoped rules map those real screens onto the V3 system
 * without changing their forms, routes or data contracts.
 */

.xr-scope[data-surface="c"] {
  --bg: var(--xr-bg);
  --surface: var(--xr-surface);
  --surface-soft: var(--xr-surface-soft);
  --text: var(--xr-text);
  --muted: var(--xr-text-muted);
  --border: var(--xr-border);
  --primary: var(--xr-ink);
  --primary-soft: #e8f0ea;
  --success: #197548;
}

.xr-scope[data-surface="c"] .shell.c-shell {
  grid-template-columns: 224px minmax(0, 1fr);
  background: var(--xr-bg);
}
.xr-scope[data-surface="c"] .sidebar {
  padding: 28px 16px;
  color: var(--xr-text);
  background: var(--xr-white);
  border-right: 1px solid var(--xr-border);
}
.xr-scope[data-surface="c"] .sidebar .brand,
.xr-scope[data-surface="ops"] .sidebar .brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 4px;
  font-size: 16px;
  line-height: 1.2;
}
.xr-scope[data-surface="c"] .sidebar .brand img,
.xr-scope[data-surface="ops"] .sidebar .brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex: 0 0 auto;
}
.xr-scope[data-surface="c"] .sidebar .subbrand {
  margin: 0 0 28px 45px;
  color: var(--xr-text-muted);
  font-size: 11px;
}
.xr-scope[data-surface="c"] .nav-item {
  position: relative;
  min-height: 42px;
  margin-bottom: 3px;
  padding: 0 12px 0 15px;
  display: flex;
  align-items: center;
  color: var(--xr-text-muted);
  border-radius: var(--xr-radius-control);
  font-weight: 650;
}
.xr-scope[data-surface="c"] .nav-item:hover { color: var(--xr-text); background: #f5f8f6; }
.xr-scope[data-surface="c"] .nav-item.active {
  color: var(--xr-text);
  background: var(--xr-mist);
}
.xr-scope[data-surface="c"] .nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: var(--xr-lime);
}
.xr-scope[data-surface="c"] .main { min-width: 0; background: var(--xr-bg); }
.xr-scope[data-surface="c"] .topbar {
  height: 64px;
  padding: 0 clamp(20px, 3vw, 40px);
  background: rgba(255, 255, 255, .9);
  border-color: var(--xr-border);
  backdrop-filter: blur(12px);
}
.xr-scope[data-surface="c"] .content {
  max-width: 1440px;
  padding: clamp(20px, 3vw, 40px);
}
.xr-scope[data-surface="c"] .workspace-hero,
.xr-scope[data-surface="c"] .project-hero,
.xr-scope[data-surface="c"] .panel,
.xr-scope[data-surface="c"] .metric-card,
.xr-scope[data-surface="c"] .workflow-step,
.xr-scope[data-surface="c"] .project-card {
  border-color: var(--xr-border);
  border-radius: 14px;
  box-shadow: none;
}
.xr-scope[data-surface="c"] .workspace-hero,
.xr-scope[data-surface="c"] .project-hero { padding: clamp(24px, 3vw, 34px); }
.xr-scope[data-surface="c"] .workspace-hero::after,
.xr-scope[data-surface="c"] .project-hero::after {
  right: -72px;
  top: -100px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(184,255,50,.16) 0 28%, rgba(184,255,50,.055) 29% 51%, transparent 52%);
}
.xr-scope[data-surface="c"] .btn.primary {
  color: var(--xr-paper);
  background: var(--xr-ink);
  border-color: var(--xr-ink);
}
.xr-scope[data-surface="c"] .btn.primary:hover { background: #13271e; }
.xr-scope[data-surface="c"] .badge.ok {
  color: #155f3b;
  background: #ebffd0;
  border-color: #cdeca8;
}
.xr-scope[data-surface="c"] .workflow-step b {
  color: var(--xr-ink);
  background: var(--xr-lime);
}
.c-mobile-nav { display: none; }

.xr-scope[data-surface="ops"] {
  --bg: var(--xr-bg);
  --surface: var(--xr-surface);
  --surface-soft: var(--xr-surface-soft);
  --text: var(--xr-text);
  --muted: var(--xr-text-muted);
  --border: var(--xr-border);
  --primary: var(--xr-ink);
  --success: #1f9d60;
}
.xr-scope[data-surface="ops"] .shell.ops-shell { background: var(--xr-bg); }
.xr-scope[data-surface="ops"] .sidebar {
  color: var(--xr-side-text);
  background: var(--xr-side-bg);
  border-right: 1px solid var(--xr-side-border);
}
.xr-scope[data-surface="ops"] .sidebar .subbrand {
  margin: 0 0 28px 45px;
  color: var(--xr-side-muted);
  font-size: 11px;
}
.xr-scope[data-surface="ops"] .nav-item {
  min-height: 40px;
  margin-bottom: 2px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  color: var(--xr-side-muted);
  border-radius: 9px;
  font-size: 13px;
}
.xr-scope[data-surface="ops"] .nav-item:hover {
  color: var(--xr-paper);
  background: rgba(246,255,247,.06);
}
.xr-scope[data-surface="ops"] .nav-item.active {
  color: var(--xr-ink);
  background: var(--xr-lime);
  font-weight: 750;
}
.xr-scope[data-surface="ops"] .main { background: var(--xr-bg); }
.xr-scope[data-surface="ops"] .topbar {
  color: var(--xr-text);
  background: var(--xr-white);
  border-color: var(--xr-border);
}
.xr-scope[data-surface="ops"] .content { max-width: none; }
.xr-scope[data-surface="ops"] .ops-hero {
  color: var(--xr-paper);
  background: var(--xr-ink);
  border: 1px solid rgba(246,255,247,.08);
  border-radius: 14px;
}
.xr-scope[data-surface="ops"] .ops-hero::before {
  right: -90px;
  top: -180px;
  width: 430px;
  height: 430px;
  opacity: 1;
  background: radial-gradient(circle, rgba(184,255,50,.22) 0 20%, rgba(184,255,50,.07) 21% 42%, transparent 43%);
}
.xr-scope[data-surface="ops"] .ops-hero::after { background: linear-gradient(90deg, var(--xr-lime), transparent 52%); }
.xr-scope[data-surface="ops"] .ops-hero .btn.primary {
  color: var(--xr-ink);
  background: var(--xr-lime);
  border-color: var(--xr-lime);
}
.xr-scope[data-surface="ops"] .ops-card,
.xr-scope[data-surface="ops"] .panel,
.xr-scope[data-surface="ops"] .analytics-card {
  border-color: var(--xr-border);
  border-radius: 12px;
  box-shadow: none;
}
.xr-scope[data-surface="ops"] .ops-bar span { background: linear-gradient(90deg, #218f5b, var(--xr-lime)); }
.xr-scope[data-surface="ops"] .login-shell.ops-login,
.xr-scope[data-surface="ops"] .login-shell.ops-login .form-side { background: var(--xr-ink); }
.xr-scope[data-surface="ops"] .ops-login-visual {
  background: radial-gradient(circle at 68% 26%, rgba(184,255,50,.16), transparent 30%), var(--xr-ink);
}
.xr-scope[data-surface="ops"] .ops-console-card {
  border-color: rgba(184,255,50,.22);
  background: rgba(10,31,21,.86);
}

@media (max-width: 760px) {
  .xr-scope[data-surface="c"] { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .xr-scope[data-surface="c"] .shell.c-shell { display: block; min-height: 100vh; }
  .xr-scope[data-surface="c"] .sidebar { display: none; }
  .xr-scope[data-surface="c"] .topbar {
    position: sticky;
    z-index: 40;
    top: 0;
    height: 58px;
    padding: 0 18px;
  }
  .xr-scope[data-surface="c"] .content { padding: 16px 16px 28px; }
  .xr-scope[data-surface="c"] .workspace-hero,
  .xr-scope[data-surface="c"] .project-hero { padding: 22px; }
  .xr-scope[data-surface="c"] .workspace-hero h1,
  .xr-scope[data-surface="c"] .project-hero h1 { font-size: 28px; }
  .xr-scope[data-surface="c"] .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .xr-scope[data-surface="c"] .workflow-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .xr-scope[data-surface="c"] .metric-card,
  .xr-scope[data-surface="c"] .workflow-step { min-height: 116px; padding: 16px; }
  .xr-scope[data-surface="c"] .hero-actions { gap: 8px; }
  .xr-scope[data-surface="c"] .btn { min-height: 44px; }
  .c-mobile-nav {
    position: fixed;
    z-index: 90;
    left: 10px;
    right: 10px;
    bottom: max(8px, env(safe-area-inset-bottom));
    min-height: 64px;
    padding: 7px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    border: 1px solid rgba(7,21,16,.1);
    border-radius: 20px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 16px 48px rgba(7,21,16,.16);
    backdrop-filter: blur(16px);
  }
  .c-mobile-nav a {
    position: relative;
    min-width: 0;
    min-height: 50px;
    padding: 7px 2px 4px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 5px;
    color: #75847c;
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
  }
  .c-mobile-nav a i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #c5d0ca;
  }
  .c-mobile-nav a.active { color: var(--xr-ink); }
  .c-mobile-nav a.active i { width: 18px; border-radius: 999px; background: var(--xr-lime); }
}
