* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  color: #333;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
}

header {
  border-bottom: 1px solid #ddd;
  padding: 1rem 0;
  margin-bottom: 2rem;
}

nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
}

.nav-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.nav-app-name {
  font-family: "Orbitron", sans-serif;
  font-weight: 900;
  font-size: 1.85rem;
  letter-spacing: 0.08em;
  color: #fff;
  -webkit-text-stroke: 2px #7a8bb5;
  paint-order: stroke fill;
  transform-style: preserve-3d;
  display: inline-block;
  margin-top: -5px;
  transition: transform 0.08s ease-out;
}

.nav-brand:hover .nav-app-name {
  color: #fff;
  -webkit-text-stroke-color: #8b9dc4;
}

.nav-brand:hover {
  text-decoration: none;
}

nav a {
  text-decoration: none;
}

nav a:not(.nav-brand) {
  color: #2d3748;
  /* font-weight: bold; */
}

nav a:hover {
  /* text-decoration: underline; */
}

nav .user-info {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

nav .user-name {
  color: #666;
  font-size: 0.9rem;
}

.credits-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: default;
}

.credits-bar {
  width: 60px;
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
}

.credits-fill {
  display: block;
  height: 100%;
  background: #0066cc;
  border-radius: 3px;
  transition: width 0.2s;
}

.credits-unlimited {
  color: #0066cc;
  font-size: 1.1rem;
  font-weight: 500;
}

/* Quota tooltip */
.credits-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 100;
  pointer-events: none;
}

.credits-tooltip::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 16px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-left: 1px solid #e0e0e0;
  border-top: 1px solid #e0e0e0;
  transform: rotate(45deg);
}

.credits-wrapper:hover .credits-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.credits-tooltip-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.5rem;
}

.credits-tooltip-main {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.25rem;
}

.credits-tooltip-detail {
  font-size: 0.85rem;
  color: #666;
}

