:root {
  --bg: #f6efe6;
  --bg-soft: #ffffff;
  --card: #ffffff;
  --text: #181818;
  --muted: #6e655a;
  --primary: #c48840;
  --primary-strong: #b47c3c;
  --action: #667085;
  --action-strong: #475467;
  --action-soft: #98a2b3;
  --accent: #d49c5c;
  --charcoal: #181818;
  --border: #e4d1b8;
  --header: #ffffff;
  --danger: #f04438;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% -5%, rgba(196, 136, 64, 0.18), transparent 42%),
    radial-gradient(circle at 85% 0%, rgba(212, 156, 92, 0.16), transparent 40%),
    linear-gradient(180deg, #fff8f0 0%, var(--bg) 240px, var(--bg) 100%);
}

header {
  padding: 16px 24px;
  color: var(--text);
  background: linear-gradient(135deg, #ffffff 0%, #fff3e4 76%);
  border-bottom: 1px solid var(--border);
}

header .nav {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  padding: 0;
  flex: 0 0 auto;
}

.nav-brand img {
  display: block;
  height: 56px;
  width: auto;
  border-radius: 0;
  box-shadow: none;
}

.nav-brand:hover {
  background: transparent;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1 1 auto;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  border-radius: 10px;
  padding: 7px 10px;
}

.nav-links a:hover {
  color: var(--text);
  background: rgba(196, 136, 64, 0.14);
}

.nav-burger {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
  cursor: pointer;
}

.nav-burger span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

main {
  max-width: 1180px;
  margin: 28px auto 36px;
  padding: 0 24px;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: #f7efe4;
  padding: 16px 24px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.site-footer a:hover {
  text-decoration: underline;
}

.card {
  background: linear-gradient(180deg, var(--card) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: 0 12px 30px rgba(24, 24, 24, 0.08);
}

.legal-card {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.legal-block + .legal-block {
  margin-top: 18px;
}

.legal-block h2 {
  margin-bottom: 8px;
}

.legal-block p {
  margin: 0;
  line-height: 1.5;
}

.help-phone-box {
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.help-phone-box p {
  margin: 0;
}

.help-phone-box a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

.help-phone-box a:hover {
  text-decoration: underline;
}

.help-form .field {
  margin-bottom: 12px;
}

.help-note {
  margin-top: 8px;
  font-size: 0.86rem;
}

.ticket-thread {
  display: grid;
  gap: 12px;
}

.ticket-message {
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
}

.ticket-message.is-user {
  border-left-color: var(--primary);
}

.ticket-message.is-admin {
  border-left-color: var(--charcoal);
}

.ticket-message header {
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.ticket-message p {
  margin: 0;
  line-height: 1.5;
}

.ticket-list-links {
  display: grid;
  gap: 8px;
}

.ticket-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
}

.ticket-link.is-active {
  border-color: rgba(196, 136, 64, 0.7);
  box-shadow: 0 0 0 2px rgba(196, 136, 64, 0.12);
}

.ticket-status-form {
  margin-top: 12px;
}

.ticket-back-link {
  margin-bottom: 14px;
}

.howto-card code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: #eef2f7;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
}

.howto-section + .howto-section {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.howto-section h2 {
  margin-bottom: 8px;
}

.howto-section ul,
.howto-section ol {
  margin: 0;
  padding-left: 20px;
  line-height: 1.6;
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 12px 14px;
}

.faq-item h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.faq-item p {
  margin: 0;
}

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

h1,
h2,
h3 {
  margin: 0 0 10px;
}

h2 {
  font-size: 1.15rem;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--primary);
}

.muted {
  color: var(--muted);
}

.dashboard-hero {
  position: relative;
  overflow: hidden;
}

.dashboard-hero-content {
  max-width: 720px;
}

.plan-current {
  margin: 12px 0 0;
}

.dashboard-stat-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}

.stat-tile {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.stat-value {
  display: block;
  margin-top: 4px;
  font-size: 1.9rem;
  line-height: 1.1;
}

.stat-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.stat-link:hover {
  text-decoration: underline;
}

.dashboard-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.auth-wrap {
  display: flex;
  justify-content: center;
  padding: 24px 0 8px;
}

.auth-card {
  width: 100%;
  max-width: 560px;
  padding: 30px 28px;
}

.auth-form {
  margin-top: 18px;
  display: grid;
  gap: 16px;
}

.auth-form .field {
  margin-bottom: 0;
}

.auth-form .field .muted {
  margin-top: 7px;
  margin-bottom: 0;
  font-size: 0.86rem;
}

.auth-footer {
  margin-top: 18px;
  margin-bottom: 0;
}

.auth-footer a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.runtime-url-preview {
  margin: 9px 0 0;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px dashed rgba(196, 136, 64, 0.38);
  background: linear-gradient(180deg, rgba(255, 246, 235, 0.95), rgba(249, 240, 228, 0.95));
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.runtime-url-preview-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.runtime-url-base,
.runtime-url-suffix {
  color: #475467;
}

.runtime-url-slug {
  color: var(--primary);
  font-weight: 800;
}

.runtime-url-slug.is-placeholder {
  color: var(--primary-strong);
}

.auth-compare {
  margin-top: 18px;
  margin-bottom: 10px;
}

.auth-compare h2 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.auth-compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}

.auth-compare-table th,
.auth-compare-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.auth-compare-table th {
  background: #f7efe4;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--muted);
}

.auth-compare-table th:first-child,
.auth-compare-table td:first-child {
  width: 52%;
}

.dashboard-plan {
  margin-top: 0;
}

.dashboard-plan-table th:first-child,
.dashboard-plan-table td:first-child {
  width: 24%;
}

.plan-row-active td {
  background: #fbf2e8;
}

.dashboard-plan-table th:not(:first-child),
.dashboard-plan-table td:not(:first-child) {
  min-width: 132px;
}

.dashboard-plan-table th.plan-col-active,
.dashboard-plan-table td.plan-col-active {
  background: #fbf2e8;
}

.dashboard-plan-table th .plan-pill {
  margin-top: 6px;
}

.dashboard-upgrade-form {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.dashboard-plan-note {
  margin-top: 10px;
}

.dashboard-upgrade-form h3 {
  margin-bottom: 10px;
}

.plan-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  border: 1px solid transparent;
}

.plan-pill-icon {
  font-size: 0.78rem;
}

.plan-pill.yes {
  background: #f3e6d6;
  color: #7a4f22;
  border-color: #dfc2a0;
}

.plan-pill.no {
  background: #fff2f5;
  color: #8f3555;
  border-color: #f2c4d2;
}

.plan-pill.pro {
  background: #ecd7b9;
  color: #6a441c;
  border-color: #d9b98f;
}

.plan-pill.neutral {
  background: #f2f4f7;
  color: #3a2f24;
  border-color: #d0d5dd;
}

.dashboard-plan-table td:first-child .plan-pill {
  margin-left: 8px;
}

.action-card {
  text-decoration: none;
  color: inherit;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(24, 24, 24, 0.12);
}

.action-link {
  display: inline-block;
  margin-top: 6px;
  font-weight: 700;
  color: var(--primary);
}

.form-card {
  max-width: 980px;
}

.studio-card {
  max-width: none;
  width: calc(100vw - 48px);
  margin-left: calc(50% - 50vw + 24px);
  margin-right: calc(50% - 50vw + 24px);
}

.studio-card > h1 {
  margin-bottom: 6px;
}

.studio-card > .muted {
  margin-bottom: 8px;
  font-size: 0.86rem;
}

.studio-form {
  gap: 8px;
}

.project-title-section {
  padding-bottom: 0;
  margin-bottom: 2px;
}

.project-title-row {
  display: grid;
  grid-template-columns: minmax(360px, 50%) auto;
  gap: 12px;
  align-items: start;
}

.project-title-field {
  margin-bottom: 0;
}

.project-title-action {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding-top: 0;
}

.studio-workspace-section {
  border-top: 0;
  padding-top: 0;
}

.studio-layout {
  position: relative;
  display: block;
}

.studio-column {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(24, 24, 24, 0.1);
}

.studio-left h2,
.studio-center h2,
.studio-right h2 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.studio-left {
  position: absolute;
  left: 12px;
  top: 44px;
  width: min(240px, 32vw);
  max-height: calc(100% - 56px);
  overflow: auto;
  z-index: 3;
}

.studio-elements-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.studio-item-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.studio-item-children {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: -2px 0 4px 14px;
  padding-left: 10px;
}

.studio-item-child-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.studio-item-child-btn {
  flex: 1 1 auto;
  width: auto;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 560;
  font-size: 0.82rem;
  padding: 7px 9px;
  cursor: pointer;
  position: relative;
}

.studio-item-child-btn.active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
}

.studio-item-child-btn.is-inactive:not(.active) {
  color: #968f86;
  background: #f8f6f3;
  border-color: #d9d3cb;
}

.studio-item-child-btn.is-inactive::after {
  content: "◌";
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.72rem;
  font-weight: 700;
  color: #8e877d;
  opacity: 0.9;
}

.studio-item-child-btn.active.is-inactive::after {
  color: rgba(255, 255, 255, 0.95);
}

.studio-item-visibility-btn {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: #1f1f1f;
  font-size: 0.82rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0;
  cursor: pointer;
}

.studio-item-visibility-btn.is-hidden-state {
  color: #8e877d;
  background: #f7f4ef;
}

.studio-item-visibility-btn.is-hidden-state::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 1.5px;
  background: currentColor;
  transform: rotate(-35deg);
}

.studio-elements-list-secondary {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

.studio-item-btn {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-weight: 650;
  padding: 10px 12px;
  cursor: pointer;
  flex: 1 1 auto;
  position: relative;
}

.studio-item-btn.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
}

.studio-item-btn.is-inactive:not(.active) {
  color: #968f86;
  background: #f8f6f3;
  border-color: #d9d3cb;
}

.studio-item-btn.is-inactive::after {
  content: "◌";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.78rem;
  font-weight: 700;
  color: #8e877d;
  opacity: 0.9;
}

.studio-item-btn.active.is-inactive::after {
  color: rgba(255, 255, 255, 0.95);
}

.studio-item-btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.studio-item-add-btn {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.studio-item-add-btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.studio-item-btn-bottom {
  margin-top: 12px;
}

.studio-overlay-toggle {
  position: absolute;
  z-index: 4;
  top: 8px;
  border: 1px solid rgba(24, 24, 24, 0.22);
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.studio-overlay-toggle-left {
  left: 12px;
}

.studio-overlay-toggle-right {
  right: 12px;
}

.studio-overlay-right-tabs {
  position: absolute;
  z-index: 4;
  top: 8px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.studio-overlay-right-tabs .studio-overlay-toggle {
  position: static;
}

.studio-overlay-tab-btn.active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
}

.studio-overlay-tab-btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.studio-overlay-toggle.is-active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
}

.studio-overlay-panel {
  transition: transform 220ms ease, opacity 220ms ease, visibility 220ms ease;
}

.studio-overlay-panel.is-collapsed {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.studio-play-mode .studio-overlay-toggle {
  display: none;
}

.studio-play-mode .studio-left,
.studio-play-mode .studio-right {
  display: none;
}

.studio-overlay-left.is-collapsed {
  transform: translateX(-14px);
}

.studio-overlay-right.is-collapsed {
  transform: translateX(14px);
}

.studio-center {
  display: flex;
  flex-direction: column;
  border: 0;
  background: transparent;
  padding: 0;
}

.studio-center .preview-stage {
  flex: 0 0 auto;
  height: min(72vh, calc(100vh - 220px));
  min-height: 440px;
}

.studio-right {
  position: absolute;
  right: 12px;
  top: 44px;
  width: min(340px, 42vw);
  max-height: calc(100% - 56px);
  overflow: auto;
  padding: 10px 11px;
  z-index: 3;
}

.studio-panel {
  display: none;
}

.studio-panel.active {
  display: block;
}

.studio-panel > h3 {
  display: none;
}

.studio-right-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 10px;
}

.studio-right-tab-btn {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-weight: 650;
  font-size: 0.86rem;
  padding: 8px 10px;
  cursor: pointer;
}

.studio-right-tab-btn.active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
}

.studio-right-tab-btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.studio-features-root {
  display: none;
}

.studio-panel .media-slot-add[data-media-add] {
  display: none !important;
}

.studio-right .field {
  margin-bottom: 12px;
}

.studio-right .field-grid {
  gap: 8px;
}

.studio-right .field:last-child {
  margin-bottom: 0;
}

.studio-right label {
  margin-bottom: 6px;
}

.studio-right input[type="text"],
.studio-right input[type="url"],
.studio-right input[type="email"],
.studio-right input[type="password"],
.studio-right input[type="tel"],
.studio-right input[type="date"],
.studio-right input[type="number"],
.studio-right textarea,
.studio-right select {
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 0.9rem;
}

.studio-right textarea {
  min-height: 110px;
}

.studio-right .muted {
  font-size: 0.8rem;
  line-height: 1.35;
  font-style: italic;
}

.feature-metric-stack {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.feature-metric-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  align-items: center;
  gap: 10px;
}

.feature-metric-row > label {
  margin: 0;
  font-weight: 600;
}

.feature-metric-row > input[type="text"] {
  margin: 0;
  text-align: right;
}

.feature-control-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 220px);
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.feature-control-row:last-child {
  margin-bottom: 0;
}

.feature-control-row > label {
  margin: 0;
  font-weight: 600;
}

.feature-control-row > select,
.feature-control-row > input[type="text"],
.feature-control-row > input[type="number"] {
  margin: 0;
}

.face-preset-box {
  margin-top: 10px;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: rgba(196, 136, 64, 0.06);
}

.face-preset-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.face-preset-actions button {
  padding: 8px 12px;
  font-size: 0.84rem;
}

.media-slot-group {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.media-slot-group h4 {
  margin: 0 0 10px;
  font-size: 0.96rem;
}

.media-slot-add {
  margin-bottom: 10px;
  padding: 8px 12px;
}

.media-slot-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 10px 4px;
  margin-bottom: 10px;
  background: #fff;
}

.media-slot-card.media-slot-active {
  border-color: rgba(196, 136, 64, 0.78);
  box-shadow: 0 0 0 2px rgba(196, 136, 64, 0.18);
}

.media-slot-card .face-preset-actions button.is-active {
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: #fff;
}

.face-preset-actions .scene-set-activate-btn.is-active {
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: #fff;
}

.occlusion-row-active {
  border-color: rgba(196, 136, 64, 0.78);
  box-shadow: 0 0 0 2px rgba(196, 136, 64, 0.18);
}

.occlusion-row .face-preset-actions {
  justify-content: flex-end;
}

.occlusion-row .face-preset-actions .occlusion-activate-btn.is-active {
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: #fff;
}

.media-slot-card.is-hidden,
.media-slot-card.editor-slot-filter-hidden,
.editor-context-hidden,
.is-hidden {
  display: none !important;
}

.media-slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.media-slot-remove {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--danger);
  padding: 6px 10px;
  font-weight: 700;
  cursor: pointer;
}

.media-slot-settings {
  margin-top: 8px;
}

.media-upload-hint {
  margin: 4px 0 8px;
}

.spaced-top-xs {
  margin-top: 8px;
}

.studio-submit {
  display: flex;
  justify-content: flex-end;
}

.preview-toolbar {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 4;
}

.preview-playmode-toggle {
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: rgba(24, 24, 24, 0.78);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 7px 12px;
  cursor: pointer;
  backdrop-filter: blur(2px);
}

.preview-playmode-toggle.hidden {
  display: none;
}

.preview-playmode-toggle.is-active {
  border-color: rgba(212, 156, 92, 0.95);
  background: rgba(196, 136, 64, 0.88);
}

.project-form {
  display: grid;
  gap: 14px;
}

.form-section {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.form-section.studio-workspace-section {
  border-top: 0;
  padding-top: 0;
}

.form-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.field {
  margin-bottom: 18px;
}

form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 650;
}

input[type="text"],
input[type="url"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="date"],
input[type="number"],
textarea,
select {
  width: 100%;
  margin: 0;
  padding: 12px 13px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 0.95rem;
}

textarea {
  min-height: 130px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(196, 136, 64, 0.68);
  box-shadow: 0 0 0 3px rgba(196, 136, 64, 0.18);
}

.field-grid {
  display: grid;
  gap: 12px;
}

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

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

.target-field-grid .field {
  display: flex;
  flex-direction: column;
}

.target-field-grid .field > label {
  min-height: 2.6em;
  display: flex;
  align-items: flex-end;
}

.checkbox-row {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.checkbox-row input {
  width: auto;
  margin: 0;
}

.rotation-fields {
  transition: opacity 140ms ease;
}

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

.range-value {
  min-width: 46px;
  text-align: right;
  font-weight: 700;
  color: var(--muted);
}

button,
.button {
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 11px 16px;
  display: inline-block;
  background: linear-gradient(135deg, var(--action) 0%, var(--action-strong) 100%);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

button.secondary,
.button.secondary {
  background: #fff;
  color: var(--action-strong);
  border-color: var(--action-soft);
}

button.danger,
.button.danger {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

.table-wrap {
  overflow-x: auto;
}

.projects-table th {
  white-space: nowrap;
}

.projects-table td:last-child {
  white-space: nowrap;
}

table th,
table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.projects-table tbody tr:hover {
  background: rgba(196, 136, 64, 0.08);
}

.admin-users-table .admin-user-summary-row:hover {
  background: rgba(196, 136, 64, 0.08);
}

.admin-user-summary-row td {
  vertical-align: middle;
}

.admin-user-detail-row td {
  padding: 0;
  background: #f9f1e6;
}

.admin-user-form {
  padding: 14px;
}

.admin-user-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-user-form-group {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.admin-user-form-group h3 {
  margin: 0 0 10px;
  font-size: 0.98rem;
}

.admin-user-form-group .field {
  margin-bottom: 10px;
}

.admin-user-form-group .field:last-of-type {
  margin-bottom: 0;
}

.admin-user-form-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.table-thumb {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 4px;
}

.table-thumb.qr {
  width: 52px;
  height: 52px;
}

.status-pill {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 9px;
  background: #fff;
  font-size: 0.82rem;
}

.icon-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.icon-form {
  margin: 0;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid #d0d5dd;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #98a2b3;
  background: #f2f4f7;
  text-decoration: none;
  cursor: pointer;
}

.icon-btn.secondary {
  background: #f2f4f7;
  color: #98a2b3;
  border-color: #d0d5dd;
}

.icon-btn.danger {
  background: #f2f4f7;
  color: #b42318;
  border-color: #d0d5dd;
}

.icon-btn:hover {
  background: #eaecf0;
  color: #667085;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.flash {
  margin-bottom: 12px;
  border-radius: 10px;
  padding: 12px 16px;
  border: 1px solid transparent;
  transition: opacity 240ms ease, transform 240ms ease;
}

.flash.info {
  background: #f7efe4;
  border-color: #e4d1b8;
}

.flash.success {
  background: var(--primary);
  border-color: var(--primary-strong);
  color: #fff;
}

.flash.warning {
  background: #fff6ea;
  border-color: #f1d4a7;
}

.flash.error {
  background: #fee4e2;
  border-color: #fecdca;
}

.flash.is-hiding {
  opacity: 0;
  transform: translateY(-3px);
}

.logo-preview {
  max-width: 280px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 6px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.chart-box {
  position: relative;
  width: 100%;
  min-height: 300px;
  margin-bottom: 14px;
}

.preview-stage {
  position: relative;
  width: 100%;
  min-height: 380px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff 0%, #f7efe4 100%);
  overflow: hidden;
}

.preview-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.project-info-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.project-info-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
}

.project-info-item strong {
  display: block;
  margin-top: 4px;
}

.project-info-qr {
  width: 180px;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 6px;
}

.branding-logo-preview {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f9f1e6;
  padding: 12px;
  display: grid;
  justify-items: center;
  margin-bottom: 14px;
}

.branding-logo-image {
  max-width: 220px;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.branding-logo-actions {
  margin: 8px 0 12px;
}

.branding-button-group {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.branding-subtitle {
  margin: 0 0 10px;
  font-size: 1rem;
}

.ck-editor .ck-editor__editable_inline {
  min-height: 140px;
}

img {
  max-width: 100%;
  height: auto;
}

.target-compiler-card code {
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
}

.target-compiler-steps {
  margin: 14px 0 18px;
  padding-left: 20px;
  line-height: 1.6;
}

.target-compiler-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(300px, 1.1fr) minmax(260px, 1fr);
  align-items: start;
}

.target-compiler-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.target-compiler-actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.target-compiler-panel progress {
  width: 100%;
  margin-top: 12px;
  height: 12px;
}

.target-compiler-preview-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

.target-compiler-preview {
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px dashed var(--border);
  background: #f9f1e6;
  display: none;
}

.target-compiler-preview.is-visible {
  display: block;
}

.text-error {
  color: var(--danger);
  font-weight: 600;
}

@media (max-width: 920px) {
  .studio-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .studio-overlay-toggle {
    display: none;
  }

  .studio-overlay-right-tabs {
    position: static;
    margin-left: auto;
    justify-content: flex-end;
  }

  .studio-overlay-right-tabs .studio-overlay-toggle {
    display: inline-flex;
  }

  .studio-left,
  .studio-right {
    position: static;
    width: 100%;
    max-height: none;
    overflow: visible;
    z-index: auto;
    box-shadow: none;
  }

.studio-overlay-panel.is-collapsed {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

  .studio-elements-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  }

  .studio-item-row {
    flex: 1 1 160px;
  }

  .studio-item-children {
    width: 100%;
    margin: -4px 0 4px 8px;
  }

  .studio-elements-list-secondary {
    width: 100%;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .studio-item-btn {
    width: auto;
    flex: 1 1 auto;
  }

  .studio-item-child-btn {
    width: 100%;
  }

  .studio-item-add-btn {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
  }

  .studio-item-btn-bottom {
    margin-top: 0;
  }

  .studio-card {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .studio-center .preview-stage {
    min-height: 420px;
    height: min(62vh, calc(100vh - 240px));
  }

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

  .target-compiler-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  header {
    padding: 14px 15px;
  }

  header .nav {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
  }

  .nav-brand img {
    height: 64px;
  }

  .nav-burger {
    display: inline-flex;
    flex-direction: column;
  }

  .nav-links {
    grid-column: 1 / -1;
    display: none;
    width: 100%;
    margin-top: 2px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .nav.is-open .nav-links {
    display: flex;
  }

  .nav-links a {
    width: 100%;
    padding: 9px 10px;
    border-radius: 8px;
  }
}

@media (max-width: 760px) {
  header {
    padding: 14px 15px;
  }

  main {
    margin-top: 18px;
    padding: 0 14px 24px;
  }

  .card {
    padding: 16px;
    border-radius: 14px;
  }

  .project-title-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .project-title-action {
    justify-content: flex-start;
    padding-top: 0;
  }

  .studio-card {
    width: calc(100vw - 28px);
    margin-left: calc(50% - 50vw + 14px);
    margin-right: calc(50% - 50vw + 14px);
  }

  .auth-wrap {
    padding-top: 8px;
  }

  .auth-card {
    padding: 20px 16px;
  }

  .auth-compare-table {
    font-size: 0.84rem;
  }

  .auth-compare-table th,
  .auth-compare-table td {
    padding: 9px 8px;
  }

  .auth-compare-table th:first-child,
  .auth-compare-table td:first-child {
    width: auto;
  }

  .field-grid.two {
    grid-template-columns: 1fr;
  }

  .field-grid.three {
    grid-template-columns: 1fr;
  }

  .feature-metric-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .feature-metric-row > input[type="text"] {
    text-align: left;
  }

  .feature-control-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .studio-elements-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .studio-item-row {
    width: 100%;
  }

  .studio-item-children {
    margin: -4px 0 4px 6px;
    padding-left: 8px;
  }

  .studio-elements-list-secondary {
    margin-top: 10px;
    padding-top: 10px;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .studio-item-btn {
    width: 100%;
    flex: 0 0 auto;
  }

  .studio-center .preview-stage {
    min-height: 340px;
    height: min(56vh, calc(100vh - 250px));
  }

  table {
    font-size: 0.86rem;
  }

  .admin-user-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) and (min-width: 921px) {
  .studio-left {
    width: min(214px, 34vw);
  }

  .studio-right {
    width: min(300px, 44vw);
  }

  .studio-center .preview-stage {
    min-height: 420px;
    height: min(66vh, calc(100vh - 225px));
  }
}
