/* Lunaris: shared tokens and components. */
:root {
  color-scheme: dark;
  --bg: #101114;
  --panel: #17181d;
  --raised: #1e2026;
  --subtle: #141519;
  --line: #2c2e36;
  --text: #ececf0;
  --muted: #999ba8;
  --accent: #b5a2ed;
  --accent-bg: #292335;
  --accent-ink: #191323;
  --green: #85c9a4;
  --red: #ee9c9c;
  --amber: #dec18b;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f6f6f8;
  --panel: #fff;
  --raised: #f0f0f4;
  --subtle: #fafafb;
  --line: #dedee6;
  --text: #252530;
  --muted: #686878;
  --accent: #70529f;
  --accent-bg: #eee8f7;
  --accent-ink: #fff;
  --green: #24774a;
  --red: #b23c45;
  --amber: #8c631c;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  color: inherit;
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
a,
button,
input,
select,
textarea {
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}
a:hover {
  color: var(--accent);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
img {
  max-width: 100%;
  object-fit: cover;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 28px;
  letter-spacing: -1px;
  line-height: 1.25;
  font-weight: 650;
}
h2 {
  font-size: 18px;
  letter-spacing: -0.4px;
  font-weight: 600;
}
h3 {
  font-size: 15px;
  font-weight: 600;
}
p {
  color: var(--muted);
}
ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
code,
pre,
.mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
code,
small,
.small {
  font-size: 12px;
}
.muted {
  color: var(--muted);
}
.accent {
  color: var(--accent);
}
.good {
  color: var(--green);
}
.bad {
  color: var(--red);
}
.warn {
  color: var(--amber);
}
.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  letter-spacing: -0.4px;
  font-size: 17px;
  white-space: nowrap;
}
.brand-logo {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}
.brand em {
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.button:hover {
  background: var(--line);
  color: var(--text);
}
.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.button.danger {
  background: transparent;
  color: var(--red);
}
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0;
}
.icon-button:hover {
  background: var(--raised);
  color: var(--text);
}
input:not([type='checkbox']):not([type='color']):not([type='file']):not([type='hidden']),
select,
textarea {
  display: block;
  width: 100%;
  background: var(--subtle);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 6px;
  min-height: 42px;
  padding: 10px 12px;
  min-width: 0;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}
input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}
input[type='checkbox'] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}
input[type='color'] {
  width: 100%;
  height: 42px;
  background: var(--subtle);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px;
}
input[type='file'] {
  max-width: 100%;
  font-size: 12px;
}
label.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  min-width: 0;
}
label.field small {
  font-weight: 400;
  color: var(--muted);
  font-size: 11px;
}
.field-wide {
  grid-column: 1/-1;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.form-stack,
.stack {
  display: grid;
  gap: 20px;
}
.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  margin-top: 24px;
}
.check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.wrap {
  flex-wrap: wrap;
}
.split {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
  align-items: start;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  min-width: 0;
}
.panel-body {
  padding: 24px;
}
.panel-heading {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.panel-heading h2 {
  font-size: 14px;
}
.panel-description {
  font-size: 12px;
  margin-top: 5px;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.page-heading p {
  font-size: 13px;
  margin-top: 7px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  margin-bottom: 12px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--raised);
  border: 1px solid var(--line);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  white-space: nowrap;
}
.badge.plan {
  background: var(--accent-bg);
  color: var(--accent);
}
.badge.good::before,
.badge.bad::before,
.badge.warn::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.empty {
  padding: 44px 20px;
  text-align: center;
  grid-column: 1/-1;
}
.empty h3 {
  margin-bottom: 8px;
}
.empty p {
  font-size: 12px;
  max-width: 380px;
  margin: auto;
}
.empty .button {
  margin-top: 18px;
}
.notice {
  padding: 12px 15px;
  font-size: 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--panel);
  border-radius: 4px;
  color: var(--muted);
  margin-bottom: 20px;
}
.notice.error {
  border-left-color: var(--red);
  color: var(--red);
}
.notice.success {
  border-left-color: var(--green);
  color: var(--green);
}
.notice p {
  color: inherit;
}
.skip {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 100;
  background: var(--panel);
  padding: 12px;
}
.skip:focus {
  top: 12px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
[hidden] {
  display: none !important;
}
.table-wrap {
  overflow: auto;
  width: 100%;
}
table {
  border-collapse: collapse;
  text-align: left;
  width: 100%;
  white-space: nowrap;
  font-size: 12px;
}
th {
  color: var(--muted);
  font-weight: 500;
  background: var(--subtle);
  font-size: 11px;
}
th,
td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: var(--subtle);
}
td .button {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 11px;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--raised);
  flex-shrink: 0;
}
.avatar.large {
  width: 68px;
  height: 68px;
}
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.toolbar .search-field {
  flex: 1;
  min-width: 180px;
}
.toolbar select {
  width: auto;
  min-width: 150px;
}
.help {
  font-size: 11px;
  color: var(--muted);
  margin-top: 12px;
}
.mobile-only {
  display: none;
}
/* Workspace */
.app-layout {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 12px 14px;
  border-right: 1px solid var(--line);
  background: var(--subtle);
  overflow: auto;
  z-index: 30;
}
.sidebar .brand {
  margin: 0 12px 32px;
}
.nav-label {
  font-size: 9px;
  letter-spacing: 1.4px;
  color: var(--muted);
  text-transform: uppercase;
  padding: 18px 12px 8px;
}
.side-link {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 12px;
  color: var(--muted);
  padding: 9px 12px;
  border-radius: 5px;
  margin: 2px 0;
}
.side-link:hover {
  background: var(--raised);
  color: var(--text);
}
.side-link[aria-current='page'] {
  background: var(--accent-bg);
  color: var(--accent);
}
.sidebar details summary {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 9px 12px;
  color: var(--muted);
  font-size: 12px;
  list-style: none;
}
.sidebar details summary::after {
  content: '›';
  margin-left: auto;
  transform: rotate(90deg);
}
.sidebar details[open] summary::after {
  transform: rotate(-90deg);
}
.endpoint-list {
  border-left: 1px solid var(--line);
  margin: 2px 12px 8px 20px;
  padding-left: 8px;
}
.endpoint-link {
  display: block;
  padding: 7px 8px;
  font-size: 11px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.endpoint-link[aria-disabled='true'] {
  opacity: 0.45;
}
.sidebar-bottom {
  margin-top: auto;
  padding-top: 22px;
}
.sidebar-user {
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
}
.sidebar-user strong {
  font-size: 12px;
  display: block;
  max-width: 125px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace {
  min-width: 0;
}
.app-header {
  height: 64px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 32px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 20;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}
.breadcrumb strong {
  color: var(--text);
  font-weight: 500;
}
.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.header-search kbd {
  font: 10px var(--font);
  margin-left: 30px;
  opacity: 0.65;
}
.user-menu {
  position: relative;
}
.user-menu summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-menu summary::-webkit-details-marker {
  display: none;
}
.user-popover {
  position: absolute;
  right: 0;
  top: 44px;
  min-width: 200px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 12px 30px #0003;
}
.user-popover a,
.user-popover button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  font-size: 12px;
  background: none;
  border: 0;
  border-radius: 4px;
}
.user-popover a:hover,
.user-popover button:hover {
  background: var(--raised);
}
.user-info {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.app-content {
  max-width: 1440px;
  margin: auto;
  padding: 32px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  margin-bottom: 24px;
}
.metric {
  padding: 22px 24px;
  border-right: 1px solid var(--line);
  min-width: 0;
}
.metric:last-child {
  border: 0;
}
.metric-label {
  font-size: 11px;
  color: var(--muted);
}
.metric-value {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -1px;
  margin-top: 9px;
  line-height: 1.2;
}
.metric small {
  color: var(--muted);
  font-size: 10px;
  display: block;
  margin-top: 7px;
}
.status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.status-item:last-child {
  border: 0;
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 8px;
  display: inline-block;
}
.key-box {
  background: var(--subtle);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  margin: 16px 0;
}
.key-box input {
  padding: 0 !important;
  min-height: 26px !important;
  background: transparent !important;
  border: 0 !important;
  font:
    12px ui-monospace,
    monospace;
  flex: 1;
}
.quick-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 18px;
}
.quick-links a {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 12px;
}
.endpoint-path {
  color: var(--muted);
  max-width: 390px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.profile-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 24px;
}
.profile-summary {
  text-align: center;
  padding: 28px 20px;
}
.profile-summary .avatar {
  margin-bottom: 12px;
}
.profile-summary h2 {
  overflow-wrap: anywhere;
}
.profile-summary .badge {
  margin: 10px 0 18px;
}
.settings-group {
  display: grid;
  gap: 16px;
}
.settings-group + .settings-group {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  margin-top: 24px;
}
.mobile-overlay {
  display: none;
}
.app-footer {
  font-size: 10px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
/* Public pages */
.site-width {
  max-width: 1120px;
  width: calc(100% - 64px);
  margin: auto;
}
.site-header {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}
.site-links {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 12px;
  color: var(--muted);
}
.site-links [aria-current='page'] {
  color: var(--accent);
}
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  padding: 24px 0;
  color: var(--muted);
  font-size: 11px;
}
.site-footer nav {
  display: flex;
  gap: 20px;
}
.public-main {
  padding: 48px 0 70px;
  min-height: calc(100vh - 154px);
}
.landing-hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 72px;
  padding: 78px 0 64px;
}
.landing-hero h1 {
  font-size: 55px;
  letter-spacing: -2.8px;
  line-height: 1.08;
  font-weight: 600;
}
.landing-hero p {
  max-width: 440px;
  font-size: 14px;
  margin: 22px 0 26px;
  line-height: 1.8;
}
.landing-hero .eyebrow {
  color: var(--accent);
}
.landing-code {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}
.code-top {
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  display: flex;
  justify-content: space-between;
}
.landing-code pre {
  padding: 24px;
  font-size: 11px;
  line-height: 2;
  color: var(--muted);
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.landing-code pre span {
  color: var(--accent);
}
.landing-code footer {
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: var(--muted);
}
.landing-divider {
  display: flex;
  gap: 32px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
  font-size: 12px;
  color: var(--muted);
}
.landing-section {
  padding: 56px 0;
}
.section-top {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 28px;
  margin-bottom: 28px;
}
.section-top h2 {
  font-size: 26px;
  letter-spacing: -1px;
}
.section-top p {
  font-size: 12px;
  max-width: 340px;
}
.feature-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}
.feature-column {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.number {
  font-size: 10px;
  color: var(--accent);
  margin-bottom: 18px;
  display: block;
}
.feature-column p {
  font-size: 12px;
  margin: 10px 0 18px;
}
.text-link {
  color: var(--accent);
  font-size: 12px;
}
.bottom-cta {
  border-top: 1px solid var(--line);
  padding: 34px 0 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.bottom-cta p {
  font-size: 12px;
  margin-top: 8px;
}
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.pricing-plan {
  padding: 26px 22px;
  border-right: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  flex-direction: column;
}
.pricing-plan:last-child {
  border: 0;
}
.pricing-plan.featured {
  background: var(--accent-bg);
}
.price {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -1px;
  margin: 18px 0;
}
.price small {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}
.plan-benefits {
  font-size: 12px;
  display: grid;
  gap: 12px;
  padding: 0 0 26px;
  color: var(--muted);
  flex: 1;
}
.plan-benefits li::before {
  content: '✓';
  color: var(--accent);
  margin-right: 8px;
}
.plan-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 16px;
  max-width: 740px;
}
.directory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.directory-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.directory-body {
  padding: 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.directory-body p {
  font-size: 12px;
}
.directory-body .button {
  align-self: start;
  margin-top: auto;
}
.directory-banner {
  height: 112px;
  width: 100%;
  background: var(--raised);
}
.directory-heading {
  display: flex;
  gap: 12px;
  align-items: center;
}
.directory-item details {
  font-size: 12px;
  color: var(--muted);
}
.directory-item summary {
  cursor: pointer;
  color: var(--accent);
}
.directory-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.directory-actions form {
  margin-left: auto;
}
.auth-layout {
  min-height: calc(100vh - 154px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  padding: 64px 0;
  max-width: 960px;
  margin: auto;
}
.auth-intro h1 {
  font-size: 44px;
  letter-spacing: -2px;
  line-height: 1.15;
}
.auth-intro p {
  max-width: 320px;
  margin: 22px 0;
  font-size: 13px;
}
.auth-detail {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-top: 32px;
  max-width: 320px;
  font-size: 11px;
  color: var(--muted);
}
.auth-form h2 {
  font-size: 22px;
  margin-bottom: 8px;
}
.auth-form > .muted {
  font-size: 12px;
  margin-bottom: 26px;
}
.auth-form form {
  display: grid;
  gap: 18px;
}
.auth-form .button {
  width: 100%;
  margin-top: 4px;
}
.auth-switch {
  font-size: 12px;
  margin-top: 24px;
  color: var(--muted);
}
.password-field {
  position: relative;
}
.password-field input {
  padding-right: 45px !important;
}
.password-field button {
  position: absolute;
  right: 5px;
  top: 3px;
  border: 0;
}
.error-panel {
  max-width: 660px;
  padding: 100px 0 140px;
}
.error-panel h1 {
  font-size: 44px;
  letter-spacing: -2px;
  margin: 16px 0;
}
.error-panel p {
  font-size: 14px;
  overflow-wrap: anywhere;
  margin-bottom: 24px;
}
.toast-region {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: grid;
  gap: 10px;
  max-width: min(390px, calc(100vw - 32px));
}
.toast {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  padding: 13px 18px;
  font-size: 12px;
  border-radius: 5px;
  box-shadow: 0 8px 24px #0003;
}
.toast.error {
  border-left-color: var(--red);
}
dialog {
  width: 430px;
  max-width: calc(100% - 32px);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
}
dialog::backdrop {
  background: #0009;
}
dialog p {
  font-size: 13px;
  margin: 12px 0 24px;
}
dialog .row {
  justify-content: flex-end;
}
.chat-log {
  height: 400px;
  overflow: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.chat-message {
  padding: 12px 15px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 6px;
  max-width: 90%;
  font-size: 13px;
  background: var(--subtle);
}
.chat-message.user {
  align-self: flex-end;
  background: var(--accent-bg);
}
.chat-message strong {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 5px;
}
.chat-form {
  padding: 18px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
}
.chat-form input {
  flex: 1;
}
.video-stage {
  position: relative;
  background: #000;
  margin-top: 20px;
  border-radius: 6px;
  overflow: hidden;
}
.video-stage video {
  width: 100%;
  max-height: 560px;
  display: block;
}
.subtitle {
  position: absolute;
  bottom: 50px;
  left: 10%;
  width: 80%;
  text-align: center;
  color: #fff;
  background: #0009;
  padding: 6px;
  font-size: 16px;
  pointer-events: none;
}
.tool-panel {
  max-width: 850px;
}
.download-meta {
  display: flex;
  gap: 20px;
  align-items: center;
  margin: 20px 0;
}
.download-meta img {
  width: 150px;
  border-radius: 6px;
}
.progress {
  width: 100%;
  margin: 18px 0;
  accent-color: var(--accent);
}
@media (min-width: 1500px) {
  .app-content {
    padding: 40px 48px;
  }
  .site-width {
    max-width: 1180px;
  }
}
@media (max-width: 1100px) {
  .landing-hero {
    gap: 38px;
  }
  .landing-hero h1 {
    font-size: 46px;
  }
  .directory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pricing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pricing-plan:nth-child(2) {
    border-right: 0;
  }
  .pricing-plan:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
  .split {
    grid-template-columns: 1fr;
  }
  .auth-layout {
    gap: 40px;
  }
  .metric {
    padding: 20px 16px;
  }
  .header-search kbd {
    display: none;
  }
}
@media (max-width: 760px) {
  .mobile-only {
    display: inline-grid;
  }
  .app-layout {
    display: block;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 224px;
    transform: translateX(-100%);
    transition: transform 0.2s;
  }
  .sidebar.is-open {
    transform: translateX(0);
  }
  .sidebar-close {
    position: absolute;
    right: 10px;
    top: 20px;
    background: var(--subtle);
  }
  .mobile-overlay.is-open {
    display: block;
    position: fixed;
    inset: 0;
    background: #0009;
    z-index: 25;
    border: 0;
    width: 100%;
    height: 100%;
  }
  .app-header {
    padding: 0 18px;
    height: 60px;
  }
  .app-content {
    padding: 24px 18px;
  }
  .header-search {
    padding: 7px;
  }
  .header-search span {
    display: none;
  }
  .breadcrumb > span {
    display: none;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metric:nth-child(2) {
    border-right: 0;
  }
  .metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
  .metric-value {
    font-size: 25px;
  }
  .page-heading {
    align-items: start;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 22px;
  }
  h1 {
    font-size: 25px;
  }
  .page-heading p {
    font-size: 12px;
  }
  .profile-layout {
    grid-template-columns: 1fr;
  }
  .profile-summary {
    text-align: left;
    display: flex;
    gap: 18px;
    align-items: center;
  }
  .profile-summary .avatar,
  .profile-summary .badge {
    margin: 0;
  }
  .profile-numbers {
    display: none;
  }
  .panel-body {
    padding: 20px;
  }
  .panel-heading {
    padding: 16px 20px;
  }
  .site-width {
    width: calc(100% - 36px);
  }
  .site-header {
    height: 70px;
  }
  .site-links {
    gap: 15px;
  }
  .site-links .optional {
    display: none;
  }
  .site-header .brand {
    font-size: 15px;
  }
  .site-header .brand em {
    display: none;
  }
  .site-links .button {
    padding: 7px 10px;
    min-height: 34px;
  }
  .site-header .icon-button {
    width: 30px;
    height: 32px;
  }
  .landing-hero {
    grid-template-columns: 1fr;
    padding: 46px 0;
    gap: 30px;
  }
  .landing-hero h1 {
    font-size: 43px;
    letter-spacing: -2px;
  }
  .landing-hero p {
    font-size: 13px;
  }
  .landing-divider {
    flex-wrap: wrap;
    gap: 14px;
    justify-content: start;
    font-size: 11px;
  }
  .landing-divider span:first-child {
    width: 100%;
  }
  .feature-columns {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .landing-section {
    padding: 38px 0;
  }
  .section-top {
    display: block;
  }
  .section-top h2 {
    font-size: 23px;
  }
  .section-top p {
    margin-top: 12px;
  }
  .bottom-cta {
    align-items: start;
    flex-direction: column;
  }
  .site-footer {
    flex-wrap: wrap;
    font-size: 10px;
  }
  .auth-layout {
    display: block;
    padding: 34px 0 54px;
    max-width: 410px;
  }
  .auth-intro {
    display: none;
  }
  .auth-form {
    padding-top: 12px;
  }
  .auth-form h2 {
    font-size: 25px;
  }
  .directory-grid {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-actions {
    flex-wrap: wrap;
  }
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  .pricing-plan {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 24px;
  }
  .pricing-plan:nth-child(3) {
    border-bottom: 1px solid var(--line);
  }
  .public-main {
    padding: 32px 0 48px;
  }
  .toast-region {
    right: 16px;
    bottom: 16px;
  }
  .chat-form {
    padding: 16px;
    gap: 8px;
  }
  .chat-form .button {
    padding: 8px 12px;
  }
  .chat-log {
    padding: 16px;
    height: 350px;
  }
  .download-meta {
    display: block;
  }
  .download-meta img {
    margin-bottom: 14px;
  }
  .toolbar select {
    flex: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.code-block {
  max-width: 100%;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--subtle);
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.8;
  margin: 0;
}
.parameter-description {
  white-space: normal;
  min-width: 220px;
  max-width: 450px;
}
.panel-heading code {
  overflow-wrap: anywhere;
  word-break: break-word;
}
#endpoint-test-result {
  margin-top: 18px;
  max-height: 550px;
}
.generated-preview {
  display: block;
  max-width: 100%;
  max-height: 640px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius, 12px);
  margin: 20px auto;
}
.generated-preview[hidden] {
  display: none;
}

.canvas-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.canvas-gallery-card {
  overflow: hidden;
}
.canvas-gallery-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 300px;
  padding: 24px;
  background: #11151f;
}
.canvas-gallery-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 18px #0005);
  transition: transform 0.2s;
}
.canvas-gallery-preview:hover img {
  transform: scale(1.025);
}
.canvas-gallery-card .panel-body {
  padding: 24px;
}
.canvas-gallery-card h2 {
  font-size: 1.2rem;
}
.canvas-doc-preview {
  margin-bottom: 24px;
}
.canvas-doc-preview img {
  display: block;
  max-width: 100%;
  max-height: 440px;
  margin: 0 auto;
  object-fit: contain;
}
@media (max-width: 760px) {
  .canvas-gallery {
    grid-template-columns: minmax(0, 1fr);
  }
  .canvas-gallery-preview {
    height: 260px;
    padding: 16px;
  }
}

/* Plans and billing: scoped to preserve existing application layouts. */
.plans-intro {
  max-width: 820px;
  padding: 48px 0 30px;
}
.plans-intro h1 {
  font-size: clamp(2.3rem, 5vw, 4rem);
  line-height: 1.12;
  letter-spacing: -0.045em;
  margin: 18px 0;
}
.plans-intro h1 span {
  color: var(--accent, #b69aef);
}
.plans-intro > p {
  max-width: 620px;
  font-size: 1.08rem;
  line-height: 1.7;
}
.plans-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 24px;
  font-size: 0.86rem;
  color: var(--muted, #aaa5b6);
}
.plans-trust span::before {
  content: '✓';
  color: #b69aef;
  margin-right: 8px;
}
.plans-grid {
  align-items: stretch;
  margin: 30px 0 64px;
}
.plans-grid .pricing-plan {
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 28px 24px;
  border-radius: 18px;
  transition:
    border-color 0.2s,
    transform 0.2s;
}
.plans-grid .pricing-plan:hover {
  transform: translateY(-3px);
}
.plans-grid .pricing-plan.featured {
  border-color: #a98ae0;
  box-shadow: 0 12px 36px #a287d214;
}
.plans-grid .price {
  font-size: clamp(1.8rem, 2.5vw, 2.6rem);
  letter-spacing: -0.04em;
  white-space: nowrap;
}
.plan-description {
  min-height: 50px;
  line-height: 1.6;
  color: var(--muted, #aaa5b6);
}
.price-period {
  font-size: 0.8rem;
  margin-top: 4px;
  color: var(--muted, #aaa5b6);
}
.plan-capacity {
  border-block: 1px solid #ffffff12;
  padding: 20px 0;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.plan-capacity strong {
  font-size: 1.8rem;
}
.plan-capacity small {
  margin-top: 8px;
  color: var(--muted, #aaa5b6);
}
.plans-grid .plan-benefits {
  flex: 1;
  margin-block: 24px;
}
.plans-grid .button,
.plans-grid form {
  width: 100%;
}
.plans-comparison {
  margin-bottom: 40px;
}
.plans-comparison th,
.plans-comparison td {
  min-width: 145px;
  max-width: 250px;
  white-space: normal;
  vertical-align: top;
  line-height: 1.6;
}
.plans-comparison th:first-child {
  min-width: 175px;
}
.plans-comparison td:nth-child(4),
.plans-comparison thead th:nth-child(4) {
  background: #a98ae00b;
}
.plans-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 32px 0;
}
.plans-details p,
.plans-details li {
  line-height: 1.8;
  color: var(--muted, #aaa5b6);
}
.usage-panel {
  margin-bottom: 24px;
}
.usage-numbers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}
.usage-numbers > div {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.usage-numbers span,
.usage-numbers small {
  font-size: 0.85rem;
  color: var(--muted, #aaa5b6);
}
.usage-numbers strong {
  font-size: 1.8rem;
}
.usage-label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 10px;
}
.usage-panel progress {
  width: 100%;
  height: 9px;
  accent-color: #b39ae5;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff12;
}
.usage-panel progress::-webkit-progress-bar {
  background: #ffffff12;
}
.usage-panel progress::-webkit-progress-value {
  background: #b39ae5;
  border-radius: 12px;
}
.usage-panel h3 {
  margin-top: 26px;
}
.request-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid #ffffff12;
}
.request-row > div {
  flex: 1;
  min-width: 180px;
}
.billing-form {
  display: grid;
  gap: 18px;
  max-width: 900px;
  margin-block: 24px;
}
.billing-form label {
  display: grid;
  gap: 8px;
}
.billing-form input,
.billing-form select,
.billing-form textarea {
  width: 100%;
  min-width: 0;
}
.billing-form textarea {
  min-height: 80px;
}
.billing-form .billing-check {
  display: flex;
  gap: 10px;
  align-items: start;
  line-height: 1.6;
}
.billing-check input {
  width: auto;
  margin-top: 5px;
}
.billing-form .billing-config {
  min-height: 550px;
  font:
    0.85rem/1.7 ui-monospace,
    monospace;
}
.billing-search {
  display: flex;
  gap: 12px;
  align-items: end;
  margin: 20px 0;
}
.billing-request {
  border-top: 1px solid #ffffff12;
  margin-top: 20px;
  padding-top: 20px;
}
@media (max-width: 1100px) {
  .plans-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .plans-intro {
    padding-top: 24px;
  }
  .plans-grid,
  .plans-details,
  .usage-numbers {
    grid-template-columns: 1fr;
  }
  .plan-description {
    min-height: 0;
  }
  .plans-grid .price {
    font-size: 2.5rem;
  }
  .plans-details {
    gap: 16px;
  }
  .usage-numbers {
    gap: 18px;
  }
  .usage-numbers > div {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .usage-numbers strong {
    font-size: 1.3rem;
  }
  .billing-search {
    align-items: stretch;
    flex-direction: column;
  }
}
@media (prefers-reduced-motion: reduce) {
  .plans-grid .pricing-plan {
    transition: none;
  }
  .plans-grid .pricing-plan:hover {
    transform: none;
  }
}
.plans-grid {
  gap: 18px;
  border: 0;
  overflow: visible;
}
.plans-grid .pricing-plan,
.plans-grid .pricing-plan:last-child {
  border: 1px solid var(--line);
}
.plans-grid .pricing-plan.featured {
  border: 1px solid #a98ae0;
}
.plans-grid .plan-benefits {
  font-size: 0.9rem;
  line-height: 1.65;
}
.plans-grid .pricing-plan.featured .plan-description {
  color: var(--muted);
}
.billing-plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.billing-plan-grid fieldset {
  min-width: 0;
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  padding: 20px;
  border-radius: 12px;
}
.billing-plan-grid legend {
  padding: 0 8px;
  font-weight: 600;
}
.billing-rates {
  font:
    0.85rem/1.7 ui-monospace,
    monospace;
  min-height: 180px !important;
}
@media (max-width: 640px) {
  .billing-plan-grid {
    grid-template-columns: 1fr;
  }
}
