body {
  margin: 0;
  font-family: 'Roboto', sans-serif;
  background: linear-gradient(180deg, #f6f3ff 0%, #f3f6fb 35%, #eef2f8 100%);
  color: #1f2937;
}

.app-bar {
  background: #6750a4;
}

.content {
  max-width: 900px;
  margin: 0 auto;
  padding: 96px 16px 32px;
}

.hero-card,
.form-card,
.item-card,
.empty-card,
.list-overview-card {
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 20px;
}

.item-card {
  padding: 14px 16px;
  border-radius: 18px;
}

.hero-card {
  background: linear-gradient(135deg, #6750a4, #7f67be);
  color: white;
  box-shadow: 0 18px 40px rgba(103, 80, 164, 0.22);
}

.hero-copy h1 {
  margin: 0 0 8px;
  font-size: 2rem;
}

.hero-copy p {
  margin: 0;
  color: rgba(255,255,255,0.88);
}

.form-card {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 16px 40px rgba(31, 41, 55, 0.08);
}

.stats-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  background: rgba(255,255,255,0.94);
  box-shadow: 0 14px 30px rgba(31, 41, 55, 0.08);
}

.stats-card-simple {
  grid-template-columns: 1fr;
}

.stat-pill {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(103, 80, 164, 0.08), rgba(127, 103, 190, 0.14));
}

.stat-pill .material-icons {
  color: #6750a4;
}

.stat-pill strong,
.stat-pill span {
  display: block;
}

.stat-pill strong {
  font-size: 1.15rem;
}

.stat-pill span {
  color: #6b7280;
  font-size: 0.92rem;
}

.top-actions-card {
  display: grid;
  gap: 16px;
}

.field-group-wide {
  grid-column: 1 / span 2;
}

.quantity-group {
  grid-column: auto;
}

.input-shell-with-action {
  padding-right: 8px;
}

.quantity-input-shell {
  justify-content: space-between;
}

.quantity-input-shell input {
  text-align: center;
}

.icon-action-button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: #ede9fe;
  color: #5b43a5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
}

.subtle-action-button {
  background: #f3f4f6;
  color: #6b7280;
}

.scanner-modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 2000;
}

.scanner-modal.hidden {
  display: none;
}

.scanner-modal-card {
  width: min(100%, 720px);
  background: #ffffff;
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 24px 60px rgba(17, 24, 39, 0.28);
}

.scanner-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.scanner-header h2 {
  margin: 0 0 6px;
}

.scanner-header p {
  margin: 0;
  color: #6b7280;
}

.scanner-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.scanner-video-wrap {
  background: #111827;
  border-radius: 20px;
  overflow: hidden;
  min-height: 220px;
}

.barcode-video {
  width: 100%;
  display: block;
  background: #111827;
}

.scanner-status {
  margin: 0;
  color: #5b43a5;
  font-weight: 500;
}

.scanner-hint {
  margin: 0;
  color: #b45309;
  font-size: 0.95rem;
}

.scanner-result,
.scanner-name-fallback,
.manual-barcode-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.scanner-result {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.7);
}

.scanner-result.hidden,
.scanner-name-fallback.hidden {
  display: none;
}

.scanner-result p {
  margin: 0;
}

.scanner-name-fallback .inline-input,
.manual-barcode-form .inline-input {
  flex: 1 1 240px;
}

.item-form {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr 1fr auto;
  gap: 16px;
  align-items: end;
}

.item-form.single-row {
  grid-template-columns: 1fr auto;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-group label,
.share-box label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #4b5563;
  padding-left: 4px;
  display: block;
  margin-bottom: 8px;
}

