:root {
  --ink: #202a36;
  --ink-soft: #596879;
  --muted: #8995a3;
  --canvas: #f4f6f8;
  --surface: #ffffff;
  --line: #dde3e9;
  --line-strong: #cad3dc;
  --navy: #173b5f;
  --navy-dark: #102e4b;
  --navy-soft: #eaf1f7;
  --burgundy: #8c3549;
  --burgundy-soft: #f8edf0;
  --green: #29735d;
  --green-soft: #eaf4f0;
  --gold: #9b6b20;
  --gold-soft: #f8f0df;
  --sidebar-width: 276px;
  --shadow: 0 12px 30px rgba(35, 49, 63, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[contenteditable="true"]:focus-visible {
  outline: 3px solid rgba(42, 111, 160, 0.2);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.app-shell {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 640px;
  overflow: hidden;
}

.sidebar {
  position: relative;
  z-index: 20;
  display: flex;
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  min-height: 0;
  flex-direction: column;
  color: #e7eef5;
  background: #153551;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  min-height: 78px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(224, 236, 247, 0.12);
}

.brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  color: inherit;
  background: transparent;
  text-align: left;
}

.brand__mark {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px 8px 8px 3px;
  color: #fff;
  background: var(--burgundy);
  font-family: Literata, Georgia, serif;
  font-size: 20px;
  font-weight: 600;
}

.brand__copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.brand__copy strong {
  overflow: hidden;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand__copy small {
  color: #a9bed1;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.09em;
}

.sidebar__close {
  display: none;
  width: 34px;
  height: 34px;
  margin-left: auto;
  place-items: center;
  border-radius: 6px;
  color: #cfdae5;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar__close svg,
.mobile-menu svg,
.nav-item > svg,
.nav-item__icon svg,
.tool-card svg,
.back-button svg,
.form-actions svg,
.preview-actions svg,
.edit-hint svg,
.preview-empty svg,
.generation-state svg,
.recent-list__heading svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.sidebar__nav {
  padding: 18px 12px 10px;
}

.nav-label {
  margin: 24px 10px 9px;
  color: #91a8bc;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: 7px;
  color: #c8d7e4;
  background: transparent;
  text-align: left;
  transition: color 160ms ease, background 160ms ease;
}

.nav-item + .nav-item {
  margin-top: 4px;
}

.nav-item:hover,
.nav-item:focus-visible,
.nav-item.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-item.is-active {
  box-shadow: inset 3px 0 0 #d07986;
}

.nav-item__icon {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  place-items: center;
  border-radius: 6px;
}

.nav-item__icon--exam {
  color: #bcd9ee;
  background: rgba(93, 157, 204, 0.18);
}

.nav-item__icon--lesson {
  color: #efbdc7;
  background: rgba(190, 77, 103, 0.17);
}

.nav-item__icon--review {
  color: #c4e3d7;
  background: rgba(66, 156, 126, 0.18);
}

.nav-item__copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.nav-item__copy strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item__copy small {
  overflow: hidden;
  color: #89a2b8;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-list {
  flex: 1;
  min-height: 0;
  padding: 10px 18px;
  overflow-y: auto;
}

.recent-list__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  border-top: 1px solid rgba(224, 236, 247, 0.12);
  padding-top: 16px;
}

.recent-list__heading p {
  margin: 0;
  color: #91a8bc;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.recent-list__heading button {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 5px;
  color: #8fa6ba;
  background: transparent;
}

.recent-list__heading button:hover,
.recent-list__heading button:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
}

.recent-list__heading svg {
  width: 14px;
  height: 14px;
}

.recent-list__items {
  display: grid;
  gap: 4px;
}

.recent-list__empty {
  margin: 8px 5px;
  color: #718ba1;
  font-size: 10px;
}

.recent-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  padding: 8px 7px;
  border-radius: 6px;
  color: #c7d5e1;
  background: transparent;
  text-align: left;
}

.recent-item:hover,
.recent-item:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

.recent-item > span:first-child {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 5px;
  color: #a9c0d4;
  background: rgba(255, 255, 255, 0.08);
}

.recent-item svg {
  width: 13px;
  height: 13px;
}

.recent-item__copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.recent-item__copy strong,
.recent-item__copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-item__copy strong {
  font-size: 10px;
  font-weight: 500;
}

.recent-item__copy small {
  color: #7891a6;
  font-size: 8px;
}

.sidebar__footer {
  padding: 13px 18px 17px;
  border-top: 1px solid rgba(224, 236, 247, 0.12);
}

.teacher-profile {
  display: flex;
  align-items: center;
  gap: 9px;
}

.teacher-profile__avatar {
  display: grid;
  width: 33px;
  height: 33px;
  place-items: center;
  border-radius: 50%;
  color: #e7f0f7;
  background: #2a5273;
  font-size: 9px;
  font-weight: 700;
}

.teacher-profile > span:last-child {
  display: grid;
  gap: 3px;
}

.teacher-profile strong {
  color: #dce7f0;
  font-size: 10px;
  font-weight: 500;
}

.teacher-profile small {
  color: #88a1b6;
  font-size: 8px;
}

.teacher-profile small i,
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #58c99b;
}

