:root {
  --bg: #f5f1e8;
  --ink: #172127;
  --muted: #5f6d75;
  --card: rgba(255, 252, 247, 0.86);
  --card-strong: #fffdf8;
  --line: rgba(27, 39, 46, 0.12);
  --brand: #0f766e;
  --brand-deep: #0d5e58;
  --sand: #c98e4d;
  --sand-soft: #ecd7bf;
  --shadow: 0 24px 60px rgba(23, 33, 39, 0.1);
  --radius-xl: 26px;
  --radius-lg: 18px;
  --radius-md: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  color: var(--ink);
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.08), transparent 32%),
    radial-gradient(circle at bottom right, rgba(201, 142, 77, 0.12), transparent 30%),
    linear-gradient(180deg, #f8f4ec 0%, #f4efe5 100%);
}

.ambient {
  position: fixed;
  inset: auto;
  z-index: -1;
  border-radius: 999px;
  filter: blur(70px);
  opacity: 0.45;
}
.ambient-left {
  top: 120px;
  left: -60px;
  width: 260px;
  height: 260px;
  background: rgba(15, 118, 110, 0.15);
}
.ambient-right {
  right: 30px;
  bottom: 80px;
  width: 260px;
  height: 260px;
  background: rgba(201, 142, 77, 0.18);
}

.shell-header {
  max-width: 1180px;
  margin: 22px auto 0;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--brand-deep), var(--sand));
  box-shadow: var(--shadow);
}

.brand-name {
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 1rem;
}

.brand-subtitle,
.shell-nav a,
.panel-copy,
.hero-text,
.workspace-label,
.progress-step p,
.card-kicker,
.inline-message {
  color: var(--muted);
}

.shell-nav a {
  text-decoration: none;
  font-weight: 600;
}

.text-link {
  color: var(--brand-deep);
  font-weight: 700;
  text-decoration: none;
}

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

.shell {
  max-width: 1180px;
  margin: 24px auto 48px;
  padding: 0 18px;
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.2fr 0.85fr;
  gap: 22px;
  align-items: stretch;
}

.hero-copy {
  padding: 34px 8px 24px 0;
}

.eyebrow,
.workspace-label,
.card-kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Sora", sans-serif;
}

h1 {
  max-width: 760px;
  font-size: clamp(2.2rem, 4.6vw, 4.2rem);
  line-height: 1.02;
}

h2 {
  font-size: 1.45rem;
  margin-bottom: 10px;
}

h3 {
  font-size: 1.1rem;
}

.hero-text {
  max-width: 640px;
  margin: 18px 0 0;
  font-size: 1.05rem;
  line-height: 1.65;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-points span,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  background: rgba(255, 255, 255, 0.62);
  font-size: 0.92rem;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--card);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.auth-panel {
  padding: 16px;
}

.tab-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(15, 118, 110, 0.06);
  margin-bottom: 18px;
}

.tab,
.ghost-button,
button {
  font: inherit;
}

.tab {
  border: 0;
  min-height: 44px;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.tab.is-active {
  color: white;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
}

.tab-panel {
  padding: 6px 4px 2px;
}

.stack-form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  font-size: 0.9rem;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(23, 33, 39, 0.12);
  border-radius: var(--radius-md);
  background: white;
  padding: 12px 14px;
  color: var(--ink);
}

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

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(15, 118, 110, 0.18);
  border-color: rgba(15, 118, 110, 0.45);
}

.oauth-fields {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(23, 33, 39, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.58);
}

.oauth-fields summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  margin-bottom: 2px;
}

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

.provider-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.provider-card {
  min-height: 92px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(23, 33, 39, 0.1);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  text-align: left;
}

.provider-card strong,
.provider-card span {
  display: block;
}

.provider-card span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.provider-card.is-active {
  color: white;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
  border-color: transparent;
}

.provider-card.is-active span {
  color: rgba(255, 255, 255, 0.82);
}

.oauth-connect-panel {
  gap: 10px;
}

