/* Text and field outlines identify errors together, in both colour themes. */
:root{--form-error:#a32323;--form-error-bg:#fff0ed}
html[data-theme="dark"]{--form-error:#ffb4ab;--form-error-bg:#34232c}
#page-athlete .form-instructions{font-size:14px;line-height:1.6;margin:12px 0 24px;color:var(--text)}
#page-athlete .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
#page-athlete .form-grid>label,#page-athlete .details-grid>*{min-width:0}
#page-athlete input,#page-athlete select,#page-athlete textarea{min-width:0;max-width:100%;scroll-margin-block:120px}
#page-athlete .field-requirement{display:inline-block;font-size:12px;font-weight:600;color:var(--muted);margin-left:7px}
#page-athlete .check-row .field-requirement{order:1;flex-shrink:0}
#page-athlete .field-error{display:block;color:var(--form-error);font-size:13px;font-weight:500;line-height:1.5;margin-top:7px}
#page-athlete .field-error[hidden],#page-athlete .export-error-summary[hidden]{display:none}
#page-athlete [aria-invalid="true"]{border:2px solid var(--form-error);outline-offset:3px}
#page-athlete .check-row.field-has-error{padding:12px;border:2px solid var(--form-error);border-radius:10px;background:var(--form-error-bg)}
#page-athlete .export-error-summary{border:2px solid var(--form-error);border-radius:12px;background:var(--form-error-bg);padding:18px;margin-bottom:24px;color:var(--text)}
#page-athlete .export-error-summary h3{margin:0 0 8px;font-size:16px;color:var(--text)}
#page-athlete .export-error-summary ul{margin:0;padding-left:20px}
#page-athlete .error-link{display:inline-block;border:0;background:none;color:var(--form-error);font:inherit;font-size:14px;line-height:1.5;text-align:left;text-decoration:underline;text-underline-offset:3px;padding:7px 0;cursor:pointer}
#page-athlete .error-link:focus-visible{outline:2px solid currentColor;outline-offset:3px}
@media(max-width:600px){#page-athlete .form-grid{grid-template-columns:minmax(0,1fr)}#page-athlete .check-row{flex-wrap:wrap}#page-athlete .check-row .field-requirement{width:100%;margin:0}}

/* A visible forward action joins editing to the details/download step. */
#page-editor{padding-bottom:110px}
.editor-next-step{position:fixed;left:256px;right:24px;bottom:16px;z-index:25;display:flex;align-items:center;justify-content:space-between;gap:24px;padding:16px 20px;border:1px solid var(--line-strong);border-radius:16px;background:var(--surface);color:var(--text);box-shadow:0 6px 28px #0003}
.editor-next-step strong{font-size:16px;color:var(--text)}
.editor-next-step p{font-size:13px;line-height:1.5;margin:4px 0 0;color:var(--muted)}
.editor-next-step .btn{flex-shrink:0;min-height:48px;gap:9px;font-size:15px}
.required-information{padding:18px 20px;margin:16px 0 26px;border:1px solid var(--line-strong);border-radius:12px;background:var(--surface-alt);color:var(--text)}
.required-information h3{font-size:16px;margin:0 0 12px;color:var(--text)}
.required-information ul{padding-left:20px;margin:0 0 14px;font-size:14px;line-height:1.7}
.required-information li+li{margin-top:6px}
.required-information p,#page-athlete .required-information .form-instructions{font-size:13px;line-height:1.6;margin:12px 0 0}
#page-athlete .field-hint{display:block;font-size:12px;line-height:1.5;color:var(--muted);margin-top:7px}
#page-athlete .download-heading{font-size:21px;line-height:1.35;margin:12px 0 18px}
@media(max-width:1200px){.editor-next-step{left:232px;right:22px}}
@media(max-width:950px){.editor-next-step{left:22px}}
@media(max-width:600px){#page-editor{padding-bottom:145px}.editor-next-step{left:12px;right:12px;bottom:max(12px,env(safe-area-inset-bottom));padding:14px;gap:10px;flex-direction:column;align-items:stretch}.editor-next-step strong{font-size:14px}.editor-next-step p{display:none}.editor-next-step .btn{width:100%;font-size:15px}.required-information{padding:16px}#page-athlete .page-head h1{font-size:29px}}

/* Required input first; optional data stays in distinct disclosure groups. */
#page-athlete .field-heading{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:8px;line-height:1.4;font-size:14px;font-weight:600;color:var(--text)}
#page-athlete .field-heading .field-requirement{font-size:11px;line-height:1.5;margin:0;padding:3px 8px;border-radius:6px;white-space:nowrap;font-weight:600;color:var(--muted);background:var(--surface-alt);border:1px solid var(--line-strong)}
#page-athlete .is-required .field-requirement{color:var(--accent-text);background:var(--accent-panel);border-color:var(--accent-text)}
#page-athlete .required-fields input{border-top:2px solid var(--accent-text)}
#page-athlete .form-section-heading{font-size:17px;margin:26px 0 18px;color:var(--text)}
#page-athlete .form-optional{margin:22px 0;border:1px solid var(--line-strong);border-radius:12px;background:var(--surface)}
#page-athlete .form-optional>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:pointer;padding:17px 18px;font-size:14px;font-weight:600;list-style:none;color:var(--text)}
#page-athlete .form-optional>summary::-webkit-details-marker{display:none}
#page-athlete .form-optional>summary::after{content:'＋';font-size:20px;font-weight:400;order:2}
#page-athlete .form-optional[open]>summary::after{content:'−'}
#page-athlete .form-optional>summary:focus-visible{outline:2px solid var(--accent-text);outline-offset:3px;border-radius:12px}
#page-athlete .group-status{font-size:11px;font-weight:500;color:var(--muted);margin-left:auto;white-space:nowrap}
#page-athlete .group-status.contains-required{color:var(--accent-text);font-weight:600}
#page-athlete .optional-form-content{padding:0 18px 18px}
#page-athlete .optional-form-content>.hint:first-child{margin:0 0 18px}
#page-athlete .optional-form-content .athlete-photo-section{margin:0;padding-top:0;border-top:0}
#page-athlete .check-row .field-requirement{color:var(--accent-text);font-size:12px;font-weight:600}
@media(max-width:600px){#page-athlete .form-optional>summary{padding:15px 12px;gap:8px}#page-athlete .optional-form-content{padding:0 12px 16px}#page-athlete .field-heading{font-size:14px}#page-athlete .field-heading .field-requirement{font-size:11px}}

/* One reading direction: load, create, listen, download. */
#page-editor .editor-grid{grid-template-columns:minmax(0,1fr);max-width:1100px;margin-inline:auto}
#page-editor .main-column>.target-card{width:100%;display:block;order:1}
#page-editor .target-card .card-title h2{display:flex;align-items:center;gap:11px;font-size:21px;margin:0;color:var(--ink)}
#page-editor .target-card .create-instructions{font-size:14px;margin:0 0 22px;color:var(--text)}
#page-editor .target-entry{max-width:650px}
#page-editor .manual-time-fields{max-width:360px}
#page-editor .target-card .target-options{margin-top:20px}
#page-editor .target-card #autoBtn{font-size:17px;min-height:54px;margin-top:18px}
#page-editor .main-column>.export-card{order:6}
#page-editor .main-column>.small-note{order:7}
@media(max-width:600px){#page-editor .target-card .card-title h2{font-size:18px}#page-editor .manual-time-fields{max-width:none}}
#page-editor .main-column>.source-card{order:0}
#page-editor .main-column>.timeline-card{order:2}
#page-editor .main-column>section.card:not(.source-card):not(.timeline-card):not(.sound-card):not(.export-card){order:3}
#page-editor .main-column>.sound-card{order:4}
#page-editor .main-column>.tempo-card{order:5}

#listenStepHeading{scroll-margin-top:24px}
#listenStepHeading:focus{outline:none}
#listenStepHeading:focus-visible{outline:2px solid var(--accent-text);outline-offset:6px;border-radius:4px}

.editor-next-step.is-locked{box-shadow:none;background:var(--surface-alt);border-color:var(--line-strong)}
.editor-next-step.is-locked strong{font-size:13px;font-weight:500;color:var(--muted)}
.editor-next-step.is-locked .btn,.export-card.is-locked .btn{background:var(--surface-alt);color:var(--muted);border:1px solid var(--line-strong);box-shadow:none;opacity:.7;cursor:not-allowed}
.nav:disabled{opacity:.45;cursor:not-allowed;background:transparent!important}
#sourceStepHeading,#createStepHeading{scroll-margin-top:24px}
@media(max-width:950px){.sidebar nav{flex-wrap:wrap}.nav,.nav:last-child{flex:1 1 140px;max-width:none}}
@media(max-width:600px){.editor-next-step.is-locked{padding:9px 12px;gap:5px}.editor-next-step.is-locked .btn{min-height:38px;font-size:13px}.editor-next-step.is-locked p{display:block;font-size:11px;margin:0}.sidebar nav{gap:5px}.nav,.nav:last-child{flex:1 1 calc(50% - 5px);justify-content:flex-start}}

.rights-simple-grid{max-width:960px;display:grid;gap:24px;margin-inline:auto}
.rights-simple-grid .rights-intro{font-size:16px;line-height:1.65;color:var(--text);margin:12px 0 20px}
.rights-simple-grid p{font-size:14px;line-height:1.65;color:var(--text)}
.rights-disclosure{border:1px solid var(--line-strong);border-radius:12px;margin-top:18px}
.rights-disclosure>summary{display:flex;justify-content:space-between;gap:14px;align-items:center;padding:17px 18px;cursor:pointer;font-size:14px;font-weight:600;list-style:none;color:var(--text)}
.rights-disclosure>summary::-webkit-details-marker{display:none}
.rights-disclosure>summary:after{content:'＋';font-size:19px;order:2}
.rights-disclosure[open]>summary:after{content:'−'}
.rights-disclosure>summary span{font-size:12px;color:var(--muted);font-weight:400;margin-left:auto}
.rights-details-content{padding:0 18px 18px}.rights-details-content>.form-grid{margin-top:8px}
.rights-details-content>a{display:block;padding:10px 0;color:var(--accent-text)}
#downloadRules .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
#downloadRules input,#downloadRules select{min-width:0;max-width:100%}
@media(max-width:600px){#downloadRules .form-grid{grid-template-columns:minmax(0,1fr)}.rights-disclosure>summary{font-size:13px;padding:14px 12px}.rights-details-content{padding:0 12px 16px}}

.download-rules-section{margin-top:28px;border-top:1px solid var(--line);padding-top:8px;min-width:0}.download-rules-section h3{scroll-margin-top:24px}.download-rules-section .rights-explanation{margin-top:28px}.download-rules-section .rights-intro{font-size:14px;line-height:1.65}.download-rules-section .rights-row{grid-template-columns:minmax(0,1fr);gap:8px}
