:root {
  color-scheme: dark;
  --background: #101416;
  --surface: #181e21;
  --surface-raised: #20282c;
  --surface-hover: #293338;
  --text: #f3f5f5;
  --muted: #9da9ad;
  --border: #354148;
  --input: #12181b;
  --cyan: #65bddc;
  --cyan-soft: #1d4554;
  --amber: #e2b65f;
  --green: #65c18c;
  --focus: #8cdef9;
  --radius: 10px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
}

button,
input,
select,
textarea { font: inherit; }

button,
select { cursor: pointer; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

h1,
h2,
h3,
p { margin-top: 0; }

h1,
h2,
h3 { letter-spacing: -0.025em; }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 50;
  padding: 9px 12px;
  border: 1px solid var(--focus);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text);
  transform: translateY(-180%);
  transition: transform 140ms ease;
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  border-bottom: 1px solid var(--border);
  background: linear-gradient(115deg, #182126, #161b1e 62%, #20211c);
}

.header-inner,
.app-shell {
  width: min(1600px, 100%);
  margin: 0 auto;
  padding-inline: 24px;
}

.header-inner {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand-block { min-width: 0; }

.eyebrow,
.dialog-kicker {
  margin: 0 0 7px;
  color: var(--amber);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 4px;
  font-size: clamp(27px, 3vw, 38px);
  font-weight: 600;
}

.brand-subtitle {
  margin-bottom: 0;
  color: var(--muted);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.header-button,
.social-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-raised);
  color: var(--text);
  text-decoration: none;
}

