:root {
  color-scheme: light;
  --navy-950: #250c19;
  --navy-900: #40152c;
  --navy-800: #662246;
  --teal-700: #662246;
  --teal-600: #71264e;
  --teal-100: #f0e8ec;
  --teal-50: #fbf8f9;
  --blue-50: #fbf8f9;
  --white: #ffffff;
  --text: #333333;
  --muted: #55585c;
  --instruction-muted: #3f4245;
  --line: #e3d7dd;
  --line-strong: #cdb8c3;
  --brand: #662246;
  --brand-dark: #40152c;
  --brand-mid: #71264e;
  --brand-soft: #f0e8ec;
  --brand-pale: #fbf8f9;
  --accent: #ffb547;
  --success: #267653;
  --success-bg: #e8f6ee;
  --warning: #8a5a12;
  --warning-bg: #fff5dc;
  --danger: #b53a4c;
  --danger-bg: #fff0f2;
  --shadow: 0 12px 35px rgba(64, 21, 44, .12);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--blue-50); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--blue-50);
  font: 16px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.18; letter-spacing: -.025em; }
.hidden { display: none !important; }

.service-clock {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: .5rem .8rem;
  border: 1px solid rgba(102, 34, 70, .2);
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  color: #4c1835;
  font-size: .85rem;
  font-weight: 700;
}

.topbar-clock { margin-left: auto; }

.closed-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(30, 10, 22, .88);
  backdrop-filter: blur(8px);
}

.closed-card {
  width: min(34rem, 100%);
  padding: 2.25rem;
  border-radius: 1.25rem;
  background: #fff;
  box-shadow: 0 2rem 5rem rgba(0, 0, 0, .35);
  text-align: center;
}

.closed-card h2 { margin: .4rem 0 1rem; }

.demo-lab-card {
  border-color: #662246;
  box-shadow: inset 0 .25rem 0 #662246;
}
.muted { color: var(--muted); }
.eyebrow, .toolbar-kicker {
  margin: 0 0 .45rem;
  color: var(--teal-700);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .13em;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: .66rem 1rem;
  font-weight: 750;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .48; transform: none; }
