/* Demo "upplast": the dialog "Läs upp provet" (src/components/ExamAudioDialog.tsx, src/exam-audio.css); its 600px rules are container queries here. */

.upplast-title { font: 700 22px/1.45 var(--rp-sans); }
.upplast-h3 { font: 700 16.38px/1.45 var(--rp-sans); }
.upplast-eyebrow, .upplast-note { color: var(--rp-text-2); font-size: 14px; line-height: 1.5; }

/* The body: it scrolls for real (the kit's scroll) and ends at .upplast-end (data-dk-scroll-to), see "The end of the body" below */
.upplast-body { padding-top: 0; }
.upplast-body p { margin: 14px 0; }
.upplast-label { display: block; margin: 20px 0 8px; font-weight: 600; }
.upplast-write { margin-top: 20px; }
.upplast-keeps, .upplast-top { scroll-margin-top: 12px; }   /* under the 14px between blocks, so the one above stays out of the crop */
.upplast-write + .upplast-label { margin-top: 16px; }
.upplast-progress-line { display: flex; align-items: center; gap: 8px; }
.upplast-body .upplast-bg { margin-top: 0; }
.upplast-textarea { position: relative; padding-bottom: 5.7px; }
.upplast-textarea::after {   /* the resize corner of a textarea */
  content: ""; position: absolute; right: 3px; bottom: 8.7px; width: 10px; height: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none' stroke='%23767676' stroke-width='1' stroke-linecap='round'%3E%3Cpath d='M9 1 1 9M9 5 5 9'/%3E%3C/svg%3E") no-repeat;
}
.upplast-script {   /* the textarea "Text som läses upp": the script as the AI wrote it, scrolled with the kit's `scroll` */
  height: 240px; padding: 12px; border: 1px solid var(--rp-line-strong); border-radius: 8px; background: var(--rp-bg); color: var(--rp-text);
  line-height: 1.6; white-space: pre-wrap; overflow-wrap: break-word; overflow-x: hidden; overflow-y: auto; scrollbar-width: none;
}
.upplast-script::-webkit-scrollbar { display: none; }
.upplast-ph { color: #757575; }
.upplast-review { display: flex; align-items: flex-start; gap: 10px; margin-top: 20px; line-height: 1.5; }
.upplast-checkbox {   /* Chrome's checkbox with accent-color */
  position: relative; flex: none; box-sizing: border-box; width: 13px; height: 13px; margin: 5px 3px 3px 4px; border: 1px solid #767676; border-radius: 2.5px; background: #fff;
}
.upplast-review.is-checked .upplast-checkbox { border-color: #003145; background: #003145; }
.upplast-review.is-checked .upplast-checkbox::after {
  content: ""; position: absolute; left: 3px; top: 0.5px; width: 3px; height: 7px; border: solid #fff; border-width: 0 1.7px 1.7px 0; transform: rotate(40deg);
}
.upplast-review.is-locked .upplast-checkbox { border-color: #cbcdcd; }   /* disabled: before there is a script, and while a job runs */
.upplast-review.is-locked.is-checked .upplast-checkbox { background: #cbcdcd; }
.upplast-review.is-locked.is-checked .upplast-checkbox::after { border-color: #eaecec; }
.upplast-result { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--rp-line); }

.upplast-audio { display: flex; align-items: center; height: 54px; margin: 12px 0 16px; padding: 0 16px 0 18px; border-radius: 27px; background: #f1f3f4; color: #000; font-size: 14px; }
.upplast-audio svg { flex: none; fill: #000; }
.upplast-time { margin-left: 13px; white-space: nowrap; }
.upplast-track { flex: 1 1 auto; min-width: 16px; height: 4px; margin: 0 21px 0 15px; border-radius: 2px; background: #595959; }
.upplast-more { margin-left: 13px; }

/* The footer: Stäng on the left, Skapa ljud (or Avbryt) on the right; the app's 16 px above and below. */
.upplast-foot { justify-content: space-between; padding-block: 16px; }

/* The end of the body (step 5, step 4's scroll, the static page): the kit puts the body where .upplast-end stands, less its scroll-margin-top.
   On a stage wider than a phone the marker has no margin and lies below the last scroll position, so the body stands at its very end, as the app's does.
   On a phone the end is a block edge instead of a line cut in two: .upplast-tail (the checkbox row to the end) is as tall as the body, so the body can scroll to its top,
   and the marker at its foot has the body's height less 8px as scroll-margin-top, so the view starts 12px above the tail (under the note above it). Where the tail is taller
   than the body (a very short window) the same sum puts the view's foot 8px under the download button, so the button is never cut off.
   The body's height is the window's (--rp-vh) less 2 x 12px (the modal's gap), 2px (the dialog's border), 86.19px (head) and 65px (foot): 177px, measured at 320 to 600px. */
.upplast-end { display: block; height: 0; }
@container rp (max-width: 600px) {
  .upplast-script { height: 200px; }   /* the app's 600px rule for the textarea */
  .upplast-tail { min-height: calc(var(--rp-vh) - 177px - 20px); }   /* 20px: the body's padding below */
  .upplast-end { scroll-margin-top: calc(var(--rp-vh) - 177px - 8px); }
}

/* A stage of 761 to 1000px: the sidebar folds into the 64px rail so the work behind the dialog keeps its room */
[data-demo="upplast"] .upplast-rail { display: none; }
@container rp (min-width: 761px) and (max-width: 1000px) {
  [data-demo="upplast"] .rp-sidebar:not(.upplast-rail) { display: none; }
  [data-demo="upplast"] .upplast-rail { display: flex; }
}
