/* ============================================================================
   Cloud SaaS Auth / Admin / Portal Theme — 「画廊白瓷 · Gallery Porcelain & Sculpted Obsidian」
   Studio porcelain floor (#F4F5F7), pure matte white sheets (#FFFFFF) with
   Prompt Motion inset rim light, sculpted obsidian buttons (#111111) with real
   studio shadow, surgical 1% Swiss signal spark (#E55A2B). Zero blur smear.
   ============================================================================ */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fa;
  --text: #111113;
  --text-2: #52525b;
  --muted: #7c808b;
  --accent: #111111;
  --accent-hover: #242428;
  --signal: #e55a2b;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.13);
  --danger: #dc2626;
  --warn-bg: #fffbeb;
  --warn-border: rgba(217, 119, 6, 0.30);
  --warn-text: #92400e;
  --ease: cubic-bezier(0.25, 1, 0.5, 1);
}

* { box-sizing: border-box; }

html, body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(17, 17, 19, 0.14);
  color: #111113;
}

body {
  font: 15px/1.65 system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(880px 480px at 50% -10%, rgba(255, 255, 255, 0.90), transparent 72%),
    var(--bg);
}

main {
  max-width: 1020px;
  margin: 40px auto;
  padding: 0 22px 64px;
}

main.narrow {
  max-width: 448px;
  margin-top: 84px;
}

section, .card {
  background: var(--surface);
  border: 0;
  border-radius: 16px;
  padding: 26px 28px;
  margin-top: 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.035), inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  transition: box-shadow 200ms var(--ease);
  animation: galleryIn 220ms var(--ease) both;
}

section:nth-of-type(2), .card:nth-of-type(2) { animation-delay: 28ms; }
section:nth-of-type(3), .card:nth-of-type(3) { animation-delay: 56ms; }
section:nth-of-type(4), .card:nth-of-type(4) { animation-delay: 84ms; }

@keyframes galleryIn {
  from { opacity: 0.2; transform: translate3d(0, 6px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

section:focus-within, .card:focus-within {
  box-shadow: 0 10px 26px -14px rgba(0, 0, 0, 0.12), inset 0 0 0 1px rgba(0, 0, 0, 0.14);
}

h1 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0 0 8px;
  color: var(--text);
}

h2 {
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 14px;
  color: var(--text);
}

p { margin: 6px 0 12px; color: var(--muted); }

label {
  display: block;
  margin: 12px 0 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
}

input, select, textarea {
  width: 100%;
  font: inherit;
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  transition: border-color 140ms ease, box-shadow 160ms ease;
}

input.inline-check {
  width: auto;
  padding: 0;
  margin-right: 6px;
  vertical-align: middle;
  accent-color: #111111;
}

input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) {
  border-color: rgba(0, 0, 0, 0.24);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #111111;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

/* Sculpted matte obsidian CTA with Prompt Motion studio floor shadow */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid #111111;
  background: #111111;
  color: #ffffff;
  cursor: pointer;
  text-decoration: none;
  margin-top: 12px;
  margin-right: 8px;
  box-shadow: 0 8px 18px -8px rgba(0, 0, 0, 0.36), 0 1px 2px rgba(0, 0, 0, 0.16);
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 180ms ease, transform 130ms var(--ease);
}

button:hover:not(:disabled), .btn:hover {
  background: #242428;
  border-color: #242428;
  box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.44), 0 2px 5px rgba(0, 0, 0, 0.18);
}

button:active:not(:disabled), .btn:active {
  transform: scale(0.975);
}

