* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #f5f5f7;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}

/* .app {
  padding: 0;
  margin: 0 auto;
  min-height: 100vh;
  max-width: 430px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
} */

.app {
  padding: 0;
  margin: 0;
  margin: 0 auto;
  min-height: 100vh;
  max-width: 430px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  }

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 8px;
  background: white;
}

.header h1 {
  font-size: 28px;
  font-weight: 600;
  color: #1d1d1f;
  margin: 0;
  letter-spacing: -0.5px;
  padding-left: 8px;
}

.header-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reset-button {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: none;
  border: none;
  color: #ff3b30;
  cursor: pointer;
}

.reset-button:active {
  opacity: 0.7;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.menu-button {
  width: 44px;
  height: 44px;
  position: relative;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-button-icon {
  width: 30px;
  height: 24px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.menu-button span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #1d1d1f;
  transition: all 0.3s ease;
  transform-origin: left center;
}

.menu-button.open span:first-child {
  transform: rotate(45deg);
}

.menu-button.open span:nth-child(2) {
  opacity: 0;
}

.menu-button.open span:last-child {
  transform: rotate(-45deg);
}

.menu-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  pointer-events: none;
}

.menu-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.menu-card {
  position: absolute;
  top: 16px;
  right: 16px;
  background: white;
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transform-origin: top right;
  transform: scale(0.95);
  opacity: 0;
  transition: all 0.3s ease;
  width: 160px;
  pointer-events: none;
}

.menu-overlay.open .menu-card {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}

.menu-card button {
  display: block;
  width: 100%;
  padding: 12px 24px;
  text-align: left;
  background: none;
  border: none;
  font-size: 17px;
  font-weight: 500;
  color: #1d1d1f;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 0;
  white-space: nowrap;
}

.menu-card button:hover {
  background-color: #f5f5f7;
}

.menu-card button.active {
  color: #0071e3;
  background-color: #f5f5f7;
}

.inventory-manager {
  background-color: white;
  padding: 0 8px;
}

.inventory-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.table-container {
  background-color: white;
}

.inventory-list {
  width: 100%;
  border-collapse: collapse;
}

.inventory-list th {
  display: none;
}

.inventory-list td {
  padding: 12px 8px;
  border-bottom: 1px solid #e5e5ea;
  vertical-align: middle;
}

.inventory-list td:first-child {
  font-size: 22px;
  font-weight: 500;
  padding-right: 8px;
  line-height: 1.2;
  width: calc(100% - 40px);
}

.inventory-list td:last-child {
  width: 40px;
  padding-left: 0;
  padding-right: 8px;
}

.inventory-list input[type="tel"] {
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 18px;
  border-radius: 6px;
  border: 1.5px solid #d2d2d7;
  background-color: #ffffff;
  -webkit-appearance: none;
  text-align: center;
  font-weight: 500;
}

.inventory-list input[type="tel"]:focus {
  outline: none;
  border-color: #0071e3;
}

.inventory-list input[type="tel"]::placeholder {
  color: #86868b;
  opacity: 0.5;
}

.save-load {
  margin-top: 4px;
  padding: 12px;
  background: white;
  display: flex;
  gap: 4px;
}

.save-load button {
  flex: 1;
  height: 44px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  background: #1d1d1f;
  color: white;
  opacity: 0.9;
  cursor: pointer;
}

.danger-button {
  background: #ff3b30;
}

.save-load button:active {
  opacity: 1;
}

.comment-box {
  margin: 4px 4px;
  padding: 0 8px;
}

.comment-box textarea {
  width: 100%;
  padding: 12px;
  border: 1.5px solid #d2d2d7;
  border-radius: 10px;
  font-size: 16px;
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

.comment-box textarea:focus {
  outline: none;
  border-color: #0071e3;
}

@media screen and (max-width: 768px) {
  * {
    touch-action: manipulation;
  }
  
  input[type="tel"] {
    font-size: 16px !important;
  }
  
  .inventory-manager {
    padding: 16px 8px;
  }
}