/* Responsive Design Variables */
:root {
  --container-max-width: 420px;
  --container-padding: 24px;
  --border-radius: 24px;
  --font-size-base: 16px;
  --font-size-large: 1.2rem;
  --font-size-small: 0.9rem;
  --spacing-unit: 8px;
  --logo-size: 220px;
}

/* Base responsive styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: #f8f8fa;
  font-family: 'SF Pro Display', 'Segoe UI', 'Roboto', Arial, sans-serif;
  color: #222;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-base);
  line-height: 1.5;
}

.welcome-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100vw;
  min-height: 100vh;
  background: #fff;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.04);
  border-radius: var(--border-radius);
  padding: calc(var(--spacing-unit) * 4) calc(var(--spacing-unit) * 2);
  box-sizing: border-box;
  transition: box-shadow 0.3s;
}

.logo {
  width: var(--logo-size);
  max-width: 80vw;
  height: auto;
  margin-bottom: calc(var(--spacing-unit) * 4);
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.06));
}

.tagline {
  font-size: 1.4rem;
  font-weight: 400;
  margin-bottom: calc(var(--spacing-unit) * 5);
  color: #444;
  letter-spacing: 0.02em;
  text-align: center;
}

.primary-btn {
  background: linear-gradient(90deg, #e0e7ef 0%, #f3f4f6 100%);
  color: #222;
  font-size: var(--font-size-large);
  font-weight: 600;
  padding: calc(var(--spacing-unit) * 2.25) calc(var(--spacing-unit) * 6);
  border: none;
  border-radius: 32px;
  box-shadow: 0 2px 12px 0 rgba(0,0,0,0.08);
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  outline: none;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.primary-btn:hover, .primary-btn:focus {
  background: linear-gradient(90deg, #f3f4f6 0%, #e0e7ef 100%);
  box-shadow: 0 4px 16px 0 rgba(0,0,0,0.12);
  transform: translateY(-2px) scale(1.03);
}

/* Room Selection Screen */
.room-selection-container {
  max-width: var(--container-max-width);
  width: 100%;
  margin: 0 auto;
  padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 0.5) 0 calc(var(--spacing-unit) * 0.5);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  min-height: 100vh;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 16px 0 rgba(0,0,0,0.03);
  box-sizing: border-box;
  position: relative;
}

.room-selection-container h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: calc(var(--spacing-unit) * 1.25) 0 calc(var(--spacing-unit) * 0.25) 0;
  text-align: center;
  width: 100%;
}

.room-selection-container .subtitle {
  font-size: 1rem;
  color: #888;
  margin-bottom: var(--spacing-unit);
  margin-top: 0;
  text-align: center;
  width: 100%;
}

.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: calc(var(--spacing-unit) * 1.25);
  width: 100%;
  margin-bottom: calc(var(--spacing-unit) * 1.5);
}

.room-btn {
  background: #f8f8fa;
  border: none;
  border-radius: 12px;
  padding: calc(var(--spacing-unit) * 1.5) 0 calc(var(--spacing-unit) * 1) 0;
  font-size: 0.98rem;
  font-weight: 500;
  color: #222;
  box-shadow: 0 1px 4px 0 rgba(0,0,0,0.03);
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  outline: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70px;
  position: relative;
  aspect-ratio: 1;
}

.room-btn .room-icon {
  font-size: 1.4rem;
  margin-bottom: calc(var(--spacing-unit) * 0.5);
}

.add-room-btn {
  background: #f0f0f3;
  color: #444;
  font-size: 1.1rem;
  font-weight: 500;
  border: none;
  border-radius: 18px;
  padding: calc(var(--spacing-unit) * 2) 0;
  width: 100%;
  margin-top: var(--spacing-unit);
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.04);
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  min-height: 48px;
}

.add-room-btn:hover, .add-room-btn:focus {
  background: #eaeaea;
  transform: translateY(-1px) scale(1.01);
}

.back-btn {
  position: absolute;
  top: calc(var(--spacing-unit) * 2.25);
  left: calc(var(--spacing-unit) * 2.25);
  z-index: 10;
}

.back-btn:active, .back-btn:focus, .back-btn:hover {
  color: #174ea6;
  background: #e0e7ef;
}

/* Scanner Screen */
.scanner-container {
  position: relative;
  max-width: var(--container-max-width);
  width: 100%;
  margin: 0 auto;
  padding: calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 1) 0 calc(var(--spacing-unit) * 1);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  min-height: 100vh;
  background: #fff;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.04);
  box-sizing: border-box;
}

