:root {
  color-scheme: dark;
  font-family: "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
  --bg: #09111c;
  --bg-accent: #12223a;
  --panel: rgba(10, 21, 36, 0.92);
  --panel-soft: rgba(17, 30, 49, 0.88);
  --panel-line: rgba(125, 157, 199, 0.18);
  --text: #e8edf5;
  --text-soft: #97a6bd;
  --accent: #79db9d;
  --accent-strong: #38c28b;
  --warning: #ffcf66;
  --danger: #ff7878;
  --ok: #93f0bf;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(56, 194, 139, 0.16), transparent 26%),
    radial-gradient(circle at right 20%, rgba(100, 160, 255, 0.18), transparent 28%),
    linear-gradient(180deg, #0b1320 0%, #07101a 100%);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at center, black, transparent 88%);
}

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

.shell {
  position: relative;
  max-width: 1680px;
  margin: 0 auto;
  padding: 28px;
}

.hero,
.presetBar,
.controlPanel,
.previewCard,
.linkCard {
  border: 1px solid var(--panel-line);
  box-shadow: var(--shadow);
  background: var(--panel);
  backdrop-filter: blur(20px);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px;
  border-radius: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  font-family: "IBM Plex Mono", "SF Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1,
.previewHeader h2,
.linkHeader h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 0.95;
}

.heroCopy {
  max-width: 720px;
  margin: 12px 0 0;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.55;
}

.heroActions {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.primaryButton,
.ghostButton,
.presetChip {
  appearance: none;
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.primaryButton {
  background: linear-gradient(135deg, #33c58c 0%, #2d87ff 100%);
  border-color: transparent;
  padding: 12px 18px;
  font-weight: 600;
}

.ghostButton {
  background: rgba(255, 255, 255, 0.04);
  padding: 12px 18px;
}

.primaryButton:hover,
.ghostButton:hover,
.presetChip:hover {
  transform: translateY(-1px);
}

.presetBar {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  border-radius: 22px;
}

.presetLabel {
  font-family: "IBM Plex Mono", "SF Mono", monospace;
  color: var(--text-soft);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.presetList {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.presetChip {
  background: rgba(255, 255, 255, 0.03);
  padding: 9px 14px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 470px) minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.controlPanel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 28px;
}

.panelSection {
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 22px;
  background: var(--panel-soft);
  overflow: hidden;
}

.panelSection summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  font-weight: 600;
  font-size: 15px;
}

.panelSection summary:hover {
  background: rgba(255, 255, 255, 0.025);
}

.panelSection summary::-webkit-details-marker {
  display: none;
}

.panelChevron {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  border-right: 2px solid rgba(232, 237, 245, 0.72);
  border-bottom: 2px solid rgba(232, 237, 245, 0.72);
  transform: rotate(45deg) translateY(-1px);
  transform-origin: center;
  transition: transform 160ms ease;
}

.panelSection.isOpen .panelChevron {
  transform: rotate(-135deg) translateY(-1px);
}

.panelSectionBody {
  padding: 0 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panelHint {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.fieldLabel {
  font-size: 13px;
  font-weight: 600;
  color: #f4f8ff;
}

.fieldHint {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
}

.fieldGrid {
  display: grid;
  gap: 12px;
}

.fieldGrid.twoColumns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fieldGrid.threeColumns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(5, 12, 22, 0.66);
  color: var(--text);
}

.input:focus {
  outline: 2px solid rgba(121, 219, 157, 0.25);
  border-color: rgba(121, 219, 157, 0.45);
}

.inputInvalid {
  border-color: rgba(255, 120, 120, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 120, 120, 0.16);
}

.input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.colorFieldRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  gap: 10px;
  align-items: center;
}

.colorPickerShell {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(5, 12, 22, 0.66);
  cursor: pointer;
}

.colorPickerShell.isDisabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.colorPickerInput {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 1;
  cursor: pointer;
}

.colorPreview {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.textarea {
  resize: vertical;
  min-height: 100px;
}

.textarea.compact {
  min-height: 86px;
}

.toggleField {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
}

.toggleField.isDisabled {
  opacity: 0.45;
}

.toggleCopy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toggleShell {
  position: relative;
  width: 54px;
  height: 32px;
}

.toggleShell input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.toggleTrack {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 160ms ease;
}

.toggleTrack::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #d7dde7;
  transition: transform 160ms ease, background 160ms ease;
}

.toggleShell input:checked + .toggleTrack {
  background: linear-gradient(135deg, #33c58c 0%, #2d87ff 100%);
}

.toggleShell input:checked + .toggleTrack::after {
  transform: translateX(22px);
  background: white;
}

.previewPanel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.previewCard,
.linkCard {
  padding: 18px;
  border-radius: 28px;
}

.previewHeader,
.linkHeader {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.previewHeader h2,
.linkHeader h2 {
  font-size: 28px;
}

.previewMeta,
.linkActions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.statusBadge,
.metaPill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-family: "IBM Plex Mono", "SF Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-ready {
  background: rgba(147, 240, 191, 0.12);
  color: var(--ok);
}

.status-loading {
  background: rgba(255, 207, 102, 0.12);
  color: var(--warning);
}

.status-error {
  background: rgba(255, 120, 120, 0.12);
  color: var(--danger);
}

.status-idle {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-soft);
}

.messageList {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.message {
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.45;
}

.message-error {
  background: rgba(255, 120, 120, 0.12);
  color: #ffd2d2;
}

.message-warning {
  background: rgba(255, 207, 102, 0.12);
  color: #ffe3a2;
}

.message-ok {
  background: rgba(147, 240, 191, 0.12);
  color: #cfffe4;
}

.previewSurface {
  margin-top: 18px;
  min-height: 420px;
  display: grid;
  place-items: center;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background:
    radial-gradient(circle at top, rgba(121, 219, 157, 0.12), transparent 35%),
    linear-gradient(180deg, rgba(4, 9, 17, 0.82), rgba(10, 18, 30, 0.92));
  overflow: hidden;
}

.previewImage {
  display: block;
  max-width: min(100%, 760px);
  max-height: 72vh;
  object-fit: contain;
  padding: 20px;
}

.previewPlaceholder {
  max-width: 460px;
  padding: 20px;
  color: var(--text-soft);
  text-align: center;
  line-height: 1.6;
}

.previewPlaceholder.errorState {
  color: #ffd2d2;
}

.previewFooter {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
}

.footerLabel {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.footerValue {
  margin-top: 6px;
  font-family: "IBM Plex Mono", "SF Mono", monospace;
  font-size: 13px;
  line-height: 1.5;
}

.truncated {
  overflow-wrap: anywhere;
}

.linkCard {
  background: linear-gradient(180deg, rgba(12, 23, 39, 0.96), rgba(10, 18, 31, 0.96));
}

.linkOutput {
  width: 100%;
  min-height: 170px;
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(1, 7, 14, 0.72);
  color: #dff7ea;
  font-family: "IBM Plex Mono", "SF Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
}

.linkTips {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
}

.docsShell {
  position: relative;
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px;
}

.docsGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.docsCard {
  border: 1px solid var(--panel-line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  background: var(--panel);
  backdrop-filter: blur(20px);
  padding: 22px 24px;
}

.docsCardWide {
  grid-column: span 2;
}

.docsTitle {
  margin: 0;
  font-size: 28px;
  line-height: 1;
}

.docsLead {
  margin-top: 10px;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.65;
}

.docsStack {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.docsCallout {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.docsPath {
  font-family: "IBM Plex Mono", "SF Mono", monospace;
  font-size: 13px;
  color: var(--ok);
}

.docsSubTitle {
  margin-bottom: 10px;
  font-size: 15px;
  font-weight: 600;
  color: #f4f8ff;
}

.docsList {
  margin: 18px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  color: var(--text-soft);
  line-height: 1.6;
}

.docsCode {
  margin: 18px 0 0;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(1, 7, 14, 0.72);
  color: #dff7ea;
  font-family: "IBM Plex Mono", "SF Mono", monospace;
  font-size: 12px;
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.docsActions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.docsTable {
  width: 100%;
  margin-top: 18px;
  border-collapse: collapse;
  font-size: 14px;
}

.docsTable th,
.docsTable td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  vertical-align: top;
}

.docsTable th {
  color: #f4f8ff;
  font-size: 13px;
}

.docsTable td {
  color: var(--text-soft);
  line-height: 1.55;
}

.inlineLink {
  margin-top: 10px;
  display: inline-flex;
  color: var(--accent);
  text-decoration: none;
}

.inlineLink:hover {
  color: var(--ok);
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .previewFooter {
    grid-template-columns: 1fr;
  }

  .docsGrid {
    grid-template-columns: 1fr;
  }

  .docsCardWide {
    grid-column: span 1;
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 16px;
  }

  .docsShell {
    padding: 18px;
  }

  .hero,
  .previewHeader,
  .linkHeader {
    flex-direction: column;
  }

  .heroActions,
  .previewMeta,
  .linkActions {
    width: 100%;
    justify-content: stretch;
  }

  .primaryButton,
  .ghostButton {
    width: 100%;
  }

  .fieldGrid.twoColumns,
  .fieldGrid.threeColumns {
    grid-template-columns: 1fr;
  }

  .previewSurface {
    min-height: 320px;
  }

  .docsCard {
    padding: 18px;
    border-radius: 24px;
  }
}
