:root {
  color-scheme: dark;
  --ink: #f9f4f6;
  --ink-soft: #c5b8be;
  --ink-muted: #8f8087;
  --night: #0d090c;
  --night-soft: #151014;
  --panel: rgba(27, 19, 24, 0.94);
  --panel-soft: rgba(37, 26, 32, 0.74);
  --accent: #ec3664;
  --accent-soft: #ff7798;
  --accent-pale: #ffd2de;
  --mint: #73e6bd;
  --warning: #f7c76b;
  --danger: #ff6f78;
  --hairline: rgba(255, 239, 245, 0.1);
  --hairline-bright: rgba(255, 239, 245, 0.17);
  --curve: cubic-bezier(0.32, 0.72, 0, 1);
  --font: 'Avenir Next', 'Segoe UI Variable', 'Trebuchet MS', sans-serif;
  --display: 'Bodoni 72', 'Iowan Old Style', 'Palatino Linotype', serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--night);
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 52% -10%, rgba(236, 54, 100, 0.1), transparent 34%),
    linear-gradient(145deg, #0a0709 0%, #100b0f 50%, #0b080a 100%);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  color: inherit;
  font: inherit;
}

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

:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 3px;
}

button {
  border: 0;
}

.is-hidden {
  display: none !important;
}

.ambient {
  position: fixed;
  z-index: 0;
  width: 42rem;
  height: 42rem;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(120px);
  opacity: 0.13;
}

.ambient-a {
  top: -21rem;
  right: -8rem;
  background: #ec3664;
}

.ambient-b {
  bottom: -27rem;
  left: -18rem;
  background: #7450ff;
}

.grain {
  position: fixed;
  z-index: 8;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.loading-screen {
  position: fixed;
  z-index: 7;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 1.25rem;
  background: var(--night);
  text-align: center;
  transition:
    opacity 700ms var(--curve),
    transform 700ms var(--curve);
}

.loading-screen.is-leaving {
  opacity: 0;
  transform: scale(1.03);
  pointer-events: none;
}

.loading-screen p {
  color: var(--ink-muted);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.pulse-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  height: 2rem;
}

.pulse-mark span {
  width: 0.25rem;
  height: 1.1rem;
  border-radius: 999px;
  background: var(--accent);
  animation: pulse 1.2s var(--curve) infinite alternate;
}

.pulse-mark span:nth-child(2) {
  height: 2rem;
  animation-delay: 130ms;
}

.pulse-mark span:nth-child(3) {
  animation-delay: 260ms;
}

@keyframes pulse {
  from {
    opacity: 0.3;
    transform: scaleY(0.45);
  }
  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.brand-mark {
  display: grid;
  width: 2.65rem;
  height: 2.65rem;
  place-items: center;
  border-radius: 42% 58% 54% 46% / 46% 42% 58% 54%;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.24), transparent 38%), var(--accent);
  box-shadow:
    0 12px 36px rgba(236, 54, 100, 0.3),
    inset 0 1px 1px rgba(255, 255, 255, 0.45);
  color: white;
  font-family: var(--display);
  font-size: 1.45rem;
  font-style: italic;
}

.brand span:last-child {
  display: grid;
  gap: 0.1rem;
}

