:root {
  color-scheme: dark;
  --bg: #131314;
  --panel: rgba(30, 31, 32, .88);
  --panel-strong: rgba(42, 43, 45, .94);
  --text: #e3e3e3;
  --muted: #a8adb7;
  --line: rgba(232, 234, 237, .12);
  --accent: #ff72b6;
  --blue: #8ab4f8;
  --ok: #3ed864;
  --bad: #ff4b55;
  --shadow: rgba(0, 0, 0, .45);
  --bottom-bar-height: 52px;
  --scroll-progress: 0;
  --hero-scale: 1;
  --hero-y: 0px;
  --hero-opacity: 1;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  background: #08090d;
  overflow-x: hidden;
  letter-spacing: 0;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: 1;
  background:
    radial-gradient(circle at 52% 34%, rgba(255, 114, 182, .16), transparent 34%),
    radial-gradient(circle at 78% 18%, rgba(155, 114, 255, .13), transparent 32%),
    radial-gradient(circle at 16% 86%, rgba(138, 180, 248, .09), transparent 34%);
  mix-blend-mode: screen;
  animation: panel-wash-pulse 11s ease-in-out infinite alternate;
}

body::after {
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(8, 9, 13, .10) 0%, rgba(8, 9, 13, .30) 52%, rgba(8, 9, 13, .88) 100%),
    radial-gradient(ellipse at center, transparent 0%, rgba(8, 9, 13, .22) 64%, rgba(8, 9, 13, .76) 100%);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.three-silhouette-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  opacity: .88;
}

.page-shell {
  position: relative;
  z-index: 2;
  width: min(1120px, calc(100% - 40px));
  min-height: 100svh;
  margin: 0 auto;
  padding: 0 0 calc(var(--bottom-bar-height) + env(safe-area-inset-bottom) + 36px);
}

.intro-stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 0;
  margin: 0;
}

.hero-title {
  opacity: 0;
  transform: translate3d(0, 18px, 0) scale(.96);
  text-align: center;
  will-change: transform, opacity;
  overflow: visible;
  padding: .08em .08em .24em;
}

.intro-stage.ready .hero-title {
  animation: taffy-welcome-in 900ms cubic-bezier(.16, 1, .3, 1) 80ms both;
}

.hero-title h1 {
  display: grid;
  gap: .08em;
  margin: 0;
  font-size: clamp(72px, 12vw, 148px);
  font-weight: 650;
  line-height: 1.08;
  overflow: visible;
  transform: translate3d(0, var(--hero-y), 0) scale(var(--hero-scale));
  transform-origin: center top;
  opacity: var(--hero-opacity);
  transition: transform 90ms linear, opacity 90ms linear;
  will-change: transform, opacity;
}

.hero-title h1 span {
  color: rgba(227, 227, 227, .78);
  text-shadow: 0 20px 60px rgba(0, 0, 0, .32);
}

.hero-title h1 b {
  display: block;
  padding: 0 .04em .20em;
  line-height: 1.14;
  background: linear-gradient(90deg, #f06292 0%, #ff72b6 30%, #c58af9 66%, #8ab4f8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 24px 72px rgba(255, 79, 154, .24);
}

.dashboard-content {
  position: relative;
  z-index: 3;
  display: grid;
  gap: 24px;
  margin-top: calc(-1 * min(21svh, 180px));
}

.metrics-wrap,
.apps-wrap,
.settings,
.locked,
.content-panel,
.login-card,
.taffy-popover {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 18px 56px rgba(0, 0, 0, .34);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}

.metrics-wrap,
.apps-wrap,
.settings,
.locked {
  border-radius: 24px;
  padding: 14px;
}

.metrics-wrap > .section-head {
  min-height: min(21svh, 180px);
  display: flex;
  align-items: flex-start;
  padding-top: clamp(18px, 4vh, 34px);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 8px 12px;
  border-bottom: 1px solid var(--line);
}

.section-head .eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(24px, 4.6vw, 36px);
  line-height: 1.15;
  font-weight: 720;
}

.metrics {
  display: grid;
}

.metric-row {
  display: grid;
  grid-template-columns: minmax(150px, .8fr) minmax(220px, 1.5fr) repeat(4, minmax(72px, .36fr));
  align-items: center;
  gap: 18px;
  min-height: 126px;
  padding: 18px 8px;
  border-bottom: 1px solid var(--line);
}

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

.metric-name strong {
  display: block;
  font-size: 16px;
  line-height: 1.2;
}

.metric-name span,
.metric-stat span,
.service-main p,
.service-meta,
.action-msg,
.role-pill,
.ghost-pill {
  color: var(--muted);
}

.metric-name span {
  display: block;
  margin-top: 5px;
  font-size: 13px;
}