button.secondary, .btn.secondary {
  background: #ffffff;
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

button.secondary:hover:not(:disabled), .btn.secondary:hover {
  background: #f5f6f8;
  border-color: rgba(0, 0, 0, 0.22);
  box-shadow: 0 2px 6px -2px rgba(0, 0, 0, 0.08);
}

button.danger {
  border-color: #b91c1c;
  background: #dc2626;
  box-shadow: 0 6px 14px -6px rgba(220, 38, 38, 0.36);
}

button.danger:hover:not(:disabled) {
  background: #b91c1c;
  border-color: #991b1b;
}

button:disabled { opacity: 0.52; cursor: not-allowed; transform: none; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 680px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.badge.ok {
  background: #111111;
  color: #ffffff;
  border-color: #111111;
}

.badge.warn {
  background: var(--warn-bg);
  color: var(--warn-text);
  border-color: var(--warn-border);
}

.notice {
  padding: 12px 15px;
  border-radius: 12px;
  margin: 12px 0;
  font-size: 14px;
  white-space: pre-wrap;
  animation: galleryIn 180ms var(--ease);
}

.notice.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.notice.ok { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); }
.notice.warn { background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--warn-border); }

.table-wrap { overflow-x: auto; border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 13px 11px; border-bottom: 1px solid rgba(0, 0, 0, 0.055); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; background: var(--surface-2); border-bottom-color: var(--border); }
tbody tr { transition: background-color 120ms ease; }
tbody tr:hover { background: #f8f9fb; }
td button { margin-top: 0; margin-bottom: 4px; padding: 6px 12px; font-size: 13px; border-radius: 8px; }

[hidden] { display: none !important; }

.stat-box {
  background: var(--surface-2);
  border: 0;
  border-radius: 13px;
  padding: 16px 18px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  transition: box-shadow 180ms var(--ease), background-color 160ms ease;
}

.stat-box:hover {
  background: #ffffff;
  box-shadow: 0 8px 20px -12px rgba(0, 0, 0, 0.14), inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.stat-num {
  margin-top: 6px;
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

#stat-founder {
  color: var(--signal);
}

@media (prefers-reduced-motion: reduce) {
  section, .card, .notice { animation: none !important; }
  button, .btn, .stat-box { transition: none !important; transform: none !important; }
}

/* ============================================================================
   Auth Page — 画廊双栏登录 (obsidian brand sheet + porcelain login sheet)
   ============================================================================ */
body.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 18px;
  padding-bottom: max(32px, env(safe-area-inset-bottom));
  background:
    radial-gradient(1100px 620px at 12% -12%, #ffffff, transparent 70%),
    radial-gradient(900px 520px at 108% 112%, rgba(229, 90, 43, 0.06), transparent 70%),
    var(--bg);
}

.auth-shell {
  width: 100%;
  max-width: 1000px;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1.04fr 1fr;
  background: var(--surface);
  border-radius: 26px;
  overflow: hidden;
  box-shadow:
    0 48px 90px -48px rgba(0, 0, 0, 0.30),
    0 2px 6px rgba(0, 0, 0, 0.04),
    inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  animation: authRise 360ms var(--ease) both;
}

@keyframes authRise {
  from { opacity: 0; transform: translate3d(0, 14px, 0) scale(0.99); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

.auth-brand {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding: 44px 42px 36px;
  color: #f4f4f5;
  background: linear-gradient(158deg, #1c1c20 0%, #111113 46%, #08080a 100%);
  overflow: hidden;
}

.auth-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
}

.auth-brand::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -120px;
  bottom: -140px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(229, 90, 43, 0.26), transparent 66%);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.auth-logo small {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(244, 244, 245, 0.78);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  vertical-align: 1px;
}

.auth-logo-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: #111113;
  background: linear-gradient(180deg, #ffffff, #e9eaee);
  box-shadow: 0 10px 22px -10px rgba(0, 0, 0, 0.7), inset 0 -1px 0 rgba(0, 0, 0, 0.08);
}

.auth-logo-mark svg { width: 22px; height: 22px; }

.auth-hero h2 {
  margin: 0;
  color: #ffffff;
  font-size: 30px;
  line-height: 1.32;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.auth-hero h2 em {
  font-style: normal;
  color: #ffffff;
  background: linear-gradient(transparent 64%, rgba(229, 90, 43, 0.55) 64%, rgba(229, 90, 43, 0.55) 92%, transparent 92%);
}

.auth-lead {
  margin: 12px 0 0;
  font-size: 14px;
  color: rgba(244, 244, 245, 0.62);
}

.auth-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.auth-features li {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  animation: authFade 420ms var(--ease) both;
}

.auth-features li:nth-child(1) { animation-delay: 120ms; }
.auth-features li:nth-child(2) { animation-delay: 170ms; }
.auth-features li:nth-child(3) { animation-delay: 220ms; }
.auth-features li:nth-child(4) { animation-delay: 270ms; }

@keyframes authFade {
  from { opacity: 0; transform: translate3d(-6px, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

.auth-feat-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.11);
}

.auth-feat-icon svg { width: 18px; height: 18px; }

.auth-features strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.45;
}

.auth-features li span:not(.auth-feat-icon) {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  color: rgba(244, 244, 245, 0.56);
}

.auth-brand-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: rgba(244, 244, 245, 0.52);
}

.auth-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 52px 48px 34px;
  background: var(--surface);
}

.auth-panel h1 { font-size: 27px; margin: 0; }
.auth-sub { margin: 6px 0 20px; font-size: 14px; }
.auth-panel .notice { margin: 0 0 6px; }

.auth-field { margin-top: 16px; }
.auth-field label { margin: 0 0 7px; }

.auth-input { position: relative; }

.auth-lead-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: #a1a4ad;
  pointer-events: none;
  transition: color 160ms ease;
}

.auth-input input {
  height: 48px;
  padding: 0 14px 0 42px;
  border-radius: 12px;
  font-size: 16px;
  background: #fafafb;
  transition: border-color 140ms ease, box-shadow 180ms ease, background-color 160ms ease;
}

.auth-input input::placeholder { color: #b2b5bd; }
.auth-input input:focus { background: #ffffff; box-shadow: 0 0 0 4px rgba(17, 17, 19, 0.07); }
.auth-input:focus-within .auth-lead-icon { color: #111113; }
.auth-input.has-toggle input { padding-right: 48px; }

.auth-input input.is-invalid {
  border-color: rgba(220, 38, 38, 0.55);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.08);
}

.pw-toggle {
  position: absolute;
  right: 7px;
  top: 50%;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: #80848e;
  background: transparent;
  box-shadow: none;
  transform: translateY(-50%);
}

.pw-toggle:hover:not(:disabled) {
  color: #111113;
  background: #eef0f2;
  border-color: transparent;
  box-shadow: none;
}

.pw-toggle:active:not(:disabled) { transform: translateY(-50%) scale(0.92); }
.pw-toggle:focus-visible { outline: 2px solid #111113; outline-offset: 1px; }
.pw-toggle svg { width: 19px; height: 19px; }
.pw-toggle .eye-off { display: none; }
.pw-toggle[aria-pressed="true"] .eye-on { display: none; }
.pw-toggle[aria-pressed="true"] .eye-off { display: block; }

.caps-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--warn-text);
  animation: galleryIn 160ms var(--ease);
}

.caps-hint svg { width: 15px; height: 15px; }

.auth-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  margin-top: 16px;
}

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}

