:root {
  --ink: #122a3e;
  --ink-2: #203a50;
  --muted: #667784;
  --muted-2: #8d9aa3;
  --paper: #f4f5f1;
  --surface: #ffffff;
  --surface-2: #fafbf8;
  --line: #dce3e1;
  --line-strong: #c9d3d0;
  --blue: #0b5d8e;
  --blue-deep: #0a3c61;
  --blue-soft: #e7f1f6;
  --teal: #1c8176;
  --teal-soft: #e4f2ee;
  --orange: #e06d34;
  --orange-soft: #f9ece4;
  --red: #d94a43;
  --shadow: 0 20px 55px rgba(19, 42, 58, 0.08);
  --shadow-soft: 0 8px 28px rgba(19, 42, 58, 0.06);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --sans: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  --serif: "Bahnschrift", "DIN Alternate", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 5%, rgba(27, 130, 118, 0.08), transparent 25rem),
    linear-gradient(180deg, #f9faf7 0, var(--paper) 32rem, #f2f4f1 100%);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(11, 93, 142, 0.25);
  outline-offset: 2px;
}

svg {
  display: block;
}

.app-shell {
  width: min(100% - 40px, 1680px);
  margin: 0 auto;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 76px;
  border-bottom: 1px solid rgba(18, 42, 62, 0.1);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--ink);
  transform: rotate(-3deg);
}

.brand-mark span {
  width: 3px;
  border-radius: 10px;
  background: #fff;
}

.brand-mark span:nth-child(1) {
  height: 13px;
}

.brand-mark span:nth-child(2) {
  height: 21px;
  background: #79c5b8;
}

