:root {
  color-scheme: dark;
  --bg: #101411;
  --panel: #141915;
  --panel2: #1b211c;
  --panel3: #222a23;
  --text: #e8ece4;
  --muted: #899587;
  --border: #2a332b;
  --accent: #b4f272;
  --ink: #17210e;
  --red: #ff8585;
  --blue: #8bbff6;
  --yellow: #edc776;
  --shadow: 0 24px 100px #0005;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 14px;
}
.mobile-pricing {
  display: none;
}
.pricing-card {
  max-width: 480px;
  padding: 32px;
  border: 1px solid var(--accent);
  border-radius: 20px;
  background: var(--panel);
}
.pricing-card h3 {
  margin: 22px 0;
  font-size: 48px;
}
.pricing-card h3 small {
  font-size: 15px;
  font-weight: 400;
  color: var(--muted);
}
.pricing-card ul {
  padding: 0;
  list-style: none;
}
.pricing-card li {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
}
.pricing-card li svg {
  width: 20px;
  color: var(--accent);
}
.pricing-card .btn {
  margin-top: 20px;
}
.usage-card {
  padding: 20px;
  margin-bottom: 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel2);
}
.usage-card h3 {
  font-size: 15px;
  margin: 0;
}
.usage-card .row {
  flex-wrap: wrap;
}
.usage-card .tag {
  white-space: normal;
}
.usage-count {
  margin: 20px 0 12px;
  color: var(--muted);
}
.usage-count strong {
  color: var(--text);
  font-size: 28px;
}
.usage-card progress {
  display: block;
  width: 100%;
  height: 10px;
  border: none;
  border-radius: 10px;
  background: var(--panel3);
  accent-color: var(--accent);
  overflow: hidden;
}
.usage-card progress::-webkit-progress-bar {
  background: var(--panel3);
}
.usage-card progress::-webkit-progress-value {
  background: var(--accent);
  border-radius: 10px;
}
.usage-card progress::-moz-progress-bar {
  background: var(--accent);
}
.usage-card.limit-reached progress {
  accent-color: var(--red);
}
.usage-card.limit-reached progress::-webkit-progress-value {
  background: var(--red);
}
.usage-card.limit-reached progress::-moz-progress-bar {
  background: var(--red);
}
.usage-warning {
  color: var(--red);
}
.usage-card .form-note,
.admin-reset .form-note {
  margin: 12px 0 0;
}
.admin-entry,
.admin-pagination,
.admin-reset {
  margin-top: 20px;
}
.admin-search label {
  min-width: 0;
}
.admin-users {
  margin-top: 20px;
}
.admin-user strong,
.admin-user small {
  overflow-wrap: anywhere;
}
.admin-reset {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.admin-reset .btn {
  margin-top: 14px;
}
@media (max-width: 760px) {
  .mobile-pricing {
    display: inline;
    font-size: 12px;
  }
  .nav {
    flex-wrap: wrap;
    gap: 8px;
  }
  .pricing-card {
    padding: 24px;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6ef;
  --panel: #fff;
  --panel2: #eef2e8;
  --panel3: #e4eadc;
  --text: #202b22;
  --muted: #62705f;
  --border: #d6dfcd;
  --accent: #4b761f;
  --ink: #fff;
  --red: #b83035;
  --blue: #2869a4;
  --yellow: #89610c;
  --shadow: 0 24px 100px #24341613;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
}
button {
  border: 0;
}
button svg {
  pointer-events: none;
}
svg {
  width: 19px;
  height: 19px;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
h1,
h2,
h3,
p {
  margin: 0;
}
p {
  line-height: 1.7;
}
small {
  font-size: 11px;
}
.mono,
code,
pre,
.eyebrow,
.label,
.status {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
.muted {
  color: var(--muted);
}
.accent {
  color: var(--accent);
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.between {
  justify-content: space-between;
}
.grow {
  flex: 1;
  min-width: 0;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 17px;
  border-radius: 7px;
  background: var(--accent);
  color: var(--ink);
  font-weight: 600;
  border: 1px solid transparent;
  transition:
    filter 0.15s,
    transform 0.15s;
}
.btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}
.btn.secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn.danger {
  background: #ff858514;
  color: var(--red);
  border-color: #ff858533;
}
.btn.small {
  font-size: 12px;
  padding: 8px 11px;
}
.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  flex-shrink: 0;
}
.icon-btn:hover {
  background: var(--panel3);
  color: var(--text);
}
.icon-btn.active {
  color: var(--accent);
  background: var(--panel3);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.6px;
}
.brand-icon {
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--ink);
  width: 31px;
  height: 31px;
  border-radius: 7px;
}
.brand-icon svg {
  width: 23px;
  height: 23px;
}
.brand span:last-child {
  color: var(--accent);
}
.dot {
  width: 6px;
  height: 6px;
  display: inline-block;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 9px #b4f240;
}
.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 9px;
}
.product-name {
  text-transform: none;
}
.label {
  font-size: 10px;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--muted);
}
.tag {
  font: 10px monospace;
  background: var(--panel3);
  border: 1px solid var(--border);
  padding: 4px 7px;
  border-radius: 4px;
  color: var(--muted);
}
.landing {
  isolation: isolate;
  max-width: 1320px;
  margin: auto;
  padding: 0 60px;
}
.landing > header,
.landing > main,
.landing > footer {
  position: relative;
  z-index: 1;
}
.landing-spotlight {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  color: var(--accent);
  background: radial-gradient(
    circle 260px at var(--spot-x, -500px) var(--spot-y, -500px),
    color-mix(in srgb, currentColor 3%, transparent),
    transparent
  );
  transition: opacity 0.7s ease;
  mask-image: radial-gradient(
    circle 240px at var(--spot-x, -500px) var(--spot-y, -500px),
    #000 10%,
    transparent 100%
  );
}
.landing-spotlight::after {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: 0.11;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='144'%3E%3Ctext fill='white' font-family='monospace' font-size='11'%3E%3Ctspan x='8' y='18'%3E0 1 0 0 1 0%3C/tspan%3E%3Ctspan x='8' y='42'%3E1 0 1 1 0 1%3C/tspan%3E%3Ctspan x='8' y='66'%3E0 0 1 0 1 1%3C/tspan%3E%3Ctspan x='8' y='90'%3E1 1 0 1 0 0%3C/tspan%3E%3Ctspan x='8' y='114'%3E0 1 1 0 0 1%3C/tspan%3E%3Ctspan x='8' y='138'%3E1 0 0 1 1 0%3C/tspan%3E%3C/text%3E%3C/svg%3E");
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .landing-spotlight.active {
    opacity: 1;
  }
}
.nav {
  height: 98px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  color: var(--muted);
  font-size: 13px;
}
.nav-links a:hover {
  color: var(--text);
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lang {
  background: transparent;
  color: var(--muted);
  font: 11px monospace;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 5px;
}
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  min-height: 560px;
  padding: 70px 0;
}
.hero h1 {
  font-size: clamp(42px, 4.8vw, 65px);
  line-height: 1.08;
  letter-spacing: -3px;
  font-weight: 600;
  margin: 24px 0;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
}
.hero > div > p {
  font-size: 16px;
  color: var(--muted);
  max-width: 440px;
  line-height: 1.8;
}
.hero-cta {
  margin-top: 30px;
  display: flex;
  gap: 12px;
}
.hero-note {
  margin-top: 19px;
  font-size: 11px;
  color: var(--muted);
}
.hero-note span {
  margin-right: 18px;
}
.terminal {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: rotate(-1deg);
}
.terminal-bar {
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
  font: 10px monospace;
  color: var(--muted);
}
.terminal-bar i {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #455044;
}
.terminal-bar i:first-child {
  background: #aa6761;
}
.terminal-bar i:nth-child(2) {
  background: #a49461;
}
.terminal-bar i:nth-child(3) {
  background: #728e58;
}
.terminal-bar span {
  margin-left: auto;
}
.terminal-code {
  padding: 24px;
  font-size: 11px;
  line-height: 1.9;
  color: var(--muted);
  overflow: auto;
}
.terminal-code b {
  font-weight: 400;
  color: var(--accent);
}
.terminal-code .blue {
  color: var(--blue);
}
.terminal-result {
  padding: 15px 24px;
  border-top: 1px dashed var(--border);
  font: 11px monospace;
  color: var(--accent);
}
.demo-notification {
  border: 1px solid var(--border);
  margin: 0 20px 22px;
  padding: 16px;
  border-radius: 7px;
  display: flex;
  gap: 12px;
  background: var(--panel2);
}
.demo-notification p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
}
.demo-notification strong {
  font-size: 12px;
}
.service-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 26px 0;
  color: var(--muted);
  flex-wrap: wrap;
}
.service-strip .row {
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
}
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  padding: 65px 0 30px;
  gap: 20px;
}
.section-title h2 {
  font-weight: 500;
  font-size: 31px;
  letter-spacing: -1px;
  margin-top: 12px;
}
.section-title > p {
  color: var(--muted);
  font-size: 13px;
  max-width: 340px;
}
/* The light and station highlights share one 8-second timeline. */
.backup-flow {
  scroll-margin-top: 24px;
}
.flow-intro {
  color: var(--muted);
  max-width: 650px;
  line-height: 1.7;
  margin: -10px 0 26px;
}
.flow-rows {
  display: grid;
  gap: 16px;
}
.flow-row {
  --flow-color: var(--accent);
  position: relative;
  padding: 26px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}
