:root {
  --bg: #0e1116;
  --panel: rgba(20, 26, 36, 0.92);
  --panel-2: rgba(15, 20, 28, 0.92);
  --text: #eff5ff;
  --muted: #94a3b8;
  --line: rgba(148, 163, 184, 0.18);
  --accent: #f25f3a;
  --accent-2: #1fb6a6;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Archivo", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(242, 95, 58, 0.18), transparent 25rem),
    radial-gradient(circle at bottom right, rgba(31, 182, 166, 0.16), transparent 24rem),
    linear-gradient(180deg, #0a0d13 0%, var(--bg) 100%);
}

code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.94em;
}

.app-shell {
  width: min(1240px, calc(100% - 1.25rem));
  margin: 0 auto;
  padding: 1rem 0 2rem;
}

.landing-shell {
  width: min(1240px, calc(100% - 1.25rem));
  margin: 0 auto;
  padding: 1rem 0 2rem;
}

.landing-hero,
.landing-projects {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.9fr);
  gap: 1rem;
  padding: 1.35rem;
}

.landing-copy h1 {
  max-width: 11ch;
}

.landing-lead {
  margin-top: 0.95rem;
  line-height: 1.7;
  max-width: 60ch;
}

.landing-actions,
.project-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 1.15rem;
}

.landing-side {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.landing-logo-card,
.landing-note {
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.landing-logo-card {
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
}

.landing-logo {
  max-height: 240px;
}

.landing-note {
  padding: 1rem;
  line-height: 1.65;
}

.landing-projects {
  margin-top: 1rem;
  padding: 1.2rem;
}

.project-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 1rem;
  margin-top: 1rem;
}

.project-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel-2);
  padding: 1.1rem;
}

.project-card h3 {
  margin-top: 0.35rem;
  font-size: 1.55rem;
}

.project-card p {
  margin-top: 0.75rem;
  line-height: 1.65;
}

.project-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.project-badge {
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  background: rgba(31, 182, 166, 0.18);
  border: 1px solid rgba(31, 182, 166, 0.32);
  color: #d9fff9;
  font-size: 0.82rem;
  font-weight: 700;
}

.project-badge-muted {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.22);
  color: var(--muted);
}

.project-badge-beta {
  background: rgba(242, 95, 58, 0.16);
  border-color: rgba(242, 95, 58, 0.28);
  color: #ffe1d8;
}

.project-list {
  margin: 0.95rem 0 0;
  padding-left: 1.2rem;
  line-height: 1.7;
  color: var(--text);
}

.landing-cta {
  text-decoration: none;
}

.hero,
.control-panel,
.preview-panel,
.code-panel {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(260px, 0.85fr);
  gap: 1rem;
  padding: 1.35rem;
}

.eyebrow,
.section-kicker,
.field span,
.addon span,
.code-note {
  color: var(--muted);
}

.eyebrow,
.section-kicker,
.field span {
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.78rem;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  margin-top: 0.35rem;
  font-size: clamp(2.7rem, 6vw, 5.2rem);
  line-height: 0.95;
  max-width: 12ch;
}

.hero-copy p:last-child,
.hero-note p,
.code-note {
  margin-top: 0.9rem;
  line-height: 1.65;
}

.hero-side {
  display: grid;
  grid-template-rows: minmax(180px, 1fr) auto;
  gap: 1rem;
}

.hero-logo-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0.65rem 0.25rem 0;
}

.hero-logo {
  width: min(100%, 420px);
  max-height: 220px;
  object-fit: contain;
  object-position: center top;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.32));
}

.hero-note {
  padding: 1rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  align-self: end;
}

.hero-note-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.builder-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.control-panel,
.preview-panel,
.code-panel {
  padding: 1.2rem;
}

.control-panel,
.item-settings,
.secondary-editor-group {
  overflow-anchor: none;
}

.preview-panel {
  position: sticky;
  top: 1rem;
  align-self: start;
}

.panel-head h2,
.panel-head h3 {
  margin-top: 0.2rem;
}

.preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
}

.preview-tool-groups {
  display: grid;
  gap: 0.7rem;
  justify-items: end;
  flex: 1 1 auto;
}

.output-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
}

