:root {
  color-scheme: dark;
  --bg: #080b12;
  --bg-deep: #05070c;
  --surface: rgba(18, 24, 36, .86);
  --surface-solid: #111724;
  --surface-raised: #171e2d;
  --surface-soft: #0e141f;
  --line: rgba(166, 190, 219, .13);
  --line-strong: rgba(166, 205, 235, .24);
  --text: #edf4fb;
  --text-soft: #a4b2c5;
  --text-faint: #6d7b90;
  --accent: #72e4cd;
  --accent-strong: #4bd5bd;
  --accent-ink: #06201b;
  --blue: #6ca7ff;
  --violet: #aa79ff;
  --amber: #f3bb63;
  --red: #ff7888;
  --green: #6de0b0;
  --shadow: 0 24px 80px rgba(0, 0, 0, .32);
  --shadow-soft: 0 12px 34px rgba(0, 0, 0, .22);
  --radius-lg: 24px;
  --radius: 17px;
  --radius-sm: 11px;
  --font: Inter, "Avenir Next", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f7fb;
  --bg-deep: #eaf0f7;
  --surface: rgba(255, 255, 255, .9);
  --surface-solid: #ffffff;
  --surface-raised: #ffffff;
  --surface-soft: #edf2f8;
  --line: rgba(37, 60, 84, .12);
  --line-strong: rgba(37, 71, 96, .22);
  --text: #142234;
  --text-soft: #596b80;
  --text-faint: #8493a4;
  --accent: #18a990;
  --accent-strong: #078a74;
  --accent-ink: #effffb;
  --blue: #397ed8;
  --violet: #8154cc;
  --amber: #b97718;
  --red: #d64d5e;
  --green: #168962;
  --shadow: 0 24px 70px rgba(37, 60, 84, .13);
  --shadow-soft: 0 12px 28px rgba(37, 60, 84, .1);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3, p { margin-top: 0; }
::selection { background: color-mix(in srgb, var(--accent) 32%, transparent); }

.shell-width { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.brand { display: inline-flex; align-items: center; color: var(--text); }
.brand img { width: 195px; height: auto; display: block; }
.brand-small img { width: 148px; }
.button {
  border: 1px solid transparent;
  border-radius: 12px;
  min-height: 44px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 720;
  letter-spacing: -.01em;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button svg { width: 17px; height: 17px; }
.button-primary {
  color: var(--accent-ink);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 96%, white), color-mix(in srgb, var(--accent) 76%, var(--blue)));
  box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 20%, transparent);
}
.button-primary:hover { box-shadow: 0 15px 36px color-mix(in srgb, var(--accent) 30%, transparent); }
.button-secondary { background: var(--surface-raised); border-color: var(--line-strong); color: var(--text); }
.button-secondary:hover, .button-ghost:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 7%, var(--surface-raised)); }
.button-ghost { background: transparent; border-color: var(--line); color: var(--text-soft); }
.button-danger { background: color-mix(in srgb, var(--red) 15%, var(--surface-raised)); border-color: color-mix(in srgb, var(--red) 34%, transparent); color: var(--red); }
.button-wide { width: 100%; }
.eyebrow, .kicker {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.eyebrow { display: flex; align-items: center; gap: 10px; }
.eyebrow > span { display: inline-block; width: 25px; height: 1px; background: currentColor; }
.quiet-note { color: var(--text-faint); font-size: 13px; }
.theme-toggle, .icon-button {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: inline-grid;
  place-items: center;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  color: var(--text-soft);
  cursor: pointer;
  transition: .18s ease;
}
.theme-toggle:hover, .icon-button:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface-raised); }
.theme-toggle span { position: relative; width: 17px; height: 17px; border: 1.8px solid currentColor; border-radius: 50%; }
.theme-toggle span::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: currentColor; transform: translateX(5px); transition: transform .25s ease; }
[data-theme="light"] .theme-toggle span::after { transform: translateX(-5px); }

