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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f8f8f8;
  color: #333;
  min-height: 100vh;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
}

h1 {
  font-size: 1.5rem;
  text-align: center;
  padding: 20px 0 16px;
  color: #333;
}

h2 {
  font-size: 1rem;
  color: #555;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* フォーム */
.form-section {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

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

input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  background: #fafafa;
  appearance: auto;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
  outline: 2px solid #f5a623;
  border-color: #f5a623;
  background: #fff;
}

input[type="number"] {
  max-width: 100px;
}

#addBtn {
  padding: 11px;
  background: #f5a623;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

#addBtn:hover {
  background: #e09410;
}

/* フィルター */
.filter-section {
  background: #fff;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-section label {
  font-size: 0.9rem;
  color: #666;
  white-space: nowrap;
}

#filterSize {
  flex: 1;
  min-width: 140px;
}

/* リスト */
.list-section {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.badge {
  background: #f5a623;
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: normal;
}

.device-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.device-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 10px;
  gap: 8px;
}

.device-info {
  flex: 1;
  min-width: 0;
}

.device-name {
  font-size: 0.95rem;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.device-meta {
  font-size: 0.8rem;
  color: #888;
  margin-top: 2px;
}

.battery-tag {
  background: #fff3db;
  color: #c47d00;
  border: 1px solid #f5c862;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: bold;
  white-space: nowrap;
}

.delete-btn {
  background: none;
  border: none;
  color: #ccc;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}

.delete-btn:hover {
  color: #e05252;
  background: #ffeaea;
}

.empty-msg {
  text-align: center;
  color: #bbb;
  font-size: 0.9rem;
  padding: 24px 0 8px;
  display: none;
}

.empty-msg.visible {
  display: block;
}

/* スマホ対応 */
@media (max-width: 480px) {
  h1 {
    font-size: 1.3rem;
  }

  .device-card {
    padding: 10px 12px;
  }
}