.auth-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  accent-color: #111111;
  cursor: pointer;
}

.auth-help { font-size: 12.5px; color: var(--muted); }

.auth-submit {
  position: relative;
  width: 100%;
  height: 50px;
  margin: 22px 0 0;
  border-radius: 13px;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  gap: 9px;
}

.auth-submit .arrow { width: 18px; height: 18px; transition: transform 200ms var(--ease); }
.auth-submit:hover:not(:disabled) .arrow { transform: translateX(3px); }
.auth-submit .spinner {
  display: none;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.32);
  border-top-color: #ffffff;
  animation: authSpin 680ms linear infinite;
}
.auth-submit.is-loading .spinner { display: inline-block; }
.auth-submit.is-loading .arrow { display: none; }
.auth-submit.is-loading:disabled { opacity: 0.9; cursor: progress; }
.auth-submit.is-success:disabled { background: #18181b; opacity: 1; }

@keyframes authSpin { to { transform: rotate(360deg); } }

.auth-panel.shake { animation: authShake 380ms var(--ease); }

@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
}

.auth-trial {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-2);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.auth-trial svg { flex: none; width: 17px; height: 17px; margin-top: 1px; color: var(--signal); }
.auth-trial b { font-weight: 600; color: var(--text); }

.auth-foot { margin: 22px 0 0; font-size: 12px; text-align: center; color: #a1a4ad; }

@media (max-width: 860px) {
  body.auth-page { align-items: flex-start; padding-top: 20px; }
  .auth-shell { grid-template-columns: 1fr; max-width: 460px; border-radius: 22px; }
  .auth-brand { gap: 14px; padding: 26px 26px 24px; }
  .auth-hero h2 { font-size: 22px; }
  .auth-hero h2 br { display: none; }
  .auth-lead, .auth-features, .auth-brand-foot { display: none; }
  .auth-panel { padding: 30px 26px 26px; }
}

@media (max-width: 380px) {
  .auth-panel { padding: 26px 20px 22px; }
  .auth-help { width: 100%; }
}

/* ============================================================================
   Global micro-interaction polish for portal / admin sheets
   ============================================================================ */
:focus-visible { outline: 2px solid #111113; outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
a { color: var(--text); text-underline-offset: 3px; text-decoration-color: rgba(17, 17, 19, 0.3); transition: text-decoration-color 140ms ease; }
a:hover { text-decoration-color: currentColor; }
html { scrollbar-color: rgba(17, 17, 19, 0.22) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { border-radius: 999px; border: 3px solid transparent; background: rgba(17, 17, 19, 0.18) padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(17, 17, 19, 0.32) padding-box; }
::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  .auth-shell, .auth-features li, .auth-panel.shake, .caps-hint { animation: none !important; }
  .auth-submit .arrow, .auth-lead-icon, .auth-input input { transition: none !important; }
  .auth-submit .spinner { animation-duration: 1.6s; }
}

/* ============================================================================
   Portal & Admin Sheet Refinements
   ============================================================================ */
.portal-main {
  max-width: 860px;
}

.portal-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 6px;
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.portal-brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #111111;
  color: #ffffff;
  box-shadow: 0 8px 18px -8px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.portal-brand-mark svg { width: 22px; height: 22px; }

.portal-brand strong {
  display: block;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1.3;
}

.portal-brand span {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

.portal-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.portal-top-actions .btn,
.portal-top-actions button {
  margin: 0;
}

.portal-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.portal-sec-head h2 { margin: 0; }

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

.portal-kv {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.055);
  transition: background-color 150ms ease, box-shadow 180ms var(--ease);
}

.portal-kv:hover {
  background: #ffffff;
  box-shadow: 0 6px 16px -10px rgba(0, 0, 0, 0.12), inset 0 0 0 1px rgba(0, 0, 0, 0.13);
}

.portal-kv .k {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
}

.portal-kv .v {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}

.portal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.portal-actions button { margin: 0; }

.btn-icon {
  width: 17px;
  height: 17px;
  flex: none;
}

.portal-note {
  margin: 14px 0 0;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--muted);
}

.mt-12 { margin-top: 12px; }
.mb-12 { margin-bottom: 12px; }
.stat-num-sm { font-size: 15px; line-height: 1.45; }
.stat-num-xs { font-size: 14px; line-height: 1.45; }
.admin-backup-note { margin: 10px 0 12px; font-size: 13px; color: var(--text-2); }

@media (max-width: 680px) {
  .portal-kv-grid { grid-template-columns: 1fr; }
  .portal-actions button { width: 100%; }
}

/* ============================================================================
   Frosted Obsidian v3 & Full-Journey 120 FPS One-Shot System — Login, Portal & Admin
   (Pure achromatic obsidian #111111 + optical frosted glass, ZERO blue tap/focus/shadow)
   ============================================================================ */
*, *::before, *::after {
  -webkit-tap-highlight-color: transparent !important;
}

button, .btn, [role="button"], label.auth-check, summary {
  user-select: none;
  -webkit-user-select: none;
}

:is(button, .btn, a, [role="button"]):focus:not(:focus-visible) {
  outline: none !important;
}

:is(button, .btn, a, [role="button"]):focus-visible {
  outline: 2px solid #111111 !important;
  outline-offset: 2px !important;
}

/* Pre-first-paint warm porcelain hold (zero flash across page cross-dissolve transitions, 100% CSP safe) */
html.wb-oneshot-hold,
html.wb-oneshot-hold body {
  background: #f4f5f7 !important;
  overflow: hidden !important;
}

html.wb-oneshot-hold main {
  opacity: 0;
}

/* Keynote mask-line wrappers & coral bar draw-across */
.os-mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}