.sidebar-scrim {
  display: none;
}

.main-panel {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  background: var(--canvas);
}

.topbar {
  display: flex;
  min-height: 78px;
  align-items: center;
  gap: 13px;
  padding: 14px 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.topbar__title {
  display: grid;
  gap: 3px;
}

.topbar__title span {
  color: var(--burgundy);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.topbar__title h1 {
  margin: 0;
  color: var(--navy-dark);
  font-family: Literata, Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
}

.topbar__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #748394;
  background: #fff;
  font-size: 9px;
  font-weight: 500;
}

.topbar__status.is-connected {
  border-color: #b9d9cd;
  color: #28634f;
  background: #f1f8f5;
}

.mobile-menu {
  display: none;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 6px;
  color: var(--navy);
  background: var(--navy-soft);
}

.main-scroll {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
}

.dashboard-view,
.workspace-view {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 44px 42px 56px;
}

.welcome-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 8px 4px 34px;
}

.eyebrow {
  color: var(--burgundy);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.welcome-band h2,
.workspace-heading h2 {
  margin: 9px 0 12px;
  color: var(--navy-dark);
  font-family: Literata, Georgia, serif;
  font-size: 33px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.25;
}

.welcome-band h2 em {
  color: var(--burgundy);
  font-style: normal;
}

.welcome-band p,
.workspace-heading p {
  max-width: 650px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.7;
}

.welcome-band__seal {
  display: grid;
  width: 128px;
  height: 128px;
  flex: 0 0 128px;
  place-content: center;
  border: 1px solid #cfd9e3;
  border-radius: 50%;
  color: var(--navy);
  background: #fff;
  box-shadow: inset 0 0 0 8px var(--navy-soft);
  text-align: center;
}

.welcome-band__seal span {
  font-family: Literata, Georgia, serif;
  font-size: 26px;
  font-weight: 600;
}

.welcome-band__seal small {
  margin-top: 6px;
  color: var(--burgundy);
  font-size: 6px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.tool-card {
  display: flex;
  min-height: 305px;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--card-accent);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(34, 48, 63, 0.04);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.tool-card:hover {
  border-color: var(--card-accent);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.tool-card--exam {
  --card-accent: #2f6e9c;
  --card-soft: var(--navy-soft);
}

.tool-card--lesson {
  --card-accent: var(--burgundy);
  --card-soft: var(--burgundy-soft);
}

.tool-card--review {
  --card-accent: var(--green);
  --card-soft: var(--green-soft);
}

.tool-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 25px;
}

.tool-card__number {
  color: #a7b1bc;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.tool-card__icon {
  display: grid;
  width: 45px;
  height: 45px;
  place-items: center;
  border-radius: 8px;
  color: var(--card-accent);
  background: var(--card-soft);
}

.tool-card__icon svg {
  width: 22px;
  height: 22px;
}

.tool-card__tag {
  color: var(--card-accent);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.tool-card h3 {
  margin: 9px 0 10px;
  color: var(--navy-dark);
  font-family: Literata, Georgia, serif;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.35;
}

.tool-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.65;
}

.tool-card > button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  margin-top: auto;
  padding: 8px 0 2px;
  color: var(--card-accent);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
}

.tool-card > button svg {
  width: 15px;
  height: 15px;
  transition: transform 160ms ease;
}

.tool-card > button:hover svg,
.tool-card > button:focus-visible svg {
  transform: translateX(3px);
}

.process-band {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1.4fr);
  gap: 45px;
  align-items: center;
  margin-top: 42px;
  padding: 30px 4px 0;
  border-top: 1px solid var(--line);
}

