/* アカウントページ（撮影者の作業画面）
   色の決まり：濃紺＝いちばん大事なボタン、白＝カード、青灰＝背景、緑＝済み・公開中、黄＝注意、赤＝削除 */

body { background: #f2f4f7; }

.admin-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: rgba(255, 255, 255, .94); border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.admin-header .brand { white-space: nowrap; flex: none; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; font-size: 13px; color: var(--muted); }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .btn { flex: none; white-space: nowrap; }

.admin-main { max-width: 1040px; margin: 0 auto; padding: 20px 16px 96px; }

h1 { margin: 0; font-size: 24px; color: var(--navy); font-weight: 600; line-height: 1.4; }
h2 { margin: 0 0 12px; font-size: 18px; color: var(--navy); font-weight: 600; }

.back { margin: 0 0 12px; font-size: 14px; }
.back a { color: var(--muted); text-decoration: none; }
.back a:hover { color: var(--accent); }
.lead { margin: 6px 0 20px; }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }

.panel { padding: 22px; margin-bottom: 16px; background: #fff; border: 1px solid #e3e7ee; border-radius: 16px; box-shadow: 0 1px 2px rgba(19, 32, 58, .04); }
.panel-narrow { max-width: 440px; margin: 48px auto; }

.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row-between { justify-content: space-between; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.quiet { margin: 14px 0 0; font-size: 14px; }
.link-btn { padding: 0; border: 0; background: none; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 14px; }
.link-btn:hover { color: var(--accent); }

/* 一覧が空のとき */
.empty { padding: 48px 24px; text-align: center; }
.empty-title { margin: 0 0 6px; font-size: 18px; font-weight: 600; color: var(--navy); }
.empty .btn { margin-top: 18px; }

/* フォーム */
.form { max-width: 720px; }
.field { display: block; margin-bottom: 18px; }
.field > span { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.field small { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; font-weight: 400; }
.field input[type=text], .field input[type=email], .field input[type=date], .field input[type=password],
.field input[inputmode], .field textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #d5dbe4; border-radius: 10px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.field textarea { min-height: 96px; resize: vertical; }
.choices { display: flex; gap: 16px; }
.choices label { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; }
.error { color: var(--danger); font-size: 14px; }
.error:empty { display: none; }
.more { margin: 4px 0 20px; padding: 14px 16px; border-radius: 12px; background: var(--bg-subtle); }
.more summary { cursor: pointer; font-size: 14px; color: var(--muted); }
.more[open] summary { margin-bottom: 16px; }

/* 一覧 */
.album-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.album-card { display: block; overflow: hidden; background: #fff; border: 1px solid #e3e7ee; border-radius: 16px; color: inherit; text-decoration: none; transition: transform .2s, box-shadow .2s; }
.album-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(19, 32, 58, .08); }
.album-card .thumb { display: grid; place-items: center; aspect-ratio: 3 / 2; background: #e9edf2; }
.album-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-empty { font-size: 13px; color: var(--muted); }
.album-card .body { padding: 14px 16px 16px; }
.album-card .title { margin: 0; font-weight: 600; }
.album-card .meta { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.badge { flex: none; display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; background: #eef1f5; color: var(--muted); white-space: nowrap; }
.badge-published { background: #e3f3ea; color: var(--ok); }
.badge-expired { background: #fbeaea; color: var(--danger); }
.badge-warn { background: #fdf3dc; color: var(--warn); }

/* アルバムの見出し */
.album-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.album-cover { flex: none; width: 72px; height: 72px; border-radius: 14px; overflow: hidden; background: #e2e7ee; }
.album-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-title { min-width: 0; flex: 1; }
.album-title .card-top { justify-content: flex-start; flex-wrap: wrap; }
.album-title .meta { margin: 4px 0 0; font-size: 14px; color: var(--muted); }

/* 進み具合 */
.stepper { display: flex; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.stepper li { display: flex; align-items: center; gap: 8px; flex: 1; padding: 8px 12px; border-radius: 999px; background: #f2f4f7; white-space: nowrap; }
.stepper .dot { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 1px solid #d5dbe4; font-size: 12px; font-weight: 600; flex: none; }
.stepper li.done { color: var(--ok); }
.stepper li.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.stepper li.current { background: var(--navy); color: #fff; }
.stepper li.current .dot { border-color: transparent; color: var(--navy); }

/* 次にすること */
.next-step h2 { font-size: 20px; margin-bottom: 6px; }
.next-step p { margin: 0; }
.next-step.ok { border-color: #cfe8da; }
.next-step.warn { border-color: #f0c9c6; background: #fffafa; }
.next-step .url-box { margin-top: 16px; }
.checklist { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 16px 0 0; }
.checklist > div { padding: 12px 14px; border-radius: 12px; background: var(--bg-subtle); }
.checklist dt { font-size: 12px; color: var(--muted); }
.checklist dd { display: flex; align-items: center; gap: 10px; margin: 4px 0 0; font-weight: 600; }
.checklist dd small { font-weight: 400; }
.check-cover { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }

.url-box { display: flex; gap: 8px; }
.url-box input { flex: 1; min-width: 0; min-height: 46px; padding: 8px 12px; border: 1px solid #d5dbe4; border-radius: 10px; background: var(--bg-subtle); font-size: 14px; }

/* 切り替え（写真・様子・設定） */
.tabs { display: flex; gap: 4px; margin: 28px 0 16px; border-bottom: 1px solid #dfe4eb; scroll-margin-top: 70px; }
.tab { position: relative; padding: 10px 16px; border: 0; background: none; color: var(--muted); font-size: 15px; cursor: pointer; }
.tab[aria-selected="true"] { color: var(--navy); font-weight: 600; }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; border-radius: 3px; background: var(--navy); }
.hint { margin: 12px 0; font-size: 13px; }
.tab-panel.narrow > * { max-width: 760px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { padding: 16px; border-radius: 14px; background: #fff; border: 1px solid #e3e7ee; }
.stat b { display: block; font-size: 20px; color: var(--navy); }
.stat span { font-size: 13px; color: var(--muted); }

/* アップロード */
.uploader { margin-bottom: 8px; }
.drop {
  display: grid; place-items: center; gap: 6px; padding: 36px 16px; text-align: center;
  border: 2px dashed #c6cfdb; border-radius: 16px; background: #fff; cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
}
.drop:hover { border-color: #9fb0c6; }
.drop.over { border-color: var(--accent); background: var(--accent-light); transform: scale(1.01); }
.drop.busy { opacity: .6; pointer-events: none; }
.drop p { margin: 0; }
.drop-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent-light); color: var(--accent); font-size: 20px; font-weight: 700; }
.drop-title { font-weight: 600; color: var(--navy); }
.queue { margin-top: 12px; padding: 14px 16px; border-radius: 12px; background: #fff; border: 1px solid #e3e7ee; font-size: 14px; }
.queue-summary { margin-bottom: 8px; font-weight: 600; color: var(--navy); }
.progress { height: 6px; border-radius: 3px; background: #e6eaf0; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s; }
.queue-details { margin-top: 8px; }
.queue-details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.queue-items { max-height: 240px; overflow: auto; margin: 8px 0 0; padding: 0; list-style: none; }
.queue-items li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid #eef1f5; }
.queue-items .st-done { color: var(--ok); }
.queue-items .st-error { color: var(--danger); }
.queue-items .st-skip { color: var(--muted); }

/* 写真 */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo-cell { position: relative; border-radius: 12px; overflow: hidden; background: #e2e7ee; animation: appear .25s ease-out; }
.photo-cell img, .photo-cell .placeholder { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.photo-cell.is-cover { outline: 3px solid var(--navy); outline-offset: -3px; }
.cell-tags { position: absolute; top: 8px; left: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-block; padding: 2px 9px; border: 0; border-radius: 999px; font-size: 12px; line-height: 1.6; white-space: nowrap; }
.chip-cover { background: var(--navy); color: #fff; }
.chip-warn { background: #fdf3dc; color: var(--warn); }
.chip-delete { position: absolute; top: 8px; right: 8px; background: rgba(255, 255, 255, .92); color: var(--danger); cursor: pointer; opacity: 0; transition: opacity .15s; }
.cell-cover-btn {
  position: absolute; left: 8px; right: 8px; bottom: 8px; min-height: 34px; border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, .94); color: var(--navy); font-size: 13px; white-space: nowrap; cursor: pointer; opacity: 0; transition: opacity .15s;
}
.photo-cell:hover .chip-delete, .photo-cell:hover .cell-cover-btn,
.photo-cell:focus-within .chip-delete, .photo-cell:focus-within .cell-cover-btn { opacity: 1; }
/* 指で触る画面では、いつも見せる（重ねて誤タップしないよう、削除は右上に小さく） */
@media (hover: none) {
  .chip-delete, .cell-cover-btn { opacity: 1; }
}

.explain table { width: 100%; border-collapse: collapse; font-size: 14px; }
.explain th, .explain td { padding: 10px 8px; border-bottom: 1px solid #eef1f5; text-align: left; vertical-align: top; }
.explain tr:first-child th { font-size: 12px; color: var(--muted); font-weight: 400; }
.danger-zone { border-color: #f0c9c6; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 30; transform: translateX(-50%) translateY(20px);
  max-width: calc(100% - 32px); padding: 12px 20px; border-radius: 999px;
  background: var(--navy); color: #fff; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s;
  box-shadow: 0 10px 30px rgba(19, 32, 58, .25);
}
.toast.show { opacity: 1; transform: translateX(-50%); }

@keyframes appear { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* スマホ */
@media (max-width: 640px) {
  .who span { display: none; }
  .admin-main { padding-top: 14px; }
  .panel { padding: 18px; border-radius: 14px; }
  .album-head { align-items: flex-start; }
  .album-cover { width: 56px; height: 56px; border-radius: 12px; }
  h1 { font-size: 20px; }
  .stepper { gap: 4px; font-size: 11px; }
  .stepper li { gap: 5px; padding: 5px 7px; }
  .stepper .dot { width: 18px; height: 18px; font-size: 10px; }
  .actions .btn { flex: 1 1 100%; }
  .url-box { flex-direction: column; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .tabs { overflow-x: auto; }
  .tab { white-space: nowrap; padding: 10px 12px; }
  .explain th, .explain td { padding: 8px 4px; font-size: 13px; }
}