.button.primary { color: #fff; background: var(--teal-700); }
.button.primary:hover { background: var(--brand-dark); }
.button.secondary { color: var(--teal-700); border-color: var(--teal-700); background: #fff; }
.button.quiet { color: var(--navy-800); border-color: var(--line); background: transparent; }
.button.quiet:hover { background: var(--teal-50); border-color: var(--line-strong); }
.button.full { width: 100%; }

/* Login */
.login-view { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr); min-height: 100vh; }
.login-intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(3rem, 8vw, 8rem);
  color: #fff;
  background:
    radial-gradient(circle at 76% 18%, rgba(255, 181, 71, .20), transparent 33%),
    linear-gradient(145deg, var(--brand-dark), var(--brand));
}
.login-intro .eyebrow { color: #f2dce7; }
.login-intro h1 { max-width: 760px; margin: 1.5rem 0; font-size: clamp(2.6rem, 5.4vw, 5.4rem); }
.login-lead { max-width: 630px; color: #f0e8ec; font-size: clamp(1.05rem, 1.6vw, 1.3rem); }
.iths-logo { display: block; width: auto; object-fit: contain; }
.login-logo { width: min(300px, 72%); height: auto; margin-bottom: 1.8rem; }
.topbar-logo { width: 184px; height: 41px; }
.login-panel { display: grid; place-items: center; padding: clamp(1.5rem, 5vw, 5rem); background: #fff; }
.login-card { width: min(430px, 100%); }
.login-card h2 { margin-bottom: .5rem; font-size: 2rem; }
.login-card label { display: block; margin: 1.3rem 0 .4rem; font-weight: 700; }
.login-card input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: .75rem .85rem;
  color: var(--text);
  background: #fff;
}
.login-card input:focus { border-color: var(--teal-600); }
.login-card .button { margin-top: 1.35rem; }
.login-help { margin: 1rem 0 0; color: var(--muted); font-size: .86rem; text-align: center; }
.message { min-height: 1.5em; margin: .8rem 0 0; }
.message.error { color: var(--danger); }

/* Shared shell */
.portal { min-height: 100vh; }
.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem clamp(1rem, 3vw, 2.4rem);
  border-bottom: 1px solid var(--brand-dark);
  color: #fff;
  background: rgba(102, 34, 70, .98);
  backdrop-filter: blur(10px);
}
.brand-button { display: flex; align-items: center; gap: 1rem; border: 0; padding: 0; color: #fff; background: transparent; cursor: pointer; text-align: left; }
.brand-button strong, .brand-button small { display: block; }
.brand-button small { color: #e7cfdc; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; }
.portal-name { padding-left: 1rem; border-left: 1px solid rgba(255, 255, 255, .35); }
.account { display: flex; align-items: center; gap: .7rem; }
.account > span:first-child { font-weight: 700; }
.account-id { color: #e7cfdc; font-size: .85rem; }
.topbar .button.quiet { color: #fff; border-color: rgba(255, 255, 255, .5); }
.topbar .button.quiet:hover { border-color: #fff; background: rgba(255, 255, 255, .12); }

/* Dashboard */
.dashboard { width: min(1240px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(2rem, 5vw, 4.5rem) 0 5rem; }
.dashboard-hero { display: flex; flex-direction: column; align-items: stretch; gap: 1.5rem; margin-bottom: 3.2rem; }
.dashboard-hero h1 { margin-bottom: .75rem; font-size: clamp(2.2rem, 4vw, 3.8rem); }
.hero-copy { max-width: 720px; margin: 0; color: var(--muted); font-size: 1.1rem; }
.environment-note { display: flex; width: 100%; min-height: 112px; align-items: center; gap: 1.15rem; padding: 1.35rem 1.6rem; border: 2px solid #e4bd62; border-radius: 14px; background: var(--warning-bg); box-shadow: 0 8px 24px rgba(138, 90, 18, .10); }
.environment-note strong { display: block; color: #5e3c0a; font-size: 1.18rem; line-height: 1.3; }
.environment-note p { margin: .3rem 0 0; color: #76501a; font-size: 1.03rem; line-height: 1.5; }
.note-icon { display: grid; flex: 0 0 44px; height: 44px; place-items: center; border-radius: 50%; color: #fff; background: var(--warning); font-size: 1.1rem; font-weight: 800; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.2rem; }
.section-heading h2 { margin: 0; font-size: 1.65rem; }
.section-heading > p { margin: 0; }
.lab-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.1rem; }
.lab-card { display: flex; min-height: 290px; flex-direction: column; padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 3px 14px rgba(64, 21, 44, .05); }
.lab-card:hover { border-color: #b985a0; box-shadow: var(--shadow); }
.lab-card-top, .lab-card-meta { display: flex; align-items: center; justify-content: space-between; gap: .7rem; }
.status-pill { display: inline-flex; align-items: center; gap: .35rem; border-radius: 999px; padding: .28rem .62rem; color: var(--teal-700); background: var(--teal-100); font-size: .77rem; font-weight: 800; }
.status-pill.complete { color: var(--success); background: var(--success-bg); }
.lab-card h3 { margin: 1rem 0 .5rem; font-size: 1.4rem; }
.lab-card > p { flex: 1; color: var(--muted); }
.lab-card-meta { margin: 1rem 0; color: var(--muted); font-size: .84rem; }
.mini-progress { height: 6px; overflow: hidden; border-radius: 999px; background: #e8eef1; }
.mini-progress span { display: block; height: 100%; border-radius: inherit; background: var(--teal-600); }
.lab-card .button { margin-top: 1rem; }
.roadmap { margin-top: 4rem; }
.planned-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.planned-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .75rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .7); }
.planned-card h3 { margin: 0 0 .2rem; font-size: 1rem; }
.planned-card p { margin: 0; color: var(--muted); font-size: .86rem; }
.planned-context { display: block; margin-bottom: .18rem; color: var(--brand); font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.quiz-card { border-left: 4px solid var(--teal-600); }
.planned-phase { align-self: start; border-radius: 999px; padding: .25rem .55rem; color: var(--muted); background: #eaf0f3; font-size: .7rem; white-space: nowrap; }

/* Focused lab */
.lab-view { height: calc(100vh - 66px); overflow: hidden; background: #eaf0f3; }
.lab-header { display: grid; grid-template-columns: 180px minmax(0, 1fr) minmax(180px, 260px); align-items: center; gap: 1rem; min-height: 86px; padding: .8rem 1.25rem; border-bottom: 1px solid var(--line); background: #fff; }
.lab-header-title .eyebrow { margin-bottom: .2rem; }
.lab-header-title h1 { margin: 0; overflow: hidden; font-size: 1.35rem; text-overflow: ellipsis; white-space: nowrap; }
.lab-progress-summary { text-align: right; }
.lab-progress-summary > span { display: block; margin-bottom: .35rem; color: var(--muted); font-size: .8rem; }
.progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: #e4ebee; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--success); transition: width .25s ease; }
.focus-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(390px, 470px); gap: 12px; height: calc(100% - 86px); padding: 12px; }
.workspace-panel, .task-panel { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 4px 16px rgba(20, 48, 60, .06); }
.workspace-panel { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.workspace-toolbar { display: flex; min-height: 76px; align-items: center; gap: .75rem; padding: .8rem 1rem; border-bottom: 1px solid var(--brand-dark); color: #fff; background: var(--brand-dark); }
.workspace-toolbar h2 { margin: 0; font-size: 1rem; }
.toolbar-kicker { margin-bottom: .1rem; color: #e7cfdc; font-size: .62rem; }
.workspace-tabs { display: flex; flex: 1; justify-content: center; gap: .4rem; }
.workspace-tool { display: inline-flex; min-height: 40px; align-items: center; gap: .55rem; border: 1px solid #f0c7dc; border-radius: 999px; padding: .45rem .9rem; color: #fff; background: var(--brand-mid); font-weight: 750; }
.workspace-tool > span { color: var(--accent); font-size: .72rem; }
.workspace-tool.idle { border-color: #a0527b; color: #e7cfdc; background: transparent; font-weight: 650; }
.workspace-toolbar .icon-button { min-height: 40px; padding-inline: .75rem; color: #fff; border-color: #a0527b; background: transparent; }
.workspace-toolbar .icon-button:hover { border-color: #f0c7dc; background: var(--brand-mid); }
.workspace-desktop {
  display: grid;
  min-height: 0;
  grid-template-columns: 112px minmax(0, 1fr);
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 18%, rgba(255, 181, 71, .22), transparent 28%),
    radial-gradient(circle at 24% 82%, rgba(255, 255, 255, .12), transparent 32%),
    linear-gradient(145deg, #40152c 0%, #662246 52%, #7d3158 100%);
}
.desktop-icons {
  display: flex;
  min-height: 0;
  flex-direction: column;
  align-items: stretch;
  gap: .55rem;
  overflow-y: auto;
  padding: .9rem .65rem;
  border-right: 1px solid rgba(255, 255, 255, .16);
  background: rgba(37, 12, 25, .26);
}
.desktop-icon {
  display: grid;
  justify-items: center;
  gap: .18rem;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: .62rem .3rem;
  color: #fff;
  background: transparent;
  cursor: pointer;
  text-align: center;
}
.desktop-icon:hover, .desktop-icon.active { border-color: rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .13); }
.desktop-icon.recommended {
  border-color: var(--accent);
  background: rgba(255, 181, 71, .2);
  box-shadow: 0 0 0 3px rgba(255, 181, 71, .14);
  animation: recommended-tool 1.8s ease-in-out infinite;
}
.desktop-icon.recommended::after {
  content: "Välj här";
  border-radius: 999px;
  padding: .16rem .4rem;
  color: var(--brand-dark);
  background: var(--accent);
  font-size: .58rem;
  font-weight: 850;
  letter-spacing: .03em;
  text-transform: uppercase;
}
@keyframes recommended-tool {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255, 181, 71, .12); }
  50% { box-shadow: 0 0 0 6px rgba(255, 181, 71, .28); }
}
.desktop-icon-symbol {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .52);
  border-radius: 12px;
  color: var(--brand-dark);
  background: linear-gradient(145deg, #fff, #eadde4);
  box-shadow: 0 7px 16px rgba(20, 5, 13, .26);
  font: 850 1rem/1 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.desktop-icon strong { font-size: .78rem; }
.desktop-icon small { color: #ecdce5; font-size: .61rem; line-height: 1.15; }
.desktop-stage { position: relative; min-width: 0; min-height: 0; padding: clamp(.7rem, 1.6vw, 1.2rem); }
.desktop-welcome {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 2rem;
  color: #f8edf3;
  text-align: center;
}
.desktop-welcome-mark {
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 22px;
  background: rgba(255, 255, 255, .13);
  box-shadow: 0 18px 45px rgba(30, 7, 20, .24);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: .08em;
}
.desktop-welcome h3 { margin: 1rem 0 .45rem; color: #fff; }
.desktop-welcome p { max-width: 460px; margin: 0; color: #ecdce5; }
.workspace-window {
  position: relative;
  z-index: 2;
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-rows: 42px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 11px;
  background: #f7fafb;
  box-shadow: 0 18px 50px rgba(30, 7, 20, .38);
}
.window-titlebar { display: flex; align-items: center; justify-content: space-between; padding: 0 .45rem 0 .8rem; color: #fff; background: #2e101f; }
.window-title { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.window-title strong { overflow: hidden; font-size: .84rem; text-overflow: ellipsis; white-space: nowrap; }
.window-app-icon { color: var(--accent); font: 800 .8rem/1 ui-monospace, monospace; }
.window-control { display: grid; width: 34px; height: 30px; place-items: center; border: 0; border-radius: 6px; color: #fff; background: transparent; cursor: pointer; font-weight: 800; }
.window-control:hover { background: rgba(255, 255, 255, .15); }
.workspace-placeholder { display: grid; align-content: center; justify-items: center; padding: 2rem; color: var(--muted); text-align: center; background: #f7fafb; }
.workspace-placeholder h3 { margin: 1rem 0 .45rem; color: var(--text); font-size: 1.35rem; }
.workspace-placeholder p { max-width: 480px; }
.workspace-empty-icon { display: grid; width: 72px; height: 72px; place-items: center; border: 1px solid #d8becb; border-radius: 18px; color: var(--brand); background: var(--brand-pale); font: 800 1.45rem/1 ui-monospace, monospace; }
#workspace-frame { width: 100%; height: 100%; min-height: 0; border: 0; background: #111; }
#workspace-frame:focus { outline: 3px solid var(--accent); outline-offset: -3px; }
.task-panel { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.task-progress { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1.2rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .85rem; font-weight: 700; }
.step-dots { display: flex; flex-wrap: wrap; justify-content: end; gap: 5px; }
.step-dot { width: 9px; height: 9px; border: 0; border-radius: 50%; padding: 0; background: #cfdbdf; }
.step-dot.complete { background: var(--success); }
.step-dot.active { outline: 2px solid var(--teal-600); outline-offset: 2px; background: #fff; }
.step-dot:disabled { cursor: default; }
.step-content { overflow-y: auto; padding: 1.45rem 1.5rem 2rem; }
.step-label { margin-bottom: .35rem; color: var(--teal-700); font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.step-content h2 { margin-bottom: .5rem; font-size: 1.65rem; }
.step-summary { color: var(--instruction-muted); font-size: 1rem; line-height: 1.55; }
.tool-guidance { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: .8rem; margin: 1rem 0; border: 1px solid #d8becb; border-radius: 10px; padding: .8rem .9rem; background: #fff9f0; }
.tool-guidance-icon { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 11px; color: #fff; background: var(--brand-dark); font: 850 .9rem/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.tool-guidance-kicker { margin: 0 0 .1rem; color: var(--brand); font-size: .68rem; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.tool-guidance strong { display: block; color: var(--brand-dark); font-size: 1rem; }
.tool-guidance p:not(.tool-guidance-kicker) { margin: .22rem 0; color: var(--instruction-muted); font-size: .86rem; line-height: 1.45; }
.tool-guidance div > span { color: var(--brand); font-size: .8rem; font-weight: 750; }
.tool-documentation-link { display: block; width: fit-content; margin-top: .45rem; color: var(--teal-700); font-size: .8rem; font-weight: 800; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.tool-documentation-link:hover { color: var(--brand-dark); }
.instruction-list { display: grid; gap: .85rem; margin: 1.3rem 0; padding: 0; list-style: none; counter-reset: instruction; }
.instruction-list li { position: relative; padding-left: 2.25rem; counter-increment: instruction; }
.instruction-list li::before { content: counter(instruction); position: absolute; left: 0; top: .05rem; display: grid; width: 1.55rem; height: 1.55rem; place-items: center; border-radius: 50%; color: #fff; background: var(--teal-700); font-size: .74rem; font-weight: 800; }
.instruction-list strong { display: block; margin-bottom: .18rem; }
.instruction-list p { margin: 0; color: var(--instruction-muted); font-size: .95rem; line-height: 1.58; }
.command-block { margin: 1rem 0; border: 1px solid #693250; border-radius: 10px; overflow: hidden; background: var(--navy-950); }
.command-label { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .55rem .7rem; color: #e7cfdc; border-bottom: 1px solid #693250; font-size: .76rem; }
.copy-button { min-height: 32px; border: 1px solid #a0527b; border-radius: 7px; padding: .3rem .55rem; color: #fff; background: transparent; cursor: pointer; }
.command-block code { display: block; overflow-x: auto; padding: .85rem; color: #ffd493; font: .87rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: nowrap; }
.terminal-paste-help { display: flex; align-items: center; gap: .45rem; margin: 0; border-top: 1px solid #693250; padding: .5rem .7rem; color: #e7cfdc; background: #250b19; font-size: .75rem; line-height: 1.35; }
.terminal-paste-help kbd { display: inline-block; flex: 0 0 auto; border: 1px solid #a0527b; border-radius: 5px; padding: .12rem .4rem; color: #fff; background: #4a1732; box-shadow: 0 1px 0 #a0527b; font: 700 .7rem/1.35 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: nowrap; }
.expected-box { margin: 1rem 0; padding: .8rem .9rem; border-left: 4px solid var(--teal-600); border-radius: 0 8px 8px 0; background: var(--teal-50); }
.expected-box strong { display: block; margin-bottom: .2rem; font-size: .82rem; }
.expected-box p { margin: 0; color: #693250; font-size: .88rem; }
.answer-form { margin-top: 1.2rem; padding-top: 1.15rem; border-top: 1px solid var(--line); }
.answer-form > label:not(.check-label) { display: block; margin-bottom: .4rem; font-weight: 750; }
.answer-form input[type="text"] { width: 100%; min-height: 46px; border: 1px solid var(--line-strong); border-radius: 9px; padding: .65rem .75rem; }
.field-help { margin: .35rem 0 .8rem; color: var(--instruction-muted); font-size: .86rem; }
.check-label { display: flex; align-items: flex-start; gap: .65rem; margin-bottom: 1rem; font-weight: 650; }
.check-label input { width: 20px; height: 20px; margin-top: .1rem; accent-color: var(--teal-700); }
.answer-actions { display: flex; align-items: center; gap: .55rem; }
.step-message { min-height: 1.4em; margin: .7rem 0 0; font-size: .86rem; }
.step-message.error { color: var(--danger); }
.step-message.success { color: var(--success); font-weight: 700; }
.hint-stack { display: grid; gap: .55rem; margin: 1rem 0 0; }
.hint-card { padding: .75rem .85rem; border: 1px solid #ead6a4; border-radius: 9px; background: var(--warning-bg); }
.hint-card strong { display: block; color: #67440f; font-size: .84rem; }
.hint-card p { margin: .2rem 0 0; color: #76501a; font-size: .86rem; }
.explanation-card { margin: 1rem 0 1.15rem; padding: .9rem 1rem; border-left: 4px solid var(--brand); border-radius: 0 9px 9px 0; background: var(--brand-pale); }
.explanation-card p { margin: .35rem 0; color: #513344; font-size: .9rem; line-height: 1.5; }
.explanation-card p strong { color: var(--brand-dark); }
.explanation-card .explanation-kicker { margin: 0 0 .4rem; color: var(--brand); font-size: .72rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.term-details { margin-top: .55rem; border-top: 1px solid #dec5d2; padding-top: .55rem; }
.term-details summary { width: fit-content; color: var(--brand); cursor: pointer; font-size: .84rem; font-weight: 800; }
.term-details dl { display: grid; gap: .45rem; margin: .65rem 0 0; }
.term-row { display: grid; grid-template-columns: minmax(80px, .35fr) 1fr; gap: .7rem; }
.term-row dt { color: var(--brand-dark); font-size: .84rem; font-weight: 800; }
.term-row dd { margin: 0; color: var(--instruction-muted); font-size: .86rem; line-height: 1.5; }
.repeat-banner { display: grid; gap: .12rem; margin: 0 0 1.2rem; padding: .85rem .95rem; border: 1px solid #d8becb; border-radius: 10px; color: var(--brand-dark); background: var(--brand-pale); }
.repeat-banner strong { font-size: .9rem; }
.repeat-banner span { color: var(--instruction-muted); font-size: .86rem; }
.completed-banner { display: flex; align-items: center; gap: .65rem; margin: 1rem 0; padding: .8rem; border-radius: 9px; color: var(--success); background: var(--success-bg); font-weight: 750; }
.report-download { margin-top: .8rem; }
.task-footer { display: flex; min-height: 66px; align-items: center; justify-content: space-between; gap: .6rem; padding: .7rem 1.1rem; border-top: 1px solid var(--line); background: #fafcfd; }
.saved-status { color: var(--success); font-size: .8rem; }
.toast { position: fixed; z-index: 50; right: 1.2rem; bottom: 1.2rem; max-width: 380px; padding: .8rem 1rem; border-radius: 10px; color: #fff; background: var(--navy-900); box-shadow: var(--shadow); }

@media (prefers-reduced-motion: reduce) {
  .desktop-icon.recommended { animation: none; }
}

@media (max-width: 1050px) {
  .focus-layout { grid-template-columns: minmax(0, 1fr) 390px; }
  .lab-header { grid-template-columns: 150px minmax(0, 1fr) 180px; }
  .account-id { display: none; }
}
@media (max-width: 820px) {
  .login-view { grid-template-columns: 1fr; }
  .login-intro { min-height: auto; padding: 2rem 1.4rem; }
  .login-intro h1 { margin: 1rem 0 .7rem; font-size: 2.3rem; }
  .login-panel { padding: 2.2rem 1.3rem; }
  .planned-list { grid-template-columns: 1fr; }
  .lab-view { height: auto; overflow: visible; }
  .lab-header { grid-template-columns: 1fr; min-height: 0; }
  .lab-header-title { order: -1; }
  .lab-progress-summary { text-align: left; }
  .focus-layout { grid-template-columns: 1fr; height: auto; }
  .task-panel { min-height: 680px; order: -1; }
  .workspace-panel { min-height: 70vh; }
  .workspace-desktop { grid-template-columns: 96px minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .topbar { align-items: flex-start; }
  .account { gap: .35rem; }
  .account > span { display: none; }
  .dashboard { width: min(100% - 1.2rem, 1240px); padding-top: 2rem; }
  .dashboard-hero { margin-bottom: 2.5rem; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: .5rem; }
  .lab-grid { grid-template-columns: 1fr; }
  .workspace-toolbar { flex-wrap: wrap; }
  .workspace-toolbar > div:first-child { display: none; }
  .workspace-tabs { justify-content: flex-start; }
  .icon-button span { display: none; }
  .step-content { padding: 1.2rem; }
  .answer-actions { align-items: stretch; flex-direction: column; }
  .answer-actions .button { width: 100%; }
  .workspace-desktop { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .desktop-icons { flex-direction: row; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .16); }
  .desktop-icon { min-width: 86px; }
  .desktop-icon small { display: none; }
}
