* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding-left: var(--sck-rail-width);
  min-width: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, var(--sck-line) 1px, transparent 1px),
    linear-gradient(var(--sck-line) 1px, transparent 1px),
    var(--sck-cream);
  background-size: 96px 96px;
  color: var(--sck-text);
  font-family: var(--font-body);
}

body::before {
  content: "";
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sck-rail-width);
  background: var(--sck-red);
  z-index: -1;
}

.studio-header {
  width: min(calc(100vw - var(--sck-rail-width) - (var(--sck-page-gutter) * 2)), var(--sck-max));
  margin: clamp(14px, 2vw, 26px) auto clamp(28px, 4vw, 52px);
  padding: 14px clamp(16px, 2.4vw, 26px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(248, 249, 240, 0.95);
  border: 2px solid var(--sck-red);
  border-radius: 30px;
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--sck-black);
  font-family: var(--font-title);
  font-size: clamp(1rem, 1.8vw, 1.28rem);
  font-weight: 900;
  text-decoration: none;
}

.brand-text {
  display: grid;
  gap: 2px;
  line-height: 1;
}

.brand-text strong,
.brand-text small {
  display: block;
}

.brand-text strong {
  font: inherit;
}

.brand-text small {
  color: var(--sck-red);
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.brand img {
  width: 46px;
  height: 46px;
  display: block;
  flex: 0 0 auto;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.studio-shell {
  width: min(calc(100vw - var(--sck-rail-width) - (var(--sck-page-gutter) * 2)), 1440px);
  margin: 0 auto clamp(56px, 8vw, 96px);
}

.workspace {
  display: grid;
  gap: 18px;
}

.progress-panel {
  width: min(100%, 860px);
  margin: 0 auto;
  padding: 14px 18px;
  border: 1.5px solid var(--sck-red);
  border-radius: 24px;
  background: rgba(248, 249, 240, 0.88);
}

.progress-editorial {
  display: grid;
  gap: 10px;
}

.progress-copy {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.progress-editorial strong {
  color: var(--sck-red);
  font-family: var(--font-title);
  font-weight: 900;
  line-height: 1;
  text-transform: none;
}

.progress-editorial small {
  color: var(--sck-muted);
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: left;
}

.screen-panel {
  min-width: 0;
  min-height: 620px;
  padding: 0;
  overflow: visible;
}

.screen-panel > h2,
.screen-panel > .micro-lesson,
.screen-panel > .source-material,
.screen-panel > .mindset-block,
.screen-panel > .source-list,
.screen-panel > .screen-example,
.screen-panel > .format-guide,
.screen-panel > .screen-result,
.screen-panel > .glossary-block,
.screen-panel > .diagnostic-form,
.screen-panel > .screen-actions,
.screen-panel > .placeholder-box,
.screen-panel > .synthesis-grid,
.screen-panel > .hint {
  width: min(100%, 920px);
  margin-inline: auto;
}

.screen-panel > .kicker {
  width: fit-content;
  max-width: min(100%, 920px);
  margin-inline: max(0px, calc((100% - 920px) / 2)) auto;
}

.screen-panel > h2 {
  margin-top: 12px;
  margin-bottom: 18px;
  font-family: var(--font-title);
  font-size: clamp(2.7rem, 7vw, 5.4rem);
  font-weight: 900;
  line-height: 0.92;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.22);
  z-index: 20;
}

.drawer-backdrop[hidden] {
  display: none;
}

.studio-drawer {
  position: fixed;
  inset: 14px 14px 14px auto;
  width: min(460px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 22px;
  overflow: auto;
  transform: translateX(calc(100% + 28px));
  transition: transform 180ms ease;
  z-index: 30;
  background: var(--sck-cream);
  border: 2px solid var(--sck-red);
  border-radius: 28px;
  box-shadow: var(--sck-soft-shadow);
}

.studio-drawer.is-open {
  transform: translateX(0);
}

.drawer-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.studio-drawer h1,
.studio-drawer h2 {
  margin: 0 0 12px;
  color: var(--sck-red);
  font-family: var(--font-title);
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 900;
  line-height: 0.94;
}

.drawer-intro,
.storage-status,
.summary-empty {
  color: var(--sck-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.storage-status {
  min-height: 1.4em;
  margin: 12px 0 0;
}

.module-nav,
.resource-list,
.summary-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.drawer-glossary {
  display: grid;
  gap: 14px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1.5px solid rgba(255, 0, 0, 0.22);
}

.drawer-glossary h2 {
  margin: 0;
}

.drawer-glossary-list {
  display: grid;
  gap: 10px;
}

.drawer-glossary-entry {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1.5px solid rgba(255, 0, 0, 0.2);
  outline: none;
}

.drawer-glossary-entry h3 {
  margin: 0;
  color: var(--sck-red);
  font-family: var(--font-title);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  text-transform: lowercase;
}

.drawer-glossary-entry p {
  margin: 0;
  color: var(--sck-text);
  font-size: 0.9rem;
  line-height: 1.5;
}

.drawer-glossary-entry:focus-visible {
  outline: 3px solid rgba(255, 0, 0, 0.28);
  outline-offset: 4px;
}

.project-summary-panel {
  display: grid;
  gap: 16px;
}

.summary-sections {
  display: grid;
  gap: 14px;
}

.summary-section {
  padding: 16px;
  border: 1.5px solid var(--sck-red);
  border-radius: 28px;
  background: var(--sck-pink);
}

.summary-section h3 {
  margin: 0 0 10px;
  font-family: var(--font-title);
  font-size: 1rem;
  line-height: 1;
}

.summary-screen {
  display: grid;
  gap: 8px;
}

.summary-screen + .summary-screen {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1.5px solid rgba(255, 0, 0, 0.22);
}

.summary-screen h4 {
  margin: 0;
  color: var(--sck-red);
  font-family: var(--font-title);
  font-size: 0.78rem;
  line-height: 1.1;
  text-transform: uppercase;
}

.summary-section li {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1.5px solid var(--sck-red);
  border-radius: 18px;
  background: var(--sck-cream);
}

.summary-section li:first-child {
  border-top: 1.5px solid var(--sck-red);
}

.summary-section strong {
  font-family: var(--font-title);
  font-size: 0.82rem;
  line-height: 1.15;
}

.summary-section span {
  font-size: 0.86rem;
  line-height: 1.45;
}

.summary-item.is-missing span {
  color: var(--sck-red);
  font-weight: 700;
}

.summary-return {
  width: fit-content;
  min-height: 34px;
  margin-top: 2px;
  padding: 8px 14px;
  border: 2px solid var(--sck-red);
  border-radius: 999px;
  background: var(--sck-yellow);
  color: var(--sck-red);
  cursor: pointer;
  font-family: var(--font-title);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease;
}

.summary-return:hover,
.summary-return:focus-visible {
  background: var(--sck-red);
  color: var(--sck-cream);
  transform: translateY(-2px);
}

.summary-return:active {
  transform: translateY(0) scale(0.97);
}

.panel-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.project-reset-button {
  appearance: none;
  width: fit-content;
  justify-self: end;
  min-height: 34px;
  padding: 8px 14px;
  border: 2px solid var(--sck-red);
  border-radius: 999px;
  background: var(--sck-cream);
  color: var(--sck-red);
  cursor: pointer;
  font-family: var(--font-title);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease;
}

.project-reset-button:hover,
.project-reset-button:focus-visible {
  background: var(--sck-yellow);
  transform: translateY(-2px);
}

.project-reset-button:active {
  transform: translateY(0) scale(0.97);
}

@media print {
  body {
    background: var(--sck-cream);
  }

  body::before,
  .studio-header,
  .progress-panel,
  .screen-actions,
  .studio-drawer,
  .drawer-backdrop,
  .form-status,
  .hint {
    display: none !important;
  }

  .studio-shell {
    width: 100%;
    margin: 0;
    display: block;
  }
}