.preview-tools {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.preview-tools-primary,
.preview-tools-secondary {
  justify-content: flex-end;
}

.help-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.preview-zoom-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.preview-tool {
  min-height: 3rem;
  padding: 0.7rem 1rem;
}

.zoom-tool {
  min-width: 2.8rem;
}

.preview-tool.is-active {
  background: rgba(31, 182, 166, 0.18);
  border-color: rgba(31, 182, 166, 0.45);
  color: #d9fff9;
}

.preview-tool:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.lock-tool {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.lock-state-icon {
  position: relative;
  width: 0.88rem;
  height: 0.62rem;
  border: 0.12rem solid currentColor;
  border-radius: 0.16rem;
  box-sizing: border-box;
}

.lock-state-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -0.48rem;
  width: 0.56rem;
  height: 0.44rem;
  border: 0.12rem solid currentColor;
  border-bottom: 0;
  border-radius: 0.42rem 0.42rem 0 0;
  transform: translateX(-50%);
  box-sizing: border-box;
}

.lock-tool.is-unlocked .lock-state-icon::before {
  left: 64%;
}

.lock-state-label {
  font-size: 0.92rem;
}

.preview-style {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border-radius: 18px;
  min-height: 3rem;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.preview-style span {
  color: var(--muted);
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.preview-style select {
  width: auto;
  min-width: 120px;
  height: 2.25rem;
  padding: 0 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(5, 8, 14, 0.9);
}

.upload-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  flex: 0 0 auto;
  white-space: nowrap;
  min-height: 3rem;
  cursor: pointer;
}

.upload-inline input {
  display: none;
}

.preview-display-tabs {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
}

.preview-tab.is-active {
  background: rgba(31, 182, 166, 0.18);
  border-color: rgba(31, 182, 166, 0.45);
  color: #d9fff9;
}

.preview-tab {
  min-height: 2.65rem;
  padding: 0.55rem 0.9rem;
  border-radius: 16px;
}

.panel-head.compact h3 {
  font-size: 1.1rem;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(5, 8, 14, 0.8);
  color: var(--text);
}

input:focus,
select:focus {
  outline: 2px solid rgba(31, 182, 166, 0.24);
  border-color: var(--accent-2);
}

.addons {
  margin-top: 1.2rem;
}

.mode-settings {
  margin-top: 1.2rem;
  padding: 1rem;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.035);
}

.secondary-screen-grid {
  margin-top: 0.85rem;
}

.viewport-grid.is-support-hidden {
  display: none;
}

.section-help {
  margin-top: 0.75rem;
  color: var(--muted);
  line-height: 1.55;
}

.item-settings {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.95rem;
  position: relative;
}

.display-panel .section-help {
  margin-bottom: 0.8rem;
}

.display-panel > .item-card-body {
  display: block;
}

.display-panel-setup {
  margin-bottom: 1rem;
}

.artwork-tools {
  margin-top: 1.2rem;
}

.upload-drop {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.95rem;
  padding: 1rem;
  border-radius: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.upload-drop input {
  display: none;
}

.upload-drop.is-over {
  border-color: var(--accent-2);
  background: rgba(31, 182, 166, 0.08);
}

.upload-title {
  font-weight: 700;
}

.upload-subtitle,
.artwork-status {
  color: var(--muted);
  line-height: 1.55;
}

.viewport-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 0.8rem;
  margin-top: 0.95rem;
}

.viewport-grid input {
  min-width: 0;
  padding-left: 0.85rem;
  padding-right: 0.85rem;
}

.detect-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.95rem;
}

.artwork-status {
  margin-top: 0.85rem;
}

.item-card {
  padding: 0.9rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.03);
}

.item-card.is-disabled {
  opacity: 0.72;
}

.item-card.is-locked .item-card-body .field input:not([type="file"]),
.item-card.is-locked .item-card-body .field select,
.item-card.is-locked .item-card-body .field textarea {
  opacity: 0.66;
}

.item-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.item-head-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.item-title {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 700;
}

.item-title input {
  width: auto;
  margin: 0;
  accent-color: var(--accent-2);
}

.item-badge {
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  color: #d9fff9;
  background: rgba(31, 182, 166, 0.14);
  font-size: 0.82rem;
}

.import-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  border: 1px solid rgba(242, 95, 58, 0.28);
  background: rgba(242, 95, 58, 0.14);
  flex: 0 0 auto;
}

.import-icon {
  position: relative;
  width: 0.78rem;
  height: 0.78rem;
  display: inline-block;
}

.import-icon::before,
.import-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.import-icon::before {
  top: 0;
  width: 0.16rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #fff4df;
}

.import-icon::after {
  bottom: 0;
  width: 0.58rem;
  height: 0.3rem;
  border: 0.12rem solid #fff4df;
  border-top: 0;
  border-radius: 0 0 0.2rem 0.2rem;
  box-sizing: border-box;
}

.import-icon {
  clip-path: polygon(50% 100%, 14% 56%, 34% 56%, 34% 0, 66% 0, 66% 56%, 86% 56%);
  background: #fff4df;
}

.upload-import-icon {
  width: 1.45rem;
  height: 1.45rem;
}

.collapse-button {
  min-width: 2.4rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.item-card-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.9rem;
}

.item-upload {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.55rem;
  padding: 0.9rem;
  border-radius: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.025);
}

.item-upload.is-over {
  border-color: var(--accent-2);
  background: rgba(31, 182, 166, 0.08);
}

.item-upload input[type="file"] {
  display: none;
}

.item-upload-title {
  font-weight: 700;
}