.brand strong {
  font-size: 0.84rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.brand small {
  color: var(--ink-muted);
  font-size: 0.63rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status-chip,
.eyebrow {
  display: inline-flex;
  align-items: center;
  width: max-content;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.63rem;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.status-chip {
  gap: 0.45rem;
  padding: 0.55rem 0.8rem;
  background: rgba(255, 255, 255, 0.045);
  box-shadow:
    inset 0 0 0 1px var(--hairline),
    inset 0 1px 1px rgba(255, 255, 255, 0.06);
}

.status-chip.online::before {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 16px rgba(115, 230, 189, 0.7);
  content: '';
}

.eyebrow {
  padding: 0.4rem 0.7rem;
  background: rgba(236, 54, 100, 0.09);
  color: var(--accent-pale);
  box-shadow: inset 0 0 0 1px rgba(236, 54, 100, 0.18);
}

.login-screen {
  position: relative;
  z-index: 1;
  width: min(1440px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 1.5rem 3rem 5rem;
}

.login-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 0.75rem 1rem;
  border-radius: 1.4rem;
  background: rgba(20, 14, 18, 0.62);
  box-shadow:
    inset 0 0 0 1px var(--hairline),
    0 20px 70px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(22px);
}

.login-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(440px, 1.05fr);
  align-items: center;
  gap: clamp(3rem, 8vw, 9rem);
  min-height: calc(100dvh - 8rem);
  padding: 8rem 3rem;
}

.hero-copy h1 {
  max-width: 12ch;
  margin: 1.55rem 0 1.4rem;
  font-size: clamp(4.4rem, 7.6vw, 8.8rem);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 0.78;
}

.hero-copy h1 em {
  color: var(--accent-soft);
  font-family: var(--display);
  font-weight: 400;
}

.hero-copy > p {
  max-width: 37rem;
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.25vw, 1.18rem);
  line-height: 1.75;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 2.2rem;
  padding: 0.48rem 0.5rem 0.48rem 1.45rem;
  border-radius: 999px;
  background: var(--ink);
  box-shadow:
    0 18px 60px rgba(236, 54, 100, 0.17),
    inset 0 1px 1px white;
  color: #160e12;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition:
    opacity 600ms var(--curve),
    transform 600ms var(--curve);
}

.primary-action:hover {
  transform: translateY(-3px);
}

.primary-action:active {
  transform: scale(0.98);
}

.action-orb {
  display: grid;
  width: 2.55rem;
  height: 2.55rem;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 1rem;
  transition: transform 700ms var(--curve);
}

.primary-action:hover .action-orb {
  transform: translate(2px, -2px) scale(1.06);
}

.auth-message {
  min-height: 1.5rem;
  margin-top: 1rem !important;
  color: var(--danger) !important;
  font-size: 0.8rem !important;
}

.login-composition {
  position: relative;
}

.shell {
  padding: 0.48rem;
  border-radius: 2rem;
  background: rgba(255, 255, 255, 0.035);
  box-shadow:
    inset 0 0 0 1px var(--hairline),
    0 40px 120px rgba(0, 0, 0, 0.25);
}

.core {
  border-radius: calc(2rem - 0.35rem);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.045), transparent 36%), var(--panel);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.11),
    inset 0 0 0 1px rgba(255, 255, 255, 0.035);
}

.hero-shell {
  transform: rotate(1.4deg);
}

.hero-panel {
  min-height: 34rem;
  padding: 2rem;
}

.panel-topline,
.vital,
.privacy-note,
.feature-head,
.form-actions,
.audit-head,
.overview-head {
  display: flex;
  align-items: center;
}

.panel-topline {
  justify-content: space-between;
  color: var(--ink-muted);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--mint);
}

.live-dot::before {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
  content: '';
}

.clinic-vitals {
  display: grid;
  gap: 0.7rem;
  margin-top: 2.6rem;
}

.vital {
  gap: 1rem;
  padding: 0.95rem;
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.055);
}

.vital-icon {
  display: grid;
  width: 2.6rem;
  height: 2.6rem;
  place-items: center;
  border-radius: 0.9rem;
  background: rgba(236, 54, 100, 0.1);
  color: var(--accent-soft);
  font-family: var(--display);
  font-size: 1.25rem;
}

.vital > span:last-child {
  display: grid;
  gap: 0.18rem;
}

.vital b {
  font-size: 0.8rem;
}

.vital small {
  color: var(--ink-muted);
  font-size: 0.68rem;
}

.monitor-line {
  height: 8.5rem;
  margin: 1.7rem -0.3rem 0;
}

.monitor-line svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.monitor-line path {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 8px rgba(236, 54, 100, 0.55));
  stroke-dasharray: 900;
  animation: trace 3.6s var(--curve) infinite;
}

@keyframes trace {
  0% {
    stroke-dashoffset: 900;
    opacity: 0.2;
  }
  45%,
  75% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
  100% {
    stroke-dashoffset: -900;
    opacity: 0.2;
  }
}

