:root {
  --bg: #fef3ca;
  --panel: #fffaf0;
  --ink: #424531;
  --muted: #7f7f7f;
  --line: #e2d5ae;
  --green: #424531;
  --green-dark: #303321;
  --gold: #434631;
  --soft: #fff0ce;
  --danger: #9e3129;
  --shadow: 0 18px 45px rgba(66, 69, 49, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.home-view,
.client-view {
  display: grid;
  gap: 18px;
}

.hero {
  padding: 22px 0 6px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
}

.session-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.session-bar a,
.session-bar button {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.session-bar button {
  border: 0;
  background: transparent;
  padding: 0;
  font-weight: 800;
}

.brand-logo-mark {
  width: 46px;
  height: 34px;
  display: block;
  object-fit: contain;
}

.brand-version {
  align-self: flex-end;
  padding-bottom: 2px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.hero h1 {
  margin: 24px 0 8px;
  font-size: clamp(38px, 7vw, 74px);
  line-height: 0.96;
}

.hero p {
  margin: 0;
  max-width: 640px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.45;
}

.search-panel,
.results-section,
.work-section,
.client-card,
.add-client-bar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-panel {
  padding: 18px;
  display: grid;
  gap: 10px;
}

.search-panel label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 10px;
}

.search-row input,
.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
}

.search-row input {
  min-height: 54px;
  font-size: 18px;
}

.form-grid textarea {
  padding-top: 10px;
  resize: vertical;
}

.search-row button,
.back-button,
.add-client-bar button,
.dialog-actions .primary {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: var(--soft);
  font-weight: 800;
  padding: 0 16px;
}

.add-client-bar {
  padding: 14px 18px;
}

.add-client-bar button {
  min-width: 128px;
}

.results-section,
.work-section {
  overflow: hidden;
}

.section-title {
  min-height: 60px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.section-title h2 {
  margin: 0;
  font-size: 18px;
}

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

.title-actions button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  font-weight: 800;
  padding: 0 10px;
}

.title-actions button:hover {
  background: var(--soft);
}

.section-actions {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.section-actions button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  font-weight: 800;
  padding: 0 12px;
}

.section-actions button:hover {
  background: var(--soft);
}

.results-list,
.work-results {
  display: grid;
}

.client-result,
.work-result {
  width: 100%;
  min-height: 76px;
  display: grid;
  gap: 14px;
  align-items: center;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  padding: 14px 18px;
}

.client-result {
  grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1.2fr) minmax(180px, 1fr);
}

.work-result {
  grid-template-columns: minmax(180px, 0.75fr) minmax(0, 1fr) 74px;
}

.client-result:hover,
.work-result:hover {
  background: #fff0ce;
}

.result-name,
.work-main strong {
  font-weight: 800;
  font-size: 17px;
}

.result-meta,
.result-contact,
.work-main span,
.work-meta span,
.eyebrow,
.field-card span,
.info-tile span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.work-main,
.work-meta {
  display: grid;
  gap: 5px;
}

.work-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.work-meta b {
  color: var(--ink);
}

.work-result button {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: var(--soft);
  font-weight: 800;
}

.back-button {
  justify-self: start;
  background: var(--green-dark);
}

.client-card {
  padding: 22px;
  display: grid;
  gap: 22px;
}

.client-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.client-header h1 {
  margin: 4px 0 0;
  font-size: 38px;
}

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

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  font-weight: 800;
}

.info-grid,
.field-grid {
  display: grid;
  gap: 10px;
}

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

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

.info-tile,
.field-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff8e5;
  padding: 14px;
}

.info-tile strong,
.field-card strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.map-link,
.inline-map-link {
  color: var(--green-dark);
  font-weight: 800;
  text-decoration: none;
}

.map-link {
  display: inline-flex;
  margin-top: 10px;
  min-height: 30px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--soft);
}

.inline-map-link {
  display: inline-block;
  margin-top: 6px;
}

.map-link:hover,
.inline-map-link:hover {
  text-decoration: underline;
}

.detail-section {
  display: grid;
  gap: 12px;
}

