/* MissionTodo — ミッション画面 */

/* ---------- 一覧カード ---------- */
.mlist { position: relative; }
.mrow { position: relative; margin-bottom: 6px; border-radius: 4px; }
.mswipe {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 20px;
  border-radius: 4px;
  background: var(--good);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  opacity: var(--swipe, 0);
}
.mswipe span { display: flex; flex-direction: column; align-items: center; gap: 2px; transform: scale(calc(0.75 + var(--swipe, 0) * 0.25)); }
.mswipe .ic { font-size: 22px; stroke-width: 3; }
.mrow:not(.swiping) .mswipe { visibility: hidden; }
.mcard {
  position: relative;
  padding: 7px 28px 6px;
  background: var(--card);
  border: 2px solid var(--card-edge);
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px var(--card-line), 0 1px 0 rgba(0, 0, 0, 0.12);
  color: var(--card-title);
  text-align: center;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: pointer;
}
.mcard:hover { filter: brightness(1.04); }
.mcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mcnt { position: absolute; top: 5px; right: 9px; font-size: 11px; font-weight: 800; }
.mt { overflow: hidden; white-space: nowrap; font-size: 13px; font-weight: 800; line-height: 1.55; }
.mt span { display: inline-block; }
.mt.marquee { text-align: left; }
.mt.marquee span { animation: marquee var(--dur, 6s) ease-in-out infinite alternate; }
@keyframes marquee { 0%, 15% { transform: translateX(0); } 85%, 100% { transform: translateX(var(--shift)); } }
.md { margin-top: 1px; color: var(--card-text); font-size: 11px; font-weight: 700; line-height: 1.45; white-space: pre-line; word-break: break-word; }
.md.short { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.md.none { opacity: 0.75; }
.mmeta { display: grid; grid-template-columns: 1fr 1.5fr; align-items: center; margin-top: 4px; font-size: 11px; font-weight: 800; }
.mpt, .mtime { display: inline-flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap; }
.mpt .ic { color: #dad1c7; font-size: 9px; }
.mpt b { color: var(--pt); }
.mtime { color: var(--time); }
.mtime .ic { color: var(--time-icon); font-size: 13px; stroke-width: 2.4; }
.mtime em { font-style: normal; font-variant-numeric: tabular-nums; }
.mrow.dragging { z-index: 5; }
.mrow.dragging .mcard { transform: scale(1.03); box-shadow: inset 0 0 0 1px var(--card-line), 0 10px 22px rgba(0, 0, 0, 0.38); }
.drag-active { cursor: grabbing; }

/* ---------- 詳細 ---------- */
.detail { padding: 2px 4px 10px; }
.d-kind { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 2px 0 6px; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 10px; background: var(--brown); color: var(--on-dark); font-size: 10.5px; font-weight: 800; line-height: 1.6; }
.chip.soft { background: transparent; border: 1.5px solid var(--line-soft); color: var(--ink-soft); }
.d-title { margin: 4px 0 6px; text-align: center; font-size: 19px; font-weight: 800; line-height: 1.4; word-break: break-word; }
.d-desc { margin: 0 0 12px; text-align: center; color: var(--ink-soft); font-size: 13px; font-weight: 700; line-height: 1.6; white-space: pre-line; word-break: break-word; }
.d-info {
  margin: 0 0 14px;
  padding: 4px 12px;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 6px;
  box-shadow: inset 0 0 0 2px var(--panel), inset 0 0 0 3px var(--line-soft);
}
.d-info > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 2px; border-bottom: 1px dashed var(--line-soft); font-size: 12.5px; font-weight: 700; }
.d-info > div:last-child { border-bottom: 0; }
.d-info span { color: var(--ink-soft); }
.d-info b { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.d-info b.pt .ic { color: var(--ink-faint); font-size: 10px; margin-right: 3px; }
.stamp { display: inline-block; padding: 0 7px; border: 2px solid currentColor; border-radius: 4px; font-size: 10.5px; font-weight: 800; line-height: 1.6; transform: rotate(-4deg); white-space: nowrap; }
.stamp.cleared { color: #c2362f; }
.stamp.failed { color: #6f6a66; }
.stamp.gaveup { color: #8a6d3b; }
.stamp.skipped { color: #4d7aa6; }
.stamp.active { color: var(--good); }
.d-hist { margin-top: 6px; }
.d-hist > button { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 8px; color: var(--ink); font-size: 12.5px; font-weight: 800; }
.d-hist > button .ic:last-child { transition: transform 0.2s; }
.d-hist ul { display: none; margin: 0; padding: 2px 10px; list-style: none; background: var(--panel-in); border: 1.5px solid var(--line-soft); border-radius: 6px; }
.d-hist.open ul { display: block; }
.d-hist.open > button .ic:last-child { transform: rotate(180deg); }
.d-hist li { display: flex; justify-content: space-between; padding: 7px 2px; border-bottom: 1px dashed var(--line-soft); font-size: 12px; font-weight: 700; }
.d-hist li:last-child { border-bottom: 0; }

/* ---------- 終了したミッション ---------- */
.ended-panel { padding: 8px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 8px; }
.cal-head b { font-size: 15px; font-weight: 800; }
.cal-head .icon-btn { width: 36px; height: 30px; font-size: 18px; }
.msum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.msum div { padding: 6px 4px; background: var(--panel-in); border: 1.5px solid var(--line-soft); border-radius: 6px; text-align: center; min-width: 0; }
.msum span { display: block; color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.msum b { display: block; font-size: 13.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-wd { padding: 2px 0; text-align: center; color: var(--ink-soft); font-size: 10px; font-weight: 800; }
.cal-wd.sun, .cal-cell.sun .cd { color: #b84a3e; }
.cal-wd.sat, .cal-cell.sat .cd { color: #3f6ea8; }
.cal-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  min-height: 48px;
  padding: 3px 1px;
  background: var(--panel-in);
  border: 1.5px solid transparent;
  border-radius: 5px;
  overflow: hidden;
}
.cal-cell.blank { background: transparent; }
.cal-cell.today { border-color: var(--line-soft); }
.cal-cell.sel { border-color: var(--brown); background: color-mix(in srgb, var(--panel-in) 72%, var(--accent)); }
.cal-cell.future { opacity: 0.55; }
.cal-cell .cd { color: var(--ink); font-size: 11px; font-weight: 800; }
.cal-cell .cp { margin-top: 1px; color: #a3680f; font-size: 8.5px; font-weight: 800; white-space: nowrap; }
.cal-cell .cc { color: var(--good); font-size: 8.5px; font-weight: 800; }
.day-head { margin: 12px 2px 6px; font-size: 12.5px; font-weight: 800; }
.day-head small { display: block; margin-top: 2px; color: var(--ink-soft); font-size: 10.5px; font-weight: 700; }
.ecard {
  display: block;
  width: 100%;
  margin-bottom: 6px;
  padding: 8px 10px;
  text-align: left;
  background: var(--card);
  border: 2px solid var(--card-edge);
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px var(--card-line);
  color: var(--card-title);
}
.ecard .e-top { display: flex; align-items: center; gap: 8px; }
.ecard .e-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ecard .stamp { background: rgba(255, 255, 255, 0.92); }
.ecard .e-sub { display: flex; justify-content: space-between; gap: 8px; margin-top: 5px; color: var(--card-text); font-size: 11px; font-weight: 700; }
.ecard .e-sub b { color: var(--pt); white-space: nowrap; }
.ecard .e-times { margin-top: 3px; color: var(--card-text); font-size: 10.5px; font-weight: 700; }
.ended-panel > .btn.sm { display: block; margin: 8px auto 2px; }