.privacy-note {
  gap: 0.85rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--hairline);
}

.privacy-note p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.7rem;
  line-height: 1.55;
}

.lock-glyph {
  position: relative;
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.15rem;
  border-radius: 0.34rem;
  background: rgba(115, 230, 189, 0.12);
  box-shadow: inset 0 0 0 1px rgba(115, 230, 189, 0.28);
}

.lock-glyph::before {
  position: absolute;
  top: -0.48rem;
  left: 0.3rem;
  width: 0.72rem;
  height: 0.7rem;
  border: 1px solid rgba(115, 230, 189, 0.6);
  border-bottom: 0;
  border-radius: 0.55rem 0.55rem 0 0;
  content: '';
}

.floating-tag {
  position: absolute;
  padding: 0.6rem 0.85rem;
  border-radius: 999px;
  background: rgba(24, 17, 21, 0.82);
  box-shadow:
    inset 0 0 0 1px var(--hairline-bright),
    0 18px 60px rgba(0, 0, 0, 0.3);
  color: var(--ink-soft);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  backdrop-filter: blur(18px);
}

.tag-one {
  top: 18%;
  right: -2.6rem;
  transform: rotate(5deg);
}

.tag-two {
  bottom: 12%;
  left: -2.4rem;
  transform: rotate(-6deg);
}

.setup-card {
  width: min(720px, calc(100% - 2rem));
  margin: -5rem auto 7rem;
  padding: 2rem;
  border-radius: 1.7rem;
  background: rgba(247, 199, 107, 0.06);
  box-shadow: inset 0 0 0 1px rgba(247, 199, 107, 0.17);
}

.setup-card h2 {
  margin: 1rem 0 0.5rem;
  font-size: 1.5rem;
}

.setup-card p {
  color: var(--ink-soft);
  line-height: 1.6;
}

.setup-card code {
  display: block;
  overflow-x: auto;
  padding: 1rem;
  border-radius: 0.9rem;
  background: rgba(0, 0, 0, 0.22);
  color: var(--warning);
}

.reveal {
  opacity: 0;
  transform: translateY(2.5rem);
  transition:
    opacity 900ms var(--curve),
    transform 900ms var(--curve);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.dashboard-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 15.5rem minmax(0, 1fr);
  gap: 1rem;
  min-height: 100dvh;
  padding: 1rem;
}

.sidebar {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 2rem);
  padding: 1rem;
  border-radius: 1.8rem;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.04), transparent 30%),
    rgba(20, 14, 18, 0.88);
  box-shadow:
    inset 0 0 0 1px var(--hairline),
    inset 0 1px 1px rgba(255, 255, 255, 0.06),
    0 30px 100px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(22px);
}

.sidebar-brand {
  padding: 0.35rem 0.3rem 1.4rem;
}

.primary-nav {
  display: grid;
  gap: 0.24rem;
  margin-top: 1rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.78rem;
  width: 100%;
  padding: 0.72rem 0.78rem;
  border-radius: 0.92rem;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 0.76rem;
  text-align: left;
  transition:
    color 600ms var(--curve),
    opacity 600ms var(--curve),
    transform 600ms var(--curve);
}

.nav-item:hover {
  color: var(--ink);
  transform: translateX(3px);
}

.nav-item.is-active {
  background: rgba(236, 54, 100, 0.09);
  box-shadow: inset 0 0 0 1px rgba(236, 54, 100, 0.15);
  color: var(--accent-pale);
}

.nav-glyph {
  display: grid;
  width: 1.85rem;
  height: 1.85rem;
  place-items: center;
  border-radius: 0.62rem;
  background: rgba(255, 255, 255, 0.035);
  font-family: var(--display);
  font-size: 0.95rem;
}