/* Public site */
.public-body {
  overflow-x: hidden;
  background:
    radial-gradient(circle at 78% 15%, color-mix(in srgb, var(--blue) 14%, transparent), transparent 28rem),
    radial-gradient(circle at 16% 34%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 26rem),
    var(--bg);
}
.public-nav { height: 96px; display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 10; }
.public-nav-actions { display: flex; align-items: center; gap: 10px; }
.hero {
  min-height: 680px;
  padding: 80px 0 105px;
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  align-items: center;
  gap: 60px;
}
.hero-copy { position: relative; z-index: 2; }
.hero h1 {
  margin: 25px 0 26px;
  max-width: 760px;
  font-size: clamp(56px, 6vw, 88px);
  line-height: .97;
  letter-spacing: -.065em;
  font-weight: 760;
}
.hero h1 em {
  font-style: normal;
  font-weight: 520;
  background: linear-gradient(96deg, var(--accent), var(--blue) 57%, var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lead { max-width: 630px; color: var(--text-soft); font-size: clamp(17px, 2vw, 21px); line-height: 1.7; }
.hero-actions { margin-top: 34px; display: flex; align-items: center; gap: 21px; }
.hero-actions .button { min-height: 53px; padding-inline: 23px; border-radius: 14px; }
.trust-row { margin-top: 52px; display: flex; flex-wrap: wrap; gap: 22px; color: var(--text-faint); font-size: 12px; }
.trust-row span { display: flex; align-items: center; gap: 7px; }
.trust-row i { display: grid; place-items: center; width: 17px; height: 17px; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent); border-radius: 50%; font-style: normal; font-size: 9px; }
.hero-specimen { position: relative; min-height: 500px; display: grid; place-items: center; }
.crystal-stage { position: relative; width: 360px; transform: rotate(3deg); filter: drop-shadow(0 40px 55px rgba(31, 76, 150, .32)); animation: float 7s ease-in-out infinite; }
.crystal-stage > img { width: 320px; display: block; margin: auto; }
.orb { position: absolute; border-radius: 50%; filter: blur(2px); }
.orb-one { width: 360px; height: 360px; background: color-mix(in srgb, var(--blue) 10%, transparent); box-shadow: inset 0 0 80px color-mix(in srgb, var(--accent) 10%, transparent); }
.orb-two { width: 520px; height: 520px; border: 1px solid var(--line); opacity: .65; }
.mineral-card {
  position: absolute;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(202, 229, 255, .2);
  border-radius: 14px;
  background: rgba(14, 20, 31, .68);
  color: #eef7ff;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-soft);
  transform: rotate(-3deg);
}
[data-theme="light"] .mineral-card { background: rgba(255, 255, 255, .75); color: #142234; }
.mineral-card-one { top: 70px; right: -38px; display: grid; grid-template-columns: 1fr auto; }
.mineral-card-one span { grid-column: 1/-1; font-size: 11px; color: var(--accent); font-weight: 750; }
.mineral-card-one b { font-size: 22px; }
.mineral-card-one small { color: var(--text-soft); }
.mineral-card-two { left: -45px; bottom: 85px; font-size: 12px; font-weight: 700; }
.mineral-card-two i { width: 8px; height: 8px; background: var(--green); border-radius: 50%; box-shadow: 0 0 12px var(--green); }
@keyframes float { 0%,100% { transform: rotate(3deg) translateY(0); } 50% { transform: rotate(1deg) translateY(-14px); } }
.feature-band { border-block: 1px solid var(--line); background: color-mix(in srgb, var(--surface-soft) 78%, transparent); }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.feature-grid article { position: relative; min-height: 250px; padding: 58px 52px; border-right: 1px solid var(--line); }
.feature-grid article:first-child { border-left: 1px solid var(--line); }
.feature-number { color: var(--accent); font-size: 11px; letter-spacing: .18em; }
.feature-grid h2 { margin: 29px 0 12px; font-size: 22px; letter-spacing: -.03em; }
.feature-grid p { color: var(--text-soft); font-size: 14px; line-height: 1.75; }
.mineral-story { padding-block: 130px; display: grid; grid-template-columns: .45fr 1fr; gap: 100px; align-items: center; }
.story-mark { width: 260px; height: 260px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--blue) 12%, transparent), transparent 67%); }
.story-mark img { width: 130px; filter: drop-shadow(0 22px 30px rgba(72, 117, 210, .33)); }
.mineral-story h2 { margin: 22px 0; font-size: clamp(34px, 4.4vw, 56px); line-height: 1.08; letter-spacing: -.052em; }
.mineral-story p { max-width: 700px; color: var(--text-soft); font-size: 17px; line-height: 1.8; }
.public-footer { padding-block: 45px; display: flex; justify-content: space-between; align-items: flex-end; border-top: 1px solid var(--line); }
.public-footer p { margin: 10px 0 0; color: var(--text-faint); font-size: 12px; }
.footer-links { display: flex; gap: 24px; color: var(--text-soft); font-size: 13px; }
.footer-links a:hover { color: var(--accent); }
.profile-page { min-height: calc(100vh - 200px); padding-block: 75px 120px; display: grid; grid-template-columns: 340px 1fr; gap: 80px; }
.profile-intro { position: sticky; top: 40px; align-self: start; }
.profile-gem { width: 84px; height: 84px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); margin-bottom: 28px; }
.profile-gem img { height: 62px; }
.profile-intro h1 { margin: 17px 0 15px; font-size: 43px; letter-spacing: -.045em; }
.profile-intro p { color: var(--text-soft); }
.profile-website { color: var(--accent); font-weight: 700; font-size: 13px; }
.profile-links { display: grid; gap: 14px; align-content: start; }
.profile-link-card { display: flex; align-items: center; justify-content: space-between; padding: 25px 27px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); transition: .2s ease; }
.profile-link-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.profile-link-card small { color: var(--accent); font-size: 11px; text-transform: uppercase; letter-spacing: .09em; }
.profile-link-card strong { display: block; margin-top: 7px; font-size: 19px; }
.profile-link-card p { margin: 7px 0 0; color: var(--text-soft); }
.profile-link-card i { font-style: normal; font-size: 25px; color: var(--text-faint); }
.preview-page { min-height: calc(100vh - 200px); display: grid; place-items: center; padding-block: 70px 110px; }
.preview-card { width: min(620px, 100%); padding: 48px; border: 1px solid var(--line); border-radius: 28px; background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.preview-icon { width: 88px; height: 88px; margin: 0 auto 24px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 25px; background: var(--surface-soft); }
.preview-icon img { height: 68px; }
.preview-card .eyebrow { justify-content: center; }
.preview-card h1 { margin: 15px 0 10px; font-size: 34px; letter-spacing: -.04em; }
.preview-card > p { color: var(--text-soft); }
.destination-panel { margin: 28px 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); text-align: left; }
.destination-panel small, .destination-panel span { display: block; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.destination-panel strong { display: block; margin: 3px 0; }
.report-link { display: block; margin-top: 22px; color: var(--text-faint); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.public-form { margin-top: 27px; display: grid; gap: 16px; text-align: left; }
.public-form label { color: var(--text-soft); font-size: 12px; font-weight: 700; }
.public-form label > span { float: right; color: var(--text-faint); font-weight: 500; }
.public-form input, .public-form select, .public-form textarea { margin-top: 7px; }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.honeypot { position: absolute !important; left: -10000px; }
.public-alert, .public-success { margin: 23px 0; padding: 16px; border-radius: 12px; text-align: left; }
.public-alert strong, .public-alert span, .public-success strong, .public-success span { display: block; }
.public-alert span, .public-success span { margin-top: 3px; }
.public-alert { color: var(--red); background: color-mix(in srgb, var(--red) 9%, transparent); border: 1px solid color-mix(in srgb, var(--red) 20%, transparent); }
.public-success { display: grid; gap: 3px; color: var(--green); background: color-mix(in srgb, var(--green) 9%, transparent); border: 1px solid color-mix(in srgb, var(--green) 20%, transparent); }
.content-page { min-height: calc(100vh - 190px); padding-block: 80px 130px; }
.content-page > h1 { margin: 15px 0 45px; font-size: 52px; letter-spacing: -.05em; }
.content-page article { max-width: 740px; color: var(--text-soft); font-size: 16px; line-height: 1.8; }
.content-page article h2 { margin-top: 35px; color: var(--text); }
.installer-card { width: min(100%, 620px); }
.installer-brand { margin: 0 auto 35px; justify-content: center; }
.install-steps { display: grid; grid-template-columns: 30px 1fr; gap: 13px 12px; margin: 25px 0; text-align: left; align-items: start; }
.install-steps span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); font-size: 11px; font-weight: 800; }
.install-steps p { margin: 2px 0 0; }
code { padding: .12em .38em; border: 1px solid var(--line); border-radius: 5px; color: var(--accent); background: var(--surface-soft); font: 500 .88em var(--font-mono); }
.error-page { min-height: calc(100vh - 200px); padding-block: 90px 120px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.error-crystal { width: 120px; height: 120px; margin-bottom: 24px; filter: grayscale(.3); opacity: .8; }
.error-page h1 { margin: 13px 0 9px; font-size: 42px; letter-spacing: -.045em; }
.error-page p { color: var(--text-soft); margin-bottom: 25px; }
.public-empty { padding: 35px; color: var(--text-faint); border: 1px dashed var(--line-strong); border-radius: var(--radius); text-align: center; }

/* Forms */
label { display: block; color: var(--text-soft); font-size: 12px; font-weight: 700; }
label > span, legend + span { color: var(--text-faint); font-weight: 500; }
input, select, textarea {
  width: 100%;
  min-height: 47px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 11px 13px;
  background: color-mix(in srgb, var(--surface-soft) 88%, transparent);
  color: var(--text);
  outline: none;
  transition: border .17s ease, box-shadow .17s ease, background .17s ease;
}
textarea { resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--text-faint); opacity: .8; }
input:focus, select:focus, textarea:focus { border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent); background: var(--surface-solid); }
select { cursor: pointer; }