.oauth-connect-panel button {
  width: fit-content;
}

.oauth-steps {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.45;
}

.oauth-redirect-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(23, 33, 39, 0.08);
  background: rgba(255, 255, 255, 0.7);
}

.oauth-redirect-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.oauth-redirect-box code {
  overflow-wrap: anywhere;
}

.oauth-connect-panel .ghost-button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
}

.entity-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.status-pill.is-connected,
.status-pill.is-ready {
  background: rgba(15, 118, 110, 0.12);
  color: var(--brand-deep);
}

.status-pill.is-warning {
  background: rgba(201, 142, 77, 0.18);
  color: #9a5c1a;
}

.status-pill.is-danger {
  background: rgba(163, 63, 31, 0.12);
  color: #a33f1f;
}

.entity-note {
  margin-top: 8px;
  max-width: 640px;
  color: #9a5c1a;
  font-size: 0.85rem;
  line-height: 1.45;
}

button {
  border: 0;
  min-height: 48px;
  border-radius: 14px;
  color: white;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
}

button:hover {
  filter: brightness(1.04);
}

.ghost-button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.74);
  cursor: pointer;
  font-weight: 600;
}

.inline-message {
  margin-top: 14px;
  min-height: 22px;
  font-size: 0.92rem;
}

.provider-help {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  background: rgba(15, 118, 110, 0.05);
}

.ai-copilot-panel textarea {
  min-height: 96px;
}

.provider-help strong {
  display: block;
  margin-bottom: 6px;
  font-family: "Sora", sans-serif;
}

.provider-help p {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.55;
}

.provider-help code {
  display: inline-block;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  font-size: 0.84rem;
}

.help-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
  display: grid;
  gap: 6px;
}

.compact-help-list {
  font-size: 0.9rem;
}

.layout-help-block {
  padding-top: 4px;
}

.help-hero {
  padding: 28px;
  margin-bottom: 18px;
}

.help-title {
  font-size: clamp(1.9rem, 3vw, 3rem);
  margin-bottom: 10px;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.help-card {
  padding: 20px;
  display: grid;
  gap: 12px;
}

.help-card h3 {
  font-size: 1rem;
}

.helper-copy {
  margin-top: -4px;
  font-size: 0.84rem;
  color: var(--muted);
}

.workspace-shell {
  margin-top: 28px;
}

body.workspace-active .hero-panel {
  grid-template-columns: 1fr;
  gap: 0;
  min-height: 0;
}

body.workspace-active .auth-panel {
  display: none;
}

body.workspace-active .hero-copy {
  display: none;
}

body.workspace-active .shell {
  margin-top: 14px;
}

body.workspace-active .workspace-shell {
  margin-top: 0;
}

.workspace-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.workspace-layout-guided {
  grid-template-columns: 290px minmax(0, 1fr);
}

.workspace-sidebar {
  position: sticky;
  top: 18px;
  padding: 18px;
}

.workspace-sidebar-guided {
  display: grid;
  gap: 18px;
}

.sidebar-brand {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.session-detail {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted);
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.sidebar-panel {
  padding-top: 6px;
  border-top: 1px solid rgba(23, 33, 39, 0.08);
}

.sidebar-checklist {
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.workspace-main {
  min-width: 0;
}

.workspace-main .dashboard-view {
  animation: enter 280ms ease both;
}

.admin-shell {
  margin-top: 18px;
}

.admin-card {
  padding: 20px;
}

.admin-form {
  margin-bottom: 12px;
}

.dashboard-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.dash-tab {
  min-height: 46px;
  width: 100%;
  justify-content: flex-start;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.dash-tab.is-active {
  color: white;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
}

.dashboard-view {
  display: block;
}

.security-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.entity-list {
  display: grid;
  gap: 12px;
}

.entity-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.entity-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.entity-title {
  font-family: "Sora", sans-serif;
  font-size: 1rem;
}

.entity-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.entity-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.builder-actions {
  display: flex;
  justify-content: flex-start;
}

.builder-studio {
  display: grid;
  gap: 18px;
}

.workflow-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.workflow-stat {
  padding: 18px 20px;
}

.workflow-stat h3 {
  margin: 4px 0 10px;
  font-size: 1.7rem;
}

.builder-hero {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  padding: 22px;
  background:
    radial-gradient(circle at top right, rgba(201, 142, 77, 0.12), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(247, 242, 234, 0.86));
}

.builder-hero-copy {
  margin: 0;
  max-width: 760px;
  align-self: center;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.7;
}

.builder-hero-guided {
  align-items: center;
}

.builder-card,
.builder-preview-card {
  padding: 22px;
}

.builder-card-guided {
  display: grid;
  gap: 18px;
}

.builder-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(250, 247, 242, 0.86));
}

.builder-preview-card {
  background:
    linear-gradient(180deg, rgba(17, 24, 28, 0.02), rgba(15, 118, 110, 0.05)),
    rgba(255, 252, 247, 0.9);
}

.builder-stage-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.74);
}