.brand-mark span:nth-child(3) {
  height: 15px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-copy strong {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.brand-copy small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.topbar-context {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.live-dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
}

.live-dot::after {
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(28, 129, 118, 0.25);
  border-radius: inherit;
  content: "";
}

.context-divider {
  color: var(--line-strong);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: none;
  font-weight: 600;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button svg,
.icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.button-quiet {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.62);
}

.button-quiet:hover {
  border-color: var(--line-strong);
  background: #fff;
}

.button-primary {
  color: #fff;
  background: var(--ink);
  box-shadow: 0 8px 20px rgba(18, 42, 62, 0.16);
}

.button-primary:hover {
  background: var(--blue-deep);
  box-shadow: 0 12px 24px rgba(18, 42, 62, 0.2);
}

main {
  padding-top: 38px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(330px, 0.6fr);
  align-items: end;
  gap: 7vw;
  padding: 16px 4px 30px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--teal);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.eyebrow-index {
  display: inline-grid;
  place-items: center;
  width: 29px;
  height: 20px;
  border-radius: 20px;
  color: var(--teal);
  background: var(--teal-soft);
  font-size: 10px;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 780px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(38px, 3.8vw, 54px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.hero h1 span {
  color: var(--blue);
}

.hero-copy p {
  max-width: 620px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.hero-spec {
  position: relative;
  overflow: hidden;
  padding: 20px 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  color: #eef7f5;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 55%),
    var(--ink);
  box-shadow: var(--shadow);
}

.hero-spec::after {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(168, 223, 213, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168, 223, 213, 0.12) 1px, transparent 1px);
  background-size: 14px 14px;
  content: "";
  mask-image: linear-gradient(90deg, transparent 42%, #000);
  pointer-events: none;
}

.hero-spec-heading,
.hero-spec-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(238, 247, 245, 0.58);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.draft-state {
  display: flex;
  align-items: center;
  gap: 6px;
}

.draft-state::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #79c5b8;
  content: "";
}

.hero-spec-main {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 18px 0 16px;
}

.template-monogram {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  color: #a8dfd5;
  background: rgba(255, 255, 255, 0.05);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.hero-spec-main div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.hero-spec-main strong {
  overflow: hidden;
  font-size: 16px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-spec-main div span {
  margin-top: 5px;
  color: rgba(238, 247, 245, 0.55);
  font-size: 11px;
}

.hero-rule {
  position: relative;
  z-index: 1;
  height: 1px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.1);
}

.hero-spec-foot strong {
  margin-left: 5px;
  color: #fff;
  font-weight: 500;
  font-family: var(--serif);
  letter-spacing: 0.03em;
}

.control-deck {
  padding: 28px;
  border: 1px solid rgba(18, 42, 62, 0.1);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.section-heading,
.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.section-heading h2,
.panel-heading h2 {
  margin: 5px 0 0;
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.section-kicker,
.panel-index {
  color: var(--teal);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.section-note {
  padding-top: 7px;
  color: var(--muted-2);
  font-size: 11px;
}

.template-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 23px 0 14px;
}

.template-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 92px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: left;
  background: var(--surface);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease,
    background 180ms ease;
}

.template-option:hover {
  border-color: #aac9cb;
  box-shadow: 0 9px 22px rgba(18, 42, 62, 0.06);
  transform: translateY(-2px);
}

.template-option.is-active {
  border-color: #9dcac2;
  background: linear-gradient(135deg, #f9fdfb, #edf7f3);
  box-shadow: inset 0 0 0 1px rgba(28, 129, 118, 0.08);
}

.template-icon {
  position: relative;
  display: flex;
  width: 58px;
  height: 48px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 3px;
  overflow: hidden;
  border-radius: 13px;
  background: var(--surface-2);
}

.template-icon::before,
.template-icon::after {
  position: absolute;
  top: 16px;
  width: 9px;
  height: 16px;
  border-radius: 3px;
  background: var(--ink);
  content: "";
}

.template-icon::before {
  left: 4px;
}

.template-icon::after {
  right: 4px;
}

.template-icon span {
  width: 2px;
  height: 17px;
  border-radius: 2px;
  background: #d9a447;
}

.template-icon-ribbon {
  gap: 4px;
}

.template-icon-ribbon span {
  width: 3px;
  border-radius: 3px;
  background: var(--teal);
}

.template-icon-ribbon span:nth-child(even) {
  background: #7eaa9f;
}

.template-option.is-active .template-icon {
  background: #fff;
}

.template-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.template-title {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.template-title strong {
  font-size: 16px;
  font-weight: 700;
}

.template-title span {
  overflow: hidden;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-description {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.template-check {
  position: absolute;
  top: 12px;
  right: 12px;
  display: none;
  width: 19px;
  height: 19px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--teal);
  font-size: 10px;
  font-weight: 700;
}

.template-option.is-active .template-check {
  display: grid;
}

.prompt-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}

.prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 16px 0;
}

.prompt-head label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.prompt-head span {
  color: var(--muted-2);
  font-size: 10px;
}

.prompt-input {
  display: block;
  width: 100%;
  min-height: 94px;
  padding: 11px 16px 12px;
  resize: vertical;
  border: 0;
  outline: none;
  color: var(--ink-2);
  background: transparent;
  font-size: 14px;
  line-height: 1.75;
}

.prompt-input::placeholder {
  color: #a3afb5;
}

.prompt-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 12px 11px 16px;
  border-top: 1px solid #edf0ee;
}

.example-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.example-chip {
  padding: 6px 10px;
  border: 1px solid #e2e8e5;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 10px;
  transition:
    border-color 150ms ease,
    color 150ms ease,
    background 150ms ease;
}

.example-chip:hover {
  border-color: #b7cfca;
  color: var(--teal);
  background: var(--teal-soft);
}

.prompt-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.character-count {
  color: var(--muted-2);
  font-family: var(--serif);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.button-generate {
  min-height: 39px;
  padding: 0 16px;
  color: #fff;
  background: var(--teal);
  box-shadow: 0 7px 16px rgba(28, 129, 118, 0.16);
}

.button-generate:hover {
  background: #176d64;
}

.button-generate.is-loading svg {
  animation: spin 750ms linear infinite;
}

.button-generate.is-loading svg path {
  d: path("M12 3a9 9 0 1 0 9 9");
}

.parse-status {
  display: flex;
  min-height: 37px;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-top: 1px solid #edf0ee;
  background: #fbfcfa;
  font-size: 10px;
}

.parse-status-icon {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border: 1px solid var(--teal);
  border-radius: 50%;
  background: var(--teal-soft);
}

.parse-status.is-ready .parse-status-icon {
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(28, 129, 118, 0.1);
}

.parse-status.is-warning .parse-status-icon {
  border-color: var(--orange);
  background: var(--orange-soft);
}

.parse-status-copy {
  flex: 0 0 auto;
  color: var(--muted);
}

.parse-tags {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 5px;
}

.parse-tag {
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--teal);
  background: var(--teal-soft);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(285px, 0.74fr) minmax(440px, 1.45fr) minmax(330px, 0.95fr);
  gap: 14px;
  margin-top: 14px;
  align-items: stretch;
}

.panel {
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(18, 42, 62, 0.1);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
}

.config-panel,
.preview-panel,
.cover-panel {
  padding: 20px;
}

.panel-heading {
  align-items: center;
}

.panel-heading > div:first-child {
  min-width: 0;
}

.panel-heading h2 {
  font-size: 18px;
}

.panel-index {
  margin-right: 4px;
}

.panel-intro,
.cover-note {
  margin: 9px 0 18px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.text-button {
  padding: 4px;
  border: 0;
  color: var(--blue);
  background: none;
  font-size: 10px;
}

.text-button:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.spec-form {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
}

.form-section {
  padding-top: 12px;
  border-top: 1px solid #e8ecea;
}

.form-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.form-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.form-section-title::after {
  height: 1px;
  flex: 1;
  margin-left: 10px;
  background: #edf0ee;
  content: "";
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 9px;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.field.is-wide {
  grid-column: 1 / -1;
}

.field label {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-control {
  position: relative;
  display: flex;
  align-items: center;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  padding: 0 9px;
  border: 1px solid #dfe5e2;
  border-radius: 8px;
  outline: none;
  color: var(--ink-2);
  background: #fff;
  font-size: 11px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.field input,
.field select {
  height: 35px;
}

.field textarea {
  min-height: 58px;
  padding-top: 8px;
  padding-bottom: 8px;
  resize: vertical;
  line-height: 1.55;
}

.field select {
  padding-right: 27px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #71818b 50%),
    linear-gradient(135deg, #71818b 50%, transparent 50%);
  background-position:
    calc(100% - 13px) 15px,
    calc(100% - 9px) 15px;
  background-repeat: no-repeat;
  background-size: 4px 4px, 4px 4px;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: #c6d2ce;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #80b8ae;
  box-shadow: 0 0 0 3px rgba(28, 129, 118, 0.09);
}

.field-suffix {
  position: absolute;
  right: 9px;
  color: var(--muted-2);
  font-size: 9px;
  pointer-events: none;
}

.field.has-suffix input {
  padding-right: 34px;
}

.field.is-recognized label::after {
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-left: 5px;
  border-radius: 50%;
  background: var(--teal);
  vertical-align: 2px;
  content: "";
}

.preview-heading {
  margin-bottom: 14px;
}

.board-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f8faf8;
}

.board-tools,
.board-secondary {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
}

.board-button,
.board-upload-button,
.board-icon-button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #50636f;
  background: transparent;
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
  transition:
    color 140ms ease,
    background 140ms ease,
    border-color 140ms ease;
}

.board-button {
  padding: 0 9px;
}

.board-upload-button {
  padding: 0 8px;
}

.board-icon-button {
  width: 32px;
  padding: 0;
}

.board-button svg,
.board-upload-button svg,
.board-icon-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
}

.board-button:hover,
.board-icon-button:hover,
.board-upload-button:hover {
  border-color: #d4dfdb;
  color: var(--ink);
  background: #fff;
}

.board-button.is-active {
  color: #fff;
  background: var(--ink);
}

.board-button:disabled,
.board-icon-button:disabled {
  opacity: 0.35;
  pointer-events: none;
}

.board-divider {
  width: 1px;
  height: 19px;
  margin: 0 2px;
  background: var(--line);
}

.board-reference-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -1px 0 9px;
  padding: 7px 9px;
  border: 1px solid #d9e5e1;
  border-radius: 9px;
  color: var(--muted);
  background: #f2f8f5;
  font-size: 9px;
}

.board-reference-bar[hidden],
.attachment-list[hidden],
.board-assets[hidden] {
  display: none;
}

.board-assets {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin: -2px 0 9px;
  padding: 6px 7px;
  border: 1px solid #dbe4e1;
  border-radius: 9px;
  background: #fbfcfa;
}

.board-assets label {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.board-assets select,
.asset-button {
  height: 29px;
  padding: 0 8px;
  border: 1px solid #d7e0dd;
  border-radius: 6px;
  color: var(--ink-2);
  background: #fff;
  font-size: 9px;
}

.board-assets select {
  padding-right: 23px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #71818b 50%),
    linear-gradient(135deg, #71818b 50%, transparent 50%);
  background-position:
    calc(100% - 11px) 12px,
    calc(100% - 7px) 12px;
  background-repeat: no-repeat;
  background-size: 4px 4px;
}

.asset-button:hover,
.board-assets select:hover {
  border-color: #9fbfba;
  color: var(--teal);
}

.reference-badge {
  padding: 2px 5px;
  border-radius: 4px;
  color: #fff;
  background: var(--teal);
  font-family: var(--serif);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.reference-name {
  overflow: hidden;
  flex: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-opacity {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.reference-opacity input {
  width: 72px;
  accent-color: var(--teal);
}

.reference-remove {
  border: 0;
  color: var(--blue);
  background: none;
  font-size: 9px;
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: -2px 0 9px;
}

.attachment-chip {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  border: 1px solid #dfe6e3;
  border-radius: 6px;
  color: var(--muted);
  background: #fff;
  font-size: 8px;
}

.attachment-chip span {
  overflow: hidden;
  max-width: 165px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-chip button {
  padding: 0;
  border: 0;
  color: #88969c;
  background: none;
  line-height: 1;
}

.preview-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.zoom-controls {
  display: inline-flex;
  height: 30px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.zoom-controls button {
  height: 100%;
  padding: 0 7px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
}

.zoom-controls button:hover {
  color: var(--teal);
  background: var(--teal-soft);
}

.zoom-controls span {
  min-width: 38px;
  color: var(--ink-2);
  font-family: var(--serif);
  font-size: 8px;
  text-align: center;
}

.preview-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9px;
}

.preview-live i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--teal);
}

.icon-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: #fff;
  transition:
    color 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

.icon-button:hover {
  border-color: #b8ccc6;
  color: var(--teal);
  background: var(--teal-soft);
}

.preview-stage {
  position: relative;
  display: flex;
  min-height: 285px;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #cbd3d2;
  border-radius: 10px;
  background-color: #ffffff;
  background-image:
    linear-gradient(rgba(18, 42, 62, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 42, 62, 0.028) 1px, transparent 1px);
  background-size:
    12px 12px,
    12px 12px;
  box-shadow: inset 0 0 0 5px #f8f9f7;
}

.preview-stage::before {
  position: absolute;
  top: 7px;
  left: 7px;
  width: 14px;
  height: 14px;
  border-top: 1px solid #9aa8a6;
  border-left: 1px solid #9aa8a6;
  content: "";
}

.stage-label,
.stage-caption,
.stage-scale {
  position: absolute;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  color: #85928f;
  font-family: var(--serif);
  font-size: 8px;
  letter-spacing: 0.11em;
}

.preview-stage .stage-label,
.preview-stage .stage-scale,
.preview-stage .stage-caption {
  display: none;
}

.stage-label {
  top: 13px;
  right: 14px;
  left: 14px;
}

.stage-scale {
  right: 15px;
  bottom: 38px;
  left: 15px;
  padding-top: 4px;
  border-top: 1px solid rgba(18, 42, 62, 0.09);
  font-size: 7px;
}

.stage-caption {
  right: 14px;
  bottom: 12px;
  left: 14px;
  font-size: 8px;
  letter-spacing: 0.05em;
}

.svg-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 250px;
  flex: 1;
}

#wireSvg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.board-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow: visible;
  cursor: default;
  touch-action: none;
}

.board-layer.is-draw-mode {
  cursor: crosshair;
}

.board-layer.is-select-mode {
  cursor: default;
}

.board-layer.is-erase-mode {
  cursor: cell;
}

.board-layer.is-pan-mode,
.board-layer.is-panning {
  cursor: grab;
}

.board-layer.is-panning {
  cursor: grabbing;
}

.board-layer [data-board-shape-id] {
  pointer-events: none;
}

.board-layer.is-select-mode [data-board-shape-id] {
  pointer-events: stroke;
  cursor: move;
}

.board-layer.is-select-mode rect[data-board-shape-id],
.board-layer.is-select-mode ellipse[data-board-shape-id],
.board-layer.is-select-mode text[data-board-shape-id],
.board-layer.is-select-mode image[data-board-shape-id],
.board-layer.is-select-mode polyline[data-board-shape-id] {
  pointer-events: all;
}

.board-layer.is-select-mode [data-board-shape-id].board-preset {
  pointer-events: all;
  cursor: move;
}

.board-layer .board-selection {
  fill: rgba(28, 129, 118, 0.08);
  stroke: #1c8176;
  stroke-width: 1;
  stroke-dasharray: 4 3;
  pointer-events: none;
}

.board-layer .board-selection-handle {
  fill: var(--blue);
  stroke: #fff;
  stroke-width: 1.5;
  pointer-events: all;
  cursor: grab;
}

.board-layer .board-selection-scale {
  fill: #fff;
  stroke: var(--blue);
  stroke-width: 1.5;
  pointer-events: all;
  cursor: nwse-resize;
}

.board-layer .board-rotate-line {
  fill: none;
  stroke: #1c8176;
  stroke-width: 1;
  stroke-dasharray: 3 2;
  pointer-events: none;
}

.board-layer .board-erase-range {
  fill: rgba(224, 109, 52, 0.08);
  stroke: #e06d34;
  stroke-width: 1;
  stroke-dasharray: 5 4;
  pointer-events: none;
}

.board-text-editor {
  position: absolute;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 5px;
  width: min(270px, calc(100% - 16px));
  padding: 6px;
  border: 1px solid #aebfbb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(18, 42, 62, 0.16);
}

.board-text-editor[hidden] {
  display: none;
}

.board-text-editor input {
  min-width: 0;
  height: 30px;
  flex: 1;
  padding: 0 8px;
  border: 1px solid #d6e0dd;
  border-radius: 6px;
  outline: none;
  color: var(--ink);
  background: #fff;
  font-size: 11px;
}

.board-text-editor input:focus {
  border-color: #75ada4;
  box-shadow: 0 0 0 3px rgba(28, 129, 118, 0.09);
}

.board-text-editor button {
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: var(--blue);
  font-size: 9px;
  font-weight: 600;
}

.board-text-editor .board-text-close {
  width: 26px;
  padding: 0;
  color: var(--muted);
  background: #f0f3f1;
  font-size: 14px;
}

#wireSvg .technical-line {
  fill: none;
  stroke: #9aabaa;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

#wireSvg .technical-text {
  fill: #647674;
  font-family: var(--sans);
  font-size: 10px;
}

#wireSvg .technical-label {
  fill: #1a3649;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
}

#wireSvg .micro-label {
  fill: #71827f;
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: 0.04em;
}

#wireSvg .draw-item {
  transform-origin: center;
  animation: reveal-drawing 500ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}

.drawing-note {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.drawing-note label {
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 600;
}

.drawing-note textarea {
  width: 100%;
  min-height: 74px;
  padding: 10px 11px;
  resize: vertical;
  border: 1px solid #dfe5e2;
  border-radius: 9px;
  outline: none;
  color: var(--ink);
  background: #fbfcfa;
  font-size: 11px;
  line-height: 1.65;
}

.drawing-note textarea:focus {
  border-color: #80b8ae;
  box-shadow: 0 0 0 3px rgba(28, 129, 118, 0.09);
}

.metric {
  min-width: 0;
  padding: 11px 10px;
  border: 1px solid #e7ece9;
  border-radius: 10px;
  background: #fbfcfa;
}

.metric span {
  display: block;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric strong {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric small {
  margin-left: 2px;
  color: var(--muted-2);
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 400;
}

.insight-bar {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 12px;
  padding: 12px 13px;
  border-radius: 11px;
  background: var(--blue-soft);
}

.insight-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: var(--blue);
  background: #fff;
}

.insight-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.insight-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.insight-copy strong {
  font-size: 10px;
}

.insight-copy span {
  overflow: hidden;
  margin-top: 2px;
  color: #59768a;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.insight-tag {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 5px;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.72);
  font-family: var(--serif);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.cover-panel {
  overflow: hidden;
}

.cover-heading {
  margin-bottom: 7px;
}

.cover-viewport {
  display: flex;
  flex: 1;
  align-items: flex-start;
  justify-content: center;
  padding: 14px;
  border-radius: 13px;
  background: #e8eeeb;
}

.cover-sheet {
  position: relative;
  width: 100%;
  min-height: 0;
  aspect-ratio: 210 / 297;
  overflow: hidden;
  color: #1c2d3a;
  background: #fff;
  box-shadow: 0 5px 18px rgba(18, 42, 62, 0.12);
}

.cover-sheet::after {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(18, 42, 62, 0.05);
  pointer-events: none;
  content: "";
}

.cover-sheet.is-word-rendered {
  height: auto;
  min-height: 0;
  aspect-ratio: auto;
  overflow: hidden;
}

.pdf-cover-image {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}

.pdf-cover-data-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  color: #111;
  font-family: "SimSun", "Microsoft YaHei";
}

.pdf-data-value {
  position: absolute;
  max-width: 66%;
  overflow: hidden;
  padding: 0 0.15%;
  font-size: calc(var(--pdf-scale, 1) * 12px);
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #fff;
  transform: translateY(-88%);
}

.pdf-data-value.is-wide {
  max-width: 36%;
  font-size: calc(var(--pdf-scale, 1) * 10.5px);
}

.pdf-data-value.is-special {
  width: 70%;
  max-width: 70%;
  font-size: calc(var(--pdf-scale, 1) * 8.5px);
}

.pdf-checkbox {
  position: absolute;
  display: inline-block;
  width: calc(var(--pdf-scale, 1) * 12px);
  height: calc(var(--pdf-scale, 1) * 12px);
  box-sizing: border-box;
  border: max(1px, calc(var(--pdf-scale, 1) * 0.8px)) solid #111;
  background: #fff;
}

.pdf-checkbox.is-checked::after {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: calc(var(--pdf-scale, 1) * 11px);
  font-weight: 700;
  line-height: 1;
  content: "✓";
  transform: translate(-50%, -54%);
}

.cover-sheet .docx-wrapper,
.cover-sheet .moka-docx-wrapper {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}

.cover-sheet .docx-wrapper > .docx,
.cover-sheet .moka-docx-wrapper > .moka-docx {
  margin: 0 !important;
  border: 0 !important;
  background: #fff;
  box-shadow: none !important;
}

.word-checkbox {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 1px;
  border: 1px solid #202020;
  box-sizing: border-box;
  vertical-align: -0.5px;
}

.word-checkbox.is-checked::after {
  position: absolute;
  top: -2px;
  left: 1px;
  color: #202020;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  content: "✓";
}

.docx-cover-loading {
  display: grid;
  min-height: 430px;
  place-items: center;
  color: var(--muted);
  background:
    linear-gradient(90deg, transparent, rgba(18, 42, 62, 0.035), transparent) 0 0 / 220px 100%,
    #fff;
  font-size: 10px;
  animation: docx-loading 1.2s linear infinite;
}

.doc-topline {
  height: 4px;
  background: linear-gradient(90deg, var(--blue) 0 72%, var(--red) 72% 100%);
}

.doc-masthead {
  display: grid;
  grid-template-columns: 0.85fr 1.9fr 0.85fr;
  align-items: center;
  gap: 7px;
  padding: 11px 18px 9px;
  border-bottom: 1px solid #cfd8dd;
}

.doc-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
}

.doc-logo {
  color: var(--blue-deep);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.doc-brand small {
  margin-top: 4px;
  color: #7d8d99;
  font-size: 4px;
  letter-spacing: 0.11em;
}

.doc-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  line-height: 1.2;
}

.doc-title > span {
  margin-bottom: 2px;
  color: var(--red);
  font-size: 5px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.doc-title strong {
  color: #172c3c;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.doc-title small {
  margin-top: 2px;
  color: #8997a1;
  font-size: 3px;
  letter-spacing: 0.09em;
}

.doc-version {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  color: #778894;
  font-size: 4px;
}

.doc-version span:first-child {
  color: var(--blue);
  font-weight: 700;
}

.doc-file-line {
  display: flex;
  justify-content: space-between;
  padding: 4px 18px;
  color: #7d8d99;
  background: #f5f7f8;
  font-size: 3.5px;
}

.doc-identity-grid {
  display: grid;
  grid-template-columns: 1fr 1.72fr;
  margin: 7px 18px 0;
  border-top: 1px solid #aebcc5;
  border-left: 1px solid #aebcc5;
}

.doc-identity-cell {
  display: grid;
  min-height: 25px;
  grid-template-columns: 45px 1fr;
  border-right: 1px solid #aebcc5;
  border-bottom: 1px solid #aebcc5;
}

.doc-identity-cell:nth-child(3n + 1),
.doc-identity-cell:nth-child(3n + 2) {
  grid-column: auto;
}

.doc-label {
  display: flex;
  align-items: center;
  padding: 4px;
  border-right: 1px solid #d7e0e4;
  color: #566976;
  background: #f2f5f6;
  font-size: 4.4px;
  line-height: 1.35;
}

.doc-value {
  display: flex;
  min-width: 0;
  align-items: center;
  padding: 4px 5px;
  color: #1e3443;
  font-size: 5px;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-all;
}

.doc-value.is-subtle {
  color: #81909a;
  font-weight: 400;
}

.doc-section {
  margin: 7px 18px 0;
  border-top: 1px solid #9eafba;
  border-left: 1px solid #b8c4cb;
}

.doc-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 16px;
  padding: 3px 6px;
  border-right: 1px solid #b8c4cb;
  border-bottom: 1px solid #b8c4cb;
  color: #1d3444;
  background: #edf2f4;
  font-size: 5.2px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.doc-section-title span {
  color: #82919b;
  font-size: 3.5px;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.doc-attr-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.doc-attr-row {
  display: grid;
  min-height: 17px;
  grid-template-columns: 45px minmax(0, 1fr);
  border-right: 1px solid #b8c4cb;
  border-bottom: 1px solid #dce3e6;
}

.doc-attr-row.is-wide {
  grid-column: 1 / -1;
}

.doc-attr-row dt {
  display: flex;
  align-items: center;
  padding: 3px 4px;
  color: #6d7d87;
  background: #f7f9fa;
  font-size: 3.8px;
  line-height: 1.3;
}

.doc-attr-row dd {
  display: flex;
  min-width: 0;
  align-items: center;
  margin: 0;
  padding: 3px 5px;
  color: #213847;
  font-size: 4.3px;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-all;
}

.doc-checkbox-line {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 5px;
}

.doc-option {
  color: #8998a1;
}

.doc-option.is-selected {
  color: #173d5b;
  font-weight: 700;
}

.doc-option.is-selected::before {
  display: inline-grid;
  width: 5px;
  height: 5px;
  margin-right: 2px;
  place-items: center;
  border: 0.5px solid #356c91;
  border-radius: 1px;
  color: #fff;
  background: var(--blue);
  font-size: 3px;
  content: "✓";
  vertical-align: 0;
}

.doc-option:not(.is-selected)::before {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 2px;
  border: 0.5px solid #9eabb3;
  border-radius: 1px;
  content: "";
}

.doc-long-text {
  display: block;
  overflow: hidden;
  max-height: 29px;
  line-height: 1.55;
}

.doc-signoff {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin: 7px 18px 0;
}

.doc-sign-box {
  border: 1px solid #b8c4cb;
}

.doc-sign-box > strong {
  display: block;
  padding: 3px 5px;
  border-bottom: 1px solid #d5dee2;
  color: #516672;
  background: #f5f7f8;
  font-size: 4px;
  font-weight: 500;
}

.doc-sign-box > span {
  display: flex;
  min-height: 28px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 4px 5px;
  color: #788892;
  font-size: 3.8px;
}

.doc-sign-box b {
  color: #29404e;
  font-size: 5px;
  font-weight: 600;
}

.doc-footer {
  position: absolute;
  right: 18px;
  bottom: 8px;
  left: 18px;
  display: flex;
  justify-content: space-between;
  padding-top: 4px;
  border-top: 1px solid #dbe2e5;
  color: #8998a1;
  font-size: 3px;
}

.cover-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.button-soft {
  min-height: 39px;
  border-color: var(--line);
  color: var(--ink-2);
  background: #fff;
  font-size: 10px;
}

.button-dark {
  min-height: 39px;
  padding: 0 12px;
  color: #fff;
  background: var(--blue-deep);
  font-size: 10px;
}

.workflow-note {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  margin-top: 14px;
  padding: 21px 24px;
  border: 1px solid rgba(18, 42, 62, 0.09);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.58);
}

.workflow-number {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 12px;
  color: var(--teal);
  background: var(--teal-soft);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
}

.workflow-copy {
  display: flex;
  flex-direction: column;
}

.workflow-copy strong {
  font-size: 12px;
}

.workflow-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.workflow-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-2);
  font-size: 9px;
}

.workflow-steps span {
  padding: 4px 8px;
  border-radius: 5px;
}

.workflow-steps .is-done {
  color: var(--teal);
  background: var(--teal-soft);
}

.workflow-steps i {
  width: 14px;
  height: 1px;
  background: var(--line-strong);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 4px 35px;
  color: var(--muted-2);
  font-size: 9px;
}

.cover-dialog {
  width: min(92vw, 760px);
  max-height: 92vh;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 32px 90px rgba(18, 42, 62, 0.28);
}

.cover-dialog::backdrop {
  background: rgba(12, 28, 40, 0.62);
  backdrop-filter: blur(5px);
}

.dialog-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.dialog-bar > div {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.dialog-bar span {
  color: var(--teal);
  font-family: var(--serif);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.dialog-bar strong {
  font-size: 13px;
}

.dialog-body {
  max-height: calc(92vh - 61px);
  padding: 22px;
  overflow: auto;
}

.dialog-body .cover-sheet {
  width: min(100%, 600px);
  margin: 0 auto;
  font-size: 1.35em;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  padding: 11px 16px;
  border-radius: 10px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 12px 30px rgba(18, 42, 62, 0.22);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

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

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes reveal-drawing {
  from {
    opacity: 0;
    transform: translateY(7px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes docx-loading {
  to {
    background-position: 220px 0, 0 0;
  }
}

@media (max-width: 1320px) {
  .workspace {
    grid-template-columns: minmax(315px, 0.72fr) minmax(500px, 1.28fr);
  }

  .cover-panel {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(210px, 0.55fr) minmax(330px, 0.8fr) minmax(210px, 0.55fr);
    align-items: center;
    gap: 18px;
  }

  .cover-panel .cover-heading {
    align-self: end;
    margin: 0;
  }

  .cover-panel .cover-note {
    grid-column: 1;
    align-self: start;
    margin: -12px 0 0;
  }

  .cover-panel .cover-viewport {
    grid-column: 2;
    grid-row: 1 / span 3;
  }

  .cover-panel .cover-actions {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
    grid-template-columns: 1fr;
    margin: 0;
  }
}

@media (max-width: 980px) {
  .app-shell {
    width: min(100% - 28px, 860px);
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .topbar-context {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 22px;
    padding-bottom: 26px;
  }

  .hero h1 {
    font-size: clamp(38px, 6.5vw, 48px);
  }

  .hero-spec {
    max-width: 560px;
  }

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

  .config-panel {
    order: 2;
  }

  .preview-panel {
    order: 1;
  }

  .cover-panel {
    order: 3;
    grid-template-columns: minmax(180px, 0.65fr) minmax(310px, 1fr);
  }

  .cover-panel .cover-viewport {
    grid-column: 2;
  }

  .cover-panel .cover-actions {
    grid-column: 1;
    grid-row: 3;
    align-self: end;
  }
}

@media (max-width: 700px) {
  main {
    padding-top: 22px;
  }

  .app-shell {
    width: min(100% - 22px, 620px);
  }

  .topbar {
    min-height: 66px;
  }

  .brand-copy small {
    display: none;
  }

  .topbar-actions .button-quiet {
    display: none;
  }

  .button-primary {
    min-height: 38px;
    padding: 0 12px;
    font-size: 11px;
  }

  .hero {
    padding-top: 12px;
  }

  .hero h1 {
    font-size: clamp(32px, 9vw, 40px);
  }

  .hero-copy p {
    font-size: 13px;
  }

  .control-deck {
    padding: 19px;
    border-radius: 20px;
  }

  .section-heading {
    align-items: flex-end;
  }

  .section-note {
    display: none;
  }

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

  .template-option {
    min-height: 78px;
  }

  .prompt-head span {
    display: none;
  }

  .prompt-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .prompt-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .config-panel,
  .preview-panel,
  .cover-panel {
    padding: 16px;
  }

  .board-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .board-tools,
  .board-secondary {
    width: 100%;
  }

  .board-secondary {
    justify-content: flex-end;
  }

  .board-reference-bar {
    flex-wrap: wrap;
  }

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

  .field.is-wide {
    grid-column: auto;
  }

  .svg-wrap {
    min-height: 220px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cover-panel {
    display: block;
  }

  .cover-panel .cover-note {
    margin: -5px 0 14px;
  }

  .cover-panel .cover-viewport {
    max-width: 420px;
    margin: 0 auto;
  }

  .cover-panel .cover-actions {
    grid-template-columns: 1fr 1fr;
    margin-top: 12px;
    max-width: 420px;
    margin-right: auto;
    margin-left: auto;
  }

  .workflow-note {
    grid-template-columns: auto 1fr;
  }

  .workflow-steps {
    display: none;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 430px) {
  .topbar-actions .button-primary svg {
    display: none;
  }

  .hero-spec {
    padding: 19px;
  }

  .hero-spec-main {
    margin: 20px 0;
  }

  .section-heading h2 {
    font-size: 18px;
  }

  .template-title span {
    display: none;
  }

  .cover-actions {
    grid-template-columns: 1fr;
  }

  .board-button {
    padding: 0 7px;
    font-size: 8.5px;
  }

  .board-upload-button {
    padding: 0 6px;
    font-size: 8.5px;
  }
}

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

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  body {
    background: #fff;
  }

  .app-shell > header,
  main > .hero,
  main > .control-deck,
  .config-panel,
  .preview-panel,
  main > .workflow-note,
  .footer,
  .cover-heading,
  .cover-note,
  .cover-actions,
  .toast,
  .cover-dialog {
    display: none !important;
  }

  .app-shell {
    width: 210mm;
    margin: 0;
  }

  main {
    padding: 0;
  }

  .workspace {
    display: block;
    margin: 0;
  }

  .cover-panel {
    display: block;
    padding: 0;
    border: 0;
    background: #fff;
    box-shadow: none;
  }

  .cover-viewport {
    padding: 0;
    border-radius: 0;
    background: #fff;
  }

  #coverSheet {
    position: relative;
    width: 210mm;
    height: 296.8mm;
    aspect-ratio: auto;
    margin: 0;
    box-shadow: none;
  }

  #coverSheet .docx-wrapper,
  #coverSheet .moka-docx-wrapper {
    zoom: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #coverSheet .docx-wrapper > .docx,
  #coverSheet .moka-docx-wrapper > .moka-docx {
    margin: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  #coverSheet .doc-masthead {
    padding: 28px 38px 22px;
  }

  #coverSheet .doc-logo {
    font-size: 37px;
  }

  #coverSheet .doc-brand small {
    font-size: 8px;
  }

  #coverSheet .doc-title strong {
    font-size: 25px;
  }

  #coverSheet .doc-title > span,
  #coverSheet .doc-title small,
  #coverSheet .doc-version,
  #coverSheet .doc-file-line {
    font-size: 8px;
  }

  #coverSheet .doc-file-line {
    padding: 9px 38px;
  }

  #coverSheet .doc-identity-grid,
  #coverSheet .doc-section,
  #coverSheet .doc-signoff {
    margin-right: 38px;
    margin-left: 38px;
  }

  #coverSheet .doc-identity-cell {
    min-height: 50px;
    grid-template-columns: 100px 1fr;
  }

  #coverSheet .doc-label {
    padding: 8px;
    font-size: 9px;
  }

  #coverSheet .doc-value {
    padding: 8px 10px;
    font-size: 10px;
  }

  #coverSheet .doc-section-title {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 11px;
  }

  #coverSheet .doc-section-title span {
    font-size: 7px;
  }

  #coverSheet .doc-attr-row {
    min-height: 34px;
    grid-template-columns: 100px 1fr;
  }

  #coverSheet .doc-attr-row dt {
    padding: 6px 8px;
    font-size: 8px;
  }

  #coverSheet .doc-attr-row dd {
    padding: 6px 9px;
    font-size: 9px;
  }

  #coverSheet .doc-sign-box > strong,
  #coverSheet .doc-sign-box > span {
    font-size: 8px;
  }

  #coverSheet .doc-sign-box b {
    font-size: 10px;
  }

  #coverSheet .doc-sign-box > span {
    min-height: 55px;
    padding: 8px;
  }

  #coverSheet .doc-footer {
    right: 38px;
    bottom: 17px;
    left: 38px;
    font-size: 7px;
  }
}

