:root {
  color: #26251e;
  background: #f7f7f4;
  font-family: "Cursor Gothic", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
  font-weight: 400;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@font-face {
  font-family: "Cursor Gothic";
  src: url("../../Cursor Gothic 250822/WEB/WOFF2/CursorGothic-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "Cursor Gothic";
  src: url("../../Cursor Gothic 250822/WEB/WOFF2/CursorGothic-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  height: 100%;
  margin: 0;
}

@media (max-width: 979px) {
  html,
  body,
  #root {
    height: auto;
    min-height: 100%;
  }

  .app-layout--hub {
    min-height: 100%;
  }
}

body {
  background:
    radial-gradient(circle at top left, rgba(245, 78, 0, 0.08), transparent 24%),
    #f7f7f4;
}

button,
input,
select {
  font: inherit;
}

.app-layout {
  display: flex;
  flex-direction: column;
}

.app-layout--hub {
  min-height: 100dvh;
  overflow: auto;
}

.app-layout--editor {
  height: 100dvh;
  max-height: 100dvh;
  overflow: auto;
}

.editor-root {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.app-top-bar-hub .hub-header-compact {
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
}

.app-top-bar-hub .hub-tagline-wide {
  max-width: 52ch;
}

.hub-page {
  flex: 1;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 8px 24px 48px;
}

.hub-hero {
  padding: 24px 28px;
  margin-bottom: 28px;
}

.hub-hero--compact {
  margin-bottom: 16px;
  padding-bottom: 20px;
}

.hub-hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(38, 37, 30, 0.08);
}

.hub-title {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hub-lead {
  margin: 12px 0 0;
  max-width: 56ch;
  color: rgba(38, 37, 30, 0.72);
  font-size: 1rem;
  line-height: 1.45;
}

.hub-section-title {
  margin: 32px 0 16px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(38, 37, 30, 0.55);
}

.hub-section-blurb {
  margin: -8px 0 20px;
  max-width: 68ch;
  font-size: 0.95rem;
  color: rgba(38, 37, 30, 0.72);
  line-height: 1.5;
}

.hub-section-blurb code {
  font-size: 0.88em;
  background: rgba(38, 37, 30, 0.07);
  padding: 2px 6px;
  border-radius: 6px;
}

.hub-card-body code {
  font-size: 0.88em;
  background: rgba(38, 37, 30, 0.07);
  padding: 2px 6px;
  border-radius: 6px;
}

.hub-examples {
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(38, 37, 30, 0.04);
  border: 1px solid rgba(38, 37, 30, 0.06);
}

.hub-examples-compact {
  margin: 12px 0;
  flex: 0 0 auto;
}

.hub-examples-title {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(38, 37, 30, 0.55);
}

.hub-examples-list {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.88rem;
  color: rgba(38, 37, 30, 0.78);
  line-height: 1.45;
}

.hub-examples-list li + li {
  margin-top: 6px;
}

.hub-quick-label {
  margin: 12px 0 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(38, 37, 30, 0.55);
}

.hub-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.chip-primary {
  border-color: rgba(245, 78, 0, 0.45);
  background: rgba(245, 78, 0, 0.1);
}

.chip-primary:hover {
  border-color: rgba(245, 78, 0, 0.65);
  background: rgba(245, 78, 0, 0.14);
}

.hub-sole-cta {
  margin-top: 14px;
}

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

.hub-grid-narrow {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  max-width: 720px;
}

.hub-grid-wide {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  max-width: 900px;
}

/* “What do you need?” - compact entry tiles */
.hub-start-panel {
  padding: 20px 22px 22px;
  margin-bottom: 12px;
}

.hub-start-heading {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
}

.hub-start-lead {
  margin: 0 0 16px;
  max-width: 62ch;
  font-size: 0.92rem;
  color: rgba(38, 37, 30, 0.72);
  line-height: 1.45;
}

.hub-action-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 12px;
}

.hub-action-tile {
  appearance: none;
  border: 1px solid rgba(38, 37, 30, 0.1);
  background: #fdfdfc;
  border-radius: 16px;
  padding: 14px 16px 16px;
  text-align: left;
  cursor: pointer;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    transform 120ms ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 118px;
}

.hub-action-tile:hover {
  background: #f7f7f4;
  border-color: rgba(245, 78, 0, 0.35);
  transform: translateY(-1px);
}

.hub-action-tile--primary {
  border-color: rgba(245, 78, 0, 0.28);
  background: rgba(245, 78, 0, 0.06);
}

.hub-action-tile--primary:hover {
  background: rgba(245, 78, 0, 0.09);
  border-color: rgba(245, 78, 0, 0.45);
}

.hub-action-tile:focus-visible {
  outline: 2px solid rgba(245, 78, 0, 0.45);
  outline-offset: 2px;
}

.hub-action-tile-kicker {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #f54e00;
}

.hub-action-tile-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.2;
  color: #26251e;
}

.hub-action-tile-desc {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.35;
  color: rgba(38, 37, 30, 0.68);
}

.hub-secondary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(38, 37, 30, 0.08);
}

.hub-secondary-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: #26251e;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hub-secondary-link:hover {
  color: #f54e00;
}

/* Kit at a glance - tight grid instead of a long horizontal strip */
.hub-preview-panel {
  padding: 18px 22px 20px;
  margin-bottom: 8px;
}

.hub-preview-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.hub-preview-heading {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.hub-preview-lead {
  margin: 0;
  max-width: 60ch;
  font-size: 0.88rem;
  color: rgba(38, 37, 30, 0.7);
  line-height: 1.45;
}

.hub-preview-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.hub-browse-library-btn {
  flex-shrink: 0;
}

.hub-kit-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px 12px;
}