/* Login */
.app-body { min-height: 100vh; overflow-x: hidden; }
.boot-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 20px; color: var(--text-faint); }
.boot-screen img { width: 160px; }
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr; background: var(--bg); }
.login-art { position: relative; overflow: hidden; min-height: 100vh; padding: 50px 6.5vw; display: flex; flex-direction: column; background:
  radial-gradient(circle at 78% 50%, rgba(63, 113, 218, .27), transparent 27rem),
  linear-gradient(145deg, #070a10, #0b111d 62%, #0b1521); color: #eef7ff; }
.login-art::before { content: ""; position: absolute; width: 800px; height: 800px; border: 1px solid rgba(181, 214, 255, .08); border-radius: 50%; right: -310px; top: 7%; }
.login-art .brand img { width: 200px; }
.login-art-copy { position: relative; z-index: 2; margin: auto 0; max-width: 670px; }
.login-art-copy h1 { margin: 25px 0; font-size: clamp(44px, 4.8vw, 72px); line-height: 1.02; letter-spacing: -.057em; }
.login-art-copy p { max-width: 540px; color: #95a9bf; font-size: 17px; line-height: 1.75; }
.login-crystal { position: absolute; width: 330px; right: -45px; bottom: -45px; opacity: .77; transform: rotate(9deg); filter: drop-shadow(0 30px 60px rgba(59, 113, 210, .4)); }
.login-art > small { position: relative; color: #62758e; }
.login-spark { position: absolute; border-radius: 50%; background: #82eeda; box-shadow: 0 0 18px #82eeda; }
.spark-one { width: 5px; height: 5px; right: 29%; top: 21%; }
.spark-two { width: 3px; height: 3px; right: 12%; top: 43%; background: #9f75ff; box-shadow: 0 0 14px #9f75ff; }
.login-panel { position: relative; display: grid; place-items: center; padding: 55px; background:
  linear-gradient(var(--line) 1px, transparent 1px),
  linear-gradient(90deg, var(--line) 1px, transparent 1px), var(--bg);
  background-size: 45px 45px; }
.login-panel::before { content: ""; position: absolute; inset: 0; background: var(--bg); opacity: .72; }
.login-theme { position: absolute; z-index: 2; top: 26px; right: 28px; }
.login-form { position: relative; z-index: 2; width: min(420px, 100%); padding: 43px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.login-mark { width: 54px; height: 54px; margin-bottom: 27px; }
.login-form h2 { margin: 9px 0 7px; font-size: 28px; letter-spacing: -.035em; }
.login-form > p { margin-bottom: 28px; color: var(--text-soft); }
.login-form label { margin-top: 17px; }
.login-form label input { margin-top: 7px; }
.login-form .button { margin-top: 24px; min-height: 50px; }
.login-security { margin-top: 22px; display: flex; justify-content: center; gap: 7px; color: var(--text-faint); font-size: 11px; }
.login-security svg { width: 13px; }
.form-alert { padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--red) 25%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--red) 9%, transparent); color: var(--red); font-size: 12px; }

/* Workspace */
.workspace { min-height: 100vh; display: grid; grid-template-columns: 246px 1fr; }
.sidebar {
  position: fixed;
  z-index: 50;
  inset: 0 auto 0 0;
  width: 246px;
  display: flex;
  flex-direction: column;
  background: color-mix(in srgb, var(--bg-deep) 95%, transparent);
  border-right: 1px solid var(--line);
}
.sidebar-brand { height: 84px; padding: 0 22px; display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.sidebar-brand .brand img { width: 170px; }
.sidebar-close { display: none; margin-left: auto; border: 0; background: none; color: var(--text-soft); font-size: 25px; cursor: pointer; }
.sidebar-context { margin: 24px 18px 15px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 6%, transparent), color-mix(in srgb, var(--blue) 4%, transparent)); }
.sidebar-context span { display: block; color: var(--text-faint); font-size: 9px; text-transform: uppercase; letter-spacing: .14em; }
.sidebar-context strong { display: block; margin-top: 2px; font-size: 12px; }
.sidebar-nav { padding: 0 13px; display: grid; gap: 3px; overflow: auto; }
.sidebar-nav a { position: relative; height: 43px; padding: 0 13px; display: flex; align-items: center; gap: 12px; border-radius: 10px; color: var(--text-soft); font-size: 13px; font-weight: 650; transition: .16s ease; }
.sidebar-nav a svg { width: 18px; height: 18px; color: var(--text-faint); }
.sidebar-nav a:hover { color: var(--text); background: var(--surface-soft); }
.sidebar-nav a.active { color: var(--text); background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 13%, transparent), color-mix(in srgb, var(--blue) 5%, transparent)); }
.sidebar-nav a.active::before { content: ""; position: absolute; left: 0; width: 2px; height: 21px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.sidebar-nav a.active svg { color: var(--accent); }
.nav-heading { margin: 22px 13px 7px; color: var(--text-faint); font-size: 9px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.sidebar-footer { margin-top: auto; padding: 17px 14px; display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); }
.user-chip { min-width: 0; flex: 1; display: flex; align-items: center; gap: 10px; }
.user-chip > span, .user-avatar { flex: 0 0 auto; width: 35px; height: 35px; display: grid; place-items: center; border-radius: 11px; background: linear-gradient(135deg, var(--accent), var(--blue)); color: var(--accent-ink); font-size: 12px; font-weight: 850; }
.user-chip div { min-width: 0; }
.user-chip strong, .user-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip strong { font-size: 11px; }
.user-chip small { color: var(--text-faint); font-size: 9px; text-transform: capitalize; }
.sidebar-footer .icon-button { width: 35px; height: 35px; }
.sidebar-scrim { display: none; }
.workspace-main { grid-column: 2; min-width: 0; }
.topbar { height: 84px; padding: 0 clamp(24px, 4vw, 58px); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: blur(18px); }
.topbar-trail { display: flex; align-items: center; gap: 9px; color: var(--text-faint); font-size: 11px; }
.topbar-trail i { opacity: .45; }
.topbar-trail strong { color: var(--text-soft); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-actions .icon-button { width: 38px; height: 38px; }
.quick-create { min-height: 39px; padding: 0 14px; display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 11px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; cursor: pointer; }
.quick-create svg { width: 15px; height: 15px; }
.mobile-menu { display: none; }
.page { width: min(1320px, calc(100% - clamp(40px, 8vw, 112px))); margin: 0 auto; padding: 48px 0 90px; }
.page-header { margin-bottom: 34px; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.page-header h1 { margin: 8px 0 6px; font-size: clamp(31px, 3.6vw, 46px); line-height: 1.08; letter-spacing: -.052em; }
.page-header p { margin: 0; color: var(--text-soft); font-size: 14px; }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.panel-head span { display: block; color: var(--text-faint); font-size: 9px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.panel-head h2 { margin: 4px 0 0; font-size: 19px; letter-spacing: -.025em; }
.panel-head > svg { width: 21px; height: 21px; color: var(--accent); }
.text-button { padding: 5px; border: 0; background: none; color: var(--accent); font-size: 11px; font-weight: 750; cursor: pointer; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.metric-card { min-height: 176px; padding: 22px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); }
.metric-featured { background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 9%, var(--surface)), color-mix(in srgb, var(--blue) 5%, var(--surface))); }
.metric-icon { width: 34px; height: 34px; margin-bottom: auto; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--accent); background: var(--surface-soft); }
.metric-icon svg { width: 16px; }
.metric-card > span { margin-top: 20px; color: var(--text-soft); font-size: 11px; font-weight: 700; }
.metric-card > strong { margin-top: 2px; font-size: 34px; line-height: 1; letter-spacing: -.045em; }
.metric-card > small { margin-top: 8px; color: var(--text-faint); font-size: 10px; }
.dashboard-grid { margin-top: 14px; display: grid; grid-template-columns: 1.65fr .75fr; gap: 14px; }
.activity-panel, .quick-panel, .recent-panel { padding: 24px; }
.activity-panel { min-height: 340px; position: relative; overflow: hidden; }
.chart-summary { margin-top: 27px; display: flex; align-items: baseline; gap: 9px; }
.chart-summary strong { font-size: 30px; letter-spacing: -.04em; }
.chart-summary span { color: var(--text-faint); font-size: 11px; }
.spark-chart { width: 100%; height: 150px; overflow: visible; }
.spark-chart .chart-area { fill: url(#chartFill); stroke: none; }
.spark-chart .chart-line { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark-chart circle { fill: var(--surface-solid); stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-axis { display: flex; justify-content: space-between; color: var(--text-faint); font-size: 9px; }
.quick-panel { position: relative; overflow: hidden; display: flex; flex-direction: column; }
.quick-panel > p { position: relative; z-index: 2; max-width: 230px; margin: 80px 0 20px; color: var(--text-soft); font-size: 12px; }
.quick-panel .button { position: relative; z-index: 2; margin-top: auto; }
.quick-crystal { position: absolute; width: 150px; height: 180px; right: -25px; top: 57px; transform: rotate(12deg); opacity: .7; }
.recent-panel { margin-top: 14px; }
.recent-list { margin-top: 18px; display: grid; }
.recent-link { min-width: 0; padding: 13px 3px; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 24px; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.recent-link:last-child { border: 0; }
.link-glyph { width: 37px; height: 37px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); color: var(--accent); }
.link-glyph svg { width: 16px; }
.recent-link > div { min-width: 0; }
.recent-link > div > div { display: flex; align-items: center; gap: 9px; }
.recent-link strong, .recent-link small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-link strong { font-size: 12px; }
.recent-link small { margin-top: 3px; color: var(--text-faint); font-size: 10px; }
.recent-metric { text-align: right; }
.recent-metric strong { font-size: 15px; }
.recent-metric span { display: block; color: var(--text-faint); font-size: 9px; }
.row-arrow { color: var(--text-faint); }
.status-badge { width: fit-content; display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 999px; font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.status-badge i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.status-active { color: var(--green); background: color-mix(in srgb, var(--green) 9%, transparent); }
.status-draft { color: var(--amber); background: color-mix(in srgb, var(--amber) 9%, transparent); }
.status-disabled { color: var(--text-faint); background: color-mix(in srgb, var(--text-faint) 9%, transparent); }

/* Links */
.filter-bar { margin-bottom: 18px; }
.filter-bar form { display: grid; grid-template-columns: minmax(250px, 1fr) 170px 170px auto; gap: 9px; }
.search-box { position: relative; }
.search-box svg { position: absolute; left: 14px; top: 14px; z-index: 1; width: 17px; color: var(--text-faint); }
.search-box input { padding-left: 40px; }
.link-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.link-card { position: relative; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); overflow: hidden; transition: transform .18s ease, border-color .18s ease; }
.link-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.link-card-main { min-height: 220px; padding: 23px; cursor: pointer; }
.link-card-top { display: flex; align-items: center; gap: 8px; }
.link-card-top .link-glyph { margin-right: auto; }
.visibility-badge { padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--text-faint); font-size: 8px; text-transform: uppercase; letter-spacing: .07em; }
.link-card h2 { margin: 21px 0 4px; font-size: 19px; letter-spacing: -.025em; }
.link-card-main > a { color: var(--accent); font-size: 12px; font-weight: 700; }
.link-card-main > p { margin: 7px 0 17px; color: var(--text-faint); font-size: 11px; }
.tag-row { display: flex; gap: 5px; flex-wrap: wrap; }
.tag-row span { padding: 4px 7px; border-radius: 7px; background: var(--surface-soft); color: var(--text-soft); font-size: 9px; }
.link-card-stats { padding: 13px 23px; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.link-card-stats div + div { padding-left: 18px; border-left: 1px solid var(--line); }
.link-card-stats strong, .link-card-stats span { display: block; }
.link-card-stats strong { font-size: 12px; }
.link-card-stats span { color: var(--text-faint); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.link-card-actions { padding: 10px 17px; display: flex; justify-content: flex-end; gap: 5px; }
.link-card-actions .icon-button { width: 34px; height: 34px; border: 0; background: transparent; }
.link-card-actions svg { width: 15px; }
.pagination { margin-top: 25px; display: flex; justify-content: center; gap: 6px; }
.pagination button { width: 35px; height: 35px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text-soft); cursor: pointer; }
.pagination button.active { border-color: var(--accent); color: var(--accent); }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 17px; align-items: start; }
.editor-main { display: grid; gap: 14px; }
.form-panel { position: relative; padding: 27px; display: grid; grid-template-columns: 1fr 1fr; gap: 19px; }
.section-number { position: absolute; top: 27px; right: 27px; color: var(--text-faint); font-size: 10px; letter-spacing: .18em; }
.section-heading { grid-column: 1/-1; padding-right: 40px; margin-bottom: 4px; }
.section-heading h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: -.025em; }
.section-heading p { margin: 0; color: var(--text-faint); font-size: 11px; }
.form-panel label input, .form-panel label select, .form-panel label textarea { margin-top: 7px; }
.form-panel label small { display: block; margin-top: 6px; color: var(--text-faint); font-size: 9px; font-weight: 500; }
.field-wide { grid-column: 1/-1; }
.input-prefix { margin-top: 7px; display: flex; align-items: stretch; }
.input-prefix > span { padding: 0 12px; display: grid; place-items: center; border: 1px solid var(--line); border-right: 0; border-radius: 11px 0 0 11px; background: var(--surface-soft); color: var(--text-faint); font-size: 11px; font-weight: 600; }
.input-prefix input { margin: 0 !important; border-radius: 0 11px 11px 0; }
.editor-aside { position: sticky; top: 104px; display: grid; gap: 9px; }
.link-preview-panel { min-height: 325px; padding: 23px; overflow: hidden; position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; background:
  radial-gradient(circle at 50% 28%, color-mix(in srgb, var(--blue) 18%, transparent), transparent 8rem), var(--surface); }
.preview-label { align-self: flex-start; color: var(--text-faint); font-size: 8px; text-transform: uppercase; letter-spacing: .13em; }
.preview-gem { height: 130px; margin-top: 4px; }
.preview-gem img { height: 125px; filter: drop-shadow(0 17px 25px rgba(55, 103, 190, .33)); }
.link-preview-panel > small { color: var(--accent); font-weight: 700; }
.link-preview-panel > strong { max-width: 100%; margin-top: 7px; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-preview-panel > span { color: var(--text-faint); font-size: 11px; }
.preview-destination { width: 100%; margin-top: auto; padding: 10px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.preview-destination i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 7px var(--green); }
.preview-destination span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-soft); font-size: 9px; }
.editor-save { min-height: 50px; }
.danger-button { min-height: 40px; border: 0; display: flex; align-items: center; justify-content: center; gap: 8px; background: none; color: var(--red); font-size: 10px; cursor: pointer; }
.danger-button svg { width: 14px; }
.success-stage { position: relative; min-height: 650px; padding-top: 25px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.success-halo { position: absolute; top: -80px; width: 460px; height: 300px; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 13%, transparent), transparent 68%); pointer-events: none; }
.success-gem { position: relative; height: 150px; }
.success-gem img { height: 145px; filter: drop-shadow(0 20px 30px rgba(58, 109, 202, .34)); }
.success-stage h1 { margin: 11px 0 6px; font-size: 39px; letter-spacing: -.05em; }
.success-stage > p { color: var(--text-soft); }
.result-link { width: min(720px, 100%); margin: 23px 0 14px; padding: 16px 17px 16px 21px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); border-radius: 15px; background: color-mix(in srgb, var(--accent) 5%, var(--surface)); text-align: left; }
.result-link small, .result-link strong { display: block; }
.result-link small { color: var(--text-faint); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
.result-link strong { margin-top: 2px; color: var(--accent); font-size: 17px; }
.result-grid { width: min(720px, 100%); display: grid; grid-template-columns: 250px 1fr; gap: 14px; text-align: left; }
.qr-result, .result-details { padding: 22px; }
.qr-result { display: grid; place-items: center; }
#qrCanvas svg, #modalQr svg { display: block; width: 160px; height: 160px; padding: 8px; border-radius: 10px; background: white; color: #071019; }
#qrCanvas svg path, #modalQr svg path { fill: currentColor; stroke: none; }
.result-details { display: flex; flex-direction: column; }
.result-details > span { color: var(--text-faint); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
.result-details > strong { margin-top: 7px; font-size: 21px; }
.result-details > p { color: var(--text-soft); font-size: 11px; word-break: break-all; }
.result-details > div { margin-top: auto; display: flex; gap: 7px; }
.success-actions { margin-top: 18px; display: flex; gap: 9px; }

/* Analytics */
.period-switch { width: fit-content; margin: -18px 0 16px; padding: 4px; display: flex; gap: 3px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.period-switch button { min-height: 31px; padding: 0 11px; border: 0; border-radius: 8px; background: transparent; color: var(--text-faint); font-size: 9px; font-weight: 750; cursor: pointer; }
.period-switch button.active { color: var(--text); background: var(--surface-raised); box-shadow: var(--shadow-soft); }
.analytics-hero { padding: 27px; display: grid; grid-template-columns: 230px 1fr; align-items: center; gap: 35px; }
.analytics-summary { padding-right: 30px; border-right: 1px solid var(--line); }
.analytics-summary span, .analytics-summary strong, .analytics-summary small { display: block; }
.analytics-summary span { color: var(--text-soft); font-size: 11px; }
.analytics-summary strong { margin: 7px 0; font-size: 48px; letter-spacing: -.055em; }
.analytics-summary small { color: var(--text-faint); font-size: 9px; }
.analytics-chart .spark-chart { height: 180px; }
.analytics-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.analytics-grid > article { min-width: 0; padding: 23px; }
.detail-bars { margin-top: 23px; display: grid; gap: 13px; }
.detail-bars > div > span { display: flex; justify-content: space-between; gap: 12px; }
.detail-bars b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.detail-bars small { color: var(--text-faint); font-size: 9px; }
.detail-bars progress { width: 100%; height: 3px; margin-top: 6px; display: block; overflow: hidden; border: 0; border-radius: 4px; appearance: none; background: var(--surface-soft); }
.detail-bars progress::-webkit-progress-bar { border-radius: 4px; background: var(--surface-soft); }
.detail-bars progress::-webkit-progress-value { border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--blue)); }
.detail-bars progress::-moz-progress-bar { border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--blue)); }
.table-panel { margin-top: 14px; padding: 24px; }
.data-table { margin-top: 18px; }
.table-head, .table-row { display: grid; grid-template-columns: 1fr 100px 100px; align-items: center; gap: 14px; }
.table-head { padding: 8px 12px; color: var(--text-faint); font-size: 8px; text-transform: uppercase; letter-spacing: .1em; }
.table-row { width: 100%; padding: 13px 12px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--text); text-align: left; cursor: pointer; }
.table-row:hover { background: var(--surface-soft); }
.table-row strong, .table-row small { display: block; }
.table-row strong { font-size: 11px; }
.table-row small { color: var(--text-faint); font-size: 9px; }
.table-row > b { font-size: 11px; font-weight: 650; }
.privacy-note { margin-top: 14px; padding: 16px 19px; display: flex; gap: 12px; border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line)); border-radius: 13px; background: color-mix(in srgb, var(--accent) 4%, transparent); }
.privacy-note svg { color: var(--accent); flex: 0 0 auto; }
.privacy-note strong, .privacy-note span { display: block; }
.privacy-note strong { font-size: 10px; }
.privacy-note span { color: var(--text-soft); font-size: 9px; }
.compact-empty { padding: 25px 5px; color: var(--text-faint); font-size: 10px; text-align: center; }

