/* v4 Story Planner — corkboard, beat timeline, beat checklist */
.pl-toolbar h2 { font-size: 22px; }
.pl-controls { margin-top: 12px; }
.pl-inline { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; font-size: 15px; }
.pl-inline select, .pl-inline input { margin: 0; width: auto; min-width: 0; max-width: 340px; }
.pl-sum { font-weight: 700; }
.pl-sum.ok { color: #1d7a4a; } .pl-sum.thin { color: #9a6700; } .pl-sum.drift { color: #3e63dd; } .pl-sum.missing { color: var(--danger); }
.pl-empty { border-style: dashed; }

/* timeline */
.pl-timeline { overflow: hidden; }
.pl-track-label { margin: 14px 0 4px; }
.pl-track { position: relative; height: 34px; background: rgba(127, 127, 127, .08); border-radius: 8px; }
.pl-track.planned { margin-bottom: 4px; }
.pl-seg { position: absolute; top: 0; bottom: 0; border-right: 2px solid var(--card); background: rgba(29, 92, 63, .16); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pl-track.actual .pl-seg { background: rgba(62, 99, 221, .18); }
.pl-seg.empty { background: transparent; }
.pl-seg span { font-size: 11px; font-weight: 700; color: var(--muted); }
.pl-beat { position: absolute; top: -5px; bottom: -5px; width: 0; }
.pl-beat i { position: absolute; left: -10px; top: 50%; margin-top: -10px; width: 20px; height: 20px; border-radius: 50%; background: #1d7a4a; border: 2px solid var(--card); box-shadow: 0 0 0 1px rgba(0,0,0,.15);
  font-style: normal; font-size: 10px; font-weight: 800; color: #fff; display: flex; align-items: center; justify-content: center; line-height: 1; }
.pl-beat:hover { z-index: 5; }
.pl-beat-no { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; border-radius: 50%; background: #1d7a4a; color: #fff; font-size: 11px; font-weight: 800; }
.pl-beat-no.thin { background: #e8b23a; } .pl-beat-no.drift { background: #3e63dd; } .pl-beat-no.missing { background: var(--danger); }
.pl-beat.thin i { background: #e8b23a; } .pl-beat.drift i { background: #3e63dd; } .pl-beat.missing i { background: var(--danger); }
.pl-scale { display: flex; justify-content: space-between; margin-top: 4px; }

/* beat checklist */
.pl-beats summary { cursor: pointer; }
.pl-beat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin-top: 12px; }
.pl-beat-row { border: 1px solid var(--line); border-left: 4px solid #1d7a4a; border-radius: 10px; padding: 10px 12px; background: var(--card); }
.pl-beat-row.thin { border-left-color: #e8b23a; } .pl-beat-row.drift { border-left-color: #3e63dd; } .pl-beat-row.missing { border-left-color: var(--danger); }
.pl-beat-head { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.pl-state { margin-left: auto; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 12px; background: #e6f4ea; color: #1d5c3f; }
.pl-state.thin { background: #fff4d6; color: #7a5b00; } .pl-state.drift { background: #e8eefb; color: #2c4a7c; } .pl-state.missing { background: #fdecea; color: var(--danger); }
.pl-note { margin-top: 4px; }
.pl-map { margin-top: 8px; font-size: 14px; padding: 6px 8px; }

/* corkboard */
.pl-board-head { margin: 8px 0 10px; }
.pl-part { font-weight: 800; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 16px 0 8px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.pl-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-bottom: 8px; }
.pl-card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 10px 18px; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); display: flex; flex-direction: column; gap: 6px; cursor: grab; transition: box-shadow .15s, transform .15s; }
.pl-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; border-radius: 12px 0 0 12px; background: var(--pl-color, transparent); }
.pl-card:hover { box-shadow: 0 4px 14px rgba(16, 24, 40, .1); }
.pl-card.dragging { opacity: .45; transform: scale(.98); }
.pl-card.drop-before { box-shadow: -4px 0 0 0 var(--accent, #e8b23a); }
.pl-card.drop-after { box-shadow: 4px 0 0 0 var(--accent, #e8b23a); }
.pl-card-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.pl-no { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.pl-status { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 12px; background: #eef2ee; color: var(--muted); white-space: nowrap; }
.pl-status.s-outline { background: #e8eefb; color: #2c4a7c; } .pl-status.s-drafting { background: #fff4d6; color: #7a5b00; }
.pl-status.s-revised { background: #f3e8fb; color: #6b2c91; } .pl-status.s-final { background: #e6f4ea; color: #1d5c3f; }
.pl-title { margin: 0; font-size: 17px; line-height: 1.25; }
.pl-brief { margin: 0; font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pl-words { display: flex; align-items: center; gap: 8px; }
.pl-wbar { flex: 1; height: 6px; border-radius: 4px; background: rgba(127, 127, 127, .15); overflow: hidden; }
.pl-wbar div { height: 100%; background: #e8b23a; }
.pl-wbar div.met { background: #30a46c; } .pl-wbar div.over { background: #3e63dd; }
.pl-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.pl-chip { font-size: 12px; padding: 2px 8px; border-radius: 12px; background: rgba(127, 127, 127, .1); color: var(--ink); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-chip.beat { background: #e8eefb; color: #2c4a7c; font-weight: 600; }
.pl-notes { margin: 0; color: var(--muted); }
.pl-actions { display: flex; align-items: center; gap: 2px; margin-top: auto; padding-top: 6px; border-top: 1px solid var(--line); flex-wrap: nowrap; }
.pl-actions button.small { padding: 6px 9px; font-size: 14px; white-space: nowrap; }
.pl-actions button.ghost { padding: 6px 6px; }
.pl-more summary { padding: 4px 8px !important; }
.pl-more { position: relative; margin-left: auto; }
.pl-more summary { list-style: none; cursor: pointer; padding: 4px 10px; border-radius: 8px; font-weight: 800; }
.pl-more summary::-webkit-details-marker { display: none; }
.pl-more summary:hover { background: rgba(127, 127, 127, .12); }
.pl-menu { position: absolute; right: 0; bottom: 110%; z-index: 20; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(16, 24, 40, .16); padding: 6px; display: flex; flex-direction: column; min-width: 190px; }
.pl-menu button { text-align: left; justify-content: flex-start; width: 100%; }

/* trash, modals */
.pl-trash summary { cursor: pointer; }
.pl-trash-row { padding: 8px 0; border-bottom: 1px solid var(--line); }
.pl-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.pl-swatch input { display: none; }
.pl-swatch span { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; color: var(--muted); font-size: 14px; }
.pl-swatch input:checked + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.pl-split-list { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.pl-split-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-bottom: 1px solid var(--line); font-weight: 400; font-size: 14px; margin: 0; cursor: pointer; }
.pl-split-row input { width: auto; margin-top: 4px; }
.pl-split-row.disabled { opacity: .6; cursor: default; }

@media (max-width: 700px) {
  .pl-board, .pl-beat-grid { grid-template-columns: 1fr; }
  .pl-card { cursor: default; }
  .pl-drag-hint { display: none; }
  .pl-inline { flex-wrap: wrap; width: 100%; }
  .pl-inline select { max-width: 100%; width: 100%; }
}
.pl-para-no { display: inline-block; min-width: 38px; color: var(--muted); }