.hub-preview-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.hub-preview-thumb {
  width: 100%;
  max-width: 104px;
  aspect-ratio: 1;
  border-radius: 16px;
  background:
    linear-gradient(45deg, #e0ddd6 25%, transparent 25%),
    linear-gradient(-45deg, #e0ddd6 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e0ddd6 75%),
    linear-gradient(-45deg, transparent 75%, #e0ddd6 75%);
  background-size: 12px 12px;
  background-position:
    0 0,
    0 6px,
    6px -6px,
    -6px 0;
  background-color: #f2f1ed;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border: 1px solid rgba(38, 37, 30, 0.08);
}

.hub-preview-thumb--circle {
  border-radius: 50%;
}

.hub-preview-thumb--wordmark {
  padding: 8px 6px;
}

.hub-preview-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.hub-preview-thumb--wordmark img {
  width: 100%;
  height: auto;
  max-height: 72%;
}

.hub-preview-caption {
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(38, 37, 30, 0.62);
  line-height: 1.2;
  max-width: 11em;
}

.hub-kit-strip {
  padding: 16px 20px 18px;
  margin-bottom: 12px;
}

.hub-kit-strip-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 12px;
}

.hub-kit-strip-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.hub-kit-strip-link {
  font-size: 0.88rem;
  font-weight: 600;
}

.hub-kit-grid--compact {
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px 10px;
}

.hub-kit-grid--compact .hub-preview-thumb {
  max-width: 88px;
  padding: 8px;
}

.hub-grid-single {
  grid-template-columns: 1fr;
  max-width: 720px;
}

.library-page {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px 48px;
}

.library-top-bar .app-top-bar-tagline code {
  font-size: 0.84em;
  background: rgba(38, 37, 30, 0.07);
  padding: 2px 6px;
  border-radius: 6px;
}

.library-toolbar {
  padding: 16px 18px;
  margin-bottom: 16px;
}

.library-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: flex-end;
}

.library-field {
  flex: 1 1 200px;
  margin-top: 0;
}

.library-count {
  margin: 12px 0 0;
  font-size: 0.9rem;
  color: rgba(38, 37, 30, 0.65);
}

.library-action-toast {
  color: rgba(38, 37, 30, 0.55);
}

.library-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 16px;
}

.library-card {
  display: grid;
  grid-template-columns: minmax(100px, 132px) 1fr;
  gap: 16px;
  padding: 16px;
  align-items: start;
}