.scanner-container .back-btn {
  position: absolute;
  top: calc(var(--spacing-unit) * 2.25);
  left: calc(var(--spacing-unit) * 2.25);
  z-index: 10;
}

.scanner-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: var(--spacing-unit);
}

.room-badge {
  background: #e0e7ef;
  color: #2563eb;
  font-weight: 600;
  border-radius: 12px;
  padding: calc(var(--spacing-unit) * 0.75) calc(var(--spacing-unit) * 2);
  margin-left: calc(var(--spacing-unit) * 1.5);
  font-size: var(--font-size-small);
}

.camera-preview {
  position: relative;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 4/3;
  background: #222;
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: calc(var(--spacing-unit) * 2.25);
  box-shadow: 0 2px 12px 0 rgba(0,0,0,0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

#scanner-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 18px;
  transform: translateZ(0);
  backface-visibility: hidden;
}

#scanner-viewport {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

#scanner-viewport canvas {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

#scanner-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
}

.scan-area {
  position: absolute;
  top: 20%; left: 10%; right: 10%; bottom: 20%;
  border: 2px solid #2563eb;
  border-radius: 12px;
  box-sizing: border-box;
  z-index: 2;
}

.scan-line {
  position: absolute;
  left: 12%; right: 12%;
  top: 40%;
  height: 2px;
  background: linear-gradient(90deg, #2563eb 0%, #e0e7ef 100%);
  border-radius: 1px;
  animation: scan-move 1.2s infinite alternate;
  z-index: 3;
}

@keyframes scan-move {
  0% { top: 30%; }
  100% { top: 60%; }
}

.manual-entry {
  width: 100%;
  margin: calc(var(--spacing-unit) * 2.25) 0 var(--spacing-unit) 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.manual-entry label {
  font-size: 0.98rem;
  color: #666;
  margin-bottom: calc(var(--spacing-unit) * 0.5);
}

#manual-barcode {
  width: 100%;
  font-size: 1.1rem;
  padding: calc(var(--spacing-unit) * 1.25) calc(var(--spacing-unit) * 1.5);
  border-radius: 10px;
  border: 1px solid #e0e0e0;
  margin-bottom: var(--spacing-unit);
  box-sizing: border-box;
}

#manual-search-btn {
  align-self: flex-end;
  background: #e6f7ec;
  color: #1a7f4e;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  padding: var(--spacing-unit) calc(var(--spacing-unit) * 2.25);
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
  min-height: 40px;
}

#manual-search-btn:hover, #manual-search-btn:focus {
  background: #d2f4e3;
}

.scanner-actions {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin-top: calc(var(--spacing-unit) * 1.5);
}

#scanner-feedback {
  width: 100%;
  min-height: calc(var(--spacing-unit) * 3);
  color: #1a7f4e;
  font-size: 1.1rem;
  text-align: center;
  margin-top: var(--spacing-unit);
}

/* Product Details Screen */
.product-details-container {
  background: #fff !important;
  padding: calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 2.5) 0 calc(var(--spacing-unit) * 2.5) !important;
  box-sizing: border-box;
  max-width: var(--container-max-width);
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  min-height: 100vh;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.04);
}

.product-image-wrap {
  width: 200px;
  height: 200px;
  margin: 0 auto 8px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px auto 4px auto !important;
  padding: 0 !important;
  background: none !important;
  border-radius: 18px;
  box-shadow: none !important;
}

#product-image {
  max-width: 200px;
  max-height: 200px;
  width: 100%;
  height: auto;
  border-radius: 12px;
  object-fit: contain;
  background: #fff;
  display: block;
  margin: 0 auto;
}

#product-name {
  font-size: 1.3rem;
  font-weight: 600;
  margin: var(--spacing-unit) 0 calc(var(--spacing-unit) * 0.5) 0;
  text-align: center;
  color: #222;
  width: 100%;
}

.product-meta {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
  font-size: 1rem;
  color: #888;
  margin-bottom: var(--spacing-unit);
}

#product-code, #product-price-inline {
  flex: 1 1 0;
  font-size: 1rem;
  color: #888;
  text-align: left;
  font-weight: 500;
}

#product-price-inline {
  text-align: right;
  color: #1a7f4e;
  font-weight: 600;
}

.product-price {
  font-size: 1.08rem;
  font-weight: 600;
  color: #1a7f4e;
  margin-bottom: 8px;
  text-align: center;
  margin-bottom: var(--spacing-unit);
}

.product-description {
  font-size: 1rem;
  color: #444;
  margin-bottom: calc(var(--spacing-unit) * 1.5);
  text-align: left;
  width: 100%;
}

