/* OUR STAGE V87 — Ticket Studio */
#ticketStudio .ts-hero{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;padding:18px 20px;border:1px solid #eadde2;border-radius:18px;background:linear-gradient(135deg,#fff,#fff8fb);margin-bottom:14px}
#ticketStudio .ts-hero h2{margin:4px 0 6px;font-size:24px;letter-spacing:-.5px}#ticketStudio .ts-hero p{margin:0;color:#6b747c;line-height:1.55}
#ticketStudio .ts-event-picker{min-width:min(360px,100%)}#ticketStudio .ts-event-picker label{display:block;font-size:9px;font-weight:900;letter-spacing:1px;color:#8a5365;margin:0 0 6px}#ticketStudio .ts-event-picker select{width:100%;min-height:44px}
#ticketStudio .ts-top-grid{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(320px,.8fr);gap:14px;margin-bottom:14px}
#ticketStudio .ts-card{border:1px solid #e7e9ec;border-radius:17px;background:#fff;padding:16px;box-shadow:0 10px 28px rgba(29,37,43,.05)}#ticketStudio .ts-card h3{margin:0 0 5px;font-size:15px}#ticketStudio .ts-card p{margin:0;color:#707981;font-size:10px;line-height:1.5}
#ticketStudio .ts-portal-row{display:flex;gap:8px;align-items:center;margin-top:12px}#ticketStudio .ts-portal-row input{min-width:0;flex:1}
#ticketStudio .ts-portal-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}#ticketStudio .ts-stats{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin-top:12px}#ticketStudio .ts-stats>div{padding:12px 8px;border:1px solid #eceef0;border-radius:13px;background:#fafbfc;text-align:center}#ticketStudio .ts-stats b{display:block;font-size:20px;color:#812d48}#ticketStudio .ts-stats span{display:block;margin-top:2px;font-size:8px;color:#78818a}
#ticketStudio .ts-section-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:12px}#ticketStudio .ts-section-head h3{margin:0 0 4px;font-size:16px}#ticketStudio .ts-section-head p{margin:0;color:#707981;font-size:10px}#ticketStudio .ts-section-actions{display:flex;gap:8px;flex-wrap:wrap}
#ticketStudio .ts-designer-grid{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(300px,.65fr);gap:14px;align-items:start}
#ticketStudio .ts-designer-surface{position:relative;width:100%;min-height:260px;border-radius:15px;overflow:hidden;background:linear-gradient(135deg,#f2f3f4,#e7eaed);border:1px dashed #cfd4d8;touch-action:none}#ticketStudio .ts-designer-surface>img{position:absolute;inset:0;width:100%;height:100%;object-fit:fill;user-select:none;pointer-events:none}
#ticketStudio .ts-no-template{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center;padding:30px;color:#69747c}#ticketStudio .ts-no-template b{font-size:18px;color:#27313a}#ticketStudio .ts-no-template span{max-width:460px;font-size:10px;line-height:1.5}
#ticketStudio .ts-overlay{position:absolute;z-index:3;border:1.5px dashed rgba(133,42,70,.7);background:rgba(255,255,255,.34);min-width:28px;min-height:24px;display:flex;align-items:center;padding:2px 5px;cursor:grab;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;box-shadow:0 0 0 1px rgba(255,255,255,.45) inset}#ticketStudio .ts-overlay.dragging{cursor:grabbing;border-style:solid;background:rgba(255,255,255,.5)}#ticketStudio .ts-overlay::after{content:attr(data-box);position:absolute;left:2px;top:2px;font-size:6px;letter-spacing:.7px;text-transform:uppercase;color:#8b2a49;background:rgba(255,255,255,.84);padding:1px 3px;border-radius:4px}#ticketStudio .ts-qr{padding:4px;justify-content:center}#ticketStudio .ts-qr #tsPreviewQr,#ticketStudio .ts-qr #tsPreviewQr>canvas,#ticketStudio .ts-qr #tsPreviewQr>img{width:100%!important;height:100%!important;object-fit:contain;display:block}
#ticketStudio .ts-designer-controls{display:grid;gap:10px}#ticketStudio .ts-control-group{border:1px solid #eceef0;border-radius:13px;padding:11px;background:#fbfcfd}#ticketStudio .ts-control-group h4{margin:0 0 8px;font-size:10px;color:#672039}#ticketStudio .ts-control-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}#ticketStudio .ts-control-grid label{font-size:8px;color:#69747d;font-weight:800}#ticketStudio .ts-control-grid input,#ticketStudio .ts-control-grid select{width:100%;min-height:35px;margin-top:4px;padding:6px 8px;font-size:10px}#ticketStudio .ts-control-grid input[type=color]{padding:3px}
#ticketStudio .ts-import-grid{display:grid;grid-template-columns:360px minmax(0,1fr);gap:14px}#ticketStudio .ts-import-settings{display:grid;gap:10px}#ticketStudio .ts-import-settings label{font-size:9px;font-weight:800;color:#5f6a72}#ticketStudio .ts-import-settings select,#ticketStudio .ts-import-settings input{width:100%;margin-top:5px}.ts-file-row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.ts-file-name{font-size:9px;color:#6e7880}
#ticketStudio .ts-preview-note{font-size:9px;color:#5f6870;margin-bottom:8px;line-height:1.45}#ticketStudio .ts-table-scroll{overflow:auto;border:1px solid #eceef0;border-radius:12px}#ticketStudio .ts-table-scroll table{width:100%;border-collapse:collapse;font-size:9px;white-space:nowrap}#ticketStudio .ts-table-scroll th,#ticketStudio .ts-table-scroll td{padding:8px 9px;border-bottom:1px solid #eef0f2;text-align:left}#ticketStudio .ts-table-scroll th{position:sticky;top:0;background:#f8f9fa;color:#59636b;font-size:8px;z-index:1}.ts-error-text{color:#a02d40;font-weight:800}
#ticketStudio .ts-list-toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:10px}#ticketStudio .ts-list-toolbar input{min-width:240px;flex:1}#ticketStudio .ts-list-toolbar select{min-width:150px}#ticketStudio .ts-list-count{font-size:9px;color:#707982;margin-left:auto}
#ticketStudio .ts-ticket-list{display:grid;gap:8px}#ticketStudio .ts-ticket-row{display:grid;grid-template-columns:minmax(220px,1fr) auto auto;gap:10px;align-items:center;padding:11px 12px;border:1px solid #e7e9ec;border-radius:13px;background:#fff}#ticketStudio .ts-ticket-main{min-width:0}#ticketStudio .ts-ticket-main b{display:block;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ticketStudio .ts-ticket-main small{display:block;margin-top:3px;color:#6c7680;font-size:8px;line-height:1.4;white-space:normal}#ticketStudio .ts-ticket-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}#ticketStudio .ts-ticket-actions button{min-height:34px;padding:6px 9px;font-size:8px}.ts-status{padding:6px 8px;border-radius:999px;font-size:8px;font-weight:900;background:#edf1f3;color:#5b6670;white-space:nowrap}.ts-status.checked_in{background:#e8f7ef;color:#13714f}.ts-status.revoked,.ts-status.cancelled{background:#fff0f2;color:#922a3e}.ts-status.issued{background:#eef4ff;color:#315b97}
#ticketStudio .ts-safety{margin-top:12px;border:1px solid #eadce1;border-radius:13px;padding:11px 12px;background:#fffafd;font-size:9px;color:#67545b;line-height:1.5}
@media(max-width:1080px){#ticketStudio .ts-top-grid,#ticketStudio .ts-designer-grid,#ticketStudio .ts-import-grid{grid-template-columns:1fr}#ticketStudio .ts-stats{grid-template-columns:repeat(3,1fr)}}
@media(max-width:700px){#ticketStudio .ts-hero{display:block;padding:15px}#ticketStudio .ts-event-picker{margin-top:12px;min-width:0}#ticketStudio .ts-stats{grid-template-columns:repeat(2,1fr)}#ticketStudio .ts-ticket-row{grid-template-columns:1fr}#ticketStudio .ts-ticket-actions{justify-content:flex-start}#ticketStudio .ts-list-count{width:100%;margin-left:0}#ticketStudio .ts-control-grid{grid-template-columns:1fr 1fr}.ts-portal-row{flex-wrap:wrap}.ts-portal-row input{flex-basis:100%}}


/* V88 — configurable fields, safer QR frame & export UI */
#ticketStudio .ts-qr{padding:5px;justify-content:center;background:rgba(255,255,255,.48);border:1.5px solid rgba(133,42,70,.52);border-radius:9px;box-shadow:0 5px 18px rgba(20,27,32,.10)}
#ticketStudio .ts-qr-frame{width:100%;height:100%;display:flex;align-items:center;justify-content:center;background:#fff;border:1px solid rgba(33,41,48,.18);border-radius:7px;padding:8%;overflow:hidden}
#ticketStudio .ts-qr #tsPreviewQr,#ticketStudio .ts-qr #tsPreviewQr>canvas,#ticketStudio .ts-qr #tsPreviewQr>img{width:100%!important;height:100%!important;object-fit:contain;display:block;image-rendering:pixelated}
#ticketStudio .ts-control-title{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}
#ticketStudio .ts-visible-switch{display:flex!important;align-items:center;gap:5px;font-size:8px!important;font-weight:850!important;color:#59636c!important;white-space:nowrap}
#ticketStudio .ts-visible-switch input{width:auto!important;min-height:0!important;margin:0!important}
#ticketStudio .ts-control-group.is-off{background:#f6f7f8;opacity:.82}
.ts-export-overlay{position:fixed;inset:0;z-index:10050;background:rgba(19,24,29,.46);backdrop-filter:blur(5px);display:grid;place-items:center;padding:18px}
.ts-export-dialog{width:min(620px,100%);background:#fff;border:1px solid #e3e6e8;border-radius:18px;box-shadow:0 28px 90px rgba(16,23,29,.22);padding:17px}
.ts-export-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.ts-export-head h3{margin:0}
.ts-export-head>button{border:0;background:#f2f4f5;border-radius:9px;width:34px;height:34px;font-size:20px;cursor:pointer}
.ts-export-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:14px 0}.ts-export-grid label,.ts-export-scope label{border:1px solid #e6e9eb;border-radius:10px;padding:9px 10px;font-size:10px;font-weight:750}
.ts-export-scope{display:flex;gap:8px;flex-wrap:wrap}.ts-export-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}
@media(max-width:700px){.ts-export-grid{grid-template-columns:1fr}.ts-export-scope{display:grid}.ts-export-dialog{max-height:88vh;overflow:auto}}


/* V89 — registration merge, editable preview & guest editor */
#ticketStudio .ts-source-actions{display:flex;gap:7px;flex-wrap:wrap;align-items:center}
#ticketStudio .ts-preview-table{min-width:1180px!important}
#ticketStudio .ts-preview-input{width:100%;min-width:110px;height:31px;border:1px solid #dfe4e7;border-radius:8px;padding:5px 7px;background:#fff;font:inherit;color:#27313a;outline:none}
#ticketStudio .ts-preview-input:focus{border-color:#b35b78;box-shadow:0 0 0 3px rgba(141,41,73,.08)}
#ticketStudio .ts-source-badge{display:inline-flex;align-items:center;padding:4px 7px;border-radius:999px;background:#f1edf0;color:#7d3450;font-size:8px;font-weight:900;white-space:nowrap}
#ticketStudio .ts-auto-code{display:inline-block;min-width:110px;color:#6b747c;font-size:8px;font-weight:800}
#ticketStudio .ts-row-delete{min-width:30px!important;width:30px;height:30px;min-height:30px!important;padding:0!important;border-radius:8px!important}
.ts-edit-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:14px}
.ts-edit-grid label{display:grid;gap:5px;font-size:9px;font-weight:850;color:#5b6670}
.ts-edit-grid input{width:100%;min-height:40px;border:1px solid #dfe4e7;border-radius:10px;padding:8px 10px;font:inherit}
.ts-edit-warning{margin-top:12px;padding:10px 11px;border:1px solid #f0d8a8;border-radius:10px;background:#fff9e9;color:#7a5714;font-size:9px;line-height:1.45}
@media(max-width:700px){#ticketStudio .ts-source-actions{display:grid;grid-template-columns:1fr 1fr}#ticketStudio .ts-source-actions button:last-child{grid-column:1/-1}.ts-edit-grid{grid-template-columns:1fr}}


/* V90 — bulk ticket management */
#ticketStudio .ts-status.claimed{background:#eef5ff;color:#245785;border-color:#cbdff5}
#ticketStudio .ts-ticket-row{grid-template-columns:auto minmax(220px,1fr) auto auto}
#ticketStudio .ts-ticket-select{display:flex;align-items:center;justify-content:center;padding:0 2px}
#ticketStudio .ts-ticket-select input{width:16px!important;height:16px!important;min-height:0!important;margin:0!important}
#ticketStudio .ts-select-all{display:flex;align-items:center;gap:8px;padding:9px 11px;margin-bottom:8px;border:1px solid #e7eaed;border-radius:10px;background:#fafbfc;font-size:9px;font-weight:800;color:#5f6971}
#ticketStudio .ts-select-all input{width:15px!important;height:15px!important;min-height:0!important;margin:0 6px 0 0!important}
#ticketStudio .ts-bulk-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:10px 11px;margin:8px 0;border:1px solid #ead6dd;border-radius:11px;background:#fff8fa}
#ticketStudio .ts-bulk-bar.hidden{display:none!important}
#ticketStudio .ts-bulk-bar b{font-size:10px;color:#6e1d36}
#ticketStudio .ts-bulk-bar span{font-size:9px;color:#7a7376;margin-right:auto}
@media(max-width:760px){#ticketStudio .ts-ticket-row{grid-template-columns:auto 1fr}.ts-ticket-row>.ts-status,.ts-ticket-row>.ts-ticket-actions{grid-column:2}.ts-ticket-actions{justify-content:flex-start}}

/* V94 - centered mobile Ticket Studio manual actions and shared QR camera */
#ticketStudio .ts-manual-checkin{display:inline-flex;align-items:center;justify-content:center;gap:7px;white-space:nowrap;padding:8px 10px;border:1px solid #c9dcd2;border-radius:9px;color:#166145;background:#edf8f1;font-size:10px;font-weight:800;cursor:pointer;min-height:35px}
#ticketStudio .ts-manual-checkin input{width:16px!important;height:16px!important;min-height:0!important;accent-color:#247c53;cursor:pointer;margin:0!important}
#ticketStudio .ts-manual-checkin.complete{background:#f0f2f3;border-color:#dbe1e5;color:#657077;cursor:default}
#ticketStudio .ts-manual-checkin.complete input{cursor:default}
@media(max-width:700px){
  #ticketStudio .ts-manual-checkin{min-height:42px;padding:10px 12px;font-size:12px}
  .event-student-qr-camera{width:100%;min-width:0;max-width:100%;margin-inline:auto;overflow:hidden}
  #eventStudentQrReader{box-sizing:border-box;width:100%!important;min-width:0;max-width:100%;margin-inline:auto!important;display:flex!important;flex-direction:column;align-items:center;justify-content:center;overflow:hidden;position:relative}
  #eventStudentQrReader>div:not(.event-student-qr-placeholder){box-sizing:border-box;max-width:100%;margin-inline:auto!important}
  #eventStudentQrReader video,#eventStudentQrNativeVideo{display:block!important;max-width:100%!important;width:100%!important;object-fit:contain!important;margin-inline:auto!important}
  #eventStudentQrReader canvas{display:none!important}
  .event-student-qr-toolbar{justify-content:center;flex-wrap:wrap}
}


/* OSC multi-gate independent scanner manager */
.osc-gates-modal{max-height:min(92dvh,1000px);overflow-y:auto;overflow-x:hidden}
.osc-gates-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:13px 0}
.osc-gate-help{display:grid;gap:3px}.osc-gate-help b{font-size:13px}.osc-gate-help small{font-size:11px;color:#66717b}
.osc-gates-list{display:grid;gap:12px;max-height:60dvh;overflow-y:auto;padding:2px 5px 16px 0}
.osc-gate-row{border:1px solid #e0e4e8;background:#fff;border-radius:14px;padding:14px;display:grid;gap:10px;min-width:0}
.osc-gate-row.is-revoked{background:#f9fafb;opacity:.84}
.osc-gate-row-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.osc-gate-row-head strong{font-size:14px;color:#202b33}
.osc-gate-status{padding:4px 10px;border-radius:18px;font-size:11px;font-weight:800;white-space:nowrap}
.osc-gate-status.active{background:#e8f7f0;color:#146443}
.osc-gate-status.inactive{background:#fff4dd;color:#865b1c}
.osc-gate-status.revoked{background:#f1f2f3;color:#646e77}
.osc-gate-url-row,.osc-gate-editor,.osc-gate-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.osc-gate-url,.osc-gate-name{flex:1 1 230px;min-width:0;min-height:38px;padding:9px 11px;border:1px solid #dce2e7;border-radius:9px;background:#fff;color:#293943;font:inherit}
.osc-gate-url{font-size:11px}
.osc-gate-actions button{min-height:36px}
.osc-gates-close{background:#f3f4f5!important;border:0!important;border-radius:8px!important;font-size:20px!important;min-height:34px!important;min-width:34px!important}
@media(max-width:640px){
 .osc-gates-modal{width:min(96vw,900px)!important;max-height:94dvh!important;padding:13px!important}
 .osc-gates-toolbar{align-items:stretch}
 .osc-gates-toolbar>.primary{width:100%}
 .osc-gates-list{max-height:65dvh;overflow:auto}
 .osc-gate-row{padding:12px;gap:9px}
 .osc-gate-url-row .osc-gate-url{flex-basis:100%}
 .osc-gate-url-row button,.osc-gate-editor button{flex:1}
 .osc-gate-actions button{flex:1 1 125px}
}


/* Camera CSS correction: don't rescale Html5Qrcode video independently of its mask/canvas. */
@media(max-width:700px){
 .event-student-qr-camera{max-width:100%;min-width:0;overflow:hidden}
 #eventStudentQrReader{display:block!important;box-sizing:border-box;max-width:100%!important;
   min-width:0!important;overflow:hidden;position:relative;margin-inline:auto!important}
 #eventStudentQrReader>div{box-sizing:border-box;max-width:100%;margin-inline:auto!important}
 #eventStudentQrReader video{display:block!important;width:auto!important;height:auto!important;
   max-width:100%!important;object-fit:initial!important;margin-inline:auto!important}
 #eventStudentQrReader canvas{display:none!important}
 #eventStudentQrNativeVideo{display:block;width:100%;height:auto;max-height:55dvh;object-fit:contain;margin-inline:auto}
 #eventStudentQrReader::after,#eventStudentQrReader::before{content:none!important;display:none!important}
}
.osc-staff-areas-modal{width:min(860px,96vw)!important;max-height:92dvh;overflow:auto}
.osc-staff-areas-note{padding:12px 14px;background:#faf7f9;border:1px solid #eddee5;border-radius:12px;font-size:12px;line-height:1.5}
.osc-staff-areas-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:12px 0}
.osc-staff-areas-list{display:grid;gap:12px;max-height:60dvh;overflow:auto;padding-right:5px}
.osc-staff-area{display:grid;gap:11px;border:1px solid #e2e5e9;background:white;padding:14px;border-radius:14px;min-width:0}
.osc-staff-area.revoked{background:#f8f9fa;opacity:.78}
.osc-staff-area-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.osc-staff-area-status{font-size:11px;font-weight:800;padding:5px 10px;border-radius:18px;background:#f2f4f6}
.osc-staff-area-status.on{color:#14704c;background:#e8f7ee}.osc-staff-area-status.off{color:#7a6469}
.osc-staff-area-link,.osc-staff-area-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.osc-staff-area-link>input{flex:1 1 240px;min-width:0;max-width:100%;min-height:38px;border:1px solid #dce0e5;border-radius:9px;background:#f9fafb;padding:9px;font-size:12px}
.osc-staff-area-form{display:grid;gap:12px}
.osc-staff-area-form>label{display:grid;gap:5px;font-size:12px;font-weight:750}
.osc-staff-area-form>label>input{min-height:41px;padding:9px 11px;border:1px solid #dce0e5;border-radius:9px;font-size:13px}
.osc-staff-fields{border:1px solid #ebecf0;border-radius:11px;margin:0;padding:10px 12px}
.osc-staff-fields legend{font-size:12px;font-weight:800;padding:0 6px}
.osc-staff-fixed{display:block;font-size:12px;color:#42515b;margin-bottom:9px}
.osc-staff-fields-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(125px,1fr));gap:8px}
.osc-staff-fields-grid label{display:flex;align-items:center;gap:8px;font-size:12px;line-height:1.4}
.osc-staff-fields-grid input{width:16px;height:16px;min-height:0;accent-color:#8d2949}
.osc-staff-area-actions button{min-height:36px}
.osc-attendance-xlsx-tools{flex:1 1 100%;width:100%;min-width:0;display:flex;gap:12px;align-items:center;justify-content:space-between;
 padding:13px 15px;margin:10px 0;border:1px solid #dfdce4;background:linear-gradient(115deg,#fff,#fdf7fa);border-radius:14px}
.osc-attendance-xlsx-intro{display:grid;gap:4px;min-width:0;flex:1}
.osc-attendance-xlsx-intro strong{font-size:13px;color:#63233a}
.osc-attendance-xlsx-intro small{font-size:11px;line-height:1.5;color:#66717b}
.osc-attendance-xlsx-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.osc-attendance-xlsx-actions button{white-space:normal;min-height:40px;padding:9px 14px}
.osc-attendance-xlsx-tools input[type=file]{display:none!important}
.osc-attendance-xlsx-modal{max-height:90dvh;overflow:auto}
.osc-attendance-xlsx-modal details{border:1px solid #e6e9ec;border-radius:10px;padding:10px 12px}
.osc-attendance-xlsx-modal summary{cursor:pointer;font-weight:750}
.osc-attendance-xlsx-modal .import-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:12px 0}
.osc-attendance-xlsx-modal .import-summary>div{display:grid;gap:6px;text-align:center;border:1px solid #e5e8eb;background:#fbfbfc;padding:10px 5px;border-radius:10px}
.osc-attendance-xlsx-modal .import-summary span{font-size:11px;color:#68737d}
.osc-attendance-xlsx-modal .import-summary strong{font-size:20px}
@media(max-width:690px){
 .osc-staff-areas-modal{width:min(97vw,860px)!important;max-height:94dvh}
 .osc-staff-areas-list{max-height:68dvh}
 .osc-staff-area{padding:11px}
 .osc-staff-area-link>input{flex-basis:100%}
 .osc-staff-area-actions button{flex:1 1 120px}
 .osc-attendance-xlsx-tools{flex-direction:column;align-items:stretch;padding:13px}
 .osc-attendance-xlsx-actions{display:grid;grid-template-columns:1fr 1fr}
 .osc-attendance-xlsx-actions button{width:100%;font-size:12px}
 .osc-attendance-xlsx-modal .import-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
}


/* Attendance v2026-10-24 — separate single-activity and whole-term actions.
   These selectors are intentionally restricted to the attendance panel. */
#manage .attendance-bar.osc-attendance-bar{
  display:grid!important;
  grid-template-columns:minmax(190px,1.6fr) repeat(4,minmax(112px,1fr));
  align-items:stretch!important;
  justify-content:stretch!important;
  gap:12px!important;
  width:100%;
  max-width:100%;
  min-width:0;
  box-sizing:border-box;
  overflow:visible;
}
#manage .attendance-bar.osc-attendance-bar>label{
  display:block;
  grid-column:1/-1;
  margin:0 0 2px;
  min-width:0;
  width:100%;
}
#manage .attendance-bar.osc-attendance-bar>select,
#manage .attendance-bar.osc-attendance-bar>button{
  box-sizing:border-box;
  min-width:0!important;
  max-width:100%!important;
  width:100%!important;
  height:auto;
  min-height:46px;
  margin:0!important;
  padding:10px 12px;
  white-space:normal;
  overflow-wrap:anywhere;
  text-align:center;
  font-size:clamp(12px,0.9vw,15px);
  line-height:1.35;
}
#manage .attendance-bar.osc-attendance-bar>select{
  text-align:left;
  text-overflow:ellipsis;
  padding-inline:12px;
  overflow:hidden;
  white-space:nowrap;
}
#manage .attendance-bar.osc-attendance-bar>#attendanceExcelInput{
  display:none!important;
}
#manage>.osc-attendance-xlsx-tools{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:16px;
  box-sizing:border-box;
  width:100%;
  max-width:100%;
  min-width:0;
  margin:14px 0 20px;
  padding:17px 20px;
  border:1px solid #e6dce3;
  border-radius:15px;
  background:linear-gradient(115deg,#fff,#fdf8fa);
}
#manage>.osc-attendance-xlsx-tools .osc-attendance-xlsx-intro{
  min-width:0;
  max-width:100%;
  overflow-wrap:break-word;
}
#manage>.osc-attendance-xlsx-tools .osc-attendance-xlsx-intro strong{
  display:block;
  font-size:15px;
  line-height:1.35;
}
#manage>.osc-attendance-xlsx-tools .osc-attendance-xlsx-intro small{
  display:block;
  font-size:12px;
  line-height:1.5;
}
#manage>.osc-attendance-xlsx-tools .osc-attendance-xlsx-actions{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr));
  align-items:stretch;
  gap:9px;
  width:auto;
  min-width:0;
}
#manage>.osc-attendance-xlsx-tools .osc-attendance-xlsx-actions>button{
  box-sizing:border-box;
  min-width:0!important;
  max-width:100%!important;
  width:100%!important;
  min-height:44px;
  margin:0!important;
  white-space:normal;
  overflow-wrap:break-word;
  line-height:1.35;
  padding:10px 14px;
}
#manage .osc-attendance-xlsx-modal,
#manage .osc-attendance-xlsx-modal *{
  box-sizing:border-box;
}
@media(max-width:1200px){
  #manage .attendance-bar.osc-attendance-bar{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  #manage .attendance-bar.osc-attendance-bar>select{grid-column:1/-1}
  #manage .attendance-bar.osc-attendance-bar>button{font-size:14px}
  #manage>.osc-attendance-xlsx-tools{
    grid-template-columns:minmax(0,1fr);
    align-items:stretch;
  }
  #manage>.osc-attendance-xlsx-tools .osc-attendance-xlsx-actions{
    width:100%;
  }
}
@media(max-width:640px){
  #manage .attendance-bar.osc-attendance-bar{gap:10px!important}
  #manage .attendance-bar.osc-attendance-bar>button{
    min-height:46px;
    padding:10px 8px;
    font-size:13px;
  }
  #manage>.osc-attendance-xlsx-tools{
    margin:12px 0 18px;
    padding:14px;
    gap:12px;
  }
  #manage>.osc-attendance-xlsx-tools .osc-attendance-xlsx-actions>button{
    min-height:48px;
    padding:10px 8px;
    font-size:13px;
  }
  #manage .osc-attendance-xlsx-modal{
    width:min(96vw,800px)!important;
    max-height:88dvh;
    overflow:auto;
  }
  #manage .osc-attendance-xlsx-modal .import-summary{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media(max-width:380px){
  #manage .attendance-bar.osc-attendance-bar,
  #manage>.osc-attendance-xlsx-tools .osc-attendance-xlsx-actions{
    grid-template-columns:minmax(0,1fr);
  }
}

/* Ticket Studio invitation artwork workflow — isolated from legacy designer */
#ticketStudio .td-panel{display:grid;gap:16px;margin:16px 0 22px;padding:20px;max-width:100%;min-width:0;
 background:#fff;border:1px solid #eadde4;border-radius:17px;box-sizing:border-box}
#ticketStudio .td-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
#ticketStudio .td-heading h3{margin:5px 0 6px;font-size:20px;color:#5e1834}
#ticketStudio .td-heading p{margin:0;font-size:12px;line-height:1.5;color:#666b74}
#ticketStudio .td-kicker{font-size:10px;letter-spacing:1.4px;font-weight:850;color:#9d4a66}
#ticketStudio .td-tag{background:#f8f1f5;color:#79314b;border-radius:24px;padding:7px 11px;font-size:11px;font-weight:800;white-space:nowrap}
#ticketStudio .td-mode-actions,#ticketStudio .td-actions{display:flex;flex-wrap:wrap;gap:9px}
#ticketStudio .td-mode-actions button{flex:1 1 210px;padding:11px 14px;min-height:42px}
#ticketStudio .td-mode-actions button.is-active{outline:2px solid #8d2949;outline-offset:2px}
#ticketStudio .td-workflow{display:grid;grid-template-columns:minmax(0,1fr) minmax(260px,0.9fr);gap:15px;align-items:stretch}
#ticketStudio .td-box{padding:16px;border:1px solid #eee6eb;background:#fff;border-radius:14px;min-width:0;display:grid;align-content:start;gap:11px}
#ticketStudio .td-box:last-child{grid-column:1/-1}
#ticketStudio .td-box h4{margin:0;font-size:15px;color:#642b43}
#ticketStudio .td-box p,#ticketStudio .td-caution{font-size:12px;line-height:1.55;color:#65707a;margin:0}
#ticketStudio .td-box code{font-size:11px}
#ticketStudio .td-label{display:block;font-size:12px;font-weight:750}
#ticketStudio .td-box input[type=text]{width:100%;min-width:0;max-width:100%;box-sizing:border-box;padding:11px;border:1px solid #dcdde3;border-radius:10px;font:inherit;font-size:13px}
#ticketStudio .td-box button{min-height:40px;padding:9px 13px}
#ticketStudio .td-box small{font-size:11px;line-height:1.45;color:#64717b}
#ticketStudio .td-stage{width:min(100%,340px);max-height:420px;aspect-ratio:3/4;overflow:hidden;position:relative;margin-inline:auto;border-radius:12px;border:1px solid #d9cbd1;background:#562638;touch-action:none}
#ticketStudio .td-visual,#ticketStudio .td-source{width:100%;height:100%;position:absolute;inset:0;object-fit:contain;background:#ebeaed}
#ticketStudio .td-placeholder{position:absolute;inset:0;display:grid;place-content:center;text-align:center;padding:20px;color:#6e6270;font-weight:800;font-size:13px}
#ticketStudio .td-qr{position:absolute;display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:2;background:#fff;border:2px solid #a04c65;border-radius:4px;cursor:grab;user-select:none;touch-action:none;box-shadow:0 3px 10px #0002;font-weight:900;color:#1b232c}
#ticketStudio .td-qr span{font-size:clamp(22px,3vw,46px)}
#ticketStudio .td-qr small{font-size:10px!important;line-height:1;color:#2a2c33!important}
#ticketStudio .td-qr:active{cursor:grabbing}
#ticketStudio .td-coords{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
#ticketStudio .td-coords label{display:grid;gap:5px;color:#55616a;font-size:11px;font-weight:750}
#ticketStudio .td-coords input{min-width:0;width:100%;box-sizing:border-box;padding:8px 5px;border:1px solid #dce0e4;border-radius:9px;font-size:12px}
#ticketStudio .td-summary{font-size:12px;color:#6b3a50;background:#fff5f9;padding:10px 12px;border-radius:10px;border:1px solid #eddce4}
#ticketStudio .td-list{max-width:100%;min-width:0;max-height:300px;overflow:auto}
#ticketStudio .td-table{width:100%;border-collapse:collapse;min-width:560px;font-size:12px}
#ticketStudio .td-table th,#ticketStudio .td-table td{padding:9px 10px;text-align:left;white-space:nowrap;border-bottom:1px solid #eee}
#ticketStudio .td-table th{position:sticky;top:0;background:#f7f4f6;z-index:1}
#ticketStudio .td-table button{min-height:34px;padding:7px 11px}
#ticketStudio .td-progress{font-size:12px;font-weight:650;color:#6b3550}
#ticketStudio .td-message{font-size:12px;margin:0;min-height:1.6em;color:#245a46;line-height:1.5;overflow-wrap:anywhere}
#ticketStudio .ts-control-group .ts-font-upload{display:flex;flex-wrap:wrap;align-items:center;gap:8px;font-size:12px}
#ticketStudio .ts-control-group .ts-font-upload input{max-width:100%;font-size:11px}
@media(max-width:950px){
 #ticketStudio .td-workflow{grid-template-columns:minmax(0,1fr)}
 #ticketStudio .td-box:last-child{grid-column:auto}
}
@media(max-width:600px){
 #ticketStudio .td-panel{padding:14px;gap:14px}
 #ticketStudio .td-heading h3{font-size:17px}
 #ticketStudio .td-coords{grid-template-columns:repeat(2,minmax(0,1fr))}
 #ticketStudio .td-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
 #ticketStudio .td-actions button{min-width:0;width:100%;white-space:normal}
}
@media(max-width:380px){
 #ticketStudio .td-actions{grid-template-columns:minmax(0,1fr)}
}


/* Ticket Studio optional QR — artwork decision never affects camera controls */
#ticketStudio .td-qr-toggle{display:flex;align-items:center;gap:10px;padding:11px 13px;border:1px solid #d9e7e0;border-radius:12px;background:#f6faf8;color:#285e49;font-size:13px;font-weight:760;margin:10px 0}
#ticketStudio .td-qr-toggle input{width:19px;height:19px;min-width:19px;min-height:19px;accent-color:#28724d;margin:0}
#ticketStudio .td-qr-toggle:focus-within{outline:2px solid #4e9e75;outline-offset:3px}
#ticketStudio #tdQrCoordinates.hidden,#ticketStudio #tdQr.hidden{display:none!important}
#ticketStudio #tdQrDescription{color:#586a65;line-height:1.55;font-size:12px}
#ticketStudio .ts-visible-switch input[type="checkbox"]{accent-color:#336b52}


/* OSC unified square camera frame (external Staff + internal Ticket Studio). 
   Html5Qrcode owns its canvas and crop; no second decorative scan mask. */
#eventStudentQrReader.event-student-qr-reader{
 display:block!important;position:relative!important;
 width:min(100%,440px)!important;max-width:100%!important;
 aspect-ratio:1 / 1!important;
 height:auto!important;min-height:0!important;max-height:440px!important;
 margin-inline:auto!important;overflow:hidden!important;
 border-radius:16px!important;background:#f6f8f9!important;
}
#eventStudentQrReader .event-student-qr-placeholder{min-height:0!important;width:100%;height:100%;display:grid;place-items:center;text-align:center}
#eventStudentQrReader video:not(#eventStudentQrNativeVideo){
 display:block!important;max-width:100%!important;max-height:100%!important;margin-inline:auto!important;
}
#eventStudentQrReader #eventStudentQrNativeVideo{
 width:100%!important;height:100%!important;max-height:440px!important;
 object-fit:cover!important;display:block!important;
}
#eventStudentQrReader::before,#eventStudentQrReader::after{display:none!important;content:none!important}
.event-qr-camera-device{display:flex;gap:8px;align-items:center;justify-content:center;margin-top:11px;flex-wrap:wrap;font-size:12px}
.event-qr-camera-device select{padding:9px 11px;border:1px solid #d8e0e4;border-radius:10px;min-width:155px;max-width:100%;background:#fff;color:#22313a}
@media(max-width:700px){#eventStudentQrReader.event-student-qr-reader{width:min(100%,400px)!important;max-height:400px!important}.event-qr-camera-device select{flex:1;min-width:0}}


/* Html5Qrcode's canvas is for QR decoding only: never display a second video frame. */
#eventStudentQrReader canvas{display:none!important}
/* Guard against an inherited Html5Qrcode shaded overlay from older screens. */
#eventStudentQrReader #qr-shaded-region,#eventStudentQrReader [id="qr-shaded-region"]{display:none!important}
/* One scan target only: QR decoding uses the complete video frame.
   The library's qrbox/shaded-region MUST remain disabled in both OSC scan screens. */
#eventStudentQrReader.event-student-qr-reader[data-scanning="true"]::after{
 content:""!important;display:block!important;position:absolute!important;z-index:20;
 top:50%;left:50%;width:68%;height:auto;aspect-ratio:1 / 1;
 transform:translate(-50%,-50%);pointer-events:none;
 border:0!important;box-shadow:none!important;border-radius:0!important;
 background:
 linear-gradient(#fff,#fff) left top / 29px 5px no-repeat,
 linear-gradient(#fff,#fff) left top / 5px 29px no-repeat,
 linear-gradient(#fff,#fff) right top / 29px 5px no-repeat,
 linear-gradient(#fff,#fff) right top / 5px 29px no-repeat,
 linear-gradient(#fff,#fff) left bottom / 29px 5px no-repeat,
 linear-gradient(#fff,#fff) left bottom / 5px 29px no-repeat,
 linear-gradient(#fff,#fff) right bottom / 29px 5px no-repeat,
 linear-gradient(#fff,#fff) right bottom / 5px 29px no-repeat!important;
}
#eventStudentQrReader.event-student-qr-reader{isolation:isolate;}
#eventStudentQrReader.event-student-qr-reader[data-scanning="true"]::before{display:none!important;content:none!important}


/* Actual camera feed fills the entire 1:1 reader with a visual-only scale.
   CSS transforms do not alter video.clientWidth / clientHeight, which the
   Html5Qrcode decoder uses for pixel mapping. */
#eventStudentQrReader.event-student-qr-reader{
 position:relative!important;isolation:isolate;
}
#eventStudentQrReader.event-student-qr-reader>div:not(.event-student-qr-placeholder){
 position:static!important;
}
#eventStudentQrReader.event-student-qr-reader video,
#eventStudentQrReader.event-student-qr-reader #eventStudentQrNativeVideo{
 position:absolute!important;top:50%!important;left:50%!important;
 width:100%!important;height:auto!important;
 max-width:none!important;max-height:none!important;
 margin:0!important;display:block!important;
 object-fit:contain!important;object-position:center!important;
 transform-origin:center center!important;
 transform:translate(-50%,-50%) scale(var(--osc-camera-cover-scale,1))!important;
}

/* Ticket Studio: alignment guides during drag */
#ticketStudio .ts-designer-surface{isolation:isolate}
#ticketStudio .ts-snap-guide{position:absolute;z-index:8;pointer-events:none;background:#e23d84;box-shadow:0 0 0 1px rgba(255,255,255,.7)}
#ticketStudio .ts-guide-v{top:0;bottom:0;width:1px}
#ticketStudio .ts-guide-h{left:0;right:0;height:1px}

/* Ticket Studio custom font preview and upload validation */
#ticketStudio .ts-overlay{font-optical-sizing:auto}
#ticketStudio .ts-font-status{margin-top:8px;font-size:11px;color:#55616a;overflow-wrap:anywhere}
#ticketStudio .ts-font-status strong{color:#642b43}
#ticketStudio .ts-font-error{display:block;color:#a52d41;margin-top:5px}
#ticketStudio .ts-font-status+button{margin-top:9px}