.flow-error {
  --flow-color: var(--red);
}
.flow-stations {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}
.flow-station {
  min-width: 0;
  text-align: center;
  padding: 0 10px;
}
.flow-node {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel2);
  color: var(--muted);
  animation: flow-highlight 8s linear infinite;
  animation-delay: calc(var(--station) * 1.6s);
}
.flow-node svg {
  width: 25px;
  height: 25px;
}
.flow-error .flow-station:last-child .flow-node svg {
  transform-origin: 50% 20%;
  animation: flow-push-shake 8s linear infinite;
}
@keyframes flow-push-shake {
  0%,
  60%,
  74%,
  100% {
    transform: rotate(0deg);
  }
  61%,
  65%,
  69% {
    transform: rotate(-18deg);
  }
  63%,
  67%,
  71% {
    transform: rotate(18deg);
  }
  73% {
    transform: rotate(-8deg);
  }
}
.flow-number {
  position: absolute;
  top: -8px;
  right: -7px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  font: 10px monospace;
}
.flow-station h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 8px;
}
.flow-station p {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}
.flow-station:first-child h3,
.flow-station:last-child h3 {
  color: var(--flow-color);
}
.flow-track {
  position: absolute;
  top: 55px;
  left: calc(18px + (100% - 36px) / 8);
  right: calc(18px + (100% - 36px) / 8);
  height: 2px;
  background: var(--border);
}
.flow-light {
  position: absolute;
  left: 0;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--flow-color);
  box-shadow:
    0 0 10px 3px var(--flow-color),
    0 0 24px 5px color-mix(in srgb, var(--flow-color) 40%, transparent);
  animation: flow-travel 8s linear infinite;
}
.flow-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  margin: 16px 0 0;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.flow-note svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--accent);
}
.is-paused .flow-node,
.is-paused .flow-error .flow-station:last-child .flow-node svg,
.is-paused .flow-light {
  animation-play-state: paused;
}
@keyframes flow-travel {
  0%,
  10% {
    left: 0;
    opacity: 1;
  }
  20%,
  30% {
    left: 33.333%;
    opacity: 1;
  }
  40%,
  50% {
    left: 66.666%;
    opacity: 1;
  }
  60%,
  76% {
    left: 100%;
    opacity: 1;
  }
  82%,
  100% {
    left: 100%;
    opacity: 0;
  }
}
@keyframes flow-highlight {
  0%,
  14% {
    color: var(--flow-color);
    border-color: var(--flow-color);
    box-shadow:
      0 0 0 5px color-mix(in srgb, var(--flow-color) 9%, transparent),
      0 0 28px color-mix(in srgb, var(--flow-color) 22%, transparent);
  }
  22%,
  100% {
    color: var(--muted);
    border-color: var(--border);
    box-shadow: none;
  }
}
@media (max-width: 760px) {
  .flow-toggle {
    margin-top: 18px;
  }
  .flow-row {
    padding: 24px 20px;
  }
  .flow-stations {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .flow-station {
    display: grid;
    grid-template-columns: 52px 1fr;
    grid-template-rows: auto auto;
    column-gap: 18px;
    text-align: left;
    padding: 0;
    min-height: 112px;
    align-content: start;
  }
  .flow-station:last-child {
    min-height: 52px;
  }
  .flow-node {
    grid-row: 1 / 3;
    width: 52px;
    height: 52px;
    margin: 0;
    border-radius: 14px;
  }
  .flow-station h3 {
    margin: 3px 0 5px;
  }
  .flow-track {
    top: 50px;
    bottom: 50px;
    left: 46px;
    right: auto;
    width: 2px;
    height: auto;
  }
  .flow-light {
    top: 0;
    left: -3px;
    animation-name: flow-travel-mobile;
  }
  .flow-note {
    justify-content: flex-start;
    padding: 16px;
  }
}
@keyframes flow-travel-mobile {
  0%,
  10% {
    top: 0;
    opacity: 1;
  }
  20%,
  30% {
    top: 33.333%;
    opacity: 1;
  }
  40%,
  50% {
    top: 66.666%;
    opacity: 1;
  }
  60%,
  76% {
    top: 100%;
    opacity: 1;
  }
  82%,
  100% {
    top: 100%;
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .flow-error .flow-station:last-child .flow-node svg {
    animation: none;
  }
  .flow-light,
  .flow-toggle {
    display: none;
  }
  .flow-node {
    animation: none;
    color: var(--flow-color);
    border-color: var(--flow-color);
  }
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.feature {
  padding: 29px 30px 30px 0;
}
.feature + .feature {
  border-left: 1px solid var(--border);
  padding-left: 30px;
}
.feature-icon {
  color: var(--accent);
  margin-bottom: 26px;
}
.feature h3 {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 12px;
}
.feature p {
  font-size: 12px;
  color: var(--muted);
}
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin: 0 0 60px;
}
.step-number {
  font: 12px monospace;
  color: var(--accent);
  margin-bottom: 15px;
}
.steps h3 {
  font-size: 14px;
  margin-bottom: 10px;
}
.steps p {
  font-size: 12px;
  color: var(--muted);
}
.bottom-cta {
  padding: 32px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 9px;
  margin: 0 0 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.bottom-cta h3 {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.7px;
  margin-bottom: 8px;
}
.bottom-cta p {
  font-size: 12px;
  color: var(--muted);
}
footer {
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  padding: 25px 0 35px;
  font-size: 11px;
  color: var(--muted);
}
/* Workspace */
.workspace {
  height: 100dvh;
  display: flex;
  overflow: hidden;
}
.rail {
  width: 72px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 24px 0 17px;
  gap: 23px;
  background: var(--bg);
}
.rail .brand-icon {
  width: 34px;
  height: 34px;
}
.rail > nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 23px;
}
.rail .icon-btn {
  width: 40px;
  height: 40px;
}
.rail .spacer {
  flex: 1;
}
.rail-info {
  position: relative;
}
.info-dropdown {
  position: absolute;
  top: 0;
  left: calc(100% + 12px);
  z-index: 20;
  width: min(250px, calc(100vw - 80px));
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.info-dropdown[hidden] {
  display: none;
}
.info-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px;
  border-radius: 5px;
  color: var(--text);
  font-size: 12px;
}
.info-dropdown a:hover,
.info-dropdown a:focus-visible {
  background: var(--panel3);
  color: var(--accent);
}
.info-dropdown svg {
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  color: var(--muted);
}
.avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: var(--panel3);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--accent);
  font: 12px monospace;
}
.chat-sidebar {
  width: 302px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.sidebar-heading {
  padding: 16px 22px 12px;
}
.sidebar-heading h1 {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.7px;
}
.sidebar-search {
  margin: 0 18px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  padding: 9px 11px;
  border-radius: 6px;
  color: var(--muted);
}
.sidebar-search input {
  background: none;
  border: 0;
  padding: 0;
  min-width: 0;
  width: 100%;
  color: var(--text);
  font-size: 11px;
  outline: 0;
}
.sidebar-search svg {
  width: 15px;
  height: 15px;
}
.sidebar-tabs {
  padding: 0 18px 12px;
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
}
.chip {
  background: transparent;
  color: var(--muted);
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 11px;
}
.chip.active {
  background: var(--panel3);
  color: var(--text);
  border-color: var(--border);
}
.chip .count {
  font-size: 9px;
  margin-left: 5px;
  color: var(--muted);
}
.chats {
  overflow: auto;
  padding: 10px;
  flex: 1;
}
.chat-item {
  display: block;
  cursor: pointer;
  width: 100%;
  background: none;
  color: var(--text);
  text-align: left;
  padding: 15px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  margin-bottom: 4px;
}
.chat-select {
  display: flex;
  gap: 12px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
}
.chat-status-strip {
  position: relative;
  height: 20px;
  margin: 8px 0 0 50px;
  overflow: hidden;
}
.chat-status-bar {
  --status-color: #b8b8b8;
  position: absolute;
  top: 0;
  width: 10px;
  height: 20px;
  padding: 0;
  border: 1px solid var(--status-color);
  border-radius: 2px;
  background: color-mix(in srgb, var(--status-color) 72%, white);
}
.chat-status-bar:hover {
  background: var(--status-color);
}
button.chat-status-bar:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: -2px;
  z-index: 1;
}
.chat-item:hover {
  background: var(--panel2);
}
.chat-item.selected {
  background: var(--panel3);
  border-color: var(--border);
}
.chat-icon {
  width: 38px;
  height: 38px;
  background: color-mix(
    in srgb,
    var(--chat-color, var(--accent)) 10%,
    transparent
  );
  border: 1px solid
    color-mix(in srgb, var(--chat-color, var(--accent)) 22%, transparent);
  color: var(--chat-color, var(--accent));
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.chat-title {
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 155px;
}
.chat-time {
  font: 9px monospace;
  color: var(--muted);
}
.chat-preview {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 175px;
  margin-top: 8px;
}
.unread-counts {
  display: inline-flex;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 6px;
}
.chat-preview {
  min-width: 0;
}
.unread {
  font: 10px monospace;
  min-width: 17px;
  height: 17px;
  padding: 2px 4px;
  display: inline-grid;
  place-items: center;
  border-radius: 4px;
  background: var(--message-color);
  color: var(--ink);
}
.unread-important {
  font-weight: 700;
}
@media (prefers-reduced-motion: no-preference) {
  .chat-important-unread .chat-icon svg {
    animation: unread-icon-wiggle 2s ease-in-out infinite;
    transform-origin: 50% 65%;
  }
}
@keyframes unread-icon-wiggle {
  0%,
  40%,
  100% {
    transform: rotate(0deg);
  }
  8%,
  24% {
    transform: rotate(-12deg);
  }
  16%,
  32% {
    transform: rotate(12deg);
  }
}
.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 17px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font: 10px monospace;
  color: var(--muted);
}
.sidebar-footer .row {
  gap: 7px;
}
.main-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.chat-header {
  height: 56px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  gap: 14px;
}
.chat-header h2 {
  font-size: 17px;
  letter-spacing: -0.4px;
  margin-bottom: 2px;
}
.chat-header p {
  font-size: 11px;
  color: var(--muted);
}
.chat-header .row {
  gap: 13px;
}
.chat-header .tag {
  border-color: #b4f230;
  color: var(--accent);
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 32px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.search-field {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 150px;
  color: var(--muted);
}
.search-field svg {
  width: 16px;
  height: 16px;
}
.search-field input {
  background: none;
  border: 0;
  color: var(--text);
  outline: 0;
  width: 100%;
  font-size: 12px;
}
.filter-select {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--muted);
  padding: 7px 8px;
  font-size: 11px;
  max-width: 145px;
}
.message-area {
  flex: 1;
  overflow: auto;
  padding: 12px 32px 20px;
  overflow-anchor: none;
}
.date-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  font: 10px monospace;
  color: var(--muted);
  margin: 0 0 14px;
  text-align: center;
}
.date-divider:before,
.date-divider:after {
  content: "";
  height: 1px;
  background: var(--border);
  flex: 1;
}
.message {
  margin: 0 0 19px;
  display: flex;
  gap: 12px;
  max-width: 950px;
}
.message .chat-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  margin-top: 4px;
}
.message .chat-icon svg {
  width: 15px;
  height: 15px;
}
.message-content {
  min-width: 0;
  flex: 1;
}
.message-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 9px;
  padding-top: 3px;
}
.message-meta strong {
  font-size: 11px;
  font-weight: 500;
}
.message-meta time {
  font: 9px monospace;
  color: var(--muted);
}
.message-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 2px solid var(--message-color, var(--border));
  border-radius: 0 7px 7px 0;
  padding: 16px 19px;
  position: relative;
}
.message-arrival,
.chat-arrival {
  animation: message-glow 900ms ease-out 1;
}
@keyframes message-glow {
  0%,
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
  25% {
    box-shadow: 0 0 18px 3px
      color-mix(in srgb, var(--message-color) 45%, transparent);
  }
}
@media (prefers-reduced-motion: reduce) {
  .message-arrival,
  .chat-arrival {
    animation: none;
  }
}
.message-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 11px;
}
.status {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--message-color);
}
.status svg {
  width: 12px;
  height: 12px;
}
.message-card h3 {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 7px;
}
.markdown {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.markdown p + p {
  margin-top: 8px;
}
.markdown pre {
  overflow: auto;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.markdown code {
  font-size: 11px;
  color: var(--text);
}
.markdown a {
  color: var(--accent);
  text-decoration: underline;
}
.markdown ul,
.markdown ol {
  padding-left: 22px;
}
.markdown h1,
.markdown h2,
.markdown h3,
.markdown h4 {
  font-size: 14px;
  line-height: 1.5;
  margin: 8px 0;
}
.markdown blockquote {
  margin: 10px 0;
  padding-left: 12px;
  border-left: 2px solid var(--accent);
}
.message-data {
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 11px;
}
.message-data summary {
  cursor: pointer;
  color: var(--muted);
  width: fit-content;
}
.message-data summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}
.message-data dl {
  margin: 12px 0 0;
}
.metadata-entry + .metadata-entry {
  margin-top: 10px;
}
.message-data dt {
  font-family: monospace;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.message-data small {
  color: var(--muted);
  font: 9px monospace;
}
.message-data dd {
  margin: 4px 0 0;
}
.message-data pre {
  margin: 0;
  padding: 8px 10px;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--panel2);
  border-radius: 4px;
  color: var(--text);
  font: 11px/1.6 monospace;
  tab-size: 2;
}
.message-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}
.message-actions .icon-btn {
  height: 24px;
  width: 27px;
}
.message-actions svg {
  width: 13px;
  height: 13px;
}
.unread-dot {
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
}
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 50px 25px;
  flex: 1;
  min-height: 280px;
}
.empty > .chat-icon {
  width: 62px;
  height: 62px;
  border-radius: 15px;
  margin-bottom: 10px;
}
.empty h2 {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.8px;
}
.empty p {
  color: var(--muted);
  max-width: 380px;
  font-size: 13px;
}
.sidebar-empty {
  padding: 30px 14px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
.mobile-back {
  display: none;
}
.demo-banner {
  background: var(--panel3);
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
  color: var(--muted);
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.demo-banner button {
  font-size: 11px;
  color: var(--accent);
  background: none;
}
.custom-dates {
  display: flex;
  gap: 8px;
  width: 100%;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}
.custom-dates input {
  padding: 5px 8px;
  width: auto;
  font-size: 11px;
}
.load-more {
  display: block;
  margin: 0 auto 20px;
}
/* Dialogs */
dialog {
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  max-width: min(550px, calc(100vw - 30px));
  width: 550px;
  box-shadow: var(--shadow);
  max-height: 90dvh;
}
dialog::backdrop {
  background: #060a08b8;
  backdrop-filter: blur(5px);
}
.modal-head {
  padding: 24px 26px 20px;
  display: flex;
  justify-content: space-between;
  align-items: start;
  border-bottom: 1px solid var(--border);
  gap: 15px;
}
.modal-head h2 {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.6px;
}
.modal-head p {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
.modal-body {
  padding: 24px 26px;
}
.modal-body form {
  display: grid;
  gap: 17px;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 500;
}
label > span {
  display: block;
  margin-bottom: 8px;
}
input,
textarea,
select {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 6px;
  color: var(--text);
  padding: 11px 12px;
  width: 100%;
  font-size: 13px;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
}
input[type="color"] {
  padding: 3px;
  height: 40px;
}
input[type="checkbox"] {
  width: auto;
  accent-color: var(--accent);
}
textarea {
  resize: vertical;
  min-height: 75px;
}
.chat-icon-picker {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.chat-icon-picker legend {
  padding: 0;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 500;
}
.chat-icon-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.chat-icon-option {
  position: relative;
  cursor: pointer;
}
.chat-icon-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.chat-icon-option > span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
}
.chat-icon-option svg {
  width: 24px;
  height: 24px;
}
.chat-icon-option:hover > span,
.chat-icon-option input:checked + span {
  color: var(--accent);
  border-color: var(--accent);
}
.chat-icon-option input:checked + span {
  box-shadow: inset 0 0 0 1px var(--accent);
}
.chat-icon-option input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
}
.form-error {
  color: var(--red);
  font-size: 12px;
  line-height: 1.6;
  min-height: 0;
}
.form-error:empty {
  display: none;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 6px;
}
.text-btn {
  color: var(--accent);
  background: none;
  padding: 0;
  font-size: 12px;
}
.auth-switch {
  text-align: center;
  margin-top: 22px;
  font-size: 12px;
  color: var(--muted);
}
.auth-recover {
  justify-self: end;
}
.auth-notice {
  display: grid;
  justify-items: start;
  gap: 20px;
}
.auth-notice p {
  color: var(--muted);
  font-size: 14px;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: var(--muted);
}
.setting-section + .setting-section {
  border-top: 1px solid var(--border);
  margin-top: 24px;
  padding-top: 24px;
}
.setting-section h3 {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 17px;
}
.settings-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 15px;
}
.settings-tools p {
  font-size: 11px;
  color: var(--muted);
}
.token-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 13px 0;
  font-size: 12px;
}
.token-row small {
  color: var(--muted);
  display: block;
  margin-top: 4px;
}
.code-block {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 15px;
  overflow: auto;
  margin: 15px 0;
  font: 11px/1.8 monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
dialog:has(.webhook-generator) {
  width: 760px;
  max-width: min(760px, calc(100vw - 30px));
}
.webhook-token-field {
  display: flex;
  align-items: center;
  gap: 8px;
}
.webhook-token-field input {
  min-width: 0;
  flex: 1;
}
.webhook-token-field button {
  flex-shrink: 0;
}
.webhook-generator {
  display: grid;
  gap: 16px;
  margin: 24px 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
}
.webhook-generator[hidden] {
  display: none;
}
.webhook-explanation {
  margin: 14px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.webhook-generator input,
.webhook-generator select {
  height: 44px;
  box-sizing: border-box;
}
.webhook-generator h3 {
  font-size: 14px;
  font-weight: 500;
}
.webhook-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.webhook-tabs button {
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
}
.webhook-tabs button[aria-selected="true"] {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--panel3);
}
.webhook-code-toolbar {
  display: flex;
  justify-content: flex-end;
}
.webhook-generator .code-block {
  margin: 10px 0 0;
  max-height: 320px;
}
.secret-note {
  padding: 12px;
  border: 1px solid #edc77633;
  border-radius: 6px;
  background: #edc77608;
  color: var(--yellow);
  font-size: 11px;
  line-height: 1.7;
  margin-bottom: 18px;
}
.token-create {
  margin-top: 20px;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--panel3);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 13px 22px;
  border-radius: 7px;
  font-size: 12px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  max-width: 90vw;
  box-shadow: var(--shadow);
}
#toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.error-text {
  color: var(--red);
}
.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}
@media (min-width: 1550px) {
  .message-area {
    padding-left: 6vw;
    padding-right: 6vw;
  }
  .chat-sidebar {
    width: 330px;
  }
}
@media (max-width: 1000px) {
  .landing {
    padding: 0 30px;
  }
  .hero {
    gap: 30px;
  }
  .hero h1 {
    font-size: 48px;
  }
  .nav-links {
    gap: 18px;
  }
  .chat-sidebar {
    width: 260px;
  }
  .chat-header,
  .toolbar {
    padding-left: 22px;
    padding-right: 22px;
  }
  .message-area {
    padding: 12px 22px 20px;
  }
  .chat-header .tag {
    display: none;
  }
  .chat-header .btn {
    font-size: 11px;
  }
  .rail {
    width: 60px;
  }
}
@media (max-width: 760px) {
  .landing {
    padding: 0 22px;
  }
  .nav {
    height: 78px;
  }
  .nav-links {
    display: none;
  }
  .nav-actions {
    gap: 6px;
  }
  .nav-actions .btn {
    padding: 9px 11px;
    font-size: 11px;
  }
  .nav .brand {
    font-size: 19px;
  }
  .hero {
    grid-template-columns: 1fr;
    padding: 50px 0;
    gap: 35px;
  }
  .hero h1 {
    font-size: 52px;
  }
  .hero > div > p {
    font-size: 14px;
  }
  .terminal {
    transform: none;
  }
  .service-strip {
    justify-content: flex-start;
    gap: 20px;
  }
  .service-strip > .label {
    width: 100%;
  }
  .features {
    grid-template-columns: 1fr;
  }
  .feature + .feature {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--border);
  }
  .feature-icon {
    margin-bottom: 18px;
  }
  .section-title {
    display: block;
    padding-top: 45px;
  }
  .section-title > p {
    margin-top: 15px;
  }
  .steps {
    grid-template-columns: 1fr;
    gap: 25px;
  }
  .bottom-cta {
    display: block;
    padding: 24px;
  }
  .bottom-cta .btn {
    margin-top: 20px;
  }
  footer {
    gap: 15px;
  }
  .rail {
    width: 54px;
    padding-top: 20px;
  }
  .rail .brand-icon {
    width: 29px;
    height: 29px;
  }
  .chat-sidebar {
    width: calc(100vw - 54px);
    border-right: 0;
  }
  .main-pane {
    display: none;
  }
  .workspace.chat-open .chat-sidebar {
    display: none;
  }
  .workspace.chat-open .main-pane {
    display: flex;
  }
  .mobile-back {
    display: inline-grid;
  }
  .chat-header {
    height: 56px;
    padding: 0 14px;
    gap: 7px;
  }
  .chat-header > .row {
    gap: 8px;
  }
  .chat-header .chat-icon {
    width: 32px;
    height: 32px;
  }
  .chat-header h2 {
    font-size: 14px;
  }
  .chat-header p {
    font-size: 10px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .chat-header .btn {
    width: 33px;
    height: 33px;
    padding: 0;
    font-size: 0;
    gap: 0;
  }
  .toolbar {
    padding: 8px 15px;
    gap: 6px;
  }
  .search-field {
    flex-basis: 100%;
    padding-bottom: 4px;
  }
  .filter-select {
    max-width: 135px;
  }
  .message-area {
    padding: 12px 14px 20px;
  }
  .message {
    gap: 8px;
  }
  .message > .chat-icon {
    display: none;
  }
  .message-card {
    padding: 13px;
  }
  .chat-title {
    max-width: 210px;
  }
  .chat-preview {
    max-width: 230px;
  }
  .modal-body,
  .modal-head {
    padding: 20px;
  }
  .field-row {
    gap: 10px;
  }
  .custom-dates {
    flex-wrap: wrap;
  }
  .custom-dates input {
    max-width: 175px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    transform: none !important;
  }
}
@media (max-width: 760px) {
  .chat-header > .row:first-child {
    min-width: 0;
    flex: 1;
  }
  .chat-header > .row:last-child {
    gap: 1px;
  }
  .chat-header > .row:first-child > div:last-of-type {
    min-width: 0;
  }
  .chat-header h2 {
    max-width: 105px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .chat-header p {
    max-width: 100px;
  }
  .toolbar > .filter-select {
    max-width: 120px;
  }
  .toolbar > .icon-btn {
    width: 28px;
  }
  .demo-banner {
    padding: 9px 14px;
    gap: 6px;
  }
}
[data-theme="light"] .chat-icon {
  color: color-mix(in srgb, var(--chat-color, var(--accent)) 48%, #173000);
}
#docs h2 {
  overflow-wrap: anywhere;
}

/* Shared navigation for the landing page, API reference and integrations. */
.site-header {
  height: auto;
  min-height: 98px;
  gap: 20px;
  padding: 22px 0;
}
.site-header .brand,
.site-header .nav-actions {
  flex-shrink: 0;
}
.site-header .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
}
.site-header .nav-links a[aria-current="page"] {
  color: var(--accent);
}
.service-strip a:hover {
  color: var(--accent);
}
.integration-shell > footer {
  flex-wrap: wrap;
  gap: 16px;
}
.integration-hero {
  max-width: 820px;
  padding: 72px 0 58px;
}
.integration-hero h1 {
  margin: 24px 0;
  font-size: clamp(36px, 5vw, 60px);
  line-height: 1.1;
  letter-spacing: -2px;
}
.integration-hero > p {
  max-width: 680px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}
