/* Demo kit: figure, captions, Pausa / Spela control, cursor, caret, status helper (demo-kit.js plays the demos). */
.dk-demo {
  --dk-ink: var(--ink, #0a2230);
  --dk-ink-2: var(--ink-2, #3e5463);
  --dk-line: var(--line-strong, rgba(10, 34, 48, 0.22));
  --dk-accent: var(--accent, #00597d);
  --dk-ok: #17702f;
  --dk-sans: var(--sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif);
  --dk-serif: var(--serif, Georgia, serif);
  /* Room the window leaves in the viewport (--dk-row, the caption row, is set by demo-kit.js) */
  --dk-header: var(--header-h, 64px);
  --dk-air: 8px;
  --dk-min-h: 520px;
  --dk-min-h-phone: 480px;
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 14px 16px;
  margin: 0;
}
/* Short viewport: lower floors and 8px more air under the control keep it above the fold; under 420px the header is static (styles.css) */
@media (max-height: 640px) { .dk-demo { --dk-air: 16px; --dk-min-h: 260px; --dk-min-h-phone: 260px; } .dk-stage { --rp-hem-top: 16px; } }
@media (max-height: 420px) { .dk-demo { --dk-header: 0px; --dk-min-h: 120px; --dk-min-h-phone: 120px; } }
.dk-demo > .dk-stage { grid-column: 1 / -1; grid-row: 1; }
.dk-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.dk-stage { position: relative; isolation: isolate; min-width: 0; }
/* Far windows are not laid out or painted (script on only); a window within its demo's playback margin (dk-near) is never skipped */
@media (scripting: enabled) {
  .dk-stage .rp-window { content-visibility: auto; contain-intrinsic-block-size: auto var(--rp-vh); }
  .dk-demo.dk-near .rp-window { content-visibility: visible; }
}
.dk-stage [hidden], .dk-control[hidden] { display: none !important; }   /* a replica's display: flex must not beat the hidden attribute */

/* Captions */
.dk-steps {
  grid-column: 1 / -1;
  display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: dk-step;
  color: var(--dk-ink-2); font: 500 15px/1.45 var(--dk-sans);
}
.dk-steps > li { position: relative; box-sizing: border-box; min-height: 28px; padding: 3px 0 0 38px; counter-increment: dk-step; }
.dk-steps > li::before {
  content: counter(dk-step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--dk-accent); color: var(--dk-accent); font: 500 16px/1 var(--dk-serif);
}
/* Live: all captions share one grid cell (fixed height); the others are transparent, not removed */
.dk-demo.dk-live > .dk-steps { grid-column: 1; grid-row: 2; align-self: center; }
.dk-demo.dk-live > .dk-steps > li { grid-area: 1 / 1; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.dk-demo.dk-live > .dk-steps > li[aria-current="step"] { opacity: 1; color: var(--dk-ink); }
.dk-demo.dk-live > .dk-steps > li[aria-current="step"]::before { background: var(--dk-accent); color: #fff; }

/* Control (Pausa / Spela / Spela igen) */
.dk-demo.dk-live > .dk-control { grid-column: 2; grid-row: 2; align-self: center; }
.dk-control {
  display: inline-block; box-sizing: border-box; min-height: 36px; margin: 0; padding: 0 15px 0 12px; text-align: center;
  border: 1px solid var(--dk-line); border-radius: 999px; background: #fff; color: var(--dk-ink);
  font: 500 14px/1 var(--dk-sans); white-space: nowrap; cursor: pointer;
}
/* As wide as the widest label; keep the string equal to the longest LABELS entry in demo-kit.js */
.dk-control::after { content: 'Spela igen'; display: block; box-sizing: content-box; height: 0; padding-left: 22px; overflow: hidden; visibility: hidden; }
.dk-control:hover { border-color: var(--dk-accent); color: var(--dk-accent); }
.dk-control:focus-visible { outline: 2px solid var(--dk-accent); outline-offset: 2px; }
.dk-demo[tabindex="-1"]:focus-visible { outline: 2px solid var(--dk-accent); outline-offset: 6px; }
.dk-control::before { content: ''; display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px; background: currentColor; -webkit-mask: var(--dk-icon) center / contain no-repeat; mask: var(--dk-icon) center / contain no-repeat; }
.dk-control[data-action="pause"] { --dk-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Crect x='2.5' y='2' width='3' height='10' rx='1'/%3E%3Crect x='8.5' y='2' width='3' height='10' rx='1'/%3E%3C/svg%3E"); }
.dk-control[data-action="play"] { --dk-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3.5 1.8l8 5.2-8 5.2z'/%3E%3C/svg%3E"); }
.dk-control[data-action="replay"] { --dk-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.6 7a4.4 4.4 0 1 0 1.4-3.2'/%3E%3Cpath d='M3.6 1.2v3h3'/%3E%3C/svg%3E"); }
@media (pointer: coarse) { .dk-control { min-height: 44px; } }
@media (max-width: 420px) { .dk-control { padding: 0 12px 0 10px; } }

/* Pausing */
/* Not playing: CSS animations stand still (!important beats the animation shorthand) */
.dk-demo:is([data-dk-state="ready"], [data-dk-state="paused"], [data-dk-state="done"]) .dk-stage *,
.dk-demo:is([data-dk-state="ready"], [data-dk-state="paused"], [data-dk-state="done"]) .dk-stage *::before,
.dk-demo:is([data-dk-state="ready"], [data-dk-state="paused"], [data-dk-state="done"]) .dk-stage *::after { animation-play-state: paused !important; }

/* Fake cursor */
.dk-cursor {
  position: absolute; left: 0; top: 0; z-index: 9999; width: 0; height: 0; opacity: 0; pointer-events: none;
  will-change: transform; transition: opacity 0.2s linear;
}
.dk-cursor--on { opacity: 1; }
.dk-cursor-arrow { position: absolute; left: -2px; top: -2px; transform-origin: 2px 2px; transition: transform 0.12s ease-out; filter: drop-shadow(0 1px 1.5px rgba(4, 40, 60, 0.4)); }
.dk-cursor-arrow path { fill: #fff; stroke: #0a2230; }
.dk-cursor--press .dk-cursor-arrow { transform: scale(0.82); }
.dk-cursor-ring { position: absolute; left: -18px; top: -18px; width: 36px; height: 36px; border-radius: 50%; background: rgba(0, 89, 125, 0.3); opacity: 0; }
.dk-stage :where(.dk-pressed) { filter: brightness(0.93); }

/* Typing caret */
.dk-caret { display: inline-block; width: 1.5px; height: 1.1em; margin-left: 1px; vertical-align: text-bottom; background: currentColor; }

@keyframes dk-spin { to { transform: rotate(360deg); } }
@keyframes dk-dots {
  0% { clip-path: inset(0 100% 0 0); }
  25% { clip-path: inset(0 66% 0 0); }
  50% { clip-path: inset(0 33% 0 0); }
  75% { clip-path: inset(0 0 0 0); }
}
.dk-stage [data-dk-status]::before { content: ''; display: inline-block; box-sizing: border-box; width: 0.95em; height: 0.95em; margin-right: 0.45em; vertical-align: -0.14em; }
.dk-stage [data-dk-status="thinking"]::before {
  width: 1.5em; height: 0.5em; vertical-align: 0.02em;
  background: radial-gradient(circle closest-side, currentColor 88%, transparent 100%) 0 50% / 0.5em 0.5em repeat-x;
  animation: dk-dots 1.2s steps(1, end) infinite;
}
.dk-stage [data-dk-status="working"]::before { border: 0.16em solid currentColor; border-right-color: transparent; border-radius: 50%; animation: dk-spin 0.8s linear infinite; }
.dk-stage [data-dk-status="done"]::before {
  background: var(--dk-ok);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5l3.2 3.2L13 4.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5l3.2 3.2L13 4.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

@media (prefers-reduced-motion: reduce) {
  .dk-stage [data-dk-status]::before { animation: none; }
  .dk-demo.dk-live > .dk-steps > li { transition: none; }
}
@media (forced-colors: active) {
  .dk-control { border-color: ButtonText; }
  .dk-control::before, .dk-caret, .dk-stage [data-dk-status="done"]::before { forced-color-adjust: none; background: ButtonText; }
  .dk-caret { background: CanvasText; }
  .dk-cursor-arrow path { fill: Canvas; stroke: CanvasText; }
  .dk-steps > li::before { box-shadow: none; border: 1.5px solid CanvasText; }
  .dk-demo.dk-live > .dk-steps > li[aria-current="step"]::before { background: Highlight; color: HighlightText; forced-color-adjust: none; }
}
@media print { .dk-control, .dk-cursor { display: none; } }

/* Shared replicas of the app (rp-, --rp-): its look from src/*.css (named in each part); light scheme. Container queries on .dk-stage stand in for its media queries. */

/* Tokens: the app's custom properties (src/styles.css, sky.css), light scheme, as --rp-<name> */
/* --rp-surface*: the values inside the app (sky.css ".app { --surface: var(--on-glass) }") */
.dk-stage {
  container: rp / inline-size;
  --rp-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --rp-mono: "SF Mono", ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
  --rp-bg: #e6f1f6; --rp-desk: #dce9ef;
  --rp-surface: rgba(255, 255, 255, 0.55); --rp-surface-2: rgba(6, 52, 78, 0.045); --rp-surface-raised: rgba(255, 255, 255, 0.9);
  --rp-text: #0a2230; --rp-text-2: #1f3b4a; --rp-text-3: #3f5a67;
  --rp-line: rgba(6, 52, 78, 0.1); --rp-line-strong: rgba(6, 52, 78, 0.18);
  --rp-fill: rgba(6, 52, 78, 0.07); --rp-fill-hover: rgba(6, 52, 78, 0.12); --rp-selection: rgba(0, 89, 125, 0.22);
  --rp-accent: #00597d; --rp-accent-hover: #004968; --rp-accent-soft: rgba(0, 89, 125, 0.1); --rp-accent-line: rgba(0, 89, 125, 0.4); --rp-on-accent: #ffffff;
  --rp-danger: #c62828; --rp-danger-soft: rgba(198, 40, 40, 0.09); --rp-warn: #86560a; --rp-warn-soft: rgba(255, 159, 10, 0.16); --rp-ok: #17702f; --rp-pdf: #cf3a31; --rp-pdf-soft: rgba(207, 58, 49, 0.12);
  --rp-shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.06), 0 6px 18px rgba(0, 0, 0, 0.06);
  --rp-shadow-pop: 0 2px 6px rgba(0, 0, 0, 0.08), 0 18px 44px rgba(0, 0, 0, 0.16);
  --rp-shadow-paper: 0 0 0 0.5px rgba(4, 40, 60, 0.16), 0 2px 6px rgba(4, 40, 60, 0.1), 0 24px 50px -18px rgba(4, 40, 60, 0.45);
  --rp-float-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 8px 28px rgba(0, 0, 0, 0.1);
  --rp-float-line: var(--rp-line);
  --rp-ease: cubic-bezier(0.16, 1, 0.3, 1); --rp-dur-fast: 120ms; --rp-dur: 200ms;
  --rp-pill-radius: 999px; --rp-card-radius: 14px; --rp-sheet-radius: 22px;
  --rp-toolbar: 56px; --rp-sidebar-w: 264px; --rp-sidebar-w-collapsed: 64px;
  --rp-focus-ring: 0 0 0 3px var(--rp-accent-soft), 0 0 0 1px var(--rp-accent-line);
  --rp-glass: rgba(255, 255, 255, 0.6); --rp-glass-bar: rgba(255, 255, 255, 0.66); --rp-glass-thick: rgba(255, 255, 255, 0.84);
  --rp-glass-sheet: rgba(246, 251, 253, 0.84); --rp-glass-pop: rgba(248, 252, 254, 0.93); --rp-glass-solid: #f7fbfd;
  --rp-glass-edge: rgba(255, 255, 255, 0.75);
  --rp-glass-blur: blur(40px) saturate(1.8); --rp-glass-blur-calm: blur(50px) saturate(1.25);
  --rp-glass-tint: saturate(1.25); --rp-glass-tint-thin: saturate(1.8);
  --rp-glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 0 0 0.5px rgba(6, 52, 78, 0.16), 0 2px 6px rgba(4, 40, 60, 0.08), 0 30px 70px -28px rgba(4, 40, 60, 0.42);
  --rp-glass-shadow-pop: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 0 0 0.5px rgba(6, 52, 78, 0.18), 0 4px 14px rgba(4, 30, 45, 0.14), 0 40px 90px -30px rgba(4, 30, 45, 0.6);
  --rp-glass-rim: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.2) 28%, rgba(255, 255, 255, 0.06) 62%, rgba(255, 255, 255, 0.6));
  --rp-on-glass: rgba(255, 255, 255, 0.55); --rp-on-glass-2: rgba(6, 52, 78, 0.045); --rp-on-glass-raised: rgba(255, 255, 255, 0.9);
}

@keyframes rp-spin { to { transform: rotate(360deg); } }
@keyframes rp-pulse { 0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } }
@keyframes rp-shimmer { 50% { opacity: 0.45; } }

/* The window: the app on its sky */
.rp-window, .rp-window *, .rp-window *::before, .rp-window *::after { box-sizing: border-box; }
/* Registered so the cqw in the default height resolves on the window and inherits as a length */
@property --rp-vh { syntax: "<length>"; inherits: true; initial-value: 680px; }
.rp-window {
  position: relative; isolation: isolate; overflow: hidden; width: 100%;
  /* The app's 100dvh: --rp-h capped by the viewport (Fit the screen), at least --dk-min-h */
  --rp-vh: min(var(--rp-h, clamp(600px, 62.5cqw, 718px)), max(var(--dk-min-h, 520px), calc(min(100svh - var(--dk-header, 64px) - var(--dk-air, 8px), 90svh) - 14px - var(--dk-row, 36px))));
  height: var(--rp-vh);
  border-radius: 22px; box-shadow: var(--shadow-sheet, 0 0 0 0.5px rgba(4, 40, 60, 0.14), 0 2px 6px rgba(4, 40, 60, 0.08), 0 28px 60px -24px rgba(4, 40, 60, 0.38));
  font: 14px/1.45 var(--rp-sans); letter-spacing: normal; text-align: left; text-transform: none; overflow-wrap: normal; text-indent: 0;
  color: var(--rp-text); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; cursor: default; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  /* The app's sky is a WebGL shader; two stills of it */
  background-color: #2a9fcc;
  background-image: url('img/kit/sky-desktop.webp'),
    radial-gradient(75% 30% at 62% 104%, #27637a 35%, rgba(39, 99, 122, 0) 100%), radial-gradient(34% 22% at 62% 72%, #0a9ad2 30%, rgba(10, 154, 210, 0) 100%),
    radial-gradient(90% 18% at 54% 19%, #eaffff 40%, rgba(234, 255, 255, 0) 100%), linear-gradient(180deg, #0a9bd1 0, #5dc5e5 30%, #52c1e3 55%, #129fd2 78%, #1d7c9e 100%);
  background-size: cover, auto, auto, auto, auto; background-position: center; background-repeat: no-repeat;
}
@container rp (max-width: 599.98px) {
  .rp-window {
    background-image: url('img/kit/sky-phone.webp'),
      radial-gradient(60% 28% at 55% 104%, #27637a 35%, rgba(39, 99, 122, 0) 100%), radial-gradient(50% 18% at 60% 62%, #0a9ad2 30%, rgba(10, 154, 210, 0) 100%),
      radial-gradient(110% 26% at 52% 19%, #efffff 30%, rgba(239, 255, 255, 0) 100%), linear-gradient(180deg, #1aa2d4 0, #62c5e5 28%, #4dbfe1 50%, #17a2d2 70%, #1d7c9e 100%);
  }
}
@container rp (max-width: 760px) { .rp-window { --rp-vh: min(var(--rp-h-phone, var(--rp-h, 680px)), max(var(--dk-min-h-phone, 480px), calc(min(100svh - var(--dk-header, 64px) - var(--dk-air, 8px), 90svh) - 14px - var(--dk-row, 68px)))); } }
.dk-stage .rp-window { overflow-anchor: none; }
.rp-sky {
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.rp-window :where(ol, ul, p, h1, h2, h3) { margin: 0; padding: 0; }
.rp-window :where(ol, ul) { list-style: none; }
.rp-window :where(button) { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; text-align: inherit; letter-spacing: inherit; text-transform: none; cursor: default; opacity: 1; }
.rp-window :where(i, em, cite) { font-style: normal; }
.rp-window :where(svg) { flex: none; }
.rp-window :where(img) { max-width: none; }
.rp-i { display: block; flex: none; }
.rp-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rp-spin { animation: rp-spin 0.9s linear infinite; }

.rp-status::before, .rp-sync::before, .rp-working::before, .rp-spinner::before {
  content: ''; flex: none; display: block; width: var(--rp-icon, 14px); height: var(--rp-icon, 14px); background: currentColor;
  -webkit-mask: var(--rp-mask) center / contain no-repeat; mask: var(--rp-mask) center / contain no-repeat;
}
.rp-window {
  --rp-m-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  --rp-m-loader: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 1 1-6.219-8.56'/%3E%3C/svg%3E");
  --rp-m-cloud-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m17 15-5.5 5.5L9 18'/%3E%3Cpath d='M5.516 16.07A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 3.501 7.327'/%3E%3C/svg%3E");
  --rp-m-pencil-line: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 21h8'/%3E%3Cpath d='m15 5 4 4'/%3E%3Cpath d='M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z'/%3E%3C/svg%3E");
  --rp-m-circle-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' x2='12' y1='8' y2='12'/%3E%3Cline x1='12' x2='12.01' y1='16' y2='16'/%3E%3C/svg%3E");
  --rp-m-check-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 7 17l-5-5'/%3E%3Cpath d='m22 10-7.5 7.5L13 16'/%3E%3C/svg%3E");
  --rp-m-circle-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m16 9-5.5 5.5L8 12'/%3E%3C/svg%3E");
  --rp-m-triangle-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
  --rp-m-circle-x: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m15 9-6 6'/%3E%3Cpath d='m9 9 6 6'/%3E%3C/svg%3E");
  --rp-m-circle-dashed: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.1 2.182a10 10 0 0 1 3.8 0'/%3E%3Cpath d='M13.9 21.818a10 10 0 0 1-3.8 0'/%3E%3Cpath d='M17.609 3.721a10 10 0 0 1 2.69 2.7'/%3E%3Cpath d='M2.182 13.9a10 10 0 0 1 0-3.8'/%3E%3Cpath d='M20.279 17.609a10 10 0 0 1-2.7 2.69'/%3E%3Cpath d='M21.818 10.1a10 10 0 0 1 0 3.8'/%3E%3Cpath d='M3.721 6.391a10 10 0 0 1 2.7-2.69'/%3E%3Cpath d='M6.391 20.279a10 10 0 0 1-2.69-2.7'/%3E%3C/svg%3E");
}

/* App frame: the grid the real app uses (sidebar | toolbar over the work), 12 px between the glass panes */
.rp-app { position: absolute; inset: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
.rp-main { position: relative; grid-column: 2; grid-row: 2; min-width: 0; min-height: 0; margin: 12px; }
.rp-workspace { display: grid; grid-template-columns: minmax(0, calc((100% - 12px) * var(--rp-split, 50) / 100)) minmax(0, 1fr); gap: 12px; height: 100%; }
.rp-pane { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; box-shadow: var(--rp-glass-shadow); }
.rp-editor { background: var(--rp-glass-thick); -webkit-backdrop-filter: var(--rp-glass-tint); backdrop-filter: var(--rp-glass-tint); }
.rp-preview { background: var(--rp-glass); -webkit-backdrop-filter: var(--rp-glass-tint-thin); backdrop-filter: var(--rp-glass-tint-thin); }
.rp-sidebar::after, .rp-toolbar::after {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: var(--rp-glass-bar); -webkit-backdrop-filter: var(--rp-glass-blur-calm); backdrop-filter: var(--rp-glass-blur-calm);
}
.rp-sidebar::before, .rp-toolbar::before {
  content: ''; position: absolute; inset: 0; padding: 1px; border-radius: inherit; pointer-events: none; background: var(--rp-glass-rim);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.rp-workspace.is-single { grid-template-columns: minmax(0, 1fr); }

/* Sidebar (app-shell.css, "Dokument" panel) */
.rp-sidebar {
  position: relative; z-index: 8; grid-column: 1; grid-row: 1 / -1; min-width: 0; min-height: 0; width: var(--rp-sidebar-w); margin: 12px 0 12px 12px; padding: 10px 10px 12px;
  display: flex; flex-direction: column; gap: 6px; border-radius: 26px; box-shadow: var(--rp-glass-shadow);
}
.rp-sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; padding: 0 4px 0 5px; }
.rp-wordmark { display: inline-flex; align-items: center; font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.18em; white-space: nowrap; }
/* The app's cloud octopus in front of the caps (1.25em high, the 1069 x 1011 art's ratio); decoration, so the name stays the text alone */
.rp-wordmark::before {
  content: ''; flex: none; height: 1.25em; width: calc(1.25em * 1069 / 1011); margin-right: 0.4em;
  background: url('img/brand/octopus-60.webp') center / contain no-repeat;
}
.rp-icon-btn { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 8px; color: var(--rp-text-2); }
.rp-sidebar-toggle { color: var(--rp-text-3); }
.rp-nav { display: flex; flex-direction: column; gap: 2px; }
/* The icon column (src/app-shell.css): an 18 px icon sits 13 px into a navigation item, so its centre is 32 px from the sidebar's edge, in the middle of the 64 px rail.
   The headings of Kurser, Mina prov and Mappar keep to the same column, so the rail is the panel with its words hidden. */
.rp-nav-item { position: relative; display: flex; align-items: center; gap: 11px; width: 100%; height: 36px; padding: 0 13px; border-radius: 10px; color: var(--rp-text-2); font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.rp-nav-item[aria-current="page"] { color: var(--rp-text); background: var(--rp-surface-raised); box-shadow: 0 1px 3px rgba(4, 40, 60, 0.12), 0 0 0 0.5px var(--rp-line); }
.rp-nav-item[aria-current="page"] .rp-i { color: var(--rp-accent); }
.rp-sidebar-panel {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; margin: 6px -10px 0; padding: 4px 10px 2px; overflow: hidden;
}
.rp-sidebar-panel > * { flex-shrink: 0; }
.rp-section { display: flex; flex-direction: column; gap: 6px; }
.rp-section:has(> .rp-section-head > .rp-with-icon) { gap: 2px; }
.rp-section-toggle { display: inline-flex; align-items: center; align-self: flex-start; gap: 4px; height: 24px; margin-top: 6px; padding: 0 6px 0 4px; border-radius: 7px; font-size: 12px; font-weight: 600; color: var(--rp-text-3); }
.rp-section-toggle:not(.rp-with-icon)[aria-expanded="false"] .rp-i { transform: rotate(-90deg); }
/* A heading with an icon (Kurser, Mina prov, Mappar; .panel-section.with-icon in src/app-shell.css): a row like a navigation item, the rail's icon, the name, then the chevron.
   The icon is in the accent colour while what is on screen belongs to the section (.is-holds), as the rail's active item is. */
.rp-section-toggle.rp-with-icon { display: flex; align-self: center; flex: 1 1 auto; gap: 11px; height: 36px; margin-top: 0; padding: 0 6px 0 13px; border-radius: 10px; font-size: 13.5px; font-weight: 500; color: var(--rp-text-2); }
.rp-section-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-section-name .rp-i { display: inline-block; margin-left: 5px; vertical-align: -2px; color: var(--rp-text-3); }
.rp-with-icon[aria-expanded="false"] .rp-section-name .rp-i { transform: rotate(-90deg); }
.rp-with-icon.is-holds > .rp-i:first-child { color: var(--rp-accent); }
.rp-app.is-making .rp-with-icon.is-holds > .rp-i:first-child { color: inherit; }
.rp-exams { display: flex; flex-direction: column; gap: 1px; }
/* Sidebar exam rows mirror app-shell.css: name above time, with the count first for a group. */
.rp-exam { position: relative; display: flex; align-items: center; min-width: 0; min-height: 44px; padding: 5px 36px 5px calc(24px + var(--level, 0) * 18px); border-radius: 8px; color: var(--rp-text); }
.rp-exam.is-selected { background: var(--rp-accent-soft); }
.rp-exam.is-selected::before { content: ""; position: absolute; left: 8px; width: 3px; height: 21px; border-radius: 2px; background: var(--rp-accent); }
.rp-exam.is-selected strong { font-weight: 620; }
.rp-exam-text { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-width: 0; font-size: 13.5px; line-height: 1.32; }
.rp-exam-text strong { max-width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.rp-exam-text small { flex: none; color: var(--rp-text-2); font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-exam.is-hover:not(.is-selected) { background: color-mix(in srgb, var(--rp-fill) 55%, transparent); }
.rp-exam-count { display: inline-block; margin-right: 6px; padding: 0 5px; border-radius: 4px; background: var(--rp-fill); font-size: 10.5px; line-height: 16px; font-weight: 600; }
.rp-exam > .rp-row-more { position: absolute; right: 4px; top: 50%; width: 28px; height: 28px; margin: -14px 0 0; }
/* A new exam on its way (CloudExamList `pending`): one line and a shimmering "Skapar…". */
.rp-ai-shimmer { display: block; width: fit-content; color: var(--rp-text-3); font-weight: 500; }
@media (prefers-reduced-motion: no-preference) {
  .rp-ai-shimmer {
    background: linear-gradient(100deg, var(--rp-text-3) 35%, color-mix(in srgb, var(--rp-text-3) 55%, #fff) 50%, var(--rp-text-3) 65%) 100% 0 / 250% 100% no-repeat;
    -webkit-background-clip: text; background-clip: text; color: transparent; animation: rp-ai-shimmer 1.8s cubic-bezier(.45, 0, .55, 1) infinite;
  }
}
@keyframes rp-ai-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (forced-colors: active) { .rp-ai-shimmer { background: none; color: CanvasText; } .rp-exam.is-selected { outline: 1px solid Highlight; outline-offset: -1px; } }
/* "Visa fler" and "Visa färre" (sidebar-folders.css .sidebar-more): quiet text in the text column. */
.rp-show-more-row { display: flex; gap: 4px; margin-left: 34px; }
.rp-show-more { display: inline-flex; flex: none; align-items: center; box-sizing: border-box; white-space: nowrap; min-height: 28px; padding: 4px 8px; border-radius: 8px; color: var(--rp-text-3); font-size: 12.5px; font-weight: 500; }
/* The two sections after Kurser (sidebar-folders.css): Mina prov (.rp-recent, the first 6, newest first, whatever folder they are in) and Mappar (.rp-tree: the folders, with a Plus in the heading).
   In the tree a folder row has a chevron and a folder icon; --level steps a row in 22 px. An exam in a folder has its name under the folder's name. */
.rp-section-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.rp-section-head .rp-section-toggle { align-self: center; }
.rp-section-add { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; margin: 6px 2px 0 0; color: var(--rp-text-3); }
.rp-section-head > .rp-with-icon + .rp-section-add { width: 28px; height: 28px; margin: 0 4px 0 0; }
.rp-recent, .rp-tree, .rp-folders, .rp-folder, .rp-folder-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rp-folder-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border-radius: 10px; }
.rp-folder-row.is-hover { background: color-mix(in srgb, var(--rp-fill) 55%, transparent); }
.rp-folder-main { display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 32px; padding: 5px 4px 5px calc(15px + var(--level, 0) * 22px); color: var(--rp-text); font-size: 13px; font-weight: 500; line-height: 1.3; }
.rp-folder-main > .rp-i { color: var(--rp-text-3); }
.rp-folder-main > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-folder-main > .rp-folder-chev { margin-right: 7px; }
.rp-folder-row.is-open .rp-folder-chev { transform: rotate(90deg); }
.rp-folder-row.is-open .rp-folder-main > .rp-i:not(.rp-folder-chev) { color: var(--rp-accent); }
.rp-row-more { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; margin-right: 4px; border-radius: 8px; color: var(--rp-text-2); opacity: 0; }
.rp-folder-row.is-hover .rp-row-more, .rp-exam.is-hover .rp-row-more { opacity: 1; }
/* The foot of a panel without .rp-sidebar-footer: the AI card goes to the bottom, then the account. */
.rp-sidebar-panel > .rp-side-cards { margin-top: auto; }
.rp-account { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 12px; background: var(--rp-on-glass); }
.rp-account-open { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; min-height: 44px; padding: 4px 10px 4px 6px; border-radius: 9px; }
.rp-account-text { display: flex; flex-direction: column; min-width: 0; flex: 1; font-size: 13px; }
.rp-account-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-account-text small { color: var(--rp-text-3); }
/* account-menu.css: the whole row opens the account menu (Inställningar, Kort introduktion, Lämna feedback, Logga ut…); the chevron at its end says so. */
.rp-account-chevron { flex: none; color: var(--rp-text-3); }
.rp-avatar { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--rp-accent); color: var(--rp-on-accent); font-weight: 700; font-size: 13px; }
.rp-sidebar.is-rail { width: var(--rp-sidebar-w-collapsed); align-items: stretch; }
.rp-sidebar.is-rail .rp-sidebar-head { flex-direction: column; justify-content: center; gap: 6px; padding: 0; }
.rp-sidebar.is-rail .rp-nav-item { height: 40px; }
.rp-sidebar.is-rail .rp-nav-item > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rp-sidebar.is-rail .rp-rail-account { display: flex; align-items: center; width: 44px; height: 40px; margin: auto 0 0; padding: 0 8px; }
.rp-sidebar.is-rail .rp-avatar { width: 28px; height: 28px; font-size: 12px; }
/* Kurser, Mina prov and Mappar in the rail (app-shell.css .rail-places): the panel's sections as icons, under Nytt prov (and Delat i skolan) after a hairline, above the account */
.rp-rail-places { flex: none; display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.rp-rail-places::before { content: ''; flex: none; height: 1px; margin: 0 10px 6px; background: var(--rp-line); }
.rp-rail-places .rp-nav-item.is-holds .rp-i { color: var(--rp-accent); }
.rp-app.is-making .rp-rail-places .rp-nav-item.is-holds .rp-i { color: inherit; }
.rp-sidebar.is-drawer {
  position: absolute; z-index: 30; top: 0; bottom: 0; left: 0; width: min(320px, 88%); margin: 0; padding: 12px; border-radius: 0 var(--rp-sheet-radius) var(--rp-sheet-radius) 0;
  background: var(--rp-glass-pop); -webkit-backdrop-filter: var(--rp-glass-blur-calm); backdrop-filter: var(--rp-glass-blur-calm); box-shadow: var(--rp-glass-shadow-pop);
  transform: translateX(-102%); visibility: hidden; transition: transform 0.26s var(--rp-ease), visibility 0s 0.26s;
}
.rp-sidebar.is-drawer::before, .rp-sidebar.is-drawer::after { display: none; }
.rp-sidebar.is-drawer .rp-sidebar-head { padding: 0 4px 0 5px; }
.rp-scrim { position: absolute; inset: 0; z-index: 25; background: rgba(4, 30, 45, 0.28); opacity: 0; visibility: hidden; transition: opacity 0.2s, visibility 0s 0.2s; }
.rp-window[data-drawer="open"] .rp-sidebar.is-drawer { transform: none; visibility: visible; transition: transform 0.26s var(--rp-ease); }
.rp-window[data-drawer="open"] .rp-scrim { opacity: 1; visibility: visible; transition: opacity 0.2s; }
@container rp (min-width: 761px) { .rp-sidebar.is-drawer, .rp-scrim { display: none; } }
@container rp (max-width: 760px) { .rp-sidebar:not(.is-drawer) { display: none; } }

/* Toolbar (editor-toolbar.css, styles.css .toolbar, sync-status.css) */
.rp-toolbar {
  position: relative; z-index: 7; grid-column: 2; grid-row: 1; height: var(--rp-toolbar); margin: 12px 12px 0; padding: 0 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; border-radius: 20px; box-shadow: var(--rp-glass-shadow);
}
.rp-toolbar-left, .rp-toolbar-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rp-toolbar-left { flex: 1 1 auto; }
.rp-toolbar-right { flex: none; }
.rp-docs-btn { display: none; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 9px; color: var(--rp-text-2); }
.rp-doc { display: flex; flex-direction: column; min-width: 0; padding-left: 4px; line-height: 1.25; }
.rp-doc > strong { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.rp-doc-name { display: block; letter-spacing: normal; max-width: calc(100% + 8px); min-height: 24px; margin: -2px -4px; padding: 2px 4px; border-radius: 6px; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-sync { display: inline-flex; align-items: center; gap: 4px; min-width: 0; font-size: 12px; color: var(--rp-text-3); white-space: nowrap; --rp-icon: 13px; }
.rp-sync::before { --rp-mask: var(--rp-m-cloud-check); color: var(--rp-ok); }
.rp-sync[data-state="saving"]::before { --rp-mask: var(--rp-m-loader); color: currentColor; animation: rp-spin 0.9s linear infinite; }
.rp-status { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 6px; font-size: 12px; font-weight: 500; white-space: nowrap; color: var(--rp-text-2); max-width: 150px; overflow: hidden; text-overflow: ellipsis; --rp-icon: 14px; }
.rp-status::before { --rp-mask: var(--rp-m-check); }
.rp-status[data-state="ok"] { color: var(--rp-ok); }
.rp-status[data-state="busy"]::before { --rp-mask: var(--rp-m-loader); animation: rp-spin 0.9s linear infinite; }
.rp-status[data-state="error"] { color: var(--rp-danger); }
.rp-status[data-state="error"]::before { --rp-mask: var(--rp-m-circle-alert); }
.rp-status[data-state="stale"] { color: var(--rp-warn); }
.rp-status[data-state="stale"]::before, .rp-status[data-state="idle"]::before { -webkit-mask: none; mask: none; width: 7px; height: 7px; border-radius: 50%; opacity: 0.6; }
.rp-history { display: flex; flex: none; align-items: center; gap: 6px; }
.rp-toolbar-right .rp-history { padding-right: 10px; margin-right: 2px; border-right: 1px solid var(--rp-line-strong); }
.rp-step { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px solid transparent; border-radius: 9px; font-size: 13px; font-weight: 500; white-space: nowrap; color: var(--rp-text-3); }
.rp-step:not(.is-on) { opacity: 0.6; }
.rp-step.is-on { color: var(--rp-text); }
.rp-check { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px solid transparent; border-radius: 9px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.rp-check-short { display: none; }
.rp-export { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px solid transparent; border-radius: 9px; background: var(--rp-accent); color: var(--rp-on-accent); font-size: 13px; font-weight: 500; white-space: nowrap; }
.rp-export-chev { margin: 0 -3px 0 -1px; opacity: 0.85; }
.rp-more { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid transparent; border-radius: 9px; color: var(--rp-text-2); }
/* Pressed while its menu is open: set aria-expanded on the opener (styles.css .toolbar) */
.rp-more[aria-expanded="true"] { background: var(--rp-fill); }
.rp-export[aria-expanded="true"] { background: var(--rp-accent-hover); }
@container rp (max-width: 1360px) {
  .rp-toolbar-right .rp-step { width: 36px; padding: 0; gap: 0; }
  .rp-toolbar-right .rp-step-word { display: none; }
}
@container rp (max-width: 960px) {
  .rp-toolbar-right .rp-check, .rp-toolbar-right .rp-export { font-size: 0; gap: 0; width: 36px; padding: 0; }
  .rp-export-chev { display: none; }
}
@container rp (max-width: 1200px) {
  .rp-toolbar-right .rp-check { font-size: 12.5px; gap: 4px; width: auto; min-width: 36px; padding: 0 9px; }
  .rp-toolbar-right .rp-check-long { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .rp-toolbar-right .rp-check-short:not(:empty) { display: inline; }
}

.rp-mobile-bar { display: none; }
@container rp (max-width: 760px) {
  .rp-app { display: flex; flex-direction: column; }
  .rp-toolbar { --rp-toolbar: 52px; flex: none; margin: 0; padding: 0 8px; gap: 8px; border-radius: 0; box-shadow: 0 0.5px 0 var(--rp-line); }
  .rp-toolbar::before { display: none; }
  .rp-toolbar-left, .rp-toolbar-right { gap: 4px; }
  .rp-docs-btn { display: inline-grid; }
  .rp-toolbar .rp-status { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); }
  .rp-toolbar .rp-history { display: none; }
  .rp-toolbar-right .rp-check, .rp-toolbar-right .rp-export, .rp-toolbar-right .rp-more { height: 44px; min-width: 44px; }
  .rp-toolbar-right .rp-export, .rp-toolbar-right .rp-more { width: 44px; }
  .rp-mobile-bar { display: flex; flex: none; align-items: center; gap: 8px; margin: 8px 12px; }
  .rp-switch { display: flex; flex: 1 1 auto; min-width: 0; padding: 2px; gap: 2px; border-radius: 12px; background: var(--rp-glass-bar); -webkit-backdrop-filter: var(--rp-glass-blur); backdrop-filter: var(--rp-glass-blur); box-shadow: var(--rp-glass-shadow); }
  .rp-switch-item { flex: 1; height: 30px; padding: 1px 6px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--rp-text-2); text-align: center; white-space: nowrap; display: grid; place-items: center; }
  .rp-window[data-view="write"] .rp-switch-item[data-view="write"], .rp-window[data-view="preview"] .rp-switch-item[data-view="preview"] {
    background: var(--rp-surface-raised); color: var(--rp-text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18), 0 0 0 0.5px var(--rp-line);
  }
  .rp-mobile-bar .rp-history { gap: 4px; }
  .rp-mobile-bar .rp-step { width: auto; height: 34px; padding: 0 10px; gap: 5px; border: 1px solid var(--rp-line-strong); border-radius: 8px; background: var(--rp-surface); }
  .rp-main { flex: 1 1 auto; margin: 0; }
  .rp-workspace { display: block; position: relative; }
  .rp-workspace > .rp-pane { position: absolute; inset: 0; border-radius: 0; box-shadow: none; }
  .rp-window[data-view="write"] .rp-preview, .rp-window[data-view="preview"] .rp-editor { display: none; }
}
@container rp (max-width: 384px) {
  .rp-mobile-bar .rp-step { width: 36px; padding: 0; }
  .rp-mobile-bar .rp-step-word { display: none; }
}

.rp-pane-head { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; min-height: 52px; padding: 10px 14px; border-bottom: 1px solid var(--rp-line); }
.rp-segmented { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--rp-fill); }
.rp-seg { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--rp-text-2); white-space: nowrap; }
.rp-seg.is-on,
.rp-preview[data-tab="allt"] .rp-seg[data-tab="allt"], .rp-preview[data-tab="prov"] .rp-seg[data-tab="prov"], .rp-preview[data-tab="svarsmall"] .rp-seg[data-tab="svarsmall"] {
  background: var(--rp-surface-raised); color: var(--rp-text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18), 0 0 0 0.5px var(--rp-line);
}
.rp-history-open { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; margin-left: auto; padding: 0 10px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--rp-text-2); }
/* Kursplan and Historik at the right end (editor-toolbar.css): the words give way by the header's own width, first Kursplan (420px), then Historik beside it (350px) */
.rp-history-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 2px; margin-left: auto; }
.rp-history-controls .rp-history-open { margin-left: 0; }
.rp-editor > .rp-pane-head { container: rp-head / inline-size; }
@container rp-head (max-width: 420px) {
  .rp-history-open-icon { width: 36px; padding: 0; }
  .rp-history-open-icon .rp-history-word { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@container rp-head (max-width: 350px) {
  .rp-history-controls:has(.rp-history-open-icon) .rp-history-open:not(.rp-history-open-icon) { width: 36px; padding: 0; }
  .rp-history-controls:has(.rp-history-open-icon) .rp-history-open:not(.rp-history-open-icon) .rp-history-word { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.rp-richbar {
  flex: none; container: rp-bar / inline-size; position: relative; z-index: 6; padding: 7px 12px 7px calc(24px + max(0px, (100% - 48px - 640px) / 2));
  background: var(--rp-glass-solid); border-bottom: 1px solid var(--rp-line);
}
.rp-richbar-row { display: flex; align-items: center; gap: 1px; overflow: hidden; }
.rp-tg { display: flex; align-items: center; gap: 1px; flex: none; }
.rp-sep { flex: none; width: 1px; height: 18px; margin: 0 4px; background: var(--rp-line-strong); }
.rp-tool {
  flex: none; display: inline-grid; grid-auto-flow: column; place-content: center; align-items: center; gap: 6px; min-width: 34px; height: 34px; padding: 0 6px; border-radius: 8px;
  color: var(--rp-text-2); font-size: 12.5px; font-weight: 500; white-space: nowrap;
}
.rp-tool.has-text { gap: 3px; }
.rp-tool.is-pressed { background: var(--rp-accent-soft); color: var(--rp-accent); }
.rp-richbar[data-state="off"] .rp-tool { opacity: 0.38; }
.rp-tool-num { border-radius: 8px 3px 3px 8px; }
.rp-tool-style { min-width: 24px; padding: 0; border-radius: 3px 8px 8px 3px; color: var(--rp-text-3); }
/* No scrolling row here (the app's scrolls): labels only from 541.6px of bar, else icons */
@container rp-bar (max-width: 541.6px) { .rp-tool.has-text .rp-tool-label { display: none; } }
@container rp-bar (max-width: 410px) {
  .rp-richbar-row, .rp-tg { gap: 0; }
  .rp-sep { margin: 0; }
}
@container rp-bar (max-width: 366px) {
  .rp-tg { flex: 0 1 auto; min-width: 0; }
  .rp-tool:not(.rp-tool-style) { flex: 0 1 auto; width: 34px; min-width: 0; padding: 0 3px; }
}
.rp-questions { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; scrollbar-width: none; padding: 20px 24px 96px; }
.rp-questions::-webkit-scrollbar { display: none; }
.rp-sheet { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.rp-title { min-height: 50px; padding: 4px 0; border-bottom: 1px solid transparent; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; overflow-wrap: break-word; }
.rp-block { display: flex; flex-direction: column; gap: 6px; }
.rp-block-label { font-size: 12px; font-weight: 600; color: var(--rp-text-3); }
.rp-sources { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 8px; min-width: 0; margin-top: -10px; }
.rp-sources-head { flex: none; display: inline-flex; align-items: center; height: 30px; }
.rp-sources-label { font-size: 12px; font-weight: 600; line-height: 30px; color: var(--rp-text-3); }
.rp-sources-info { margin-left: 0.5px; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: var(--rp-pill-radius); color: var(--rp-text-3); }
.rp-source-add { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px 0 9px; border: 1px dashed var(--rp-line-strong); border-radius: var(--rp-pill-radius); color: var(--rp-accent); font-size: 12.5px; font-weight: 500; }
.rp-source-chip { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; height: 30px; padding: 0 11px; border: 1px solid var(--rp-line); border-radius: var(--rp-pill-radius); background: var(--rp-surface-2); color: var(--rp-text-2); font-size: 12.5px; }
.rp-source-chip .rp-i { color: var(--rp-accent); }
.rp-source-chip strong { max-width: 26ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--rp-text); font-weight: 600; }
/* exam-sources.css .source-remove: 28px square at the chip's end, icon X 13px */
.rp-source-chip .rp-source-x { align-self: stretch; display: grid; place-items: center; flex: none; width: 28px; margin: 0 -11px 0 -2px; border-radius: 0 var(--rp-pill-radius) var(--rp-pill-radius) 0; }
.rp-source-chip .rp-source-x .rp-i { color: var(--rp-text-3); }
.rp-assess { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: -10px; }
.rp-assess-field { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.rp-assess-label { flex: none; font-size: 12px; font-weight: 600; color: var(--rp-text-3); }
.rp-select { position: relative; display: inline-flex; align-items: center; min-width: 168px; height: 32px; padding: 0 38px 0 12px; border-radius: 10px; background: var(--rp-fill); color: var(--rp-text); font-size: 13px; font-weight: 400; }
.rp-select .rp-i { position: absolute; right: 14px; top: 50%; margin-top: -6px; color: var(--rp-text-3); }
.rp-select .rp-i use { stroke-width: 2.4; }
.rp-student { display: grid; gap: 6px; width: calc(100% + 24px); margin: 0 -12px; padding: 10px 12px; border-radius: var(--rp-card-radius); }
.rp-student-line { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 24px; font-size: 14.5px; }
.rp-student-entry { display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; }
.rp-student-rule { display: inline-block; height: 1px; border-bottom: 1.5px solid var(--rp-text-2); transform: translateY(-3px); }
.rp-field { min-height: 42px; padding: 9px 18px 9px 12px; border: 1px solid transparent; border-radius: 10px; background: var(--rp-surface-2); font-size: 15px; line-height: 1.75; overflow-wrap: anywhere; }
.rp-field p + p { margin-top: 0.55em; }
.rp-sel { border-radius: 2px; background: var(--rp-selection); }
.rp-field strong { font-weight: 700; }
.rp-field.is-focus { background: var(--rp-surface); border-color: var(--rp-accent-line); box-shadow: 0 0 0 3px var(--rp-accent-soft); outline: 2px solid var(--rp-accent); outline-offset: 2px; }
.rp-field-answer { font-size: 14px; background: transparent; border-color: var(--rp-line); border-style: dashed; }
.rp-field-answer.is-focus { background: var(--rp-surface); border-style: solid; }
.rp-img-btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; height: 30px; margin: 2px 0 8px -2px; padding: 0 12px 0 10px; border-radius: var(--rp-pill-radius); color: var(--rp-text-2); font-size: 12.5px; font-weight: 500; }
.rp-list-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: -12px; color: var(--rp-text-3); font-size: 12.5px; }
.rp-list-tools-link { padding: 8px 0 8px 8px; color: var(--rp-accent); font-size: 12.5px; font-weight: 600; }
/* The ⇥ chip is gone from the app: an old .rp-raw draws nothing; the text after the edge floats right, like the app's .edge-end (styles.css) */
.rp-raw { display: none; }
.rp-edge-end { float: right; margin-left: 1em; }
.rp-field :is(p, h2, h5):has(.rp-edge-end) { display: flow-root; }

.rp-task-list { display: flex; flex-direction: column; gap: 8px; }
.rp-task { display: block; border: 1px solid var(--rp-line); border-radius: var(--rp-card-radius); overflow: clip; background: var(--rp-surface); }
.rp-task.is-open { scroll-margin-top: 15px; }
.rp-task-head { display: flex; align-items: stretch; background: var(--rp-surface); }
.rp-handle { flex: none; display: grid; place-items: center; width: 30px; margin-right: -10px; padding: 0 0 0 6px; color: var(--rp-text-3); }
.rp-task-toggle { flex: 1; min-width: 0; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto 18px; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 12px; color: var(--rp-text); text-align: left; }
.rp-num { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--rp-accent-soft); color: var(--rp-accent); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rp-summary { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; line-height: 1.5; font-size: 13px; }
.rp-score { color: var(--rp-text-2); font-size: 11.5px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rp-chev { grid-column: 4; color: var(--rp-text-3); transition: transform 0.15s; }
.rp-task.is-open .rp-chev { transform: rotate(180deg); }
.rp-task.is-open .rp-task-head { border-bottom: 1px solid var(--rp-line); }
.rp-task-body { display: none; flex-direction: column; gap: 8px; min-width: 0; padding: 14px 14px 12px 76px; }
.rp-task.is-open .rp-task-body { display: flex; }
.rp-task-fields { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rp-answer { display: flex; flex-direction: column; gap: 4px; padding-left: 2px; }
.rp-tag-chip { display: flex; align-items: center; gap: 6px; width: fit-content; max-width: 100%; min-height: 26px; margin: 0 0 6px; padding: 2px 10px 2px 8px; border-radius: 999px; background: var(--rp-accent-soft); color: var(--rp-text-2); font-size: 12.5px; font-weight: 500; line-height: 1.4; }
.rp-tag-chip[aria-expanded="true"] { background: color-mix(in srgb, var(--rp-accent) 18%, var(--rp-surface)); }
@container rp (max-width: 640px) { .rp-tag-chip { min-height: 32px; } }
@container rp (max-width: 480px) {
  .rp-questions:has(.rp-tag-chip) { padding-left: 12px; padding-right: 12px; }
  .rp-task-body:has(.rp-tag-chip) { padding-left: 8px; padding-right: 8px; }
  .rp-task-body:has(.rp-tag-chip) .rp-field { padding-right: 10px; }
}
@container rp (max-width: 370px) { .rp-tag-chip { margin-right: -8px; max-width: calc(100% + 8px); } }
@container rp (max-width: 340px) { .rp-tag-chip { gap: 4px; padding-right: 8px; font-size: 11.5px; } }
.rp-tag-chip > .rp-i { color: var(--rp-accent); }
.rp-tag-chip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-tag-label, .rp-tag-dot { flex: none; color: var(--rp-text-3); }
.rp-tag-value { color: var(--rp-text); font-weight: 600; }
.rp-callout { display: grid; gap: 8px; margin: 2px 0 4px; padding: 10px 10px 10px 12px; border: 1px solid var(--rp-accent-line); border-radius: 10px; background: var(--rp-accent-soft); color: var(--rp-text); font-size: 13px; line-height: 1.45; }
.rp-callout p strong { font-weight: 600; }
.rp-callout-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.rp-callout { animation: rp-callout-in var(--rp-dur) var(--rp-ease) both; }
@keyframes rp-callout-in { from { opacity: 0; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .rp-callout { animation: none; } }
.rp-callout .rp-btn.is-quiet { margin-left: auto; padding: 0 8px; border-color: transparent; background: transparent; color: var(--rp-text-2); }
@container rp (max-width: 480px) { .rp-callout-actions { width: 100%; } .rp-callout-actions .rp-btn { flex: 1 1 auto; } }
.rp-task-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 12px; }
.rp-points { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; font-size: 12px; color: var(--rp-text-3); }
.rp-points-cap { font-weight: 600; }
.rp-points-part { display: inline-flex; align-items: center; gap: 5px; }
.rp-points-name { font-weight: 600; }
.rp-pts-input { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 32px; padding: 0 4px; border: 1px solid var(--rp-line-strong); border-radius: 8px; background: var(--rp-surface); color: var(--rp-text); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rp-points.is-sum { flex-direction: column; align-items: flex-start; gap: 2px; }
.rp-points-line { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.rp-points-sum { display: inline-flex; flex-wrap: wrap; gap: 2px 12px; font-size: 14px; font-weight: 600; color: var(--rp-text); font-variant-numeric: tabular-nums; }
.rp-points-sum .rp-points-name { font-size: 12px; color: var(--rp-text-3); }
.rp-points-hint { font-weight: 400; }
.rp-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; margin: -2px -4px 0 auto; }
.rp-act { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 8px; color: var(--rp-text-3); }
.rp-act[data-action="ask"], .rp-act[data-action="check"], .rp-act[data-action="image"] { margin-right: 8px; }
.rp-act[data-action="ask"]:has(+ .rp-act[data-action="check"], + .rp-act[data-action="image"]), .rp-act[data-action="check"]:has(+ .rp-act[data-action="image"]) { margin-right: 0; }
.rp-act[data-action="remove"] { margin-left: 8px; }
.rp-act[data-action="image"] { display: inline-flex; gap: 5px; width: auto; padding: 0 9px 0 7px; font-size: 13px; font-weight: 500; }
.rp-act.is-off { opacity: 0.38; }
.rp-add-task { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border: 1px dashed var(--rp-line-strong); border-radius: 10px; color: var(--rp-text-2); font-weight: 500; }
/* "Ny uppgift" and "Ny textruta" under the list (task-actions.css .add-cards): two dashed buttons side by side, wrapping */
.rp-add-cards { display: flex; flex-wrap: wrap; align-self: flex-start; gap: 8px; }
.rp-outro-sum { font-size: 13px; color: var(--rp-text-2); font-variant-numeric: tabular-nums; }
.rp-note { display: flex; align-items: flex-start; gap: 8px; margin: 4px 0 0; font-size: 12.5px; color: var(--rp-text-3); }
.rp-note .rp-i { margin-top: 2px; }
/* Result chip (.rp-check) and card mark (.rp-mark): data-tone = ok | check | wrong | stale | running | none */
.rp-mark { flex: none; display: grid; place-items: center; width: 40px; color: var(--rp-ok); }
.rp-mark[data-tone="check"] { color: var(--rp-warn); }
.rp-mark[data-tone="wrong"] { color: var(--rp-danger); }
.rp-mark[data-tone="stale"], .rp-mark[data-tone="running"], .rp-mark[data-tone="none"] { color: var(--rp-text-3); }
.rp-check[data-tone="ok"] { color: var(--rp-ok); }
.rp-check[data-tone="check"] { color: var(--rp-warn); }
.rp-check[data-tone="wrong"] { color: var(--rp-danger); }
/* Icon follows data-tone (the app's CheckIcon), drawn as a mask; an own svg.rp-i is kept */
.rp-check { --rp-icon: 16px; --rp-mask: var(--rp-m-check-check); }
.rp-check[data-tone="ok"] { --rp-mask: var(--rp-m-circle-check); }
.rp-check[data-tone="check"] { --rp-mask: var(--rp-m-triangle-alert); }
.rp-check[data-tone="wrong"] { --rp-mask: var(--rp-m-circle-x); }
.rp-check[data-tone="stale"] { --rp-mask: var(--rp-m-pencil-line); }
.rp-check[data-tone="running"] { --rp-mask: var(--rp-m-loader); }
.rp-mark { --rp-icon: 18px; --rp-mask: var(--rp-m-circle-check); }
.rp-mark[data-tone="check"] { --rp-mask: var(--rp-m-triangle-alert); }
.rp-mark[data-tone="wrong"] { --rp-mask: var(--rp-m-circle-x); }
.rp-mark[data-tone="stale"] { --rp-mask: var(--rp-m-pencil-line); }
.rp-mark[data-tone="running"] { --rp-mask: var(--rp-m-loader); }
.rp-mark[data-tone="none"] { --rp-mask: var(--rp-m-circle-dashed); }
.rp-check:not(:has(> .rp-i))::before, .rp-mark:not(:has(> .rp-i))::before {
  content: ''; flex: none; display: block; width: var(--rp-icon); height: var(--rp-icon); background: currentColor;
  -webkit-mask: var(--rp-mask) center / contain no-repeat; mask: var(--rp-mask) center / contain no-repeat;
}
.rp-check[data-tone="running"]::before, .rp-mark[data-tone="running"]::before { animation: rp-spin 0.9s linear infinite; }
/* The read-aloud chip (ExamAudioStatus.tsx) is the Dubbelkolla chip with a Headphones icon; data-tone="running" turns it into the spinner */
.rp-check.rp-audio { --rp-m-headphones: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3'/%3E%3C/svg%3E"); }
.rp-check.rp-audio:not([data-tone="running"]) { --rp-mask: var(--rp-m-headphones); }

@container rp (max-width: 760px) {
  .rp-richbar { padding: 6px 16px; }
  .rp-questions { padding: 16px 16px 80px; }
}
@container rp (max-width: 480px) {
  .rp-task-toggle { grid-template-columns: 30px minmax(0, 1fr) 18px; gap: 8px 10px; }
  .rp-chev { grid-column: 3; grid-row: 1; }
  .rp-score { grid-column: 2; grid-row: 2; }
  .rp-task-body { padding: 12px; }
}
@container rp (max-width: 410px) { .rp-richbar { padding-right: 8px; } }

/* Formula chips: MathLive static markup (MIT, fonts/MIT-MathLive.txt), KaTeX fonts (OFL) */
@font-face { font-family: KaTeX_Main; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/KaTeX_Main-Regular.woff2') format('woff2'); }
@font-face { font-family: KaTeX_Math; font-style: italic; font-weight: 400; font-display: swap; src: url('fonts/KaTeX_Math-Italic.woff2') format('woff2'); }
.rp-math { display: inline-block; vertical-align: middle; margin: 0 2px; padding: 0 6px; min-width: 1.6em; max-width: 100%; font-size: 1.12em; line-height: 1.5; border: 1px solid transparent; border-radius: 7px; background: var(--rp-accent-soft); color: var(--rp-text); }
.rp-math__in { display: inline-flex; flex-flow: row; justify-content: space-between; align-items: flex-end; width: 100%; padding: 4px; box-sizing: border-box; }
.rp-math__c { display: flex; align-items: center; align-self: center; position: relative; overflow: hidden; padding: 2px 3px 2px 1px; width: 100%; isolation: isolate; }
.rp-math .ML__base { display: inline-block; border: 0; box-sizing: content-box; cursor: text; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0; outline: 0; padding: 0; position: relative; text-decoration: none; vertical-align: baseline; visibility: inherit; width: min-content; }
.rp-math .ML__strut, .rp-math .ML__strut--bottom { display: inline-block; min-height: 0.5em; }
.rp-math .ML__cmr { font-family: KaTeX_Main; font-style: normal; }
.rp-math .ML__mathit { font-family: KaTeX_Math; font-style: italic; }
.rp-math .ML__center { text-align: center; }
.rp-math .ML__frac-line { min-height: 1px; width: 100%; }
.rp-math .ML__frac-line:after { background: currentColor; box-sizing: content-box; content: ""; display: block; forced-color-adjust: preserve-parent-color; margin-top: max(-1px, -0.04em); min-height: max(1px, 0.04em); print-color-adjust: exact; transform: translate(0); }
.rp-math .ML__latex { direction: ltr; display: inline-block; font-family: inherit; font-size-adjust: none; font-stretch: normal; font-style: normal; font-variant-caps: normal; letter-spacing: normal; line-height: 1.2; text-align: left; text-indent: 0; text-rendering: auto; word-wrap: normal; forced-color-adjust: preserve-parent-color; text-shadow: none; white-space: nowrap; width: min-content; word-spacing: normal; }
.rp-math .ML__latex .ML__mfrac { display: inline-block; }
.rp-math .ML__latex .ML__vlist-t { border-collapse: collapse; display: inline-table; table-layout: fixed; }
.rp-math .ML__latex .ML__vlist-r { display: table-row; }
.rp-math .ML__latex .ML__vlist { display: table-cell; position: relative; vertical-align: bottom; }
.rp-math .ML__latex .ML__vlist > span { display: block; height: 0; position: relative; }
.rp-math .ML__latex .ML__vlist > span > span { display: inline-block; }
.rp-math .ML__latex .ML__vlist > span > .ML__pstrut { overflow: hidden; width: 0; }
.rp-math .ML__latex .ML__vlist-t2 { margin-right: -2px; }
.rp-math .ML__latex .ML__vlist-s { display: table-cell; font-size: 1px; min-width: 2px; vertical-align: bottom; width: 2px; }
.rp-math .ML__latex .ML__msubsup { text-align: left; }
.rp-math .ML__latex .ML__thinspace { display: inline-block; height: 0.71em; width: 0.16667em; }
.rp-math .ML__latex .ML__nulldelimiter { display: inline-block; }

.rp-preview[data-tab="allt"] [data-show]:not([data-show~="allt"]),
.rp-preview[data-tab="prov"] [data-show]:not([data-show~="prov"]),
.rp-preview[data-tab="svarsmall"] [data-show]:not([data-show~="svarsmall"]) { display: none !important; }
.rp-preview-head { container: rp-pv / inline-size; }
.rp-pdfctl { display: flex; align-items: center; gap: 2px; margin-left: auto; padding: 2px; border-radius: 9px; background: var(--rp-fill); }
.rp-pbtn { display: grid; place-items: center; min-width: 30px; height: 28px; padding: 0 6px; border-radius: 7px; color: var(--rp-text-2); }
.rp-pbtn.is-off { opacity: 0.4; }
.rp-zoom { width: 54px; min-width: 0; padding: 0; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: center; }
.rp-mark-toggle { display: inline-flex; gap: 6px; padding: 0 9px 0 8px; font-size: 13px; font-weight: 500; color: var(--rp-text); }
.rp-mark-toggle.is-on { background: var(--rp-accent); color: var(--rp-on-accent); }
.rp-divider { width: 1px; height: 16px; margin: 0 3px; background: var(--rp-line-strong); }
.rp-page-label { padding: 0 5px; font-size: 12.5px; color: var(--rp-text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
@container rp-pv (max-width: 529px) { .rp-page-label, .rp-pdfctl > .rp-divider { display: none; } }
@container rp-pv (max-width: 430px) { .rp-pdfctl { flex: 1 1 100%; justify-content: space-between; } }
.rp-pdf { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; container: rp-pdf / inline-size; }
.rp-pdf-scroller { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; scrollbar-width: none; }
.rp-pdf-scroller::-webkit-scrollbar { display: none; }
.rp-pages { display: flex; flex-direction: column; align-items: center; padding: 28px 28px 96px; gap: 24px; }
/* Zoom: data-zoom = 50..300 on .rp-preview (PdfPreview.tsx steps); a page is 793.7px wide at 100 % */
.rp-preview[data-zoom="50"] { --rp-zoom: 0.5; }
.rp-preview[data-zoom="67"] { --rp-zoom: 0.67; }
.rp-preview[data-zoom="80"] { --rp-zoom: 0.8; }
.rp-preview[data-zoom="100"] { --rp-zoom: 1; }
.rp-preview[data-zoom="125"] { --rp-zoom: 1.25; }
.rp-preview[data-zoom="150"] { --rp-zoom: 1.5; }
.rp-preview[data-zoom="200"] { --rp-zoom: 2; }
.rp-preview[data-zoom="300"] { --rp-zoom: 3; }
.rp-preview:is([data-zoom="50"], [data-zoom="67"], [data-zoom="80"], [data-zoom="100"], [data-zoom="125"], [data-zoom="150"], [data-zoom="200"], [data-zoom="300"]) .rp-pages { min-width: min-content; }
.rp-preview:is([data-zoom="50"], [data-zoom="67"], [data-zoom="80"], [data-zoom="100"], [data-zoom="125"], [data-zoom="150"], [data-zoom="200"], [data-zoom="300"]) .rp-page { width: calc(793.7px * var(--rp-zoom)); }
.rp-page { position: relative; flex: none; width: 100%; background: #fff; border-radius: 2px; box-shadow: var(--rp-shadow-paper); line-height: 0; }
.rp-page img { display: block; width: 100%; height: auto; border-radius: 2px; }
.rp-pdf-empty { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr); place-content: center; justify-items: center; gap: 8px; padding: 32px; text-align: center; }
.rp-paper-frame { position: relative; width: min(420px, 78%); display: grid; }
.rp-skeleton { width: 100%; aspect-ratio: 1 / 1.414; display: flex; flex-direction: column; gap: 4.5%; padding: 11% 10%; background: #fff; border-radius: 2px; box-shadow: var(--rp-shadow-paper); }
.rp-skeleton i { display: block; height: 2.6%; border-radius: 99px; background: #e7e7ea; animation: rp-shimmer 1.6s ease-in-out infinite; }
.rp-skeleton i:nth-child(1) { width: 46%; height: 4%; }
.rp-skeleton i:nth-child(3) { width: 82%; }
.rp-skeleton i:nth-child(4) { width: 64%; }
.rp-skeleton i:nth-child(5) { width: 74%; }
.rp-building { position: absolute; inset: 48% 10% auto; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; color: #515154; font-size: 14px; line-height: 1.45; text-align: center; }
.rp-building span { max-width: 30ch; color: #66666b; font-size: 13px; }
.rp-pill {
  position: absolute; top: 12px; right: 12px; z-index: 3; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: var(--rp-pill-radius);
  background: var(--rp-surface-raised); color: var(--rp-text-2); box-shadow: var(--rp-float-shadow); font-size: 12.5px; font-weight: 500; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  --rp-icon: 14px;
}
.rp-pill::before { content: ''; flex: none; width: 14px; height: 14px; background: currentColor; -webkit-mask: var(--rp-m-loader) center / contain no-repeat; mask: var(--rp-m-loader) center / contain no-repeat; animation: rp-spin 0.9s linear infinite; }
.rp-pill[data-state="stale"] { color: var(--rp-warn); }
.rp-pill[data-state="stale"]::before { display: none; }
@container rp (max-width: 760px) {
  .rp-pdfctl .rp-page-label, .rp-pdfctl .rp-divider { display: none; }
  .rp-pages { padding: 16px 28px 88px; }
}

/* The assistant (global-assistant.css, prompt-box.css) */
.rp-main { display: flex; flex-direction: column; }
.rp-workspace { flex: 1 1 auto; min-height: 0; height: auto; }
.rp-dock { position: absolute; inset: auto 0 0 0; z-index: 10; padding: 0 16px 14px; pointer-events: none; }
.rp-assistant {
  pointer-events: auto; position: relative; width: min(100%, 480px); margin: 0 auto; padding: 6px; display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; overflow: hidden;
  border: 1px solid var(--rp-glass-edge); border-radius: 24px; background: var(--rp-glass-pop); -webkit-backdrop-filter: var(--rp-glass-blur); backdrop-filter: var(--rp-glass-blur); box-shadow: var(--rp-float-shadow);
}
.rp-assistant:not([data-state="idle"]), .rp-assistant:has(.rp-latest:not([hidden])) { width: min(100%, 640px); border-radius: var(--rp-sheet-radius); }
.rp-assistant:has(.rp-suggest:not([hidden])) { border-radius: var(--rp-sheet-radius); }
.rp-assistant[data-state="active"], .rp-assistant[data-state="thread"] { box-shadow: var(--rp-focus-ring), var(--rp-float-shadow); }
.rp-dock.is-minimized .rp-assistant { display: none; }
.rp-dock:not(.is-minimized) .rp-fab { display: none; }
.rp-fab { position: relative; display: grid; place-items: center; width: 52px; height: 52px; margin: 0 0 0 auto; border-radius: 50%; background: var(--rp-accent); color: var(--rp-on-accent); box-shadow: var(--rp-float-shadow); pointer-events: auto; }
.rp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--rp-line-strong); border-radius: 8px; background: var(--rp-surface); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.rp-btn.is-primary { background: var(--rp-accent); border-color: transparent; color: var(--rp-on-accent); }
.rp-link { display: inline-flex; align-items: center; gap: 6px; color: var(--rp-accent); font-size: 12.5px; font-weight: 500; }
.rp-ibtn { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: var(--rp-pill-radius); color: var(--rp-text-2); }
.rp-ibtn.is-on { background: var(--rp-fill); color: var(--rp-text); }
.rp-thread-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0 8px; min-height: 32px; padding: 0 0 0 10px; }
.rp-sync-note { min-width: 0; font-size: 12px; color: var(--rp-text-2); }
.rp-thread-actions { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; }
.rp-thread-actions .rp-link { min-height: 28px; padding: 0 10px; border-radius: var(--rp-pill-radius); font-size: 12.5px; }
.rp-thread-actions .rp-ibtn { width: 32px; height: 32px; }
.rp-chat { max-height: min(calc(var(--rp-vh) * 0.6), 560px); overflow-x: hidden; overflow-y: auto; scrollbar-width: none; padding: 4px 10px 12px; }
.rp-chat::-webkit-scrollbar { display: none; }
.rp-chat-list { display: flex; flex-direction: column; gap: 14px; }
.rp-msg-user { align-self: flex-end; max-width: 88%; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.rp-msg-user p { padding: 8px 13px; border-radius: 16px 16px 5px 16px; background: var(--rp-fill); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.rp-msg-task { display: inline-flex; align-items: center; gap: 4px; margin-right: 4px; font-size: 12px; font-weight: 550; color: var(--rp-text-3); }
.rp-msg-assistant { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.rp-msg-text { font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.rp-change-card { width: 100%; padding: 11px 12px 12px; border: 1px solid var(--rp-line); border-radius: var(--rp-card-radius); background: var(--rp-surface-2); }
.rp-change-head { display: flex; align-items: center; gap: 8px; }
.rp-change-head .rp-i { color: var(--rp-accent); }
.rp-change-head strong { font-size: 13.5px; }
.rp-change-stats { margin-left: auto; font-size: 12.5px; color: var(--rp-text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-change-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rp-change-actions .rp-btn { height: 28px; }
.rp-latest { min-width: 0; padding: 4px 2px 6px 8px; }
.rp-latest-inner { display: flex; align-items: flex-start; gap: 4px; min-height: 0; min-width: 0; overflow: hidden; }
.rp-latest-body { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.rp-latest-close { width: 32px; height: 32px; }
.rp-working { display: flex; align-items: center; gap: 8px; min-height: 32px; margin: 0; font-size: 12.5px; color: var(--rp-text-2); --rp-icon: 15px; }
.rp-working::before { display: none; color: var(--rp-accent); }
.rp-working[data-kind="writing"]::before { display: block; --rp-mask: var(--rp-m-pencil-line); }
.rp-working[data-kind="checking"]::before, .rp-working[data-kind="busy"]::before { display: block; --rp-mask: var(--rp-m-loader); animation: rp-spin 0.9s linear infinite; }
.rp-dots { display: none; gap: 4px; }
.rp-working[data-kind="thinking"] .rp-dots { display: inline-flex; }
.rp-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--rp-accent); animation: rp-pulse 1.1s ease-in-out infinite; }
.rp-dots i:nth-child(2) { animation-delay: 0.15s; }
.rp-dots i:nth-child(3) { animation-delay: 0.3s; }
.rp-working-detail { margin-left: -4px; color: var(--rp-text-3); font-variant-numeric: tabular-nums; }
.rp-working-detail:empty { display: none; }
.rp-reply { max-height: min(calc(var(--rp-vh) * 0.32), 220px); overflow-y: auto; scrollbar-width: none; padding: 6px 2px 0 0; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.rp-change { width: 100%; min-width: 0; }
.rp-change-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; }
.rp-chip { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; height: 32px; padding: 0 10px; border-radius: var(--rp-pill-radius); background: var(--rp-accent-soft); color: var(--rp-text); font-size: 13px; }
.rp-chip > .rp-i:first-child { color: var(--rp-accent); }
.rp-chip strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.rp-chip .rp-change-stats { margin-left: 2px; font-size: 12px; }
.rp-chip-chev { flex: none; color: var(--rp-text-3); transition: transform var(--rp-dur-fast) ease; }
.rp-change.is-open .rp-chip-chev { transform: rotate(180deg); }
.rp-change-btns { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.rp-change-details { display: none; margin: 6px 0 0 10px; }
.rp-change.is-open .rp-change-details { display: block; }
.rp-change-text { margin: 0; max-height: min(calc(var(--rp-vh) * 0.24), 160px); overflow-y: auto; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; color: var(--rp-text-2); }
.rp-change-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; }
.rp-only-phone { display: none; }
.rp-suggest { display: flex; gap: 6px; min-width: 0; overflow: hidden; padding: 2px 28px 6px 4px; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
.rp-sug { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--rp-pill-radius); background: var(--rp-fill); color: var(--rp-text); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.rp-sug.is-link { background: none; color: var(--rp-accent); }
.rp-scope-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; padding: 2px 4px 4px; }
.rp-scope { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 2px 0 10px; border-radius: var(--rp-pill-radius); background: var(--rp-accent-soft); color: var(--rp-accent); }
.rp-scope strong { font-size: 12.5px; font-weight: 600; color: var(--rp-text); white-space: nowrap; }
.rp-scope .rp-ibtn { width: 26px; height: 26px; }
.rp-prompt { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-auto-flow: row dense; align-items: end; column-gap: 4px; }
.rp-assistant[data-state="idle"] .rp-prompt { align-items: center; }
.rp-add { grid-column: 1; width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--rp-pill-radius); color: var(--rp-text-2); }
.rp-ta { grid-column: 2; min-width: 0; min-height: 36px; padding: 7px 0; font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; color: var(--rp-text); }
.rp-ta.is-empty { color: var(--rp-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-ta:not(.is-empty) { max-height: 132px; overflow-x: hidden; overflow-y: auto; scrollbar-width: none; white-space: pre-wrap; }
.rp-ta:not(.is-empty)::-webkit-scrollbar { display: none; }
.rp-prompt-row { grid-column: 3; display: flex; align-items: center; gap: 2px; }
.rp-send { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--rp-fill); color: var(--rp-text-3); }
.rp-send.is-ready { background: var(--rp-accent); color: var(--rp-on-accent); }
.rp-send.is-stop { background: var(--rp-text); color: var(--rp-surface-raised); }

@container rp (max-width: 720px) {
  .rp-dock { padding: 0 10px 10px; }
  .rp-dock:has(.rp-assistant:not([data-state="idle"]):not([hidden])), .rp-dock:has(.rp-assistant:not([hidden]) .rp-latest:not([hidden])) { padding: 0; }
  .rp-assistant:not([data-state="idle"]), .rp-assistant:has(.rp-latest:not([hidden])) { width: 100%; border-radius: var(--rp-sheet-radius) var(--rp-sheet-radius) 0 0; border-bottom-color: transparent; padding-bottom: 8px; max-height: min(calc(var(--rp-vh) * 0.7), calc(var(--rp-vh) - var(--rp-toolbar))); }
  .rp-chat { max-height: min(calc(var(--rp-vh) * 0.52), 560px); }
  .rp-assistant:not([data-state="idle"]) .rp-ta, .rp-assistant:has(.rp-latest:not([hidden])) .rp-ta { grid-column: 1 / -1; padding-left: 8px; }
  .rp-assistant:not([data-state="idle"]) .rp-prompt-row, .rp-assistant:has(.rp-latest:not([hidden])) .rp-prompt-row { grid-column: 2 / -1; justify-self: end; }
  .rp-assistant[data-state="idle"] .rp-info, .rp-assistant[data-state="idle"] .rp-send:not(.is-stop) { display: none; }
  .rp-chip-diff span { display: none; }
  .rp-chip-diff { width: 30px; padding: 0; }
  .rp-only-phone { display: inline-flex; }
  .rp-change-stats { display: none; }
  .rp-scope .rp-ibtn { width: 34px; height: 34px; }
}
@container rp (max-width: 760px) {
  .rp-dock.is-minimized { position: static; padding: 6px 12px 8px; border-top: 1px solid var(--rp-line); background: var(--rp-bg); }
}

/* Menus (Exportera, Mer): the app's .menu-panel */
.rp-menu-wrap { position: relative; display: inline-flex; }
.rp-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: max-content; min-width: 200px; max-width: 340px; padding: 5px;
  background: var(--rp-glass-solid); border: 1px solid var(--rp-glass-edge); border-radius: 14px; box-shadow: var(--rp-glass-shadow-pop); color: var(--rp-text);
}
.rp-menu:has(.rp-menu-tag) { min-width: 224px; }
.rp-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border-radius: 7px; font-size: 13.5px; text-align: left; white-space: nowrap; }
.rp-menu-item.has-detail { min-height: 36px; height: auto; padding: 7px 10px; }
.rp-menu-text { display: flex; flex: 1; flex-direction: column; gap: 1px; min-width: 0; line-height: 1.25; }
.rp-menu-text small { font-size: 12px; color: var(--rp-text-3); }
.rp-menu-tag { flex: none; padding: 1px 6px; border: 1px solid var(--rp-line-strong); border-radius: 5px; font-size: 11px; font-weight: 600; line-height: 1.35; letter-spacing: 0.02em; color: var(--rp-text-3); }
.rp-menu-tag[data-tone="ok"] { color: var(--rp-ok); border-color: color-mix(in srgb, var(--rp-ok) 45%, transparent); }
.rp-menu-tag[data-tone="check"] { color: var(--rp-warn); border-color: color-mix(in srgb, var(--rp-warn) 45%, transparent); }
.rp-menu-tag[data-tone="wrong"] { color: var(--rp-danger); border-color: color-mix(in srgb, var(--rp-danger) 45%, transparent); }
.rp-menu-tag[data-tone="stale"], .rp-menu-tag[data-tone="running"] { color: var(--rp-text-2); border-color: color-mix(in srgb, var(--rp-text-2) 45%, transparent); }
/* Auto in Mer is a checkbox item: its check is there (kept in the layout) only while aria-checked is true */
.rp-menu-item[aria-checked="false"] > .rp-i { visibility: hidden; }
.rp-menu-sep { display: block; height: 1px; margin: 5px 8px; background: var(--rp-line); }
.rp-menu-note { display: block; margin: 5px 6px 0; padding: 6px 4px 2px; border-top: 1px solid var(--rp-line); font-size: 12px; line-height: 1.3; color: var(--rp-text-3); }
.rp-menu-item.is-active { background: var(--rp-accent); color: var(--rp-on-accent); }
.rp-menu-item.is-active small, .rp-menu-item.is-active .rp-menu-tag { color: inherit; opacity: 0.85; }
.rp-menu-item.is-active .rp-menu-tag { border-color: currentColor; }
@container rp (max-width: 760px) { .rp-toolbar-right .rp-menu-wrap { position: static; } .rp-menu { right: 8px; } }

/* Dialog (sky.css): the scrim and the sheet are SIBLINGS, since a backdrop-filter on the parent would flatten the glass */
@keyframes rp-dialog-in { from { opacity: 0; transform: translateY(8px) scale(0.99); } }
@keyframes rp-dialog-up { from { opacity: 0; transform: translateY(24px); } }
.rp-modal { position: absolute; inset: 0; z-index: 60; display: grid; place-items: center; padding: var(--rp-modal-gap, var(--rp-modal-pad, 12px)) var(--rp-modal-pad, 12px); }
.rp-modal.is-top { --rp-modal-pad: 16px; --rp-modal-gap: min(calc(var(--rp-vh) * 0.08), 64px); align-items: start; }
.rp-modal-scrim { position: absolute; inset: 0; background: rgba(4, 30, 45, 0.3); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.rp-dialog {
  position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  width: min(var(--rp-dialog-w, 720px), 100%); height: var(--rp-dialog-h, auto); max-height: calc(var(--rp-vh) - 2 * var(--rp-modal-gap, var(--rp-modal-pad, 12px)));
  border: 1px solid var(--rp-glass-edge); border-radius: 24px; color: var(--rp-text);
  background: var(--rp-glass-sheet); -webkit-backdrop-filter: var(--rp-glass-blur-calm); backdrop-filter: var(--rp-glass-blur-calm); box-shadow: var(--rp-glass-shadow-pop);
}
.rp-modal.is-animated > .rp-dialog { animation: rp-dialog-in var(--rp-dur) var(--rp-ease); }
@media (prefers-reduced-motion: reduce) { .rp-modal.is-animated > .rp-dialog { animation: none; } }
.rp-dialog-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px var(--rp-dialog-px, 20px); border-bottom: 1px solid var(--rp-line); }
.rp-dialog-titles { min-width: 0; }
.rp-dialog-title { font: 700 20px/1.3 var(--rp-sans); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.rp-dialog-sub { margin-top: 3px; color: var(--rp-text-2); font-size: 13px; overflow-wrap: anywhere; }
.rp-dialog-x { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 8px; color: var(--rp-text-2); }
.rp-dialog-body { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding: 16px var(--rp-dialog-px, 20px) 20px; }
.rp-dialog-body::-webkit-scrollbar { display: none; }
.rp-dialog-foot { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 16px; padding: 12px var(--rp-dialog-px, 20px); border-top: 1px solid var(--rp-line); }
.rp-dialog-view { flex: 1 1 auto; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.rp-dialog .rp-btn { height: 32px; padding: 0 12px; font-size: 13px; }   /* the app's .button; the kit's own .rp-btn is the small one of the task cards and the assistant */
.rp-dialog .rp-btn.is-off { opacity: 0.45; }
@container rp (max-width: 640px) { .rp-dialog { border-radius: 16px; } }
@container rp (max-width: 600px) {
  .rp-dialog { --rp-dialog-px: 14px; }
  .rp-modal.is-full { padding: 0; }
  .rp-modal.is-full > .rp-dialog { width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0; }
  .rp-modal.is-sheet { padding: 0; place-items: end center; }
  .rp-modal.is-sheet > .rp-dialog { width: 100%; height: calc(var(--rp-vh) * 0.94); max-height: none; border-width: 1px 0 0; border-radius: var(--rp-sheet-radius) var(--rp-sheet-radius) 0 0; }
  .rp-modal.is-sheet.is-animated > .rp-dialog { animation-name: rp-dialog-up; }
}
/* No backdrop-filter: the glass that carries text over the work turns (nearly) solid */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .dk-stage {
    --rp-glass-sheet: var(--rp-glass-solid); --rp-glass-pop: var(--rp-glass-solid);
    --rp-glass: rgba(255, 255, 255, 0.9); --rp-glass-bar: rgba(255, 255, 255, 0.9); --rp-glass-thick: rgba(255, 255, 255, 0.94);
  }
}

/* The editor while the prov is created (document-loading.css): .is-making on .rp-app switches it */
.rp-spinner { display: block; flex: none; width: 20px; height: 20px; --rp-icon: 20px; --rp-mask: var(--rp-m-loader); color: var(--rp-accent); }
.rp-spinner::before { animation: rp-spin 0.9s linear infinite; }
.rp-doc-loading { display: none; flex: 1 1 auto; min-height: 0; flex-direction: column; gap: 32px; padding: 28px 28px 24px; overflow: hidden; background: var(--rp-surface); }
.rp-app.is-making .rp-editor > :not(.rp-doc-loading), .rp-editor.is-making > :not(.rp-doc-loading) { display: none; }
.rp-app.is-making .rp-editor > .rp-doc-loading, .rp-editor.is-making > .rp-doc-loading { display: flex; }
.rp-doc-loading-head { display: flex; align-items: center; gap: 12px; }
.rp-doc-loading-head > div { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rp-doc-loading-head strong { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.rp-doc-loading-head > div > span { font-size: 13px; color: var(--rp-text-2); }
.rp-doc-loading-sheet { display: flex; flex-direction: column; gap: 16px; }
.rp-doc-loading-sheet i { display: block; height: 12px; border-radius: 99px; background: var(--rp-fill); animation: rp-shimmer 1.6s ease-in-out infinite; }
.rp-doc-loading-sheet .is-title { width: 58%; height: 26px; margin-bottom: 6px; }
.rp-doc-loading-sheet .is-label { width: 34%; }
.rp-doc-loading-sheet .is-field { width: 100%; height: 52px; border-radius: 10px; margin-bottom: 10px; }
.rp-doc-loading-card { display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 16px; border: 1px solid var(--rp-line); border-radius: 12px; }
.rp-doc-loading-card .is-dot { flex: none; width: 28px; height: 28px; border-radius: 50%; }
.rp-doc-loading-card i:not(.is-dot) { flex: 0 1 62%; }
.rp-doc-loading-card:nth-of-type(2) i:not(.is-dot) { flex-basis: 48%; }
.rp-doc-loading-card:nth-of-type(3) i:not(.is-dot) { flex-basis: 70%; }
@container rp (max-width: 760px) { .rp-doc-loading { gap: 24px; padding: 20px 16px; } }
.rp-sync[data-state="note"]::before { display: none; }
.rp-toolbar-right.is-frozen > :not(.rp-status), .rp-app.is-making .rp-toolbar-right > :not(.rp-status) { opacity: 0.45; }
.rp-app.is-making .rp-pages, .rp-app.is-making .rp-pdfctl { display: none; }
.rp-app:not(.is-making) .rp-while-making, .rp-app.is-making .rp-unless-making { display: none; }

.rp-send > .rp-send-stop { display: none; }
.rp-send.is-stop > .rp-send-go { display: none; }
.rp-send.is-stop > .rp-send-stop { display: block; }

/* A preview page that changes: images stacked in one .rp-page.is-stack; .is-on or data-current picks the shown one */
.rp-page.is-stack > img + img { position: absolute; inset: 0; height: 100%; opacity: 0; transition: opacity var(--rp-page-fade, 0s) ease; }
.rp-page.is-stack > img.is-on, .rp-page.is-stack > img:has(~ img.is-on) { opacity: 1; }
.rp-page.is-stack[data-current="2"] > img:nth-child(-n+2), .rp-page.is-stack[data-current="3"] > img:nth-child(-n+3), .rp-page.is-stack[data-current="4"] > img:nth-child(-n+4) { opacity: 1; }

/* Page headings stay out of the replicas (not :where(): it would lose to the page's (0,1,1) rules) */
.dk-stage :is(h1, h2, h3, h4) { margin: 0; font: inherit; letter-spacing: normal; text-wrap: wrap; }

/* Hem and plan (src/components/{HomeComposer,PromptBox,plan/*,kursplan/*}.tsx). Knobs: --rp-hem-top (56px), --rp-plan-top (44px). The cards are glass: put them on the sky. */

.rp-hem-band, .rp-plan-band {
  box-sizing: border-box; min-width: 0; color: var(--rp-text); text-align: left;
  font: 14px/1.45 var(--rp-sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.rp-hem-band *, .rp-hem-band *::before, .rp-hem-band *::after,
.rp-plan-band *, .rp-plan-band *::before, .rp-plan-band *::after { box-sizing: border-box; }
/* :where() keeps these resets weaker than every component rule */
:where(.rp-hem-band, .rp-plan-band) :where(p, ul, li, span, div, button, i, img) { margin: 0; padding: 0; }
:where(.rp-hem-band, .rp-plan-band) :where(ul) { list-style: none; }
:where(.rp-hem-band, .rp-plan-band) button { appearance: none; -webkit-appearance: none; border: 0; background: none; font: inherit; color: inherit; text-align: inherit; cursor: default; }
:where(.rp-hem-band, .rp-plan-band) img { max-width: none; }

/* Icons: Lucide 1.48.0 (ISC, fonts/ISC-Lucide.txt) as a mask; size --rp-ico-size */
.rp-hem-ico, .rp-plan-ico {
  display: inline-block; flex: none; width: var(--rp-ico-size, 15px); height: var(--rp-ico-size, 15px); background: currentColor;
  -webkit-mask: var(--rp-ico) center / contain no-repeat; mask: var(--rp-ico) center / contain no-repeat;
}
[data-rp-ico="image"] { --rp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='18' x='3' y='3' rx='2' ry='2'/%3E%3Ccircle cx='9' cy='9' r='2'/%3E%3Cpath d='m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21'/%3E%3C/svg%3E"); }
[data-rp-ico="file-up"] { --rp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z'/%3E%3Cpath d='M14 2v5a1 1 0 0 0 1 1h5'/%3E%3Cpath d='M12 12v6'/%3E%3Cpath d='m15 15-3-3-3 3'/%3E%3C/svg%3E"); }
[data-rp-ico="history"] { --rp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8'/%3E%3Cpath d='M3 3v5h5'/%3E%3Cpath d='M12 7v5l4 2'/%3E%3C/svg%3E"); }
[data-rp-ico="layout-template"] { --rp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='7' x='3' y='3' rx='1'/%3E%3Crect width='9' height='7' x='3' y='14' rx='1'/%3E%3Crect width='5' height='7' x='16' y='14' rx='1'/%3E%3C/svg%3E"); }
[data-rp-ico="chevron-down"] { --rp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
[data-rp-ico="info"] { --rp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E"); }
[data-rp-ico="arrow-right"] { --rp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='m12 5 7 7-7 7'/%3E%3C/svg%3E"); }
[data-rp-ico="arrow-left"] { --rp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 19-7-7 7-7'/%3E%3Cpath d='M19 12H5'/%3E%3C/svg%3E"); }
[data-rp-ico="x"] { --rp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E"); }
[data-rp-ico="file-text"] { --rp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z'/%3E%3Cpath d='M14 2v5a1 1 0 0 0 1 1h5'/%3E%3Cpath d='M10 9H8'/%3E%3Cpath d='M16 13H8'/%3E%3Cpath d='M16 17H8'/%3E%3C/svg%3E"); }
[data-rp-ico="pencil"] { --rp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z'/%3E%3Cpath d='m15 5 4 4'/%3E%3C/svg%3E"); }
[data-rp-ico="minus"] { --rp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E"); }
[data-rp-ico="plus"] { --rp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='M12 5v14'/%3E%3C/svg%3E"); }
[data-rp-ico="check"] { --rp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
[data-rp-ico="search"] { --rp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21 21-4.34-4.34'/%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3C/svg%3E"); }
[data-rp-ico="chevron-right"] { --rp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E"); }
[data-rp-ico="loader-circle"] { --rp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 1 1-6.219-8.56'/%3E%3C/svg%3E"); }
[data-rp-ico="copy"] { --rp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='14' height='14' x='8' y='8' rx='2' ry='2'/%3E%3Cpath d='M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2'/%3E%3C/svg%3E"); }
[data-rp-ico="image-plus"] { --rp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 5h6'/%3E%3Cpath d='M19 2v6'/%3E%3Cpath d='M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5'/%3E%3Cpath d='m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21'/%3E%3Ccircle cx='9' cy='9' r='2'/%3E%3C/svg%3E"); }
.rp-hem-spin, .rp-plan-spin { animation: rp-spin 0.9s linear infinite; }
@media (prefers-reduced-motion: reduce) { .rp-hem-spin, .rp-plan-spin { animation: none; } }

/* HEM (HomeComposer.tsx, home.css, home-sky.css, prompt-box.css) */

/* The band: the heading on the sky; --rp-hem-top is the app's clamp(48px, 9vh, 96px) as a fixed length */
.rp-hem-band { padding: var(--rp-hem-top, 56px) 24px 8px; }
.rp-hem-band-inner { display: grid; justify-items: center; gap: 16px; max-width: 760px; margin: 0 auto; text-align: center; }
.rp-hem-title {
  font: 650 clamp(32px, 4.2cqw, 46px) / 1.08 var(--rp-sans); letter-spacing: -0.03em; text-wrap: balance; color: var(--rp-text);
}
.rp-hem-panel { display: grid; gap: 14px; justify-self: stretch; min-width: 0; text-align: left; }
/* The line under the card while a prov is open (home.css .home-note); last in .rp-hem-panel */
.rp-hem-note { margin: 0; font-size: 13px; line-height: 1.5; color: var(--rp-text-2); text-align: center; }

.rp-hem-card, .rp-plan {
  position: relative; z-index: 2; min-width: 0; border-radius: 30px;
  background: var(--rp-glass); -webkit-backdrop-filter: var(--rp-glass-blur); backdrop-filter: var(--rp-glass-blur); box-shadow: var(--rp-glass-shadow);
}
.rp-hem-card::before, .rp-plan::before {
  content: ''; position: absolute; inset: 0; padding: 1px; border-radius: inherit; pointer-events: none; background: var(--rp-glass-rim);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.rp-hem-card.is-focus { box-shadow: var(--rp-glass-shadow), 0 0 0 4px var(--rp-accent-soft); outline: 2px solid var(--rp-accent-line); outline-offset: 0; }

.rp-hem-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 16px 0; }
.rp-hem-chips:not(:has(li)) { display: none; }
.rp-hem-sources { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.rp-hem-source {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 36px; padding: 3px 4px 3px 10px;
  border: 1px solid var(--rp-line); border-radius: 12px; background: var(--rp-surface-2);
}
.rp-hem-source > .rp-hem-ico { --rp-ico-size: 15px; color: var(--rp-accent); }
.rp-hem-source-label { min-width: 0; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.rp-hem-source-remove { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 8px; color: var(--rp-text-3); }
.rp-hem-source-remove > .rp-hem-ico { --rp-ico-size: 14px; }

.rp-hem-prompt { display: flex; flex-direction: column; gap: 6px; padding: 18px 14px 14px 22px; border-radius: inherit; }

.rp-hem-text {
  width: 100%; min-height: 84px; padding: 2px 0; font-size: 17px; line-height: 1.5; letter-spacing: -0.012em; color: var(--rp-text);
  overflow-wrap: anywhere; white-space: pre-wrap;
}
[data-placeholder]:empty::before { content: attr(data-placeholder); color: var(--rp-text-3); }

/* What waits to be sent (src/prompt-box.css .attachments, PromptBox.tsx): every card has one shape; Hem's box and the assistant's box (rita) both use it */
.rp-hem-attachments { display: flex; flex-wrap: wrap; gap: 10px 8px; margin: 0; padding: 0; list-style: none; }
.rp-hem-attachments:not(:has(li)) { display: none; }
.rp-att {
  position: relative; flex: none; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; column-gap: 10px;
  min-width: 188px; max-width: min(280px, 100%); height: 58px; padding: 8px 12px 8px 8px;
  border: 1px solid var(--rp-line); border-radius: 14px; background: var(--rp-surface); box-shadow: 0 1px 2px rgba(6, 52, 78, 0.05);
}
.rp-att-tile { position: relative; display: grid; place-items: center; width: 40px; height: 40px; overflow: hidden; border-radius: 10px; background: var(--rp-accent-soft); color: var(--rp-accent); }
.rp-att-tile > .rp-hem-ico { --rp-ico-size: 19px; }
.rp-att-pdf .rp-att-tile { background: var(--rp-pdf-soft); color: var(--rp-pdf); }
.rp-att-thumb { background: var(--rp-surface-2); }
.rp-att-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rp-att-thumb::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(6, 52, 78, 0.1); }
.rp-att-text { display: grid; gap: 1px; min-width: 0; }
.rp-att-name, .rp-att-kind { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.3; }
.rp-att-name { font-size: 13px; font-weight: 600; letter-spacing: -0.006em; color: var(--rp-text); }
.rp-att-kind { font-size: 12px; color: var(--rp-text-3); }
.rp-att-remove {
  position: absolute; top: -8px; right: -8px; z-index: 1; display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%;
  background: var(--rp-text); color: var(--rp-surface-raised); box-shadow: 0 0 0 2px var(--rp-surface-raised), 0 1px 3px rgba(0, 0, 0, 0.18);
}
.rp-att-remove > .rp-hem-ico { --rp-ico-size: 12px; }
@media (hover: hover) and (pointer: fine) { .rp-att-remove { opacity: 0; transform: scale(0.8); } }   /* the app shows it with the pointer; the demo has none */
.rp-att-busy { display: grid; place-items: center; width: 58px; height: 58px; border: 1px dashed var(--rp-line-strong); border-radius: 14px; color: var(--rp-accent); }
.rp-att-busy > .rp-hem-ico { --rp-ico-size: 19px; }
@media (prefers-reduced-motion: no-preference) {
  .rp-att, .rp-att-busy { animation: rp-att-in var(--rp-dur) var(--rp-ease); }
  @keyframes rp-att-in { from { opacity: 0; transform: translateY(4px) scale(0.98); } }
}

.rp-hem-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: -4px; }
.rp-hem-inputs, .rp-hem-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.rp-hem-fact { position: relative; display: flex; min-width: 0; max-width: 100%; }

.rp-hem-input, .rp-hem-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: min(280px, 100%); height: 32px; border-radius: 999px;
  background: var(--rp-on-glass); box-shadow: 0 0 0 0.5px var(--rp-line); color: var(--rp-text-2); font-size: 13px; font-weight: 550; white-space: nowrap;
}
.rp-hem-input { padding: 0 12px 0 10px; }
.rp-hem-chip { padding: 0 10px 0 12px; }
.rp-hem-input > .rp-hem-ico { color: var(--rp-text-3); }
.rp-hem-chip > .rp-hem-ico { --rp-ico-size: 14px; color: var(--rp-text-3); }
.rp-hem-input > span, .rp-hem-chip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rp-hem-chip.is-set { background: var(--rp-accent-soft); box-shadow: none; color: var(--rp-text); }
.rp-hem-chip.is-set > .rp-hem-ico { color: var(--rp-accent); }
.rp-hem-chip[aria-expanded="true"], .rp-hem-input[aria-expanded="true"] { background: var(--rp-on-glass-raised); color: var(--rp-text); }
.rp-hem-chip.is-set[aria-expanded="true"] { background: color-mix(in srgb, var(--rp-accent) 18%, white); }

.rp-hem-info { display: grid; place-items: center; flex: none; width: 36px; height: 36px; margin-left: auto; border-radius: 999px; color: var(--rp-text-2); }
.rp-hem-info > .rp-hem-ico { --rp-ico-size: 18px; }

.rp-hem-send {
  display: inline-flex; align-items: center; gap: 8px; flex: none; height: 38px; padding: 0 16px 0 18px; border-radius: 999px; white-space: nowrap;
  background: var(--rp-accent); color: var(--rp-on-accent); font-size: 14px; font-weight: 600;
  box-shadow: 0 1px 2px rgba(4, 40, 60, 0.2), 0 8px 18px -8px rgba(0, 89, 125, 0.6);
}
.rp-hem-send > .rp-hem-ico { --rp-ico-size: 16px; }
.rp-hem-send:disabled { background: rgba(6, 52, 78, 0.08); color: var(--rp-text-3); box-shadow: none; }

/* Drop: a file is over the card (add is-drop to .rp-hem-card); no dashed border, home-sky.css sets border: 0 */
.rp-hem-drop {
  position: absolute; inset: 0; z-index: 12; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border-radius: inherit; text-align: center; color: var(--rp-accent); pointer-events: none;
  background: color-mix(in srgb, var(--rp-surface) 90%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; transition: opacity 0.16s, visibility 0.16s;
}
.rp-hem-card.is-drop > .rp-hem-drop { opacity: 1; visibility: visible; }
.rp-hem-drop > .rp-hem-ico { --rp-ico-size: 26px; }
.rp-hem-drop strong { font-size: 16px; font-weight: 600; line-height: 1.45; color: var(--rp-text); }
.rp-hem-drop span { font-size: 13px; line-height: 1.45; color: var(--rp-text-2); }
@media (prefers-reduced-motion: reduce) { .rp-hem-drop { transition: none; } }

/* Tidigare prov: the list under the card (HomeSourcePicker) */
.rp-hem-picker {
  position: absolute; z-index: 40; top: calc(100% + 8px); left: 14px; width: min(460px, calc(100% - 28px)); display: grid; gap: 4px; padding: 8px;
  border: 1px solid var(--rp-glass-edge); border-radius: 14px; background: var(--rp-glass-solid); box-shadow: var(--rp-glass-shadow-pop); color: var(--rp-text);
}
.rp-hem-picker-search { position: relative; display: block; }
.rp-hem-picker-search > .rp-hem-ico { --rp-ico-size: 15px; position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--rp-text-3); }
.rp-hem-picker-field {
  display: flex; align-items: center; height: 38px; padding: 0 12px 0 34px; border: 1px solid var(--rp-line-strong); border-radius: 10px;
  background: var(--rp-surface); font-size: 14px; color: var(--rp-text-3);
}
.rp-hem-picker-field.is-focus { border-color: var(--rp-accent-line); box-shadow: var(--rp-focus-ring); }
.rp-hem-picker-list { max-height: 280px; padding: 2px 0 0; overflow: hidden; }
.rp-hem-picker-option { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 6px 8px; border-radius: 8px; }
.rp-hem-picker-option.is-active { background: var(--rp-fill); }
.rp-hem-picker-option[aria-selected="true"] { background: var(--rp-accent-soft); }
.rp-hem-picker-check { display: grid; place-items: center; flex: none; width: 18px; color: var(--rp-accent); }
.rp-hem-picker-check > .rp-hem-ico { --rp-ico-size: 14px; }
.rp-hem-picker-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 550; }
.rp-hem-picker-count { flex: none; font-size: 12px; color: var(--rp-text-3); }

.rp-hem-menu {
  position: absolute; z-index: 40; top: calc(100% + 5px); left: 0; width: max-content; min-width: 200px; max-width: min(340px, calc(100cqw - 24px)); padding: 5px;
  border: 1px solid var(--rp-glass-edge); border-radius: 14px; background: var(--rp-glass-solid); box-shadow: var(--rp-glass-shadow-pop); color: var(--rp-text);
}
.rp-hem-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border-radius: 7px; font-size: 13.5px; text-align: left; }
.rp-hem-menu-item > .rp-hem-ico { --rp-ico-size: 16px; }
.rp-hem-menu-item:not([aria-checked="true"]) > .rp-hem-ico { visibility: hidden; }
.rp-hem-menu-sep { height: 1px; margin: 5px 6px; background: var(--rp-line); }

.rp-hem-pop, .rp-plan-pop {
  position: absolute; z-index: 60; top: calc(100% + var(--rp-pop-gap, 8px)); left: 0; width: 360px; display: grid; gap: 8px; padding: 14px 16px;
  border: 1px solid var(--rp-glass-edge); border-radius: var(--rp-card-radius); background: var(--rp-glass-pop); box-shadow: var(--rp-float-shadow); color: var(--rp-text);
  -webkit-backdrop-filter: var(--rp-glass-blur); backdrop-filter: var(--rp-glass-blur);
}
.rp-hem-pop { gap: 4px; }
.rp-hem-pop-search { position: relative; display: block; }
.rp-hem-pop-search > .rp-hem-ico { --rp-ico-size: 15px; position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--rp-text-3); }
.rp-hem-pop-field {
  display: flex; align-items: center; height: 38px; padding: 0 12px 0 34px; border: 1px solid var(--rp-line-strong); border-radius: 10px;
  background: var(--rp-surface); font-size: 14px; color: var(--rp-text-3);
}
.rp-hem-pop-field.is-focus { border-color: var(--rp-accent-line); box-shadow: var(--rp-focus-ring); }
.rp-hem-pop-list, .rp-plan-pop-list { max-height: 280px; padding: 2px 0 0; overflow: hidden; }
.rp-hem-opt, .rp-plan-opt { display: flex; align-items: flex-start; gap: 8px; min-height: 38px; padding: 8px; border-radius: 8px; }
.rp-hem-opt.is-active, .rp-plan-opt.is-active { background: var(--rp-fill); }
.rp-hem-opt[aria-selected="true"], .rp-plan-opt[aria-selected="true"] { background: var(--rp-accent-soft); }
.rp-hem-opt-check, .rp-plan-opt-check { display: grid; place-items: center; flex: none; width: 18px; height: 20px; color: var(--rp-accent); }
.rp-hem-opt-check > .rp-hem-ico, .rp-plan-opt-check > .rp-plan-ico { --rp-ico-size: 14px; }
.rp-hem-opt-text, .rp-plan-opt-text { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 13.5px; font-weight: 500; line-height: 1.4; }
.rp-plan-pop-foot { display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 2px 4px 0; }

/* Hem library (HomeRecent.tsx, LibraryView.tsx, library.css): static, the last child of .rp-hem-band */
.rp-hem-library {
  position: relative; display: grid; gap: 40px; min-width: 0; margin: 48px 0 24px; padding: 36px 36px 40px; border-radius: 34px; color: var(--rp-text);
  background: var(--rp-glass-thick); -webkit-backdrop-filter: var(--rp-glass-blur-calm); backdrop-filter: var(--rp-glass-blur-calm); box-shadow: var(--rp-glass-shadow);
}
.rp-hem-library::before {
  content: ''; position: absolute; inset: 0; padding: 1px; border-radius: inherit; pointer-events: none; background: var(--rp-glass-rim);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.rp-hem-library > * { min-width: 0; }
.rp-hem-library .rp-i { color: var(--rp-text-3); }
/* The Ämne list is solid: the card's glass would show the sheet's text (the app's top layer blurs the sheet) */
.rp-hem-band .rp-hem-pop { background: var(--rp-glass-solid); }

.rp-hem-recent { container: rp-hem-recent / inline-size; display: grid; gap: 14px; }
.rp-hem-recent-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.rp-hem-recent-title { font-size: 18px; font-weight: 650; letter-spacing: -0.015em; line-height: 1.25; }
.rp-hem-recent-hint { font-size: 13px; color: var(--rp-text-3); }
.rp-hem-recent-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.rp-hem-recent-item { display: grid; gap: 2px; min-width: 0; align-content: start; }
.rp-hem-recent-tile {
  container-type: inline-size; position: relative; display: block; aspect-ratio: 4 / 3; margin-bottom: 8px; overflow: hidden;
  border: 1px solid var(--rp-line); border-radius: 12px; background: var(--rp-desk);
}
.rp-hem-recent-name, .rp-hem-recent-detail { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-hem-recent-name { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; }
.rp-hem-recent-detail { font-size: 12.5px; color: var(--rp-text-3); line-height: 1.35; }
.rp-hem-recent-tag {
  position: absolute; left: 8px; bottom: 8px; z-index: 1; display: inline-flex; align-items: center; gap: 5px; max-width: calc(100% - 16px);
  height: 22px; padding: 0 9px 0 7px; border-radius: var(--rp-pill-radius); background: var(--rp-accent); color: var(--rp-on-accent);
  font-size: 11.5px; font-weight: 600; white-space: nowrap; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.rp-hem-recent-tag::before {
  content: ''; flex: none; width: 11px; height: 11px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.rp-hem-paper {
  position: absolute; inset: 12px 13% 0; display: flex; flex-direction: column; gap: 3.2cqw; overflow: hidden;
  padding: 5cqw 5.5cqw 0; border-radius: 3px 3px 0 0; background: #fff; color: #1d1d1f; box-shadow: var(--rp-shadow-paper);
  font: max(5px, 3cqw) / 1.3 "Latin Modern Roman", "Times New Roman", Georgia, serif;
}
.rp-hem-paper-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 1.1em; font-weight: 700; line-height: 1.2; }
.rp-hem-paper-meta { display: flex; gap: 6cqw; color: #55555a; font-size: 0.85em; }
.rp-hem-paper-meta > span { flex: 1; border-bottom: 0.5px solid #9a9aa0; }
.rp-hem-paper-task { display: grid; grid-template-columns: 1.5em minmax(0, 1fr); gap: 0.2em; }
.rp-hem-paper-task > span:first-child { font-weight: 700; }
.rp-hem-paper-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
@container rp-hem-recent (max-width: 780px) {
  .rp-hem-recent-row { display: flex; gap: 12px; overflow: hidden; }
  .rp-hem-recent-item { flex: 0 0 min(168px, 44cqw); }
  .rp-hem-recent-detail { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; }
  .rp-hem-recent-hint { display: none; }
}

.rp-hem-all { container: rp-hem-all / inline-size; position: relative; }
.rp-hem-all-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding-bottom: 16px; }
.rp-hem-all-title { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; }
.rp-hem-all-search { display: flex; align-items: center; gap: 8px; flex: 1 1 280px; max-width: 520px; min-width: 0; }
.rp-hem-all-field {
  position: relative; display: flex; align-items: center; flex: 1; min-width: 0; height: 38px; padding: 0 14px 0 36px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  border: 1px solid var(--rp-line-strong); border-radius: var(--rp-pill-radius); background: var(--rp-surface); font-size: 14px; color: var(--rp-text-3);
}
.rp-hem-all-field > .rp-i { position: absolute; left: 12px; top: 50%; margin-top: -8px; }
.rp-lib-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none; height: 32px; padding: 0 12px; border: 1px solid var(--rp-line-strong); border-radius: 8px;
  background: var(--rp-surface); font-size: 13px; font-weight: 500; white-space: nowrap; color: var(--rp-text);
}
.rp-lib-btn.is-primary { background: var(--rp-accent); border-color: transparent; color: var(--rp-on-accent); }
.rp-hem-all-search .rp-lib-btn { height: 38px; padding: 0 16px; border-radius: var(--rp-pill-radius); }
.rp-lib-btn > .rp-i { color: var(--rp-text-2); }

.rp-hem-all-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; padding-bottom: 8px; }
.rp-hem-all-toggle { display: none; }
.rp-hem-all-nav { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rp-hem-all-views { display: grid; gap: 2px; margin-bottom: 14px; }
.rp-hem-all-view, .rp-hem-all-add {
  position: relative; display: flex; align-items: center; gap: 9px; min-height: 34px; padding: 6px 10px; border-radius: 10px; color: var(--rp-text-2); font-size: 13.5px; overflow-wrap: anywhere;
}
.rp-hem-all-view.is-current { background: var(--rp-surface); color: var(--rp-text); font-weight: 600; box-shadow: var(--rp-shadow-soft); }
.rp-hem-all-view.is-current::before { content: ''; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--rp-accent); }
.rp-hem-all-view.is-current > .rp-i { color: var(--rp-accent); }
.rp-hem-all-label { padding: 0 10px; font-size: 12px; font-weight: 600; color: var(--rp-text-3); }
.rp-hem-all-add { gap: 7px; width: fit-content; min-height: 32px; margin-top: 2px; padding: 4px 10px; border-radius: 9px; color: var(--rp-accent); font-size: 13px; font-weight: 550; }
.rp-hem-all-add > .rp-i { color: var(--rp-accent); }
.rp-hem-all-none { padding: 2px 10px; font-size: 12.5px; color: var(--rp-text-3); }
.rp-hem-all-labels { display: grid; gap: 2px; margin-top: 16px; }

.rp-hem-all-main { min-width: 0; }
.rp-hem-all-location { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; margin-bottom: 14px; }
.rp-hem-all-where { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; min-width: 0; }
.rp-hem-all-name { font-size: 16px; font-weight: 620; letter-spacing: -0.02em; }
.rp-hem-all-count {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--rp-pill-radius); background: var(--rp-fill); color: var(--rp-text-2);
  font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums;
}
.rp-hem-all-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.rp-hem-all-compact { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--rp-text-2); }
.rp-hem-all-select {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; height: 32px; padding: 0 14px 0 10px; border: 1px solid var(--rp-line-strong); border-radius: 8px;
  background: var(--rp-surface); font-size: 13.5px; font-weight: 400; white-space: nowrap; color: var(--rp-text);
}
.rp-hem-all-seg { display: inline-flex; padding: 2px; border-radius: 10px; background: var(--rp-fill); }
.rp-hem-all-seg > span { display: grid; place-items: center; width: 30px; height: 28px; border-radius: 8px; color: var(--rp-text-2); }
.rp-hem-all-seg > .is-on { background: var(--rp-surface); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); }
.rp-hem-all-seg > .is-on > .rp-i { color: var(--rp-text); }
.rp-hem-all-refresh { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 8px; }

.rp-hem-all-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 264px), 1fr)); gap: 14px; }
.rp-hem-all-card {
  position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 176px; padding: 16px;
  border: 1px solid var(--rp-line); border-radius: var(--rp-card-radius); background: var(--rp-surface); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.rp-hem-all-pick { position: absolute; top: 8px; left: 8px; display: grid; place-items: center; width: 32px; height: 32px; }
.rp-hem-all-pick::before { content: ''; width: 18px; height: 18px; border: 1.5px solid var(--rp-text-3); border-radius: 4px; background: rgba(255, 255, 255, 0.9); }
.rp-hem-all-card-main { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.rp-hem-all-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-left: 30px; }
.rp-hem-all-card-top time { font-size: 12px; color: var(--rp-text-3); white-space: nowrap; }
.rp-hem-all-kind { display: inline-flex; align-items: center; gap: 5px; min-width: 0; font-size: 12px; font-weight: 600; color: var(--rp-text-2); }
.rp-hem-all-kind > .rp-i { color: var(--rp-accent); }
.rp-hem-all-card-title { margin-top: 2px; font-size: 15.5px; font-weight: 620; letter-spacing: -0.01em; line-height: 1.3; overflow-wrap: anywhere; }
.rp-hem-all-details { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; font-size: 12px; overflow-wrap: anywhere; }
.rp-hem-all-details > li { padding: 2px 8px; border-radius: var(--rp-pill-radius); background: var(--rp-fill); color: var(--rp-text-2); }
.rp-hem-all-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.rp-hem-all-actions > .rp-hem-all-more { margin-left: auto; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--rp-text-2); }

/* No prov: the library's empty state, the only message on Hem */
.rp-hem-all-empty {
  display: grid; justify-items: center; gap: 6px; padding: 48px 20px; text-align: center; border-radius: var(--rp-card-radius);
  background: var(--rp-surface); border: 1px dashed var(--rp-line-strong); color: var(--rp-text-2);
}
.rp-hem-all-empty-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; margin-bottom: 6px; border-radius: 16px; background: var(--rp-accent-soft); color: var(--rp-accent); }
.rp-hem-all-empty-icon > .rp-i { color: var(--rp-accent); }
.rp-hem-all-empty-title { font-size: 16px; font-weight: 700; color: var(--rp-text); }
.rp-hem-all-empty-text { max-width: 46ch; margin-bottom: 10px; font-size: 13px; line-height: 1.5; }

/* Below 760px of its own width: one column, the folders behind a button */
@container rp-hem-all (max-width: 760px) {
  .rp-hem-all-body { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
  .rp-hem-all-nav { display: none; }
  .rp-hem-all-toggle {
    display: flex; align-items: center; gap: 9px; width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--rp-line); border-radius: 12px; background: var(--rp-surface);
    font-size: 13px; font-weight: 500; color: var(--rp-text);
  }
  .rp-hem-all-toggle > small { margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--rp-text-3); font-size: 12px; font-weight: 400; }
  .rp-hem-all-location { align-items: flex-start; }
  .rp-hem-all-tools { width: 100%; }
  .rp-hem-all-compact { flex: 1 1 120px; }
  .rp-hem-all-compact > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .rp-hem-all-compact .rp-hem-all-select { width: 100%; }
  .rp-hem-all-card { min-height: 0; }
}
/* Phone Hem (max-width: 640px): the sheet reaches the window's edges */
@container rp (max-width: 640px) {
  .rp-hem-library { gap: 28px; margin: 32px -16px 0; padding: 26px 16px 32px; border-radius: 28px 28px 0 0; }
}

/* PLAN (PlanWaiting.tsx, CreatePlanView.tsx, plan-view.css, new-exam-settings.css): two cards in one band */
.rp-plan-band { padding: var(--rp-plan-top, 44px) 24px 8px; }
.rp-plan-band-inner { max-width: 760px; margin: 0 auto; }

.rp-plan {
  --rp-plan-pad: 22px; --rp-plan-label: 112px; --rp-control: 38px;
  display: grid; gap: 16px; padding: 20px var(--rp-plan-pad) 0; color: var(--rp-text);
}
.rp-plan > * { min-width: 0; }
.rp-plan-title { font-size: 20px; font-weight: 650; letter-spacing: -0.015em; line-height: 1.45; }

.rp-plan-waiting { display: flex; align-items: center; gap: 10px; color: var(--rp-text-2); font-size: 14.5px; }
.rp-plan-waiting > .rp-plan-ico { --rp-ico-size: 16px; }

/* The buttons bar: nearly solid glass, flush with the card's edges */
.rp-plan-actions {
  position: relative; z-index: 3; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin: 0 calc(-1 * var(--rp-plan-pad)); padding: 12px var(--rp-plan-pad) 16px;
  border-top: 1px solid var(--rp-line); border-radius: 0 0 30px 30px; background: var(--rp-glass-pop);
}
.rp-plan-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border: 1px solid var(--rp-line-strong); border-radius: 8px;
  background: var(--rp-surface); font-size: 14px; font-weight: 500; white-space: nowrap; color: var(--rp-text);
}
.rp-plan-btn > .rp-plan-ico { --rp-ico-size: 15px; }
.rp-plan-btn.is-primary { gap: 8px; margin-left: auto; border-color: transparent; background: var(--rp-accent); color: var(--rp-on-accent); font-weight: 600; }
.rp-plan-btn.is-primary > .rp-plan-ico { --rp-ico-size: 16px; }
.rp-plan-btn.is-primary[aria-disabled="true"] { background: var(--rp-fill-hover); color: var(--rp-text-3); }
.rp-plan-lack { flex: 1 1 100%; font-size: 13px; color: var(--rp-text-2); }

.rp-plan-name-box { position: relative; }
/* Line-height = inner height: text-overflow only cuts block containers (phone names end in …) */
.rp-plan-name-input {
  display: block; width: 100%; height: 52px; padding: 0 46px 0 16px; border: 1px solid var(--rp-line-strong); border-radius: 14px; background: var(--rp-surface);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 20px; font-weight: 650; line-height: 50px; letter-spacing: -0.015em; color: var(--rp-text);
}
.rp-plan-name-input:empty::before { font-weight: 500; }
/* is-focus while a timeline types into the name or the plan (plan-view.css :focus-visible) */
.rp-plan-name-input.is-focus, .rp-plan-written-text.is-focus { border-color: var(--rp-accent-line); box-shadow: var(--rp-focus-ring); }
.rp-plan-name-box > .rp-plan-ico { --rp-ico-size: 16px; position: absolute; top: 50%; right: 16px; transform: translateY(-50%); color: var(--rp-text-3); }

.rp-plan-note { padding: 10px 14px; border-radius: 10px; background: var(--rp-warn-soft); color: var(--rp-warn); font-size: 13px; line-height: 1.45; text-wrap: pretty; }
.rp-plan-summary { max-width: 62ch; font-size: 15.5px; line-height: 1.5; color: var(--rp-text); white-space: pre-line; text-wrap: pretty; }

.rp-plan-rows { display: grid; gap: 12px; }
.rp-plan-row { position: relative; display: grid; grid-template-columns: var(--rp-plan-label) minmax(0, 1fr); align-items: center; gap: 6px 16px; min-width: 0; min-height: var(--rp-control); }
.rp-plan-row-label { font-size: 14px; font-weight: 600; color: var(--rp-text-2); }
.rp-plan-control { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
.rp-plan-needed { font-size: 13px; font-weight: 600; color: var(--rp-warn); }
.rp-plan-scope { min-width: 0; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }

.rp-plan-picker { position: relative; flex: 0 1 15rem; min-width: min(100%, 11rem); }
.rp-plan-field {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; height: var(--rp-control); padding: 0 12px; border-radius: 10px;
  background: var(--rp-fill); font-size: 14px; font-weight: 500; color: var(--rp-text);
}
.rp-plan-field > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-plan-field > .rp-plan-ico { --rp-ico-size: 14px; color: var(--rp-text-3); }
.rp-plan-field.is-empty > span { color: var(--rp-text-3); }
.rp-plan-field[aria-expanded="true"] { background: var(--rp-fill-hover); }
.rp-plan-row.is-needed .rp-plan-field { box-shadow: inset 0 0 0 1.5px var(--rp-accent-line); }

.rp-plan-stepper { display: flex; align-items: center; width: max-content; max-width: 100%; height: var(--rp-control); border-radius: 10px; background: var(--rp-fill); }
.rp-plan-stepper-value { width: 68px; text-align: center; font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
.rp-plan-step { display: grid; place-items: center; flex: none; width: var(--rp-control); height: var(--rp-control); border-radius: 10px; color: var(--rp-text-2); }
.rp-plan-step > .rp-plan-ico { --rp-ico-size: 15px; }
.rp-plan-step[aria-disabled="true"] { opacity: 0.4; }

.rp-plan-seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; padding: 3px; border-radius: 9px; background: var(--rp-fill); }
.rp-plan-seg > button {
  display: inline-flex; align-items: center; gap: 6px; height: calc(var(--rp-control) - 6px); padding: 0 14px; border-radius: 7px; font-size: 14px; font-weight: 500; color: var(--rp-text-2);
  transition: background-color 0.18s, color 0.18s, box-shadow 0.18s;
}
.rp-plan-seg > button[aria-checked="true"] { background: var(--rp-surface-raised); color: var(--rp-text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18), 0 0 0 0.5px var(--rp-line); }

.rp-plan-anchor { position: relative; display: inline-flex; }
.rp-plan-link { min-height: var(--rp-control); font-size: 14px; font-weight: 600; color: var(--rp-accent-hover); }

.rp-plan-written { display: grid; gap: 6px; min-width: 0; }
.rp-plan-written-label { font-size: 14px; font-weight: 600; }
.rp-plan-hint { font-size: 13px; line-height: 1.45; color: var(--rp-text-2); text-wrap: pretty; }
.rp-plan-written-box { position: relative; }
.rp-plan-written-text {
  display: block; width: 100%; min-height: 9.5em; max-height: 26em; padding: 10px 12px; border: 1px solid var(--rp-line-strong); border-radius: 10px; background: var(--rp-surface);
  overflow: hidden; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; color: var(--rp-text);
}
.rp-plan-line { display: block; }
.rp-plan-written-box::after {
  content: ''; position: absolute; right: 3px; bottom: 3px; width: 9px; height: 9px; pointer-events: none; color: var(--rp-text-3);
  background: linear-gradient(135deg, transparent 0 46%, currentColor 46% 54%, transparent 54% 68%, currentColor 68% 76%, transparent 76%);
}
.rp-plan-written-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 4px 12px; min-width: 0; }
.rp-plan-outdated { flex: 1 1 auto; min-width: 0; color: var(--rp-warn); }
.rp-plan-counter { margin-left: auto; flex: none; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--rp-text-3); }

.rp-plan-fold { border-top: 1px solid var(--rp-line); }
.rp-plan-fold-head { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 2px; font-size: 14px; font-weight: 600; }
.rp-plan-fold-head > .rp-plan-ico { --rp-ico-size: 16px; color: var(--rp-text-3); }
.rp-plan-fold-count { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 450; color: var(--rp-text-3); }

.rp-plan-pop { --rp-pop-gap: 9px; }

@container rp (max-width: 920px) {
  .rp-hem-fact:has(> .rp-hem-pop) { position: static; }
  .rp-hem-pop { top: calc(100% - 9px); left: auto; right: -12px; }
  .rp-plan-anchor { position: static; }
  .rp-plan-pop { left: auto; right: calc(-1 * var(--rp-plan-pad) - 12px); }
}

/* PHONE (the app's max-width: 640px, here the stage's width) */
@container rp (max-width: 640px) {
  .rp-hem-band { padding: 32px 16px 4px; }
  .rp-hem-title { font-size: 30px; }
  .rp-hem-card, .rp-plan { border-radius: 26px; }
  .rp-hem-prompt { padding-left: 16px; padding-right: 10px; }
  .rp-hem-attachments { flex-wrap: nowrap; overflow-x: auto; margin: -12px -10px 0 0; padding: 12px 10px 4px 0; scrollbar-width: none; }   /* one row that scrolls sideways; the padding keeps the corner buttons inside it */
  .rp-hem-attachments::-webkit-scrollbar { display: none; }
  .rp-att { max-width: 240px; }
  .rp-hem-chips { padding: 12px 12px 0; }
  .rp-hem-source-label { max-width: 220px; }
  .rp-hem-inputs { flex-basis: 100%; }
  .rp-hem-input { height: 36px; gap: 5px; padding: 0 10px 0 9px; }
  .rp-hem-chip { height: 36px; }
  /* Lists as wide as the window (12px/16px from its edges) */
  .rp-hem-fact:has(> .rp-hem-pop) { position: static; }
  .rp-hem-pop { top: calc(100% - 7px); left: 0; right: 0; width: auto; }
  .rp-hem-picker { left: 8px; right: 8px; width: auto; }
  .rp-hem-opt, .rp-plan-opt { min-height: 44px; }

  .rp-plan-band { padding: var(--rp-plan-top, 44px) 16px 4px; }
  .rp-plan { --rp-plan-pad: 16px; --rp-control: 40px; gap: 14px; padding-top: 16px; }
  .rp-plan-title { font-size: 19px; }
  .rp-plan-summary { font-size: 15px; }
  .rp-plan-name-input { height: 48px; font-size: 18px; line-height: 46px; }
  .rp-plan-rows { gap: 16px; }
  .rp-plan-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .rp-plan-picker { flex: 1 1 11rem; }
  .rp-plan-seg { display: flex; width: 100%; }
  .rp-plan-seg > button { flex: 1 1 auto; justify-content: center; padding: 0 8px; }
  .rp-plan-btn.is-primary { flex: 1 1 0; }
  /* The Områden list opens above its row, as wide as the card */
  .rp-plan-anchor { position: static; }
  .rp-plan-pop { top: auto; bottom: calc(100% + 9px); left: calc(-1 * var(--rp-plan-pad)); right: calc(-1 * var(--rp-plan-pad)); width: auto; }
}

/* v4 plan (plan-view.css, PlanWaiting.tsx, PlanDock.tsx): .is-v2 puts the buttons in the card's head and the AI box at the foot of the band; the old markup keeps its rules above */
[data-rp-ico="external-link"] { --rp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6'/%3E%3Cpath d='M10 14 21 3'/%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3C/svg%3E"); }
.rp-plan-band.is-stage { display: flex; flex-direction: column; min-height: 100%; padding-bottom: 0; }
.rp-plan-band.is-stage > .rp-plan-band-inner { flex: 1 0 auto; display: flex; flex-direction: column; gap: 20px; width: 100%; }
.rp-plan.is-v2 { padding-bottom: var(--rp-plan-pad); }
.rp-plan-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; }
.rp-plan-head > .rp-plan-title { margin-right: auto; font-size: 15px; font-weight: 600; letter-spacing: 0; color: var(--rp-text-2); }
.rp-plan-head-actions { display: flex; align-items: center; gap: 8px; }
.rp-plan-head .rp-plan-btn { height: 36px; padding: 0 14px; font-size: 14px; }
.rp-plan-head .rp-plan-back { gap: 6px; border-color: transparent; background: transparent; color: var(--rp-text-2); }
.rp-plan-head .rp-plan-btn.is-primary { margin-left: 0; padding: 0 20px; font-weight: 600; }
.rp-plan-status { display: grid; gap: 10px; }
.rp-plan-status:empty { display: none; }
.rp-plan-body { display: grid; gap: 16px; }
.rp-plan-body > * { min-width: 0; }
/* A change of the plan runs: everything under the head is inert and at 60 % (.plan-body[inert]) */
.rp-plan-body.is-working { opacity: 0.6; }
/* The name is the card's title, set as one: no box until it has the keyboard (the pencil stays) */
.rp-plan.is-v2 .rp-plan-name-box { margin: 0 -10px; }
.rp-plan.is-v2 .rp-plan-name-input { height: 45px; padding: 4px 40px 4px 10px; border-color: transparent; border-radius: 12px; background: transparent; font-size: 28px; font-weight: 680; line-height: 35px; letter-spacing: -0.024em; }
.rp-plan.is-v2 .rp-plan-name-input:empty::before { font-weight: 600; }
.rp-plan.is-v2 .rp-plan-name-input.is-focus { background: var(--rp-surface); }
.rp-plan.is-v2 .rp-plan-name-box > .rp-plan-ico { right: 14px; opacity: 0.55; }
/* The description: prose to read, Redigera beside its label; it glows 1.6 s (.is-new) when the AI box has changed it */
.rp-plan.is-v2 .rp-plan-written { gap: 8px; }
/* The foot (the outdated line, the counter) is there only while one of them shows */
.rp-plan.is-v2 .rp-plan-written-foot:not(:has(> :not([hidden]))) { display: none; }
.rp-plan-written-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rp-plan-edit { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--rp-accent); }
.rp-plan-edit > .rp-plan-ico { --rp-ico-size: 13px; }
.rp-plan-written-read { margin: 0 -8px; max-width: 68ch; padding: 4px 8px; border-radius: 10px; font-size: 15.5px; line-height: 1.55; white-space: pre-line; text-wrap: pretty; overflow-wrap: anywhere; transition: background-color 0.9s var(--rp-ease); }
.rp-plan-written-read.is-new { background: var(--rp-accent-soft); transition-duration: 0.2s; }
.rp-plan-kursplan { min-width: 0; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.rp-plan-link.is-ext { display: inline-flex; align-items: center; gap: 6px; text-decoration: underline; text-underline-offset: 2px; }
.rp-plan-link.is-ext > .rp-plan-ico { --rp-ico-size: 14px; }

/* The AI box of the plan step, held at the bottom of the band: the kit's .rp-assistant in a sticky host (global-assistant.css .ai-dock, plan-view.css .plan-dock-host) */
.rp-plan-dock { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: center; margin-top: auto; padding: 8px 0 14px; pointer-events: none; }
.rp-plan-dock > .rp-assistant { pointer-events: auto; }
/* No keyboard in the box, so no focus ring: .is-focus draws it */
.rp-plan-dock > .rp-assistant[data-state]:not(.is-focus) { box-shadow: var(--rp-float-shadow); }
.rp-plan-dock .rp-plan-sent { align-self: flex-end; max-width: 92%; }
.rp-plan-sent p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* Something runs: the box cannot send, only stop */
.rp-plan-dock .rp-assistant.is-busy .rp-add { opacity: 0.45; }
.rp-plan-dock .rp-assistant.is-busy .rp-ta.is-empty { opacity: 0.7; }
.rp-plan-dock .rp-assistant.is-busy .rp-send.is-stop { opacity: 0.6; }

/* While the plan is made (PlanWaiting): the teacher's words come into focus one by one, a light moves through them, the plan takes form under them */
.rp-plan-reading { margin: 4px 0 0; max-width: 34ch; font-size: clamp(21px, 2.3cqw, 26px); font-weight: 560; line-height: 1.3; letter-spacing: -0.02em; color: var(--rp-text); text-wrap: balance; overflow-wrap: anywhere; }
.rp-plan-forming { display: grid; gap: 10px; padding-top: 6px; }
.rp-plan-forming-label { font-size: 14px; font-weight: 600; color: var(--rp-text-3); }
.rp-plan-ink-lines { display: grid; gap: 9px; margin-bottom: 14px; }
.rp-plan-ink { display: block; height: 11px; border-radius: 6px; background: var(--rp-fill-hover); transform-origin: left center; }
.rp-plan-forming-rows { display: grid; gap: 12px; }
.rp-plan-forming-row { display: grid; grid-template-columns: var(--rp-plan-label) minmax(0, 240px); align-items: center; gap: 16px; }
.rp-plan-forming-value { height: var(--rp-control); border-radius: 10px; background: var(--rp-fill); }
@keyframes rp-plan-read { to { opacity: 1; filter: blur(0); } }
@keyframes rp-plan-think { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes rp-plan-ink { 0% { transform: scaleX(0); opacity: 1; } 30%, 78% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
@keyframes rp-plan-breathe { 50% { opacity: 0.55; } }
@keyframes rp-plan-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes rp-plan-unveil { from { -webkit-mask-position: 0 100%; mask-position: 0 100%; } to { -webkit-mask-position: 0 0; mask-position: 0 0; } }
@media (prefers-reduced-motion: no-preference) {
  .rp-plan-reading span { opacity: 0.22; filter: blur(3px); animation: rp-plan-read 0.7s calc(0.35s + var(--i) * 75ms) cubic-bezier(0.32, 0.72, 0, 1) forwards; }
  .rp-plan-reading {
    background: linear-gradient(100deg, var(--rp-text) 40%, var(--rp-text-3) 50%, var(--rp-text) 60%) 100% 0 / 260% 100% no-repeat; -webkit-background-clip: text; background-clip: text;
    color: transparent; animation: rp-plan-think 2.8s calc(1.1s + var(--n) * 75ms) cubic-bezier(0.45, 0, 0.55, 1) infinite;
  }
  .rp-plan-forming { animation: rp-plan-in 0.7s calc(0.5s + var(--n) * 40ms) cubic-bezier(0.32, 0.72, 0, 1) backwards; }
  .rp-plan-ink { animation: rp-plan-ink 3.2s calc(1s + var(--i) * 0.42s) cubic-bezier(0.32, 0.72, 0, 1) infinite backwards; }
  .rp-plan-forming-value { animation: rp-plan-breathe 2.4s calc(var(--i) * 0.2s) ease-in-out infinite; }
  /* The plan arrives (add .is-revealed to the card, in the final HTML too): its parts settle in top to bottom and the description is unveiled */
  .rp-plan.is-revealed .rp-plan-body > * { animation: rp-plan-in 0.55s cubic-bezier(0.32, 0.72, 0, 1) backwards; }
  .rp-plan.is-revealed .rp-plan-body > :nth-child(2) { animation-delay: 0.06s; }
  .rp-plan.is-revealed .rp-plan-body > :nth-child(3) { animation-delay: 0.12s; }
  .rp-plan.is-revealed .rp-plan-body > :nth-child(4) { animation-delay: 0.18s; }
  .rp-plan.is-revealed .rp-plan-body > :nth-child(n+5) { animation-delay: 0.24s; }
  .rp-plan.is-revealed .rp-plan-written-read {
    -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent 60%); mask-image: linear-gradient(to bottom, #000 40%, transparent 60%);
    -webkit-mask-size: 100% 260%; mask-size: 100% 260%; animation: rp-plan-unveil 1.1s 0.15s cubic-bezier(0.32, 0.72, 0, 1) both;
  }
}
@container rp (max-width: 720px) {
  .rp-plan-dock { padding: 6px 0 10px; }
  .rp-plan-dock:has(> .rp-assistant:not([data-state="idle"])) { margin-inline: -24px; padding-bottom: 0; }
}
@container rp (max-width: 640px) {
  .rp-plan-dock:has(> .rp-assistant:not([data-state="idle"])) { margin-inline: -16px; }
  .rp-plan.is-v2 .rp-plan-name-input { height: 39px; font-size: 23px; line-height: 29px; }
  .rp-plan-forming-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}

/* v4 outline panel (DocumentLoading.tsx DraftOutline): the editor side while the prov is written; .rp-doc-loading holds the head, the title and the task cards fill in */
.rp-live-pencil { flex: none; color: var(--rp-accent); animation: rp-live-pencil 1.4s ease-in-out infinite; }
@keyframes rp-live-pencil { 50% { transform: translate(1px, -1px) rotate(-6deg); } }
.rp-live-outline { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 16px; margin: -4px -6px; padding: 4px 6px 96px; overflow-x: hidden; overflow-y: auto; scrollbar-width: none; }
.rp-live-outline::-webkit-scrollbar { display: none; }
.rp-live-outline-title { margin: 0 0 4px; font-size: 22px; font-weight: 680; letter-spacing: -0.02em; line-height: 1.2; overflow-wrap: anywhere; }
.rp-live-tasks { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.rp-live-card { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 0 16px; border: 1px solid var(--rp-line); border-radius: 12px; transition: border-color 0.4s, background-color 0.4s, box-shadow 0.4s; }
.rp-live-card[data-state="writing"] { border-color: color-mix(in srgb, var(--rp-accent) 45%, var(--rp-line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rp-accent) 10%, transparent); }
.rp-live-card[data-state="done"] { background: var(--rp-surface); }
.rp-live-dot { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--rp-fill); color: var(--rp-text-3); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rp-live-dot .rp-i use { stroke-width: 2.6; }
/* One card for all three states: the number or the check, the grey bar or the text, by data-state */
.rp-live-dot > .rp-i { display: none; }
.rp-live-card[data-state="done"] .rp-live-dot > .rp-i { display: block; }
.rp-live-card[data-state="done"] .rp-live-dot-n { display: none; }
.rp-live-card[data-state="waiting"] .rp-live-card-text, .rp-live-card:not([data-state="waiting"]) .rp-live-card-bar { display: none; }
.rp-live-card[data-state="writing"] .rp-live-dot { background: color-mix(in srgb, var(--rp-accent) 14%, transparent); color: var(--rp-accent); }
.rp-live-card[data-state="done"] .rp-live-dot { background: var(--rp-accent); color: var(--rp-on-accent); }
.rp-live-card-text { flex: 1 1 auto; min-width: 0; margin: 10px 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; line-height: 1.4; color: var(--rp-text); }
.rp-live-card[data-state="writing"] .rp-live-card-text { color: var(--rp-text-2); }
.rp-live-card-bar { display: block; flex: 0 1 62%; height: 12px; border-radius: 99px; background: var(--rp-fill); animation: rp-shimmer 1.6s ease-in-out infinite; }
.rp-live-card:nth-child(2) .rp-live-card-bar { flex-basis: 48%; }
.rp-live-card:nth-child(3) .rp-live-card-bar { flex-basis: 70%; }
@container rp (max-width: 760px) { .rp-live-card { padding: 0 14px; } }

/* v4 change review (ChangeReview.tsx, ReviewCard.tsx, change-review.css): "Visa ändringar" replaces the editor pane's list; one card per change with its own Ångra */
.rp-review { --rp-ins-bg: color-mix(in srgb, var(--rp-ok) 16%, transparent); --rp-del-bg: color-mix(in srgb, var(--rp-danger) 14%, transparent); container: rp-review / inline-size; flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.rp-review-list { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; scrollbar-width: none; padding-bottom: 96px; }
.rp-review-list::-webkit-scrollbar { display: none; }
.rp-review-head { position: sticky; top: 0; z-index: 2; background: var(--rp-glass-solid); border-bottom: 1px solid var(--rp-line); }
.rp-review-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "text done" "modes all"; align-items: center; gap: 10px; max-width: 660px; margin: 0 auto; padding: 14px 20px 12px; }
.rp-review-top-text { grid-area: text; min-width: 0; }
.rp-review-modes { grid-area: modes; justify-self: start; display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--rp-pill-radius); background: var(--rp-fill); }
.rp-review-mode { display: inline-flex; align-items: center; justify-content: center; height: 28px; padding: 0 13px; border-radius: var(--rp-pill-radius); font-size: 13px; font-weight: 550; color: var(--rp-text-2); white-space: nowrap; }
.rp-review-mode.is-on { background: var(--rp-surface-raised); color: var(--rp-text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18), 0 0 0 0.5px var(--rp-line); }
.rp-review-top .rp-review-all { grid-area: all; justify-self: end; }
.rp-review-done { grid-area: done; justify-self: end; }
.rp-review-title { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.3; }
.rp-review-title .rp-i { color: var(--rp-accent); }
.rp-review-summary { margin: 3px 0 0; color: var(--rp-text-3); font-size: 12.5px; line-height: 1.4; text-wrap: pretty; }
.rp-review-all, .rp-review-done, .rp-review-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none; border-radius: var(--rp-pill-radius); font-size: 13px; font-weight: 600; white-space: nowrap; }
.rp-review-all, .rp-review-toggle { height: 30px; padding: 0 14px; background: var(--rp-fill); color: var(--rp-text); }
.rp-review-done { height: 32px; padding: 0 16px; background: var(--rp-accent); color: var(--rp-on-accent); }
.rp-review-all.is-redo, .rp-review-toggle.is-redo { background: var(--rp-accent-soft); color: var(--rp-accent); }
.rp-review-end { display: none; }
.rp-review-sheet { max-width: 660px; margin: 0 auto; padding: 18px 20px 24px; }
.rp-review-doc-title { margin: 2px 0 14px; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; overflow-wrap: anywhere; }
.rp-review-rows { display: flex; flex-direction: column; gap: 8px; }
.rp-review-quiet { display: flex; align-items: center; gap: 12px; padding: 5px 18px; color: var(--rp-text-3); font-size: 13px; }
.rp-review-quiet-number { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--rp-fill); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rp-review-quiet-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-review-fold { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 18px; color: var(--rp-text-3); font-size: 13px; }
.rp-review-card { --rp-review-ink: var(--rp-text-3); position: relative; border: 1px solid var(--rp-line); border-radius: var(--rp-card-radius); background: var(--rp-surface); overflow: clip; }
.rp-review-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--rp-review-tone, transparent); }
.rp-review-card:is(.is-changed, .is-moved, .is-field, .is-frame) { --rp-review-tone: var(--rp-accent); --rp-review-ink: var(--rp-accent); }
.rp-review-card.is-added { --rp-review-tone: var(--rp-ok); --rp-review-ink: var(--rp-ok); }
.rp-review-card.is-removed { --rp-review-tone: var(--rp-danger); --rp-review-ink: var(--rp-danger); }
/* Taken back: dashed edge and the background's surface, not a faded card */
.rp-review-card.is-undone { --rp-review-tone: transparent; --rp-review-ink: var(--rp-text-3); border-style: dashed; border-color: var(--rp-line-strong); background: var(--rp-surface-2); }
.rp-review-card-head { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 12px 12px 0 16px; }
.rp-review-card:not(.has-number) .rp-review-card-head { padding-left: 18px; }
.rp-review-card .rp-num { flex: none; }
.rp-review-card.is-added .rp-num { background: var(--rp-ins-bg); color: var(--rp-ok); }
.rp-review-card.is-removed .rp-num { background: var(--rp-del-bg); color: color-mix(in srgb, var(--rp-danger) 80%, var(--rp-text)); }
.rp-review-card.is-undone .rp-num { background: var(--rp-fill); color: var(--rp-text-3); }
.rp-review-card-title { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 14px; font-weight: 650; line-height: 1.3; letter-spacing: -0.005em; }
.rp-review-name { overflow-wrap: anywhere; }
.rp-review-state { color: var(--rp-review-ink); font-size: 12px; font-weight: 600; letter-spacing: 0; }
.rp-review-toggle { min-width: 96px; }
.rp-review-card-body { padding: 8px 18px 16px; font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.rp-review-card.has-number .rp-review-card-body { padding-left: 58px; }
.rp-review-card.is-undone .rp-review-card-body { color: var(--rp-text-2); }
.rp-review-text { display: flow-root; }
.rp-review-text + .rp-review-text { margin-top: 6px; }
.rp-review-mark { float: right; margin-left: 1em; font-weight: 700; color: var(--rp-text); }
.rp-review-answer { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--rp-line); font-size: 14px; }
.rp-review-answer-label { display: block; margin-bottom: 2px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.01em; color: var(--rp-text-3); }
/* Words: new ones on a soft green with a thin underline, removed ones struck in red text without a fill */
.rp-review-card ins { border-radius: 3px; padding: 0 1px; background: var(--rp-ins-bg); color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--rp-ok) 60%, transparent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.rp-review-card del { padding: 0 1px; background: none; color: color-mix(in srgb, var(--rp-danger) 78%, var(--rp-text)); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--rp-danger) 60%, transparent); text-decoration-thickness: 1.5px; }
.rp-review-card.is-undone :is(ins, del) { background: transparent; }
.rp-review-card .rp-math { background: transparent; }
/* An inline-block takes no line from its ins or del, so the chip draws its own: a green line under an added formula, a strike through a removed one (src/field-diff.css) */
.rp-review-card ins .rp-math { position: relative; }
.rp-review-card ins .rp-math::after { content: ''; position: absolute; left: -3px; right: -3px; bottom: 0; border-bottom: 1px solid var(--rp-ok); pointer-events: none; }
.rp-review-card del .rp-math { position: relative; color: inherit; }
.rp-review-card del .rp-math::after { content: ''; position: absolute; left: 0; right: 0; top: 54%; border-top: 1.5px solid color-mix(in srgb, var(--rp-danger) 60%, transparent); }
@container rp-review (min-width: 820px) {
  .rp-review-top { grid-template-columns: minmax(0, 1fr) auto auto auto; grid-template-areas: "text modes all done"; gap: 8px 10px; max-width: 720px; }
  .rp-review-sheet { max-width: 720px; }
}
@container rp-review (max-width: 459px) {
  .rp-review-top { grid-template-areas: "text done" "modes modes"; padding: 12px 16px 10px; }
  .rp-review-summary { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .rp-review-modes { justify-self: stretch; }
  .rp-review-mode { flex: 1 1 0; }
  .rp-review-top .rp-review-all { display: none; }
  .rp-review-end { display: flex; justify-content: center; margin-top: 16px; }
  .rp-review-sheet { padding: 14px 12px 24px; }
  .rp-review-card-head, .rp-review-card:not(.has-number) .rp-review-card-head { padding-left: 14px; }
  .rp-review-card-body, .rp-review-card.has-number .rp-review-card-body { padding: 8px 14px 14px; }
  .rp-review-quiet, .rp-review-fold { padding-left: 14px; padding-right: 12px; }
}

/* v4 kursplan overview (CoveragePopover.tsx, kursplan-coverage.css): the popover the pane head's Kursplan opens; the demo sets --rp-cov-x and --rp-cov-y (px in the window) */
.rp-cov {
  position: absolute; z-index: 55; top: var(--rp-cov-y, 60px); left: var(--rp-cov-x, 16px); box-sizing: border-box; width: 440px; max-width: calc(100% - 32px); max-height: calc(var(--rp-vh) - var(--rp-cov-y, 60px) - 16px);
  display: grid; gap: 16px; padding: 14px 16px; overflow: auto; scrollbar-width: none; font-size: 13px; line-height: 1.5; color: var(--rp-text);
  border: 1px solid var(--rp-glass-edge); border-radius: var(--rp-card-radius); background: var(--rp-glass-pop); -webkit-backdrop-filter: var(--rp-glass-blur); backdrop-filter: var(--rp-glass-blur); box-shadow: var(--rp-float-shadow);
}
.rp-cov::-webkit-scrollbar { display: none; }
.rp-cov-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rp-cov-title { font-size: 17px; font-weight: 700; line-height: 1.3; }
.rp-cov-close { flex: none; display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border: 1px solid var(--rp-line-strong); border-radius: 8px; background: var(--rp-surface); font-size: 13px; font-weight: 500; }
.rp-cov-note { margin: 0; font-size: 12.5px; color: var(--rp-text-2); }
/* Per area a name, a grey count line and the lists "Prövas" and "Prövas inte", each point with a marker (a filled dot when tested, a ring when not)
   and the tasks or "Lägg till uppgift" under it; the levels as a two-column list. */
.rp-cov-area { display: grid; gap: 8px; }
.rp-cov-area + .rp-cov-area { padding-top: 14px; border-top: 1px solid var(--rp-line); }
.rp-cov-h { font-size: 14px; font-weight: 600; color: var(--rp-text); }
.rp-cov-count { margin: 0; font-size: 12.5px; color: var(--rp-text-2); }
.rp-cov-group { display: grid; gap: 6px; }
.rp-cov-group + .rp-cov-group { margin-top: 8px; scroll-margin-top: 14px; }   /* a demo that scrolls "Prövas inte" to the top keeps it below the padding */
.rp-cov-label { font-size: 12.5px; font-weight: 600; color: var(--rp-text-2); }
.rp-cov-area ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.rp-cov-area li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 2px 8px; align-items: start; overflow-wrap: anywhere; }
:is(.rp-cov-tested, .rp-cov-untested) > li > * { grid-column: 2; }
:is(.rp-cov-tested, .rp-cov-untested) > li::before { content: ''; grid-column: 1; grid-row: 1; box-sizing: border-box; width: 8px; height: 8px; margin-top: calc((1.5em - 8px) / 2); border-radius: 50%; }
.rp-cov-tested > li::before { background: var(--rp-accent); }
.rp-cov-untested > li::before { border: 1.5px solid var(--rp-text-3); }
.rp-cov-point { display: block; min-width: 0; color: var(--rp-text); text-decoration: underline; text-decoration-color: var(--rp-line); text-underline-offset: 3px; }
.rp-cov-untested .rp-cov-point { color: var(--rp-text-2); }
.rp-cov-tasks { display: block; color: var(--rp-text-2); font-size: 12.5px; }
.rp-cov-add { justify-self: start; display: inline-flex; align-items: center; min-height: 28px; color: var(--rp-accent); font-size: 12.5px; font-weight: 500; }
.rp-cov-levels > li { grid-template-columns: 2ch minmax(0, 1fr); }
.rp-cov-level { font-weight: 600; }
/* Phone (kursplan-coverage.css, max-width: 640px): 44 px targets; the padding of a point is its spacing, and the tasks and the link stay with their point. */
@container rp (max-width: 640px) {
  .rp-cov-close { height: 44px; }
  .rp-cov-add { align-items: flex-start; min-height: 44px; padding-top: 2px; }
  .rp-cov-point { box-sizing: border-box; min-height: 44px; padding-block: 12px; }
  .rp-cov-area :is(.rp-cov-tested, .rp-cov-untested) { gap: 0; }
  .rp-cov-untested .rp-cov-point { padding-bottom: 4px; }
  .rp-cov-label + ul { margin-top: -10px; }
  .rp-cov-tested .rp-cov-tasks { margin-top: -8px; padding-bottom: 6px; }
  :is(.rp-cov-tested, .rp-cov-untested) > li::before { margin-top: calc(12px + (1.5em - 8px) / 2); }
}
@container rp (max-width: 520px) { .rp-cov { left: 16px; right: 16px; width: auto; max-width: none; } }

@media (prefers-reduced-motion: reduce) {
  .rp-window *, .rp-window *::before, .rp-window *::after { animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  .rp-window { forced-color-adjust: none; }
  .rp-wordmark::before { display: none; }
}

/* AppSidebar.tsx: documents scroll above the pinned footer. */
.rp-sidebar-scroll { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; overflow: hidden auto; scrollbar-width: thin; overscroll-behavior: contain; padding: 2px 0 4px; }
.rp-sidebar-scroll > * { flex-shrink: 0; }
.rp-sidebar-footer { flex: none; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--rp-line); padding-top: 8px; }
@media (max-height: 640px) {
  .rp-sidebar:has(.rp-sidebar-footer) { gap: 4px; padding-block: 8px; }
  .rp-sidebar-panel:has(.rp-sidebar-footer) { gap: 6px; margin-top: 4px; }
  .rp-sidebar:has(.rp-sidebar-footer) .rp-sidebar-head { min-height: 32px; }
  .rp-sidebar:has(.rp-sidebar-footer) .rp-nav-item { height: 32px; }
  .rp-sidebar-footer { gap: 6px; padding-top: 6px; }
}
/* The AI card at the foot of the sidebar, right above the account (sidebar-cards.css .side-card, .ai-card; SidebarCards.tsx AiCard). The landing's
   teachers are paying school teachers past their first steps, so there is no "Kom igång" card: only "AI den här månaden", a share, a thin bar and when it resets.
   In the rail only the bar is left (.rail-ai), in the icon column of a 44x40 item right above the account. */
.rp-side-cards { flex: none; display: flex; flex-direction: column; gap: 6px; }
.rp-side-card { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 8px 12px; border-radius: 12px; background: var(--rp-fill); color: var(--rp-text); font-size: 13px; font-weight: 500; text-align: left; }
.rp-side-card-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-ai-card-value { flex: none; color: var(--rp-text-2); font-size: 12.5px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-side-card-note { color: var(--rp-text-2); font-size: 11.5px; font-weight: 400; line-height: 1.3; }
.rp-ai-card { flex-direction: column; align-items: stretch; gap: 6px; padding: 9px 12px 10px; }
.rp-ai-card-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0 8px; min-width: 0; }
.rp-ai-card .rp-side-card-name { flex: 0 1 auto; }
.rp-ai-bar { position: relative; display: block; height: 4px; border-radius: 999px; background: color-mix(in srgb, var(--rp-accent) 16%, transparent); overflow: hidden; }
.rp-ai-bar > span { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 999px; background: var(--rp-accent); }
.rp-sidebar.is-rail .rp-rail-ai { flex: none; display: flex; align-items: center; width: 44px; height: 40px; margin: auto 0 0; padding: 0 12px; }
.rp-sidebar.is-rail .rp-rail-ai + .rp-rail-account { margin-top: 2px; }
.rp-rail-ai .rp-ai-bar { flex: none; width: 20px; height: 5px; }
@media (max-height: 700px) { .rp-side-card-note { display: none; } .rp-ai-card { padding-block: 8px 9px; } }
@media (max-height: 520px) { .rp-side-card { min-height: 36px; padding-block: 6px; } }
/* CreatePlanView.tsx and plan-view.css. */
.rp-plan-reference { margin: 0 0 1rem; padding: .75rem 1rem; border: 1px solid var(--rp-line-strong); border-radius: .5rem; overflow-wrap: anywhere; }
.rp-plan-reference p { margin: .25rem 0; }
.rp-plan-reference label { display: flex; align-items: center; gap: .5rem; padding: .25rem 0; }
.rp-plan-reference input { accent-color: var(--rp-accent); }
