@import './ui-tokens.css';

:root {
  color-scheme: dark;
  --bg: #000;
  --panel: #0f0d14;
  --surface: #1c1a22;
  --hover: #2c2736;
  --primary: var(--ui-accent);
  --primary-hover: #6158f5;
  --tint: #1c173b;
  --text: var(--ui-text);
  --muted: var(--ui-muted);
  --border: #242129;
  --danger: #ff909b;
  --success: #8fd6b7;
  --r: 12px;
  --field-r: 16px;
  --nav: 60px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button,
.button {
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  min-height: 40px;
  padding: 8px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition:
    background 0.18s,
    box-shadow 0.18s,
    transform 0.18s;
  white-space: nowrap;
}
button:hover,
.button:hover {
  background: var(--hover);
}
button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #aaa5ff;
  outline-offset: 3px;
}
.primary {
  background: var(--primary);
  color: #fff;
}
.primary:hover {
  background: var(--primary-hover);
}
.outline {
  background: transparent;
  border-color: var(--border);
}
.ghost {
  background: transparent;
}
.active {
  color: #9188ff;
}
.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-lg {
  width: 30px;
  height: 30px;
}
.muted {
  color: var(--muted);
}
.tiny {
  font-size: 12px;
}
.badge {
  font-size: 12px;
  padding: 2px 8px;
  background: var(--tint);
  color: #b9b1ff;
  border-radius: 999px;
}
.tag {
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #ada6ff;
}
.app-header {
  height: var(--nav);
  position: sticky;
  top: 0;
  z-index: 30;
  background: #000;
}
.topbar {
  height: 60px;
  max-width: 1280px;
  padding: 0 16px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  font-size: 22px;
  letter-spacing: -1px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand small {
  font-size: 10px;
  letter-spacing: 1.2px;
  color: var(--muted);
  font-weight: 400;
}
.brandmark {
  color: #8d84ff;
}
.navlinks {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: 14px;
}
.navlinks a {
  display: flex;
  align-items: center;
  gap: 7px;
}
.account-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 24px;
}
.account-nav .button {
  border-radius: var(--r);
  padding-inline: 22px;
}
.mobile-nav {
  display: none;
}
.main {
  min-height: calc(100dvh - var(--nav));
}
.workspace {
  height: calc(100dvh - var(--nav));
  display: flex;
  position: relative;
}
.settings {
  width: 380px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 18px 16px;
  overflow: auto;
}
.settings h3 {
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 10px;
}
.settings p {
  font-size: 12px;
  margin: 7px 0;
  color: var(--muted);
}
.settings-section {
  padding: 20px 0;
  border-bottom: 1px solid #1d1a21;
}
.settings-section:first-child {
  padding-top: 0;
}
.segmented {
  display: flex;
  gap: 4px;
  background: #000;
  border-radius: 999px;
  padding: 4px;
}
.segmented button {
  flex: 1;
  padding: 6px 10px;
  font-size: 14px;
  min-height: 36px;
}
.segmented .selected {
  background: white;
  color: #15131b;
}
.split-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.split-row > * {
  min-width: 0;
}
.between {
  justify-content: space-between;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 12px;
}
.field {
  display: block;
}
.field > span,
.field > label {
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
}
.field select,
.field input,
.field textarea,
input.text,
textarea.text,
select.text {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: var(--field-r);
  width: 100%;
  padding: 14px 15px;
  min-height: 48px;
}
.field textarea {
  resize: vertical;
  min-height: 80px;
}
input[type='range'] {
  width: 100%;
  accent-color: var(--primary);
}
input[type='checkbox'] {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
}
.field input::placeholder,
textarea::placeholder {
  color: #777480;
}
.style-trigger {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  justify-content: space-between;
  font-size: 16px;
  min-height: 52px;
  background: var(--panel);
}
.settings details summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 8px;
}
.settings details[open] summary {
  margin-bottom: 18px;
}
.settings .full {
  width: 100%;
}
.full {
  width: 100%;
}
.info-strip {
  font-size: 12px;
  padding: 8px 12px;
  border: 1px solid #302953;
  background: #181427;
  border-radius: 999px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #c5bfd8;
  margin-bottom: 18px;
}
.canvas {
  flex: 1;
  min-width: 0;
  position: relative;
  overflow: auto;
  padding: 100px 24px 170px;
  text-align: center;
}
.canvas-empty h1 {
  font-size: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 12px 0;
}
.canvas-empty p {
  color: var(--muted);
  margin: 12px 0 26px;
  line-height: 1.7;
}
.composer {
  position: absolute;
  bottom: 24px;
  left: calc(380px + (100% - 380px) / 2);
  transform: translateX(-50%);
  width: min(680px, calc(100% - 420px));
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 12px 16px;
  z-index: 10;
  text-align: left;
}
.composer label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.composer textarea {
  border: 0;
  background: none;
  color: white;
  resize: none;
  width: calc(100% - 58px);
  height: 45px;
  outline: none;
  padding: 8px 0;
  font-size: 16px;
}
.composer .send {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
}
.composer .cost {
  margin-left: auto;
  font-size: 12px;
  color: #aba3ff;
}
.service-note {
  font-size: 12px;
  color: #a49bbd;
  margin-top: 10px;
}
.mobile-settings,
.drawer-close {
  display: none;
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 12px;
  z-index: 100;
  padding: 8px;
  background: var(--primary);
}
.skip-link:focus {
  top: 8px;
}
#toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90vw;
  padding: 12px 22px;
  background: #292433;
  border: 1px solid #514666;
  border-radius: var(--r);
  z-index: 100;
  display: none;
  box-shadow: 0 12px 40px #0008;
}
#toast.visible {
  display: block;
}
dialog {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: min(680px, calc(100vw - 28px));
  max-height: 88dvh;
  padding: 24px;
  box-shadow: 0 25px 80px #0009;
}
dialog::backdrop {
  background: #000b;
  backdrop-filter: blur(3px);
}
.modal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 20px;
}
.modal-heading h2 {
  font-size: 22px;
  margin: 0;
}
.close {
  padding: 0;
  width: 36px;
  min-height: 36px;
  background: transparent;
}
.error-box {
  color: var(--danger);
  padding: 12px;
  background: #35191f;
  border-radius: var(--r);
}
.empty-panel {
  text-align: center;
  padding: 70px 20px;
  color: var(--muted);
}
.page-shell {
  max-width: 1280px;
  margin: auto;
  padding: 80px 16px;
}
.page-title {
  font-size: 36px;
  line-height: 1.15;
}
.page-footer {
  max-width: 1120px;
  margin: 100px auto 0;
  padding: 40px 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.page-footer nav {
  display: flex;
  flex-wrap: wrap;
  max-width: 440px;
  gap: 20px;
}
.loader {
  border: 2px solid #40335e;
  border-top-color: #b2aaff;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  animation: spin 0.8s linear infinite;
  margin: 24px auto;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (max-width: 1100px) {
  .settings {
    width: 320px;
  }
  .composer {
    left: calc(320px + (100% - 320px) / 2);
    width: calc(100% - 360px);
  }
  .navlinks {
    gap: 18px;
  }
  .account-nav {
    margin-left: 8px;
  }
  .brand small {
    display: none;
  }
}
@media (max-width: 639px) {
  :root {
    --nav: 118px;
  }
  .topbar {
    padding: 0 16px;
    gap: 6px;
  }
  .brand {
    font-size: 20px;
  }
  .navlinks {
    display: none;
  }
  .account-nav {
    margin-left: auto;
    gap: 6px;
  }
  .account-nav .button {
    padding: 8px 14px;
  }
  .mobile-nav {
    height: 58px;
    display: flex;
    justify-content: center;
    gap: 34px;
    font-size: 12px;
  }
  .mobile-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding-top: 6px;
  }
  .settings {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 20;
    display: none;
    padding: 16px;
  }
  .settings.open {
    display: block;
  }
  .drawer-close {
    display: flex;
    margin-bottom: 14px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .canvas {
    padding: 78px 18px 155px;
  }
  .canvas-empty h1 {
    font-size: 28px;
  }
  .mobile-settings {
    position: absolute;
    left: 16px;
    top: 12px;
    display: flex;
    gap: 8px;
    z-index: 11;
  }
  .composer {
    left: 12px;
    right: 12px;
    transform: none;
    bottom: 14px;
    width: auto;
    padding: 12px 14px;
  }
  .page-shell {
    padding: 38px 16px;
  }
  .page-title {
    font-size: 30px;
  }
  .brandmark {
    display: none;
  }
  .page-footer {
    margin-top: 50px;
  }
  dialog {
    padding: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
[hidden] {
  display: none !important;
}
.center {
  text-align: center;
}
.wide {
  grid-column: 1/-1;
}
.form-error {
  color: var(--danger);
  font-size: 14px;
  min-height: 22px;
}