.product-links {
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin-bottom: calc(var(--spacing-unit) * 2);
  flex-wrap: nowrap;
  width: 100%;
  justify-content: space-between;
}

.product-links a {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  width: auto;
  justify-content: center;
  margin: 0;
  background: #f8f8fa;
  color: #2563eb;
  text-decoration: none;
  padding: 10px 0;
  border-radius: 10px;
  font-size: var(--font-size-small);
  font-weight: 500;
  transition: background 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  gap: 4px;
  border: none;
  box-shadow: none;
}

.product-links a:hover {
  background: #e0e7ef;
  transform: translateY(-1px);
  text-decoration: none;
}

.product-details-row {
  display: flex;
  flex-direction: row;
  gap: 4px;
  width: 100%;
  margin-bottom: calc(var(--spacing-unit) * 1.5);
  align-items: flex-end;
  justify-content: space-between;
}

.room-select-field {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.quantity-field {
  flex: 0 0 64px;
  width: 64px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.room-select-field label,
.room-select-field select {
  align-self: flex-start;
  text-align: left;
  margin-left: 0;
}

.quantity-field label,
.quantity-field select {
  align-self: flex-end;
  text-align: right;
}

.variant-select-row label {
  font-size: var(--font-size-small);
  color: #666;
  margin-bottom: calc(var(--spacing-unit) * 0.5);
}

#room-select, #product-quantity {
  width: 100%;
  padding: calc(var(--spacing-unit) * 1.25) calc(var(--spacing-unit) * 1.5);
  border-radius: 10px;
  border: 1px solid #e0e0e0;
  font-size: 1rem;
  background: #fff;
  margin-bottom: calc(var(--spacing-unit) * 1.5);
  min-height: 44px;
}

#room-select:focus, #product-quantity:focus {
  outline: none;
  border-color: #2563eb;
}

.annotation-field {
  width: 100%;
  margin-bottom: calc(var(--spacing-unit) * 2);
}

.annotation-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: calc(var(--spacing-unit) * 0.5);
}

.annotation-char-count {
  font-size: var(--font-size-small);
  color: #888;
}

#add-to-room-btn {
  background: linear-gradient(90deg, #e0e7ef 0%, #f3f4f6 100%);
  color: #222;
  font-size: 1.2rem;
  font-weight: 600;
  padding: 18px 48px;
  border: none;
  border-radius: 32px;
  box-shadow: 0 2px 12px 0 rgba(0,0,0,0.08);
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  outline: none;
  width: auto;
  margin-top: calc(var(--spacing-unit) * 1.5);
  min-height: 48px;
}

#add-to-room-btn:hover, #add-to-room-btn:focus {
  background: linear-gradient(90deg, #f3f4f6 0%, #e0e7ef 100%);
  box-shadow: 0 4px 16px 0 rgba(0,0,0,0.12);
  transform: translateY(-2px) scale(1.03);
}

/* Product Search Dropdown */
.product-search {
  width: 100%;
  margin-bottom: calc(var(--spacing-unit) * 1.5);
  position: relative;
}

.product-search label {
  display: block;
  font-size: var(--font-size-small);
  color: #666;
  margin-bottom: calc(var(--spacing-unit) * 0.5);
}

#product-search-input {
  width: 100%;
  padding: calc(var(--spacing-unit) * 1.25) calc(var(--spacing-unit) * 1.5);
  border-radius: 10px;
  border: 1px solid #e0e0e0;
  font-size: 1rem;
  background: #fff;
  min-height: 44px;
}

.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  z-index: 1000;
  max-height: 300px;
  overflow-y: auto;
  display: none;
  margin-top: calc(var(--spacing-unit) * 0.5);
}

.search-dropdown.visible {
  display: block;
}

.search-dropdown li {
  padding: calc(var(--spacing-unit) * 1.25) calc(var(--spacing-unit) * 1.5);
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  font-size: 1rem;
  transition: background 0.2s;
}

.search-dropdown li:last-child {
  border-bottom: none;
}

.search-dropdown li:hover, .search-dropdown li.active {
  background: #f8f8fa;
}

#product-annotation {
  width: 100%;
  padding: calc(var(--spacing-unit) * 1.25) calc(var(--spacing-unit) * 1.5);
  border-radius: 10px;
  border: 1px solid #e0e0e0;
  font-size: 1rem;
  background: #fff;
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

.top-bar {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 8px;
  min-height: 48px;
}