.library-card-preview {
  border-radius: 14px;
  background:
    linear-gradient(45deg, #e0ddd6 25%, transparent 25%),
    linear-gradient(-45deg, #e0ddd6 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e0ddd6 75%),
    linear-gradient(-45deg, transparent 75%, #e0ddd6 75%);
  background-size: 10px 10px;
  background-position:
    0 0,
    0 5px,
    5px -5px,
    -5px 0;
  background-color: #f2f1ed;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border: 1px solid rgba(38, 37, 30, 0.08);
}

.library-card-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.library-card-body {
  min-width: 0;
}

.library-card-family {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #f54e00;
}

.library-card-title {
  margin: 0 0 10px;
  font-size: 1rem;
  line-height: 1.25;
}

.library-params {
  margin: 0 0 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px 12px;
}

.library-param {
  margin: 0;
}

.library-param dt {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(38, 37, 30, 0.5);
}

.library-param dd {
  margin: 2px 0 0;
  font-size: 0.88rem;
  color: #26251e;
}

.library-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
}

.library-download-btn {
  font-size: 0.88rem;
  padding: 10px 16px;
  margin-top: 4px;
}

.library-empty {
  margin: 24px 0;
  text-align: center;
  color: rgba(38, 37, 30, 0.65);
}

@media (max-width: 520px) {
  .library-card {
    grid-template-columns: 1fr;
  }

  .library-card-preview {
    max-width: 160px;
    margin: 0 auto;
  }
}

.hub-card {
  border-radius: 20px;
  border: 1px solid rgba(38, 37, 30, 0.1);
  background: #f7f7f4;
  padding: 20px;
  display: flex;
  flex-direction: column;
  min-height: 180px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hub-card:hover {
  border-color: rgba(245, 78, 0, 0.35);
  box-shadow: 0 12px 32px rgba(38, 37, 30, 0.06);
}

.hub-card-featured {
  border-color: rgba(245, 78, 0, 0.28);
  background: linear-gradient(165deg, #fffcfa 0%, #f7f7f4 100%);
  grid-column: span 1;
}

.hub-card-wide {
  width: 100%;
}

@media (min-width: 900px) {
  .hub-grid .hub-card-featured {
    grid-column: span 2;
  }
}

.hub-card-muted {
  opacity: 0.72;
}

.hub-card-muted:hover {
  box-shadow: none;
  border-color: rgba(38, 37, 30, 0.1);
}

.hub-card-kicker {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #f54e00;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hub-card-title {
  margin: 0 0 10px;
  font-size: 1.15rem;
  line-height: 1.2;
}

.hub-card-body {
  margin: 0;
  flex: 1;
  font-size: 0.92rem;
  color: rgba(38, 37, 30, 0.74);
  line-height: 1.45;
}

.hub-card-cta {
  margin-top: 16px;
  align-self: flex-start;
}

.hub-card-inline .hub-card-body {
  margin-bottom: 8px;
}

.hub-inline-link {
  align-self: flex-start;
  padding-left: 0;
}

button.button:disabled,
.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.button-back {
  display: block;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(38, 37, 30, 0.65);
  font-size: 0.88rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-align: left;
}

.button-back:hover {
  color: #f54e00;
}

.app-top-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 24px;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(38, 37, 30, 0.08);
  background: rgba(247, 247, 244, 0.92);
  backdrop-filter: blur(12px);
}

.app-top-bar-editor {
  flex-shrink: 0;
  padding-block: 12px;
}

.app-top-bar-title {
  margin: 0;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.app-top-bar-tagline {
  margin: 6px 0 0;
  max-width: 42ch;
  font-size: 0.92rem;
  color: rgba(38, 37, 30, 0.7);
}

.app-top-bar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.app-top-bar-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.app-top-bar-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button-text {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(38, 37, 30, 0.75);
  font-size: 0.9rem;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.button-text:hover {
  color: #f54e00;
  background: rgba(245, 78, 0, 0.08);
}

.mobile-tab-bar {
  display: none;
  gap: 0;
  padding: 0 16px;
  margin: 0;
  border-bottom: 1px solid rgba(38, 37, 30, 0.08);
  background: #f0efeb;
}

.mobile-tab {
  flex: 1;
  appearance: none;
  border: 0;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: rgba(38, 37, 30, 0.55);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.mobile-tab-active {
  color: #26251e;
  border-bottom-color: #f54e00;
  background: rgba(247, 247, 244, 0.6);
}

.app-body {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 320px);
  gap: 16px;
  padding: 16px 24px 20px;
  min-height: 0;
  align-items: stretch;
  overflow: auto;
}

.panel {
  border-radius: 24px;
  border: 1px solid rgba(38, 37, 30, 0.08);
  background: rgba(242, 241, 237, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(38, 37, 30, 0.08);
}

.app-main.panel-preview {
  padding: 16px 18px 22px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.app-rail.panel-controls {
  padding: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-self: start;
  max-height: calc(100dvh - 156px);
}

.rail-inner {
  padding: 14px;
  padding-bottom: max(14px, env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1;
  min-height: 0;
}

.build-card {
  border-radius: 18px;
  border: 1px solid rgba(38, 37, 30, 0.08);
  background: #f7f7f4;
  padding: 12px 12px 14px;
  margin-bottom: 12px;
}

.build-card:last-of-type {
  margin-bottom: 0;
}

.build-card-title {
  margin: 0 0 6px;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
}

.build-card-hint {
  margin: 0 0 10px;
  font-size: 0.8rem;
  color: rgba(38, 37, 30, 0.65);
  max-width: 36ch;
  line-height: 1.4;
}

.rail-field-first {
  margin-top: 0;
}

.build-card .field-group {
  margin-top: 10px;
}

.build-card .field-group.rail-field-first {
  margin-top: 0;
}

.asset-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(38, 37, 30, 0.06);
}

.asset-block:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.asset-block-secondary {
  margin-top: 16px;
}

.asset-block-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(38, 37, 30, 0.85);
}

.preview-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 16px;
}

.preview-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 0.88rem;
  color: rgba(38, 37, 30, 0.65);
  padding: 0 4px;
}

.preview-summary-sep {
  opacity: 0.45;
  user-select: none;
}

.preview-summary-filename {
  font-size: 0.82rem;
  background: rgba(38, 37, 30, 0.06);
  padding: 4px 10px;
  border-radius: 8px;
  color: #26251e;
}

.error-message-preview {
  margin: 0;
}

dialog.export-modal {
  margin: 0;
  position: fixed;
  inset: auto auto auto auto;
  width: min(360px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  padding: 0;
  border: 1px solid rgba(38, 37, 30, 0.12);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(20, 18, 11, 0.2);
  z-index: 120;
}

dialog.export-modal::backdrop {
  background: transparent;
}

.export-modal.panel {
  box-sizing: border-box;
  width: 100%;
  padding: 12px 12px 12px;
  border-radius: 14px;
  box-shadow: none;
  max-height: min(72dvh, 560px);
  overflow-y: auto;
  border: 0;
  background: #fff;
  backdrop-filter: none;
}

.export-modal-title {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.export-modal-lead {
  margin: 0 0 18px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: rgba(38, 37, 30, 0.72);
}

.export-modal-block {
  margin-bottom: 18px;
}

.export-modal-label {
  display: block;
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(38, 37, 30, 0.55);
}

.export-format-segmented {
  display: flex;
  margin: 0;
  padding: 4px;
  gap: 4px;
  border: 1px solid rgba(38, 37, 30, 0.08);
  border-radius: 14px;
  background: rgba(38, 37, 30, 0.06);
  min-width: 0;
}

.export-format-segmented legend {
  padding: 0;
}

.export-format-segment {
  flex: 1;
  appearance: none;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: rgba(38, 37, 30, 0.55);
  transition:
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.export-format-segment:hover {
  color: #26251e;
  background: rgba(255, 255, 255, 0.45);
}

.export-format-segment--active {
  background: #fdfdfc;
  color: #26251e;
  box-shadow: 0 2px 8px rgba(38, 37, 30, 0.08);
}

.export-size-dropdown {
  position: relative;
}

.export-size-dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 280px;
  box-sizing: border-box;
  appearance: none;
  border: 1px solid rgba(38, 37, 30, 0.12);
  border-radius: 14px;
  padding: 12px 14px 12px 16px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #26251e;
  background: #f7f7f4;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.export-size-dropdown-trigger:hover {
  border-color: rgba(245, 78, 0, 0.35);
  background: #fdfdfc;
}

.export-size-dropdown-trigger:focus-visible {
  outline: 2px solid rgba(245, 78, 0, 0.45);
  outline-offset: 2px;
}

.export-size-dropdown-value {
  font-variant-numeric: tabular-nums;
}

.export-size-dropdown-chevron {
  flex-shrink: 0;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid rgba(38, 37, 30, 0.45);
  border-bottom: 2px solid rgba(38, 37, 30, 0.45);
  transform: rotate(45deg);
  margin-bottom: 2px;
  transition: transform 0.2s ease;
}

.export-size-dropdown-chevron--open {
  transform: rotate(225deg);
  margin-bottom: -2px;
}

.export-size-dropdown-panel {
  margin-top: 8px;
  max-width: 320px;
  padding: 12px 12px 14px;
  border-radius: 16px;
  background: #fdfdfc;
  border: 1px solid rgba(38, 37, 30, 0.1);
  box-shadow: 0 12px 40px rgba(20, 18, 11, 0.12);
  animation: export-dropdown-in 0.2s ease-out;
}

@keyframes export-dropdown-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.export-size-dropdown-heading {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(38, 37, 30, 0.48);
}

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

.export-size-dropdown-option {
  appearance: none;
  border: 1px solid rgba(38, 37, 30, 0.1);
  border-radius: 10px;
  padding: 8px 6px;
  font-size: 0.82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #26251e;
  background: rgba(38, 37, 30, 0.03);
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.export-size-dropdown-option:hover {
  border-color: rgba(245, 78, 0, 0.35);
  background: rgba(245, 78, 0, 0.06);
}

.export-size-dropdown-option--active {
  border-color: rgba(245, 78, 0, 0.5);
  background: rgba(245, 78, 0, 0.12);
  color: #c43e00;
}

.export-size-dropdown-custom {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(38, 37, 30, 0.08);
}

.export-size-dropdown-custom-label {
  flex-shrink: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(38, 37, 30, 0.65);
}

.export-size-dropdown-custom-input {
  width: 7rem;
  max-width: 100%;
  border: 1px solid rgba(38, 37, 30, 0.12);
  border-radius: 10px;
  background: #f7f7f4;
  padding: 8px 10px;
  font-size: 0.9rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #26251e;
}

.export-size-dropdown-custom-input:focus {
  outline: 2px solid rgba(245, 78, 0, 0.25);
  border-color: rgba(245, 78, 0, 0.45);
}

.export-modal-hint {
  margin: 8px 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: rgba(38, 37, 30, 0.62);
  max-width: 42ch;
}

.export-modal-filename {
  margin: 0 0 16px;
  font-size: 0.88rem;
  color: rgba(38, 37, 30, 0.7);
}

.export-modal-filename code {
  font-size: 0.84em;
  background: rgba(38, 37, 30, 0.07);
  padding: 3px 8px;
  border-radius: 8px;
  color: #26251e;
}

.export-modal-error {
  margin: 0 0 12px;
}

.export-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.preview-summary-export-link {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: #f54e00;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.preview-summary-export-link:hover {
  color: #c43e00;
}

.rail-advanced {
  margin-top: 4px;
}

.rail-advanced-summary {
  list-style: none;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(38, 37, 30, 0.86);
  padding: 2px 0 4px;
}

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

.rail-advanced-summary::after {
  content: "▾";
  float: right;
  opacity: 0.6;
  transform: translateY(1px);
}

.rail-advanced[open] .rail-advanced-summary::after {
  content: "▴";
}

.rail-advanced-body {
  margin-top: 8px;
}

.rail-advanced .field-group label {
  font-size: 0.8rem;
}

.rail-advanced .field-help {
  font-size: 0.78rem;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(20, 18, 11, 0.45);
  cursor: pointer;
}

.drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 201;
  width: min(440px, 100vw);
  max-width: 100%;
  height: 100%;
  background: #f7f7f4;
  border-left: 1px solid rgba(38, 37, 30, 0.1);
  box-shadow: -12px 0 40px rgba(20, 18, 11, 0.12);
  display: flex;
  flex-direction: column;
  animation: drawer-in 180ms ease-out;
}

@keyframes drawer-in {
  from {
    transform: translateX(100%);
    opacity: 0.9;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(38, 37, 30, 0.08);
  flex-shrink: 0;
}

.drawer-title {
  margin: 0;
  font-size: 1.1rem;
}

.drawer-close {
  appearance: none;
  border: 0;
  background: #d8d5cd;
  color: #26251e;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.drawer-close:hover {
  background: #ebeae5;
}

.drawer-body {
  padding: 16px 18px 32px;
  overflow-y: auto;
  flex: 1;
}

.drawer-body .guidelines-panel {
  margin-top: 0;
  background: #f0efeb;
}

.colours-drawer .helper-copy {
  margin-top: 0;
}

.avatar-tool-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr minmax(260px, 340px);
  gap: 20px;
  padding: 16px 24px 24px;
  overflow: auto;
}

.avatar-preview-panel,
.avatar-controls {
  padding: 20px;
}

.avatar-panel-title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
}

.avatar-panel-hint {
  margin: 0 0 16px;
  font-size: 0.85rem;
  color: rgba(38, 37, 30, 0.65);
  max-width: 52ch;
  line-height: 1.4;
}

.avatar-preview-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  border-radius: 20px;
  padding: 28px;
}

.avatar-export-frame {
  width: 280px;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.avatar-export-frame-circle {
  border-radius: 50%;
  overflow: hidden;
}

.avatar-export-frame-square {
  border-radius: 20px;
  overflow: hidden;
}

.avatar-preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.avatar-notes-p {
  margin: 0;
  font-size: 0.88rem;
  color: rgba(38, 37, 30, 0.76);
  line-height: 1.45;
}

@media (max-width: 979px) {
  .avatar-tool-body {
    grid-template-columns: 1fr;
  }
}

.eyebrow {
  margin: 0 0 8px;
  color: #f54e00;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  text-transform: none;
}

.field-group {
  margin-top: 20px;
}

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

.field-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.82rem;
  line-height: 1.25;
  color: rgba(38, 37, 30, 0.86);
}

.field-group input,
.field-group select {
  width: 100%;
  border: 1px solid rgba(38, 37, 30, 0.12);
  border-radius: 12px;
  background: #f7f7f4;
  padding: 10px 12px;
  min-height: 42px;
  font-size: 0.9rem;
  line-height: 1.25;
  color: #26251e;
}

.field-group select {
  padding-right: 30px;
}

.field-group input:focus,
.field-group select:focus {
  outline: 2px solid rgba(245, 78, 0, 0.2);
  border-color: rgba(245, 78, 0, 0.5);
}

.field-group input[type="range"] {
  padding: 0;
  border: 0;
  background: transparent;
}

.field-help {
  margin: 6px 0 0;
  color: rgba(38, 37, 30, 0.64);
  font-size: 0.8rem;
}

.asset-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(38, 37, 30, 0.08);
}

.asset-section h2 {
  margin: 0;
  font-size: 1.05rem;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(38, 37, 30, 0.8);
}

.checkbox-label input {
  accent-color: #f54e00;
}

.notes-card {
  margin-top: 24px;
  border-radius: 18px;
  background: #ebeae5;
  padding: 18px;
}

.notes-card h2 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.notes-card ul {
  margin: 0;
  padding-left: 20px;
  color: rgba(38, 37, 30, 0.78);
}

.button-row {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: #f54e00;
  color: #14120b;
}

.button-secondary {
  background: #d8d5cd;
  color: #26251e;
}

.button-tertiary {
  background: #ebeae5;
  color: #26251e;
  border: 1px solid rgba(38, 37, 30, 0.12);
  flex: 1;
  text-align: center;
}

.helper-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(38, 37, 30, 0.08);
}

.helper-section-title {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.helper-copy {
  margin: 0 0 12px;
  color: rgba(38, 37, 30, 0.75);
  font-size: 0.95rem;
  max-width: 40ch;
}

.export-size-shortcuts {
  margin: 8px 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.export-size-shortcuts-label {
  margin: 0 0 8px;
  padding: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(38, 37, 30, 0.55);
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  appearance: none;
  border: 1px solid rgba(38, 37, 30, 0.14);
  background: #f7f7f4;
  color: #26251e;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.76rem;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.chip:hover {
  background: #f0efeb;
  border-color: rgba(245, 78, 0, 0.35);
}

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

.swatch {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(38, 37, 30, 0.12);
}

.download-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.copy-hint {
  margin: 8px 0 0;
  font-size: 0.9rem;
  color: rgba(38, 37, 30, 0.65);
}

.guidelines-panel {
  margin-top: 24px;
  padding: 18px;
  border-radius: 18px;
  background: #f0efeb;
  border: 1px solid rgba(38, 37, 30, 0.08);
}

.guidelines-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.guidelines-intro {
  margin: 0 0 14px;
  font-size: 0.92rem;
  color: rgba(38, 37, 30, 0.75);
  max-width: 48ch;
}

.guidelines-details {
  border-top: 1px solid rgba(38, 37, 30, 0.08);
  padding: 10px 0;
}

.guidelines-details summary {
  cursor: pointer;
  font-weight: 600;
  color: #26251e;
}

.guidelines-details p {
  margin: 10px 0 0;
  font-size: 0.9rem;
  color: rgba(38, 37, 30, 0.78);
  max-width: 52ch;
}

.error-message {
  color: #b83300;
  margin-top: 14px;
}

.preview-frame {
  flex: 1 1 0;
  min-height: 0;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: auto;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.2)),
    #f0efeb;
  padding: clamp(12px, 2vw, 24px);
}

/* Flex shell only - tile size uses % + aspect-ratio (cq units could compute to 0 / invalidate without a stable container). */
.preview-frame-meter {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

/* Largest square that fits: width capped by panel; height from aspect-ratio, capped by frame. */
.event-tile-fit {
  box-sizing: border-box;
  width: min(100%, 820px);
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1;
  height: auto;
  flex-shrink: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

@supports not (aspect-ratio: 1) {
  .event-tile-fit {
    position: relative;
    width: min(100%, 820px);
    height: 0;
    padding-bottom: min(100%, 820px);
    max-height: 100%;
  }

  .event-tile-fit > .event-tile {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }
}

.event-tile {
  position: relative;
  container-type: size;
  container-name: event-tile;
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border-radius: 32px;
  box-shadow: 0 40px 80px rgba(20, 18, 11, 0.18);
}

.event-tile-dark {
  box-shadow: 0 40px 80px rgba(20, 18, 11, 0.35);
}

.event-tile-noise {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(245, 78, 0, 0.08), transparent 24%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.07), transparent 18%);
  opacity: 0.8;
}

.event-tile-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: clamp(18px, 6.2cqh, 34px);
}

.event-tile-top,
.event-tile-bottom {
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.event-tile-main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1.6cqh, 16px);
  text-align: center;
  overflow: hidden;
}