.metric-chart {
  min-width: 0;
}

.spark {
  display: block;
  width: 100%;
  height: 58px;
}

.spark polyline {
  fill: none;
  stroke: var(--blue);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.metric-stat span,
.metric-stat b {
  display: block;
}

.metric-stat span {
  margin-bottom: 5px;
  font-size: 12px;
}

.metric-stat b {
  font-size: 14px;
  font-weight: 650;
}

.apps,
.settings {
  display: grid;
  gap: 12px;
}

.service-card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 16px;
}

.service-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 86% 8%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 34%);
}

.service-main,
.service-footer,
.service-actions,
.topbar,
.brand,
.top-actions {
  display: flex;
  align-items: center;
}

.service-main {
  position: relative;
  gap: 10px;
}

.service-main h3 {
  margin: 0;
  font-size: 16px;
}

.service-main p {
  margin: 4px 0 0;
  font-size: 12px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.dot.green {
  background: var(--ok);
  box-shadow: 0 0 14px rgba(62, 216, 100, .55);
}

.dot.red {
  background: var(--bad);
}

.service-meta {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
  font-size: 12px;
}

.service-footer {
  position: relative;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.service-open,
.service-actions button,
form button,
.taffy-chat-form button {
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: #1a73e8;
  text-decoration: none;
  cursor: pointer;
}

.service-open {
  padding: 7px 12px;
  font-size: 12px;
}

.service-open.disabled {
  color: var(--muted);
  background: rgba(255, 255, 255, .08);
  cursor: default;
}

.service-actions {
  gap: 7px;
}

.service-actions button {
  padding: 7px 10px;
  font-size: 12px;
  background: rgba(255, 255, 255, .10);
}

.service-actions .danger {
  background: rgba(255, 75, 85, .78);
}

.topbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  min-height: calc(38px + env(safe-area-inset-bottom));
  padding: 5px max(18px, env(safe-area-inset-left)) calc(5px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-right));
  gap: 12px;
  border-top: 1px solid rgba(232, 234, 237, .10);
  background: rgba(19, 19, 20, .92);
  box-shadow: 0 -6px 22px rgba(0, 0, 0, .24);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  font-size: 10px;
}

.brand {
  min-width: 0;
  gap: 7px;
}

.brand strong {
  display: block;
  max-width: 180px;
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand span {
  display: none;
}

.liquid-logo {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  flex: 0 0 auto;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  background: linear-gradient(135deg, #6ea4ff, #ba74ff 44%, #ff6cae 68%, #ffb14a);
}

.liquid-logo.large {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  font-size: 22px;
}

.top-actions {
  margin-left: auto;
  gap: 10px;
}

.role-pill,
.login-pill,
.ghost-pill {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}

.role-pill {
  text-transform: uppercase;
}

.login-pill,
.ghost-pill {
  color: var(--blue);
  font-weight: 700;
  cursor: pointer;
}

.taffy-widget {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: calc(var(--bottom-bar-height) + env(safe-area-inset-bottom) + 16px);
  z-index: 88;
}

.taffy-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd4e9, #ff5aa8 52%, #8b5cf6);
  box-shadow: 0 18px 44px rgba(255, 79, 154, .30), 0 7px 18px rgba(0, 0, 0, .22);
  cursor: pointer;
}

.taffy-orb img {
  width: 58px;
  height: 58px;
  border: 3px solid rgba(255, 255, 255, .92);
  border-radius: 999px;
  object-fit: cover;
}

.taffy-orb span {
  position: absolute;
  right: 5px;
  bottom: 6px;
  width: 15px;
  height: 15px;
  border: 3px solid #1b1c22;
  border-radius: 999px;
  background: var(--ok);
}

.taffy-popover {
  position: absolute;
  right: 0;
  bottom: 82px;
  width: min(360px, calc(100vw - 28px));
  max-height: min(520px, calc(100svh - var(--bottom-bar-height) - 128px));
  display: grid;
  grid-template-rows: auto minmax(96px, 1fr) auto;
  gap: 10px;
  padding: 14px;
  border-radius: 22px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(.96);
  transform-origin: bottom right;
  transition: opacity .16s ease, transform .16s ease;
}

.taffy-widget.open .taffy-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.taffy-chat-head {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.taffy-chat-head img {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  object-fit: cover;
}

.taffy-chat-head strong,
.taffy-chat-head span {
  display: block;
}

.taffy-chat-head strong {
  font-size: 14px;
}

.taffy-chat-head span {
  color: var(--muted);
  font-size: 11px;
}

.taffy-chat-head .action-msg {
  max-width: 110px;
  margin: 0;
  text-align: right;
  font-size: 11px;
}

.taffy-chat-log {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 96px;
  max-height: min(240px, calc(100svh - var(--bottom-bar-height) - 260px));
  overflow: auto;
  padding: 2px;
}

.bot-bubble,
.user-bubble {
  max-width: 92%;
  padding: 9px 12px;
  border-radius: 17px;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.bot-bubble {
  align-self: flex-start;
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--line);
}

.user-bubble {
  align-self: flex-end;
  color: white;
  background: linear-gradient(135deg, #ff5aa8, #8b5cf6);
}

.taffy-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.taffy-chat-form input,
.login-card input,
.form-grid input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(255, 255, 255, .08);
  outline: none;
}

.taffy-chat-form button {
  padding: 0 15px;
}

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

.form-grid label,
.login-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.form-grid button {
  justify-self: start;
  padding: 9px 14px;
}

.check {
  display: flex !important;
  grid-auto-flow: column;
  align-items: center;
  justify-content: start;
}

.login-dialog {
  width: min(360px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  background: transparent;
}

.login-dialog::backdrop {
  background: rgba(0, 0, 0, .42);
}

.login-card {
  position: relative;
  display: grid;
  gap: 12px;
  border-radius: 24px;
  padding: 22px;
}

.login-card h2,
.login-card p {
  margin: 0;
}

.login-card p {
  color: var(--muted);
  font-size: 12px;
}

.login-card button[type="submit"] {
  min-height: 38px;
}

.close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, .10);
  cursor: pointer;
}

.action-msg {
  min-height: 1em;
  font-size: 12px;
}

.action-msg.ok {
  color: var(--ok);
}

.action-msg.error {
  color: var(--bad);
}

@keyframes taffy-welcome-in {
  0% {
    opacity: 0;
    transform: translate3d(0, 26px, 0) scale(.94);
    filter: blur(10px);
  }

  58% {
    opacity: 1;
    filter: blur(0);
  }

  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
  }
}

