/* FixMySTL — IlovePDF-style minimalist UX */

:root {
  --bg: #f8f9fa;
  --card-bg: #ffffff;
  --border: #e0e0e0;
  --text: #333333;
  --text-muted: #666666;
  --primary: #4a9eff;
  --primary-hover: #3a8eef;
  --secondary: #6c757d;
  --error: #dc3545;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

.page {
  padding: 24px 0 64px;
}

.container {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
}

.app {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.header-content {
  text-align: center;
}

.header h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text);
}

.tagline {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.btn-bookmark {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 0.85rem;
}

.btn-bookmark:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text);
}

.bookmark-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90%;
  width: 320px;
  padding: 1rem 2rem 1rem 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  color: var(--text);
  z-index: 1000;
}

.bookmark-toast.hidden {
  display: none;
}

.bookmark-toast p {
  margin: 0 0 0.5rem;
}

.bookmark-toast p:last-of-type {
  margin-bottom: 0;
}

.bookmark-toast .bookmark-tip {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.bookmark-toast kbd {
  padding: 0.15rem 0.4rem;
  font-family: inherit;
  font-size: 0.85em;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.bookmark-toast-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0 0.35rem;
  font-size: 1.2rem;
  line-height: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.bookmark-toast-close:hover {
  color: var(--text);
}

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  background: var(--card-bg);
  transition: border-color 0.2s, background 0.2s;
}

.dropzone.dragover {
  border-color: var(--primary);
  background: rgba(74, 158, 255, 0.05);
}

.dropzone-text {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: var(--text);
}

.dropzone-sub {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--secondary);
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background: #5a636a;
}

.btn-download {
  background: #28a745;
  color: white;
}

.btn-download:hover:not(:disabled) {
  background: #218838;
}

.btn-scale, .btn-apply {
  background: var(--primary);
  color: white;
}

.btn-scale:hover:not(:disabled),
.btn-apply:hover:not(:disabled) {
  background: var(--primary-hover);
}

/* Message */
.message {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin: 1rem 0;
}

.message.hidden {
  display: none;
}

.message.info {
  background: #e7f3ff;
  color: #004085;
  border: 1px solid #b8daff;
}

.message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Cards */
.cards {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.cards.hidden {
  display: none;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  border: 1px solid var(--border);
}

.card h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

/* Model stats */
.stat-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1.5rem;
  margin: 0;
}

.stat-list dt {
  margin: 0;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-list dd {
  margin: 0;
}

.size-warning {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.size-sanity {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.size-sanity.hidden {
  display: none;
}

.size-sanity-value {
  color: var(--text);
  margin-bottom: 0.25rem;
}

.size-sanity-status {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.size-sanity-status.size-sanity-ok {
  color: #5a7a5a;
}

.size-sanity-status.size-sanity-warn {
  color: #9a7a2e;
}

/* Preview container */
.preview-container {
  position: relative;
  width: 100%;
  height: 400px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #f0f0f0;
}

.preview-container canvas {
  display: block;
}

/* Unit toggle */
.unit-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.unit-toggle span {
  color: var(--text-muted);
}

.unit-toggle label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.unit-toggle input {
  cursor: pointer;
}

.bbox-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
}

.bbox-toggle input {
  cursor: pointer;
}

.dim-labels {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.9);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.dim-labels.hidden {
  display: none;
}

/* Scale controls */
.scale-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.scale-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.scale-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.suggestion-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: #e7f3ff;
  border: 1px solid #b8daff;
  border-radius: var(--radius);
  color: #004085;
}

.suggestion-banner.hidden {
  display: none;
}

.suggestion-text {
  flex: 1;
  min-width: 200px;
  font-size: 0.9rem;
}

.suggestion-dismiss {
  padding: 0 0.4rem;
  font-size: 1.2rem;
  line-height: 1;
  background: none;
  border: none;
  color: #004085;
  cursor: pointer;
  opacity: 0.7;
}

.suggestion-dismiss:hover {
  opacity: 1;
}

.center-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.95rem;
}

.center-toggle input {
  cursor: pointer;
}

.custom-scale {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.custom-scale label {
  font-weight: 500;
  color: var(--text);
}

.custom-scale input {
  width: 100px;
  padding: 0.5rem;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Orientation */
.orientation-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.orientation-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-orient {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

.btn-orient:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text);
}

/* Printer Fit */
.printer-fit-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.printer-select-label {
  font-weight: 500;
  color: var(--text);
}

.printer-select {
  max-width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  color: var(--text);
}

.printer-custom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.printer-custom.hidden {
  display: none;
}

.printer-custom-inputs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.printer-custom-inputs label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.printer-custom-inputs input {
  width: 70px;
  padding: 0.4rem 0.5rem;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.printer-custom-unit {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.fit-result {
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.fit-result .fit-ok {
  color: #2e7d32;
  font-weight: 500;
}

.fit-result .fit-near {
  color: #9a7a2e;
  font-weight: 500;
}

.fit-result .fit-exceed {
  color: var(--error);
  font-weight: 500;
}

.fit-details {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Model Check */
.model-check-panel {
  font-size: 0.95rem;
}

.model-check-list {
  margin-bottom: 0.75rem;
}

.model-check-warnings {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.model-check-warnings.hidden {
  display: none;
}

.model-check-warnings li {
  margin-bottom: 0.25rem;
}

/* Pre-Slicer Checks */
.pre-slicer-disclaimer {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.pre-slicer-inputs {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.pre-slicer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.pre-slicer-row label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--text);
}

.cam-select {
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
}

.pre-slicer-row input[type="number"] {
  width: 60px;
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.cam-custom-density.hidden {
  display: none;
}

.cam-custom-density input {
  width: 55px;
}

.seller-toggle {
  cursor: pointer;
}

.pre-slicer-seller {
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.pre-slicer-seller.hidden {
  display: none;
}

.cam-suggested-price {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

.pre-slicer-outputs {
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.cam-debug {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.cam-output-line {
  margin-bottom: 0.2rem;
}

.cam-output-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.cam-placeholder {
  color: var(--text-muted);
}

.cam-rough {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pre-slicer-footprint,
.pre-slicer-overhang {
  font-size: 0.9rem;
  color: var(--text);
  margin-top: 0.5rem;
}

.cam-orient-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.overhang-low { color: #2e7d32; font-weight: 500; }
.overhang-medium { color: #9a7a2e; font-weight: 500; }
.overhang-high { color: var(--error); font-weight: 500; }

/* Page title & subtitle (single H1) */
.page .container > h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text);
}

.app .header .header-content {
  display: none;
}

.app .header {
  justify-content: flex-end;
}

.subtitle {
  margin-top: 8px;
  margin-bottom: 18px;
  color: #444;
  line-height: 1.5;
  font-size: 1rem;
  max-width: 900px;
}

/* SEO section */
.seo-section {
  margin: 48px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  max-width: 900px;
}

.seo-section details {
  border: 1px solid rgba(0, 0, 0, 0.10);
  border-radius: 12px;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.02);
}

.seo-section summary {
  cursor: pointer;
  user-select: none;
  font-size: 1rem;
  outline: none;
}

.seo-section details[open] summary {
  margin-bottom: 12px;
}

.seo-section h3 {
  margin: 18px 0 8px;
  font-size: 1.05rem;
}

.seo-section p {
  margin: 0 0 12px;
  color: #444;
  line-height: 1.7;
}