.builder-stage-nav-guided {
  padding: 14px;
}

.builder-stage-tab {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-weight: 700;
}

.builder-stage-tab.is-active {
  color: white;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
}

.stage-index {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(15, 118, 110, 0.08);
  font-weight: 700;
  color: var(--brand-deep);
}

.builder-stage-tab.is-active .stage-index {
  background: rgba(255, 255, 255, 0.18);
  color: white;
}

.stage-copy {
  display: grid;
  gap: 4px;
  text-align: left;
}

.stage-copy strong {
  font-size: 0.95rem;
}

.stage-copy small {
  font-size: 0.8rem;
  color: var(--muted);
}

.builder-stage-tab.is-active .stage-copy small {
  color: rgba(255, 255, 255, 0.84);
}

.builder-stage-panel {
  display: block;
  min-width: 0;
}

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

.guided-intro {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  background: rgba(15, 118, 110, 0.05);
  color: var(--ink);
}

.guided-intro p {
  margin: 0;
  line-height: 1.6;
}

.guided-intro-inline {
  margin-top: -2px;
}

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

.design-setup {
  display: grid;
  gap: 14px;
}

.designer-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 14px;
  min-width: 0;
}

.designer-grid-guided {
  align-items: start;
}

.designer-stack {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.designer-panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(249, 245, 238, 0.84));
  padding: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  min-width: 0;
  overflow: hidden;
}

.panel-title {
  margin-bottom: 10px;
  font-family: "Sora", sans-serif;
  font-size: 0.96rem;
}

.field-picker {
  display: grid;
  gap: 10px;
  color: var(--muted);
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
}

.field-meta {
  display: grid;
  gap: 3px;
}

.field-name {
  font-weight: 700;
  color: var(--ink);
}

.field-label-input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(23, 33, 39, 0.12);
  border-radius: 10px;
  background: white;
  color: var(--ink);
  font-weight: 700;
}

.field-path {
  font-size: 0.8rem;
  color: var(--muted);
}

.field-actions {
  display: flex;
  gap: 6px;
}

.mini-button {
  min-height: 34px;
  min-width: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.field-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 0.9rem;
}

.field-toggle input {
  min-height: auto;
  width: auto;
}

.style-controls {
  display: grid;
  gap: 10px;
}

.style-controls-compact,
.table-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.designer-style-panel {
  display: grid;
  gap: 16px;
}

.settings-block {
  display: grid;
  gap: 10px;
}

.design-preview-block {
  display: grid;
  gap: 12px;
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid rgba(23, 33, 39, 0.08);
}

.design-preview-head {
  margin-bottom: 0;
}

.design-preview-shell {
  margin-bottom: 0;
}

.feature-title {
  margin-top: 16px;
}

.table-options {
  display: grid;
  gap: 10px;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 2px;
  grid-column: 1 / -1;
}

.inline-check input,
.preview-search input {
  min-height: auto;
  width: auto;
}

.workspace-top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 6px 4px 0;
}

#logout-button {
  min-width: 110px;
}