.sidebar-foot {
  display: grid;
  gap: 0.65rem;
  margin-top: auto;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 0.68rem;
  min-width: 0;
  padding: 0.7rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.user-card img {
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 0.8rem;
  object-fit: cover;
  background: var(--panel-soft);
}

.user-card span {
  display: grid;
  min-width: 0;
  gap: 0.1rem;
}

.user-card b,
.user-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-card b {
  font-size: 0.72rem;
}

.user-card small {
  color: var(--ink-muted);
  font-size: 0.62rem;
}

.quiet-button {
  padding: 0.65rem;
  border-radius: 0.85rem;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 0.68rem;
  transition:
    color 500ms var(--curve),
    background 500ms var(--curve);
}

.quiet-button:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
}

.dashboard-main {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 3.6rem clamp(1rem, 3.5vw, 4.5rem) 6rem;
}

.dashboard-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 3.2rem;
}

.dashboard-header h1 {
  margin: 0.8rem 0 0;
  font-size: clamp(2.4rem, 4vw, 4.8rem);
  font-weight: 520;
  letter-spacing: -0.055em;
  line-height: 0.9;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.view-panel {
  animation: view-in 700ms var(--curve) both;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(1.25rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(18rem, 0.55fr);
  gap: 1rem;
}

.overview-primary {
  grid-row: span 2;
}

.overview-core {
  min-height: 29rem;
  padding: clamp(1.5rem, 4vw, 3.5rem);
}

.overview-head {
  justify-content: space-between;
  gap: 1rem;
}

.overview-head small {
  color: var(--ink-muted);
  font-size: 0.68rem;
}

.overview-title {
  max-width: 10ch;
  margin: 4rem 0 1rem;
  font-size: clamp(3rem, 6vw, 7rem);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 0.82;
}

.overview-title em {
  color: var(--accent-soft);
  font-family: var(--display);
  font-weight: 400;
}

.overview-copy {
  max-width: 42rem;
  color: var(--ink-soft);
  line-height: 1.75;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-top: 3rem;
}

.metric {
  padding: 1.1rem;
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.metric b {
  display: block;
  font-size: clamp(1.2rem, 2.4vw, 2rem);
  font-weight: 560;
}

.metric span {
  color: var(--ink-muted);
  font-size: 0.65rem;
}

.side-core {
  min-height: 13.8rem;
  padding: 1.4rem;
}

.side-core h2,
.feature-core h2,
.audit-core h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.operation-list {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.35rem;
}

.operation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--hairline);
}

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

.operation-row span {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.operation-row b {
  max-width: 60%;
  color: var(--mint);
  font-size: 0.65rem;
  font-weight: 600;
  overflow-wrap: anywhere;
  text-align: right;
}

.feature-shortcuts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
  margin-top: 1rem;
}

.shortcut {
  min-height: 10rem;
  padding: 1.25rem;
  border-radius: 1.5rem;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 42%),
    rgba(25, 18, 22, 0.7);
  box-shadow:
    inset 0 0 0 1px var(--hairline),
    inset 0 1px 1px rgba(255, 255, 255, 0.06);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition:
    opacity 650ms var(--curve),
    transform 650ms var(--curve);
}

.shortcut:hover {
  transform: translateY(-5px);
}

.shortcut .shortcut-glyph {
  display: block;
  margin-bottom: 2.5rem;
  color: var(--accent-soft);
  font-family: var(--display);
  font-size: 1.5rem;
}

.shortcut b,
.shortcut small {
  display: block;
}

.shortcut b {
  font-size: 0.82rem;
}

.shortcut small {
  margin-top: 0.25rem;
  color: var(--ink-muted);
  font-size: 0.65rem;
}

.feature-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  align-items: start;
  gap: 1rem;
}

.feature-core {
  padding: clamp(1.3rem, 3vw, 2.1rem);
}

.feature-head {
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.feature-head p {
  margin: 0.35rem 0 0;
  color: var(--ink-muted);
  font-size: 0.7rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

fieldset.field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

fieldset.field legend {
  padding: 0;
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 620;
}

.field-intro {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.65;
}

.channel-check-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.72rem 0.8rem;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 0 0 1px var(--hairline);
  color: var(--ink-soft);
  font-size: 0.65rem;
  line-height: 1.35;
}

.check-row input {
  flex: 0 0 auto;
  accent-color: var(--accent);
}

.check-row.compact {
  padding: 0.45rem 0;
  background: transparent;
  box-shadow: none;
}

.danger-check {
  color: var(--danger);
}

.empty-inline {
  margin: 0;
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.025);
  color: var(--ink-muted);
  font-size: 0.7rem;
}

