
.page {
  flex: 1;
  max-width: var(--w-base);
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tool {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* アップロードゾーン（画像が1枚もないときだけ表示） */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.upload-zone:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.upload-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 48px 24px;
  user-select: none;
  pointer-events: none;
}

.upload-icon { color: var(--muted); }

.upload-primary {
  font-size: 14px;
  font-weight: 600;
  color: var(--sub);
}

.upload-sub {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}

/* ページ全体にドラッグしたときのオーバーレイ */
.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(17, 24, 39, 0.55);
  pointer-events: none;
}

.drop-overlay.show { display: flex; }

.drop-overlay span {
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  padding: 20px 32px;
  border-radius: var(--radius);
  border: 2px dashed var(--accent);
}

/* タイトルが長く、スマホでは「セキュリティ」の札が縦に折れるため */
.page-title-row .page-cat { white-space: nowrap; }

/* 選んでいる写真に入っていた情報 */
.detail {
  display: none;
  gap: 16px;
  align-items: flex-start;
}

.detail-thumb {
  width: 140px;
  height: 140px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.detail-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  word-break: break-all;
}

.detail-lead {
  font-size: 12.5px;
  color: var(--sub);
  line-height: 1.6;
}
.detail-lead.is-clean { color: #15803d; font-weight: 600; }

.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.info-table th,
.info-table td {
  border-top: 1px solid var(--border);
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
  line-height: 1.55;
}
.info-table th {
  width: 9.5em;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.info-table td {
  color: var(--ink);
  word-break: break-all;
}
/* 位置情報は、いちばん知られたくない情報なので目立たせる */
.info-table tr.is-gps th,
.info-table tr.is-gps td {
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 700;
}

.detail-keep {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

/* 一覧 */
.list {
  display: none;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 340px;
  overflow-y: auto;
}

.row {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.row:hover { background: var(--hover); }

.row.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.row-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg);
  display: block;
}

.row-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.row-name {
  font-size: 12.5px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-size {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-btn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.row-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent-deep);
  background: var(--surface);
}

.row-btn.del:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.row-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* 操作ボタン */
.actions {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.sub-btn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: "Noto Sans JP", sans-serif;
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease;
}

.sub-btn:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
}

.sub-btn.danger:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.dl-btn {
  appearance: none;
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 13px 20px;
  border-radius: var(--radius);
  cursor: pointer;
  width: 100%;
  transition: background 140ms ease;
}

.dl-btn:hover { background: var(--accent-deep); }

.dl-btn:disabled {
  background: var(--border);
  color: var(--muted);
  cursor: not-allowed;
}

/* 注意書き */
.notice {
  display: none;
  gap: 8px;
  align-items: flex-start;
  flex-wrap: wrap;
  background: var(--bg);
  border-left: 3px solid var(--muted);
  border-radius: 4px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--sub);
  line-height: 1.6;
}

.notice.show { display: flex; }

.notice.warn {
  background: #fffbeb;
  border-left-color: #d97706;
}

.notice-icon {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--muted);
}

.notice.warn .notice-icon { color: #d97706; }

/* 一覧の行の中の小さな札 */
.row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 2px 0;
}

.chip {
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--sub);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.chip.is-gps {
  background: var(--danger-soft);
  border-color: #fca5a5;
  color: var(--danger);
}
.chip.is-clean {
  background: var(--ok-soft);
  border-color: #bbf7d0;
  color: #15803d;
}

/* アコーディオン内 */
.howto {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: howto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
}

/* li は flex にしない。flex にすると本文中の <b> が独立した子として
   横に並んでしまい、文章が途中で分断される。番号は絶対配置で置く。 */
.howto li {
  counter-increment: howto;
  position: relative;
  padding-left: 30px;
  font-size: 13px;
  color: var(--sub);
  line-height: 1.6;
}

.howto li::before {
  content: counter(howto);
  position: absolute;
  left: 0;
  top: 1px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-text {
  font-size: 13px;
  color: var(--sub);
  line-height: 1.7;
  margin: 0;
  padding-top: 14px;
}

.about-text + .about-text { padding-top: 10px; }

.fmt-table-wrap {
  padding-top: 14px;
  overflow-x: auto;
}

.fmt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  min-width: 380px;
}

.fmt-table th,
.fmt-table td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  line-height: 1.6;
  color: var(--sub);
}

.fmt-table th {
  background: var(--bg);
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.ad-slot { margin-top: 4px; }

/* モバイル */
@media (max-width: 480px) {
  .tool { padding: 18px; }
  .upload-idle { padding: 32px 16px; }
  .upload-primary { font-size: 13px; }

  .detail { flex-direction: column; }
  .detail-thumb { width: 100%; height: 180px; }
  .info-table th { width: 7.5em; white-space: normal; }

  .row {
    grid-template-columns: 36px 1fr auto auto;
    gap: 8px;
    padding: 6px;
  }
  .row-thumb { width: 36px; height: 36px; }
  .row-name { font-size: 12px; }
  .actions .sub-btn { flex: 1; }
}
