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

body {
  font-family: "Meiryo", "Yu Gothic", sans-serif;
  font-size: 14px;
  background: #f0f4f8;
  color: #1a1a2e;
  min-height: 100vh;
  padding: 24px 16px;
}

header {
  text-align: center;
  margin-bottom: 24px;
}

h1 {
  font-size: 20px;
  font-weight: bold;
  color: #1a1a2e;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.lead {
  font-size: 13px;
  color: #555;
  line-height: 1.7;
}

footer {
  text-align: center;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid #d0ddd8;
  font-size: 12px;
  color: #999;
  line-height: 1.9;
}

footer a {
  color: #999;
  text-decoration: none;
}

footer a:hover {
  color: #1a8a72;
  text-decoration: underline;
}

.container {
  max-width: 900px;
  margin: 0 auto;
}

/* ====== テーブル ====== */
.table-wrapper {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  overflow: hidden;
  margin-bottom: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: #1a8a72;
  color: #fff;
  padding: 10px 8px;
  text-align: center;
  font-weight: bold;
  font-size: 14px;
  border: 1px solid #16755f;
}

tbody tr:nth-child(even) { background: #e8f5f1; }
tbody tr:nth-child(odd)  { background: #fff; }

tbody td {
  border: 1px solid #c8ddd8;
  padding: 4px 6px;
  vertical-align: middle;
}

td.center { text-align: center; }
td.separator {
  background: #1a8a72 !important;
  width: 6px;
  padding: 0;
  border: none;
}

/* 入力フィールド */
tbody td input[type="text"],
tbody td input[type="number"] {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 14px;
  font-family: inherit;
  padding: 4px 2px;
  outline: none;
}

tbody td input[type="number"] {
  text-align: right;
}

tbody td input:focus {
  background: #fffde7;
  border-radius: 3px;
}

/* 削除ボタン */
.btn-del {
  background: none;
  border: none;
  cursor: pointer;
  color: #c0392b;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 3px;
  transition: background 0.15s;
}
.btn-del:hover { background: #fde8e8; }

/* ====== ボタン群 ====== */
.actions {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

button {
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  padding: 8px 18px;
  border-radius: 5px;
  border: none;
  transition: background 0.15s, opacity 0.15s;
}

.btn-add {
  background: #1a8a72;
  color: #fff;
}
.btn-add:hover { background: #157060; }

kbd {
  display: inline-block;
  font-family: inherit;
  font-size: 11px;
  background: rgba(255,255,255,0.25);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 3px;
  padding: 0 4px;
  margin-left: 4px;
  vertical-align: middle;
}

.btn-clear {
  background: #c0392b;
  color: #fff;
}
.btn-clear:hover { background: #a93226; }

.label-save {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #444;
  cursor: pointer;
  padding: 4px 2px;
  user-select: none;
}

.label-save input[type="checkbox"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: #1a8a72;
}

/* ====== フッター情報 ====== */
.info {
  text-align: right;
  color: #666;
  font-size: 12px;
  margin-top: 4px;
}

/* ====== 関連ツール ====== */
.related-tools {
  background: #fff;
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 16px;
  border-left: 4px solid #4a90d9;
}

.related-tools h2 {
  font-size: 14px;
  font-weight: bold;
  color: #555;
  margin-bottom: 10px;
}

.related-tool-link {
  display: inline-block;
  padding: 8px 18px;
  background: #4a90d9;
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
  font-size: 14px;
  font-weight: bold;
  transition: background 0.2s;
}

.related-tool-link:hover {
  background: #357abd;
}

/* ====== 使い方 ====== */
.help {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  padding: 20px 24px;
  margin-top: 20px;
}

.help h2 {
  font-size: 15px;
  font-weight: bold;
  color: #1a8a72;
  border-bottom: 2px solid #1a8a72;
  padding-bottom: 6px;
  margin-bottom: 14px;
  letter-spacing: 0.05em;
}

.help dl {
  display: grid;
  grid-template-columns: 9em 1fr;
  gap: 8px 16px;
  font-size: 13px;
  line-height: 1.7;
}

.help dt {
  font-weight: bold;
  color: #1a1a2e;
  padding-top: 1px;
}

.help dd {
  color: #444;
  margin: 0;
}

.help kbd {
  font-family: inherit;
  font-size: 11px;
  background: #eee;
  border: 1px solid #bbb;
  border-radius: 3px;
  padding: 0 4px;
  color: #1a1a2e;
}

.help-del {
  color: #c0392b;
  font-weight: bold;
}

.help code {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 12px;
  background: #f0f4f8;
  border-radius: 3px;
  padding: 0 4px;
  color: #1a1a2e;
}

/* ====== プレースホルダ行メッセージ ====== */
.empty-msg td {
  text-align: center;
  color: #999;
  padding: 20px;
  background: #fff !important;
}

/* ====== SNSシェアボタン ====== */
.share-section {
  text-align: center;
  padding: 20px 0 4px;
}

.share-title {
  font-size: 0.8rem;
  color: #999;
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}

.share-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: bold;
  text-decoration: none;
  color: #fff;
  transition: opacity 0.15s, transform 0.1s;
  line-height: 1;
}

.share-btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.share-btn--x        { background: #000000; }
.share-btn--facebook { background: #1877F2; }
.share-btn--line     { background: #06C755; }
.share-btn--hatena   { background: #00A4DE; }

.hatena-icon {
  font-size: 0.9rem;
  font-weight: 900;
  font-style: italic;
  line-height: 1;
}

/* ====== モバイル対応 ====== */
@media (max-width: 600px) {
  body {
    padding: 16px 10px;
  }

  h1 {
    font-size: 17px;
  }

  .lead {
    font-size: 11px;
    line-height: 1.6;
  }

  /* ボタンを小さく */
  button {
    font-size: 12px;
    padding: 6px 12px;
  }

  /* ボタン内のショートカットキー表示を非表示 */
  button kbd {
    display: none;
  }

  .actions {
    gap: 8px;
  }

  .label-save {
    font-size: 12px;
  }

  /* テーブルヘッダー・セルのフォントサイズ縮小 */
  thead th {
    font-size: 12px;
    padding: 8px 4px;
  }

  tbody td {
    padding: 3px 4px;
  }

  tbody td input[type="text"],
  tbody td input[type="number"] {
    font-size: 12px;
  }

  .btn-del {
    font-size: 14px;
    padding: 2px 4px;
  }

  /* 使い方セクション */
  .help {
    padding: 14px 14px;
  }

  .help h2 {
    font-size: 13px;
  }

  .help dl {
    grid-template-columns: 1fr;
    gap: 4px 0;
    font-size: 12px;
  }

  .help dt {
    margin-top: 10px;
  }

  .help dt:first-child {
    margin-top: 0;
  }

  footer {
    font-size: 11px;
  }
}
