/* POP催事カレンダー独自の見た目（共通の style.css のあとに読む）。色は共通の変数を使う
   状態の色：予定＝--warning、確定＝--accent、終了（実績入力済）＝--success */
:root,[data-accent]{
  --pop-planned:var(--warning);
  --pop-confirmed:var(--accent);
  --pop-done:var(--success);
  --pop-planned-soft:color-mix(in oklab,var(--warning) 14%,var(--surface));
  --pop-confirmed-soft:var(--accent-soft);
  --pop-done-soft:color-mix(in oklab,var(--success) 13%,var(--surface));
  --pop-sun:var(--danger);
  --pop-sat:var(--info);
}
.auth-box{max-width:440px;margin:0 auto}
.pop-user{font-size:.85rem}
.header-actions form{margin:0}

/* 見出し・月の移動 */
.pop-nav{align-items:center}
.pop-month{font-weight:800;font-size:1.5rem;line-height:1;min-width:6.2em;text-align:center;font-variant-numeric:tabular-nums}

/* 今月のまとめ */
.pop-summary{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);margin:0 0 16px;overflow:hidden}
.pop-summary > div{padding:12px 16px;border-left:1px dashed var(--line)}
.pop-summary > div:first-child{border-left:0}
.pop-summary dt{font-size:.75rem;color:var(--muted);font-weight:600}
.pop-summary dd{margin:2px 0 0;font-weight:700;font-size:1.3rem;font-variant-numeric:tabular-nums;white-space:nowrap}
.pop-summary dd small{font-size:.75rem;color:var(--muted);font-weight:500;margin-left:2px}
.pop-rate{height:5px;background:var(--surface-3);border-radius:3px;margin-top:6px;overflow:hidden}
.pop-rate i{display:block;height:100%;background:var(--pop-done)}

/* カレンダー＋その日の催事 */
.pop-layout{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:16px;align-items:start}
.pop-cal{overflow:hidden;padding:0}
.pop-dow,.pop-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr))}
.pop-dow div{font-size:.75rem;text-align:center;padding:8px 0;color:var(--muted);border-bottom:1px solid var(--line);font-weight:700;background:var(--surface-2)}
.pop-dow div:first-child{color:var(--pop-sun)}
.pop-dow div:last-child{color:var(--pop-sat)}
.pop-day{min-height:112px;border:0;border-right:1px solid var(--line);border-bottom:1px solid var(--line);padding:6px 5px;cursor:pointer;background:none;text-align:left;display:flex;flex-direction:column;gap:3px;min-width:0;color:var(--ink);font:inherit}
.pop-grid .pop-day:nth-child(7n){border-right:0}
.pop-day:hover{background:var(--surface-2)}
.pop-day.out{opacity:.42}
.pop-day.sel{box-shadow:inset 0 0 0 2px var(--accent)}
.pop-num{font-size:.8rem;font-weight:700;font-variant-numeric:tabular-nums;width:24px;height:24px;display:grid;place-items:center;border-radius:50%;flex:none}
.pop-day.sun .pop-num{color:var(--pop-sun)}
.pop-day.sat .pop-num{color:var(--pop-sat)}
.pop-day.today .pop-num{background:var(--accent);color:var(--accent-ink)}
.pop-chip{display:block;font-size:.72rem;line-height:1.35;padding:2px 6px;border-radius:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border-left:3px solid var(--pop-planned);background:var(--pop-planned-soft)}
.pop-chip.confirmed{border-color:var(--pop-confirmed);background:var(--pop-confirmed-soft)}
.pop-chip.done{border-color:var(--pop-done);background:var(--pop-done-soft)}
.pop-chip b{font-weight:700;font-variant-numeric:tabular-nums;margin-right:3px}
.pop-more{font-size:.7rem;color:var(--muted);padding-left:4px}

