:root {
  --ui-text: #b5c3d4;
  --ui-title: #e4edf7;
  --ui-strong: #d8e6f2;
  --ui-muted: #90a2b8;
  --ui-label: #a8b8cb;
  --ui-value: #85d5c0;
  --ui-primary-text: #ddfff6;
  --ui-primary-bg: rgb(19 76 69 / 96%);
  --ui-secondary-text: #bac9da;
  --ui-secondary-bg: rgb(137 166 197 / 9%);
  --ui-secondary-border: rgb(151 177 206 / 16%);
  --ui-region-bg: rgb(12 24 40 / 88%);
  --ui-region-tint: rgb(132 165 202 / 4%);
  --ui-region-border: rgb(151 177 206 / 12%);
  --ui-user-message-bg: rgb(35 67 78 / 60%);
  --ui-field-bg: rgb(5 15 28 / 76%);
  --ui-shadow-soft: 0 4px 16px rgb(0 5 14 / 12%);
  --ui-shadow-raised: 0 12px 36px rgb(0 5 14 / 28%);
  --ui-title-shadow: none;
  --ui-font-body: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", sans-serif;
  --ui-font-mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  --ui-weight-title: 650;
  --ui-weight-label: 550;
  --ui-weight-body: 400;
}

:root {
  color-scheme: light dark;
  --shared-bg: #eef4ff;
  --shared-surface: rgb(255 255 255 / 76%);
  --shared-text: #101828;
  --shared-muted: #5d6879;
  --shared-line: rgb(16 24 40 / 12%);
  --shared-accent: #405cf5;
  --shared-accent-soft: #dce4ff;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--shared-bg);
  color: var(--shared-text);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 0; }
