:root {
  color-scheme: light;
  --lbp-ink: #172026;
  --lbp-muted: #5c6a72;
  --lbp-soft: #f5f7f8;
  --lbp-panel: #ffffff;
  --lbp-line: #d9e0e4;
  --lbp-line-strong: #b8c4ca;
  --lbp-dark: #111820;
  --lbp-dark-2: #1b252d;
  --lbp-accent: #0d7f78;
  --lbp-accent-dark: #09625d;
  --lbp-warn: #b44e16;
  --lbp-radius: 8px;
  --lbp-shadow: 0 18px 55px rgba(15, 24, 32, 0.13);
  --lbp-grab-cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' stroke='%230b1117' stroke-width='1.25' stroke-linejoin='round' d='M8.2 3.4c.7 0 1.2.5 1.2 1.2v5.7h.4V8.5c0-.7.5-1.2 1.2-1.2s1.2.5 1.2 1.2v2h.4V9.1c0-.7.5-1.2 1.2-1.2s1.2.5 1.2 1.2v2h.4v-.8c0-.7.5-1.2 1.2-1.2s1.2.5 1.2 1.2v4.2c0 3.4-2.2 5.8-5.5 5.8h-1.2c-2.1 0-3.8-.8-5-2.5L4.5 13c-.4-.6-.2-1.3.3-1.7.5-.4 1.2-.3 1.7.2l.5.6V4.6c0-.7.5-1.2 1.2-1.2z'/%3E%3C/svg%3E") 8 5, grab;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body.lbp-standalone {
  margin: 0;
  min-width: 320px;
  height: 100vh;
  overflow: hidden;
  color: var(--lbp-ink);
  background:
    linear-gradient(180deg, #eef2f3 0%, #f8faf9 42%, #edf1ee 100%);
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.lbp-shell {
  width: min(1440px, calc(100vw - 32px));
  height: clamp(640px, calc(100vh - 220px), 780px);
  margin: 20px auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

body.lbp-standalone .lbp-shell {
  height: 100vh;
  min-height: 0;
  margin: 0 auto;
  padding: 12px 0;
}

.lbp-header {
  display: none;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  flex: 0 0 auto;
  padding: 0 0 10px;
}

.lbp-kicker {
  margin: 0 0 4px;
  color: var(--lbp-accent-dark);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.lbp-header h1 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(1.35rem, 2.4vw, 2.6rem);
  line-height: 1;
  letter-spacing: 0;
}

.lbp-header p {
  max-width: 680px;
  margin: 6px 0 0;
  color: var(--lbp-muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.lbp-header-link {
  display: none;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--lbp-line-strong);
  border-radius: var(--lbp-radius);
  color: var(--lbp-ink);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.7);
}

.lbp-tool {
  display: grid;
  grid-template-columns: minmax(270px, 330px) minmax(0, 1fr) minmax(270px, 320px);
  grid-template-areas: "controls preview output";
  flex: 1 1 auto;
  min-height: 0;
  border: 1px solid var(--lbp-line);
  border-radius: var(--lbp-radius);
  overflow: hidden;
  background: var(--lbp-panel);
  box-shadow: var(--lbp-shadow);
}

.lbp-controls,
.lbp-output-panel {
  display: flex;
  flex-direction: column;
  background: #fbfcfc;
  overflow: auto;
  min-height: 0;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

.lbp-controls,
.lbp-output-panel,
.lbp-controls :where(h1, h2, h3, h4, h5, h6, p, span, small, strong, label, legend, button, a, div),
.lbp-output-panel :where(h1, h2, h3, h4, h5, h6, p, span, small, strong, label, legend, button, a, div) {
  color: var(--lbp-ink) !important;
}

.lbp-controls {
  grid-area: controls;
  border-right: 1px solid var(--lbp-line);
}

.lbp-output-panel {
  grid-area: output;
  border-left: 1px solid var(--lbp-line);
}

.lbp-controls *,
.lbp-output-panel * {
  cursor: default !important;
  user-select: none;
  -webkit-user-select: none;
}

.lbp-controls button,
.lbp-controls button *,
.lbp-controls a,
.lbp-controls a *,
.lbp-controls .lbp-upload,
.lbp-controls .lbp-upload *,
.lbp-controls .lbp-color-button,
.lbp-controls .lbp-color-button *,
.lbp-controls label[for],
.lbp-output-panel button,
.lbp-output-panel button * {
  cursor: pointer !important;
}

.lbp-controls input,
.lbp-controls textarea,
.lbp-output-panel input,
.lbp-output-panel textarea {
  color: var(--lbp-ink) !important;
  caret-color: var(--lbp-ink);
  cursor: text !important;
  user-select: text;
  -webkit-user-select: text;
}

.lbp-controls input::placeholder,
.lbp-controls textarea::placeholder,
.lbp-output-panel input::placeholder,
.lbp-output-panel textarea::placeholder {
  color: var(--lbp-muted) !important;
  opacity: 1;
}

.lbp-controls input[type="file"],
.lbp-controls input[type="button"],
.lbp-controls input[type="submit"],
.lbp-controls input[type="radio"],
.lbp-controls input[type="checkbox"],
.lbp-output-panel input[type="button"],
.lbp-output-panel input[type="submit"],
.lbp-output-panel input[type="checkbox"] {
  cursor: pointer !important;
}

.lbp-controls .lbp-form-label,
.lbp-output-panel .lbp-form-label {
  cursor: default !important;
}

.lbp-control-section {
  padding: 12px 14px;
  border-bottom: 0;
}

.lbp-section-title,
.lbp-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lbp-section-title {
  margin-bottom: 8px;
  font-weight: 800;
}

.lbp-help {
  margin: 7px 0 0;
  color: var(--lbp-muted) !important;
  font-size: 0.78rem;
  line-height: 1.35;
}

.lbp-upload {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 4px 12px;
  align-items: center;
  min-height: 66px;
  padding: 10px;
  border: 1px dashed #91a3aa;
  border-radius: var(--lbp-radius);
  background: #ffffff;
  cursor: pointer;
}

.lbp-upload input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.lbp-upload.dragging {
  border-color: var(--lbp-accent);
  background: #eefbf8;
}

.lbp-upload-icon {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #ffffff !important;
  background: var(--lbp-dark);
  font-size: 1.5rem;
}

.lbp-upload-text {
  font-weight: 800;
}

.lbp-upload-hint,
.lbp-file-status,
.lbp-validation {
  color: var(--lbp-muted) !important;
  font-size: 0.82rem;
}

.lbp-file-status {
  margin-top: 7px;
  padding: 7px 9px;
  border-radius: var(--lbp-radius);
  background: #eef2f3;
}

.lbp-file-status.warning,
.lbp-validation {
  color: var(--lbp-warn) !important;
  background: #fff3e8;
}

.lbp-file-status.error {
  color: #9e1f1f !important;
  background: #fff0f0;
}

.lbp-segment-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.lbp-segment,
.lbp-two-toggle button,
.lbp-unit-toggle button {
  min-height: 32px;
  padding: 0 7px;
  border: 1px solid var(--lbp-line);
  border-radius: var(--lbp-radius);
  color: var(--lbp-ink);
  background: #ffffff;
  font-size: 0.78rem;
  font-weight: 400;
  cursor: pointer;
}

.lbp-segment.active,
.lbp-unit-toggle button.active {
  border-color: var(--lbp-dark);
  box-shadow: inset 0 0 0 1px var(--lbp-dark);
}

.lbp-two-toggle button.active {
  border-color: var(--lbp-accent);
  color: #ffffff;
  background: var(--lbp-accent);
  box-shadow: none;
}

.lbp-custom-size {
  margin-top: 8px;
}

.lbp-custom-size label,
.lbp-notes-label {
  display: block;
  margin-bottom: 8px;
  color: var(--lbp-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.lbp-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.lbp-input-row input,
textarea {
  width: 100%;
  border: 1px solid var(--lbp-line);
  border-radius: var(--lbp-radius);
  color: var(--lbp-ink);
  background: #ffffff;
}

.lbp-input-row input {
  min-height: 36px;
  padding: 0 12px;
}

textarea {
  min-height: 58px;
  padding: 10px 12px;
  resize: vertical;
}

.lbp-unit-toggle,
.lbp-two-toggle {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 6px;
}

.lbp-unit-toggle button {
  min-width: 50px;
}

.lbp-two-toggle button {
  min-width: 78px;
  padding: 0 12px;
  white-space: nowrap;
}

.lbp-full-toggle {
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lbp-full-toggle button {
  width: 100%;
  min-width: 0;
}

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

.lbp-download-section {
  margin-top: auto;
}

.lbp-validation {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: var(--lbp-radius);
}

.lbp-size-readout {
  margin-top: 7px;
  padding: 7px 9px;
  border: 0;
  border-radius: var(--lbp-radius);
  color: var(--lbp-muted) !important;
  background: #eef2f3;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.35;
}

.lbp-color-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.lbp-color-button {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-height: 32px;
  padding: 0 7px;
  border: 1px solid var(--lbp-line);
  border-radius: var(--lbp-radius);
  background: #ffffff;
  cursor: pointer;
}

.lbp-color-button.active {
  border-color: var(--lbp-dark);
  box-shadow: inset 0 0 0 1px var(--lbp-dark);
}

.lbp-swatch {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(17, 24, 32, 0.18);
  border-radius: 50%;
  background: var(--swatch-color);
}

.lbp-color-button span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 400;
}

.lbp-toggle-row {
  margin-top: 9px;
  font-size: 0.84rem;
  font-weight: 700;
}

.lbp-actions {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.lbp-quote-form {
  display: grid;
  gap: 9px;
  margin-top: 10px;
}

.lbp-form-field {
  display: grid;
  gap: 5px;
}

.lbp-form-label {
  color: var(--lbp-ink);
  font-size: 0.78rem;
  font-weight: 700;
}

.lbp-form-field input,
.lbp-form-field textarea {
  width: 100%;
  border: 1px solid var(--lbp-line);
  border-radius: var(--lbp-radius);
  color: var(--lbp-ink);
  background: #ffffff;
  font-size: 0.84rem;
}

.lbp-form-field input {
  min-height: 36px;
  padding: 0 10px;
}

.lbp-form-field textarea {
  min-height: 72px;
  padding: 9px 10px;
  resize: vertical;
}

.lbp-form-status {
  margin: 0;
  padding: 8px 10px;
  border-radius: var(--lbp-radius);
  color: var(--lbp-muted) !important;
  background: #eef2f3;
  font-size: 0.78rem;
  line-height: 1.35;
}

.lbp-form-status.success {
  color: #09625d !important;
  background: #e9f7f3;
}

.lbp-form-status.error {
  color: #9e1f1f !important;
  background: #fff0f0;
}

.lbp-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.lbp-primary,
.lbp-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: var(--lbp-radius);
  text-align: center;
  text-decoration: none;
  font-weight: 800;
}

.lbp-primary {
  border: 0;
  color: #ffffff !important;
  background: var(--lbp-dark);
  cursor: pointer;
}

.lbp-primary *,
.lbp-upload-icon * {
  color: #ffffff !important;
}

.lbp-primary:disabled {
  cursor: wait;
  opacity: 0.65;
}

.lbp-secondary {
  border: 1px solid var(--lbp-line-strong);
  color: var(--lbp-dark);
  background: #ffffff;
}

.lbp-preview-panel {
  grid-area: preview;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  background: var(--lbp-dark);
}

.lbp-preview-toolbar,
.lbp-preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #dfe8ea;
}

.lbp-preview-toolbar {
  display: none;
  min-height: 54px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  background: var(--lbp-dark-2);
}

.lbp-live-label {
  display: none;
  margin-bottom: 4px;
  color: #95aab1;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.lbp-status-pill {
  display: none;
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #c9d5d8;
  background: rgba(255, 255, 255, 0.07);
  font-size: 0.78rem;
}

.lbp-viewport-stage {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #0c1218;
}

.lbp-viewport-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  cursor: var(--lbp-grab-cursor);
}

.lbp-lighting-dock {
  position: relative;
  z-index: 1;
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(54px, 1fr));
  gap: 4px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(17, 24, 32, 0.72);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(12px);
  flex: 0 0 auto;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

.lbp-lighting-dock button {
  min-width: 54px;
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  color: #eaf2f4;
  background: transparent;
  cursor: pointer;
  font-size: 0.76rem;
  line-height: 1;
  user-select: none;
  -webkit-user-select: none;
}

.lbp-lighting-dock button.active {
  color: #ffffff;
  background: var(--lbp-accent);
}

.lbp-viewport {
  position: absolute;
  inset: 0;
  cursor: var(--lbp-grab-cursor);
}

.lbp-viewport canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: var(--lbp-grab-cursor);
}

.lbp-dimension-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  cursor: var(--lbp-grab-cursor);
}

.lbp-empty {
  position: absolute;
  inset: auto 24px 24px;
  padding: 12px 14px;
  border-radius: var(--lbp-radius);
  color: #dfe8ea;
  background: rgba(17, 24, 32, 0.82);
}

.lbp-empty.error {
  background: rgba(122, 28, 28, 0.9);
}

.lbp-preview-notice {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  color: #cbd6da;
  background: rgba(17, 24, 32, 0.96);
  font-size: 0.78rem;
  line-height: 1.35;
}

.lbp-preview-notice-text {
  min-width: 0;
  flex: 1 1 auto;
}

.lbp-preview-meta {
  display: none;
  min-height: 40px;
  padding: 8px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  background: #151e25;
  color: #c8d5d8;
  font-size: 0.86rem;
}

.lbp-info-grid {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 28px;
  overflow: hidden;
  border: 1px solid var(--lbp-line);
  border-radius: var(--lbp-radius);
  background: var(--lbp-line);
}

.lbp-info-grid article {
  padding: 22px;
  background: rgba(255, 255, 255, 0.72);
}

.lbp-info-grid h2 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.lbp-info-grid p,
.lbp-info-grid ol {
  margin: 0;
  color: var(--lbp-muted);
  line-height: 1.55;
}

.lbp-info-grid ol {
  padding-left: 20px;
}

@media (max-width: 1040px) {
  body.lbp-standalone {
    overflow: auto;
    height: auto;
  }

  .lbp-shell {
    width: 100%;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
  }

  body.lbp-standalone .lbp-shell {
    min-height: 100vh;
    padding: 0;
  }

  .lbp-tool {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    border-top: 0;
    border-radius: 0;
    overflow: visible;
  }

  .lbp-controls {
    order: 2;
    border-right: 0;
    border-top: 0;
  }

  .lbp-output-panel {
    order: 3;
    border-left: 0;
    border-top: 0;
  }

  .lbp-controls,
  .lbp-output-panel {
    display: flex;
    overflow: visible;
    min-height: auto;
  }

  .lbp-preview-panel {
    order: 1;
    min-height: 0;
    grid-template-rows: auto auto;
    margin-top: -1px;
  }

  .lbp-viewport-stage {
    width: 100%;
    height: min(75vh, 720px);
    min-height: 0;
    overflow: hidden;
  }

  .lbp-viewport-wrap {
    width: 100%;
    height: 100%;
  }
}

@media (max-width: 760px) {
  .lbp-shell {
    width: 100%;
    padding: 0;
    margin: 0;
  }

  .lbp-header {
    grid-template-columns: 1fr;
    padding: 20px 16px;
  }

  .lbp-header-link {
    width: fit-content;
  }

  .lbp-tool,
  .lbp-info-grid {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .lbp-control-section {
    padding: 16px;
  }

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

  .lbp-toggle-row,
  .lbp-preview-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .lbp-unit-toggle {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lbp-unit-toggle button {
    width: 100%;
  }

  .lbp-preview-panel {
    min-height: 0;
    grid-template-rows: auto auto;
  }

  .lbp-preview-notice {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding: 9px 12px;
  }

  .lbp-preview-notice-text {
    flex: 1 1 0;
  }

  .lbp-lighting-dock {
    width: auto;
    grid-template-columns: repeat(2, minmax(48px, 1fr));
    padding: 3px;
  }

  .lbp-lighting-dock button {
    min-width: 48px;
    min-height: 26px;
    padding: 0 8px;
  }

  .lbp-actions {
    position: static;
    margin: 10px 0 0;
    padding: 0;
    border-top: 0;
    background: transparent;
  }

  .lbp-info-grid {
    grid-template-columns: 1fr;
    margin-top: 18px;
  }
}