.progress-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.progress-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.52);
}

.progress-step span {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(15, 118, 110, 0.08);
  font-weight: 700;
}

.progress-step.is-active {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(201, 142, 77, 0.08));
}

.progress-step p {
  margin: 4px 0 0;
  font-size: 0.9rem;
}

.workspace-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.workspace-grid .card {
  padding: 20px;
}

.full-width {
  grid-column: 1 / -1;
}

.card-head,
.embed-actions,
.output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.card-head {
  margin-bottom: 18px;
}

.embed-actions {
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.embed-actions label {
  flex: 1;
  min-width: 0;
}

.output-wrap {
  padding: 14px;
  border-radius: 22px;
  background: #11181c;
  max-width: 100%;
  overflow: hidden;
}

.publish-note {
  margin-bottom: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
}

.publish-note strong {
  display: block;
  margin-bottom: 6px;
  font-family: "Sora", sans-serif;
}

.publish-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.preview-shell {
  margin-bottom: 14px;
}

.preview-panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.preview-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.widget-preview {
  min-height: 260px;
  max-width: 100%;
  min-width: 0;
  padding: 20px;
  background:
    radial-gradient(circle at top right, rgba(201, 142, 77, 0.14), transparent 26%),
    linear-gradient(180deg, rgba(255,255,255,0.82), rgba(246,241,232,0.96));
}

.preview-card {
  max-width: 100%;
  min-width: 0;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 18px;
  background: white;
  padding: 18px;
  box-shadow: 0 12px 30px rgba(23, 33, 39, 0.08);
}

.preview-card h4 {
  margin: 0 0 12px;
  font-family: "Sora", sans-serif;
  font-size: 1rem;
}

.preview-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.preview-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.preview-grid {
  display: grid;
  gap: 10px;
}

.preview-item {
  padding: 12px;
  border-radius: 14px;
  background: rgba(15, 118, 110, 0.06);
}

.preview-label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.75;
}

.preview-value {
  display: block;
  font-size: 0.96rem;
  line-height: 1.45;
}

.preview-table {
  width: 100%;
  min-width: 640px;
  border-collapse: separate;
  border-spacing: 0;
}

.preview-table th,
.preview-table td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(23, 33, 39, 0.06);
  vertical-align: top;
}

.preview-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(180deg, #f9f7f1 0%, #f2ece1 100%);
  border-bottom: 1px solid rgba(23, 33, 39, 0.08);
}

.preview-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.76);
}

.preview-table tbody tr:nth-child(even) {
  background: rgba(249, 245, 237, 0.92);
}

.preview-table tbody tr:hover {
  background: rgba(15, 118, 110, 0.06);
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.preview-toolbar-elevated {
  padding: 12px 14px;
  border: 1px solid rgba(23, 33, 39, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
}

.preview-search {
  display: flex;
  flex: 1;
}

.preview-search-shell {
  display: grid;
  gap: 4px;
  min-width: 220px;
}

.preview-search-label,
.preview-head-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.preview-search input {
  width: 100%;
  min-width: 220px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(23, 33, 39, 0.12);
  border-radius: 12px;
  background: #fff;
}

.preview-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.page-meta {
  font-size: 0.86rem;
  color: var(--muted);
}

.page-meta-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--brand-deep);
  font-weight: 700;
}

.sort-button,
.page-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(23, 33, 39, 0.12);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sort-indicator {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.sort-button.is-active {
  border-color: rgba(15, 118, 110, 0.3);
  background: rgba(15, 118, 110, 0.08);
  color: var(--brand-deep);
}

.preview-table-wrap {
  overflow: auto;
  max-width: 100%;
  border: 1px solid rgba(23, 33, 39, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
}

.designer-preview-rail {
  position: sticky;
  top: 18px;
  align-self: start;
}

.preview-cell {
  line-height: 1.5;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}

.preview-spotlight {
  display: grid;
  gap: 10px;
}

.preview-hero {
  padding: 16px;
  border-radius: 16px;
  color: white;
}

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

.preview-list-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(23, 33, 39, 0.05);
}

.preview-chart-card,
.dashboard-builder-grid {
  display: grid;
  gap: 16px;
}

.preview-dashboard-card {
  border: 1px solid rgba(23, 33, 39, 0.08);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.08);
}