.input-shell {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid #d7dbe7;
  border-radius: 18px;
  padding: 0 16px;
  min-height: 60px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.65), 0 6px 18px rgba(103, 80, 164, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.input-shell:focus-within,
.inline-input:focus,
.share-input:focus {
  border-color: #6750a4;
  box-shadow: 0 0 0 4px rgba(103, 80, 164, 0.12), 0 10px 24px rgba(103, 80, 164, 0.12);
  transform: translateY(-1px);
  outline: none;
}

.input-icon {
  color: #7c6bb3;
  font-size: 22px;
}

.field-group input,
.inline-input,
.share-input {
  width: 100%;
  box-sizing: border-box;
  font-size: 1rem;
  color: #111827;
}

.field-group input {
  border: 0;
  padding: 18px 0;
  background: transparent;
}

.field-group input::placeholder {
  color: #9ca3af;
}

.field-group input:focus {
  outline: none;
}

.inline-input,
.share-input {
  border: 1px solid #d7dbe7;
  border-radius: 16px;
  padding: 14px 16px;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.add-button {
  height: 60px;
  border-radius: 18px;
  background: linear-gradient(135deg, #6750a4, #7f67be) !important;
  box-shadow: 0 12px 26px rgba(103, 80, 164, 0.24);
}

.action-button {
  border-radius: 14px;
}

.danger-button {
  color: #b3261e;
}

.list-section {
  display: grid;
  gap: 16px;
}

.list-overview-card,
.item-card {
  display: grid;
  gap: 16px;
  align-items: center;
  background: rgba(255,255,255,0.94);
  box-shadow: 0 12px 26px rgba(31, 41, 55, 0.08);
}

.list-overview-link {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.list-overview-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.list-overview-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 32px rgba(31, 41, 55, 0.12);
}

.list-overview-main {
  display: flex;
  align-items: center;
  gap: 16px;
}

.list-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(103, 80, 164, 0.16), rgba(127, 103, 190, 0.22));
  color: #6750a4;
}

.list-overview-copy h2,
.item-copy h2 {
  margin: 0;
  font-size: 0.98rem;
}

.item-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.quantity-button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: #ede9fe;
  color: #5b43a5;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.quantity-button:disabled {
  opacity: 0.6;
}

.quantity-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #ede9fe;
  color: #5b43a5;
  font-size: 0.78rem;
  font-weight: 700;
}

.list-overview-copy p,
.item-copy p {
  margin: 0;
  color: #6b7280;
  font-size: 0.88rem;
}

.list-overview-side {
  display: flex;
  align-items: center;
  gap: 12px;
}

.list-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #ede9fe;
  color: #5b43a5;
  font-size: 0.9rem;
  font-weight: 600;
}

.list-actions-row,
.rename-form,
.detail-rename-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.rename-form .inline-input,
.detail-rename-form .inline-input {
  flex: 1 1 220px;
}

.share-link-row {
  display: flex;
}

.item-card {
  grid-template-columns: auto auto 1fr auto;
}

.item-index {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ede9fe;
  color: #5b43a5;
  font-weight: 700;
  font-size: 0.78rem;
}

.toggle-button {
  color: #6750a4;
}

.toggle-button:disabled {
  opacity: 0.6;
}

.delete-button {
  color: #b3261e;
}

.item-card.done h2 {
  text-decoration: line-through;
  color: #9aa0aa;
}

.empty-card {
  text-align: center;
  color: #6b7280;
  background: rgba(255,255,255,0.92);
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-right: 10px;
  color: white;
  text-decoration: none;
}

@media (max-width: 700px) {
  .stats-card,
  .item-form,
  .item-form.single-row,
  .list-overview-link {
    grid-template-columns: 1fr;
  }

  .item-card {
    grid-template-columns: 24px 40px 1fr auto;
    gap: 8px;
    padding: 10px 12px;
    align-items: center;
  }

  .field-group-wide {
    grid-column: auto;
  }

  .list-overview-side {
    justify-content: space-between;
  }

  .item-index {
    width: 22px;
    height: 22px;
    font-size: 0.72rem;
  }

  .toggle-button {
    transform: scale(0.9);
  }

  .item-copy h2 {
    font-size: 0.92rem;
    line-height: 1.2;
  }

  .item-copy p {
    font-size: 0.8rem;
  }

  .quantity-controls {
    gap: 6px;
    margin-bottom: 2px;
  }

  .quantity-button {
    width: 24px;
    height: 24px;
    font-size: 0.9rem;
  }

  .quantity-badge {
    min-height: 20px;
    padding: 0 6px;
    font-size: 0.72rem;
  }

  .delete-button {
    padding: 0;
    min-width: auto;
    font-size: 0.78rem;
  }
}