.pop-side{padding:16px;position:sticky;top:calc(var(--header-h) + 12px)}
.pop-side-head{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:12px;scroll-margin-top:calc(var(--header-h) + 12px)}
.pop-side-head h2{font-size:1.05rem;margin:0}
.pop-ev{border:1px solid var(--line);border-radius:var(--r);padding:12px 12px 12px 16px;margin-bottom:10px;position:relative}
.pop-ev::before{content:"";position:absolute;left:0;top:12px;bottom:12px;width:4px;border-radius:0 3px 3px 0;background:var(--pop-planned)}
.pop-ev.confirmed::before{background:var(--pop-confirmed)}
.pop-ev.done::before{background:var(--pop-done)}
.pop-ev h3{font-size:1rem;margin:0 0 4px;line-height:1.4}
.pop-meta{font-size:.82rem;color:var(--muted)}
.pop-ev dl{display:grid;grid-template-columns:auto 1fr;gap:2px 12px;margin:10px 0 0;font-size:.82rem}
.pop-ev dt{color:var(--muted)}
.pop-ev dd{margin:0;text-align:right;font-variant-numeric:tabular-nums;font-weight:600}
.pop-memo{font-size:.82rem;margin:8px 0 0;padding-top:8px;border-top:1px dashed var(--line);white-space:pre-wrap;word-break:break-word}
.pop-actions{margin-top:10px;display:flex;gap:6px;justify-content:flex-end}
.pop-empty{color:var(--muted);font-size:.9rem;padding:18px 4px;text-align:center}
.pop-legend{display:flex;gap:12px;font-size:.75rem;color:var(--muted);margin-top:10px;flex-wrap:wrap}
.pop-legend span::before{content:"";display:inline-block;width:10px;height:10px;border-radius:2px;margin-right:4px;vertical-align:-1px;background:var(--pop-planned)}
.pop-legend .c::before{background:var(--pop-confirmed)}
.pop-legend .d::before{background:var(--pop-done)}

/* 月の一覧（横に長いので横スクロール） */
.pop-list{margin-top:16px}
.pop-list .card-head h2{margin:0;font-size:1.05rem}
.pop-scroll{overflow-x:auto}
.pop-scroll table{min-width:960px}
.pop-scroll th,.pop-scroll td{white-space:nowrap}
.pop-scroll tbody tr{cursor:pointer}
.pop-scroll tfoot td{font-weight:700;background:var(--surface-2)}

/* 追加・編集のダイアログ */
.pop-modal{width:min(640px,calc(100vw - 32px))}
.pop-fs{border:0;padding:0;margin:14px 0 0;min-width:0}
.pop-fs legend{font-weight:700;font-size:.9rem;padding:0 0 2px;margin-bottom:8px;border-bottom:2px solid var(--accent)}
.pop-modal .modal-body > .field{margin-top:14px}
.pop-modal .modal-body > .field:first-child{margin-top:0}
.pop-del{margin-right:auto}
.pop-del[hidden]{display:none}

@media (max-width:980px){
  .pop-layout{grid-template-columns:1fr}
  .pop-side{position:static}
  .pop-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
  .pop-summary > div{border-left:0;border-top:1px dashed var(--line)}
  .pop-summary > div:nth-child(-n+2){border-top:0}
  .pop-summary > div:nth-child(even){border-left:1px dashed var(--line)}
  .pop-summary > div:last-child{grid-column:1/-1;border-left:0}
}
@media (max-width:640px){
  .pop-head .actions{width:100%;justify-content:space-between}
  .pop-month{font-size:1.25rem;min-width:5.5em}
  .pop-day{min-height:60px;padding:4px 2px;align-items:center}
  .pop-dots{display:flex;gap:3px;flex-wrap:wrap;justify-content:center}
  .pop-chip{font-size:0;padding:0;width:8px;height:8px;border-radius:50%;border:0;background:var(--pop-planned)}
  .pop-chip.confirmed{background:var(--pop-confirmed)}
  .pop-chip.done{background:var(--pop-done)}
  .pop-more{font-size:.65rem;padding:0}
}
