/* FAST Adventures V13 – role portals and protected book quizzes. */
:root{--purple:#5635bc;--violet:#946bdf;--paper:#fff;--ink:#34294d;--muted:#706780;--shadow:0 20px 45px rgba(42,20,108,.14)}
*{box-sizing:border-box}
body.role-parent,body.role-admin{margin:0;color:var(--ink);font:16px/1.5 system-ui,-apple-system,"Segoe UI",sans-serif;background:radial-gradient(circle at 10% 15%,#fff3b0 0,transparent 24%),radial-gradient(circle at 90% 10%,#d4c2ff 0,transparent 30%),linear-gradient(135deg,#f3efff,#eaf8ff 45%,#fff5e1)}
.portal-shell{min-height:100vh;display:flex;flex-direction:column}
.portal-top{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:16px max(20px,calc((100vw - 1140px)/2));color:#fff;background:linear-gradient(110deg,#5f3cc9,#9a63d7);box-shadow:0 5px 20px #4f399744}
.portal-top a{color:#fff;text-decoration:none;font-weight:700}
.portal-top nav{display:flex;gap:16px;flex-wrap:wrap}.portal-brand{font-size:1.25rem}
.portal-main{width:min(1120px,calc(100% - 28px));margin:24px auto;flex:1}
.portal-card{padding:24px;margin:0 0 22px;border:2px solid #e3d5ff;border-radius:22px;background:#fffeffed;box-shadow:var(--shadow)}
.portal-card h1{font-size:clamp(1.45rem,3vw,2.1rem);margin:0 0 10px}.portal-card h2{margin:0 0 8px}.portal-card h3{margin:18px 0 8px}.portal-card p{color:var(--muted)}
.portal-eyebrow{font-size:.77rem;font-weight:800;letter-spacing:.1em;color:#7145a7}
.portal-row,.portal-record,.portal-inline,.portal-actions{display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap}
.portal-record{border-top:1px solid #ece2ff;padding:14px 0}.portal-inline{justify-content:flex-start;gap:8px}
.portal-actions{justify-content:flex-start}.portal-actions a{padding:10px 16px;border-radius:12px;background:#eee4ff;color:#4d3294;font-weight:750;text-decoration:none}
.portal-card button{padding:12px 17px;font:inherit;font-weight:750;border-radius:12px;cursor:pointer;border:2px solid transparent}
.portal-card button.primary{color:white;background:linear-gradient(140deg,#7854d6,#5536b4);box-shadow:0 3px 0 #462c95}
.portal-card button.outline{color:#5435a3;background:white;border-color:#d1bffa}
.portal-card button.small{font-size:.85rem;padding:8px 10px}.portal-card button:disabled{opacity:.43;cursor:not-allowed}
.portal-form{display:grid;gap:15px;margin:18px 0}.portal-form label{display:grid;gap:6px;font-weight:700}
.portal-form input,.portal-form select,.portal-form textarea{font:inherit;padding:12px;border-radius:11px;border:1px solid #cfbee9;background:#fff;min-width:0;width:100%}
.portal-form button{justify-self:start}.auth-card{max-width:580px;margin:36px auto}.auth-switch{margin-top:20px}
.portal-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:16px 0}
.portal-stats>div{padding:14px;background:#f4edff;border-radius:14px}.portal-stats small{display:block;color:var(--muted)}.portal-stats strong{font-size:1.45rem}
.portal-table-wrap{overflow:auto;max-height:510px}.portal-table{width:100%;border-collapse:collapse;min-width:660px;font-size:.9rem}
.portal-table th,.portal-table td{padding:10px 12px;text-align:left;border-bottom:1px solid #ecdefb;vertical-align:middle}
.portal-table th{color:#5e35a2;background:#f6efff}.portal-count{font-size:.8rem;border-radius:99px;background:#e9daff;padding:4px 9px}
.portal-msg{padding:10px 15px;border-radius:12px;margin:14px 0}.portal-msg.err{background:#ffebec;color:#963243}.portal-msg.ok{background:#e7f8ea;color:#216b42}
.portal-shell footer{text-align:center;color:#71658e;padding:18px}
@media(max-width:680px){.portal-top{padding:14px}.portal-main{margin:15px auto}.portal-card{padding:17px}.portal-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.portal-top{flex-wrap:wrap}}
/* V13.2 - accessible read/edit dialog and filters */
.portal-filter{display:flex;align-items:end;gap:12px;flex-wrap:wrap;margin:16px 0}
.portal-filter label{display:grid;gap:4px;font-weight:700;flex:1 1 200px}
.portal-filter input,.portal-filter select{border:1px solid #cfbee9;border-radius:10px;padding:10px;font:inherit;min-width:0;width:100%}
.portal-filter button{padding:10px 16px}
.fast-question-dialog{width:min(860px,calc(100vw - 28px));max-height:90vh;overflow:auto;border:1px solid #dbccf5;border-radius:22px;padding:22px;background:#fff;color:#34294d;box-shadow:0 25px 85px #2b1b5799;font:16px/1.5 system-ui,sans-serif}
.fast-question-dialog::backdrop{background:rgba(21,17,47,.68)}
.question-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid #eee3ff}
.question-dialog-head h2{margin:0;padding-bottom:10px}.question-dialog-head button{border:0;background:#f2ebff;border-radius:12px;font-size:2rem;line-height:1;cursor:pointer;padding:3px 12px}
.fast-question-dialog .portal-form label{display:grid;gap:5px;font-weight:700}
.fast-question-dialog input,.fast-question-dialog textarea,.fast-question-dialog select{font:inherit;border:1px solid #cfbee9;border-radius:10px;padding:11px;width:100%;background:#fff;color:#34294d}
.fast-question-dialog :disabled{background:#f5f2f8;color:#574c65;opacity:1}
.question-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.question-dialog-actions{justify-content:flex-end}
.question-dialog-actions button{border-radius:10px;border:2px solid #d4c5ed;padding:10px 16px;font-weight:750;cursor:pointer;background:white;color:#5435a3}
.question-dialog-actions button.primary{color:white;border-color:#5735b4;background:#5735b4}
.question-message{margin:12px 0;color:#65538a}.question-message.error{color:#a32742}
@media(max-width:620px){.question-grid{grid-template-columns:1fr}}

/* V13.6 - server-rendered admin categories. One panel at a time. */
.portal-tabs{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:10px;margin:0 0 20px;border:1px solid #e0d4f8;border-radius:18px;background:#ffffffdf;box-shadow:0 9px 24px #40246b13}
.portal-tab{display:inline-flex;justify-content:center;align-items:center;min-height:42px;padding:9px 15px;border-radius:12px;color:#5c448d;background:#f4efff;border:1px solid transparent;text-decoration:none;font-size:.92rem;font-weight:750;transition:background .12s,border-color .12s}
.portal-tab:hover{background:#e9ddff}
.portal-tab:focus-visible{outline:3px solid #8669e3;outline-offset:2px}
.portal-tab.is-active,.portal-tab[aria-current=page]{background:#5a3bb4;color:#fff;box-shadow:0 3px 8px #6e4cc02b}
#quiz-review{scroll-margin-top:20px}
@media(max-width:680px){.portal-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.portal-tab{padding:10px 8px;text-align:center;font-size:.84rem}}
@media(max-width:380px){.portal-tabs{grid-template-columns:1fr}}


/* V13.7 - Book quiz question editor: full-width, accessible and responsive. */
.portal-quiz-guide,.portal-quiz-empty{margin:18px 0;padding:13px 16px;background:#f6f0ff;border:1px solid #e5d9fb;border-radius:12px;color:#54436e}
.portal-quiz-list{display:grid;gap:12px;margin:18px 0}
/* Critical: do not use .portal-record's horizontal flex layout for a details editor. */
.portal-quiz-item{display:block!important;width:100%;min-width:0;overflow:hidden;border:1px solid #e0d3f6;border-radius:17px;background:#fff;box-shadow:0 3px 12px #4b2e8a0c}
.portal-quiz-item[open]{border-color:#bca6e8;box-shadow:0 10px 22px #4b2e8a14}
.portal-quiz-summary{display:flex;align-items:center;gap:12px;min-width:0;padding:15px 17px;cursor:pointer;list-style:none;background:#fbf9ff}
.portal-quiz-summary::-webkit-details-marker{display:none}
.portal-quiz-summary::after{content:'+';font-size:1.5rem;line-height:1;color:#7452b7;font-weight:700;order:5;margin-left:2px}
.portal-quiz-item[open]>.portal-quiz-summary::after{content:'−'}
.portal-quiz-summary:hover{background:#f4efff}
.portal-quiz-summary:focus-visible,.portal-quiz-feedback>summary:focus-visible{outline:3px solid #8164cb;outline-offset:-3px}
.portal-quiz-number{flex:none;color:#5736ad;font-weight:850;background:#ebe2fd;padding:5px 10px;border-radius:9px}
.portal-quiz-summary-text{flex:1 1 220px;min-width:0;font-weight:750;overflow-wrap:anywhere;line-height:1.4}
.portal-quiz-status,.portal-quiz-state{flex:none;font-size:.76rem;border-radius:30px;padding:4px 9px;font-weight:750}
.portal-quiz-status.is-on{background:#e7f7ec;color:#20653b}.portal-quiz-status.is-off{background:#fff0f1;color:#a33348}
.portal-quiz-state{background:#eae4fa;color:#533c91}
.portal-quiz-body{padding:22px;min-width:0;border-top:1px solid #e9e0f7}
.portal-quiz-notice{background:#fff6df;border:1px solid #efd8a0;padding:12px 15px;border-radius:10px;color:#6e5417!important}
.portal-quiz-form{display:block;margin:0;width:100%;min-width:0}
.portal-quiz-fields{min-width:0;border:0;margin:0;padding:0}
.portal-quiz-fields[disabled]{opacity:.84}
.portal-quiz-group{padding:0 0 22px;margin-bottom:21px;border-bottom:1px solid #ede6f6}
.portal-quiz-group h4{font-size:1.03rem;margin:0 0 12px;color:#503589}
.portal-quiz-hint{color:#746984!important;font-size:.86rem;line-height:1.45;margin:0 0 13px}
.portal-quiz-form .portal-quiz-field{display:grid;gap:7px;min-width:0;margin:0;color:#49366c;font-size:.91rem;font-weight:750}
.portal-quiz-form textarea,.portal-quiz-form input,.portal-quiz-form select{width:100%;max-width:100%;min-width:0;border:1px solid #cfc0e6;border-radius:11px;padding:11px 13px;color:#34294d;background:white;font:500 1rem/1.5 system-ui,-apple-system,'Segoe UI',sans-serif}
.portal-quiz-form textarea{resize:vertical;min-height:70px}
.portal-quiz-form textarea:focus,.portal-quiz-form input:focus,.portal-quiz-form select:focus{outline:3px solid #e6dbff;border-color:#7754cc}
.portal-quiz-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px;margin:0 0 16px}
.portal-answer-choice{padding:12px;border:1px solid #eee5fa;border-radius:13px;background:#fcfaff}
.portal-answer-choice.is-correct{border-color:#8ecc9c;background:#f2fbf5}
.portal-answer-choice.is-correct>span::after{content:'  ✓ Correct';color:#237147;font-size:.78rem}
.portal-quiz-meta{margin-bottom:0}
.portal-quiz-feedback{display:block;width:100%;margin:0 0 18px;border:1px solid #e6daf8;border-radius:12px;overflow:hidden;background:#fdfbff}
.portal-quiz-feedback>summary{cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:12px;list-style:none;padding:14px 16px;font-weight:800;color:#53358f}
.portal-quiz-feedback>summary::-webkit-details-marker{display:none}
.portal-quiz-feedback>summary::before{content:'+';font-weight:800;font-size:1.1rem}
.portal-quiz-feedback[open]>summary::before{content:'−'}
.portal-quiz-feedback>summary span{font-size:.76rem;font-weight:550;color:#837595}
.portal-quiz-feedback>.portal-quiz-hint{margin:0;padding:4px 16px 12px}
.portal-quiz-feedback>.portal-quiz-grid{padding:0 16px 16px;margin:0}
.portal-quiz-actions{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 0;flex-wrap:wrap}
.portal-quiz-actions .portal-quiz-hint{max-width:440px;margin:0}
.portal-quiz-toggle{display:flex;justify-content:flex-end;border-top:1px solid #eee5f8;padding-top:12px}
@media(max-width:710px){.portal-quiz-grid{grid-template-columns:1fr}.portal-quiz-body{padding:14px}.portal-quiz-summary{gap:8px;flex-wrap:wrap;padding:12px}.portal-quiz-summary-text{flex-basis:calc(100% - 84px)}.portal-quiz-state{margin-left:0}.portal-quiz-feedback>summary{flex-wrap:wrap}}

/* V13.8 - Persisted status controls. Visually distinguish disabled quiz/question records. */
.portal-quiz-record{background:#faf8ff;border:1px solid #ece2fa;border-left:5px solid #9574d5;border-radius:13px;padding:13px 15px;margin:9px 0;align-items:center;gap:15px}
.portal-quiz-record.is-disabled{background:#fff3f3;border-color:#f2d1d4;border-left-color:#b64c60}
.portal-quiz-record-info{display:flex;align-items:center;flex-wrap:wrap;gap:9px;min-width:0;flex:1}
.portal-quiz-record-info strong{font-size:.96rem;overflow-wrap:anywhere}
.portal-quiz-record-info small{color:#6e627d}
.portal-state-badge{display:inline-flex;align-items:center;white-space:nowrap;border-radius:99px;padding:5px 10px;font-size:.79rem;font-weight:800;line-height:1.2}
.portal-state-badge::before{content:'';width:7px;height:7px;border-radius:100%;margin-right:7px;background:currentColor}
.portal-state-badge.is-published,.portal-state-badge.is-enabled{background:#e5f5ea;color:#206542}
.portal-state-badge.is-draft{background:#f1e9ff;color:#65508e}
.portal-state-badge.is-disabled{background:#ffe0e2;color:#9c2f42}
.portal-state-controls{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.portal-card button.portal-btn-enable{background:#e6f6ec;color:#1c6940;border-color:#9ccdab}
.portal-card button.portal-btn-disable{color:#923248;border-color:#e8b9c2}
.portal-quiz-item.is-disabled{border-color:#e8b6c0;border-left:5px solid #b33c55;background:#fff9fa}
.portal-quiz-item.is-disabled>.portal-quiz-summary{background:#fff0f2}
.portal-quiz-item.is-disabled>.portal-quiz-summary .portal-quiz-summary-text{color:#824352}
.portal-quiz-item.is-disabled>.portal-quiz-summary .portal-quiz-number{background:#f9dce3;color:#8f3048}
.portal-quiz-status.is-off{background:#ffdce2;color:#8c273f;border:1px solid #e5a4b3}
.portal-table-row-disabled{background:#fff5f6}
.portal-table-row-disabled td:nth-child(3){color:#875566}
@media(max-width:620px){.portal-quiz-record>.portal-inline{width:100%}.portal-quiz-record .portal-inline form{flex:1}.portal-quiz-record .portal-inline button{width:100%}}

/* V13.9: responsive instant filtering in Math & Reading. */
#question-bank[aria-busy="true"] #question-bank-results {opacity:.52;transition:opacity .12s ease}
.question-filter-status{min-height:1.1em;margin:0 0 8px;color:#715b91;font-size:.85rem}
.question-filter-status.is-error{color:#a51b45}
#question-bank-pagination a{display:inline-block;padding:2px 5px}

/* V13.10: consistent inline admin controls across all five tabs. */
.role-admin .portal-actions > a {display:inline-flex;align-items:center;justify-content:center;line-height:1.3;text-align:center;min-height:44px}
.role-admin .portal-inline > form,
.role-admin .portal-state-controls > form,
.role-admin .portal-quiz-toggle {margin:0}
.role-admin .portal-state-controls button {white-space:nowrap}
.role-admin .portal-actions, .role-admin .portal-inline, .role-admin .portal-state-controls {row-gap:10px}
@media(max-width:620px) {
  .role-admin .portal-actions > a {flex:1 1 100%}
  .role-admin .portal-quiz-actions button {width:100%}
  .role-admin .portal-state-controls {justify-content:flex-start}
}

.portal-top a.portal-brand{display:inline-flex;align-items:center;line-height:0;flex:0 0 auto}
.portal-top a.portal-brand img{display:block;width:171px;height:auto;aspect-ratio:213/87;object-fit:contain;border-radius:8px;box-shadow:0 2px 9px #15276450}
.portal-top a.portal-brand:focus-visible{outline:3px solid #ffe075;outline-offset:3px}
@media(max-width:680px){.portal-top a.portal-brand img{width:155px}}
.portal-top a.portal-brand img{background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;filter:drop-shadow(0 2px 2px #18224f50)}
#game-controls .portal-form label input[type=checkbox]{display:inline-block;width:auto;min-width:18px;height:18px;vertical-align:middle;margin:0 8px 0 0;accent-color:#6c43b5}
#game-controls .portal-form>label{max-width:420px}

/* Admin-only pet voice studio. The kids' pet selector contains no preview controls. */
#pet-voice-studio .portal-voice-toolbar {
  display:flex;flex-wrap:wrap;align-items:end;gap:12px;margin:15px 0;
}
#pet-voice-studio .portal-voice-toolbar label {
  display:grid;gap:5px;min-width:190px;font-size:.92rem;font-weight:800;color:#513c83;
}
#pet-voice-studio .portal-voice-toolbar select {
  border:1px solid #cfbee9;border-radius:11px;padding:10px 12px;
  min-height:44px;max-width:300px;font:inherit;background:#fff;color:#34294d;
}
#pet-voice-studio .portal-voice-status {
  margin:10px 0 14px;padding:9px 12px;border-radius:12px;
  background:#eff9f5;color:#276b50;font-weight:800;font-size:.88rem;
}
#pet-voice-studio .portal-voice-status.is-error {
  background:#fff0f3;color:#9a3552;
}
#pet-voice-studio .portal-voice-grid {
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;
  width:100%;
}
#pet-voice-studio .portal-voice-card {
  display:flex;flex-direction:column;align-items:center;gap:7px;min-width:0;
  padding:12px 10px;background:#fffaff;border:2px solid #e6d6fa;
  border-radius:16px;text-align:center;
}
#pet-voice-studio .portal-voice-card img {
  display:block;width:96px;height:96px;max-width:100%;object-fit:contain;
}
#pet-voice-studio .portal-voice-card-info {min-width:0;flex:1}
#pet-voice-studio .portal-voice-card-info h3 {
  margin:0;color:#5635a1;font-size:1rem;font-weight:900;
}
#pet-voice-studio .portal-voice-card-info small {
  display:block;color:#736785;font-size:.78rem;
}
#pet-voice-studio .portal-voice-card-info span {
  display:inline-block;padding:3px 8px;margin-top:6px;border-radius:999px;
  background:#f3eaff;color:#65508e;font-size:.73rem;font-weight:850;
}
#pet-voice-studio .portal-voice-play {
  width:100%;padding:8px 9px;min-height:42px;font-size:.86rem;
}
#pet-voice-studio .portal-voice-play.is-playing {
  background:linear-gradient(140deg,#198b73,#126e60);
  border-color:#198b73;box-shadow:0 2px 0 #126e60;
}
#pet-voice-studio .portal-voice-transcript {
  margin:16px 0 0;padding:13px 15px;border:1px solid #d8c9f3;
  border-radius:12px;background:#f7f2ff;color:#604e7c;font-style:italic;
}
#pet-voice-studio button:focus-visible,
#pet-voice-studio select:focus-visible {
  outline:3px solid #e8ae41;outline-offset:3px;
}
@media(max-width:900px){
  #pet-voice-studio .portal-voice-grid {grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:680px){
  #pet-voice-studio .portal-voice-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  #pet-voice-studio .portal-voice-card {padding:10px 7px}
  #pet-voice-studio .portal-voice-card img {width:82px;height:82px}
}
@media(max-width:375px){
  #pet-voice-studio .portal-voice-grid {grid-template-columns:1fr}
  #pet-voice-studio .portal-voice-card {flex-direction:row;text-align:left}
  #pet-voice-studio .portal-voice-card img {width:68px;height:68px}
  #pet-voice-studio .portal-voice-card-info {flex:1}
  #pet-voice-studio .portal-voice-play {width:auto;flex:0 0 auto}
}


/* Game Zone: existing admin portal components, one scoped responsive grid. */
#game-controls .portal-arcade-settings{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:16px}
#game-controls .portal-arcade-form{min-width:0;display:grid;gap:12px;padding:15px;border:2px solid #e6dafa;border-radius:17px;background:#faf7ff;margin:0}
#game-controls .portal-arcade-form h3{margin:0;color:#563d9b;font-size:1.07rem}
#game-controls .portal-arcade-form .portal-arcade-enable{display:flex;align-items:center;gap:8px}
#game-controls .portal-arcade-form .portal-arcade-enable input[type=checkbox]{margin:0;width:19px;min-width:19px;height:19px;accent-color:#6845b7}
#game-controls .portal-arcade-form>button{justify-self:start}
@media(max-width:650px){#game-controls .portal-arcade-settings{grid-template-columns:1fr}}

/* FAST REVIEW SHORT READS + PARENT PROFILE 20261107 */
/* FAST Adventures: Short Reads editor and Child Profile (portal-local). */
.portal-short-link{display:inline-flex;align-items:center;justify-content:center;padding:9px 12px;background:#f2eaff;color:#5b3f9a;border:1px solid #d3baf8;border-radius:11px;text-decoration:none;font-size:.87rem;font-weight:850;white-space:normal;text-align:center}
.portal-short-link:hover{background:#e6d8ff}
.portal-short-new,.portal-short-question{margin:14px 0;border:1px solid #dcc9f7;background:#faf7ff;border-radius:14px;overflow:hidden}
.portal-short-new>summary,.portal-short-question>summary{padding:14px 18px;cursor:pointer;color:#594192;font-size:1rem;font-weight:850;line-height:1.45;overflow-wrap:anywhere}
.portal-short-new[open]>summary,.portal-short-question[open]>summary{background:#eee5ff;border-bottom:1px solid #dfcef8}
.portal-short-new>.portal-form,.portal-short-question>.portal-form{padding:15px;margin:0}
.portal-short-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;min-width:0}
.portal-short-fields>label{min-width:0}.portal-short-new .portal-short-fields{margin:12px 0}
.portal-short-note{font-size:.85rem;color:#766686!important;background:#f8f2ff;padding:10px;border-radius:10px}
.portal-short-warning{padding:11px 13px;background:#fff1df;border:1px solid #e8c790;border-radius:10px;color:#875c14!important;font-size:.91rem}
.portal-short-table{overflow-x:auto;max-height:500px;overflow-y:auto;border:1px solid #eee5fc;border-radius:13px}
.portal-short-table table{min-width:640px}.portal-short-table th{position:sticky;top:0;z-index:1}
.portal-short-pages{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-top:20px}
.portal-short-page{padding:11px 8px;border:1px solid #d7c5f6;background:#f3edff;border-radius:12px;text-align:center;text-decoration:none;color:#65489b;font-weight:900;font-size:.91rem}
.portal-short-page.is-active{color:#fff;background:#7653cb;box-shadow:0 3px 0 #5839a3}
.portal-short-fieldset{display:grid;gap:15px;min-width:0;border:0;padding:0;margin:0}
.portal-short-fieldset[disabled]{opacity:.7}
.portal-short-new input:focus-visible,.portal-short-new textarea:focus-visible,.portal-short-question textarea:focus-visible,.portal-short-page:focus-visible{outline:3px solid #9a72e2;outline-offset:2px}
@media(max-width:670px){.portal-short-fields{grid-template-columns:1fr}.portal-short-pages{grid-template-columns:repeat(2,minmax(0,1fr))}.portal-short-table{max-height:450px}}


/* FAST child photo and save confirmation */
.portal-child-identity{display:flex;align-items:center;gap:16px;min-width:0;margin:4px 0 12px}
.portal-child-identity h2{margin:4px 0 0}
.portal-child-avatar{width:82px;height:82px;min-width:82px;border-radius:50%;object-fit:cover;border:4px solid #e4d5ff;box-shadow:0 5px 13px #7056a524;background:#f3e9ff}
.portal-child-avatar-placeholder{display:inline-flex;align-items:center;justify-content:center;font-size:38px;color:#714fa8}
.portal-photo-panel{padding:16px;border:1px solid #dfd0f6;border-radius:18px;background:linear-gradient(130deg,#fcf9ff,#f0f8ff);margin:16px 0}
.portal-photo-intro{display:flex;align-items:start;gap:10px}
.portal-photo-intro>span{font-size:24px}
.portal-photo-intro strong{color:#5636a0}
.portal-photo-intro p{font-size:.9rem;margin:4px 0;color:#625c76}
.portal-photo-form{margin:10px 0 0;gap:10px}
.portal-photo-form input[type=file]{cursor:pointer;padding:9px}
.portal-photo-form button{justify-self:start}
.portal-profile-success{display:flex;align-items:center;gap:13px;position:sticky;top:14px;z-index:40;max-width:700px;padding:13px 15px;margin:0 0 17px;background:#e8fcef;border:2px solid #84d3a3;border-radius:16px;color:#1c6f44;box-shadow:0 8px 25px #174e2b23}
.portal-profile-success .portal-success-icon{display:inline-flex;align-items:center;justify-content:center;flex:none;width:40px;height:40px;background:#2eab65;color:white;border-radius:50%;font-size:25px;font-weight:900}
.portal-profile-success strong{display:block;font-size:1rem}
.portal-profile-success p{margin:3px 0 0;color:#23573c;font-size:.9rem}
.portal-card button.portal-success-dismiss{align-self:flex-start;margin-left:auto;flex:none;border:0;background:transparent;color:#276440;padding:0 5px;font-size:25px;line-height:1}
@media(max-width:560px){.portal-child-avatar{width:66px;height:66px;min-width:66px}.portal-child-identity{gap:10px}.portal-profile-success{top:8px}}
/* FAST_PRIVACY_V9: private, first-party cartoon avatar selector. */
.portal-avatar-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(118px,1fr));gap:12px;margin:12px 0 20px}
.portal-avatar-option{display:flex!important;align-items:center;text-align:center;flex-direction:column;gap:6px;padding:11px;border:2px solid #dfd2f8;border-radius:18px;background:linear-gradient(155deg,#f5eaff,#eaf9ff);cursor:pointer}
.portal-avatar-option input{width:auto!important;min-width:auto!important;accent-color:#6841c2;margin:0 0 3px}
.portal-avatar-option img{width:96px;height:96px;object-fit:contain;max-width:100%;background:radial-gradient(circle,#fffeff 0,#e6dafa 76%);border-radius:50%;padding:2px}
.portal-avatar-option:has(input:checked){border-color:#6739b8;box-shadow:0 0 0 3px #a98deb55}
.portal-avatar-option:focus-within{outline:3px solid #7859cc;outline-offset:3px}
.portal-avatar-option span{font-size:.83rem;line-height:1.2;font-weight:750}
/* FAST_AVATAR_COMPACT_GRID_V9_1: four compact avatar cards in a row (desktop). */
.portal-photo-panel .portal-avatar-form .portal-avatar-list {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    margin: 14px 0 18px;
    align-items: stretch;
}
.portal-photo-panel .portal-avatar-form .portal-avatar-option {
    position: relative;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    min-height: 154px;
    padding: 14px 8px 10px;
    border: 2px solid #dfd2f8;
    border-radius: 16px;
    background: #fff;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.portal-photo-panel .portal-avatar-form .portal-avatar-option img {
    width: 88px;
    height: 88px;
    max-width: 100%;
    object-fit: contain;
    margin: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
}
.portal-photo-panel .portal-avatar-form .portal-avatar-option span {
    display: block;
    font-size: .9rem;
    font-weight: 750;
    line-height: 1.2;
}
.portal-photo-panel .portal-avatar-form .portal-avatar-option input[type="radio"] {
    position: absolute;
    top: 9px;
    right: 9px;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    cursor: pointer;
    accent-color: #6841c2;
}
.portal-photo-panel .portal-avatar-form .portal-avatar-option:has(input[type="radio"]:checked) {
    border-color: #6841c2;
    background: #f6f0ff;
    box-shadow: 0 0 0 3px #a98deb55;
}
.portal-photo-panel .portal-avatar-form .portal-avatar-option:focus-within {
    outline: 3px solid #7859cc;
    outline-offset: 2px;
}
@media (max-width: 900px) {
    .portal-photo-panel .portal-avatar-form .portal-avatar-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 600px) {
    .portal-photo-panel .portal-avatar-form .portal-avatar-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }
    .portal-photo-panel .portal-avatar-form .portal-avatar-option {
        min-height: 139px;
        padding: 12px 6px 8px;
    }
    .portal-photo-panel .portal-avatar-form .portal-avatar-option img {
        width: 78px;
        height: 78px;
    }
}