.binding-row {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.binding-add {
  background: rgba(236, 54, 100, 0.045);
  box-shadow: inset 0 0 0 1px rgba(236, 54, 100, 0.18);
}

.binding-row-head,
.binding-row-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.binding-row-head b {
  font-size: 0.72rem;
}

.inline-field {
  display: grid;
  gap: 0.38rem;
  min-width: 0;
}

.inline-field > span {
  color: var(--ink-muted);
  font-size: 0.58rem;
}

.inline-field input,
.inline-field select {
  width: 100%;
  min-height: 2.7rem;
  padding: 0 0.75rem;
  border: 0;
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px var(--hairline);
  color: var(--ink);
}

.binding-row > .inline-field {
  grid-column: span 1;
}

.binding-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.binding-row > .binding-row-head,
.binding-row > .binding-row-foot {
  grid-column: 1 / -1;
}

.binding-row > .binding-row-head {
  grid-row: 1;
}

.binding-row > .binding-row-foot {
  grid-row: 3;
}

.field {
  display: grid;
  gap: 0.5rem;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 620;
}

.field-hint {
  color: var(--ink-muted);
  font-size: 0.6rem;
  line-height: 1.45;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 0;
  outline: 0;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.035);
  box-shadow:
    inset 0 0 0 1px var(--hairline),
    inset 0 1px 1px rgba(255, 255, 255, 0.035);
  color: var(--ink);
  transition:
    background 550ms var(--curve),
    box-shadow 550ms var(--curve),
    transform 550ms var(--curve);
}

.field input,
.field select {
  min-height: 3rem;
  padding: 0 0.95rem;
}

.field textarea {
  min-height: 8.6rem;
  resize: vertical;
  padding: 0.9rem 0.95rem;
  line-height: 1.55;
}

.field textarea.tall {
  min-height: 12.5rem;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  background: rgba(255, 255, 255, 0.052);
  box-shadow:
    inset 0 0 0 1px rgba(236, 54, 100, 0.5),
    0 0 0 4px rgba(236, 54, 100, 0.08);
  transform: translateY(-1px);
}

.field input:disabled,
.field textarea:disabled,
.field select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.color-control {
  display: grid;
  grid-template-columns: 3.25rem 1fr;
  gap: 0.5rem;
}

.color-control input[type='color'] {
  min-height: 3rem;
  padding: 0.35rem;
  cursor: pointer;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.8rem;
  padding: 0.75rem 0.9rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.toggle-row span {
  display: grid;
  gap: 0.15rem;
}

.toggle-row b {
  font-size: 0.7rem;
}

.toggle-row small {
  color: var(--ink-muted);
  font-size: 0.6rem;
}

.toggle {
  position: relative;
  width: 2.8rem;
  height: 1.55rem;
  appearance: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px var(--hairline);
  cursor: pointer;
  transition: background 550ms var(--curve);
}

.toggle::after {
  position: absolute;
  top: 0.22rem;
  left: 0.23rem;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--ink-soft);
  content: '';
  transition:
    background 550ms var(--curve),
    transform 550ms var(--curve);
}

.toggle:checked {
  background: rgba(236, 54, 100, 0.38);
}

.toggle:checked::after {
  background: white;
  transform: translateX(1.25rem);
}

.form-actions {
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 2rem;
  padding-top: 1.3rem;
  border-top: 1px solid var(--hairline);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  padding: 0 1.05rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 650;
  transition:
    opacity 600ms var(--curve),
    transform 600ms var(--curve);
}

.button:hover {
  transform: translateY(-2px);
}

.button:active {
  transform: scale(0.98);
}

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

.button.primary {
  background: var(--ink);
  color: #170f13;
}

.button.secondary {
  background: rgba(236, 54, 100, 0.12);
  box-shadow: inset 0 0 0 1px rgba(236, 54, 100, 0.24);
  color: var(--accent-pale);
}