.top-bar .back-btn {
  position: absolute;
  left: 0;
  top: 0;
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  font-size: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.top-bar .page-logo {
  margin: 0 auto;
  display: block;
  position: relative;
  left: 0;
  right: 0;
  height: 28px;
  width: auto;
  opacity: 0.85;
}

/* Review Selection Screen */
.review-container {
  max-width: 420px;
  margin: 0 auto;
  padding: 0 4px 0 4px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  min-height: 100vh;
  background: #f5f5f5;
  border-radius: 18px;
  box-shadow: 0 2px 16px 0 rgba(0,0,0,0.03);
  box-sizing: border-box;
  position: relative;
}

.review-container .top-bar {
  width: 100%;
  padding-top: 12px;
}

.review-container h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 8px 0 2px 0;
  text-align: center;
}

.review-container .subtitle {
  display: none;
}

#review-list {
  width: 100%;
  margin-bottom: 12px;
}

.review-room-group {
  margin-bottom: 8px;
}

.review-room-group + .review-room-group {
  border-top: 1px solid #e0e0e0;
  margin-top: 8px;
}

.review-room-header {
  font-size: 1.05rem;
  font-weight: 600;
  color: #2563eb;
  margin-bottom: 2px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.review-room-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 24px;
  position: relative;
}

.review-room-items.is-empty {
  border: 1.5px dashed #d4d4d4;
  border-radius: 14px;
  padding: 18px 14px;
  background: #f9fafb;
}

.review-room-items.is-empty::after {
  content: 'Hold and drag items here';
  text-align: center;
  display: block;
  width: 100%;
  font-size: 0.92rem;
  color: #6b7280;
}

.review-product-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px 0 rgba(0,0,0,0.07);
  margin-bottom: 4px;
  padding: 14px 52px 14px 14px;
  display: grid;
  grid-template-columns: minmax(96px, 110px) 1fr;
  grid-auto-rows: auto;
  column-gap: 14px;
  align-items: start;
  position: relative;
  transition: transform 0.12s ease;
}

.review-product-card:active {
  transform: scale(0.99);
}

.review-product-thumb-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  min-width: 96px;
  position: relative;
  grid-column: 1;
  grid-row: 1 / -1;
}

.review-product-thumb {
  width: 96px;
  height: 96px;
  border-radius: 12px;
  object-fit: cover;
  background: #fff;
}

.review-product-info {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.review-product-title {
  font-size: 0.94rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.3;
  margin-bottom: 0;
}

.review-product-meta {
  font-size: 0.85rem;
  color: #374151;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  column-gap: 16px;
  align-items: center;
  width: 100%;
  margin-top: 2px;
}

.review-product-code {
  font-weight: 500;
  overflow: visible;
  white-space: normal;
  word-break: break-all;
  line-height: 1.3;
}

.review-product-qty {
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  justify-self: end;
  font-size: 0.88rem;
}

.review-product-price {
  font-size: 0.88rem;
  color: #1f2937;
  font-weight: 600;
  white-space: nowrap;
  justify-self: end;
}

.review-product-notes {
  grid-column: 1 / -1;
  font-size: 0.88rem;
  color: #4b5563;
  margin-top: 8px;
  padding-right: 48px;
  line-height: 1.4;
  word-break: break-word;
}

.review-edit-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  color: #4b5563;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.review-edit-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.review-edit-btn:active {
  transform: scale(0.97);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
  background: #e5e7eb;
}

.review-card-ghost {
  opacity: 0.22;
}

.review-card-chosen {
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.16);
}

.review-card-dragging {
  opacity: 0.9;
}

.product-actions-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
}

.product-actions-row .destructive-secondary {
  min-height: 48px;
  padding: 12px 18px;
  font-size: 0.92rem;
  color: #b91c1c;
  border-color: #fecaca;
  background: #ffffff;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
}

.product-actions-row .destructive-secondary[style*="display: block"],
.product-actions-row .destructive-secondary:not([style*="display: none"]) {
  display: inline-flex;
  margin-right: auto;
}

.product-actions-row .primary-btn {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 12px 34px;
  white-space: nowrap;
}

.destructive-secondary {
  background: #fef2f2;
  color: #b91c1c;
  border: 2px solid #ef4444;
  font-weight: 600;
  transition: all 0.2s;
}