.process-band h2 {
  margin: 8px 0 0;
  color: var(--navy-dark);
  font-family: Literata, Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.4;
}

.process-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.process-list li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.process-list li > span {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--burgundy);
  background: #fff;
  font-family: Literata, Georgia, serif;
  font-size: 12px;
  font-weight: 600;
}

.process-list li div {
  display: grid;
  gap: 3px;
}

.process-list strong {
  color: #344353;
  font-size: 10px;
  font-weight: 600;
}

.process-list small {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.4;
}

.workspace-view {
  width: min(1320px, 100%);
  padding-top: 30px;
}

.workspace-heading {
  margin-bottom: 24px;
}

.workspace-heading h2 {
  margin-top: 8px;
  margin-bottom: 6px;
  font-size: 26px;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 22px;
  padding: 0;
  color: #68798b;
  background: transparent;
  font-size: 10px;
  font-weight: 600;
}

.back-button:hover,
.back-button:focus-visible {
  color: var(--navy);
}

.back-button svg {
  width: 15px;
  height: 15px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(340px, 390px) minmax(480px, 1fr);
  gap: 18px;
  align-items: start;
}

.form-panel,
.preview-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 3px 14px rgba(34, 48, 63, 0.04);
}

.form-panel {
  position: sticky;
  top: 18px;
  padding: 20px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-heading--compact {
  min-width: 0;
  padding: 0;
  border: 0;
}

.panel-heading__step {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: var(--navy);
  font-family: Literata, Georgia, serif;
  font-size: 12px;
  font-weight: 600;
}

.panel-heading h3 {
  margin: 1px 0 4px;
  color: var(--navy-dark);
  font-size: 13px;
  font-weight: 700;
}

.panel-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.tool-form {
  padding-top: 18px;
}

.form-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 12px;
}