.event-tile-brand {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1.2cqh, 10px);
  flex-shrink: 1;
  min-height: 0;
  max-height: 100%;
}

.event-tile-primary-asset,
.event-tile-secondary-asset {
  display: block;
  height: auto;
  max-width: 82%;
  max-height: min(112px, 20cqh, 20vmin);
  width: auto;
  object-fit: contain;
  flex-shrink: 1;
}

.event-tile-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.event-tile-title {
  margin: 0;
  font-size: clamp(1.1rem, 7.2cqw, 2.9rem);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.event-tile-eyebrow,
.event-tile-subtitle {
  margin: 0;
  font-size: clamp(0.78rem, 2.4cqw, 1rem);
  color: inherit;
  opacity: 0.72;
}

.event-tile-eyebrow {
  font-size: clamp(0.68rem, 1.9cqw, 0.9rem);
  letter-spacing: 0.02em;
  font-weight: 600;
  opacity: 0.9;
}

.event-tile-footer {
  margin: 0;
  font-size: clamp(0.72rem, 1.8cqw, 0.86rem);
  color: inherit;
  opacity: 0.58;
}

@media (max-width: 979px) {
  .app-layout--editor {
    height: auto;
    max-height: none;
    min-height: 100dvh;
    overflow: visible;
  }

  .editor-root {
    overflow: visible;
    min-height: 0;
  }

  .mobile-tab-bar {
    display: flex;
  }

  .app-body {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 16px;
    overflow: visible;
  }

  .app-body[data-mobile-tab="build"] .app-main {
    display: none;
  }

  .app-body[data-mobile-tab="preview"] .app-rail {
    display: none;
  }

  .app-main.panel-preview {
    padding: 16px;
    min-height: 50vh;
  }

  .app-rail.panel-controls {
    overflow: visible;
  }

  .rail-inner {
    overflow: visible;
    max-height: none;
  }

  .app-top-bar {
    padding: 14px 16px;
  }

  .app-top-bar-brand {
    flex: 1 1 200px;
  }

  .event-tile-fit {
    width: min(100%, 520px);
    max-width: 100%;
    max-height: min(92dvh, 640px);
    aspect-ratio: 1;
    height: auto;
  }
}

@media (max-width: 640px) {
  .field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .event-tile-content {
    padding: 36px;
  }

  .app-top-bar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .app-top-bar-buttons {
    width: 100%;
  }

  .app-top-bar-buttons .button {
    flex: 1;
  }
}

/* --- Guidelines & Colours full pages --- */

.reference-page {
  flex: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 8px 24px 48px;
}

.reference-page-top-bar .app-top-bar-tagline {
  max-width: 58ch;
}

.reference-inline-nav {
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
  font-weight: 600;
}

.reference-page-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.reference-page-source {
  margin: 0;
  font-size: 0.88rem;
  color: rgba(38, 37, 30, 0.6);
}

.reference-section {
  padding: 22px 24px 24px;
}

.reference-section--compact {
  padding-bottom: 20px;
}

.reference-section-title {
  margin: 0 0 10px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.reference-section-lead {
  margin: 0 0 16px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: rgba(38, 37, 30, 0.78);
  max-width: 65ch;
}

.reference-section-lead strong {
  color: #26251e;
}

.reference-mono-inline {
  font-size: 0.9em;
  background: rgba(38, 37, 30, 0.07);
  padding: 2px 8px;
  border-radius: 6px;
}

.reference-do-dont {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.reference-do-dont-title {
  margin: 0 0 10px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(38, 37, 30, 0.55);
}

.reference-dont .reference-do-dont-title {
  color: rgba(184, 51, 0, 0.85);
}

.reference-list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: rgba(38, 37, 30, 0.82);
}

.reference-list li + li {
  margin-top: 6px;
}

.reference-examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.reference-example-card {
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(38, 37, 30, 0.1);
}

.reference-example-card--do {
  background: rgba(61, 120, 80, 0.08);
  border-color: rgba(61, 120, 80, 0.22);
}

.reference-example-card--dont {
  background: rgba(184, 51, 0, 0.06);
  border-color: rgba(184, 51, 0, 0.2);
}

.reference-example-label {
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.reference-list--examples {
  font-size: 0.88rem;
}

.reference-keyword-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.reference-keyword-list li {
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(38, 37, 30, 0.07);
  color: #26251e;
}

.reference-photo-figure {
  margin: 0 0 20px;
}

.reference-photo-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  border: 1px solid rgba(38, 37, 30, 0.1);
}

.reference-photo-caption {
  margin: 10px 0 0;
  font-size: 0.86rem;
  color: rgba(38, 37, 30, 0.65);
  line-height: 1.4;
}

.colours-swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.colours-swatch-tile {
  appearance: none;
  border: 1px solid rgba(38, 37, 30, 0.12);
  border-radius: 14px;
  min-height: 88px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 4px;
  cursor: pointer;
  text-align: left;
  transition:
    transform 100ms ease,
    box-shadow 100ms ease;
}

.colours-swatch-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(38, 37, 30, 0.12);
}

.colours-swatch-tile--border {
  border-color: rgba(38, 37, 30, 0.18);
}

.colours-swatch-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(38, 37, 30, 0.75);
}

