:root {
  --ink: #171916;
  --muted: #73766f;
  --line: #e7e8e4;
  --surface: #ffffff;
  --soft: #f5f6f3;
  --accent: #448cd9;
  --accent-dark: #317bc8;
  --accent-soft: #eaf4ff;
  --shadow: 0 18px 60px rgba(30, 38, 32, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 76px 1fr;
  background: #fff;
}

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 76px;
  padding: 0 18px 0 24px;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.topbar-button,
.close-button {
  border: 0;
  cursor: pointer;
}

.topbar-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  padding: 0;
  border-radius: 18px;
  color: #c7c7c9;
  background: transparent;
  line-height: 1;
  transition: transform 160ms ease, color 160ms ease, background 160ms ease;
}

.topbar-button:hover {
  color: #aeb0b4;
  background: rgba(246, 246, 247, 0.72);
  transform: scale(1.08);
}

.settings-button {
  font-size: 48px;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-weight: 300;
  font-variant-emoji: text;
}

.settings-button span {
  display: block;
  transform: translateY(-1px);
}

.add-button {
  font-size: 54px;
  font-weight: 200;
}

.add-button span {
  transform: translateY(-3px);
}

.voice-button {
  color: #c7c7c9;
}

.voice-glyph {
  position: relative;
  width: 36px;
  height: 30px;
  display: block;
}

.voice-glyph::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 26px;
  height: 19px;
  border: 2.4px solid currentColor;
  border-radius: 11px;
}

.voice-glyph::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 19px;
  width: 8px;
  height: 8px;
  border-left: 2.4px solid currentColor;
  transform: skewY(-38deg);
}

.voice-glyph i {
  position: absolute;
  right: 1px;
  bottom: 2px;
  width: 18px;
  height: 14px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-radius: 0 0 9px;
  opacity: 0.58;
}

.voice-button.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.voice-button.active::after {
  content: "";
  position: absolute;
  right: 9px;
  top: 9px;
  width: 7px;
  height: 7px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--accent);
}

.voice-button.listening .voice-glyph {
  animation: voice-pulse 1.35s ease-in-out infinite;
}

.voice-button.speaking .voice-glyph {
  animation: voice-speak 620ms ease-in-out infinite alternate;
}

.conversation {
  grid-row: 2;
  width: min(760px, calc(100% - 28px));
  min-height: 0;
  margin: 0 auto;
}

.conversation.has-messages {
  padding: 34px 0 132px;
}