/* Profile, safety, users, API, settings */
.profile-editor { display: grid; grid-template-columns: .8fr 1.2fr; gap: 15px; align-items: start; }
.profile-preview { position: sticky; top: 104px; overflow: hidden; min-height: 470px; }
.profile-cover { position: relative; height: 220px; display: grid; place-items: center; overflow: hidden; background: linear-gradient(145deg, #0b1f2a, #162653 55%, #302156); }
.profile-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(7, 10, 16, .65)); }
.profile-cover img { position: relative; z-index: 2; height: 190px; transform: rotate(5deg); filter: drop-shadow(0 20px 30px rgba(0,0,0,.25)); }
.profile-orb { position: absolute; width: 280px; height: 280px; border: 1px solid rgba(255,255,255,.11); border-radius: 50%; }
.profile-avatar { position: relative; z-index: 3; width: 66px; height: 66px; margin: -33px 0 0 27px; display: grid; place-items: center; border: 4px solid var(--surface-solid); border-radius: 19px; background: linear-gradient(135deg, var(--accent), var(--blue)); color: var(--accent-ink); font-size: 22px; font-weight: 850; }
.profile-preview-copy { padding: 20px 27px 27px; }
.profile-preview-copy small { color: var(--accent); font-size: 9px; text-transform: uppercase; letter-spacing: .11em; }
.profile-preview-copy h2 { margin: 5px 0 9px; font-size: 23px; }
.profile-preview-copy p { color: var(--text-soft); font-size: 11px; }
.profile-preview-copy > span { color: var(--text-faint); font-size: 9px; }
.profile-fields { grid-template-columns: 1fr 1fr; }
.toggle-field { display: flex !important; align-items: center; gap: 12px; cursor: pointer; }
.toggle-field > input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-field > span { flex: 0 0 auto; width: 42px; height: 23px; padding: 3px; border-radius: 99px; background: var(--surface-soft); border: 1px solid var(--line); transition: .18s ease; }
.toggle-field > span i { display: block; width: 15px; height: 15px; border-radius: 50%; background: var(--text-faint); transition: .18s ease; }
.toggle-field input:checked + span { background: color-mix(in srgb, var(--accent) 20%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.toggle-field input:checked + span i { transform: translateX(19px); background: var(--accent); }
.toggle-field strong, .toggle-field small { display: block; }
.toggle-field small { color: var(--text-faint); font-size: 9px; font-weight: 500; }
.safety-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 14px; align-items: start; }
.safety-grid > .panel { padding: 24px; }
.panel-count { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: color-mix(in srgb, var(--amber) 10%, transparent); color: var(--amber); }
.report-list, .blocked-list { margin-top: 18px; display: grid; }
.report-row { padding: 16px 0; display: flex; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); }
.report-row > div:first-child { min-width: 0; }
.report-row strong { display: block; margin-top: 8px; font-size: 11px; }
.report-row p { margin: 4px 0; color: var(--text-soft); font-size: 10px; }
.report-row small { display: block; color: var(--text-faint); font-size: 8px; word-break: break-all; }
.row-actions { display: flex; align-items: center; gap: 5px; }
.row-actions .button { min-height: 34px; padding-inline: 10px; font-size: 9px; }
.compact-form { margin-top: 18px; display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; }
.compact-form input, .compact-form .button { min-height: 39px; font-size: 10px; }
.blocked-row { padding: 12px 0; display: grid; grid-template-columns: 31px 1fr 35px; align-items: center; gap: 9px; border-top: 1px solid var(--line); }
.blocked-row > span { color: var(--red); }
.blocked-row strong, .blocked-row small { display: block; }
.blocked-row strong { font-size: 10px; }
.blocked-row small { color: var(--text-faint); font-size: 8px; }
.blocked-row .icon-button { width: 31px; height: 31px; border: 0; background: none; }
.role-summary { margin-bottom: 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.role-summary article { padding: 16px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.role-dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 10px currentColor; }
.role-dot.admin { color: var(--violet); background: currentColor; }
.role-dot.staff { color: var(--accent); background: currentColor; }
.role-dot.user { color: var(--blue); background: currentColor; }
.role-summary strong, .role-summary small { display: block; }
.role-summary strong { font-size: 11px; }
.role-summary small { color: var(--text-faint); font-size: 8px; }
.user-list { overflow: hidden; }
.user-row { width: 100%; padding: 15px 19px; display: grid; grid-template-columns: 39px minmax(0, 1fr) 80px 70px 18px; align-items: center; gap: 12px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); text-align: left; cursor: pointer; }
.user-row:last-child { border: 0; }
.user-row:hover { background: var(--surface-soft); }
.user-row strong, .user-row small { display: block; }
.user-row strong { font-size: 11px; }
.user-row small { color: var(--text-faint); font-size: 9px; }
.role-chip { width: fit-content; padding: 4px 8px; border-radius: 99px; font-size: 8px; text-transform: uppercase; letter-spacing: .07em; }
.role-admin { color: var(--violet); background: color-mix(in srgb, var(--violet) 10%, transparent); }
.role-staff { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.role-user { color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, transparent); }
.user-state { color: var(--text-faint); font-size: 9px; }
.user-state.active { color: var(--green); }
.api-intro { margin-bottom: 14px; padding: 23px; display: flex; align-items: center; justify-content: space-between; gap: 25px; background: linear-gradient(135deg, color-mix(in srgb, var(--blue) 8%, var(--surface)), color-mix(in srgb, var(--violet) 5%, var(--surface))); }
.api-intro > div { display: flex; align-items: center; gap: 17px; }
.api-orbit { flex: 0 0 auto; width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 14px; color: var(--accent); background: var(--surface-soft); }
.api-intro h2 { margin: 0 0 3px; font-size: 17px; }
.api-intro p { margin: 0; max-width: 560px; color: var(--text-soft); font-size: 10px; }
.api-intro > code, .api-client-row code, .token-modal code { padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); color: var(--accent); font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; }
.api-list { overflow: hidden; }
.api-client-row { padding: 17px 19px; display: grid; grid-template-columns: 42px minmax(0, 1fr) 110px 38px; align-items: center; gap: 13px; border-bottom: 1px solid var(--line); }
.api-client-icon { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; color: var(--accent); background: var(--surface-soft); }
.api-client-row strong, .api-client-row small, .api-client-row code { display: block; }
.api-client-row strong { font-size: 11px; }
.api-client-row small { color: var(--text-faint); font-size: 8px; }
.api-client-row code { width: fit-content; margin-top: 5px; padding: 3px 6px; font-size: 8px; }
.api-client-row > div:nth-child(3) { text-align: right; }
.settings-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.settings-layout > .form-panel { align-content: start; }
.settings-warning { grid-column: 1/-1; padding: 13px; display: flex; gap: 9px; border: 1px solid color-mix(in srgb, var(--amber) 20%, var(--line)); border-radius: 11px; background: color-mix(in srgb, var(--amber) 5%, transparent); color: var(--amber); font-size: 9px; }
.system-panel { grid-column: 1/-1; padding: 20px; display: grid; grid-template-columns: repeat(3, 1fr); }
.system-panel div { padding: 4px 20px; border-right: 1px solid var(--line); }
.system-panel div:last-child { border: 0; }
.system-panel span, .system-panel strong { display: block; }
.system-panel span { color: var(--text-faint); font-size: 8px; text-transform: uppercase; letter-spacing: .1em; }
.system-panel strong { margin-top: 3px; font-size: 11px; }
.settings-save { width: fit-content; }
.audit-list { padding: 12px 22px; }
.audit-row { position: relative; padding: 14px 0 14px 27px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.audit-row:last-child { border: 0; }
.audit-dot { position: absolute; left: 4px; width: 7px; height: 7px; border: 2px solid var(--accent); border-radius: 50%; box-shadow: 0 0 7px var(--accent); }
.audit-row strong, .audit-row small { display: block; }
.audit-row strong { font-size: 10px; }
.audit-row small, .audit-row time { color: var(--text-faint); font-size: 8px; }

/* Modals, notices, loading */
.modal-layer { position: fixed; z-index: 100; inset: 0; padding: 25px; display: grid; place-items: center; background: rgba(3, 6, 11, .72); backdrop-filter: blur(9px); animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { position: relative; width: min(520px, 100%); max-height: calc(100vh - 50px); overflow: auto; padding: 34px; border: 1px solid var(--line-strong); border-radius: 23px; background: var(--surface-solid); box-shadow: var(--shadow); animation: rise .2s ease; }
@keyframes rise { from { transform: translateY(10px) scale(.985); opacity: 0; } }
.modal-close { position: absolute; top: 15px; right: 15px; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); color: var(--text-soft); font-size: 19px; cursor: pointer; }
.modal h2 { margin: 8px 0 7px; font-size: 25px; letter-spacing: -.035em; }
.modal > p { color: var(--text-soft); font-size: 11px; }
.qr-modal { text-align: center; }
#modalQr { width: fit-content; margin: 22px auto 13px; }
.qr-modal > strong { display: block; color: var(--accent); font-size: 11px; }
.modal-actions { margin-top: 22px; display: flex; gap: 8px; }
.modal-actions > * { flex: 1; }
.form-modal form { margin-top: 23px; display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-modal input, .form-modal select { margin-top: 6px; }
.form-modal fieldset { margin: 0; padding: 13px; border: 1px solid var(--line); border-radius: 11px; }
.form-modal legend { padding: 0 5px; color: var(--text-soft); font-size: 10px; font-weight: 700; }
.check-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.check-row input { width: 16px; min-height: 16px; margin: 0; }
.token-modal { text-align: center; }
.token-success { width: 53px; height: 53px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--green) 13%, transparent); color: var(--green); font-size: 20px; }
.token-modal code { display: block; margin: 20px 0; padding: 14px; overflow-wrap: anywhere; text-align: left; }
.token-modal .text-button { margin-top: 14px; }
.toast-region { position: fixed; z-index: 200; right: 20px; bottom: 20px; display: grid; gap: 8px; pointer-events: none; }
.toast { min-width: 270px; max-width: 390px; padding: 13px 15px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-solid); box-shadow: var(--shadow); transform: translateY(12px); opacity: 0; transition: .22s ease; }
.toast-visible { transform: translateY(0); opacity: 1; }
.toast > span { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--green) 12%, transparent); color: var(--green); font-weight: 800; }
.toast-error > span { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.toast p { margin: 0; font-size: 10px; font-weight: 650; }
.loading-state { min-height: 420px; display: grid; place-content: center; justify-items: center; gap: 16px; color: var(--text-faint); font-size: 11px; }
.loading-gem { width: 32px; height: 32px; border: 2px solid var(--line-strong); border-top-color: var(--accent); transform: rotate(45deg); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(405deg); } }
.empty-state { min-height: 250px; padding: 35px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty-crystal { width: 49px; height: 49px; margin-bottom: 14px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 14px; color: var(--accent); background: var(--surface-soft); }
.empty-state h3 { margin: 0 0 5px; font-size: 16px; }
.empty-state p { max-width: 400px; color: var(--text-faint); font-size: 10px; }
.empty-state .button { margin-top: 8px; }
.qr-fallback { width: 160px; height: 160px; display: grid; place-content: center; justify-items: center; gap: 8px; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--text-faint); text-align: center; }
.qr-fallback svg { width: 35px; height: 35px; }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .analytics-grid { grid-template-columns: 1fr 1fr; }
  .analytics-grid > article:last-child { grid-column: 1/-1; }
  .safety-grid { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr .75fr; gap: 25px; }
  .crystal-stage { width: 300px; }
  .crystal-stage > img { width: 270px; }
}