.colours-swatch-label--on-dark {
  color: rgba(255, 255, 255, 0.85);
}

.colours-swatch-hex {
  font-size: 0.88rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
  font-weight: 600;
  color: #26251e;
}

.colours-swatch-hex--on-dark {
  color: rgba(255, 255, 255, 0.92);
}

.colours-copy-hint {
  margin-top: 14px;
}

.colour-table-wrap {
  overflow-x: auto;
  margin: 0 -8px;
  padding: 0 8px;
}

.colour-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.colour-table th,
.colour-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(38, 37, 30, 0.08);
  vertical-align: top;
}

.colour-table th {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(38, 37, 30, 0.55);
  background: rgba(38, 37, 30, 0.04);
}

.colour-table-name {
  font-size: 0.85rem;
}

.colour-table-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
  font-size: 0.8rem;
  color: rgba(38, 37, 30, 0.75);
  white-space: nowrap;
}

.colour-table-hex-btn {
  appearance: none;
  border: 0;
  background: rgba(245, 78, 0, 0.1);
  color: #c43e00;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.colour-table-hex-btn:hover {
  background: rgba(245, 78, 0, 0.18);
}

.colours-page .reference-section-lead code {
  font-size: 0.88em;
  background: rgba(38, 37, 30, 0.07);
  padding: 2px 6px;
  border-radius: 6px;
}

