/* Shared, scoped presentation extracted from the approved pre-change My Hub
   speech editor pinned in source-manifest.approvedSpeechDataUiUnify.
   The Required/Elective/Workshop sections are Richard's explicit amendment. */
.speech-data-editor{
 --cream:#FBF8F2;--paper:#FFFDF9;--ink:#27313A;--muted:#7D746D;--line:#E9E1D7;--rose-strong:#9B5B6D;--sage:#DCE7D8;
 color:var(--ink);font-family:"DFYuan-W7","DFYuan-Md","Microsoft JhengHei UI","Microsoft JhengHei","Noto Sans TC",system-ui,sans-serif;
}
.speech-data-editor.speech-data-editor{display:block;min-width:0}
.speech-data-editor *{box-sizing:border-box}
.speech-data-editor button,.speech-data-editor input{font:inherit;color:inherit}
.speech-data-editor .speech-title-label{display:block;margin:0 0 14px;font-size:12px;color:var(--muted);font-weight:700}
.speech-data-editor .speech-title-row{display:flex;gap:6px;align-items:center;margin-top:5px}
.speech-data-editor .speech-title-field{min-width:0;flex:1;width:100%;min-height:44px;border:1px solid var(--line);border-radius:10px;padding:10px;background:var(--paper);color:var(--ink);font:inherit;font-size:13px}
.speech-data-editor .secondary{border:1px solid #DDD3C9;border-radius:10px;background:#fff;padding:9px 11px;font-size:12px;font-weight:700;cursor:pointer}
.speech-data-editor .speech-title-row .secondary{flex:0 0 44px;width:44px;min-height:44px;padding:0;font-size:15px;color:var(--rose-strong);border-color:var(--line)}
.speech-data-editor .speaker-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;min-width:0}
.speech-data-editor .speaker-grid .field{margin:0;padding:0;border:0;min-width:0;background:transparent}
.speech-data-editor .education-field-label{display:block;font-size:11px;color:var(--muted);font-weight:650;margin-bottom:5px}
.speech-data-editor .education-field-value{display:block;font-size:13px;font-weight:600}
.speech-data-editor .education-picker-trigger{box-sizing:border-box;display:block;width:100%;text-align:left;min-height:44px;padding:11px 32px 11px 12px;border:1px solid var(--line);border-radius:11px;background:var(--paper);font-size:13px;font-weight:500;line-height:1.5;position:relative;cursor:pointer;overflow-wrap:anywhere}
.speech-data-editor .education-picker-trigger::after{content:"›";position:absolute;right:12px;top:50%;transform:translateY(-50%);color:var(--muted)}
.speech-data-editor .education-choice-dialog{box-sizing:border-box;inset:0;margin:auto;width:calc(100% - 24px);max-width:680px;max-height:calc(100dvh - 24px);padding:0;border:1px solid var(--line);border-radius:18px;background:var(--cream);color:var(--ink);box-shadow:0 18px 60px #27313a33;overflow:hidden;font:inherit}
.speech-data-editor .education-choice-dialog[open]{display:flex;flex-direction:column}
.speech-data-editor .education-choice-dialog::backdrop{background:#27313a66}
.speech-data-editor .education-choice-header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-shrink:0;padding:14px 16px;border-bottom:1px solid var(--line)}
.speech-data-editor .education-choice-header h2{font-size:18px;line-height:1.5;margin:0}
.speech-data-editor .education-choice-header button{min-height:44px;flex-shrink:0}
.speech-data-editor .speaker-grid .education-choice-dialog>.office-list,#myhub-v3 #myhubArrangementEditor .speaker-grid .education-choice-dialog>.office-list{display:grid;flex:1 1 auto;min-height:72px;max-height:none;overflow:auto;overscroll-behavior:contain;gap:8px;padding:16px;scroll-padding:16px}
.speech-data-editor .speaker-grid .office-list{display:grid;gap:5px;max-height:230px;overflow:auto;padding:2px}
.speech-data-editor .speaker-grid .choice{display:block;width:100%;text-align:left;font-size:13px;line-height:1.5;padding:10px;min-height:44px;background:var(--paper);border:1px solid #dac9bb;border-radius:11px;cursor:pointer}
.speech-data-editor .speaker-grid .choice[aria-pressed="true"]{border-color:#61744e;background:#eef1e7;box-shadow:inset 3px 0 #61744e}
.speech-data-editor .speaker-grid .section-title{margin:0;font-size:12px;color:#6e6258}
.speech-data-editor .education-choice-group{display:grid;gap:5px;min-width:0}
.speech-data-editor .education-choice-note{font-size:12px;line-height:1.5;color:var(--muted);margin:7px 0}
.speech-data-editor button:focus-visible,.speech-data-editor summary:focus-visible{outline:3px solid #61744e;outline-offset:2px}
.speech-data-editor button:disabled,.speech-data-editor input:disabled{opacity:.5;cursor:default}
.speech-data-editor .arrangement-footer{display:flex;gap:10px;margin-top:18px;padding-top:14px;border-top:1px solid var(--line)}
.speech-data-editor .arrangement-footer>button{flex:1;width:auto;min-height:44px;margin:0;font-size:13px;font-weight:700;cursor:pointer}
.speech-data-editor .speaker-save{background:var(--sage);color:var(--ink);border:0;border-radius:10px}
.speech-data-editor .speaker-save:not(:disabled){background:#3f6650;color:#fff;font-weight:700}
.speech-data-page{margin:0;background:#FBF8F2;min-height:100dvh}
.speech-data-page .pagebar{position:sticky;top:0;z-index:3;background:rgba(251,248,242,.94);backdrop-filter:blur(12px);min-height:66px;display:flex;align-items:center;gap:10px;padding:10px 14px;border-bottom:1px solid rgba(229,219,209,.8)}
.speech-data-page .pagebar h2{min-width:0;font-size:18px;margin:0;overflow-wrap:anywhere}
.speech-data-page .back{width:40px;height:40px;border-radius:50%;border:1px solid #E5D9CF;background:#FFFDF9;display:grid;place-items:center;cursor:pointer}
.speech-data-page .pagebody{padding:16px;max-width:680px;width:100%;margin:0 auto}
.speech-data-editor.speech-editor{max-width:680px;margin:0 auto}
.miv9 .modal.speech-data-dialog{position:fixed;inset:0;z-index:75;width:100%;max-width:none;height:100dvh;max-height:none;border:0;border-radius:0;padding:0;overflow:auto;background:#FBF8F2}
.miv9 .speech-data-dialog .pagebar{justify-content:flex-start}
.miv9 .speech-data-dialog .pagebar h2{font-size:18px;margin:0}
.miv9 .speech-data-dialog .pagebody{max-height:none;overflow:visible}
.miv9 .speech-data-dialog .arrangement-footer{display:flex}
@media(min-width:640px){.speech-data-editor .speaker-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.speech-data-editor .speaker-grid .wide{grid-column:1/-1}}

.speech-data-page .pagebar>.lang{margin-left:auto;flex-shrink:0;min-height:44px;border:1px solid rgba(200,169,107,.55);background:rgba(255,253,249,.82);border-radius:999px;padding:7px 10px;min-width:62px;font-size:12px;font-weight:700;cursor:pointer;box-shadow:0 2px 8px rgba(90,75,65,.05)}

#v18Dialog.speech-data-title-dialog{position:fixed;inset:0;margin:0;width:100%;max-width:none;height:100dvh;max-height:none;border:0;border-radius:0;padding:0;background:#FBF8F2;overflow:auto}
#v18Dialog.speech-data-title-dialog .dlg-head{position:sticky;top:0;min-height:66px;display:flex;align-items:center;gap:10px;padding:10px 14px;border-bottom:1px solid #E9E1D7;background:#FBF8F2}
#v18Dialog.speech-data-title-dialog .dlg-head h2{font-size:18px;margin:0}
#v18Dialog.speech-data-title-dialog .dlg-head .close{order:-1;width:40px;height:40px;border:1px solid #E5D9CF;border-radius:50%;background:#FFFDF9}
#v18Dialog.speech-data-title-dialog .dlg-body,#v18Dialog.speech-data-title-dialog .dlg-foot{width:100%;max-width:680px;margin:0 auto;padding:16px}
#v18Dialog.speech-data-title-dialog .dlg-foot{display:flex;gap:10px;border-top:1px solid #E9E1D7}
#v18Dialog.speech-data-title-dialog .dlg-foot button{flex:1;min-height:44px;border-radius:10px;font-size:13px;font-weight:700}
#v18Dialog.speech-data-title-dialog .speech-title-language{margin-left:auto;min-height:44px;border:1px solid #C8A96B;border-radius:999px;padding:7px 10px;background:#FFFDF9}
#v18Dialog.speech-data-title-dialog:not([open]){display:none}

/* The agenda host retains its own outer save/leave transaction. */
.agenda-list-speech-page.agenda-list-row{display:block;border:0;background:#FBF8F2;padding:0;min-height:0}
.agenda-list-speech-page>.agenda-list-cells{display:none}
.agenda-list-speech-page .agenda-list-speech-fields{box-sizing:border-box;display:block;margin:0 auto;padding:16px;max-width:680px}
.agenda-list-speech-page .agenda-review-field{display:block;margin:0 0 12px}
#speechLeaveNote{max-width:min(92vw,480px);border:1px solid #E9E1D7;border-radius:16px;padding:20px;background:#FFFDF9;color:#27313A}
#speechLeaveNote::backdrop{background:#27313A66}
#speechLeaveNote h2{font-size:18px;margin:0 0 14px}
#speechLeaveNote button{display:block;width:100%;margin-top:10px;min-height:44px}
.agenda-list-speech-page .speaker-grid>.agenda-review-field:first-child{grid-column:auto}

.agenda-list-speech-page .speech-data-context{box-sizing:border-box;max-width:680px;margin:0 auto;padding:10px 16px 0;color:#7D746D;font-size:13px;overflow-wrap:anywhere}

/* The speech page is a native top-layer window with its own normal scroll. */
.agenda-speech-dialog{position:fixed;inset:0;margin:0;width:100%;max-width:none;height:100dvh;max-height:none;padding:0;border:0;border-radius:0;background:#FBF8F2;overflow:hidden}
.agenda-speech-dialog:not([open]){display:none}
.agenda-speech-dialog::backdrop{background:#27313a66}
.agenda-speech-scroll{box-sizing:border-box;height:100%;overflow:auto;overscroll-behavior:contain;padding-bottom:env(safe-area-inset-bottom,0px)}
.agenda-speech-dialog .agenda-list-speech-page{min-height:0}
.agenda-speech-dialog .agenda-list-speech-page>.pagebar{position:static}
.agenda-list-editor .agenda-speech-dialog .agenda-speech-scroll>.agenda-review-actions{box-sizing:border-box;position:static;max-width:680px;margin:0 auto;padding:16px}
.agenda-speech-dialog .agenda-review-note{box-sizing:border-box;max-width:680px;margin:0 auto;padding:0 16px 16px}
/* Added signal controls only; the existing Speech Details fields stay untouched. */
.speech-timing{grid-column:1/-1;margin-top:16px}
.speech-timing-chips{display:flex;gap:8px}
.speech-timing .speech-timing-chip{flex:1;min-width:0;min-height:44px;padding:8px;border:1px solid transparent;border-radius:10px;font:inherit;font-size:16px;font-weight:600;line-height:1.4;font-variant-numeric:tabular-nums;text-align:center;cursor:pointer}
.speech-timing .signal-0,.speech-timing-dialog .signal-0{background:#deecd9;color:#2b4f32}
.speech-timing .signal-1,.speech-timing-dialog .signal-1{background:#f6eab9;color:#5e4926}
.speech-timing .signal-2,.speech-timing-dialog .signal-2{background:#f2d9d8;color:#783e3e}
.speech-timing-chip:focus-visible,.speech-timing-dialog button:focus-visible{outline:2px solid #987a36;outline-offset:3px}
.speech-timing-dialog{box-sizing:border-box;width:min(440px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto;border:1px solid #e9e1d7;border-radius:18px;padding:20px;background:#fffdf9;color:#27313a;font:16px/1.5 system-ui,sans-serif}
.speech-timing-dialog::backdrop{background:#27313a66}
.speech-timing-dialog header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}
.speech-timing-dialog h2{font:600 20px/1.4 system-ui,sans-serif;margin:0}
.speech-timing-dialog button{font:inherit;min-width:44px;min-height:44px;border:1px solid #d8d2c8;border-radius:10px;background:#fffdf9;color:inherit;padding:8px 12px;cursor:pointer}
.speech-timing-dialog button:disabled{opacity:.45;cursor:default}
.speech-timing-step{display:grid;grid-template-columns:44px 1fr 44px;align-items:center;gap:12px;padding:10px;border-radius:12px;margin:10px 0}
.speech-timing-step output{text-align:center;font-size:22px;font-variant-numeric:tabular-nums}
.speech-timing-dialog footer{display:flex;gap:10px;margin-top:20px}
.speech-timing-dialog footer button{flex:1}
.speech-timing-dialog [data-timing-save]{background:#315f50;color:white;border-color:#315f50}
.speech-timing-dialog .speech-timing-unknown{font-size:13px;color:#7d746d}
.classic-template-compact .template-item-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;margin:12px 0;align-items:end}
.classic-template-compact .template-item-row button{min-width:0;white-space:normal;overflow-wrap:anywhere;text-align:left}
.classic-template-compact .template-item-row .danger{color:#a3465b;min-width:40px;text-align:center}

.education-completed{color:#26703c;font-weight:700;margin-inline-start:auto;padding-inline-start:.65rem;flex-shrink:0}

.classic-template-compact .template-item-field{display:grid;gap:5px;min-width:0}
.classic-template-compact .template-item-field>span{font-size:12px;color:#687971}
.classic-template-compact .template-item-row>.btn{white-space:nowrap;font-size:13px}
@media(max-width:600px){
 .classic-template-compact .template-item-row{grid-template-columns:minmax(0,1fr);padding:12px 0;border-bottom:1px solid #e6e9e2}
 .classic-template-compact .template-item-row>.btn{justify-self:end}
}

#mainDialog .template-footer{display:flex;gap:8px;flex-wrap:wrap}
#mainDialog .template-footer .btn{min-width:0;white-space:normal}
@media(max-width:600px){
 #mainDialog .template-footer{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 #mainDialog .template-footer #modalOk{grid-column:1/-1}
}

.classic-template-compact .toggle-line input[type=number]{height:44px;width:80px;flex-shrink:0}
/* Short education menus expand at their field using the existing choice rows. */
.speech-data-editor .education-inline-picker>.office-list{min-height:72px;margin-top:5px}
.speech-data-editor .education-inline-picker>summary{list-style:none}
.speech-data-editor .education-inline-picker>summary::-webkit-details-marker{display:none}
.speech-data-editor .education-inline-picker>summary[aria-disabled="true"]{opacity:.55;cursor:default}
