.student-title-slot { display:block; text-align:center; }
.student-title-slot:empty { display:none; }
.student-plant-frame { position:relative; display:flow-root; }
.student-plant-frame > .student-title-slot:not(:empty) { position:absolute; bottom:4px; left:-5px; right:-5px; z-index:2; display:flex; align-items:center; justify-content:center; pointer-events:none; }
.student-plant-frame .student-title-trigger { pointer-events:auto; }
.student-title-trigger { display:inline-flex; align-items:center; justify-content:center; border:0; padding:0; background:transparent; font:inherit; cursor:pointer; max-width:100%; }
.student-title-trigger:focus-visible { outline:3px solid #a58035; outline-offset:3px; border-radius:4px; }
.student-title-ribbon {
    --title-paper:#fff6d8; --title-edge:#e6ce91; --title-shadow:#eddfb8;
    --title-ink:#536f3f; --title-seal:#e3efcc; --title-seal-edge:#a1b97d;
    position:relative; isolation:isolate; display:inline-flex; align-items:center; gap:.3em; box-sizing:border-box;
    width:max-content; max-width:calc(100% - 18px); min-height:2.4em; margin:3px 9px 5px; padding:.25em .55em;
    color:var(--title-ink); background:linear-gradient(180deg,#ffffff55,#ffffff00),var(--title-paper); border:2px solid var(--title-edge); border-radius:4px;
    box-shadow:0 2px 0 var(--title-shadow); font-size:12px; font-weight:800; line-height:1.35; white-space:nowrap;
}
.student-title-ribbon:before,.student-title-ribbon:after { content:''; position:absolute; top:4px; bottom:-5px; width:10px; z-index:-1; background:var(--title-edge); }
.student-title-ribbon:before { left:-10px; clip-path:polygon(0 0,100% 0,100% 100%,0 100%,28% 50%); transform:rotate(-5deg); }
.student-title-ribbon:after { right:-10px; clip-path:polygon(0 0,100% 0,72% 50%,100% 100%,0 100%); transform:rotate(5deg); }
.student-title-band { display:block; min-width:0; }
.student-title-band:before,.student-title-band:after { content:''; position:absolute; bottom:-5px; width:5px; height:4px; background:color-mix(in srgb,var(--title-ink) 28%,var(--title-edge)); }
.student-title-band:before { left:-1px; clip-path:polygon(0 0,100% 0,100% 100%); }
.student-title-band:after { right:-1px; clip-path:polygon(0 0,100% 0,0 100%); }
.student-title-text { display:block; letter-spacing:.025em; }
.student-title-seal {
    display:inline-flex; align-items:center; justify-content:center; width:1.5em; height:1.7em; flex:none; box-sizing:border-box;
    transform:rotate(-5deg); color:var(--title-ink);
}
.student-title-seal svg { width:1.5em; height:1.5em; }
#studentGrid .student-title-long-name { font-size:11px; gap:3px; padding-inline:4px; }
#studentGrid .student-title-long-name .student-title-text { letter-spacing:0; }
#studentGrid .student-title-long-name .student-title-seal { width:1.7em; height:1.7em; }
#studentGrid .student-plant-frame .student-title-ribbon { min-height:25px; margin:0 9px; padding:2px 5px; border-width:1.5px; border-radius:4px; font-size:11px; }
#studentGrid .student-plant-frame .student-title-seal { width:17px; height:18px; }
#studentGrid .student-plant-frame .student-title-long-name { padding-inline:3px; }
#studentGrid .student-plant-frame .student-title-long-name .student-title-seal { width:16px; height:18px; }
.title-tone-gold { --title-paper:#fff1c6; --title-edge:#e4c677; --title-shadow:#eddbac; --title-ink:#94651e; --title-seal:#ffe6a8; --title-seal-edge:#d1ae61; }
.title-tone-blue { --title-paper:#eef7ff; --title-edge:#b4d0e2; --title-shadow:#dce9ef; --title-ink:#466f8b; --title-seal:#dceef7; --title-seal-edge:#93bace; }
.title-tone-pink { --title-paper:#fff0f2; --title-edge:#e6bac7; --title-shadow:#efdae1; --title-ink:#9b5e75; --title-seal:#ffe0e8; --title-seal-edge:#d5a5b6; }
.title-tone-purple { --title-paper:#f6efff; --title-edge:#cdbbdf; --title-shadow:#e5dbef; --title-ink:#806397; --title-seal:#eadff8; --title-seal-edge:#b9a1d1; }
.student-title-slot.compact { display:inline-flex; vertical-align:middle; margin-left:3px; }
.student-title-trigger.compact { color:var(--title-ink,#285a43); width:20px; height:22px; }
.student-title-trigger.compact svg { width:16px; height:16px; }
.student-title-definition-list { display:grid; gap:12px; }
.student-title-definition { display:flex; align-items:center; gap:18px; padding:16px; border:1px solid #e6dcc6; border-radius:14px; background:#fffdf7; }
.student-title-definition > div { flex:1; min-width:0; }
.student-title-definition small { display:block; color:#78716c; margin-top:5px; }
.student-title-editor { display:grid; gap:15px; min-width:0; }
.student-title-preview { display:flex; justify-content:center; padding:14px; background:#fffaf0; border-radius:14px; }
.student-title-preview .student-title-ribbon { font-size:14px; }
.student-title-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.student-title-fields > * { min-width:0; }
.student-title-editor input:not([type=checkbox]),.student-title-editor select { width:100%; min-width:0; box-sizing:border-box; }
.student-title-longterm { display:flex; align-items:center; gap:7px; font-size:14px; }
.student-title-selection-head { display:flex; gap:12px; justify-content:space-between; align-items:center; flex-wrap:wrap; }
.student-title-selection-head > label { display:flex; align-items:center; gap:6px; font-size:13px; }
.student-title-selection-head select { width:auto; padding:6px; }
.student-title-selection-actions { display:flex; gap:8px; }
.student-title-choice-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; }
.student-title-choice { display:flex; align-items:center; gap:5px; padding:8px 6px; border:1px solid #ded8c8; border-radius:10px; min-width:0; cursor:pointer; }
.student-title-choice:has(input:checked) { background:#e5f0dd; border-color:#85a77a; color:#285a43; }
.student-title-choice input { margin:0; flex:none; }
.student-title-choice > span { display:grid; gap:3px; min-width:0; }
.student-title-choice b { font-size:16px; }
.student-title-choice > span > span { font-size:12px; overflow-wrap:anywhere; }
.student-title-form-hint { font-size:12px; color:#78716c; line-height:1.6; margin:0; }
.student-title-editor-status { color:#b45309; font-size:14px; }
.student-title-editor-status:empty { display:none; }
.student-title-editor-actions { display:flex; justify-content:space-between; gap:12px; }
.student-title-history h4 { margin:0 0 12px; color:#65452e; }
.student-title-history { margin-bottom:20px; min-width:0; }
.student-title-history-list { display:grid; gap:10px; }
.student-title-history-row { display:flex; align-items:center; flex-wrap:wrap; gap:10px 18px; padding:10px; background:#fffaf0; border-radius:10px; }
.student-title-history-row > div { flex:1; min-width:160px; }
.student-title-history-row strong { font-size:13px; color:#476d48; }
.student-title-history-row small { display:block; font-size:12px; color:#78716c; line-height:1.6; margin-top:4px; }
.student-title-display-picker { display:flex; gap:10px; align-items:center; flex-wrap:wrap; font-size:13px; margin-bottom:14px; }
.student-title-display-picker select { max-width:100%; padding:7px; border:1px solid #d5cbb7; border-radius:8px; font:inherit; }
.student-title-awarded { animation:student-title-pop .9s ease-out both; }
.student-title-awarded .student-title-seal svg { animation:student-title-book .9s ease-out both; }
.student-title-celebration { display:grid; justify-items:center; gap:20px; text-align:center; padding:20px 0; }
.student-title-celebration .student-title-ribbon { font-size:20px; }
.student-title-celebration > strong { color:#476d48; font-size:18px; }
.student-title-celebration > p { margin:0; line-height:1.9; color:#65452e; overflow-wrap:anywhere; }
.student-title-celebration-stars { color:#c89b36; font-size:30px; animation:student-title-stars 1s ease-out both; }
@keyframes student-title-stars { from { opacity:0; transform:scale(.4) translateY(20px); } to { opacity:1; transform:scale(1); } }
@keyframes student-title-pop { 0% { transform:scale(.65) translateY(5px); filter:brightness(1.2); } 55% { transform:scale(1.08) translateY(-1px); } 100% { transform:scale(1); filter:none; } }
@keyframes student-title-book { 0% { transform:perspective(80px) rotateY(75deg); } 65% { transform:perspective(80px) rotateY(-10deg); } 100% { transform:none; } }
@media(max-width:720px) {
    .student-title-definition { flex-wrap:wrap; gap:10px; padding:12px; }
    .student-title-definition > div { flex-basis:calc(100% - 175px); }
    .student-title-definition > button { margin-left:auto; }
    .student-title-choice-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
    .student-title-choice { min-height:44px; box-sizing:border-box; }
    .student-title-fields { grid-template-columns:1fr; }
    .student-title-editor input:not([type=checkbox]),.student-title-editor select { font-size:16px; }
    .student-title-trigger.compact { min-width:28px; min-height:28px; }
}
@media(prefers-reduced-motion:reduce) { .student-title-awarded,.student-title-awarded .student-title-seal svg,.student-title-celebration-stars { animation:none; } }