.destructive-secondary:hover, .destructive-secondary:focus {
  background: #fee2e2;
  border-color: #dc2626;
  color: #991b1b;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.destructive-primary {
  background: #ef4444;
  color: #fff;
  border: 2px solid #ef4444;
  border-radius: 10px;
  padding: 10px 24px;
  min-height: 44px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.destructive-primary:hover, .destructive-primary:focus {
  background: #dc2626;
  border-color: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.delete-modal-content {
  max-width: 360px;
  padding: 32px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.delete-modal-title {
  margin: 0;
  font-size: 1.2rem;
  color: #111827;
}

.delete-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.review-actions {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: stretch;
  gap: 12px;
  margin-top: 48px;
  margin-bottom: 18px;
  padding: 0 8px;
}

.secondary-btn {
  background: #f3f4f6;
  color: #2563eb;
  font-size: 1rem;
  font-weight: 500;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 10px 24px;
  min-height: 44px;
  box-shadow: 0 1px 4px 0 rgba(0,0,0,0.03);
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
}

.secondary-btn:hover, .secondary-btn:focus {
  background: #e0e7ef;
  border-color: #2563eb;
  transform: translateY(-1px);
}

.empty-state {
  color: #888;
  font-size: 1rem;
  text-align: center;
  margin-top: 18px;
}

.review-product-description-full {
  display: none;
}

.review-qty-pill {
  display: flex;
  align-items: center;
  background: none;
  border: 1.5px solid #bbb;
  border-radius: 999px;
  box-shadow: none;
  padding: 0 6px;
  gap: 2px;
  min-width: 48px;
  min-height: 24px;
  font-size: 0.98rem;
  font-weight: 500;
  margin: 4px 0 0 0;
  position: absolute;
  left: 0;
  bottom: -10px;
}

.review-qty-btn {
  background: none;
  border: none;
  color: #111;
  font-size: 1.4rem;
  font-weight: bold;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}

.review-qty-btn:active {
  background: #ededed;
}

.review-qty-btn.delete {
  color: #111;
  font-size: 1.6rem;
}

.review-qty-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}

.review-qty-value {
  min-width: 16px;
  text-align: center;
  font-size: 1rem;
  font-weight: 500;
}

.clear-selection-btn {
  font-size: 14pt;
  padding: 10px 20px;
  background: #fff0f0;
  color: #b91c1c;
  border-radius: 32px;
  width: auto;
  min-width: 120px;
  border: none;
  box-shadow: none;
  font-weight: 600;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  cursor: pointer;
}

.clear-selection-btn:hover, .clear-selection-btn:focus {
  background: #ffe5e5;
  color: #a00;
  transform: translateY(-2px) scale(1.03);
}

.seima-contact-btn {
  background: #a09484;
  border: none;
  color: #fff;
  font-size: 14pt;
  padding: 10px 20px;
  border-radius: 32px;
  cursor: pointer;
  font-weight: 600;
  min-width: 120px;
  box-shadow: 0 2px 12px 0 rgba(0,0,0,0.08);
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
}

.seima-contact-btn:hover, .seima-contact-btn:focus {
  background: #8f8373;
  box-shadow: 0 4px 16px 0 rgba(0,0,0,0.12);
  transform: translateY(-2px) scale(1.03);
}

.logo {
  width: var(--logo-size);
  max-width: 80vw;
  height: auto;
  margin-bottom: calc(var(--spacing-unit) * 4);
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.06));
  display: block;
  opacity: 0.85;
  align-self: center;
}

.scanner-container .page-logo,
.room-selection-container .page-logo {
  height: 32px;
  width: auto;
  margin: 24px auto 12px auto;
}

/* Modal styles */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  padding: 32px 24px 24px 24px;
  max-width: 90vw;
  min-width: 260px;
  box-shadow: 0 8px 32px 0 rgba(0,0,0,0.18);
  text-align: left;
}

.modal-actions {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  margin-top: 20px;
}

.form-field {
  margin-bottom: 15px;
}

.form-label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #333;
}

.form-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

.form-options {
  margin: 12px 0 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.checkbox-label input {
  margin-right: 8px;
}

.checkbox-label span {
  font-size: 1.05rem;
  color: #222;
}

.status-message {
  margin-bottom: 15px;
  padding: 10px;
  border-radius: 4px;
}

.file-drop-zone {
  border: 2px dashed #ccc;
  padding: 40px;
  text-align: center;
  margin: 20px 0;
  border-radius: 8px;
  background: #fafafa;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.file-drop-zone:hover {
  border-color: #2563eb;
  background: #f0f7ff;
}

.file-info {
  margin: 10px 0;
  padding: 10px;
  background: #e8f5e8;
  border-radius: 4px;
}

.import-options {
  margin: 20px 0;
}

.import-option {
  display: block;
  margin-bottom: 15px;
  cursor: pointer;
  padding: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  transition: background 0.2s;
}

.import-option:hover {
  background: #f8f8fa;
}

.import-option input {
  margin-right: 8px;
}

.warning-message {
  margin: 15px 0;
  padding: 15px;
  background: #fee;
  border: 1px solid #fcc;
  border-radius: 4px;
  color: #c33;
}

.processing-step {
  text-align: center;
  padding: 40px 20px;
}

.pdf-spinner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  border: 6px solid #e0e0e0;
  border-top: 6px solid #059669;
  border-radius: 50%;
  width: 54px;
  height: 54px;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.not-found-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #ddd;
  padding: 10px;
  border-radius: 4px;
  background: #fafafa;
}

