:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --line: #dfe3e8;
  --text: #1f2933;
  --muted: #6b7684;
  --accent: #1a5fb4;
  --accent-soft: #e8f0fb;
  --ok: #1f7a4d;
  --warn: #9a6700;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}
a { color: var(--accent); }
header.app {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 10;
}
header.app h1 { font-size: 16px; margin: 0; font-weight: 700; }
header.app nav { display: flex; gap: 14px; margin-left: auto; flex-wrap: wrap; }
header.app nav a { text-decoration: none; font-size: 14px; }
main { padding: 16px; max-width: 1100px; margin: 0 auto; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.panel h2 { font-size: 15px; margin: 0 0 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
input[type=text], input[type=password], input[type=number], select, textarea {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  min-width: 0;
}
textarea { width: 100%; resize: vertical; }
button {
  font: inherit;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
button.ghost { background: #fff; color: var(--accent); }
button.danger { background: #fff; color: #b3261e; border-color: #e0b4b0; }
button:disabled { opacity: .5; cursor: not-allowed; }
.muted { color: var(--muted); font-size: 13px; }
.status-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}
.status-chip.done { background: #e4f4ec; color: var(--ok); }
.status-chip.hold { background: #fdf2dc; color: var(--warn); }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list th { font-size: 13px; color: var(--muted); font-weight: 600; }
.thumb { width: 48px; height: 48px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 4px; }
.thumb.empty { display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); }
.dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  background: #fbfcfd;
}
.dropzone.hot { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.compare figure { margin: 0; }
.compare figcaption { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.compare img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background:
    linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%),
    linear-gradient(45deg, #eee 25%, #fff 25%, #fff 75%, #eee 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
}
.compare img.after { background: #fff; }
.image-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; background: #fff; }
.image-card header { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.image-card .name { font-weight: 600; font-size: 14px; word-break: break-all; }
.pad { display: grid; grid-template-columns: repeat(3, 34px); gap: 4px; justify-content: center; }
.pad button { padding: 6px 0; font-size: 13px; }
.pad .spacer { visibility: hidden; }
.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: #1f2933; color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50;
}
.toast.show { opacity: 1; }
.login-wrap { max-width: 360px; margin: 12vh auto; }
.login-wrap .panel { padding: 24px; }
.login-wrap input { width: 100%; margin-bottom: 12px; }
.login-wrap button { width: 100%; }
.error { color: #b3261e; font-size: 13px; min-height: 20px; }
.steps { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: 0 0 14px; align-items: center; }
.steps > *::after { content: "▸"; margin-left: 8px; color: var(--line); }
.steps > *:last-child::after { content: ""; }
.steps a { color: var(--muted); text-decoration: none; }
.steps a:hover { color: var(--accent); text-decoration: underline; }
.steps .on { color: var(--accent); font-weight: 700; }
.notice { border: 1px solid var(--line); border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 10px 12px; border-radius: 6px; margin: 0 0 12px; font-size: 14px; }
.notice.warn { border-left-color: #c98b3a; background: #fdf6e8; }
.notice.stop { border-left-color: #b3261e; background: #fdecea; }
.notice ul { margin: 6px 0 0; padding-left: 20px; }
.kv { display: grid; grid-template-columns: 7em 1fr; gap: 4px 12px; font-size: 14px; margin: 0 0 10px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }
details.mail { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin-bottom: 10px; background: #fff; }
details.mail summary { cursor: pointer; font-weight: 600; font-size: 14px; }
details.mail[open] summary { margin-bottom: 10px; }
.ready { font-size: 12px; white-space: nowrap; }
.ready.ok { color: var(--ok); }
.ready.ng { color: #b3261e; }
.pkg-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; background: #fff; }
@media (max-width: 700px) {
  main { padding: 12px; }
  .compare { grid-template-columns: 1fr; }
  header.app nav { width: 100%; margin-left: 0; }
  table.list, table.list tbody, table.list tr, table.list td { display: block; width: 100%; }
  table.list thead { display: none; }
  table.list tr {
    position: relative;
    padding: 12px 34px 12px 64px;
    border-bottom: 1px solid var(--line);
  }
  table.list td { border: none; padding: 0; }
  table.list td.thumb-cell { position: absolute; left: 0; top: 12px; width: 52px; }
  table.list td.sel { position: absolute; right: 4px; top: 14px; width: auto; }
  table.list td.sel input { width: 20px; height: 20px; }
  table.list td.jan { font-size: 13px; }
  table.list td.name { font-weight: 600; line-height: 1.45; margin: 2px 0 6px; }
  table.list td.status { display: inline-block; width: auto; margin-right: 8px; }
  table.list td.count { display: inline-block; width: auto; font-size: 12px; }
  #toPackage { width: 100%; margin-left: 0 !important; }
}