.detail-section h2 {
  margin: 0;
  font-size: 20px;
}

.section-inline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.secondary-action {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  font-weight: 800;
  padding: 0 12px;
  white-space: nowrap;
}

.secondary-action:hover {
  background: var(--soft);
}

.primary-action {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: var(--soft);
  font-weight: 800;
  padding: 0 12px;
  white-space: nowrap;
}

.primary-action:hover {
  background: var(--green-dark);
}

.work-detail-list {
  display: grid;
  gap: 10px;
}

.work-detail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff8e5;
  padding: 14px;
}

.work-detail div {
  display: grid;
  gap: 5px;
}

.work-detail span {
  color: var(--muted);
  font-size: 13px;
}

.work-detail p {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  line-height: 1.45;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
  background: var(--panel);
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  line-height: 1.35;
}

th {
  background: var(--soft);
  color: var(--green-dark);
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  border-left: 4px solid var(--ink);
  background: var(--panel);
  border-radius: 0 8px 8px 0;
  padding: 12px 14px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.timeline-item time {
  display: block;
  color: var(--gold);
  font-weight: 800;
  margin-bottom: 6px;
}

.timeline-item p {
  margin: 0;
  line-height: 1.45;
  white-space: pre-wrap;
}

.attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.attachment-card {
  display: grid;
  gap: 7px;
  color: var(--ink);
  text-decoration: none;
}

.attachment-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.attachment-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff8e5;
  padding: 14px;
}

.empty-state h3,
.empty-state p {
  margin: 0;
}

.empty-state h3 {
  margin-bottom: 6px;
}

.compact {
  box-shadow: none;
}

.client-dialog {
  width: min(720px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 0;
}

.client-dialog::backdrop {
  background: rgba(12, 21, 18, 0.42);
}

.client-dialog form {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.dialog-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.dialog-head h2 {
  margin: 4px 0 0;
}

.dialog-head button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  font-size: 24px;
  line-height: 1;
}

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

.form-grid label {
  display: grid;
  gap: 6px;
}

.form-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.field-label {
  display: grid;
  gap: 8px;
}

.field-label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.field-label select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 12px;
}

.form-grid input,
.form-grid select {
  min-height: 42px;
}

.users-list {
  display: grid;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(100px, auto) minmax(120px, auto) minmax(130px, auto) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
}

.user-row:last-child {
  border-bottom: 0;
}

.user-main {
  display: grid;
  gap: 3px;
}

.user-main strong {
  font-size: 17px;
}

.user-main span,
.user-meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.status-pill {
  justify-self: start;
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}

.status-pill.inactive {
  background: #f3ddd8;
  color: var(--danger);
}

.user-row button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 800;
  padding: 0 12px;
}

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

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dialog-actions button {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
}

#cancelClientBtn {
  border: 1px solid var(--line);
  background: var(--panel);
}

.form-error {
  margin: 0;
  color: var(--danger);
  font-weight: 800;
}

.hidden {
  display: none;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(100%, 420px);
  display: grid;
  gap: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin: 0;
  color: var(--ink);
  font-size: 30px;
  letter-spacing: 0;
}

.auth-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

.auth-card input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 12px;
}

.auth-card button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: var(--soft);
  font-weight: 900;
  padding: 0 16px;
}

.journal-view {
  display: grid;
  gap: 20px;
  max-width: 980px;
  margin: 0 auto;
}

.journal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 10px;
  z-index: 5;
  background: rgba(254, 243, 202, 0.94);
  border: 1px solid rgba(67, 70, 49, 0.16);
  border-radius: 8px;
  padding: 10px 12px;
  backdrop-filter: blur(8px);
}

.journal-document {
  display: grid;
  gap: 24px;
}

.journal-toolbar h2,
.journal-cover h1,
.journal-page h3 {
  margin: 0;
}

.journal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.journal-actions button,
.journal-row-actions button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  font-weight: 800;
  padding: 0 10px;
}

.journal-cover,
.journal-info-page,
.journal-page {
  width: min(100%, 210mm);
  min-height: 297mm;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #e2dcc8;
  border-radius: 0;
  box-shadow: 0 16px 42px rgba(45, 48, 34, 0.14);
  color: #424531;
  box-sizing: border-box;
}

