/* Organizer screens: create form, link boxes, confirm dialog, results page. Tokens come from base.css. */

/* ---- shared bits ---- */
.org-error { color: var(--danger); font-weight: 600; font-size: 0.95rem; margin: 6px 0 0; }
.org-strong { font-weight: 700; }
.org-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.org-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.org-fieldset > legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
[aria-invalid="true"] { border-color: var(--danger); }
input.org-date, .org-link-input { direction: ltr; text-align: left; }
.org-submit { width: 100%; min-height: 52px; font-size: 1.1rem; }
.org-shortcuts { gap: 8px; }

/* ---- expected participants / add form ---- */
.org-addrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.org-addrow .grow { flex: 1 1 200px; min-width: 0; }
.org-reqcheck { margin: 0; white-space: nowrap; }
.org-expected { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.org-expected-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.org-expected-row .org-pname { flex: 1 1 140px; min-width: 0; }
.org-pname { overflow-wrap: anywhere; font-weight: 600; }

/* ---- link boxes ---- */
.org-linkbox { display: grid; gap: 8px; }
.org-linkbox label { margin: 0; }
.org-linkbox .hint { margin: 0; }
.org-link-input { display: block; width: 100%; font-size: 0.95rem; background: var(--bg); }
.org-linkbox-actions { gap: 8px; }
.org-admin-link { border-color: #e6cf9d; background: #fffdf7; }

/* ---- confirm dialog ---- */
.org-dialog { border: 0; padding: 0; border-radius: var(--radius); width: calc(100% - 32px); max-width: 440px; color: var(--text); background: var(--surface); box-shadow: 0 8px 40px rgba(37, 48, 43, 0.3); }
.org-dialog::backdrop { background: rgba(37, 48, 43, 0.5); }
.org-dialog-body { padding: 22px; }
.org-dialog-actions { justify-content: flex-start; }

/* ---- results header ---- */
.org-title-row { align-items: flex-start; }
.org-title { overflow-wrap: anywhere; margin: 0; }
.org-desc { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); }
.org-meta { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--muted); font-size: 0.95rem; }
.org-header-actions { gap: 8px; }
.org-linkslot:empty { display: none; }

/* ---- suggested windows ---- */
.org-tier { display: grid; gap: 10px; }
.org-tier + .org-tier { margin-top: 20px; }
.org-tier h3 { margin: 0; }
.org-tier-1 > h3 { color: #7a5410; }
.org-tier-2 > h3 { color: var(--danger); }
.org-win-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.org-win { border: 1px solid var(--line); border-inline-start: 5px solid var(--primary); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface); display: grid; gap: 6px; }
.org-win:focus { outline: 3px solid var(--focus); outline-offset: 2px; }
.org-win p { margin: 0; }
.org-win-t1 { border-style: dashed; border-inline-start: 5px dashed var(--accent); background: var(--warn-soft); }
.org-win-t2 { border-inline-start-color: var(--danger); background: #fdf6f5; }
.org-win-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.org-win-when { font-weight: 700; font-size: 1.05rem; overflow-wrap: anywhere; }
.org-win-count { font-weight: 600; color: var(--primary); }
.org-win-flag { font-weight: 600; overflow-wrap: anywhere; }
.org-win-flag.is-missing { color: var(--danger); }
.org-win-flag.is-waiting { color: #7a5410; }
.org-group { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.org-group-label { font-weight: 600; font-size: 0.9rem; min-width: 5.5em; }
.org-group-can .org-group-label { color: var(--primary); }
.org-group-cannot .org-group-label { color: var(--muted); }
.org-group-pending .org-group-label { color: #7a5410; }
.org-names { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.org-names li { max-width: 100%; padding: 2px 10px; border-radius: 999px; background: var(--primary-soft); overflow-wrap: anywhere; }
.org-group-cannot .org-names li { background: #ecefec; color: var(--muted); }
.org-group-pending .org-names li { background: transparent; border: 1px dashed #c9b27a; color: #7a5410; }
.org-names li.is-missing { background: var(--danger-soft); color: var(--danger); font-weight: 700; }
.org-more { justify-self: start; }
.org-banner-list { margin: 0; padding-inline-start: 22px; }

/* ---- heatmap placeholder (filled by the lead) ---- */
.org-heatmap:empty { display: none; }

/* ---- participants ---- */
.org-plist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.org-pcard { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; display: grid; gap: 8px; align-content: start; background: var(--surface); min-width: 0; }
.org-pcard.is-pending { background: var(--bg); }
.org-pcard-head { min-width: 0; font-size: 1.05rem; }
.org-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.org-status-answered { background: var(--primary-soft); color: var(--primary); }
.org-status-none { background: #e6edf6; color: #234e80; }
.org-status-pending { background: #ecefec; color: var(--muted); }
.org-actions > summary { min-height: 44px; display: list-item; padding-block: 9px; cursor: pointer; color: var(--primary); font-weight: 600; list-style-position: inside; }
.org-actions-row { gap: 8px; padding-bottom: 4px; }
.org-newlink { padding: 12px; border-radius: var(--radius-sm); background: var(--warn-soft); }
.org-rename { display: grid; gap: 6px; }
.org-rename-row { gap: 8px; }
.org-rename-row .grow { flex: 1 1 140px; min-width: 0; }
.org-addform { border-top: 1px solid var(--line); padding-top: var(--gap); }
.org-empty { grid-column: 1 / -1; }

@media (max-width: 480px) {
  .org-two { grid-template-columns: 1fr; }
  .org-plist { grid-template-columns: 1fr; }
  .org-header-actions .btn, .org-actions-row .btn { flex: 1 1 calc(50% - 8px); padding-inline: 10px; }
  .org-dialog-actions .btn { flex: 1 1 100%; }
}

/* ---- visual overlap view (heat mode of the week grid) ---- */
.org-heatmap { margin-block: 16px; }
.org-heatmap .wg-cell { cursor: pointer; }
.org-heatmap .wg-cell.is-picked { box-shadow: inset 0 0 0 3px var(--focus); z-index: 1; }
.wg-heat-count { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; pointer-events: none; color: var(--text); }
.wg-heat-3 .wg-heat-count, .wg-heat-4 .wg-heat-count { color: #fff; }
.org-heat-legend { display: flex; align-items: center; gap: 6px; font-size: 0.9rem; color: var(--muted); flex-wrap: wrap; }
.org-heat-legend i { display: inline-block; width: 22px; height: 14px; border-radius: 3px; border: 1px solid var(--line); }
.org-heat-detail { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--primary-soft); }
.org-heat-detail h3 { margin-bottom: 4px; }
.org-heat-detail dl { margin: 8px 0 0; display: grid; gap: 6px; }
.org-heat-detail dt { font-weight: 650; }
.org-heat-detail dd { margin: 0; }

/* Dates and times never break across lines (a split range such as "09:00–" / "09:30" reads wrongly in RTL). */
.org-win-when bdi, .org-heat-detail h3 bdi, .org-pcard bdi { white-space: nowrap; }
.org-heat-detail h3 { overflow-wrap: anywhere; }
