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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
  background: #f0f4f8;
  color: #1e293b;
  min-height: 100vh;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  color: #1e40af;
  padding: 12px 0 4px;
}

h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 12px;
}

/* カード */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* 入力エリア */
.input-row {
  display: flex;
  gap: 8px;
}

.input-row input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.input-row input:focus {
  border-color: #2563eb;
}

/* ボタン共通 */
.btn {
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: #2563eb;
  color: #fff;
  white-space: nowrap;
}

.btn-primary:hover {
  background: #1d4ed8;
}

/* 呼び出しカード */
.call-card {
  border-left: 4px solid #2563eb;
}

.current-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0 16px;
  gap: 4px;
}

.current-label {
  font-size: 0.8rem;
  color: #94a3b8;
  letter-spacing: 0.05em;
}

.current-number {
  font-size: 3rem;
  font-weight: 800;
  color: #2563eb;
  line-height: 1;
}

.current-name {
  font-size: 1rem;
  color: #475569;
  min-height: 1.2em;
}

.btn-call {
  background: #16a34a;
  color: #fff;
  width: 100%;
  padding: 14px;
  font-size: 1.05rem;
}

.btn-call:hover {
  background: #15803d;
}

.btn-call:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  transform: none;
}

/* 待ちリスト */
.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.list-header h2 {
  margin-bottom: 0;
}

.wait-count {
  background: #2563eb;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
}

.wait-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
}

.wait-list .empty-msg {
  color: #94a3b8;
  font-size: 0.9rem;
  text-align: center;
  padding: 16px 0;
}

.wait-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.wait-item.first {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.wait-num {
  font-size: 1.2rem;
  font-weight: 800;
  color: #2563eb;
  min-width: 36px;
  text-align: center;
}

.wait-name {
  flex: 1;
  font-size: 0.95rem;
  color: #1e293b;
}

.wait-badge {
  font-size: 0.7rem;
  font-weight: 700;
  background: #2563eb;
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
}

.delete-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1;
}

.delete-btn:hover {
  color: #ef4444;
  background: #fee2e2;
}

/* リセット */
.reset-area {
  text-align: center;
  padding-bottom: 16px;
}

.btn-reset {
  background: #fff;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
  font-size: 0.85rem;
  padding: 8px 20px;
}

.btn-reset:hover {
  background: #fee2e2;
  color: #ef4444;
  border-color: #fca5a5;
}

@media (min-width: 640px) {
  .container {
    padding: 24px 16px;
  }

  h1 {
    font-size: 1.8rem;
  }
}