@media (max-width: 900px) {
  .workspace { display: block; }
  .workspace-main { width: 100%; }
  .sidebar { transform: translateX(-102%); transition: transform .25s ease; box-shadow: var(--shadow); }
  .sidebar-is-open .sidebar { transform: translateX(0); }
  .sidebar-scrim { position: fixed; z-index: 45; inset: 0; border: 0; background: rgba(3, 6, 11, .64); }
  .sidebar-is-open .sidebar-scrim { display: block; }
  .sidebar-close, .mobile-menu { display: inline-grid; }
  .topbar { padding-inline: 22px; }
  .topbar-trail { margin-right: auto; margin-left: 12px; }
  .page { width: min(100% - 34px, 850px); }
  .dashboard-grid, .editor-layout, .profile-editor { grid-template-columns: 1fr; }
  .editor-aside, .profile-preview { position: static; }
  .editor-aside { grid-template-columns: 1fr 1fr; }
  .link-preview-panel { grid-column: 1/-1; }
  .link-grid { grid-template-columns: 1fr; }
  .login-page { grid-template-columns: 1fr; }
  .login-art { min-height: 370px; padding: 35px; }
  .login-art-copy { margin: 65px 0; }
  .login-art-copy h1 { font-size: 45px; }
  .login-crystal { width: 220px; }
  .login-panel { min-height: 600px; }
  .hero { min-height: auto; padding-top: 65px; grid-template-columns: 1fr; }
  .hero-specimen { min-height: 430px; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-grid article, .feature-grid article:first-child { min-height: auto; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .mineral-story { grid-template-columns: 1fr; gap: 50px; }
  .profile-page { grid-template-columns: 1fr; gap: 45px; }
  .profile-intro { position: static; }
  .settings-layout { grid-template-columns: 1fr; }
  .system-panel { grid-column: 1; }
}

@media (max-width: 650px) {
  .shell-width { width: min(100% - 30px, 560px); }
  .public-nav { height: 76px; }
  .public-nav .brand img { width: 158px; }
  .public-nav .button { display: none; }
  .hero { padding: 55px 0 70px; }
  .hero h1 { font-size: 49px; }
  .hero-lead { font-size: 16px; }
  .hero-actions { align-items: flex-start; flex-direction: column; }
  .hero-specimen { min-height: 370px; }
  .crystal-stage { width: 250px; }
  .crystal-stage > img { width: 225px; }
  .orb-one { width: 270px; height: 270px; }
  .orb-two { width: 340px; height: 340px; }
  .mineral-card-one { right: -25px; }
  .mineral-card-two { left: -25px; }
  .feature-grid article { padding: 40px 29px; }
  .mineral-story { padding-block: 80px; }
  .story-mark { width: 190px; height: 190px; }
  .mineral-story h2 { font-size: 37px; }
  .public-footer { align-items: flex-start; gap: 25px; flex-direction: column; }
  .preview-card { padding: 30px 20px; }
  .profile-page { padding-top: 45px; }
  .topbar { height: 68px; padding-inline: 14px; }
  .topbar-trail span, .topbar-trail i { display: none; }
  .topbar-actions > a { display: none; }
  .quick-create span { display: none; }
  .quick-create { width: 38px; padding: 0; justify-content: center; }
  .page { width: calc(100% - 24px); padding: 28px 0 70px; }
  .page-header { align-items: flex-start; flex-direction: column; margin-bottom: 24px; }
  .page-header h1 { font-size: 34px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric-card { min-height: 156px; padding: 17px; }
  .metric-card > strong { font-size: 27px; }
  .dashboard-grid { gap: 8px; }
  .activity-panel, .quick-panel, .recent-panel { padding: 18px; }
  .recent-link { grid-template-columns: 36px minmax(0, 1fr) 20px; }
  .recent-metric { display: none; }
  .filter-bar form { grid-template-columns: 1fr 1fr; }
  .search-box { grid-column: 1/-1; }
  .filter-bar form .button { grid-column: 1/-1; }
  .link-card-main { min-height: 200px; padding: 18px; }
  .form-panel { padding: 20px; grid-template-columns: 1fr; }
  .field-wide, .section-heading { grid-column: 1; }
  .editor-aside { grid-template-columns: 1fr; }
  .link-preview-panel { grid-column: 1; }
  .result-grid { grid-template-columns: 1fr; }
  .result-link { align-items: stretch; flex-direction: column; text-align: center; }
  .analytics-hero { grid-template-columns: 1fr; }
  .analytics-summary { padding: 0 0 20px; border: 0; border-bottom: 1px solid var(--line); }
  .analytics-grid { grid-template-columns: 1fr; }
  .analytics-grid > article:last-child { grid-column: 1; }
  .table-head, .table-row { grid-template-columns: 1fr 55px 55px; }
  .profile-fields { grid-template-columns: 1fr; }
  .role-summary { grid-template-columns: 1fr; }
  .user-row { grid-template-columns: 37px minmax(0, 1fr) 60px 12px; }
  .user-row .user-state { display: none; }
  .api-intro { align-items: flex-start; flex-direction: column; }
  .api-intro > code { width: 100%; overflow: auto; }
  .api-client-row { grid-template-columns: 40px minmax(0, 1fr) 34px; }
  .api-client-row > div:nth-child(3) { display: none; }
  .system-panel { grid-template-columns: 1fr; }
  .system-panel div { padding: 10px; border: 0; border-bottom: 1px solid var(--line); }
  .form-modal form { grid-template-columns: 1fr; }
  .form-modal .field-wide { grid-column: 1; }
  .modal { padding: 29px 20px; }
  .toast-region { left: 12px; right: 12px; bottom: 12px; }
  .toast { min-width: 0; max-width: none; }
  .login-art { min-height: 315px; padding: 27px; }
  .login-art-copy { margin: 50px 0; }
  .login-art-copy h1 { font-size: 34px; }
  .login-art-copy p { font-size: 13px; }
  .login-art .brand img { width: 158px; }
  .login-panel { min-height: 570px; padding: 50px 15px; }
  .login-form { padding: 29px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
