:root {
  --bg: #0c0f14;
  --surface: #151922;
  --border: #252b36;
  --text: #e6eaf0;
  --text-muted: #8b95a5;
  --accent: #5b7cff;
  --accent-hover: #7b94ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "DM Sans", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.back-nav {
  margin-bottom: 1.5rem;
}

.back-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.back-nav a:hover {
  color: var(--accent);
}

.header {
  margin-bottom: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.logo-icon {
  font-size: 1.5rem;
}

.header h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0;
  font-size: 1rem;
  color: var(--text-muted);
}

.main {
  flex: 1;
}

.upload-section {
  margin-bottom: 2rem;
}

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 1rem;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: rgba(91, 124, 255, 0.06);
}

.upload-content {
  transition: opacity 0.2s;
}

.upload-content.hidden {
  display: none;
}

.upload-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.upload-zone h2 {
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.upload-zone p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.upload-preview {
  width: 100%;
}

.upload-preview.hidden {
  display: none;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
}

.preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-item .preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.preview-item .preview-remove:hover {
  background: #dc2626;
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: background 0.2s, opacity 0.2s;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text);
}

.results-section {
  margin-top: 1rem;
}

.results-header {
  margin-bottom: 1.25rem;
}

.results-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.results-actions {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.btn-new-estimate {
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
}

.results-grid {
  display: grid;
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}

.card-hero {
  text-align: center;
  padding: 1.5rem;
}

.unit-badge {
  display: inline-block;
  background: rgba(91, 124, 255, 0.2);
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
  font-size: 1.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.card h3,
.card h4 {
  margin: 0 0 0.75rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cubic-feet {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.25rem;
  margin: 0.25rem 0;
}

.unit-dims {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.item-list,
.suggestion-list,
.amenity-list {
  margin: 0;
  padding-left: 1.25rem;
  list-style: disc;
}

.item-list li,
.suggestion-list li,
.amenity-list li {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.category {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  margin-right: 0.5rem;
}

.category.furniture {
  background: rgba(91, 124, 255, 0.2);
  color: var(--accent);
}

.category.box {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.category.appliance {
  background: rgba(234, 179, 8, 0.2);
  color: #eab308;
}

.confidence-badge {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.loading-section {
  text-align: center;
  padding: 3rem 1rem;
}

.loader {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

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

.loading-section p {
  margin: 0;
  color: var(--text-muted);
}

.error-section {
  text-align: center;
  padding: 2rem;
}

.error-message {
  color: #f87171;
  margin: 0 0 1rem 0;
}