.item-upload-status {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.item-upload-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.add-layer-button {
  min-width: 3.6rem;
  padding-left: 0.9rem;
  padding-right: 0.9rem;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1;
}

.extra-bezel-block {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.8rem;
  margin-top: 0.15rem;
}

.extra-bezel-head {
  display: grid;
  gap: 0.3rem;
}

.extra-bezel-head span {
  color: var(--text);
  font-weight: 700;
}

.extra-bezel-footer {
  display: flex;
  justify-content: flex-start;
}

.extra-bezel-add-button {
  padding: 0.8rem 1rem;
}

.extra-bezel-empty {
  margin: 0;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px dashed rgba(148, 163, 184, 0.24);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

.extra-bezel-layer {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  padding: 0.9rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.02);
}

.extra-bezel-layer-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.extra-bezel-layer-head strong {
  font-size: 0.96rem;
}

.extra-bezel-layer-toggle {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 700;
}

.extra-bezel-layer-toggle input {
  width: auto;
  margin: 0;
  accent-color: var(--accent-2);
}

.extra-bezel-layer-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.extra-bezel-layer-body {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.extra-bezel-layer.is-collapsed .extra-bezel-layer-body {
  display: none;
}

.layer-remove {
  padding: 0.7rem 0.95rem;
}

.item-card.is-disabled .item-card-body {
  display: none;
}

.item-card.is-collapsed .item-card-body {
  display: none;
}

.field-note {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.83rem;
}

.button-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.output-tools {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

button {
  border: 0;
  border-radius: 18px;
  padding: 0.95rem 1.2rem;
  font-weight: 700;
  cursor: pointer;
  color: #081018;
  background: linear-gradient(135deg, #ffd089 0%, var(--accent) 100%);
}

.ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

a.ghost {
  text-decoration: none;
}

.summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
}

.summary-pill {
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: rgba(31, 182, 166, 0.14);
  color: #baf7ef;
  font-size: 0.9rem;
}

.preview-frame {
  margin-top: 1rem;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    #070a10;
  border: 1px solid rgba(148, 163, 184, 0.14);
  min-height: 760px;
  overflow: hidden;
}

.preview-info {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.03);
}

.preview-info-head h3 {
  margin-top: 0.2rem;
}

.preview-info-code {
  margin: 0.9rem 0 0;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: #05070b;
  color: #d7e2f0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

#layout-preview {
  display: block;
  width: 100%;
  height: 100%;
}

#layout-preview.is-zoomed {
  cursor: grab;
}

#layout-preview.is-panning {
  cursor: grabbing;
}

.code-panel {
  margin-top: 1rem;
  background: var(--panel-2);
}

#lay-output {
  margin: 1rem 0 0;
  padding: 1rem;
  border-radius: 22px;
  background: #05070b;
  border: 1px solid rgba(148, 163, 184, 0.14);
  color: #d7e2f0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.92rem;
  line-height: 1.6;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.help-shell {
  width: min(1180px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 1rem 0 2.5rem;
}

.help-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.help-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.help-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.help-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 1.2rem;
}

.help-card h2,
.help-card h3 {
  margin-top: 0.2rem;
}

.help-lead {
  margin-top: 0.9rem;
  color: var(--muted);
  line-height: 1.65;
  max-width: 70ch;
}

.help-list {
  margin: 0.9rem 0 0;
  padding-left: 1.2rem;
  line-height: 1.7;
  color: #dce7f5;
}

.help-list li + li {
  margin-top: 0.35rem;
}

.help-step {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 1rem;
  align-items: start;
}

.help-shot {
  width: 100%;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: #05070b;
}

.help-note {
  margin-top: 0.85rem;
  padding: 0.85rem 0.95rem;
  border-radius: 18px;
  border: 1px solid rgba(31, 182, 166, 0.3);
  background: rgba(31, 182, 166, 0.1);
  color: #dffcf8;
  line-height: 1.55;
}

.help-pdf-note {
  margin-top: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 980px) {
  .hero,
  .builder-grid {
    grid-template-columns: 1fr;
  }

  .hero-side {
    grid-template-rows: auto auto;
  }

  .hero-logo-wrap {
    justify-content: flex-start;
    padding-top: 0.2rem;
  }

  .hero-logo {
    width: min(100%, 320px);
    max-height: 160px;
  }

  .preview-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .preview-tool-groups {
    width: 100%;
    justify-items: stretch;
  }

  .preview-tools-primary,
  .preview-tools-secondary {
    justify-content: flex-start;
  }

  .preview-panel {
    position: static;
  }
}

@media (max-width: 700px) {
  .app-shell {
    width: min(100% - 0.8rem, 1240px);
  }

  .field-grid,
  .item-card-body,
  .viewport-grid {
    grid-template-columns: 1fr;
  }

  .preview-frame {
    min-height: 560px;
  }
}