.credits-tooltip-bar {
  width: 100%;
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.credits-tooltip-bar-fill {
  height: 100%;
  background: #0066cc;
  border-radius: 2px;
  transition: width 0.2s;
}

.credits-tooltip-bar-fill.warning {
  background: #f59e0b;
}

.credits-tooltip-bar-fill.critical {
  background: #ef4444;
}

main {
  min-height: 60vh;
}

.site-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #e3e3e3;
  text-align: center;
  color: #999;
  font-size: 0.9rem;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

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

.messages {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
}

.messages li {
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: 4px;
}

.messages li.error {
  background: #fee;
  color: #c00;
}

.messages li.success {
  background: #efe;
  color: #060;
}

h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

/* Auth pages: centered panel with muted border */
.auth-panel {
  max-width: 400px;
  margin: 2rem auto;
  padding: 2rem;
  border: 1px solid #d8dce0;
  border-radius: 12px;
  background: #fafbfc;
}

.auth-panel h1 {
  margin-top: 0;
  text-align: center;
}

.auth-panel .form-group input[type="text"],
.auth-panel .form-group input[type="password"],
.auth-panel .form-group input[type="email"] {
  width: 100%;
  max-width: none;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.auth-panel .form-actions {
  margin-top: 1.25rem;
}

.auth-panel .form-actions button {
  width: 100%;
}

.auth-divider {
  margin: 1.5rem 0;
  text-align: center;
  color: #888;
  font-size: 0.9rem;
}

.auth-sso {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.auth-sso a {
  display: inline-block;
  padding: 0.5rem 1rem;
  text-align: center;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s;
}

.auth-sso a:hover {
  opacity: 0.9;
}

.auth-sso .sso-google {
  background: #fff;
  border: 1px solid #dadce0;
  color: #3c4043;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.auth-sso .sso-google::before {
  content: "";
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23EA4335' d='M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z'/%3E%3Cpath fill='%234285F4' d='M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z'/%3E%3Cpath fill='%23FBBC05' d='M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z'/%3E%3Cpath fill='%2334A853' d='M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

.auth-sso .sso-google:hover {
  background: #f8f9fa;
  border-color: #c6c9cc;
}

.auth-sso .sso-apple {
  background: #000;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.auth-sso .sso-apple::before {
  content: "";
  width: 16px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath fill='%23fff' d='M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-googlerror-90zm-61.3-137c25.2-30.8 22.7-58.9 22-68.9-21.8 1.3-47.2 14.9-61.8 32.1-16.3 18.9-26.5 42.6-24.2 68.2 23.6 1.8 46.8-11.6 64-31.4z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

.auth-sso .sso-apple:hover {
  background: #1a1a1a;
}

.auth-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e8eaed;
  text-align: center;
  font-size: 0.9rem;
  color: #666;
}

.auth-footer a {
  color: #0066cc;
  text-decoration: none;
}

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

.auth-message {
  text-align: center;
  color: #555;
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.auth-error-message {
  color: #c00;
}

.auth-panel-wide {
  max-width: 500px;
}

/* Social connections */
.social-connections {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem 0;
}

.social-connection {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.connection-provider {
  font-weight: 600;
  color: #333;
}

.connection-identity {
  flex: 1;
  color: #666;
  font-size: 0.9rem;
}

.connection-remove {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #999;
  font-size: 0.85rem;
  cursor: pointer;
}

.connection-remove:hover {
  color: #c00;
}

.connection-remove input {
  cursor: pointer;
}

h2 {
  font-size: 1.25rem;
  margin: 1.5rem 0 0.75rem;
}

.generator-page {
  width: 100%;
}

.form-and-history-row {
  display: flex;
  gap: 2rem;
  margin-bottom: 1rem;
}

.form-column {
  flex: 1;
  min-width: 0;
}

.prompt-history-column {
  width: 300px;
  flex-shrink: 0;
}

.prompt-history-title {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.prompt-history-list {
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
  font-size: 0.8rem;
  color: #888;
  background: #f8f8f8;
  padding: 0.75rem;
  border-radius: 4px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow-y: auto;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.form-group input[type="text"],
.form-group textarea {
  width: 100%;
  max-width: 500px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.form-group .prompt-input {
  max-width: none;
  min-height: 4.5em;
  resize: vertical;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  align-items: center;
}

.form-actions button,
.form-actions .btn-secondary {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.5;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  border: none;
}

.form-actions button {
  background: #0066cc;
  color: white;
}

.form-actions button:hover {
  background: #0052a3;
}

.form-actions .btn-secondary {
  background: #e0e0e0;
  color: #333;
}

.form-actions .btn-secondary:hover {
  background: #d0d0d0;
}

.status {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.views-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.view-cell {
  background: #f5f5f5;
  border-radius: 8px;
  aspect-ratio: 1;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

.views-grid.loading .view-cell {
  overflow: visible;
}

/* Output panel: glowing rotating border when loading */
.output-panel {
  border-radius: 8px;
}

@property --border-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

.output-panel::before {
  --border-angle: 0deg;
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 12px;
  padding: 4px;
  background: conic-gradient(
    from var(--border-angle),
    #06b6d4,
    #a78bfa,
    #ec4899,
    #06b6d4
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: panel-border-gradient-spin 2.5s linear infinite;
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.5))
          drop-shadow(0 0 18px rgba(6, 182, 212, 0.4))
          drop-shadow(0 0 28px rgba(236, 72, 153, 0.3));
}

.views-grid.loading .view-cell::before,
.model-viewer.loading::before {
  opacity: 1;
}

@keyframes panel-border-gradient-spin {
  to { --border-angle: 360deg; }
}

/* Panel timer: muted, bottom right */
.panel-timer {
  position: absolute;
  bottom: 0.35rem;
  right: 0.5rem;
  font-size: 0.7rem;
  color: #999;
  font-variant-numeric: tabular-nums;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.2s;
}

.views-grid.loading .view-cell .panel-timer,
.model-viewer.loading .panel-timer {
  opacity: 1;
}

.view-cell img {
  max-width: 100%;
  height: auto;
  display: none;
}

.view-cell.has-image img {
  display: block;
}

.view-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 0.875rem;
}

.view-cell.has-image .view-placeholder {
  display: none;
}

.views-grid.loading .view-placeholder {
  display: none;
}

.view-spinner {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
}

.view-spinner::after {
  content: "";
  width: 32px;
  height: 32px;
  border: 3px solid #ddd;
  border-top-color: #0066cc;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.views-grid.loading .view-spinner {
  display: flex;
}

.model-viewer {
  min-height: 600px;
  background: #f8f8f8;
  border-radius: 10px;
  /* overflow: hidden; */
  padding: 0;
  margin-top: 0.5rem;
  position: relative;
  isolation: isolate;
}

.model-viewer-actions {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 10;
  display: flex;
  gap: 0.5rem;
}

.model-viewer-actions[hidden] {
  display: none;
}

.model-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  min-width: 40px;
  height: 40px;
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}

.model-action-btn:hover {
  background: #0066cc;
  color: #fff;
  border-color: #0066cc;
  box-shadow: 0 2px 8px rgba(0,102,204,0.3);
}

.model-action-label {
  font-size: 0.875rem;
  font-weight: 500;
}

/* Format toggle switch */
.format-toggle-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.format-toggle-wrapper[hidden] {
  display: none;
}

.format-toggle {
  display: inline-flex;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 2px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.format-toggle-btn {
  padding: 0.35rem 0.75rem;
  border: none;
  background: transparent;
  color: #666;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

.format-toggle-btn:hover {
  background: #f0f0f0;
  color: #333;
}

.format-toggle-btn.active {
  background: #0066cc;
  color: #fff;
}

.format-toggle-btn.active:hover {
  background: #0052a3;
}

/* Format toggle tooltip */
.format-toggle-tooltip {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 280px;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 0.8rem;
  line-height: 1.5;
  color: #555;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-4px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 100;
  pointer-events: none;
}

.format-toggle-tooltip::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  margin-left: -5px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-left: 1px solid #e0e0e0;
  border-top: 1px solid #e0e0e0;
  transform: rotate(45deg);
}

.format-toggle-wrapper:hover .format-toggle-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.format-toggle-tooltip strong {
  color: #333;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.modal-content {
  position: relative;
  max-width: 420px;
  width: 100%;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e8eaed;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.modal-close {
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: #666;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

.modal-close:hover {
  background: #f0f0f0;
  color: #333;
}

.modal-body {
  padding: 1rem 1.5rem 1.5rem;
}

.export-options {
  list-style: none;
  margin: 0;
  padding: 0;
}

.export-options li {
  margin: 0;
}

.export-option {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 1rem;
  margin-bottom: 0.5rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, background 0.2s;
}

.export-option:last-child {
  margin-bottom: 0;
}

.export-option:hover {
  border-color: #0066cc;
  background: #f8faff;
}

.export-option-icon {
  font-size: 1.25rem;
}

.export-option-label {
  font-weight: 600;
  font-size: 1rem;
}

.export-option-desc {
  font-size: 0.85rem;
  color: #666;
}

.model-spinner {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  border-radius: 4px;
}

.model-spinner::after {
  content: "";
  width: 48px;
  height: 48px;
  border: 3px solid #ddd;
  border-top-color: #0066cc;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.model-viewer.loading .model-spinner {
  display: flex;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Download progress overlay */
.download-progress-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 248, 248, 0.92);
  z-index: 15;
  border-radius: 10px;
}

.download-progress-overlay[hidden] {
  display: none;
}

.download-progress-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem;
  max-width: 320px;
  width: 100%;
}

.download-progress-bar {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.download-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0066cc, #06b6d4);
  border-radius: 4px;
  width: 0%;
  transition: width 0.15s ease-out;
}

.download-progress-fill.indeterminate {
  width: 30%;
  animation: indeterminate-progress 1.2s ease-in-out infinite;
}

@keyframes indeterminate-progress {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

.download-progress-text {
  font-size: 0.9rem;
  color: #666;
  text-align: center;
}

.model-viewer .placeholder {
  color: #999;
  padding: 2rem;
}

.error {
  color: #c00;
  font-size: 0.9rem;
}

/* Image picker with drag-drop */
.source-images-input {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

.image-picker {
  cursor: pointer;
  outline: none;
}

.image-picker-dropzone {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 100px;
  padding: 1rem;
  background: #f8f8f8;
  border: 2px dashed #ccc;
  border-radius: 8px;
  transition: border-color 0.2s, background 0.2s;
}

.image-picker-dropzone:hover,
.image-picker-dropzone.dragover {
  border-color: #0066cc;
  background: #f0f6ff;
}

.image-picker-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  flex: 1;
  min-width: 140px;
  color: #999;
  font-size: 0.875rem;
}

.image-picker-dropzone.has-images .image-picker-placeholder {
  display: none;
}

.image-picker-hint {
  font-size: 0.75rem;
  color: #bbb;
}

.image-picker-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.image-picker-slot {
  width: 80px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  background: #e8e8e8;
  position: relative;
  flex-shrink: 0;
}

.image-picker-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-picker-slot .remove-slot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-picker-slot .remove-slot:hover {
  background: #c00;
}

/* Project cards (Your projects page) */
.project-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.project-card:hover {
  border-color: #0066cc;
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.15);
}

.project-card-thumb {
  aspect-ratio: 1;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.project-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card-placeholder {
  color: #999;
  font-size: 0.85rem;
}

.project-card-id {
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.project-card-date {
  padding: 0 0.75rem 0.5rem;
  color: #666;
  font-size: 0.8rem;
}

/* Read-only badge */
.read-only-badge {
  display: inline-block;
  padding: 0.15em 0.5em;
  margin-left: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  background: #e8e8e8;
  color: #666;
  border-radius: 4px;
}

/* Info panel (dismissable) */
.info-panel {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  background: #f0f4ff;
  border: 1px solid #c5d4f0;
  border-radius: 8px;
  position: relative;
}

.info-panel h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
}

.info-panel-content p {
  margin: 0;
  font-size: 0.9rem;
  color: #444;
  line-height: 1.5;
}

.info-panel-dismiss {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  color: #666;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.info-panel-dismiss:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #333;
}

.prompt-history-standalone {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: #f8f8f8;
  border-radius: 6px;
  max-width: 480px;
}

.prompt-history-standalone .prompt-history-title {
  display: block;
  margin-bottom: 0.25rem;
}

/* Shareable project link panel */
.project-link-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #e8f5e9 0%, #e3f2fd 100%);
  border: 1px solid #c8e6c9;
  border-radius: 8px;
}

.project-link-message {
  font-size: 0.85rem;
  font-weight: 500;
  color: #2e7d32;
}

.project-link-input-group {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.project-link-url {
  flex: 1;
  min-width: 0;
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
  color: #555;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: text;
}

.project-link-url:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.15);
}

.project-link-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.6rem;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  color: #555;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.project-link-copy:hover {
  background: #0066cc;
  border-color: #0066cc;
  color: #fff;
}

.project-link-copy.copied {
  background: #2e7d32;
  border-color: #2e7d32;
  color: #fff;
}

/* Landing page hero */
.landing-hero {
  text-align: center;
  padding: 3rem 1rem 2rem;
  max-width: 600px;
  margin: 0 auto;
}

.landing-hero h1 {
  font-size: 2.5rem;
  margin: 0 0 1rem 0;
  color: #1a1a1a;
}

.landing-subtitle {
  font-size: 1.15rem;
  color: #555;
  line-height: 1.6;
  margin: 0 0 1.5rem 0;
}

.landing-cta {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
}

.landing-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

/* Showcase section with scrolling marquee */
.showcase-section {
  margin-top: 3rem;
  padding: 2rem 0;
  background: linear-gradient(180deg, #f8f9fa 0%, #fff 100%);
  border-top: 1px solid #eee;
  overflow: hidden;
}

.showcase-section h2 {
  text-align: center;
  font-size: 1.5rem;
  margin: 0 0 1.5rem 0;
  color: #333;
}

.showcase-marquee {
  width: 100%;
  overflow: hidden;
  mask-image: linear-gradient(
    to right,
    transparent,
    black 5%,
    black 95%,
    transparent
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    black 5%,
    black 95%,
    transparent
  );
}

.showcase-track {
  display: flex;
  gap: 1.25rem;
  width: max-content;
  animation: showcase-scroll 40s linear infinite;
}

.showcase-track:hover {
  animation-play-state: paused;
}

@keyframes showcase-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.showcase-card {
  flex-shrink: 0;
  width: 200px;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.showcase-card:hover {
  transform: translateY(-4px);
  border-color: #0066cc;
  box-shadow: 0 8px 24px rgba(0, 102, 204, 0.15);
}

.showcase-card-thumb {
  aspect-ratio: 1;
  background: #f0f0f0;
  overflow: hidden;
}

.showcase-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.showcase-card:hover .showcase-card-thumb img {
  transform: scale(1.05);
}

.showcase-card-prompt {
  padding: 0.75rem;
  font-size: 0.8rem;
  color: #555;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
}

@media (max-width: 768px) {
  body {
    padding: 0.75rem 1rem;
  }

  /* Header: smaller logo and app name */
  nav {
    gap: 0.75rem;
    flex-wrap: wrap;
  }

  .nav-logo {
    width: 40px;
    height: 40px;
  }

  .nav-app-name {
    font-size: 1.1rem;
    -webkit-text-stroke-width: 1.5px;
  }

  nav .user-info {
    gap: 0.5rem;
  }

  nav .user-name {
    font-size: 0.8rem;
  }

  /* Generator page: stack prompt history below form */
  .form-and-history-row {
    flex-direction: column;
    gap: 1rem;
  }

  .prompt-history-column {
    width: 100%;
    order: 1;
  }

  .form-column {
    order: 0;
  }

  /* Views grid: 2 columns on mobile */
  .views-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Model viewer: shorter on mobile */
  .model-viewer {
    min-height: 400px;
  }

  #three-container {
    height: 400px !important;
  }

  /* Image picker adjustments */
  .image-picker-slot {
    width: 60px;
    height: 60px;
  }

  /* Landing page */
  .landing-hero h1 {
    font-size: 1.85rem;
  }
  
  .landing-subtitle {
    font-size: 1rem;
  }
  
  .showcase-card {
    width: 160px;
  }
  
  .showcase-track {
    animation-duration: 30s;
  }
}

/* Even smaller screens */
@media (max-width: 480px) {
  nav {
    gap: 0.5rem;
  }

  .nav-brand {
    gap: 0.4rem;
  }

  .nav-logo {
    width: 32px;
    height: 32px;
  }

  .nav-app-name {
    font-size: 0.95rem;
  }

  nav a:not(.nav-brand) {
    font-size: 0.85rem;
  }

  nav .user-name {
    display: none;
  }

  .credits-bar {
    width: 40px;
  }

  .credits-tooltip {
    min-width: 160px;
    right: -10px;
  }

  .credits-tooltip::before {
    right: 20px;
  }
}