.button.ghost {
  margin-left: auto;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--hairline);
  color: var(--ink-muted);
}

.preview-shell {
  position: sticky;
  top: 1rem;
}

.preview-core {
  padding: 1.4rem;
}

.preview-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  color: var(--ink-muted);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.discord-canvas {
  padding: 1rem;
  border-radius: 1.15rem;
  background: #313338;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  color: #dbdee1;
  font-family: 'Segoe UI Variable', 'Trebuchet MS', sans-serif;
}

.discord-message {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: 0.7rem;
}

.discord-avatar {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-family: var(--display);
  font-size: 1.1rem;
}

.discord-meta {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.42rem;
}

.discord-meta b {
  color: #f2f3f5;
  font-size: 0.78rem;
}

.bot-badge {
  padding: 0.12rem 0.27rem;
  border-radius: 0.2rem;
  background: #5865f2;
  color: white;
  font-size: 0.45rem;
  font-weight: 750;
}

.discord-meta small {
  color: #949ba4;
  font-size: 0.58rem;
}

.discord-embed {
  position: relative;
  overflow: hidden;
  max-width: 32rem;
  padding: 0.85rem 0.9rem 0.75rem 1rem;
  border-radius: 0.22rem;
  background: #2b2d31;
}

.discord-embed::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0.25rem;
  background: var(--preview-color, var(--accent));
  content: '';
}

.embed-author {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
  color: #f2f3f5;
  font-size: 0.65rem;
  font-weight: 650;
}

.embed-author img {
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  object-fit: cover;
}

.embed-title {
  margin: 0 0 0.45rem;
  color: #f2f3f5;
  font-size: 0.83rem;
  font-weight: 680;
}

.embed-description {
  min-height: 2rem;
  margin: 0;
  overflow-wrap: anywhere;
  color: #dbdee1;
  font-size: 0.67rem;
  line-height: 1.47;
  white-space: pre-wrap;
}

.embed-thumbnail {
  float: right;
  width: 4.6rem;
  height: 4.6rem;
  margin: 0 0 0.6rem 0.8rem;
  border-radius: 0.35rem;
  object-fit: cover;
}

.embed-image {
  display: block;
  width: 100%;
  max-height: 15rem;
  margin-top: 0.8rem;
  border-radius: 0.35rem;
  object-fit: cover;
}

.embed-footer {
  margin-top: 0.7rem;
  color: #b5bac1;
  font-size: 0.54rem;
}

.preview-help {
  margin: 1rem 0 0;
  color: var(--ink-muted);
  font-size: 0.62rem;
  line-height: 1.55;
}

.audit-shell {
  max-width: 980px;
}

.audit-core {
  padding: clamp(1.3rem, 3vw, 2.2rem);
}

.audit-head {
  justify-content: space-between;
  margin-bottom: 1.6rem;
}

.audit-head p {
  margin: 0.35rem 0 0;
  color: var(--ink-muted);
  font-size: 0.68rem;
}

.audit-list {
  display: grid;
}

.audit-entry {
  display: grid;
  grid-template-columns: 2.1rem minmax(0, 1fr) auto;
  gap: 0.85rem;
  padding: 1rem 0;
  border-top: 1px solid var(--hairline);
}

.audit-icon {
  display: grid;
  width: 2.1rem;
  height: 2.1rem;
  place-items: center;
  border-radius: 0.75rem;
  background: rgba(236, 54, 100, 0.1);
  color: var(--accent-soft);
  font-family: var(--display);
}

.audit-entry b {
  display: block;
  font-size: 0.72rem;
}

.audit-entry p {
  margin: 0.25rem 0 0;
  color: var(--ink-muted);
  font-size: 0.63rem;
  line-height: 1.5;
}

.audit-entry time {
  color: var(--ink-muted);
  font-size: 0.58rem;
  white-space: nowrap;
}

.empty-state {
  padding: 4rem 1rem;
  color: var(--ink-muted);
  text-align: center;
}