.header-button:hover,
.social-link:hover { background: var(--surface-hover); border-color: #5a6d76; }

.feedback-button { border-color: #4e9e78; background: #235c43; }
.feedback-button:hover { background: #2b7957; }

.asset-total {
  min-width: 92px;
  display: grid;
  justify-items: end;
  gap: 2px;
  margin-left: 7px;
}

.asset-total strong { color: var(--cyan); font-size: 25px; font-weight: 600; }
.asset-total span { color: var(--muted); font-size: 12px; }

.setup-notice {
  padding: 10px 24px;
  border-bottom: 1px solid #775e2c;
  background: #332a19;
  color: #f1d89f;
  text-align: center;
  font-size: 13px;
}

.app-shell { padding-top: 24px; padding-bottom: 64px; }

.intro-panel {
  min-height: 250px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(120deg, #1c282d, #1b2023 60%, #2c281e);
}

.intro-copy { padding: clamp(26px, 5vw, 56px); }

.intro-copy h2 {
  max-width: 780px;
  margin-bottom: 12px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.05;
  font-weight: 600;
}

.intro-copy > p:not(.eyebrow) {
  max-width: 680px;
  margin-bottom: 22px;
  color: #c1c9ca;
  font-size: 16px;
  line-height: 1.55;
}

.intro-meta { display: flex; flex-wrap: wrap; gap: 9px 20px; color: var(--muted); font-size: 13px; }
.intro-meta strong { color: var(--text); font-size: 16px; }

.intro-image-wrap { min-height: 250px; background: #0b0e0f; }
.intro-image { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center; opacity: 0.78; }

.category-section,
.catalog-section { margin-top: 38px; }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.section-heading h2 { margin-bottom: 0; font-size: 25px; font-weight: 600; }
.text-button { border: 0; padding: 5px 0; background: none; color: var(--cyan); }
.text-button:hover { color: var(--focus); text-decoration: underline; }

.category-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.category-card {
  min-height: 124px;
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  padding: 15px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--category-color);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.category-card:hover,
.category-card.is-selected { border-color: var(--category-color); background: var(--surface-hover); transform: translateY(-1px); }
.category-icon { font-size: 25px; line-height: 1; }
.category-card-copy { min-width: 0; display: grid; gap: 6px; }
.category-card-copy strong { font-size: 15px; }
.category-card-copy small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.category-count { position: absolute; right: 12px; bottom: 11px; color: var(--category-color); font-size: 12px; font-weight: 700; }

.catalog-heading { margin-bottom: 18px; }
.active-summary { margin: 0; color: var(--muted); font-size: 13px; text-align: right; }

.filter-bar {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(155px, 1fr)) auto auto;
  align-items: end;
  gap: 12px;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.field { min-width: 0; display: grid; gap: 7px; }
.field > span { color: var(--muted); font-size: 12px; font-weight: 600; }

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--input);
  color: var(--text);
}

input,
select { padding: 0 12px; }
textarea { min-height: 108px; padding: 10px 12px; resize: vertical; }
input::placeholder,
textarea::placeholder { color: #718087; }

.segmented { display: flex; min-height: 42px; }
.segment { flex: 1; border: 1px solid var(--border); background: var(--input); color: var(--muted); }
.segment:first-child { border-radius: 7px 0 0 7px; }
.segment:last-child { margin-left: -1px; border-radius: 0 7px 7px 0; }
.segment.is-active { z-index: 1; border-color: var(--cyan); background: var(--cyan-soft); color: var(--text); }

.clear-button,
.primary-button,
.small-button,
.dialog-actions > button {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 0 14px;
}

.clear-button:hover,
.small-button:hover,
.dialog-actions > button:hover { background: var(--surface-hover); }
.primary-button { border-color: #5eaf84; background: #236343; color: #f2fff7; }
.primary-button:hover { background: #2d7b50; }
button:disabled { cursor: default; opacity: 0.5; }

.results-line { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 15px; color: var(--muted); }
.results-line strong { color: var(--text); font-size: 16px; }

.prop-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.prop-card {
  min-width: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: 1fr auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 140ms ease, transform 140ms ease;
}

.prop-card:hover { border-color: var(--category-color); transform: translateY(-1px); }

.prop-card-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 13px;
  padding: 13px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.prop-swatch {
  min-height: 122px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  overflow: hidden;
  border-radius: 8px;
  background: radial-gradient(circle at 35% 25%, color-mix(in srgb, var(--category-color) 82%, white), var(--category-color) 44%, #101416 100%);
  color: white;
  text-shadow: 0 1px 2px #000;
}

.prop-swatch span { font-size: 30px; line-height: 1; }
.prop-swatch small { max-width: 78px; overflow: hidden; color: rgba(255,255,255,0.8); font-size: 10px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.prop-card-copy { min-width: 0; display: grid; align-content: start; gap: 8px; }
.prop-card-copy strong { font-size: 15px; line-height: 1.25; }
.prop-card-copy code { overflow: hidden; color: var(--cyan); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.prop-card-topline { display: flex; flex-wrap: wrap; gap: 5px; }
.category-pill,
.technical-pill { display: inline-flex; width: fit-content; padding: 3px 6px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.category-pill { background: color-mix(in srgb, var(--category-color) 28%, transparent); color: color-mix(in srgb, var(--category-color) 65%, white); }
.technical-pill { background: #293236; color: var(--muted); font-weight: 500; }
.prop-path { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

.prop-card-footer { min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 11px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; }
.small-button { min-height: 28px; padding: 0 8px; font-size: 11px; }

.prop-grid.list-view { grid-template-columns: 1fr; gap: 8px; }
.prop-grid.list-view .prop-card-main { grid-template-columns: 76px minmax(0, 1fr); align-items: center; }
.prop-grid.list-view .prop-swatch { min-height: 70px; }
.prop-grid.list-view .prop-card-copy { grid-template-columns: auto minmax(150px, 1.3fr) minmax(120px, 0.8fr) minmax(0, 1.3fr); align-items: center; gap: 12px; }
.prop-grid.list-view .prop-card-topline { grid-column: 1; }
.prop-grid.list-view .prop-card-copy strong { grid-column: 2; }
.prop-grid.list-view .prop-card-copy code { grid-column: 3; }
.prop-grid.list-view .prop-path { grid-column: 4; }

.empty-state { padding: 56px 24px; border: 1px dashed var(--border); border-radius: var(--radius); text-align: center; }
.empty-state p { color: var(--muted); }

dialog { max-width: min(650px, calc(100% - 24px)); border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: 0 24px 80px rgba(0,0,0,0.55); }
dialog::backdrop { background: rgba(2,5,6,0.76); backdrop-filter: blur(2px); }
.details-dialog { width: min(650px, calc(100% - 24px)); padding: 30px; }
.details-icon { width: 64px; height: 64px; display: grid; place-items: center; margin-bottom: 16px; border-radius: 12px; background: linear-gradient(145deg, var(--category-color), #101416); font-size: 32px; }
.details-dialog h2 { margin-bottom: 7px; font-size: 28px; }
.details-technical { color: var(--muted); }
.details-list { display: grid; gap: 10px; margin: 22px 0; }
.details-list div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.details-list dt { color: var(--muted); font-size: 12px; }
.details-list dd { min-width: 0; margin: 0; overflow-wrap: anywhere; color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.feedback-dialog { width: min(570px, calc(100% - 24px)); padding: 28px; }
.feedback-dialog h2 { margin-bottom: 0; font-size: 23px; }
.feedback-form { display: grid; gap: 14px; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 4px; }
.identity-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.icon-close { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: var(--surface-raised); color: var(--text); font-size: 21px; line-height: 1; }
.icon-close:hover { background: var(--surface-hover); }
.inline-close { flex: 0 0 auto; }

.toast { position: fixed; right: 22px; bottom: 22px; z-index: 20; max-width: min(380px, calc(100% - 44px)); padding: 12px 15px; border: 1px solid #4e9e78; border-radius: 8px; background: #204d39; color: #effff6; box-shadow: 0 10px 30px rgba(0,0,0,0.35); }

.not-found-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.not-found-card { width: min(520px, 100%); padding: 32px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.not-found-card p:not(.eyebrow) { color: var(--muted); }
.not-found-link { display: inline-flex; align-items: center; margin-top: 8px; text-decoration: none; }

/* Match the Ploppable Buildings catalog cards once Props turntables are installed. */
.prop-grid {
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 12px;
}

.prop-card {
  position: relative;
  min-width: 0;
  min-height: 144px;
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  gap: 14px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.prop-card:hover {
  border-color: #4d5a65;
  background: var(--surface-raised);
  transform: none;
}

.prop-grid.list-view .prop-card {
  grid-template-columns: 102px minmax(0, 1fr);
  min-height: 122px;
}

.thumbnail-button {
  width: 124px;
  height: 124px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 5px;
  overflow: hidden;
  background: #0c0f12;
}

.prop-grid.list-view .thumbnail-button {
  width: 102px;
  height: 102px;
}

.thumbnail-button img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.prop-card-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 9px;
  background: radial-gradient(circle at 35% 25%, color-mix(in srgb, var(--category-color) 82%, white), var(--category-color) 44%, #101416 100%);
  color: white;
  text-shadow: 0 1px 2px #000;
}

.prop-card-placeholder strong { font-size: 30px; line-height: 1; }
.prop-card-placeholder small { max-width: 108px; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.card-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 5px 0 0;
}

.card-meta { margin: 0 0 7px; color: var(--amber); font-size: 12px; }
.card-copy h2 { margin: 0; overflow-wrap: anywhere; font-size: 16px; font-weight: 500; }
.card-title-row { width: 100%; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.card-copy code { color: var(--muted); font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }

.copy-icon-button {
  position: relative;
  flex: none;
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
}

.copy-icon-button:hover { border-color: var(--border); background: var(--surface-hover); color: var(--text); }
.copy-icon { position: absolute; inset: 8px 7px 7px 9px; border: 1.5px solid currentColor; border-radius: 2px; }
.copy-icon::before { content: ""; position: absolute; width: 9px; height: 9px; top: -5px; left: -5px; border: 1.5px solid currentColor; border-radius: 2px; background: var(--surface); }

.card-actions { width: 100%; display: flex; justify-content: flex-end; gap: 14px; flex-wrap: wrap; margin-top: auto; padding-top: 9px; }
.suggest-button, .bug-button { min-height: 30px; padding: 0 4px; border: 0; background: transparent; font-size: 13px; }
.suggest-button { display: inline-flex; align-items: center; gap: 6px; color: var(--cyan); }
.bug-button { color: #e0bd78; }
.suggest-button:hover, .bug-button:hover { color: var(--text); }
.suggestion-ping { width: 8px; height: 8px; display: none; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(101, 193, 140, 0.16); }
.suggestion-ping.is-visible { display: inline-block; }
.suggestion-count { color: var(--text); font-size: 11px; }

.details-dialog.preview-dialog {
  width: min(920px, calc(100% - 32px));
  max-width: min(920px, calc(100% - 32px));
  padding: 12px;
}

.details-dialog.preview-dialog[open] { display: grid; grid-template-columns: minmax(320px, 1.25fr) minmax(260px, 0.75fr); gap: 12px; }
.preview-media { position: relative; min-width: 0; aspect-ratio: 1; overflow: hidden; border-radius: 5px; background: #0d1013; }
.preview-static-image, .spin-image { width: 100%; height: 100%; display: block; object-fit: contain; }
.details-placeholder { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 12px; background: radial-gradient(circle at 35% 25%, color-mix(in srgb, var(--category-color) 82%, white), var(--category-color) 44%, #101416 100%); color: white; text-align: center; text-shadow: 0 1px 2px #000; }
.details-placeholder strong { font-size: 56px; line-height: 1; }
.details-placeholder small { max-width: 80%; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.spin-viewer { position: absolute; inset: 0; overflow: hidden; cursor: grab; touch-action: none; user-select: none; }
.spin-viewer:active { cursor: grabbing; }
.spin-image { pointer-events: none; transform-origin: 50% 50%; will-change: transform; }
.spin-step { position: absolute; top: 50%; width: 38px; height: 44px; transform: translateY(-50%); border: 1px solid rgba(135, 150, 163, 0.72); border-radius: 5px; background: rgba(12, 17, 21, 0.88); color: var(--text); font-size: 28px; line-height: 1; }
.spin-previous { left: 12px; }
.spin-next { right: 12px; }
.spin-frame, .spin-demo-badge { position: absolute; border: 1px solid rgba(135, 150, 163, 0.55); border-radius: 4px; background: rgba(12, 17, 21, 0.88); color: var(--text); font-size: 12px; }
.spin-frame { right: 12px; bottom: 12px; padding: 5px 8px; }
.spin-zoom-hint { position: absolute; left: 12px; bottom: 12px; padding: 5px 8px; border: 1px solid rgba(135, 150, 163, 0.55); border-radius: 4px; background: rgba(12, 17, 21, 0.88); color: var(--muted); font-size: 11px; pointer-events: none; }
.spin-demo-badge { left: 12px; top: 12px; padding: 5px 7px; color: var(--amber); }
.spin-loading { position: absolute; left: 50%; bottom: 14px; width: 18px; height: 18px; margin-left: -9px; border: 2px solid rgba(130, 146, 158, 0.35); border-top-color: var(--cyan); border-radius: 50%; animation: spin-loading 0.8s linear infinite; }
.dialog-details { min-width: 0; display: flex; flex-direction: column; padding: 22px 14px 10px; }
.dialog-details h2 { margin-bottom: 10px; font-size: 24px; }
.preview-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 24px; }

@media (max-width: 760px) {
  .prop-grid { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
  .prop-grid.list-view .prop-card-copy { display: flex; }
  .details-dialog.preview-dialog { padding: 8px; }
  .details-dialog.preview-dialog[open] { display: block; }
  .dialog-details { padding: 16px 6px 8px; }
  .preview-actions { margin-top: 0; }
}

@media (max-width: 1260px) {
  .category-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .prop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .header-inner { align-items: start; flex-direction: column; padding-block: 20px; }
  .header-actions { justify-content: start; }
  .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-field { grid-column: 1 / -1; }
  .prop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intro-panel { grid-template-columns: 1fr; }
  .intro-image-wrap { max-height: 220px; }
}

@media (max-width: 650px) {
  .header-inner,
  .app-shell { padding-inline: 14px; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .category-card { min-height: 114px; padding: 12px; }
  .category-card-copy small { font-size: 11px; }
  .filter-bar { grid-template-columns: 1fr; padding: 13px; }
  .search-field { grid-column: auto; }
  .results-line { align-items: start; flex-direction: column; justify-content: center; gap: 4px; }
  .active-summary { text-align: left; }
  .prop-grid { grid-template-columns: 1fr; }
  .prop-grid.list-view .prop-card-copy { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
  .prop-grid.list-view .prop-card-topline,
  .prop-grid.list-view .prop-card-copy strong,
  .prop-grid.list-view .prop-card-copy code,
  .prop-grid.list-view .prop-path { grid-column: auto; }
  .intro-copy { padding: 28px 22px; }
  .intro-copy h2 { font-size: 31px; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions button { width: 100%; }
  .details-dialog,
  .feedback-dialog { padding: 22px; }
}