.os-mask-block {
  display: block;
  overflow: hidden;
  padding-bottom: 2px;
  margin-bottom: -2px;
}

.os-rise {
  display: inline-block;
  will-change: transform;
}

.auth-shell {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(28px) saturate(185%);
  -webkit-backdrop-filter: blur(28px) saturate(185%);
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.96),
    inset 0 0 0 1px rgba(255, 255, 255, 0.52),
    0 46px 92px -44px rgba(0, 0, 0, 0.34),
    0 4px 12px -4px rgba(0, 0, 0, 0.08);
  animation: none;
}

.auth-panel {
  background: rgba(255, 255, 255, 0.72);
}

.auth-hero h2 em {
  position: relative;
  display: inline-block;
  background: none;
  z-index: 1;
}

.auth-hero-bar {
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: 3px;
  height: 10px;
  z-index: -1;
  border-radius: 3px;
  background: rgba(229, 90, 43, 0.52);
  transform-origin: 0 50%;
  will-change: transform;
}

.auth-features li {
  animation: none;
}

.auth-feat-icon {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.20), inset 0 0 0 1px rgba(255, 255, 255, 0.10);
  will-change: transform;
}

section, .card {
  background: #ffffff;
  box-shadow:
    inset 0 1px 0 #ffffff,
    inset 0 0 0 1px rgba(0, 0, 0, 0.06),
    0 12px 30px -18px rgba(0, 0, 0, 0.13),
    0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Pure flat architectural matte obsidian buttons — ZERO UI chrome gradients, ZERO blue shadow */
button, .btn {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: #111111;
  border-color: #111111;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 10px 22px -10px rgba(0, 0, 0, 0.42),
    0 2px 5px -1px rgba(0, 0, 0, 0.18);
  transition:
    background-color 160ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 160ms ease,
    box-shadow 200ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 190ms cubic-bezier(0.34, 1.38, 0.64, 1);
}

/* Cursor-reactive optical rim sheen on primary obsidian buttons */
button:not(.secondary):not(.pw-toggle):not(.danger)::before,
.btn:not(.secondary)::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(
    140px circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, 0.18),
    transparent 68%
  );
  opacity: 0;
  transition: opacity 200ms ease;
}