.integration-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.integration-guide {
  max-width: 860px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.integration-guide .section-title {
  padding-top: 48px;
}
.integration-guide a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.integration-requirements,
.integration-note {
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
}
.installation-steps {
  padding-left: 26px;
  margin: 28px 0;
}
.installation-steps li {
  padding-left: 12px;
  margin-bottom: 24px;
}
.installation-steps li::marker {
  color: var(--accent);
  font-family: monospace;
}
.installation-steps h3,
.integration-note h3 {
  margin: 0 0 8px;
  font-size: 16px;
}
.installation-steps p,
.integration-note p {
  margin: 0;
  color: var(--muted);
}
.manual-install {
  margin: 28px 0;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.manual-install summary {
  cursor: pointer;
  font-weight: 500;
}
.manual-install li {
  margin: 12px 0;
  color: var(--muted);
}
.integration-note {
  margin-top: 28px;
}
.integration-more {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin: 28px 0 60px;
}
@media (max-width: 1150px) {
  .site-header {
    flex-wrap: wrap;
    gap: 18px;
  }
  .site-header .nav-links {
    order: 3;
    flex-basis: 100%;
  }
}
@media (max-width: 760px) {
  .site-header {
    padding: 18px 0;
  }
  .site-header .nav-links {
    font-size: 12px;
    gap: 12px 18px;
  }
  .integration-hero {
    padding: 46px 0 36px;
  }
  .integration-hero > p {
    font-size: 15px;
  }
}

/* Account settings overview and subpages */
.settings-nav {
  display: grid;
  gap: 10px;
}
.settings-link {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 17px 14px;
  text-align: left;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.settings-link:hover {
  border-color: var(--accent);
}
.settings-link-icon {
  display: grid;
  place-items: center;
  color: var(--accent);
}
.settings-link strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
}
.settings-link small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.settings-link > svg {
  flex-shrink: 0;
  color: var(--muted);
}
.settings-logout {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.settings-back {
  margin-bottom: 24px;
}
.settings-page .setting-section > h3 {
  display: none;
}

/* Legal pages and permanently available legal navigation. */
.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}
.legal-links a:hover,
.legal-links a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.legal-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.legal-content {
  flex: 1;
  width: 100%;
  max-width: 800px;
  padding: 56px 0 72px;
  overflow-wrap: anywhere;
  line-height: 1.8;
}
.legal-content h1 {
  font-size: clamp(28px, 6vw, 44px);
  line-height: 1.2;
  letter-spacing: -1px;
  margin: 24px 0 32px;
}
.legal-content h2 {
  font-size: 20px;
  line-height: 1.4;
  margin: 32px 0 12px;
}
.legal-content p {
  margin: 0 0 16px;
}
.legal-content address {
  font-style: normal;
  margin-bottom: 16px;
}
.legal-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.legal-shell > footer {
  flex-wrap: wrap;
  gap: 16px;
}

.apple-sign-in {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 44px;
  margin: 12px 0 20px;
  padding: 10px 16px;
  border: 1px solid #fff;
  border-radius: 6px;
  background: #000;
  color: #fff;
  font:
    500 17px -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  cursor: pointer;
}
.apple-sign-in svg {
  width: 20px;
  height: 24px;
}
.apple-sign-in:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* MCP settings keep their sub-headings; MCP docs section spacing. */
.settings-page .mcp-settings > h3 {
  display: block;
}
#mcp > h3 {
  margin: 28px 0 8px;
}
#mcp ul {
  display: grid;
  gap: 6px;
  padding-left: 20px;
  line-height: 1.6;
}

/* OAuth consent page for MCP clients. */
.oauth-shell {
  flex: 1;
  display: grid;
  place-items: start center;
  padding: 48px 0 72px;
}
.oauth-card {
  width: min(100%, 520px);
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
}
.oauth-card h1 {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.6px;
  line-height: 1.3;
}
.oauth-card form {
  display: grid;
  gap: 17px;
}
.oauth-eyebrow {
  font-family: var(--mono, monospace);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--muted);
}
.oauth-account {
  font-size: 13px;
}
.oauth-scopes {
  display: grid;
  gap: 10px;
  border: 0;
  padding: 0;
  margin: 0;
}
.oauth-scopes legend {
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 8px;
}
.oauth-scope {
  display: flex;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.oauth-scope input {
  width: auto;
  margin-top: 3px;
}
.oauth-scope small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 400;
}
.oauth-scope:has(input:disabled) {
  opacity: 0.55;
  cursor: not-allowed;
}
.oauth-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