.message-list {
  min-height: calc(100dvh - 242px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 7px;
}

.message {
  display: flex;
  animation: fade-up 260ms ease both;
}

.message.user {
  justify-content: flex-end;
}

.message-body {
  max-width: min(78%, 590px);
  padding: 9px 14px 10px;
  border-radius: 19px;
}

.message.assistant .message-body {
  background: #e9e9eb;
  border-bottom-left-radius: 6px;
}

.message.user .message-body {
  color: #fff;
  background: var(--accent);
  border-bottom-right-radius: 6px;
}

.message-body p {
  margin: 0;
  color: inherit;
  font-size: 15px;
  line-height: 1.42;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.composer-wrap {
  position: fixed;
  inset-inline: 0;
  z-index: 15;
  padding: 14px 16px max(16px, env(safe-area-inset-bottom));
  transition:
    top 420ms cubic-bezier(0.22, 1, 0.36, 1),
    bottom 420ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 420ms cubic-bezier(0.22, 1, 0.36, 1),
    background 220ms ease;
}

.composer-wrap.centered {
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
}

.composer-wrap.docked {
  top: auto;
  bottom: 0;
  transform: translateY(0);
  border-top: 1px solid rgba(60, 60, 67, 0.08);
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
}

.composer {
  width: min(620px, 100%);
  min-height: 50px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 0 auto;
  padding: 5px 5px 5px 17px;
  border: 1px solid #c7c7cc;
  border-radius: 25px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
  transition: 160ms ease;
}

.composer:focus-within {
  border-color: #a9a9ae;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.11);
}

.composer textarea {
  flex: 1;
  min-height: 38px;
  max-height: 150px;
  padding: 9px 0 7px;
  border: 0;
  outline: 0;
  resize: none;
  overflow-y: auto;
  color: var(--ink);
  background: transparent;
  line-height: 1.45;
}

.composer textarea::placeholder {
  color: #a2a59f;
}

.send-button {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  font-size: 20px;
  font-weight: 600;
  transition: 160ms ease;
}

.send-button:hover:not(:disabled) {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.send-button:disabled {
  background: #d1d1d6;
  cursor: default;
}

.drawer-layer,
.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.drawer-backdrop,
.modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(24, 29, 25, 0.24);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  cursor: default;
  animation: fade-in 180ms ease both;
}

.drawer {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(660px, 100%);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  background: #fbfcfa;
  box-shadow: var(--shadow);
  animation: slide-in 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 30px 32px 20px;
}

.eyebrow {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.drawer h2,
.modal h2 {
  margin: 5px 0 0;
  font-family: Georgia, serif;
  font-size: 31px;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.close-button {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #676a64;
  background: var(--soft);
  font-size: 24px;
  line-height: 1;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.tabs button {
  position: relative;
  padding: 13px 10px 14px;
  border: 0;
  color: #858881;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.tabs button.active {
  color: var(--ink);
}

.tabs button.active::after {
  content: "";
  position: absolute;
  inset: auto 10px -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.tabs button span {
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 9px;
  background: #eceeea;
  font-size: 10px;
}

.drawer-content {
  padding: 28px 32px 36px;
  overflow-y: auto;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fade-up 180ms ease both;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #555952;
  font-size: 12px;
  font-weight: 700;
}

.settings-form input,
.settings-form textarea {
  width: 100%;
  border: 1px solid #dfe2dc;
  border-radius: 12px;
  outline: 0;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  font-weight: 450;
  line-height: 1.55;
  transition: 150ms ease;
}

.settings-form input {
  height: 44px;
  padding: 0 13px;
}

.settings-form textarea {
  padding: 12px 13px;
  resize: vertical;
}

.settings-form input:focus,
.settings-form textarea:focus {
  border-color: #8bb4df;
  box-shadow: 0 0 0 3px rgba(68, 140, 217, 0.09);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.connection-state {
  display: flex;
  gap: 13px;
  padding: 15px;
  border-radius: 14px;
  background: #f1f2ef;
}

.connection-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #9b6b28;
  background: #f7ead7;
  font-weight: 800;
}

.connection-icon.connected {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.connection-state strong {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
}

.connection-state p,
.section-intro p,
.modal-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.primary-button,
.secondary-button {
  min-height: 45px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  transition: 160ms ease;
}

.primary-button {
  color: #fff;
  background: var(--accent);
}

.primary-button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.secondary-button {
  color: #666a64;
  background: var(--soft);
}

.secondary-button:hover {
  background: #eceeea;
}

.section-intro {
  margin-bottom: 18px;
}

.section-intro h3,
.list-heading h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.knowledge-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(190px, 0.85fr);
  gap: 26px;
  align-items: start;
}

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

.list-heading span {
  color: var(--muted);
  font-size: 11px;
}

.document-card,
.conversation-card,
.form-card {
  display: grid;
  align-items: center;
  gap: 10px;
  padding: 11px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.document-card {
  grid-template-columns: 34px minmax(0, 1fr) 28px;
}

.conversation-card,
.form-card {
  width: 100%;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  text-align: left;
  cursor: pointer;
  transition: 150ms ease;
}

.conversation-card:hover,
.form-card:hover,
.form-card.active {
  border-color: #b9cee4;
  transform: translateY(-1px);
}

.document-icon,
.card-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--accent);
  background: var(--accent-soft);
  font-family: Georgia, serif;
  font-size: 12px;
}

.card-icon {
  width: 36px;
  height: 36px;
  font-size: 16px;
}

.document-card strong,
.conversation-card strong,
.form-card strong {
  display: block;
  overflow: hidden;
  margin-bottom: 3px;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-card p,
.conversation-card small,
.form-card small {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.document-card button {
  border: 0;
  color: #aaa;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
}

.card-arrow {
  color: #a0a49d;
}

.empty-list {
  padding: 22px 12px;
  border: 1px dashed #d8dbd5;
  border-radius: 12px;
  color: #999d96;
  text-align: center;
  font-size: 11px;
}

.documents-panel {
  display: flex;
  flex-direction: column;
}

.document-template-list {
  display: grid;
  gap: 10px;
}

.document-template-card {
  width: 100%;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.document-template-card:hover {
  border-color: #b7cfe7;
  box-shadow: 0 8px 22px rgba(37, 74, 109, 0.08);
  transform: translateY(-1px);
}

.document-template-card strong {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
}

.document-template-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.sheet-icon {
  position: relative;
  width: 39px;
  height: 46px;
  display: block;
  border: 1.8px solid #8eb6df;
  border-radius: 7px;
  background: var(--accent-soft);
}

.sheet-icon::before,
.sheet-icon::after,
.sheet-icon i {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  height: 1.6px;
  border-radius: 2px;
  background: #76a7d8;
}

.sheet-icon::before {
  top: 13px;
}

.sheet-icon::after {
  top: 21px;
}

.sheet-icon i {
  top: 29px;
  right: 14px;
}

.template-status {
  padding: 6px 9px;
  border-radius: 999px;
  color: #858982;
  background: var(--soft);
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.template-status.ready {
  color: #3976b5;
  background: var(--accent-soft);
}

.document-next-step {
  margin-top: 14px;
  padding: 13px 14px;
  border-radius: 12px;
  color: #6f7470;
  background: #f1f2ef;
  font-size: 11px;
  line-height: 1.55;
}

.document-editor-layer {
  position: fixed;
  z-index: 80;
  inset: 0;
  background: #f1f3f0;
}

.document-editor {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.document-editor-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
}

.document-editor-header h2 {
  margin: 2px 0 0;
  font-size: 20px;
}

.document-editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.document-editor-actions .secondary-button,
.document-editor-actions .primary-button {
  width: auto;
  min-width: 112px;
}

.document-editor-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
}

.document-fields {
  overflow-y: auto;
  padding: 22px 20px 40px;
  border-right: 1px solid var(--line);
  background: #fbfcfa;
}

.document-fields > p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.document-fields form {
  display: grid;
  gap: 12px;
}

.document-fields label {
  display: grid;
  gap: 6px;
  color: #5f645f;
  font-size: 10px;
  font-weight: 700;
}

.document-fields input,
.document-fields textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 11px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.35;
}

.document-fields textarea {
  min-height: 72px;
  resize: vertical;
}

.document-fields input:focus,
.document-fields textarea:focus {
  border-color: #86afd8;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.document-preview-wrap {
  overflow: auto;
  padding: 32px;
}

.document-preview {
  width: 297mm;
  min-height: 210mm;
  margin: 0 auto;
  color: #111;
  background: #fff;
  box-shadow: 0 18px 55px rgba(35, 45, 40, 0.14);
  font-family: Arial, sans-serif;
}

.print-sheet {
  box-sizing: border-box;
  width: 297mm;
  min-height: 210mm;
  padding: 12mm 13mm 10mm;
  font-size: 9.5pt;
  line-height: 1.25;
}

.print-sheet h1,
.print-sheet h2,
.print-sheet h3,
.print-sheet p {
  margin-top: 0;
}

.print-sheet h1 {
  font-size: 17pt;
  text-align: center;
}

.print-sheet .fill-line {
  min-height: 1.1em;
  display: inline-block;
  padding: 0 2mm 1mm;
  border-bottom: 1px solid #111;
  font-weight: 700;
  white-space: pre-wrap;
}

.print-sheet .doc-row {
  display: grid;
  grid-template-columns: 35mm minmax(0, 1fr);
  align-items: end;
  gap: 2mm;
  margin-bottom: 2.2mm;
}

.print-sheet .doc-row.compact {
  margin-bottom: 1mm;
}

.print-sheet .doc-label {
  font-weight: 700;
}

.print-sheet .company-name {
  font-size: 11pt;
  font-weight: 800;
}

.print-sheet .brand-word {
  margin: 3mm 0;
  color: #3c87bd;
  font-size: 20pt;
  font-weight: 800;
  text-align: center;
}

.print-sheet .brand-word span {
  color: #111;
}

.warranty-sheet {
  display: grid;
  grid-template-columns: 1.15fr 0.83fr 1.1fr;
  gap: 6mm;
}

.warranty-sheet .warranty-left,
.warranty-sheet .warranty-middle,
.warranty-sheet .warranty-rules {
  min-width: 0;
}

.warranty-sheet .warranty-title {
  grid-column: 1 / -1;
  margin: 0 0 1mm;
}

.warranty-sheet .serial-table {
  display: grid;
  grid-template-columns: 30mm 1fr;
  margin: 5mm 0;
  border-bottom: 1px solid #111;
}

.warranty-sheet .serial-table strong {
  padding: 4mm 2mm;
  border: 1px solid #111;
  border-bottom: 0;
  font-size: 14pt;
  text-align: center;
}

.warranty-sheet .serial-table span {
  padding: 4mm;
  font-size: 12pt;
}

.warranty-sheet .company-block {
  margin-top: 24mm;
  text-align: center;
}

.warranty-sheet .company-block p {
  margin-bottom: 2mm;
}

.warranty-sheet .works {
  grid-column: 1 / 3;
  margin-top: 4mm;
}

.warranty-sheet .works h2 {
  margin-bottom: 2mm;
  font-size: 13pt;
  text-align: center;
  text-decoration: underline;
}

.warranty-sheet .works-grid {
  display: grid;
  grid-template-columns: 8mm 1fr 24mm 30mm 30mm;
  gap: 2mm;
  font-size: 8.5pt;
}

.warranty-sheet .works-grid.header {
  margin-bottom: 1mm;
  text-align: center;
}

.warranty-sheet .warranty-rules {
  grid-column: 3;
  grid-row: 2 / span 2;
  font-size: 8.5pt;
}

.warranty-sheet .warranty-rules p {
  margin-bottom: 1.5mm;
}

.warranty-sheet .note-copy {
  margin-top: auto;
  font-size: 15pt;
  white-space: pre-wrap;
}

.receipt-sheet {
  display: grid;
  grid-template-columns: 0.92fr 1.45fr 0.95fr;
  gap: 5mm;
  padding-top: 10mm;
  padding-bottom: 8mm;
  font-family: "Times New Roman", serif;
  font-size: 7.8pt;
  line-height: 1.18;
}

.receipt-sheet h2 {
  margin-bottom: 3mm;
  font-size: 10.5pt;
}

.receipt-sheet .receipt-center {
  padding-top: 8mm;
}

.receipt-sheet .agreement-title {
  margin-bottom: 2mm;
  text-align: center;
}

.receipt-sheet .agreement p {
  margin-bottom: 1mm;
}

.receipt-sheet .receipt-number {
  display: flex;
  justify-content: space-between;
  gap: 4mm;
  margin-bottom: 2mm;
  font-weight: 700;
}

.receipt-sheet .section-name {
  margin: 4mm 0 2mm;
  font-weight: 700;
}

.receipt-sheet .multiline-value {
  min-height: 10mm;
  white-space: pre-wrap;
}

.receipt-sheet .signature {
  margin-top: 4mm;
  border-top: 1px solid #111;
  padding-top: 1mm;
  text-align: center;
}

.receipt-sheet .receipt-right {
  padding-top: 1mm;
}

.receipt-sheet .receipt-right .signature {
  margin-top: 8mm;
}

.notice {
  margin: 0 32px 24px;
  padding: 11px 13px;
  border-radius: 10px;
  color: #336ca8;
  background: var(--accent-soft);
  font-size: 11px;
}

.modal {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(470px, calc(100% - 28px));
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  background: #fbfcfa;
  box-shadow: var(--shadow);
  transform: translate(-50%, -50%);
  animation: modal-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.modal-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 14px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 32px;
  font-weight: 300;
}

.modal-copy {
  margin-bottom: 24px;
}

.modal-copy h2 {
  margin-bottom: 8px;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slide-in {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 14px)) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes voice-pulse {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(0.94);
  }
  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

@keyframes voice-speak {
  from {
    transform: translateY(1px) scale(0.97);
  }
  to {
    transform: translateY(-1px) scale(1.04);
  }
}

@media (max-width: 720px) {
  .topbar {
    height: 68px;
    padding: 0 8px 0 16px;
  }

  .app-shell {
    grid-template-rows: 68px 1fr;
  }

  .topbar-button {
    width: 56px;
    height: 56px;
  }

  .settings-button {
    font-size: 43px;
  }

  .add-button {
    font-size: 48px;
  }

  .drawer-header {
    padding: 24px 20px 16px;
  }

  .tabs {
    padding: 0 14px;
  }

  .drawer-content {
    padding: 22px 20px 30px;
  }

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

  .document-template-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .template-status {
    grid-column: 2;
    justify-self: start;
    margin-top: -5px;
  }

  .document-list {
    margin-top: 8px;
  }

  .notice {
    margin: 0 20px 18px;
  }

  .composer-wrap {
    padding-inline: 12px;
  }

  .message-body {
    max-width: 88%;
  }

  .document-editor-header {
    align-items: flex-start;
    padding: 12px 14px;
  }

  .document-editor-header .eyebrow {
    display: none;
  }

  .document-editor-header h2 {
    margin-top: 8px;
    font-size: 16px;
  }

  .document-editor-actions {
    gap: 5px;
  }

  .document-editor-actions .secondary-button {
    display: none;
  }

  .document-editor-actions .primary-button {
    min-width: 96px;
    padding-inline: 12px;
  }

  .document-editor-body {
    display: block;
    overflow-y: auto;
  }

  .document-fields {
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .document-preview-wrap {
    overflow: auto;
    padding: 18px 12px 32px;
  }

  .document-preview {
    transform-origin: top left;
  }
}

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

  body {
    background: #fff !important;
  }

  body > * {
    visibility: hidden !important;
  }

  #documentEditor,
  #documentEditor *,
  #documentPreview,
  #documentPreview * {
    visibility: visible !important;
  }

  #documentEditor {
    position: static !important;
    display: block !important;
    background: #fff !important;
  }

  .document-editor-header,
  .document-fields {
    display: none !important;
  }

  .document-editor,
  .document-editor-body,
  .document-preview-wrap {
    display: block !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    padding: 0 !important;
  }

  .document-preview {
    width: 297mm !important;
    min-height: 210mm !important;
    margin: 0 !important;
    box-shadow: none !important;
    transform: none !important;
  }
}

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