button:not(.secondary):not(.pw-toggle):not(.danger):hover:not(:disabled)::before,
.btn:not(.secondary):hover::before {
  opacity: 1;
}

button:not(.secondary):not(.pw-toggle):not(.danger):hover:not(:disabled),
.btn:not(.secondary):hover {
  background: #222222;
  border-color: #222222;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.20),
    0 14px 28px -10px rgba(0, 0, 0, 0.48),
    0 3px 8px -2px rgba(0, 0, 0, 0.22);
}

button:active:not(:disabled), .btn:active {
  transform: scale(0.968);
}

button.secondary, .btn.secondary {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

button.secondary:hover:not(:disabled), .btn.secondary:hover {
  background: #f5f5f5;
  border-color: rgba(0, 0, 0, 0.24);
  box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.16);
}

.pw-toggle {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #7a7a82;
}

.pw-toggle:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #111111;
  box-shadow: none !important;
}

/* Single-shape morphing obsidian login button */
.auth-submit {
  border-radius: 12px;
}

.auth-submit-mask {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  line-height: 1.4;
}

.auth-submit .label {
  display: inline-block;
  will-change: transform;
}

.auth-submit .check {
  display: none;
  width: 19px;
  height: 19px;
  flex: none;
}

.auth-submit .check path {
  stroke-dasharray: 32;
  stroke-dashoffset: 32;
}