.toast-region {
  position: fixed;
  z-index: 6;
  right: 1.2rem;
  bottom: 1.2rem;
  display: grid;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  width: min(24rem, calc(100vw - 2rem));
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: rgba(28, 20, 25, 0.94);
  box-shadow:
    inset 0 0 0 1px var(--hairline-bright),
    0 24px 80px rgba(0, 0, 0, 0.36);
  color: var(--ink);
  font-size: 0.7rem;
  opacity: 0;
  transform: translateY(1rem);
  animation: toast-in 600ms var(--curve) forwards;
  backdrop-filter: blur(18px);
}

.toast.error {
  box-shadow:
    inset 0 0 0 1px rgba(255, 111, 120, 0.35),
    0 24px 80px rgba(0, 0, 0, 0.36);
}

@keyframes toast-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-nav {
  display: none;
}

@media (max-width: 1060px) {
  .login-hero {
    grid-template-columns: 1fr;
    gap: 5rem;
    padding: 7rem 2rem;
  }

  .hero-copy {
    max-width: 760px;
  }

  .login-composition {
    width: min(650px, 100%);
    margin: 0 auto;
  }

  .overview-grid,
  .feature-layout {
    grid-template-columns: 1fr;
  }

  .overview-primary {
    grid-row: auto;
  }

  .preview-shell {
    position: static;
  }

  .feature-shortcuts {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .login-screen {
    width: 100%;
    padding: 0.8rem 1rem 5rem;
  }

  .login-nav {
    border-radius: 1.2rem;
  }

  .login-nav > .status-chip {
    display: none;
  }

  .login-hero {
    min-height: auto;
    padding: 6rem 0 3rem;
  }

  .hero-copy h1 {
    font-size: clamp(3.8rem, 19vw, 6rem);
  }

  .hero-shell,
  .tag-one,
  .tag-two {
    transform: none;
  }

  .floating-tag {
    display: none;
  }

  .dashboard-shell {
    display: block;
    width: 100%;
    padding: 0;
  }

  .sidebar {
    display: none;
  }

  .dashboard-main {
    width: 100%;
    padding: 2rem 1rem 7.5rem;
  }

  .dashboard-header {
    align-items: flex-start;
    margin-bottom: 2.2rem;
  }

  .dashboard-header h1 {
    font-size: 2.6rem;
  }

  .header-actions {
    max-width: 8rem;
  }

  .status-chip {
    font-size: 0.5rem;
  }

  .metric-row,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .field.full {
    grid-column: auto;
  }

  .feature-shortcuts {
    grid-template-columns: 1fr 1fr;
  }

  .shortcut {
    min-height: 8rem;
  }

  .shortcut .shortcut-glyph {
    margin-bottom: 1.6rem;
  }

  .button.ghost {
    margin-left: 0;
  }

  .mobile-nav {
    position: fixed;
    z-index: 5;
    right: 0.7rem;
    bottom: 0.7rem;
    left: 0.7rem;
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0.38rem;
    border-radius: 1.4rem;
    background: rgba(24, 17, 21, 0.88);
    box-shadow:
      inset 0 0 0 1px var(--hairline-bright),
      0 28px 80px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(24px);
  }

  .mobile-nav button {
    display: grid;
    place-items: center;
    gap: 0.15rem;
    flex: 0 0 4.5rem;
    min-height: 3.2rem;
    border-radius: 1rem;
    background: transparent;
    color: var(--ink-muted);
    font-size: 0.52rem;
    cursor: pointer;
  }

  .mobile-nav::-webkit-scrollbar {
    display: none;
  }

  .channel-check-list {
    grid-template-columns: 1fr;
  }

  .binding-row {
    grid-template-columns: 1fr 1fr;
  }

  .binding-row > .inline-field {
    grid-column: span 1;
  }

  .mobile-nav button span {
    font-family: var(--display);
    font-size: 0.9rem;
  }

  .mobile-nav button.is-active {
    background: rgba(236, 54, 100, 0.12);
    color: var(--accent-pale);
  }

  .audit-entry {
    grid-template-columns: 2.1rem minmax(0, 1fr);
  }

  .audit-entry time {
    grid-column: 2;
  }
}

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