body {
  min-width: 280px; margin: 0; overflow-x: hidden;
  background:
    radial-gradient(circle at 88% 4%, rgb(88 112 255 / 18%), transparent 28rem),
    radial-gradient(circle at 8% 34%, rgb(38 208 180 / 12%), transparent 26rem),
    var(--shared-bg);
}
a { color: inherit; }
button, input { font: inherit; }
:focus-visible { outline: 3px solid var(--shared-accent); outline-offset: 3px; }
.shared-skip { position: fixed; top: -5rem; left: 1rem; z-index: 20; padding: .65rem 1rem; background: #fff; color: #000; }
.shared-skip:focus { top: 1rem; }
.shared-header, .shared-main, .shared-footer { width: min(1120px, calc(100% - 48px)); max-width: 100%; margin-inline: auto; }
.shared-header {
  display: flex; min-width: 0; min-height: 74px; align-items: center; justify-content: space-between; gap: 1rem;
  border-bottom: 1px solid var(--shared-line);
}
.shared-brand { display: inline-flex; min-width: 0; align-items: center; gap: .7rem; font-weight: 720; text-decoration: none; }
.shared-brand-mark {
  display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 11px;
  background: var(--shared-text); color: var(--shared-bg); font-size: .72rem; letter-spacing: .06em;
}
.shared-home { color: var(--shared-muted); font-size: .9rem; text-decoration: none; }
.shared-main { min-width: 0; }
.shared-intro { max-width: 780px; padding-block: clamp(4rem, 9vw, 8rem) clamp(3rem, 7vw, 6rem); }
.shared-eyebrow, .shared-section-label { margin: 0 0 .85rem; color: var(--shared-accent); font-size: .72rem; font-weight: 780; letter-spacing: .14em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 1.35rem; font-size: clamp(3rem, 8vw, 6.4rem); font-weight: 610; letter-spacing: -.07em; line-height: .92; text-wrap: balance; }
h2 { margin-bottom: .8rem; font-size: clamp(1.8rem, 4vw, 3.2rem); font-weight: 620; letter-spacing: -.045em; line-height: 1; }
.shared-intro > p:last-child, .shared-lookup > div > p:last-child, .shared-admin p {
  max-width: 64ch; color: var(--shared-muted); font-size: 1.03rem; line-height: 1.72;
}
.shared-lookup, .shared-boundary, .shared-admin {
  display: grid; min-width: 0; grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr);
  gap: clamp(2rem, 7vw, 6rem); padding-block: clamp(2.5rem, 6vw, 5rem); border-top: 1px solid var(--shared-line);
}
.shared-token-form { display: grid; min-width: 0; align-content: start; gap: .6rem; }
.shared-token-form label { color: var(--shared-muted); font-size: .84rem; font-weight: 650; }
.shared-token-row { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) auto; gap: .65rem; }
.shared-token-row input {
  width: 100%; min-width: 0; min-height: 50px; padding: .75rem .9rem; border: 1px solid var(--shared-line);
  border-radius: 14px; background: var(--shared-surface); color: var(--shared-text); box-shadow: 0 12px 36px rgb(58 78 130 / 8%);
}
.shared-token-row button, .shared-admin-link {
  display: inline-flex; min-height: 50px; align-items: center; justify-content: center; padding: .75rem 1.05rem;
  border: 0; border-radius: 14px; background: var(--shared-text); color: var(--shared-bg); font-weight: 720; text-decoration: none;
}
.shared-token-row button:disabled { cursor: wait; opacity: .58; }
.shared-status { grid-column: 2; min-height: 1.5em; margin: 0; color: var(--shared-muted); font-size: .9rem; overflow-wrap: anywhere; }
.shared-status[data-tone="error"] { color: #a32929; }
.shared-status[data-tone="success"] { color: #17684f; }
.shared-profile {
  min-width: 0; margin-bottom: clamp(3rem, 7vw, 6rem); padding: clamp(1.4rem, 5vw, 3.4rem);
  overflow: hidden; border: 1px solid rgb(64 92 245 / 18%); border-radius: 34px;
  background: linear-gradient(135deg, rgb(255 255 255 / 90%), rgb(230 237 255 / 76%));
  box-shadow: 0 28px 90px rgb(54 78 145 / 14%);
}
.shared-profile-heading { display: flex; min-width: 0; align-items: center; gap: 1.2rem; }
.shared-profile-heading > div { min-width: 0; }
.shared-profile-heading h2 { margin: 0; overflow-wrap: anywhere; }
.shared-role { margin-bottom: .4rem; color: var(--shared-accent); font-weight: 720; overflow-wrap: anywhere; }
.shared-avatar {
  display: flex; width: 76px; height: 76px; flex: 0 0 auto; align-items: center; justify-content: center; gap: 8px;
  border-radius: 25px; background: linear-gradient(145deg, #7892ff, #344ed5); box-shadow: inset 0 1px rgb(255 255 255 / 52%);
}
.shared-avatar span { width: 17px; height: 25px; border-radius: 7px; background: #f8fbff; }
.shared-description { max-width: 72ch; margin: 2rem 0; color: var(--shared-muted); font-size: 1.05rem; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.shared-capabilities { display: flex; flex-wrap: wrap; gap: .55rem; margin: 0 0 2rem; padding: 0; list-style: none; }
.shared-capabilities li { padding: .48rem .72rem; border: 1px solid rgb(64 92 245 / 20%); border-radius: 999px; background: rgb(255 255 255 / 48%); color: #32429b; font-size: .82rem; }
.shared-metadata { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0; background: var(--shared-line); }
.shared-metadata div { min-width: 0; padding: 1rem; background: rgb(255 255 255 / 54%); }
.shared-metadata dt { color: var(--shared-muted); font-size: .76rem; }
.shared-metadata dd { margin: .35rem 0 0; font-weight: 690; overflow-wrap: anywhere; }
.shared-boundary ul { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.shared-boundary li { padding: 1.1rem 0; border-bottom: 1px solid var(--shared-line); color: var(--shared-muted); line-height: 1.62; }
.shared-admin { align-items: end; }
.shared-admin-link { justify-self: start; }
.shared-footer { display: flex; justify-content: space-between; gap: 1.5rem; padding-block: 2rem; border-top: 1px solid var(--shared-line); color: var(--shared-muted); font-size: .85rem; }
.shared-footer a { text-decoration: none; }
@media (max-width: 720px) {
  .shared-header, .shared-main, .shared-footer { width: calc(100% - 28px); }
  .shared-lookup, .shared-boundary, .shared-admin { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .shared-status { grid-column: 1; }
  .shared-profile { border-radius: 24px; }
}
@media (max-width: 440px) {
  .shared-header, .shared-main, .shared-footer { width: calc(100% - 24px); }
  .shared-brand > span:last-child { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .shared-token-row { grid-template-columns: minmax(0, 1fr); }
  .shared-token-row button { width: 100%; }
  .shared-profile-heading { align-items: flex-start; }
  .shared-avatar { width: 62px; height: 62px; border-radius: 20px; }
  .shared-avatar span { width: 14px; height: 21px; }
  .shared-metadata { grid-template-columns: minmax(0, 1fr); }
  .shared-footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
@media (prefers-color-scheme: dark) {
  :root { --shared-bg: #0b0f18; --shared-surface: rgb(21 27 41 / 82%); --shared-text: var(--ui-text); --shared-muted: var(--ui-muted); --shared-line: rgb(255 255 255 / 12%); --shared-accent: #9cacff; }
  body { background: radial-gradient(circle at 88% 4%, rgb(88 112 255 / 18%), transparent 28rem), radial-gradient(circle at 8% 34%, rgb(38 208 180 / 9%), transparent 26rem), var(--shared-bg); }
  .shared-profile { background: linear-gradient(135deg, rgb(25 32 51 / 94%), rgb(18 24 39 / 86%)); }
  .shared-capabilities li { background: rgb(255 255 255 / 5%); color: #c9d1ff; }
  .shared-metadata div { background: rgb(10 15 25 / 58%); }
  .shared-status[data-tone="error"] { color: #ff9b9b; }
  .shared-status[data-tone="success"] { color: #83e0be; }
}
@media (prefers-color-scheme: dark) {
  .shared-intro h1, .shared-profile h2, .shared-lookup h2, .shared-admin h2 { color: var(--ui-title); text-shadow: var(--ui-title-shadow); }
  .shared-token-form label, .shared-metadata dt { color: var(--ui-label); }
  .shared-metadata dd { color: var(--ui-value); }
  .shared-token-row button, .shared-admin-link { color: var(--ui-primary-text); background: var(--ui-primary-bg); border: 1px solid var(--ui-secondary-border); box-shadow: var(--ui-shadow-soft); }
  .shared-profile { border-color: var(--ui-region-border); background: linear-gradient(135deg, var(--ui-region-tint), transparent), var(--ui-region-bg); box-shadow: var(--ui-shadow-raised); }
}
@media (prefers-color-scheme: dark) and (prefers-reduced-transparency: reduce) {
  .shared-profile, .shared-token-row input { background: #0f1d2e; backdrop-filter: none; }
}
@media (forced-colors: active) {
  .shared-profile, .shared-token-row input { color: CanvasText; background: Canvas; box-shadow: none; }
  .shared-intro h1, .shared-profile h2, .shared-lookup h2, .shared-admin h2 { color: CanvasText; text-shadow: none; }
  .shared-token-row button, .shared-admin-link, .shared-brand-mark { border: 1px solid ButtonText; }
}