.auth-submit.is-success .spinner,
.auth-submit.is-success .arrow {
  display: none;
}

.auth-submit.is-success .check {
  display: inline-block;
}

.auth-submit.is-success .check path {
  animation: osCheckDraw 240ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes osCheckDraw {
  to { stroke-dashoffset: 0; }
}

.portal-kv {
  background: #f6f6f7;
}

/* Serene Apple Warm-Porcelain Cross-Dissolve Transition */
.wb-oneshot-flood,
.wb-oneshot-curtain {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  background: #f4f5f7;
  pointer-events: all;
  overflow: hidden;
}

.wb-oneshot-curtain.is-contracting {
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .wb-oneshot-flood, .wb-oneshot-curtain { display: none !important; }
  .auth-submit .check path { animation: none !important; stroke-dashoffset: 0; }
}

/* ============================================================================
   Phase 4 Governance Center, OpenAPI Explorer & Friendly Status Components
   ============================================================================ */
.gov-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.gov-tab {
  margin: 0;
  padding: 8px 14px;
  font-size: 13.5px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--text-2);
  border: 1px solid var(--border-strong);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.gov-tab:hover:not(:disabled) {
  background: #f5f5f7;
  color: var(--text);
  border-color: rgba(0, 0, 0, 0.22);
  box-shadow: 0 3px 8px -4px rgba(0, 0, 0, 0.14);
}

.gov-tab.active {
  background: #111111;
  color: #ffffff;
  border-color: #111111;
}

.gov-panel {
  margin-top: 14px;
}

.sub-card {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 13px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.sub-card h3 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.action-row button,
.action-row .btn {
  margin: 0;
}

.btn-compact {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 8px;
  margin-top: 8px;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(229, 90, 43, 0.10);
  color: #b83b12;
  border: 1px solid rgba(229, 90, 43, 0.26);
}

.mono-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  background: rgba(17, 17, 19, 0.06);
  padding: 2px 6px;
  border-radius: 6px;
  word-break: break-all;
}

.import-err-list {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 13.5px;
}

.import-err-list ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.import-err-list li {
  margin: 4px 0;
}

.receipt-preview-box {
  margin-top: 12px;
  padding: 14px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--border-strong);
}

.receipt-preview-box img {
  display: block;
  max-width: 100%;
  max-height: 280px;
  border-radius: 8px;
  margin-top: 8px;
}

.receipt-purged-box {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--warn-bg);
  color: var(--warn-text);
  border: 1px solid var(--warn-border);
  font-size: 13.5px;
}

.api-op {
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 10px;
  background: #ffffff;
  overflow: hidden;
}

.api-op-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  cursor: pointer;
  list-style: none;
}

.api-op-head::-webkit-details-marker {
  display: none;
}

.api-method {
  display: inline-block;
  min-width: 58px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.api-method-get { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.api-method-post { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.api-method-put,
.api-method-patch { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.api-method-delete { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

.api-path {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.api-summary {
  font-size: 13px;
  color: var(--text-2);
}

.api-op-body {
  padding: 10px 14px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 13.5px;
}

.api-meta-line {
  margin: 6px 0;
  color: var(--text-2);
  font-size: 13px;
}

.api-try-out {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #111113;
  color: #f4f4f5;
  font-size: 12px;
  overflow-x: auto;
  max-height: 260px;
}

.small-muted {
  font-size: 12.5px;
  color: var(--muted);
}