.guidelines-page .reference-section.panel .button-text {
  vertical-align: baseline;
}

/* --- Event copy templates --- */

.event-templates-page.reference-page {
  max-width: 960px;
}

.event-templates-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.event-templates-section-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.event-templates-picker {
  padding: 18px 20px 20px;
}

.event-templates-top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 14px;
}

.event-templates-city-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid rgba(38, 37, 30, 0.12);
  border-radius: 12px;
  background: #fff;
}

.event-templates-city-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(38, 37, 30, 0.82);
  white-space: nowrap;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.event-templates-city-input {
  width: 200px;
  padding: 8px 12px;
  border: 1px solid rgba(38, 37, 30, 0.2);
  border-radius: 10px;
  background: #fff;
  color: #26251e;
  font: inherit;
  font-size: 0.92rem;
  transition: border-color 0.15s ease;
}

.event-templates-city-input:focus {
  outline: 2px solid rgba(245, 78, 0, 0.18);
  border-color: rgba(245, 78, 0, 0.45);
}

.event-templates-chip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.event-template-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  border-radius: 14px;
  border: 1px solid rgba(38, 37, 30, 0.1);
  background: #fdfdfc;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.event-template-chip:hover {
  border-color: rgba(245, 78, 0, 0.3);
  background: #fff;
}

.event-template-chip--active {
  border-color: rgba(245, 78, 0, 0.45);
  background: rgba(245, 78, 0, 0.06);
  box-shadow: 0 2px 12px rgba(245, 78, 0, 0.1);
}

.event-template-chip-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #26251e;
}

.event-template-chip-tagline {
  font-size: 0.78rem;
  line-height: 1.35;
  color: rgba(38, 37, 30, 0.65);
}

.event-templates-preview-block {
  padding: 18px 20px 20px;
}

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

.event-templates-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.event-templates-toast {
  margin: 0 0 10px;
  font-size: 0.86rem;
  color: rgba(38, 37, 30, 0.62);
}