@keyframes panel-wash-pulse {
  0% {
    opacity: .92;
  }

  100% {
    opacity: .78;
  }
}

@media (max-width: 900px) {
  .metric-row {
    grid-template-columns: minmax(0, 1fr) repeat(2, minmax(74px, auto));
    gap: 12px;
  }

  .metric-chart {
    grid-column: 1 / -1;
    order: 2;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: 100%;
    padding-bottom: calc(var(--bottom-bar-height) + env(safe-area-inset-bottom) + 28px);
  }

  .intro-stage {
    min-height: 100svh;
    padding-inline: 18px;
  }

  .hero-title h1 {
    gap: .05em;
    font-size: clamp(64px, 22vw, 108px);
  }

  .dashboard-content {
    width: calc(100% - 20px);
    margin-top: calc(-1 * min(22svh, 168px));
    margin-left: auto;
    margin-right: auto;
    gap: 18px;
  }

  .metrics-wrap,
  .apps-wrap,
  .settings,
  .locked {
    border-radius: 22px;
    padding: 12px;
  }

  .metrics-wrap > .section-head {
    min-height: min(22svh, 168px);
    padding-top: clamp(18px, 3.8vh, 30px);
  }

  .section-head {
    padding-bottom: 10px;
  }

  .section-head h2 {
    font-size: 27px;
  }

  .metric-row {
    grid-template-columns: 1fr 1fr;
    min-height: 132px;
    padding: 16px 4px;
  }

  .metric-name,
  .metric-chart {
    grid-column: 1 / -1;
  }

  .metric-name strong {
    font-size: 15px;
  }

  .metric-stat b {
    font-size: 13px;
  }

  .topbar {
    min-height: calc(40px + env(safe-area-inset-bottom));
    padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
    gap: 10px;
  }

  .brand strong {
    max-width: 118px;
  }

  .top-actions {
    gap: 8px;
  }

  .taffy-widget {
    right: 14px;
    bottom: calc(var(--bottom-bar-height) + env(safe-area-inset-bottom) + 14px);
  }

  .taffy-orb {
    width: 62px;
    height: 62px;
  }

  .taffy-orb img {
    width: 54px;
    height: 54px;
  }

  .taffy-popover {
    bottom: 74px;
    width: calc(100vw - 28px);
    max-height: calc(100svh - var(--bottom-bar-height) - 106px);
  }

  .taffy-chat-form {
    grid-template-columns: 1fr;
  }

  .taffy-chat-form button {
    min-height: 38px;
  }
}

@media (max-width: 390px) {
  .brand strong {
    max-width: 98px;
  }

  .role-pill,
  .login-pill,
  .ghost-pill {
    font-size: 9px;
  }
}

@media (min-width: 1200px) {
  .dashboard-content {
    margin-top: -170px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  body::before,
  .intro-stage.ready .hero-title {
    animation: none !important;
  }

  .hero-title,
  .hero-title h1 {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    filter: none !important;
  }
}
