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

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

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

/* ヘッダー */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 8px;
  flex-wrap: wrap;
}

header h1 {
  font-size: 1.4rem;
  color: #1565c0;
}

.header-btns {
  display: flex;
  gap: 8px;
}

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

.card h2 {
  font-size: 1rem;
  color: #1565c0;
  border-bottom: 2px solid #2196F3;
  padding-bottom: 6px;
  margin-bottom: 12px;
}

/* フォームグリッド */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-grid .full-width {
  grid-column: 1 / -1;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  font-size: 0.82rem;
  color: #555;
  gap: 4px;
}

.form-grid input,
.form-grid textarea {
  padding: 7px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  width: 100%;
}

.form-grid input:focus,
.form-grid textarea:focus {
  outline: none;
  border-color: #2196F3;
}

/* 追加フォーム */
.add-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  align-items: center;
}

.add-form input {
  padding: 7px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  min-width: 0;
}

.add-form input:focus {
  outline: none;
  border-color: #2196F3;
}

/* ボタン */
button {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 0.88rem;
  font-family: inherit;
  white-space: nowrap;
  transition: opacity 0.15s;
}

button:hover {
  opacity: 0.85;
}

.btn-primary {
  background: #2196F3;
  color: #fff;
}

.btn-danger {
  background: #e53935;
  color: #fff;
}

.btn-delete {
  background: #eee;
  color: #c00;
  padding: 4px 10px;
  font-size: 0.82rem;
}

/* テーブル */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th {
  background: #e3f2fd;
  padding: 7px 8px;
  text-align: left;
  font-weight: 600;
  font-size: 0.82rem;
  color: #1565c0;
}

td {
  padding: 7px 8px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}

tr:last-child td {
  border-bottom: none;
}

/* 持ち物リスト */
#items-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px;
}

#items-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f8f9fa;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.9rem;
}

#items-list li input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #2196F3;
  flex-shrink: 0;
}

#items-list li .item-text {
  flex: 1;
}

#items-list li.checked .item-text {
  text-decoration: line-through;
  color: #999;
}

#items-list li .btn-delete {
  flex-shrink: 0;
}

/* 空表示 */
.empty-msg {
  text-align: center;
  color: #aaa;
  font-size: 0.88rem;
  padding: 10px 0;
}

/* ==================== 印刷用スタイル ==================== */
@media print {
  body {
    background: #fff;
    font-size: 10pt;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  header {
    margin-bottom: 12pt;
  }

  header h1 {
    font-size: 18pt;
    color: #000;
  }

  .header-btns,
  .add-form,
  .btn-delete,
  .no-print {
    display: none !important;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ccc;
    margin-bottom: 10pt;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .card h2 {
    color: #000;
    border-bottom-color: #000;
  }

  .form-grid input,
  .form-grid textarea {
    border: none;
    padding: 2px 0;
    font-size: 10pt;
  }

  #items-list li {
    background: none;
    padding: 3px 0;
  }

  #items-list li input[type="checkbox"] {
    accent-color: #000;
  }

  .empty-msg {
    display: none;
  }

  th {
    background: #ddd;
    color: #000;
  }
}

/* レスポンシブ */
@media (max-width: 600px) {
  header h1 {
    font-size: 1.2rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .full-width {
    grid-column: 1;
  }

  #items-list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 375px) {
  #items-list {
    grid-template-columns: 1fr;
  }
}