.event-templates-preview {
  margin: 0;
  padding: 16px 18px;
  max-height: min(72dvh, 680px);
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #26251e;
  background: #fff;
  border-radius: 14px;
  border: 1px solid rgba(38, 37, 30, 0.14);
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
}

/* - Speaker generator - */

.speaker-generator-body {
  grid-template-columns: minmax(0, 1fr) minmax(290px, 360px);
}

.speaker-preview-panel {
  gap: 12px;
}

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

.speaker-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-active {
  border-color: rgba(245, 78, 0, 0.48);
  background: rgba(245, 78, 0, 0.08);
}

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

.speaker-preview-message {
  margin: 0;
  font-size: 0.84rem;
  color: rgba(38, 37, 30, 0.75);
}

.speaker-preview-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border-radius: 16px;
  background: rgba(38, 37, 30, 0.04);
  border: 1px solid rgba(38, 37, 30, 0.08);
  padding: 14px;
  display: grid;
  place-items: center;
}

/* --- Speaker card base (Square 1:1) --- */
.speaker-card {
  position: relative;
  width: 100%;
  max-width: 680px;
  aspect-ratio: 1 / 1;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 20px 46px rgba(20, 18, 11, 0.22);
  --speaker-name-lines: 2;
  --speaker-topic-lines: 2;
}

.speaker-card--horizontal {
  aspect-ratio: 16 / 9;
  max-width: 960px;
  --speaker-name-lines: 2;
  --speaker-topic-lines: 2;
}

.speaker-card--instagram {
  aspect-ratio: 9 / 16;
  max-width: 400px;
  --speaker-name-lines: 3;
  --speaker-topic-lines: 3;
}

/* Themes - gradients kept away from bottom-right logo zone */
.speaker-card--dark {
  background:
    radial-gradient(circle at 20% 15%, rgba(245, 78, 0, 0.22), transparent 32%),
    radial-gradient(circle at 65% 90%, rgba(245, 78, 0, 0.08), transparent 24%),
    #14120b;
  color: #edecec;
}

.speaker-card--light {
  background:
    radial-gradient(circle at 20% 15%, rgba(245, 78, 0, 0.14), transparent 32%),
    radial-gradient(circle at 65% 90%, rgba(245, 78, 0, 0.05), transparent 24%),
    #f7f7f4;
  color: #26251e;
}

.speaker-card-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 75%, rgba(255, 255, 255, 0.05), transparent 18%),
    radial-gradient(circle at 50% 50%, rgba(245, 78, 0, 0.03), transparent 40%);
  pointer-events: none;
}

/* --- Square inner layout (centered, balanced) --- */
.speaker-card-inner {
  position: relative;
  z-index: 1;
  height: 100%;
  padding: clamp(28px, 4vw, 48px);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: clamp(6px, 1.2vw, 14px);
  text-align: center;
}

.speaker-card-photo {
  width: clamp(90px, 14vw, 160px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 8px 24px rgba(20, 18, 11, 0.26);
}

.speaker-card--light .speaker-card-photo {
  border-color: rgba(38, 37, 30, 0.18);
}

.speaker-card-photo--empty {
  background: rgba(255, 255, 255, 0.08);
}

.speaker-card--light .speaker-card-photo--empty {
  background: rgba(38, 37, 30, 0.06);
}

.speaker-card-photo--empty::after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 50% 36%, rgba(255,255,255,0.22) 14%, transparent 15%),
    radial-gradient(ellipse at 50% 92%, rgba(255,255,255,0.16) 28%, transparent 29%);
}

.speaker-card--light .speaker-card-photo--empty::after {
  background:
    radial-gradient(circle at 50% 36%, rgba(38,37,30,0.12) 14%, transparent 15%),
    radial-gradient(ellipse at 50% 92%, rgba(38,37,30,0.08) 28%, transparent 29%);
}

.speaker-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.speaker-card-event {
  margin: 0;
  font-size: clamp(0.68rem, 1.1vw, 0.92rem);
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}