.journal-cover {
  position: relative;
  padding: 25mm;
}

.journal-logo {
  display: block;
  width: 72mm;
  max-width: 76%;
  margin: 50mm auto 0;
}

.journal-cover-title {
  margin-top: 30mm;
  text-align: center;
}

.journal-cover-title h1 {
  max-width: 132mm;
  margin: 0 auto;
  color: #424531;
  font-size: 26pt;
  font-weight: 400;
  line-height: 1.14;
  letter-spacing: 0;
}

.journal-cover p {
  margin: 0;
}

.journal-cover-info {
  position: absolute;
  left: 25mm;
  right: 25mm;
  bottom: 42mm;
  display: grid;
  gap: 1.5mm;
  color: #424531;
  font-size: 11pt;
  line-height: 1.4;
}

.journal-cover-info p {
  border: 0;
  padding: 0;
}

.journal-cover-info span {
  display: inline;
  color: #424531;
  font-size: inherit;
  font-weight: 800;
  margin: 0 3mm 0 0;
}

.journal-cover-info strong {
  font-weight: 400;
}

.journal-info-page {
  display: grid;
  align-content: start;
  gap: 6mm;
  padding: 18mm 25mm;
  color: #424531;
  font-size: 11.5pt;
  line-height: 1.34;
}

.journal-info-page h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 7mm;
  margin: 2mm 0 0;
  background: #fff0ce;
  color: #424531;
  font-size: 11pt;
  font-weight: 800;
  letter-spacing: 0;
  text-align: center;
}

.journal-info-page p,
.journal-info-page ol {
  margin: 0;
}

.journal-info-page ol {
  padding-left: 6mm;
}

.journal-info-page li + li {
  margin-top: 1mm;
}

.journal-page {
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 0;
  padding: 18mm 25mm;
  color: #424531;
  font-size: 11.5pt;
  line-height: 1.25;
}

.journal-page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  position: relative;
  min-height: 7mm;
  margin: 0 0 10mm;
  background: #fff0ce;
}

.journal-page-head label,
.journal-footer label {
  color: #424531;
  font-size: 11pt;
  font-weight: 400;
}

.journal-page input,
.journal-page textarea {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #424531;
  padding: 0;
  font: inherit;
  letter-spacing: 0;
  resize: vertical;
}

.journal-page input:focus,
.journal-page textarea:focus {
  outline: 1px solid rgba(67, 70, 49, 0.28);
  background: #fffaf0;
}

.journal-page-head label {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 2.5mm;
  white-space: nowrap;
}

.journal-page-head input {
  min-width: 0;
  padding-left: 2mm;
  font-weight: 800;
}

.journal-page-head button {
  position: absolute;
  right: 2mm;
  top: 50%;
  transform: translateY(-50%);
  min-height: 28px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease;
}

.journal-page-head:hover button,
.journal-page-head:focus-within button {
  opacity: 1;
  pointer-events: auto;
}

.hidden-field {
  display: none !important;
}

