:root {
  color-scheme:light;
  --bg:#f7f8fb;
  --surface:#fff;
  --ink:#1b2638;
  --inksoft:#46556a;
  --muted:#758196;
  --line:#e6eaf0;
  --accent:#315b9e;
  --accentdark:#214677;
  --accentbg:#edf3ff;
  --red:#b13737;
  --redbg:#fff1f0;
  --shadow:0 7px 29px rgba(36,52,82,.045);
  /* Escala tipográfica para textos de lectura e interfaz (ajuste de legibilidad). */
  --type-micro:11px;
  --type-xxs:11.5px;
  --type-xs:12.5px;
  --type-sm:13.5px;
  --type-base:14.5px;
  --type-medium:15px;
  --type-large:16px;
  --type-heading:21px;
}
* {
  box-sizing:border-box;
}
html {
  scroll-behavior:smooth;
}
body {
  margin:0;
  background:var(--bg);
  font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
  color:var(--ink);
  line-height:1.48;
}
button,input,select,textarea {
  font:inherit;
}
button {
  cursor:pointer;
}
button:disabled {
  cursor:not-allowed;
  opacity:.55;
}
input,textarea,select {
  color:var(--ink);
}
[hidden] {
  display:none!important;
}
button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,abbr:focus-visible {
  outline:3px solid #97b9ed;
  outline-offset:2px;
}
svg {
  flex-shrink:0;
}
.app-shell {
  max-width:1270px;
  margin:auto;
  padding:0 34px;
}
.site-header {
  min-height:102px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--line);
  gap:20px;
}
.brand {
  display:flex;
  align-items:center;
  gap:12px;
}
.brand-symbol {
  width:50px;
  height:50px;
  border-radius:14px;
  display:grid;
  place-items:center;
  color:#fff;
  background:#254d89;
}
.brand-name {
  font-size:var(--type-heading);
  letter-spacing:-.6px;
  font-weight:760;
}
.brand-subtitle {
  font-size:var(--type-sm);
  color:var(--muted);
  margin-top:2px;
}
.header-trust {
  border:1px solid #dfe7ed;
  background:#fff;
  border-radius:30px;
  padding:8px 12px;
  font-size:var(--type-sm);
  font-weight:600;
  color:#62748a;
  display:flex;
  align-items:center;
  gap:8px;
}
.status-dot {
  width:8px;
  height:8px;
  background:#37a183;
  border-radius:50%;
}
.intro {
  padding:56px 0 40px;
}
.eyebrow {
  color:var(--accent);
  font-size:var(--type-xs);
  font-weight:800;
  letter-spacing:1.9px;
}
.intro h1 {
  font-size:clamp(32px,4vw,49px);
  letter-spacing:-1.95px;
  line-height:1.13;
  margin:13px 0 15px;
  font-weight:760;
}
.intro h1 span {
  color:#6d809d;
}
.intro>p {
  font-size:var(--type-large);
  color:var(--inksoft);
  max-width:660px;
  margin:0;
  line-height:1.8;
}
.panel {
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow:var(--shadow);
}
.config-panel {
  overflow:hidden;
}
.panel-header {
  padding:25px 30px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:15px;
  border-bottom:1px solid var(--line);
}
.panel-heading {
  display:flex;
  align-items:center;
  gap:15px;
}
.step-circle {
  width:39px;
  height:39px;
  background:var(--accentbg);
  border-radius:12px;
  color:var(--accent);
  font-weight:800;
  font-size:var(--type-medium);
  display:grid;
  place-items:center;
  flex-shrink:0;
}
.panel-header h2,.assessment-heading h2 {
  font-size:var(--type-heading);
  margin:0;
  letter-spacing:-.5px;
}
.panel-header p,.assessment-heading p {
  font-size:var(--type-base);
  color:var(--muted);
  margin:3px 0 0;
}
.text-button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:9px;
  background:none;
  border:0;
  color:var(--accent);
  font-size:var(--type-base);
  font-weight:750;
  padding:9px 10px;
  border-radius:9px;
}
.text-button:hover {
  background:var(--accentbg);
}
.chevron {
  transition:transform .18s ease;
}
.is-collapsed .chevron {
  transform:rotate(180deg);
}
.is-collapsed .panel-header {
  border-bottom:0;
}
.panel-body {
  padding:29px 31px 30px;
}
.form-section {
  margin-bottom:26px;
}
.field-header {
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-bottom:9px;
}
label,.levels-heading label {
  font-weight:700;
  font-size:var(--type-base);
}
.required {
  color:#c65353;
}
.optional {
  font-size:var(--type-xs);
  color:var(--muted);
  font-weight:500;
  margin-left:5px;
}
.helper {
  margin:0 0 9px;
  font-size:var(--type-sm);
  color:#758297;
}
.helper code {
  font-family:ui-monospace,Menlo,Consolas,monospace;
  background:#f0f3f8;
  border-radius:4px;
  padding:2px 4px;
  font-size:var(--type-xs);
  color:#476389;
}
.field-note {
  margin:8px 0 0;
  font-size:var(--type-xs);
  color:var(--muted);
}
input[type=text],textarea,select {
  width:100%;
  background:#fbfcfe;
  border:1px solid #dbe2ec;
  border-radius:9px;
  padding:11px 13px;
  transition:border-color .12s,box-shadow .12s;
}
input[type=text]:focus,textarea:focus,select:focus {
  border-color:#7199d8;
  outline:0;
  box-shadow:0 0 0 3px #dce9fb;
}
input[type=text] {
  height:44px;
  font-size:var(--type-base);
}
textarea {
  resize:vertical;
  min-height:147px;
  font-size:var(--type-sm);
  line-height:1.65;
}
.form-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:26px;
}
.levels-heading {
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:14px;
  margin-top:2px;
  margin-bottom:13px;
}
.levels-heading .helper {
  margin:4px 0 0;
}
.level-count-control select {
  width:146px;
  height:40px;
  background:#fff;
  font-size:var(--type-sm);
  cursor:pointer;
}
.levels-wrapper {
  max-width:100%;
  border:1px solid var(--line);
  border-radius:12px;
  overflow-x:auto;
}
.levels-table {
  width:100%;
  min-width:630px;
  border-collapse:collapse;
  text-align:left;
}
.levels-table th {
  background:#f7f9fc;
  color:#8290a5;
  font-size:var(--type-xxs);
  letter-spacing:1px;
  padding:10px 13px;
  font-weight:800;
}
.levels-table th:first-child {
  width:29%;
}
.levels-table th:nth-child(2) {
  width:150px;
}
.levels-table td {
  padding:7px 12px;
  border-top:1px solid #f0f2f6;
}
.levels-table input {
  height:36px;
  padding:7px 10px;
  background:#fff;
  font-size:var(--type-sm);
}
.levels-table input[type=text].score-input {
  text-align:right;
  font-variant-numeric:tabular-nums;
}
.levels-table .level-description {
  width:100%;
  min-height:52px;
  padding:7px 10px;
  resize:vertical;
  background:#fff;
  font-size:var(--type-sm);
  line-height:1.45;
}
.field-error {
  font-size:var(--type-sm);
  color:var(--red);
  margin:8px 0 0;
  white-space:pre-line;
}
.field-error:not([hidden]) {
  background:var(--redbg);
  padding:9px 12px;
  border-radius:8px;
}
.notice {
  font-size:var(--type-sm);
  color:#72561c;
  background:#fff8e7;
  padding:12px 14px;
  border-radius:9px;
  margin-top:16px;
  line-height:1.65;
}
.notice.success {
  background:#eaf7f1;
  color:#2e6b54;
}
.form-actions {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  margin-top:25px;
  padding-top:22px;
  border-top:1px solid var(--line);
}
.secondary-actions {
  display:flex;
  align-items:center;
  gap:4px;
  flex-wrap:wrap;
}
.secondary-action {
  font-weight:650;
  color:#60718a;
  font-size:var(--type-sm);
}
.primary-button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:11px;
  background:var(--accent);
  color:#fff;
  border:1px solid var(--accent);
  border-radius:10px;
  font-size:var(--type-base);
  font-weight:750;
  padding:12px 19px;
  min-height:43px;
  transition:background .15s,transform .15s;
  white-space:nowrap;
}
.primary-button:hover {
  background:var(--accentdark);
  transform:translateY(-1px);
}
.primary-button span {
  font-size:18px;
  line-height:0;
}
.assessment {
  margin-top:39px;
}
.assessment-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  margin:0 0 23px;
}
.assessment-heading h2 {
  font-size:26px;
  line-height:1.25;
  margin-top:7px;
  overflow-wrap:anywhere;
}
.assessment-heading p {
  margin-top:7px;
}
.outline-button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  background:#fff;
  color:var(--accent);
  border:1px solid #cad8eb;
  border-radius:10px;
  font-size:var(--type-base);
  font-weight:750;
  padding:10px 14px;
  min-height:42px;
  white-space:nowrap;
}
.outline-button:hover {
  background:#f1f6fe;
}
.outline-button span {
  font-size:20px;
  line-height:0;
}
.student-bar {
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:30px;
  margin-bottom:20px;
}
.student-field {
  width:min(100%,440px);
}
.student-field label {
  display:block;
  margin-bottom:8px;
}
.progress-area {
  width:257px;
  flex-shrink:0;
  padding-bottom:6px;
}
.progress-caption {
  display:flex;
  justify-content:space-between;
  font-size:var(--type-xs);
  color:var(--muted);
  margin-bottom:9px;
}
.progress-caption strong {
  color:var(--inksoft);
  font-weight:800;
}
.progress-track {
  background:#e2e8f1;
  border-radius:9px;
  height:7px;
  overflow:hidden;
}
.progress-fill {
  height:100%;
  background:#4275c3;
  border-radius:9px;
  width:0;
  transition:width .2s;
}
.results-panel,.summary-panel {
  margin-bottom:18px;
  overflow:hidden;
}
.table-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:23px 25px 18px;
}
.table-heading h3 {
  font-size:var(--type-large);
  letter-spacing:-.2px;
  margin:0;
}
.count-chip {
  font-size:var(--type-xs);
  color:#56677e;
  background:#f0f3f7;
  padding:6px 9px;
  border-radius:7px;
  white-space:nowrap;
}
.items-table-container,.summary-table-container {
  width:100%;
  overflow-x:auto;
}
.items-table,.summary-table {
  width:100%;
  border-collapse:collapse;
  table-layout:fixed;
}
.items-table th,.summary-table th {
  background:#f9fafd;
  color:#8090a5;
  font-size:var(--type-xxs);
  letter-spacing:.7px;
  font-weight:800;
  text-align:left;
  padding:12px 17px;
}
.items-table td,.summary-table td {
  padding:16px 17px;
  vertical-align:middle;
  border-bottom:1px solid #f1f2f5;
  font-size:var(--type-sm);
}
.items-table tbody tr:last-child td,.summary-table tbody tr:last-child td {
  border-bottom:0;
}
.items-table tbody tr:nth-child(even),.summary-table tbody tr:nth-child(even) {
  background:#fcfdff;
}
.items-table th:nth-child(1) {
  width:30%;
}
.items-table th:nth-child(2) {
  width:15%;
}
.items-table th:nth-child(3) {
  width:46%;
}
.items-table th:nth-child(4) {
  width:9%;
}
.align-right {
  text-align:right!important;
}
.item-label {
  font-weight:650;
  color:#35445c;
  overflow-wrap:anywhere;
  line-height:1.5;
}
.criterion-pills {
  display:flex;
  flex-wrap:wrap;
  gap:5px;
}
.criterion-pill {
  display:inline-flex;
  align-items:center;
  border-radius:6px;
  padding:4px 8px;
  font-size:var(--type-xs);
  font-weight:800;
  white-space:nowrap;
  text-decoration:none;
  cursor:help;
}
.level-options {
  display:flex;
  align-items:center;
  gap:4px;
  flex-wrap:wrap;
}
.level-choice {
  padding:7px 10px;
  background:#fff;
  border:1px solid #dde4ef;
  color:#536782;
  border-radius:7px;
  font-size:var(--type-xs);
  font-weight:650;
  line-height:1.2;
  min-height:34px;
  white-space:normal;
  transition:background .1s,border-color .1s,color .1s;
  max-width:145px;
}
.level-choice:hover {
  background:#f0f5fd;
  border-color:#a4b9d7;
}
.level-choice[aria-pressed=true] {
  background:#315b9e;
  border-color:#315b9e;
  color:#fff;
  box-shadow:0 1px 4px #315b9e25;
}
.row-score {
  font-weight:800;
  text-align:right;
  font-variant-numeric:tabular-nums;
  color:#244d88;
  font-size:var(--type-medium);
}
.pending-score {
  font-size:var(--type-xs);
  font-weight:550;
  color:#9da8b6;
}
.summary-table th:nth-child(1) {
  width:17%;
}
.summary-table th:nth-child(2) {
  width:57%;
}
.summary-table th:nth-child(3) {
  width:10%;
}
.summary-table th:nth-child(4) {
  width:16%;
}
.summary-table td {
  padding:13px 17px;
}
.summary-description {
  color:var(--inksoft);
  overflow-wrap:anywhere;
}
.weight-cell {
  font-variant-numeric:tabular-nums;
  color:var(--inksoft);
}
.summary-status {
  font-size:var(--type-xs);
  color:#74634d;
  background:#fdf4e5;
  padding:6px 9px;
  border-radius:7px;
}
.summary-status.complete {
  color:#2b7150;
  background:#e5f5eb;
}
.summary-status.empty {
  color:#7b8797;
  background:#f0f2f6;
}
.tiny-status {
  display:block;
  font-size:var(--type-xxs);
  font-weight:550;
  margin-top:2px;
  color:#a87935;
}
.final-panel {
  background:#eaf1fb;
  border:1px solid #d6e5f9;
  border-radius:15px;
  padding:25px 29px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
}
.final-overline {
  font-size:var(--type-xs);
  color:#5675a5;
  font-weight:850;
  letter-spacing:1px;
}
.final-description {
  font-size:var(--type-sm);
  margin-top:9px;
  color:#69809e;
}
.final-right {
  text-align:right;
  min-width:130px;
}
.final-score {
  font-size:40px;
  font-weight:800;
  color:#254d89;
  letter-spacing:-1.4px;
  font-variant-numeric:tabular-nums;
  line-height:1.1;
}
.final-state {
  font-size:var(--type-xs);
  color:#66809d;
}
.export-buttons {
  display:flex;
  align-items:center;
  gap:9px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.export-row {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:18px;
  margin:23px 0 70px;
}
.export-row p {
  font-size:var(--type-sm);
  color:var(--muted);
  max-width:540px;
}
.site-footer {
  border-top:1px solid var(--line);
  display:flex;
  justify-content:space-between;
  gap:15px;
  align-items:center;
  padding:26px 0 34px;
  color:#93a0b0;
  font-size:var(--type-xs);
}
@media(max-width:930px) {
  .form-grid {
    grid-template-columns:1fr;
    gap:0;
  }
  .items-table {
    min-width:780px;
  }
  .items-table th:nth-child(1) {
    width:27%;
  }
  .items-table th:nth-child(2) {
    width:14%;
  }
  .items-table th:nth-child(3) {
    width:49%;
  }
  .items-table th:nth-child(4) {
    width:10%;
  }
  .level-choice {
    padding:7px 8px;
  }
  .site-footer {
    flex-direction:column;
    align-items:flex-start;
  }
}
@media(max-width:630px) {
  .app-shell {
    padding:0 15px;
  }
  .site-header {
    min-height:80px;
  }
  .brand-symbol {
    width:41px;
    height:41px;
    border-radius:12px;
  }
  .brand-name {
    font-size:18px;
  }
  .brand-subtitle {
    font-size:var(--type-xxs);
  }
  .header-trust {
    display:none;
  }
  .intro {
    padding:36px 0 29px;
  }
  .intro h1 {
    letter-spacing:-1.1px;
    font-size:34px;
  }
  .intro>p {
    font-size:var(--type-base);
  }
  .panel-header {
    padding:17px;
  }
  .panel-header h2 {
    font-size:var(--type-large);
  }
  .panel-header p {
    font-size:var(--type-xs);
  }
  .panel-heading {
    gap:10px;
  }
  .step-circle {
    width:33px;
    height:33px;
    border-radius:9px;
  }
  .panel-body {
    padding:19px 16px 20px;
  }
  .form-actions {
    flex-direction:column-reverse;
    align-items:stretch;
  }
  .form-actions .primary-button {
    width:100%;
  }
  .secondary-actions {
    justify-content:center;
  }
  .levels-heading {
    align-items:flex-start;
  }
  .level-count-control select {
    width:115px;
  }
  .levels-table th:nth-child(2) {
    width:120px;
  }
  .assessment {
    margin-top:31px;
  }
  .assessment-heading {
    align-items:flex-start;
    flex-direction:column;
  }
  .assessment-heading h2 {
    font-size:24px;
  }
  .student-bar {
    flex-direction:column;
    gap:15px;
    align-items:stretch;
  }
  .progress-area {
    width:100%;
  }
  .table-heading {
    padding:18px;
  }
  .items-table,.summary-table {
    min-width:0;
    table-layout:auto;
  }
  .items-table thead,.summary-table thead {
    display:none;
  }
  .items-table tbody tr,.summary-table tbody tr {
    display:block;
    padding:14px 16px;
    border-bottom:1px solid var(--line);
  }
  .items-table tbody tr:last-child,.summary-table tbody tr:last-child {
    border:0;
  }
  .items-table td,.summary-table td {
    display:block;
    width:100%;
    padding:4px 0;
    border:0!important;
    text-align:left!important;
  }
  .items-table td[data-label]:not(:first-child)::before,.summary-table td[data-label]:not(:first-child)::before {
    content:attr(data-label);
    display:block;
    font-size:var(--type-micro);
    color:#8693a6;
    letter-spacing:1px;
    font-weight:800;
    margin-top:10px;
    margin-bottom:6px;
  }
  .item-label {
    font-size:var(--type-base);
  }
  .row-score {
    font-size:18px;
  }
  .level-options {
    gap:5px;
  }
  .level-choice {
    font-size:var(--type-xs);
    min-height:36px;
  }
  .summary-table tbody tr {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:4px;
  }
  .summary-table td:nth-child(2) {
    grid-column:1 / -1;
    grid-row:2;
  }
  .summary-table td:nth-child(3),.summary-table td:nth-child(4) {
    grid-row:3;
  }
  .final-panel {
    padding:18px;
    gap:10px;
  }
  .final-overline {
    font-size:var(--type-xxs);
  }
  .final-score {
    font-size:33px;
  }
  .final-right {
    min-width:80px;
  }
  .export-row {
    flex-direction:column;
    align-items:stretch;
    margin-bottom:43px;
  }
  .export-row p {
    order:2;
    margin:0;
  }
  .export-buttons {
    width:100%;
    display:grid;
    grid-template-columns:1fr;
  }
  .export-row button {
    width:100%;
  }
}
@media(prefers-reduced-motion:reduce) {
  html {
    scroll-behavior:auto;
  }
  *,*::before,*::after {
    transition-duration:.01ms!important;
    animation-duration:.01ms!important;
  }
}

/* Rubrica v1.1: marca, pantalla inicial y nota flotante */
.brand-title { display:flex; align-items:baseline; gap:9px; }
.version-tag { font-size:var(--type-xxs); color:#70829b; font-weight:700; border:1px solid #e1e8f2; background:#fff; border-radius:6px; padding:2px 6px; }

body.splash-active { overflow:hidden; }
.splash-screen {
  position:fixed;
  inset:0;
  z-index:1000;
  display:grid;
  place-items:center;
  padding:20px;
  background:rgba(14,23,43,.62);
  opacity:1;
  transition:opacity .32s ease;
}
.splash-screen.is-leaving { opacity:0; pointer-events:none; }
.splash-card {
  display:flex;
  flex-direction:column;
  align-items:center;
  width:min(430px,100%);
  padding:51px 32px 45px;
  text-align:center;
  border:7px solid #102c63;
  border-radius:28px;
  background:#fff;
  box-shadow:0 16px 65px rgba(4,14,31,.22);
}
.splash-symbol {
  width:114px;
  height:114px;
  display:grid;
  place-items:center;
  border-radius:25px;
  background:#081c42;
  color:white;
  margin-bottom:19px;
}
.splash-name { font-size:44px; line-height:1.1; font-weight:800; letter-spacing:-1.9px; color:#121b2b; }
.splash-author { font-size:16px; color:#53657f; margin-top:21px; font-weight:500; }
.splash-progress { width:min(225px,100%); height:6px; margin-top:28px; border-radius:30px; background:#e8ecf1; overflow:hidden; }
.splash-progress-fill { width:100%; height:100%; background:#ff7c15; transform:scaleX(0); transform-origin:left; animation:splash-progress 2.7s linear forwards; border-radius:inherit; }
@keyframes splash-progress { to { transform:scaleX(1); } }

.floating-grade {
  position:fixed;
  z-index:70;
  right:calc(20px + env(safe-area-inset-right, 0px));
  bottom:calc(20px + env(safe-area-inset-bottom, 0px));
  width:181px;
  padding:14px 16px 12px;
  border:1px solid #d9e3f0;
  border-radius:14px;
  background:rgba(255,255,255,.97);
  box-shadow:0 5px 25px rgba(22,43,74,.13);
  text-align:left;
  pointer-events:none;
  user-select:none;
  font-variant-numeric:tabular-nums;
}
.floating-grade-label { color:#657892; font-size:var(--type-xs); font-weight:750; letter-spacing:.15px; }
.floating-grade-number { white-space:nowrap; color:#244c87; font-size:30px; font-weight:800; letter-spacing:-.7px; line-height:1.3; padding-top:1px; }
.floating-grade-scale { font-size:var(--type-medium); color:#6e7e93; font-weight:600; letter-spacing:0; }
.floating-grade-status { color:#a07737; font-size:var(--type-xs); font-weight:650; min-height:16px; }
.floating-grade-status[hidden] { display:none!important; }
/* Espacio adicional para que las acciones de cierre sean accesibles tras desplazarse. */
body.has-active-assessment .app-shell { padding-bottom:120px; }
@media(max-width:630px) {
  .splash-card { width:min(348px,100%); padding:35px 20px; border-width:6px; border-radius:23px; }
  .splash-symbol { width:88px; height:88px; border-radius:22px; margin-bottom:18px; }
  .splash-symbol svg { width:50px; height:50px; }
  .splash-name { font-size:36px; }
  .splash-author { font-size:var(--type-medium); margin-top:17px; }
  .floating-grade { right:calc(10px + env(safe-area-inset-right, 0px)); bottom:calc(10px + env(safe-area-inset-bottom, 0px)); width:147px; padding:10px 12px; border-radius:12px; }
  .floating-grade-label { font-size:var(--type-xxs); }
  .floating-grade-number { font-size:25px; }
  .floating-grade-scale { font-size:var(--type-sm); }
  .floating-grade-status { font-size:var(--type-xxs); }
  body.has-active-assessment .app-shell { padding-bottom:115px; }
}
@media(prefers-reduced-motion:reduce) { .splash-progress-fill { animation:none; transform:scaleX(1); } }
@media print { .splash-screen,.floating-grade { display:none!important; } }

/* La tarjeta cambia de esquina si una acción evaluable quedaría tapada. */
.floating-grade[data-position="bottom-left"] { right:auto; left:calc(20px + env(safe-area-inset-left, 0px)); top:auto; bottom:calc(20px + env(safe-area-inset-bottom, 0px)); }
.floating-grade[data-position="top-right"] { left:auto; top:calc(20px + env(safe-area-inset-top, 0px)); bottom:auto; right:calc(20px + env(safe-area-inset-right, 0px)); }
.floating-grade[data-position="top-left"] { right:auto; bottom:auto; top:calc(20px + env(safe-area-inset-top, 0px)); left:calc(20px + env(safe-area-inset-left, 0px)); }
@media(max-width:630px) {
  .floating-grade[data-position="bottom-left"] { left:calc(10px + env(safe-area-inset-left, 0px)); bottom:calc(10px + env(safe-area-inset-bottom, 0px)); }
  .floating-grade[data-position="top-right"] { top:calc(10px + env(safe-area-inset-top, 0px)); right:calc(10px + env(safe-area-inset-right, 0px)); }
  .floating-grade[data-position="top-left"] { top:calc(10px + env(safe-area-inset-top, 0px)); left:calc(10px + env(safe-area-inset-left, 0px)); }
}

/* En móvil, cuando la tarjeta ocupa la esquina superior, el título reserva su espacio. */
@media(max-width:630px) {
  body.grade-at-heading .assessment-heading { padding-right:152px; }
}

/* Acciones superiores: descarga de plantilla a la izquierda de activar la rúbrica. */
.primary-actions {
  display:flex; align-items:center; justify-content:flex-end; gap:10px; flex-wrap:wrap;
}
.primary-actions .outline-button { white-space:normal; text-align:center; }
@media(max-width:930px) {
  .primary-actions { width:100%; justify-content:stretch; }
  .primary-actions > button { flex:1 1 230px; }
  .form-actions .primary-actions .primary-button { width:auto; }
}
@media(max-width:540px) {
  .primary-actions { flex-direction:column; align-items:stretch; }
  .primary-actions > button { flex:auto; width:100%!important; }
}

/* Insuficientes: solo calificaciones efectivamente obtenidas (0 <= nota < 5). */
.grade-fail {
  display:inline-block;
  padding:4px 9px;
  border-radius:9px;
  background:#bb3042;
  color:#fff!important;
  font-weight:800;
  line-height:1.2;
  white-space:nowrap;
  font-variant-numeric:tabular-nums;
}
.final-score.grade-fail { display:block; width:max-content; margin-left:auto; padding:7px 13px; border-radius:12px; }
.floating-grade-number #floatingScore.grade-fail { padding:3px 8px; border-radius:9px; }
@media(max-width:630px) {
  .final-score.grade-fail { padding:6px 10px; }
  .floating-grade-number #floatingScore.grade-fail { padding:3px 6px; }
}