.page-logo {
  height: 28px;
  width: auto;
  display: block;
  margin: 0 auto;
  opacity: 0.85;
  align-self: center;
}

.product-details-container, .review-container, .scanner-container, .room-selection-container {
  align-items: flex-start !important;
  justify-content: flex-start !important;
}

.row-actions-responsive {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 0 8px 0;
  width: 100%;
  padding: 0 8px;
}

.small-btn {
  font-size: 1rem;
  padding: 10px 22px;
  min-width: 0;
  min-height: 44px;
  border-radius: 10px;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.07);
  font-weight: 600;
  letter-spacing: 0.01em;
  flex: 1 1 0;
}

.left-btn {
  margin-right: 0;
}

.right-btn {
  margin-left: 0;
}

.secondary-btn.small-btn {
  background: #fff;
  color: #2563eb;
  border: 2px solid #2563eb;
  transition: background 0.2s, color 0.2s;
}

.secondary-btn.small-btn:hover, .secondary-btn.small-btn:focus {
  background: #2563eb;
  color: #fff;
}

.primary-btn.small-btn {
  background: #2563eb;
  color: #fff;
  border: 2px solid #2563eb;
  transition: background 0.2s, color 0.2s;
}

.primary-btn.small-btn:hover, .primary-btn.small-btn:focus {
  background: #174ea6;
  color: #fff;
}

.cancel-btn {
  min-width: 70px;
  font-size: 0.98rem;
  padding: 8px 0;
  border-radius: 8px;
  margin-right: auto;
  color: #2563eb;
  background: #fff;
  border: none;
  box-shadow: none;
  text-align: left;
}

.send-btn {
  min-width: 120px;
  font-size: 1.08rem;
  padding: 10px 0;
  border-radius: 10px;
  margin-left: auto;
  background: #2563eb;
  color: #fff;
  border: none;
  font-weight: 600;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.07);
  text-align: center;
}

/* Responsive Breakpoints */
@media (min-width: 1200px) {
  :root {
    --container-max-width: 600px;
    --container-padding: 32px;
    --border-radius: 32px;
    --font-size-base: 18px;
    --font-size-large: 1.3rem;
    --font-size-small: 1rem;
    --spacing-unit: 10px;
    --logo-size: 280px;
  }
  
  .welcome-container {
    max-width: 800px;
    padding: calc(var(--spacing-unit) * 6) calc(var(--spacing-unit) * 4);
  }
  
  .room-selection-container,
  .scanner-container,
  .product-details-container,
  .review-container {
    max-width: var(--container-max-width);
  }
  
  .room-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: calc(var(--spacing-unit) * 2);
  }
  
  .camera-preview {
    max-width: 500px;
    aspect-ratio: 16/9;
  }
  
  .product-image-wrap {
    width: 200px;
    height: 200px;
  }
  
  #product-image {
    max-width: 200px;
    max-height: 200px;
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  :root {
    --container-max-width: 500px;
    --container-padding: 28px;
    --border-radius: 28px;
    --font-size-base: 17px;
    --font-size-large: 1.25rem;
    --font-size-small: 0.95rem;
    --spacing-unit: 9px;
    --logo-size: 250px;
  }
  
  .welcome-container {
    max-width: 600px;
    padding: calc(var(--spacing-unit) * 5) calc(var(--spacing-unit) * 3);
  }
  
  .room-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: calc(var(--spacing-unit) * 1.5);
  }
  
  .camera-preview {
    max-width: 400px;
  }
  
  .product-image-wrap {
    width: 180px;
    height: 180px;
  }
  
  #product-image {
    max-width: 180px;
    max-height: 180px;
  }
}