.speaker-card-name {
  margin: 0;
  font-size: clamp(1.5rem, 4.2vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: var(--speaker-name-lines);
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-wrap: balance;
}

.speaker-card-title {
  margin: 0;
  font-size: clamp(0.84rem, 1.4vw, 1.15rem);
  opacity: 0.75;
  font-weight: 400;
}

.speaker-card-topic {
  margin: 0;
  font-size: clamp(0.96rem, 1.7vw, 1.4rem);
  font-weight: 700;
  max-width: 22ch;
  display: -webkit-box;
  -webkit-line-clamp: var(--speaker-topic-lines);
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-wrap: balance;
}

.speaker-card-meta {
  margin: 0;
  font-size: clamp(0.74rem, 1.1vw, 0.92rem);
  opacity: 0.6;
  font-weight: 400;
}

/* Logo - flat 2D, full opacity, quiet anchor */
.speaker-card-logo {
  width: clamp(96px, 14vw, 170px);
  height: auto;
  margin-top: clamp(8px, 1.2vw, 16px);
  opacity: 0.85;
}

/* ==============================
   Horizontal 16:9 - Side-by-side
   ============================== */
.speaker-card--horizontal .speaker-card-inner {
  grid-template-columns: clamp(140px, 18%, 220px) minmax(0, 1fr);
  grid-template-rows: auto auto auto auto auto;
  grid-template-areas:
    "photo event"
    "photo name"
    "photo role"
    "photo topic"
    "photo meta";
  justify-items: start;
  align-content: center;
  text-align: left;
  padding: clamp(32px, 3.6vw, 56px) clamp(36px, 4vw, 64px);
  gap: clamp(3px, 0.5vw, 7px) clamp(28px, 3.4vw, 52px);
}

.speaker-card--horizontal .speaker-card-photo {
  grid-area: photo;
  width: clamp(110px, 12vw, 180px);
  align-self: center;
  justify-self: center;
}

.speaker-card--horizontal .speaker-card-event {
  grid-area: event;
  align-self: end;
  font-size: clamp(0.58rem, 0.8vw, 0.76rem);
  letter-spacing: 0.12em;
  margin-bottom: 2px;
}

.speaker-card--horizontal .speaker-card-name {
  grid-area: name;
  font-size: clamp(1.5rem, 3vw, 2.8rem);
  max-width: none;
}

.speaker-card--horizontal .speaker-card-title {
  grid-area: role;
  font-size: clamp(0.76rem, 1.05vw, 1rem);
}

.speaker-card--horizontal .speaker-card-topic {
  grid-area: topic;
  font-size: clamp(0.9rem, 1.4vw, 1.25rem);
  max-width: none;
  margin-top: clamp(4px, 0.5vw, 8px);
}

.speaker-card--horizontal .speaker-card-meta {
  grid-area: meta;
  font-size: clamp(0.64rem, 0.85vw, 0.78rem);
  margin-top: 2px;
}

.speaker-card--horizontal .speaker-card-logo {
  position: absolute;
  right: clamp(28px, 3.4vw, 52px);
  bottom: clamp(24px, 2.8vw, 40px);
  margin-top: 0;
  width: clamp(108px, 11vw, 180px);
  opacity: 0.75;
}

.speaker-card--horizontal .speaker-card--dark .speaker-card-overlay,
.speaker-card--horizontal.speaker-card--dark .speaker-card-overlay {
  background:
    radial-gradient(circle at 18% 20%, rgba(245, 78, 0, 0.18), transparent 28%),
    linear-gradient(to top, rgba(20, 18, 11, 0.3) 0%, transparent 18%);
}

/* =====================================
   Story 9:16 - Tall vertical, top-heavy
   ===================================== */
.speaker-card--instagram .speaker-card-inner {
  align-content: start;
  justify-items: center;
  text-align: center;
  padding: clamp(36px, 5vw, 64px) clamp(28px, 4vw, 48px);
  gap: clamp(8px, 1.6vw, 16px);
}

.speaker-card--instagram .speaker-card-photo {
  width: clamp(100px, 18vw, 160px);
  margin-bottom: 6px;
}

.speaker-card--instagram .speaker-card-event {
  font-size: clamp(0.64rem, 1vw, 0.82rem);
}

.speaker-card--instagram .speaker-card-name {
  font-size: clamp(1.8rem, 5vw, 3rem);
}

.speaker-card--instagram .speaker-card-title {
  font-size: clamp(0.84rem, 1.4vw, 1.1rem);
}

.speaker-card--instagram .speaker-card-topic {
  font-size: clamp(1rem, 2vw, 1.4rem);
  max-width: 18ch;
  margin-top: 6px;
}

.speaker-card--instagram .speaker-card-meta {
  font-size: clamp(0.72rem, 1.1vw, 0.88rem);
}

.speaker-card--instagram .speaker-card-logo {
  margin-top: auto;
  width: clamp(100px, 18vw, 160px);
  padding-top: clamp(16px, 3vw, 32px);
  opacity: 0.8;
}

.speaker-export-stage {
  position: fixed;
  left: -9999px;
  top: -9999px;
  overflow: visible;
  pointer-events: none;
  z-index: -1;
}

/* ==========================================
   Export overrides - fixed px, !important
   to beat clamp() from preview styles
   ========================================== */
.speaker-card--export {
  aspect-ratio: auto !important;
  max-width: none !important;
  border-radius: 0 !important;
}

/* --- Square export 1080x1080 --- */
.speaker-card--export-square .speaker-card-inner {
  padding: 64px !important;
  gap: 18px !important;
}
.speaker-card--export-square .speaker-card-photo {
  width: 200px !important;
}
.speaker-card--export-square .speaker-card-event {
  font-size: 16px !important;
}
.speaker-card--export-square .speaker-card-name {
  font-size: 64px !important;
}
.speaker-card--export-square .speaker-card-title {
  font-size: 22px !important;
}
.speaker-card--export-square .speaker-card-topic {
  font-size: 28px !important;
}
.speaker-card--export-square .speaker-card-meta {
  font-size: 16px !important;
}
.speaker-card--export-square .speaker-card-logo {
  width: 220px !important;
  margin-top: 20px !important;
}

/* --- Horizontal export 1920x1080 --- */
.speaker-card--export-horizontal .speaker-card-inner {
  padding: 72px 80px !important;
  gap: 10px 64px !important;
  grid-template-columns: 260px minmax(0, 1fr) !important;
}
.speaker-card--export-horizontal .speaker-card-photo {
  width: 240px !important;
}
.speaker-card--export-horizontal .speaker-card-event {
  font-size: 15px !important;
}
.speaker-card--export-horizontal .speaker-card-name {
  font-size: 60px !important;
}
.speaker-card--export-horizontal .speaker-card-title {
  font-size: 22px !important;
}
.speaker-card--export-horizontal .speaker-card-topic {
  font-size: 28px !important;
  margin-top: 8px !important;
}
.speaker-card--export-horizontal .speaker-card-meta {
  font-size: 15px !important;
}
.speaker-card--export-horizontal .speaker-card-logo {
  width: 240px !important;
  right: 72px !important;
  bottom: 56px !important;
}

/* --- Story export 1080x1920 --- */
.speaker-card--export-instagram .speaker-card-inner {
  padding: 96px 72px !important;
  gap: 24px !important;
}
.speaker-card--export-instagram .speaker-card-photo {
  width: 200px !important;
  margin-bottom: 12px !important;
}
.speaker-card--export-instagram .speaker-card-event {
  font-size: 16px !important;
}
.speaker-card--export-instagram .speaker-card-name {
  font-size: 64px !important;
}
.speaker-card--export-instagram .speaker-card-title {
  font-size: 22px !important;
}
.speaker-card--export-instagram .speaker-card-topic {
  font-size: 30px !important;
  margin-top: 10px !important;
}
.speaker-card--export-instagram .speaker-card-meta {
  font-size: 16px !important;
}
.speaker-card--export-instagram .speaker-card-logo {
  width: 220px !important;
  padding-top: 48px !important;
}