.print-document {
  display: none;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  @page drawing {
    size: A4 landscape;
    margin: 10mm;
  }

  @page cover {
    size: A4 portrait;
    margin: 0;
  }

  body {
    margin: 0;
    background: #fff;
  }

  .app-shell,
  .cover-dialog,
  .toast {
    display: none !important;
  }

  .print-document {
    display: block !important;
  }

  .print-drawing-page {
    page: drawing;
    display: flex;
    width: 277mm;
    height: 190mm;
    flex-direction: column;
    break-before: auto;
    box-sizing: border-box;
    padding: 5mm;
    color: #182c3c;
    background: #fff;
    font-family: var(--sans);
  }

  .print-drawing-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10mm;
    padding-bottom: 3mm;
    border-bottom: 0.4mm solid #233847;
  }

  .print-drawing-head strong {
    font-size: 5mm;
  }

  .print-drawing-head span {
    color: #667983;
    font-size: 2.8mm;
  }

  .print-drawing-svg {
    display: flex;
    min-height: 0;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 4mm 0;
  }

  .print-drawing-svg svg {
    width: 100%;
    max-height: 125mm;
  }

  .print-note-box {
    display: grid;
    grid-template-columns: 28mm 1fr;
    gap: 4mm;
    min-height: 18mm;
    padding: 3mm 4mm;
    border: 0.35mm solid #697b85;
    font-size: 3mm;
    line-height: 1.55;
  }

  .print-note-box strong {
    color: #425965;
  }

  .print-note-box span {
    white-space: pre-wrap;
    word-break: break-word;
  }

  .print-cover-page {
    page: cover;
    width: 210mm;
    height: 297mm;
    overflow: hidden;
    break-after: page;
    background: #fff;
  }

  #printCoverSheet {
    position: relative;
    width: 210mm;
    height: 297mm;
    margin: 0;
    overflow: hidden;
    background: #fff;
    box-shadow: none;
    --pdf-scale: 1.33;
  }

  #printCoverSheet .moka-docx-wrapper {
    zoom: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
  }

  #printCoverSheet .moka-docx {
    margin: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
  }
}