.journal-page h3 {
  margin: 0 0 10mm;
  color: #424531;
  font-size: 12pt;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.journal-items {
  display: grid;
  gap: 1.8mm;
  width: 100%;
  max-width: 160mm;
  margin: 0 auto;
  align-content: start;
}

.journal-item {
  display: grid;
  grid-template-columns: 9mm minmax(0, 1fr) auto;
  gap: 0 5mm;
  align-items: start;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.checkline {
  display: contents;
}

.checkline input {
  width: 4.4mm;
  height: 4.4mm;
  margin: 0.6mm auto 0;
  accent-color: #424531;
  border: 1px solid #424531;
}

.print-checkbox {
  display: none;
}

.checkline textarea {
  min-height: 5.5mm;
  overflow: hidden;
}

.journal-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-column: 2;
  gap: 2mm;
  align-items: start;
  color: #424531;
  font-style: italic;
}

.page-info-note {
  display: none !important;
}

.empty-journal-note {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.journal-item:hover .empty-journal-note,
.journal-item:focus-within .empty-journal-note {
  max-height: 80px;
  opacity: 1;
  pointer-events: auto;
}

.journal-note input,
.journal-note textarea {
  font-style: italic;
}

.print-label {
  display: none;
}

.journal-note input[data-item-field="note_label"],
.journal-note input[data-item-field="extra_label"] {
  width: 28mm;
  font-weight: 400;
}

.journal-row-actions {
  display: flex;
  grid-column: 3;
  grid-row: 1 / span 3;
  gap: 6px;
  align-items: start;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease;
}

.journal-item:hover .journal-row-actions,
.journal-item:focus-within .journal-row-actions {
  opacity: 1;
  pointer-events: auto;
}

.journal-footer {
  margin-top: 10mm;
  background: #fff0ce;
  padding: 1.5mm 3mm;
  text-align: center;
}

.journal-page-info-box {
  display: grid;
  gap: 1mm;
  max-width: 150mm;
  margin: 8mm auto 0;
  border: 1px solid #424531;
  border-radius: 0.4mm;
  padding: 2mm;
  color: #424531;
  font-style: italic;
}

.journal-page-info-box span {
  font-weight: 400;
}

.journal-page-info-box textarea {
  width: 100%;
  min-height: 12mm;
  border: 0;
  background: transparent;
  color: #424531;
  padding: 0;
  font: inherit;
  font-style: italic;
  resize: vertical;
}

.journal-footer label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2mm;
  font-weight: 800;
}

.journal-footer input {
  width: min(100%, 106mm);
  font-weight: 800;
}

@media (max-width: 820px) {
  .search-row,
  .client-result,
  .work-result,
  .work-meta,
  .client-header,
  .section-inline-head,
  .client-header-actions,
  .info-grid,
  .field-grid,
  .work-detail,
  .form-grid,
  .user-row {
    grid-template-columns: 1fr;
  }

  .journal-toolbar {
    grid-template-columns: 1fr;
  }

  .hero {
    display: grid;
    gap: 12px;
  }

  .session-bar {
    justify-content: flex-start;
  }

  .journal-cover,
  .journal-info-page,
  .journal-page {
    min-height: auto;
    padding: 22px;
  }

  .journal-cover {
    min-height: 560px;
  }

  .journal-logo {
    width: 190px;
    margin-top: 110px;
  }

  .journal-cover-title h1 {
    font-size: 34px;
  }

  .journal-cover-info {
    left: 22px;
    right: 22px;
    bottom: 54px;
  }

  .journal-page-head {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px 0;
  }

  .journal-page-head label {
    white-space: normal;
  }

  .journal-item {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .journal-row-actions {
    grid-column: 2;
    grid-row: auto;
  }

  .client-header-actions {
    justify-content: flex-start;
  }

  .work-result button {
    justify-self: start;
    min-width: 74px;
  }
}

@media print {
  @page {
    size: A4;
    margin: 18mm 25mm;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body {
    background: #ffffff;
  }

  .no-print,
  .back-button,
  .client-header,
  .info-grid,
  .detail-section,
  .table-wrap {
    display: none !important;
  }

  .app {
    width: 100%;
    padding: 0;
  }

  .client-card,
  .journal-cover,
  .journal-info-page,
  .journal-page {
    border: 0;
    box-shadow: none;
    border-radius: 0;
  }

  .journal-cover,
  .journal-info-page,
  .journal-page {
    width: auto;
    min-height: calc(297mm - 36mm);
    padding: 0;
    page-break-after: always;
    break-after: page;
    background: #ffffff !important;
    color: #424531 !important;
  }

  .journal-cover {
    height: calc(297mm - 36mm);
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .journal-logo {
    width: 76mm;
    max-width: none;
    margin: 50mm auto 0;
  }

  .journal-cover-title {
    margin-top: 30mm;
  }

  .journal-cover-title h1 {
    max-width: 132mm;
    font-size: 26pt;
    line-height: 1.14;
  }

  .journal-cover-info {
    left: 1mm;
    right: 0;
    bottom: 24mm;
    gap: 1.5mm;
    font-size: 11pt;
    line-height: 1.4;
  }

  .journal-document {
    gap: 0;
  }

  .journal-info-page {
    height: calc(297mm - 36mm);
    page-break-inside: avoid;
    break-inside: avoid;
    gap: 6mm;
    font-size: 11.5pt;
    line-height: 1.34;
  }

  .journal-info-page h2,
  .journal-page-head,
  .journal-footer {
    background: #fff0ce !important;
  }

  .journal-page {
    display: block;
    font-size: 10.4pt;
    line-height: 1.18;
    page-break-before: always;
    break-before: page;
  }

  .journal-page-head {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 7mm;
    margin: 0 0 9mm;
    padding: 0;
  }

  .journal-page-head label {
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 0 2mm;
    white-space: nowrap;
    font-size: 10.5pt;
  }

  .journal-page-head label + label {
    justify-content: flex-end;
  }

  .journal-page-head label span,
  .journal-footer label span {
    flex: 0 0 auto;
  }

  .journal-page-head input {
    width: auto;
    min-width: 24mm;
    padding-left: 1mm;
    font-weight: 800;
  }

  .journal-page h3 {
    margin: 0 0 8mm;
    font-size: 11.5pt;
  }

  .journal-items {
    max-width: 160mm;
    gap: 1.4mm;
  }

  .journal-page input,
  .journal-page textarea {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    resize: none;
    overflow: visible;
  }

  .journal-page input::placeholder,
  .journal-page textarea::placeholder {
    color: transparent !important;
  }

  .journal-item {
    grid-template-columns: 9mm minmax(0, 1fr);
    gap: 0 5mm;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .blank-journal-item {
    display: none !important;
  }

  .checkline input {
    display: none !important;
  }

  .print-checkbox {
    display: block;
    grid-column: 1;
    width: 4mm;
    height: 4mm;
    margin: 0.35mm auto 0;
    border: 0.45mm solid #424531;
    border-radius: 0.4mm;
    box-sizing: border-box;
  }

  .print-checkbox.checked {
    position: relative;
    background: #424531 !important;
  }

  .print-checkbox.checked::after {
    content: "";
    position: absolute;
    left: 0.95mm;
    top: 0.2mm;
    width: 1.2mm;
    height: 2.2mm;
    border: solid #ffffff;
    border-width: 0 0.45mm 0.45mm 0;
    transform: rotate(45deg);
  }

  .checkline textarea {
    grid-column: 2;
    min-height: 0;
  }

  .journal-note {
    grid-template-columns: auto minmax(0, 1fr);
    grid-column: 2;
    gap: 1.5mm;
    margin-top: 0.6mm;
  }

  .journal-note.no-print-value {
    display: none !important;
  }

  .journal-note input[data-item-field="note_label"],
  .journal-note input[data-item-field="extra_label"] {
    display: none !important;
  }

  .print-label {
    display: inline;
    font-style: italic;
  }

  .journal-extra-field {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    margin-top: 0.6mm;
    max-width: none;
    border: 0;
    padding: 0;
  }

  .journal-extra-field .print-label {
    display: inline;
  }

  .journal-extra-field input[data-item-field="extra_value"] {
    display: inline;
    width: auto;
    font-style: italic;
  }

  .journal-page-info-box {
    display: block;
    max-width: 150mm;
    margin: 8mm auto 0;
    border: 1px solid #424531;
    border-radius: 0.4mm;
    padding: 2mm;
    page-break-inside: avoid;
    break-inside: avoid;
    font-style: italic;
  }

  .journal-page-info-box textarea {
    display: block;
    width: 100%;
    min-height: 12mm;
    border: 0;
    background: transparent;
    padding: 0;
    resize: none;
    overflow: visible;
  }

  .journal-footer {
    margin-top: 8mm;
    padding: 1.5mm 3mm;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .journal-footer label {
    gap: 1mm;
    font-size: 10.5pt;
    font-weight: 800;
  }

  .journal-footer input {
    width: auto;
    min-width: 86mm;
    font-weight: 800;
  }

  .journal-row-actions {
    display: none !important;
  }
}