@media (min-width: 481px) and (max-width: 767px) {
  :root {
    --container-max-width: 450px;
    --container-padding: 24px;
    --border-radius: 24px;
    --font-size-base: 16px;
    --font-size-large: 1.2rem;
    --font-size-small: 0.9rem;
    --spacing-unit: 8px;
    --logo-size: 220px;
  }
  
  .welcome-container {
    max-width: 500px;
    padding: calc(var(--spacing-unit) * 4) calc(var(--spacing-unit) * 2);
  }
  
  .room-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: calc(var(--spacing-unit) * 1.25);
  }
  
  .camera-preview {
    max-width: 360px;
  }
  
  .product-details-row {
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 1.5);
  }
  
  .room-select-field,
  .quantity-field {
    min-width: 100%;
  }
}

@media (max-width: 600px) {
  html, body {
    width: 100vw;
    min-height: 100vh;
    height: auto;
    margin: 0;
    padding: 0;
    background: #f4f6f9;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-padding-top: 32px;
  }
  
  .scanner-container {
    max-width: none;
    width: 100vw;
    min-height: 100vh;
    height: 100vh;
    border-radius: 0;
    box-shadow: none;
    padding: 0 0 32px 0;
    background: #f4f6f9;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  .scanner-header {
    width: 100vw;
    padding: 24px 18px 0 18px;
    background: #f4f6f9;
    box-sizing: border-box;
  }
  
  .camera-preview {
    max-width: none;
    width: 94vw;
    height: 60vw;
    min-height: 240px;
    max-height: 60vh;
    border-radius: 18px;
    margin: 24px 0 18px 0;
    box-shadow: 0 4px 24px 0 rgba(0,0,0,0.10);
    background: #fff;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
  }
  
  #scanner-viewport {
    width: 100% !important;
    height: 100% !important;
    min-height: 240px;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 18px !important;
    background: #222;
    display: block;
    transform: translateZ(0) !important;
    backface-visibility: hidden !important;
    perspective: 1000px !important;
  }
  
  #scanner-overlay {
    border-radius: 18px;
    pointer-events: none;
  }
  
  .product-search, .scanner-actions, #scanner-feedback {
    padding-left: 18px;
    padding-right: 18px;
  }
  
  .product-search {
    margin-top: 18px;
  }
  
  .scanner-actions {
    margin-top: 18px;
  }
  
  #scanner-feedback {
    margin-top: 12px;
  }
  
  .product-details-container {
    max-width: none;
    width: 100vw;
    min-height: 100vh;
    height: 100vh;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
    padding: 0 0 24px 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  
  .product-image-wrap {
    width: 140px;
    height: 140px;
    margin-bottom: 6px;
  }
  
  #product-image {
    max-width: 140px;
    max-height: 140px;
  }
  
  .annotation-field, .room-select-field, .quantity-field {
    width: 92vw;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .product-links {
    width: 92vw;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .product-actions-row {
    width: 92vw;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .room-selection-container {
    max-width: none;
    width: 100vw;
    min-height: 100vh;
    height: 100vh;
    border-radius: 0;
    box-shadow: none;
    padding: 0 0 32px 0;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  .room-grid {
    width: 94vw;
    margin-left: auto;
    margin-right: auto;
  }
  
  .add-room-btn {
    width: 94vw;
    margin-left: auto;
    margin-right: auto;
  }
  
  .room-selection-container h2, .room-selection-container .subtitle {
    padding-left: 18px;
    padding-right: 18px;
    text-align: center;
  }
  
  .review-container {
    max-width: none;
    width: 100vw;
    min-height: unset;
    height: auto;
    border-radius: 0;
    box-shadow: none;
    padding: 16px 8px 24px 8px;
    background: #f4f6f9;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    overflow-y: visible;
    margin-top: 0;
    padding-top: 0;
  }
  
  .review-actions {
    width: 100%;
    display: flex;
    flex-direction: row !important;
    justify-content: space-between;
    gap: 8px;
    margin-top: 24px;
    margin-bottom: 12px;
    padding: 0 8px;
  }
  
  .back-btn {
    font-size: 1.2rem;
    margin-top: 8px;
    margin-bottom: 8px;
    padding: 0 0 0 2px;
    min-width: 0;
    min-height: 0;
    width: auto;
    height: auto;
  }
  
  .review-container h2 {
    margin-top: 12px;
  }
  
  .row-actions-responsive {
    flex-direction: row !important;
    gap: 8px;
    margin: 0 0 6px 0;
    padding: 0 8px;
  }
  
  .small-btn {
    font-size: 1rem;
    padding: 10px 16px;
    min-width: 0;
    min-height: 44px;
    border-radius: 10px;
    flex: 1 1 0 !important;
    max-width: none;
  }
  
  .cancel-btn {
    min-width: 54px;
    font-size: 0.95rem;
    padding: 7px 0;
  }
  
  .send-btn {
    min-width: 90px;
    font-size: 1rem;
    padding: 8px 0;
  }
}

@media (max-width: 480px) {
  :root {
    --container-max-width: 100vw;
    --container-padding: 16px;
    --border-radius: 0;
    --font-size-base: 15px;
    --font-size-large: 1.1rem;
    --font-size-small: 0.85rem;
    --spacing-unit: 6px;
    --logo-size: 180px;
  }
  
  body {
    font-size: var(--font-size-base);
  }
  
  .welcome-container {
    max-width: 100vw;
    border-radius: 0;
    padding: calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 2);
    min-height: 100vh;
  }
  
  .room-selection-container,
  .scanner-container,
  .product-details-container,
  .review-container {
    max-width: 100vw;
    border-radius: 0;
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 1.5);
  }
  
  .room-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: calc(var(--spacing-unit) * 1.25);
  }
  
  .room-btn {
    min-height: 80px;
    font-size: 0.9rem;
  }
  
  .room-btn .room-icon {
    font-size: 1.2rem;
  }
  
  .camera-preview {
    max-width: 100%;
    aspect-ratio: 4/3;
    border-radius: 12px;
  }
  
  .product-image-wrap {
    width: 140px;
    height: 140px;
    margin-bottom: 6px;
  }
  
  #product-image {
    max-width: 140px;
    max-height: 140px;
  }
  
  .product-details-row {
    flex-direction: row;
    gap: calc(var(--spacing-unit) * 1);
    flex-wrap: nowrap;
  }
  
  .room-select-field,
  .quantity-field {
    max-width: 50%;
  }
  
  .product-links {
    flex-direction: row;
    gap: calc(var(--spacing-unit) * 1);
  }
  
  .product-links a {
    width: auto;
    min-width: 60px;
    font-size: var(--font-size-small);
  }
  
  .back-btn {
    top: calc(var(--spacing-unit) * 1.5);
    left: calc(var(--spacing-unit) * 1.5);
    font-size: 1.8rem;
    min-width: 40px;
    min-height: 40px;
    width: 40px;
    height: 40px;
  }
  
  .primary-btn,
  .secondary-btn {
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 4);
    font-size: var(--font-size-large);
    min-height: 44px;
  }
  
  .scanner-actions {
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 1);
  }
  
  .review-actions {
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 1);
  }
  
  .review-product-card {
    grid-template-columns: minmax(88px, 104px) 1fr;
    padding: calc(var(--spacing-unit) * 2.3) calc(var(--spacing-unit) * 4) calc(var(--spacing-unit) * 2.3) calc(var(--spacing-unit) * 1.8);
  }
  
  .review-product-thumb-wrap {
    grid-row: 1 / -1;
  }
  
  .review-product-info {
    text-align: left;
  }
}