.field {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.field--full {
  grid-column: 1 / -1;
}

.field label,
.field legend {
  margin: 0;
  color: #445466;
  font-size: 9px;
  font-weight: 700;
}

.field label span {
  color: var(--burgundy);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: 0;
  color: var(--ink);
  background: #fff;
  font-size: 11px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field input,
.field select {
  height: 38px;
  padding: 0 10px;
}

.field textarea {
  min-height: 76px;
  padding: 9px 10px;
  resize: vertical;
  line-height: 1.55;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #7fa5c3;
  box-shadow: 0 0 0 3px rgba(47, 110, 156, 0.09);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #a6b0ba;
}

.field small {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.45;
}

.check-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 2px 0;
}

.check-option {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #566779;
  background: #fafbfc;
  font-size: 9px;
  font-weight: 500;
}

.check-option input {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  accent-color: var(--navy);
}

.form-actions {
  display: flex;
  gap: 9px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.primary-button,
.secondary-button,
.download-button,
.icon-button {
  display: inline-flex;
  height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.primary-button {
  flex: 1;
  color: #fff;
  background: var(--navy);
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--navy-dark);
  box-shadow: 0 6px 15px rgba(21, 53, 81, 0.2);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.secondary-button {
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  color: #617285;
  background: #fff;
}

.secondary-button:hover,
.secondary-button:focus-visible {
  border-color: #9aaabb;
  background: #f6f8fa;
}

.preview-panel {
  min-width: 0;
  overflow: hidden;
}

.preview-toolbar {
  display: flex;
  min-height: 71px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.preview-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.icon-button {
  width: 38px;
  border: 1px solid var(--line-strong);
  color: #607286;
  background: #fff;
}

.download-button {
  padding: 0 12px;
  color: #fff;
  background: var(--burgundy);
}

.download-button:hover,
.download-button:focus-visible {
  background: #74283b;
  box-shadow: 0 5px 13px rgba(140, 53, 73, 0.22);
}

.preview-stage {
  min-height: 575px;
  max-height: calc(100vh - 245px);
  padding: 24px;
  background: #edf1f4;
  overflow: auto;
}

.preview-empty,
.generation-state {
  display: flex;
  min-height: 500px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

.preview-empty > span,
.generation-state__icon {
  display: grid;
  width: 55px;
  height: 55px;
  place-items: center;
  border: 1px solid #cbd6df;
  border-radius: 8px;
  color: #7890a4;
  background: #f8fafb;
}

.preview-empty svg,
.generation-state svg {
  width: 25px;
  height: 25px;
}

.preview-empty h4,
.generation-state h4 {
  margin: 15px 0 6px;
  color: #4a5b6d;
  font-size: 12px;
}

.preview-empty p,
.generation-state p {
  max-width: 300px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.generation-state__icon {
  color: var(--burgundy);
  background: var(--burgundy-soft);
  animation: generation-pulse 1.5s infinite ease-in-out;
}

.progress-track {
  width: min(280px, 70%);
  height: 5px;
  margin-top: 20px;
  border-radius: 4px;
  background: #d9e0e6;
  overflow: hidden;
}

.progress-track span {
  display: block;
  width: 10%;
  height: 100%;
  border-radius: inherit;
  background: var(--burgundy);
  transition: width 350ms ease;
}

.document-sheet {
  width: min(760px, 100%);
  min-height: 940px;
  margin: 0 auto;
  padding: 56px 62px;
  color: #222;
  background: #fff;
  box-shadow: 0 3px 16px rgba(28, 41, 54, 0.12);
  font-family: "Times New Roman", Times, serif;
  font-size: 14px;
  line-height: 1.55;
}

.document-sheet:focus {
  outline: 2px solid rgba(47, 110, 156, 0.28);
}

.document-sheet h1 {
  margin: 0 0 6px;
  font-size: 18px;
  letter-spacing: 0;
  line-height: 1.4;
  text-align: center;
  text-transform: uppercase;
}

.document-sheet .document-subtitle {
  margin: 0 0 24px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.document-sheet h2 {
  margin: 20px 0 8px;
  font-size: 15px;
  letter-spacing: 0;
  line-height: 1.4;
}

.document-sheet h3 {
  margin: 14px 0 6px;
  font-size: 14px;
}

.document-sheet p {
  margin: 6px 0;
}

.document-sheet ul,
.document-sheet ol {
  margin: 6px 0;
  padding-left: 23px;
}

.document-sheet li {
  margin-bottom: 4px;
}

.document-sheet table {
  width: 100%;
  margin: 10px 0 18px;
  border-collapse: collapse;
  font-size: 12px;
}

.document-sheet th,
.document-sheet td {
  padding: 7px 8px;
  border: 1px solid #333;
  vertical-align: top;
  text-align: left;
}

.document-sheet th {
  background: #edf1f4;
  font-weight: 700;
  text-align: center;
}

.document-sheet .document-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 24px;
  margin-bottom: 18px;
  padding: 10px 0;
  border-top: 1px solid #777;
  border-bottom: 1px solid #777;
}

.document-sheet .answer-box {
  margin: 12px 0;
  padding: 10px 12px;
  border-left: 3px solid #555;
  background: #f3f3f3;
}

.edit-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 9px 16px;
  border-top: 1px solid var(--line);
  color: #7b8997;
  background: #fafbfc;
  font-size: 8px;
}

.edit-hint svg {
  width: 13px;
  height: 13px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  max-width: min(360px, calc(100vw - 32px));
  padding: 11px 14px;
  border-radius: 7px;
  color: #fff;
  background: #263746;
  box-shadow: 0 10px 28px rgba(26, 39, 52, 0.25);
  font-size: 10px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes generation-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(140, 53, 73, 0.18);
  }

  50% {
    box-shadow: 0 0 0 9px rgba(140, 53, 73, 0);
  }
}

@media (max-width: 1100px) {
  :root {
    --sidebar-width: 248px;
  }

  .dashboard-view,
  .workspace-view {
    padding-right: 26px;
    padding-left: 26px;
  }

  .workspace-grid {
    grid-template-columns: 340px minmax(420px, 1fr);
  }

  .document-sheet {
    padding: 42px 38px;
  }
}

@media (max-width: 900px) {
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .tool-card {
    display: grid;
    min-height: 0;
    grid-template-columns: 70px 1fr auto;
    gap: 14px;
    align-items: center;
  }

  .tool-card__top {
    margin: 0;
  }

  .tool-card__number {
    display: none;
  }

  .tool-card h3 br {
    display: none;
  }

  .tool-card > button {
    margin: 0;
    padding: 10px;
  }

  .process-band {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .form-panel {
    position: static;
  }

  .preview-stage {
    max-height: none;
  }
}

@media (max-width: 720px) {
  .app-shell {
    min-height: 100%;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(88vw, 310px);
    transform: translateX(-102%);
    transition: transform 200ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
    box-shadow: 18px 0 35px rgba(16, 34, 50, 0.3);
  }

  .sidebar__close,
  .mobile-menu {
    display: grid;
  }

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 15;
    display: block;
    background: rgba(18, 30, 42, 0.48);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
  }

  .sidebar-scrim.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .topbar {
    min-height: 68px;
    padding: 11px 15px;
  }

  .topbar__status {
    padding: 7px;
  }

  .topbar__status span:last-child {
    display: none;
  }

  .dashboard-view,
  .workspace-view {
    padding: 28px 16px 40px;
  }

  .welcome-band {
    padding-bottom: 27px;
  }

  .welcome-band h2 {
    font-size: 27px;
  }

  .welcome-band__seal {
    display: none;
  }

  .tool-card {
    grid-template-columns: 50px minmax(0, 1fr);
    padding: 17px;
  }

  .tool-card__icon {
    width: 43px;
    height: 43px;
  }

  .tool-card > button {
    grid-column: 2;
    justify-self: start;
    padding: 4px 0;
  }

  .tool-card h3 {
    font-size: 18px;
  }

  .process-list {
    grid-template-columns: 1fr;
  }

  .process-list li {
    min-height: 38px;
  }

  .workspace-heading h2 {
    font-size: 23px;
  }

  .preview-toolbar {
    align-items: flex-start;
  }

  .preview-actions {
    align-self: center;
  }

  .download-button {
    width: 38px;
    padding: 0;
  }

  .download-button {
    font-size: 0;
  }

  .download-button svg {
    width: 17px;
    height: 17px;
  }

  .preview-stage {
    min-height: 460px;
    padding: 10px;
  }

  .preview-empty,
  .generation-state {
    min-height: 430px;
  }

  .document-sheet {
    min-height: 720px;
    padding: 34px 24px;
    font-size: 13px;
  }
}

@media (max-width: 430px) {
  .form-fields {
    grid-template-columns: 1fr;
  }

  .field--full {
    grid-column: auto;
  }

  .check-group {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .secondary-button {
    width: 100%;
  }

  .document-sheet .document-meta {
    grid-template-columns: 1fr;
  }
}

@media print {
  body * {
    visibility: hidden;
  }

  .document-sheet,
  .document-sheet * {
    visibility: visible;
  }

  .document-sheet {
    position: absolute;
    inset: 0;
    width: 100%;
    min-height: auto;
    padding: 20mm;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