.preview-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.preview-dashboard-item {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 241, 234, 0.96));
  border: 1px solid rgba(23, 33, 39, 0.08);
  display: grid;
  gap: 12px;
}

.preview-dashboard-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.preview-dashboard-item-head span {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.preview-dashboard-item-body {
  display: flex;
  align-items: center;
  gap: 12px;
}

.preview-mini-accent {
  width: 14px;
  height: 42px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.preview-kpi-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.preview-kpi-value {
  font: 700 2.6rem/1 var(--font-display, "Sora", sans-serif);
}

.preview-chart-bars {
  display: grid;
  gap: 10px;
}

.preview-bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) 2fr auto;
  gap: 10px;
  align-items: center;
}

.preview-bar-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(23, 33, 39, 0.08);
  overflow: hidden;
}

.preview-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.preview-line-wrap {
  overflow-x: auto;
  padding-bottom: 4px;
}

.preview-line-chart {
  width: 100%;
  height: auto;
  display: block;
  min-width: 320px;
}

.preview-line-grid {
  stroke: rgba(23, 33, 39, 0.1);
  stroke-width: 1;
  stroke-dasharray: 3 5;
}

.preview-axis-label {
  font-size: 9px;
  fill: var(--muted);
}

.preview-axis-label--dense {
  font-size: 8px;
}

.preview-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.preview-chart-legend span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(23, 33, 39, 0.06);
}

.preview-donut-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
}

.preview-donut-chart {
  width: 160px;
  height: 160px;
}

.preview-donut-total {
  font: 700 1.1rem/1 "Sora", sans-serif;
  fill: var(--ink);
}

.preview-donut-legend {
  display: grid;
  gap: 8px;
}

.preview-donut-legend span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-donut-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.field-label-static {
  font-weight: 700;
}

.dashboard-widget-row {
  align-items: center;
}

.dashboard-widget-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-widget-actions .ghost-button {
  min-width: 58px;
  padding: 6px 10px;
}

.output-head {
  margin-bottom: 12px;
  color: rgba(240, 246, 250, 0.72);
  font-size: 0.88rem;
}

pre {
  margin: 0;
  min-height: 200px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #e6edf3;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.qr-wrap {
  display: flex;
  justify-content: center;
  margin: 8px 0 14px;
}

.twofa-qr {
  width: 180px;
  height: 180px;
  padding: 10px;
  border-radius: 18px;
  background: white;
  box-shadow: 0 10px 22px rgba(23, 33, 39, 0.08);
}

.is-hidden {
  display: none !important;
}

.reveal {
  animation: enter 500ms ease both;
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .hero-panel,
  .workspace-grid,
  .progress-strip,
  .workflow-summary,
  .publish-ready-grid,
  .designer-grid,
  .workspace-layout,
  .builder-hero,
  .form-split,
  .builder-stage-nav,
  .security-grid {
    grid-template-columns: 1fr;
  }

  .preview-donut-wrap,
  .dashboard-builder-grid {
    grid-template-columns: 1fr;
  }

  .shell-header,
  .workspace-top,
  .card-head,
  .embed-actions,
  .output-head {
    align-items: flex-start;
  }

  .shell-header,
  .workspace-top,
  .card-head,
  .embed-actions,
  .output-head {
    flex-direction: column;
  }

  .workspace-sidebar {
    position: static;
  }

  .designer-preview-rail {
    position: static;
  }

  h1 {
    font-size: 2.4rem;
  }

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

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

  .designer-preview-rail {
    position: static;
  }
}

@media (max-width: 860px) {
  .style-controls-compact,
  .table-options,
  .form-split {
    grid-template-columns: 1fr;
  }

  .field-row {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .field-actions {
    width: 100%;
  }
}