@media (max-width: 320px) {
  :root {
    --spacing-unit: 5px;
    --logo-size: 150px;
  }
  
  .welcome-container {
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 1);
  }
  
  .room-selection-container,
  .scanner-container,
  .product-details-container,
  .review-container {
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 1);
  }
  
  .room-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .room-btn {
    min-height: 60px;
    font-size: 0.85rem;
  }
  
  .primary-btn,
  .secondary-btn {
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 3);
    font-size: 1rem;
  }
}

@media (orientation: landscape) and (max-height: 600px) {
  .welcome-container {
    min-height: 100vh;
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 3);
  }
  
  .room-selection-container,
  .scanner-container,
  .product-details-container,
  .review-container {
    min-height: 100vh;
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 2);
  }
  
  .logo {
    margin-bottom: calc(var(--spacing-unit) * 2);
  }
  
  .tagline {
    margin-bottom: calc(var(--spacing-unit) * 2);
  }
  
  .camera-preview {
    max-height: 40vh;
    aspect-ratio: 16/9;
  }
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .logo {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
  
  #product-image {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .scan-line {
    animation: none;
  }
}

@media (prefers-contrast: high) {
  :root {
    --border-radius: 0;
  }
  
  .primary-btn,
  .secondary-btn,
  .room-btn {
    border: 2px solid #000;
  }
  
  .product-links a {
    border: 1px solid #000;
  }
}

@media print {
  .back-btn,
  .scanner-actions,
  .review-actions,
  .product-search {
    display: none !important;
  }
  
  .welcome-container,
  .room-selection-container,
  .scanner-container,
  .product-details-container,
  .review-container {
    box-shadow: none;
    border-radius: 0;
    max-width: none;
    width: 100%;
  }
}
