#agenda-editor { border: 0; border-radius: 14px; padding: 0; margin: auto; width: min(1500px, calc(100vw - 32px)); max-width: none; height: min(940px, calc(100dvh - 32px)); max-height: none; color: var(--ink); background: var(--bg); box-shadow: 0 24px 100px #0005; }
#agenda-editor::backdrop { background: #15222db3; backdrop-filter: blur(3px); }
.ap-shell { display: flex; flex-direction: column; height: 100%; }
.ap-header { display: flex; justify-content: space-between; align-items: start; gap: 20px; padding: 16px 24px 8px; background: var(--surface); }
.ap-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .16em; color: var(--accent-dark); margin-bottom: 4px; }
.ap-header h2 { font-size: 24px; font-weight: 600; letter-spacing: -.035em; }
.ap-header p:last-child { color: var(--ink-soft); margin-top: 4px; font-size: 12px; }
.ap-meta { background: var(--surface); }
.ap-meta > summary { cursor: pointer; padding: 4px 24px 10px; font-size: 12px; color: var(--ink-soft); }
.ap-meta > summary span { color: var(--ink-faint); }
.ap-toolbar { display: flex; gap: 14px; align-items: end; padding: 0 28px 18px; background: var(--surface); }
.ap-toolbar > label { flex: 1; font-size: 11px; color: var(--ink-soft); }
.ap-toolbar input { margin-top: 4px; }
.ap-history { display: flex; gap: 4px; padding-bottom: 3px; }
#agenda-editor button:disabled { opacity: .35; cursor: default; }
.ap-hint { padding: 10px 28px; border-top: 1px solid var(--line-soft); color: var(--ink-soft); font-size: 12px; background: #eeeee6; }
.ap-board { display: flex; gap: 16px; padding: 20px 28px; overflow: auto; flex: 1; min-height: 0; align-items: stretch; }
.ap-session { flex: 1 0 310px; min-width: 310px; max-width: 470px; background: #eeece5; border: 1px solid var(--line); border-radius: 9px; display: flex; flex-direction: column; overflow: auto; }
.ap-session-head { padding: 12px; background: #faf9f5; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.ap-session-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; min-height: 22px; }
.ap-session-heading h3 { font-size: 15px; }
.ap-session-times { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 7px; }
.ap-session-times label { font-size: 10px; color: var(--ink-soft); min-width: 0; }
.ap-session-times input { margin-top: 3px; padding: 7px 5px; font-size: 12px; min-width: 0; width: 100%; }
.ap-capacity { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; margin: 12px 0 6px; color: var(--ink-soft); }
.ap-capacity strong { color: var(--success); }
.ap-capacity.ap-over strong { color: var(--danger); }
.ap-meter { height: 4px; border-radius: 4px; background: #dfddd4; overflow: hidden; }
.ap-meter span { height: 100%; display: block; background: #668573; }
.ap-over + .ap-meter span { background: var(--accent); }
.ap-dropzone { padding: 12px; min-height: 130px; flex: 1; }
.ap-chapter { background: var(--surface); border: 1px solid #dad7cd; border-left: 3px solid #7e9387; border-radius: 7px; margin-bottom: 10px; box-shadow: 0 2px 3px #00000004; position: relative; }
.ap-chapter-head { display: flex; gap: 6px; align-items: center; padding: 12px 12px 5px 6px; cursor: grab; }
.ap-chapter-head h4 { flex: 1; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.ap-duration { font: 11px 'JetBrains Mono', monospace; color: var(--ink-soft); white-space: nowrap; }
.ap-grip { background: transparent; border: 0; color: #858980; font-size: 20px; cursor: grab; padding: 2px 4px; border-radius: 4px; }
.ap-grip:active { cursor: grabbing; }
.ap-chapter-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 12px 10px; }
.ap-progress { font-size: 11px; color: var(--ink-soft); }
.ap-move { max-width: 185px; min-width: 0; border: 1px solid var(--line); border-radius: 4px; background: #faf9f6; color: var(--ink-soft); padding: 5px 4px; font-size: 11px; cursor: pointer; }
.ap-details { border-top: 1px solid var(--line-soft); }
.ap-details summary { list-style: none; cursor: pointer; padding: 8px 12px; font-size: 11px; color: var(--ink-soft); display: flex; justify-content: space-between; }
.ap-details summary::-webkit-details-marker { display: none; }
.ap-details[open] summary { background: #f5f4ef; }
.ap-items { padding: 0 8px; }
.ap-item { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.ap-item-title { display: flex; align-items: center; gap: 5px; }
.ap-grow { flex: 1; min-width: 0; }
.ap-item-state { display: block; color: var(--ink-faint); font-size: 10px; margin-bottom: 3px; }
.ap-item input { padding: 6px; font-size: 12px; }
.ap-item-duration { flex: 0 0 55px; font-size: 10px; color: var(--ink-soft); }
.ap-item-duration input { margin-top: 3px; }
.ap-item-tools { display: flex; gap: 5px; justify-content: end; margin-top: 6px; }
.ap-chapter-order { display: flex; justify-content: end; border-top: 1px solid var(--line-soft); padding: 0 4px; }
.ap-chapter-order .btn { padding: 2px 8px; }
.ap-drop-end { border: 1px dashed #c3c6bb; color: #777c70; border-radius: 5px; padding: 16px 8px; font-size: 11px; text-align: center; }
.ap-drop-target { outline: 2px solid var(--accent); outline-offset: 2px; background: var(--accent-soft); }
.ap-dragging { opacity: .45; }
[data-drag] { touch-action: none; user-select: none; }
.ap-drag-label { position: fixed; pointer-events: none; z-index: 10; padding: 9px 14px; background: var(--ink); color: white; border-radius: 6px; box-shadow: 0 5px 20px #0003; font-size: 13px; max-width: 240px; }
.ap-add-session { flex: 0 0 100px; background: transparent; border: 1px dashed var(--line); border-radius: 9px; padding: 15px; color: var(--ink-soft); align-self: start; min-height: 110px; font-size: 12px; }
.ap-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 28px; background: var(--surface); border-top: 1px solid var(--line); }
.ap-footer p { font-size: 12px; }
.ap-footer small { display: block; color: var(--ink-faint); font-size: 11px; margin-top: 3px; }
.ap-footer-actions { display: flex; gap: 8px; }
#agenda-editor :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media(max-width: 700px) {
  #agenda-editor { width: 100vw; height: 100dvh; border-radius: 0; }
  .ap-header { padding: 16px; }
  .ap-header { flex-wrap: wrap; gap: 8px; }
  .ap-meta > summary { padding: 0 16px 10px; }
  .ap-meta > summary span { display: none; }
  .ap-header h2 { font-size: 22px; }
  .ap-toolbar { padding: 0 16px 12px; flex-wrap: wrap; gap: 8px; }
  .ap-toolbar > label { flex: 1 0 40%; }
  .ap-history { flex: 1; justify-content: end; }
  .ap-hint { padding: 8px 16px; }
  .ap-board { padding: 12px 16px; flex-direction: column; }
  .ap-session { flex: 0 0 auto; min-width: 0; width: 100%; max-width: none; overflow: visible; }
  .ap-session-head { position: static; }
  .ap-footer { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .ap-footer-actions { width: 100%; justify-content: end; }
  .ap-add-session { min-height: 50px; flex-basis: auto; width: 100%; }
}
