/* ══════════════════════════════════════════════════════════
   タスク管理ボード（かんばん） — スタイル
   テーマカラー: Indigo (#4f46e5)
   ══════════════════════════════════════════════════════════ */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #eef2ff;
  color: #1e1b4b;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── ヘッダー ── */
header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 740px;
  margin: 0 auto;
  padding: 0 16px;
  height: 52px;
  display: flex;
  align-items: center;
}
.logo { font-weight: 700; font-size: 1.1rem; color: #4f46e5; text-decoration: none; }
.logo:hover { color: #4338ca; }

/* ── メイン ── */
main {
  flex: 1;
  max-width: 740px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  width: 100%;
}

/* ── ヒーロー ── */
.hero { text-align: center; padding: 28px 0 20px; }
.hero-icon { font-size: 3rem; margin-bottom: 10px; }
.hero h1 { font-size: 1.75rem; font-weight: 700; color: #312e81; margin-bottom: 6px; }
.description { color: #4f46e5; font-size: 0.95rem; line-height: 1.7; }

/* ── ビュータブ ── */
.view-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.view-tab {
  padding: 11px 4px;
  border: 2px solid #c7d2fe;
  border-radius: 12px;
  background: #f5f3ff;
  color: #4f46e5;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s;
  touch-action: manipulation;
  font-family: inherit;
}
.view-tab:hover { border-color: #a5b4fc; background: #e0e7ff; }
.view-tab.active {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #fff;
  box-shadow: 0 2px 10px rgba(79,70,229,.35);
}
.view-tab.locked { color: #6366f1; opacity: .72; }
.view-tab .lock { font-size: .78rem; }

/* ── ボードバー ── */
.board-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.board-name {
  flex: 1;
  min-width: 180px;
  font-size: 1rem;
  font-weight: 700;
  color: #312e81;
  background: #fff;
  border: 2px solid #c7d2fe;
  border-radius: 10px;
  padding: 9px 12px;
  font-family: inherit;
}
.board-name:focus { outline: none; border-color: #4f46e5; }
.bar-btn {
  border: 2px solid #c7d2fe;
  background: #fff;
  color: #4f46e5;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  touch-action: manipulation;
}
.bar-btn:hover { background: #e0e7ff; }
.bar-btn.danger { color: #b91c1c; border-color: #fecaca; }
.bar-btn.danger:hover { background: #fee2e2; }

.save-note {
  font-size: .78rem;
  color: #6366f1;
  min-height: 1.2em;
  margin-bottom: 10px;
  transition: opacity .4s;
}
.save-note.hide { opacity: 0; }

/* ── ボード本体（横スクロール） ── */
.board-wrap {
  margin: 0 calc(50% - 50vw);
  padding: 0 max(16px, calc(50vw - 550px));
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}
.board {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  min-height: 320px;
  width: max-content;
  min-width: 100%;
}
.list {
  width: 270px;
  flex: 0 0 270px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 14px rgba(79,70,229,.10);
  display: flex;
  flex-direction: column;
  max-height: 70vh;
}
.list-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 12px 8px;
  border-bottom: 1px solid #eef2ff;
}
.list-title {
  flex: 1;
  min-width: 0;
  font-size: .95rem;
  font-weight: 700;
  color: #312e81;
  border: none;
  background: transparent;
  font-family: inherit;
  padding: 2px 4px;
  border-radius: 6px;
}
.list-title:focus { outline: none; background: #eef2ff; }
.list-count {
  font-size: .75rem;
  font-weight: 700;
  color: #6366f1;
  background: #eef2ff;
  border-radius: 999px;
  padding: 2px 8px;
  flex: 0 0 auto;
}
.cards {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 60px;
}
.list-foot { padding: 0 10px 10px; }
.add-card {
  width: 100%;
  border: 2px dashed #c7d2fe;
  background: #f8fafc;
  color: #4f46e5;
  border-radius: 10px;
  padding: 9px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  touch-action: manipulation;
}
.add-card:hover { background: #e0e7ff; border-color: #a5b4fc; }

/* ── カード ── */
.card {
  background: #fff;
  border: 1px solid #e0e7ff;
  border-left: 5px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 10px 8px;
  cursor: grab;
  box-shadow: 0 1px 3px rgba(30,27,75,.07);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.card:hover { box-shadow: 0 2px 8px rgba(79,70,229,.18); }
.card-title {
  font-size: .9rem;
  line-height: 1.45;
  color: #1e1b4b;
  word-break: break-word;
  white-space: pre-wrap;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 7px;
}
.due {
  font-size: .72rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 8px;
  background: #f1f5f9;
  color: #475569;
}
.due.over { background: #fee2e2; color: #b91c1c; }
.due.today { background: #ffedd5; color: #c2410c; }
.due.soon { background: #fef9c3; color: #a16207; }
.memo-mark { font-size: .72rem; color: #94a3b8; }

.card.placeholder {
  opacity: .35;
  border-style: dashed;
  box-shadow: none;
}
.card.ghost {
  position: fixed;
  z-index: 900;
  pointer-events: none;
  box-shadow: 0 10px 26px rgba(30,27,75,.28);
  transform: rotate(1.5deg);
  cursor: grabbing;
  opacity: .97;
}
.dragging-on, .dragging-on * { cursor: grabbing !important; }

/* ── 追加リストのプレースホルダ列 ── */
.list-add {
  width: 240px;
  flex: 0 0 240px;
  border: 2px dashed #c7d2fe;
  border-radius: 16px;
  background: rgba(255,255,255,.6);
  color: #4f46e5;
  font-size: .88rem;
  font-weight: 600;
  padding: 18px 12px;
  cursor: pointer;
  font-family: inherit;
  touch-action: manipulation;
}
.list-add:hover { background: #e0e7ff; }
.list-add .sub { display: block; font-size: .74rem; font-weight: 500; color: #6366f1; margin-top: 6px; }

/* ── モーダル ── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(30,27,75,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 800;
}
.overlay[hidden] { display: none; }
.modal {
  background: #fff;
  border-radius: 18px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px 20px 18px;
  box-shadow: 0 18px 50px rgba(30,27,75,.35);
}
.modal h2 { font-size: 1.1rem; color: #312e81; margin-bottom: 14px; }
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: .8rem;
  font-weight: 700;
  color: #4338ca;
  margin-bottom: 5px;
}
.field input[type="text"],
.field input[type="date"],
.field textarea,
.field select {
  width: 100%;
  border: 2px solid #c7d2fe;
  border-radius: 10px;
  padding: 10px;
  font-size: .92rem;
  font-family: inherit;
  color: #1e1b4b;
  background: #fff;
}
.field textarea { resize: vertical; min-height: 78px; line-height: 1.6; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: #4f46e5; }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 3px solid transparent;
  cursor: pointer;
  padding: 0;
  touch-action: manipulation;
}
.swatch.on { border-color: #1e1b4b; }

.modal-actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.btn {
  flex: 1;
  min-width: 110px;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: .92rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  touch-action: manipulation;
}
.btn-primary { background: #4f46e5; color: #fff; }
.btn-primary:hover { background: #4338ca; }
.btn-sub { background: #eef2ff; color: #4338ca; }
.btn-sub:hover { background: #e0e7ff; }
.btn-del { background: #fee2e2; color: #b91c1c; flex: 0 0 auto; min-width: 92px; }
.btn-del:hover { background: #fecaca; }

/* ── 有料版の案内 ── */
.locked-body p { font-size: .92rem; line-height: 1.75; color: #334155; margin-bottom: 12px; }
.locked-body ul { margin: 0 0 14px 1.1em; }
.locked-body li { font-size: .88rem; line-height: 1.7; color: #334155; margin-bottom: 4px; }
.locked-body .why {
  background: #f5f3ff;
  border-left: 4px solid #a5b4fc;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: .85rem;
  line-height: 1.7;
  color: #4338ca;
  margin-bottom: 14px;
}

/* ── 解説カード ── */
.card-box {
  background: #fff;
  border-radius: 20px;
  padding: 26px 22px;
  margin-top: 22px;
  box-shadow: 0 2px 16px rgba(79,70,229,.1);
}
.card-box h2 { font-size: 1.2rem; color: #312e81; margin-bottom: 14px; }
.card-box h3 { font-size: 1rem; color: #4338ca; margin: 18px 0 8px; }
.card-box p { font-size: .92rem; line-height: 1.85; color: #334155; margin-bottom: 12px; }
.card-box ul, .card-box ol { margin: 0 0 14px 1.2em; }
.card-box li { font-size: .92rem; line-height: 1.8; color: #334155; margin-bottom: 6px; }
.card-box strong { color: #312e81; }

.faq-item { border-top: 1px solid #eef2ff; padding: 14px 0 4px; }
.faq-item:first-of-type { border-top: none; }
.faq-q { font-size: .95rem; font-weight: 700; color: #312e81; margin-bottom: 6px; }
.faq-a { font-size: .9rem; line-height: 1.8; color: #475569; }

.note-line {
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: .88rem;
  line-height: 1.8;
  color: #4338ca;
  margin-top: 16px;
}
.note-line a { color: #4f46e5; font-weight: 700; }

.related-tools { display: grid; gap: 10px; }
.related-tool-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #e0e7ff;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: all .15s;
}
.related-tool-item:hover { background: #eef2ff; border-color: #a5b4fc; }
.related-tool-icon { font-size: 1.5rem; }
.related-tool-item strong { display: block; font-size: .92rem; color: #312e81; }
.related-tool-item p { font-size: .8rem; color: #64748b; margin: 2px 0 0; }

/* ── フッター ── */
footer {
  background: #fff;
  border-top: 1px solid #e2e8f0;
  padding: 22px 16px;
  text-align: center;
  font-size: .82rem;
  color: #64748b;
}
footer p { margin-bottom: 6px; }
footer a { color: #4f46e5; text-decoration: none; }
footer a:hover { text-decoration: underline; }
.amazon-notice { font-size: .72rem; color: #94a3b8; }

/* ── レスポンシブ ── */
@media (max-width: 600px) {
  .hero { padding: 14px 0 14px; }
  .hero-icon { font-size: 2.2rem; margin-bottom: 6px; }
  .hero h1 { font-size: 1.4rem; }
  .description { font-size: .87rem; }
  .view-tabs { grid-template-columns: repeat(2, 1fr); }
  .list { width: 240px; flex-basis: 240px; }
  .card-box { padding: 20px 16px; }
}

/* ── 印刷 ── */
@media print {
  header, footer, .view-tabs, .board-bar, .save-note, .add-card,
  .list-add, .overlay, .card-box, .hero-icon, .description { display: none !important; }
  body { background: #fff; }
  main { max-width: none; padding: 0; }
  .board-wrap { margin: 0; padding: 0; overflow: visible; }
  .board { display: block; width: auto; }
  .list {
    width: auto;
    max-height: none;
    box-shadow: none;
    border: 1px solid #94a3b8;
    margin-bottom: 12px;
    page-break-inside: avoid;
  }
  .cards { overflow: visible; }
  .card { box-shadow: none; page-break-inside: avoid; }
}
