:root {
  --navy: #142c46;
  --blue: #245ac5;
  --ink: #1c3047;
  --muted: #5b6b7c;
  --line: #dde4ec;
  --bg: #f3f6fa;
  --white: #fff;
  --green: #14674c;
  --accent: #245ac5;
  font-family: "Segoe UI Variable", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
.work-category-tools,
.work-entry {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}
.work-category-tools {
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.work-entries {
  list-style: none;
  padding: 0;
  margin: 0;
}
.work-entry {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.work-entry:last-child {
  border-bottom: 0;
}
.work-entry > div:first-child,
.work-entry > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.work-entry .actions {
  flex-shrink: 0;
}
.block {
  display: block;
}
.work-entry small {
  margin-top: 4px;
}
@media (max-width: 680px) {
  .work-entry {
    align-items: flex-start;
    flex-direction: column;
  }
  .work-category-tools .actions {
    width: 100%;
  }
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button,
.button {
  min-height: 44px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: background 0.15s;
}
button:hover,
.button:hover {
  background: #edf2fa;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}
.primary:hover {
  background: #184aa9;
}
.danger {
  color: #af263d;
}
.quiet {
  background: transparent;
  border-color: transparent;
}
svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
input,
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #bdc9d7;
  border-radius: 7px;
  background: white;
  color: var(--ink);
  min-height: 44px;
}
textarea {
  resize: vertical;
  min-height: 90px;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #42566d;
}
label input,
label select,
label textarea {
  margin-top: 7px;
}
input[type="checkbox"] {
  width: 19px;
  min-height: 19px;
  accent-color: var(--blue);
}
input[type="color"] {
  padding: 4px;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
}
:focus-visible {
  outline: 3px solid #81a9f6;
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -1px;
  margin-bottom: 7px;
}
h2 {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.3px;
}
h3 {
  font-size: 15px;
}
p {
  line-height: 1.6;
}
.muted {
  color: var(--muted);
  font-size: 14px;
}
.small {
  font-size: 12px;
}
.shell {
  display: grid;
  grid-template-columns: 234px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: var(--navy);
  overflow-y: auto;
  color: white;
  position: fixed;
  inset: 0 auto 0 0;
  width: 234px;
  padding: 35px 18px 22px;
  display: flex;
  flex-direction: column;
}
.brand {
  padding: 0 17px 39px;
}
.brand strong {
  font-size: 34px;
  letter-spacing: -2px;
  line-height: 1;
  display: block;
}
.brand span {
  font-size: 12px;
  letter-spacing: 2.5px;
  color: #b2c7dc;
}
.brandmark {
  display: inline-block;
  border-left: 5px solid #76a6ef;
  padding-left: 12px;
}
.nav-label {
  color: #9db4ce;
  font-size: 12px;
  padding: 12px 16px;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.nav button {
  justify-content: flex-start;
  background: transparent;
  border: 0;
  color: #c4d3e3;
  font-size: 14px;
  padding: 13px 16px;
}
.nav button:hover {
  background: #213e5a;
}
.nav button.active {
  color: white;
  background: #2b4968;
}
.nav button.active:before {
  content: "";
  height: 16px;
  width: 3px;
  background: #91b9fa;
  position: absolute;
  left: 18px;
  border-radius: 4px;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 26px 15px 0;
  font-size: 12px;
  color: #bdd0e0;
}
.local-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #8ed4b8;
  border-radius: 50%;
  margin-right: 8px;
}
.workspace {
  grid-column: 2;
  min-width: 0;
}
.topbar {
  height: 73px;
  background: white;
  border-bottom: 1px solid var(--line);
  padding: 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e8eef8;
  display: grid;
  place-items: center;
  font-weight: 650;
}
.top-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
main {
  max-width: 1600px;
  margin: auto;
  padding: 35px 36px 60px;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 27px;
}
.page-head p {
  margin: 0;
}
.actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.welcome {
  background: #e8eff9;
  border: 1px solid #d2e0f4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 28px;
  border-radius: 12px;
  margin-bottom: 26px;
  gap: 28px;
}
.welcome h2 {
  font-size: 23px;
  margin-bottom: 6px;
}
.welcome p {
  margin: 0;
  max-width: 65ch;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}
.stat {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px;
}
.stat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}
.stat strong {
  display: block;
  font-size: 30px;
  letter-spacing: -0.8px;
  margin: 13px 0 4px;
  font-weight: 650;
}
.stat p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  margin-bottom: 22px;
}
.panel-head {
  padding: 21px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 {
  margin: 0;
}
.panel-body {
  padding: 24px;
}
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(260px, 1fr);
  gap: 24px;
}
.empty {
  text-align: center;
  padding: 52px 24px;
  color: var(--muted);
}
.empty .empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: #edf2fa;
  margin: 0 auto 17px;
  display: grid;
  place-items: center;
  color: var(--blue);
}
.empty h3 {
  color: var(--ink);
  margin-bottom: 6px;
}
.steps {
  display: flex;
  flex-direction: column;
  gap: 25px;
}
.step {
  display: flex;
  gap: 13px;
}
.step b {
  background: #eef3fa;
  border-radius: 50%;
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--blue);
}
.step h3 {
  margin: 2px 0 5px;
}
.step p {
  font-size: 13px;
  margin: 0;
  color: var(--muted);
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 14px;
}
th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  background: #fafbfd;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 17px 20px;
  border-bottom: 1px solid #edf0f5;
}
tr:last-child td {
  border-bottom: 0;
}
td .muted {
  font-size: 12px;
  margin-top: 4px;
}
td button {
  min-height: 36px;
  padding: 6px 11px;
}
.badge {
  font-size: 11px;
  font-weight: 650;
  display: inline-block;
  background: #edf1f6;
  color: #526377;
  padding: 5px 9px;
  border-radius: 5px;
  white-space: nowrap;
}
.badge.green {
  background: #e4f4eb;
  color: #14674c;
}
.badge.blue {
  background: #e8f0ff;
  color: #2857a4;
}
.badge.red {
  background: #ffeded;
  color: #a83232;
}
.right {
  text-align: right;
}
.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 21px;
}
.toolbar input {
  max-width: 390px;
}
.toolbar select {
  max-width: 190px;
}
.document-list {
  overflow: hidden;
}
.document-filters {
  padding: 24px;
  border-bottom: 1px solid var(--line);
}
.document-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 230px);
  gap: 20px;
}
.document-search-input {
  display: block;
  position: relative;
}
.document-search-input svg {
  position: absolute;
  left: 13px;
  top: 20px;
  color: var(--muted);
  pointer-events: none;
}
.document-search-input input {
  padding-left: 42px;
}
.document-filter-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) repeat(2, minmax(150px, 1fr)) auto;
  gap: 16px;
  align-items: end;
  margin-top: 18px;
}
.document-date-hint {
  margin: 12px 0 0;
}
.document-filter-error {
  color: #a83232;
  margin: 12px 0 0;
}
.document-results-head {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--white);
}
.document-results-head p {
  margin: 0;
  font-weight: 600;
}
.document-sort {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.document-sort select {
  margin: 0;
  width: 215px;
}
.document-table {
  table-layout: fixed;
}
.document-table th:nth-child(1) {
  width: 25%;
}
.document-table th:nth-child(2) {
  width: 19%;
}
.document-table th:nth-child(3) {
  width: 16%;
}
.document-table th:nth-child(4) {
  width: 12%;
}
.document-table th:nth-child(5) {
  width: 16%;
}
.document-table th:nth-child(6) {
  width: 12%;
}
.document-table td,
.document-table th {
  padding: 16px;
  overflow-wrap: anywhere;
}
.document-table .document-identity strong {
  color: var(--blue);
}
.document-table td .muted {
  font-size: 13px;
  line-height: 1.5;
}
.document-table tbody tr:hover {
  background: var(--bg);
}
.document-row-actions button {
  min-height: 40px;
  padding: 8px;
}
.document-row-actions .danger {
  font-size: 12px;
  margin-top: 4px;
}
.document-empty {
  border-top: 1px solid var(--line);
  padding: 48px 24px;
}
.document-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 18px 24px;
  color: var(--muted);
  font-size: 13px;
}
@media (max-width: 1250px) {
  .document-filter-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .document-reset {
    grid-column: 1 / -1;
    justify-self: start;
  }
  .document-table th:nth-child(1) {
    width: 24%;
  }
  .document-table th:nth-child(2) {
    width: 18%;
  }
  .document-table th:nth-child(3) {
    width: 17%;
  }
  .document-table th:nth-child(4) {
    width: 13%;
  }
  .document-table th:nth-child(5) {
    width: 16%;
  }
  .document-table th:nth-child(6) {
    width: 12%;
  }
  .document-table td,
  .document-table th {
    padding: 12px 8px;
  }
}
@media (max-width: 1250px) {
  .document-table,
  .document-table tbody,
  .document-table tr {
    display: block;
    width: 100%;
  }
  .document-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .document-table tr {
    padding: 20px;
    border-top: 1px solid var(--line);
  }
  .document-table td {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) minmax(0, 1.7fr);
    gap: 14px;
    padding: 8px 0;
    border: 0;
    text-align: left;
  }
  .document-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
  }
  .document-table .document-identity {
    display: block;
  }
  .document-table .document-identity::before {
    content: none;
  }
  .document-table .document-date small {
    grid-column: 2;
    margin-top: -12px;
  }
  .document-table .badge {
    justify-self: start;
  }
  .document-table .document-row-actions {
    display: flex;
    padding-top: 12px;
  }
  .document-row-actions::before {
    display: none;
  }
  .document-row-actions button {
    min-height: 44px;
    padding: 10px 16px;
  }
  .document-row-actions .danger {
    margin-top: 0;
    font-size: 13px;
  }
}
@media (max-width: 680px) {
  .document-filters,
  .document-results-head {
    padding: 18px;
  }
  .document-search-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .document-filter-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .document-filter-row > label:first-child {
    grid-column: 1 / -1;
  }
  .document-filter-row input {
    min-width: 0;
  }
  .document-results-head {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }
  .document-sort {
    justify-content: space-between;
  }
  .document-sort select {
    width: auto;
    max-width: 75%;
  }
  .document-pagination {
    padding: 18px;
  }
}
.editor {
  display: grid;
  grid-template-columns: minmax(430px, 1.1fr) minmax(390px, 1fr);
  gap: 25px;
  align-items: start;
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.full {
  grid-column: 1/-1;
}
.catalog-list {
  display: flex;
  flex-direction: column;
}
.catalog-choice {
  display: flex;
  align-items: center;
  gap: 13px;
  border-bottom: 1px solid #edf0f5;
  padding: 14px 0;
  cursor: pointer;
}
.catalog-choice:last-child {
  border: 0;
}
.catalog-choice span {
  flex: 1;
}
.catalog-choice small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  margin-top: 4px;
}
.catalog-choice strong {
  font-size: 13px;
  font-weight: 600;
}
.line-edit {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 14px;
  margin-bottom: 12px;
}
.line-top {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.line-top input {
  flex: 1;
  min-width: 0;
}
.line-top button {
  padding: 9px;
}
.line-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr 1fr;
  gap: 8px;
}
.line-fields label {
  font-size: 11px;
}
.line-fields input,
.line-fields select {
  padding: 9px 7px;
}
.preview-wrap {
  position: sticky;
  top: 24px;
}
.preview-bar {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.paper {
  background: white;
  border: 1px solid #dbe2ec;
  box-shadow: 0 8px 28px #2139570a;
  padding: 38px 32px;
  color: #24374a;
  min-height: 660px;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.paper-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 5px solid var(--doc-color);
  padding-top: 25px;
  margin-bottom: 38px;
}
.paper-top > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.doc-meta {
  max-width: 55%;
}
.paper-logo {
  max-width: 150px;
  max-height: 65px;
  object-fit: contain;
}
.paper-brand {
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -1px;
  color: var(--doc-color);
}
.paper h2 {
  font-size: 27px;
  color: var(--doc-color);
  margin-bottom: 8px;
}
.paper p {
  white-space: pre-line;
  line-height: 1.6;
  margin-bottom: 8px;
}
.paper .doc-meta {
  font-size: 11px;
  color: #5b6b7c;
  text-align: right;
}
.paper-to {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}
.paper-to div {
  max-width: 55%;
}
.paper-to strong {
  display: block;
  margin-bottom: 6px;
}
.paper table {
  font-size: 11px;
  margin: 24px 0;
}
.paper th {
  background: #f3f6fa;
  color: #526174;
  padding: 10px 6px;
  font-size: 10px;
}
.paper td {
  padding: 12px 6px;
  vertical-align: top;
}
.paper .sum {
  width: 60%;
  margin-left: auto;
}
.sum div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 6px 0;
}
.sum .grand {
  border-top: 2px solid var(--doc-color);
  font-size: 17px;
  font-weight: 700;
  color: var(--doc-color);
  margin-top: 7px;
  padding-top: 12px;
}
.paper-footer {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding-top: 17px;
  font-size: 10px;
  color: #596b7e;
  white-space: pre-line;
}
.paper.compact {
  padding: 25px;
  font-size: 11px;
}
.paper.compact .paper-top {
  margin-bottom: 22px;
}
.paper.compact td {
  padding: 7px 5px;
}
.paper.classic .paper-brand,
.paper.classic h2 {
  font-family: Georgia, serif;
}
.paper.classic .paper-top {
  border-top: 0;
  border-bottom: 2px solid var(--doc-color);
  padding-bottom: 20px;
}
.notice {
  padding: 13px 16px;
  border-radius: 7px;
  background: #eff4fc;
  color: #355178;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 20px;
}
.settings {
  max-width: 900px;
}
.color-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 20px;
}
.info-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: #183852;
  color: white;
  padding: 13px 23px;
  border-radius: 9px;
  box-shadow: 0 6px 30px #142c4633;
  z-index: 10;
  display: none;
  max-width: 90vw;
}
#toast.show {
  display: block;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  width: 520px;
  max-width: calc(100vw - 32px);
  max-height: 90vh;
  color: var(--ink);
}
dialog::backdrop {
  background: #142c4677;
}
dialog h2 {
  margin-bottom: 23px;
}
dialog .actions {
  justify-content: flex-end;
  margin-top: 24px;
}
.number {
  font-variant-numeric: tabular-nums;
}
.inline-link {
  color: var(--blue);
  font-weight: 600;
}
.draft-stamp {
  color: #8b5b09;
  background: #fff4d9;
  padding: 8px 12px;
  margin-bottom: 18px;
  font-size: 11px;
  text-align: center;
}
.subtle {
  background: #f8fafd;
}
.doc-actions {
  margin-bottom: 20px;
}
.logo-upload {
  display: flex;
  gap: 20px;
  align-items: center;
}
.logo-upload img {
  max-width: 100px;
  max-height: 65px;
}
.settings-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}
@media (min-width: 1500px) {
  .paper {
    padding: 46px;
  }
}
@media (max-width: 1150px) {
  .sidebar {
    width: 195px;
  }
  .shell {
    grid-template-columns: 195px minmax(0, 1fr);
  }
  main {
    padding: 28px 24px;
  }
  .editor {
    grid-template-columns: 1fr;
  }
  .preview-wrap {
    position: static;
    max-width: 760px;
  }
  .split {
    grid-template-columns: 1fr;
  }
  .topbar {
    padding: 0 24px;
  }
}
@media (max-width: 680px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: static;
    width: 100%;
    padding: 16px;
  }
  .brand {
    padding: 0 8px 16px;
  }
  .brand strong {
    font-size: 27px;
  }
  .brand span {
    font-size: 10px;
  }
  .nav {
    flex-direction: row;
    overflow: auto;
  }
  .nav button {
    padding: 10px;
    white-space: nowrap;
  }
  .nav button.active:before,
  .nav-label,
  .sidebar-bottom {
    display: none;
  }
  .topbar {
    height: 53px;
    padding: 0 18px;
  }
  .topbar > span {
    display: none;
  }
  main {
    padding: 23px 16px;
  }
  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .page-head h1 {
    font-size: 27px;
  }
  .stats {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .stat {
    padding: 17px;
  }
  .stat strong {
    font-size: 25px;
  }
  .welcome {
    padding: 22px;
    display: block;
  }
  .welcome button {
    margin-top: 15px;
  }
  .fields {
    grid-template-columns: 1fr;
  }
  .full {
    grid-column: auto;
  }
  .editor {
    display: block;
  }
  .paper {
    padding: 20px 16px;
    min-height: 580px;
  }
  .paper .sum {
    width: 80%;
  }
  .paper-brand {
    font-size: 20px;
  }
  .paper h2 {
    font-size: 23px;
  }
  .panel-body {
    padding: 18px;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .line-fields {
    grid-template-columns: 1fr 1fr;
  }
  .top-right {
    font-size: 12px;
  }
  td,
  th {
    padding: 12px;
  }
  .paper-to div {
    max-width: 58%;
  }
}
@media print {
  @page {
    size: A4;
    margin: 16mm;
  }
  :root,
  body {
    background: white !important;
  }
  .sidebar,
  .topbar,
  .page-head,
  .editor-form,
  .preview-bar,
  .doc-actions,
  #toast,
  dialog,
  .notice {
    display: none !important;
  }
  .data-disclosure,
  .approval-banner {
    display: none !important;
  }
  .shell,
  .workspace,
  main,
  .editor,
  .preview-wrap {
    display: block !important;
    background: transparent !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
  }
  .paper {
    border: 0;
    box-shadow: none;
    min-height: 0;
    padding: 0 !important;
    font-size: 11pt;
  }
  .paper table {
    font-size: 10pt;
  }
  .paper th {
    font-size: 9pt;
  }
  .paper .doc-meta {
    font-size: 9pt;
  }
  .paper-footer {
    font-size: 9pt;
  }
  .paper tr,
  .paper-to,
  .sum,
  .paper-top {
    break-inside: avoid;
  }
  .paper thead {
    display: table-header-group;
  }
  .paper .sum {
    width: 48%;
  }
  button {
    display: none !important;
  }
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
:where(.panel, .split > div, .editor-form) {
  min-width: 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
/* Review improvements: actionable totals, persistent errors and visible mobile navigation. */
.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.stat {
  display: block;
  text-align: left;
  font-weight: 400;
  width: 100%;
  min-width: 0;
}
.stat:hover {
  background: #f9fbff;
  border-color: #9fb9df;
}
.stat strong {
  font-size: 27px;
}
.stat-top {
  font-weight: 500;
}
.attention-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.attention-item strong {
  font-size: 14px;
}
.attention-item p {
  margin: 5px 0 0;
}
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.save-error {
  position: fixed;
  bottom: 18px;
  right: 20px;
  max-width: 460px;
  z-index: 15;
  background: #fff0f0;
  border: 1px solid #d78181;
  color: #7b2424;
  border-radius: 9px;
  padding: 18px;
  box-shadow: 0 3px 20px #142c461a;
  font-size: 14px;
  line-height: 1.5;
}
.saving {
  cursor: progress;
}
.saving #app {
  opacity: 0.85;
}
.doc-actions {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  padding: 10px 0;
}
.sidebar-bottom .local-dot {
  background: #91b9fa;
}
@media (max-width: 1350px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 680px) {
  .stats {
    grid-template-columns: 1fr;
  }
  .nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }
  .nav button {
    white-space: normal;
  }
  .save-error {
    left: 16px;
    right: 16px;
    bottom: 12px;
  }
  .doc-actions {
    position: static;
  }
  .attention-item {
    flex-wrap: wrap;
  }
}
@media print {
  .save-error {
    display: none !important;
  }
}
[hidden] {
  display: none !important;
}
/* Neox identity and local vault access. The supplied raster logo is unchanged. */
:root {
  --blue: #066cb4;
}
.brand {
  padding: 0 8px 24px;
}
.brand img {
  display: block;
  width: 174px;
  height: 120px;
  max-width: 100%;
  object-fit: cover;
  border-radius: 8px;
  background: #f7f7f7;
}
.paper-logo {
  width: 174px;
  height: 118px;
  max-width: none;
  max-height: none;
  object-fit: cover;
}
.access-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background: #edf3f9;
}
.access-card {
  background: white;
  border: 1px solid #d6e0ed;
  border-radius: 16px;
  padding: 32px;
  width: 440px;
  max-width: 100%;
  box-shadow: 0 15px 50px #16355412;
}
.access-logo {
  display: block;
  width: 235px;
  height: 160px;
  object-fit: cover;
  margin: 0 auto 24px;
  border-radius: 8px;
}
.access-card h1 {
  font-size: 26px;
  letter-spacing: -0.6px;
}
.access-card form {
  display: grid;
  gap: 18px;
  margin-top: 23px;
}
.access-card form p {
  margin: 0;
}
.access-card button {
  width: 100%;
}
.access-note {
  font-size: 12px;
  color: #5b6b7c;
  margin: 22px 0 0;
  text-align: center;
}
#access-error {
  color: #a22e2e;
  font-size: 14px;
}
#access-error:empty {
  display: none;
}
.top-right {
  gap: 8px;
}
.top-right button {
  font-size: 12px;
  padding: 8px 10px;
}
.top-right > span:first-child {
  margin-right: 8px;
}
@media (max-width: 680px) {
  .brand img {
    width: 150px;
    height: 100px;
  }
  .top-right > span:first-child {
    display: none;
  }
  .access-page {
    padding: 16px;
  }
  .access-card {
    padding: 24px;
  }
}
/* The scope and acceptance blocks must remain readable in multi-page PDFs. */
.scope-section {
  margin: 18px 0;
}
.scope-section h3 {
  margin: 0 0 6px;
  break-after: avoid;
}
.scope-section ul {
  padding-left: 20px;
  margin: 0;
}
.scope-section li {
  break-inside: avoid;
}
.signature-block,
.payment-plan {
  break-inside: avoid;
  margin-top: 24px;
}
.signature-space {
  border-bottom: 1px solid #64748b;
  height: 72px;
  max-width: 320px;
}
@media print {
  .scope-section {
    break-inside: avoid;
  }
  .signature-block {
    break-after: avoid-page;
  }
  .signature-block p,
  .payment-plan p {
    margin: 5px 0;
  }
  .signature-space {
    height: 54px;
  }
  .signature-block + .paper-footer {
    margin-top: 16px;
    padding-top: 10px;
  }
}
.signature-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.scope-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 0;
}
.scope-pick input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}
.scope-pick small {
  color: var(--muted);
}
.work-group {
  border-bottom: 1px solid #e2e8f0;
  padding: 10px 0;
}
.work-group summary {
  cursor: pointer;
  font-weight: 650;
  min-height: 44px;
  padding: 12px 0;
}
.work-group summary span {
  float: right;
  font-size: 12px;
}
.material-choice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 180px);
  gap: 16px;
  border-bottom: 1px solid #e2e8f0;
  padding: 8px 0;
}
.estimate-summary {
  background: #f1f6fc;
  padding: 16px;
  border-radius: 12px;
  margin-top: 16px;
}
#estimate-inputs[hidden] {
  display: none;
}
@media (max-width: 640px) {
  .material-choice {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

#estimate-form .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.calculation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 24px;
  align-items: start;
}
.calculation-fields {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.calculation-aside {
  position: sticky;
  top: 24px;
}
.calculation-prices {
  margin: 16px 0 24px;
}
.calculation-prices .info-row {
  gap: 16px;
}
.calculation-prices strong {
  white-space: nowrap;
}
@media (max-width: 1100px) {
  .calculation-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .calculation-aside {
    position: static;
  }
}
@media print {
  .simple-description {
    break-inside: auto;
  }
}
@media (max-width: 640px) {
  #estimate-form .form-grid {
    grid-template-columns: 1fr;
  }
}

.custom-material {
  padding: 16px;
  margin: 12px 0;
  border: 1px solid #d8e1ec;
  border-radius: 10px;
}
.custom-material > button {
  margin-top: 12px;
}

.line-description {
  padding-left: 18px;
  margin: 8px 0 0;
  line-height: 1.5;
}
.line-description li {
  margin-bottom: 3px;
}
#print-target {
  display: none;
}
@media print {
  .paper tr.description-row {
    break-inside: auto;
  }
  .paper .line-description li {
    break-inside: avoid;
  }
  body.export-document > * {
    display: none !important;
  }
  body.export-document > #print-target {
    display: block !important;
  }
}

@media print {
  .doc-help {
    display: none !important;
  }
}

.data-disclosure {
  margin: 12px 0;
  border: 1px solid var(--line, #dbe4ee);
  border-radius: 8px;
  background: white;
}
.data-disclosure > summary {
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 600;
}
.data-disclosure-body {
  padding: 0 16px 16px;
}
.data-disclosure-body .actions {
  margin: 12px 0;
}

.material-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.material-choice {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 1fr);
}
@media (max-width: 700px) {
  .material-choice {
    grid-template-columns: 1fr;
  }
}

/* Shared screen spacing: controls stay grouped; sections have a clear rhythm.
   Scoped to application forms so document previews and printed PDFs keep their layout. */
@media screen {
  :root {
    --space-field: 20px;
    --space-section: 32px;
  }
  .fields,
  #modal .form-grid,
  #estimate-form .form-grid {
    gap: var(--space-field) 24px;
    align-items: start;
  }
  #modal .form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #modal .form-grid > :is(p, h3, details, .notice) {
    grid-column: 1 / -1;
  }
  .fields > label,
  .form-grid > label {
    min-width: 0;
    line-height: 1.5;
  }
  .panel-body > :is(h3, form > h3),
  .data-disclosure-body > h3,
  #estimate-inputs > h3 {
    margin: var(--space-section) 0 16px;
    line-height: 1.4;
  }
  .panel-body > h3:first-child,
  .data-disclosure-body > h3:first-child {
    margin-top: 0;
  }
  .panel-body:not(.fields) > label + label,
  .data-disclosure-body > label + label {
    margin-top: var(--space-field);
  }
  .panel-body > label + button,
  .data-disclosure-body > label + button,
  #estimate-inputs > label + button {
    margin-top: 12px;
  }
  .panel-body > button + p,
  .data-disclosure-body > button + p,
  #estimate-inputs > button + p {
    margin-top: 12px;
  }
  .panel-body > p:last-child,
  .data-disclosure-body > p:last-child {
    margin-bottom: 0;
  }
  .panel-body > .actions {
    row-gap: 12px;
  }
  .data-disclosure-body {
    padding: 12px 20px 24px;
  }
  .data-disclosure-body > .actions {
    margin-top: 20px;
  }
  #modal .modal-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
  }
  #modal .modal-head h2 {
    margin: 6px 0 0;
  }
  #modal .modal-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
  }
  #estimate-inputs > .automatic-dimensions {
    margin: 24px 0 0;
    padding: 16px 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
  }
  .automatic-dimensions > summary {
    cursor: pointer;
    line-height: 1.5;
  }
  .automatic-dimensions[open] > summary {
    margin-bottom: 24px;
  }
  .automatic-dimensions > .form-grid + p {
    margin-top: 16px;
  }
  .automatic-dimensions details > summary {
    padding: 12px 0;
    cursor: pointer;
  }
  #estimate-form > .scope-pick {
    padding-top: 0;
  }
  #estimate-form .scope-pick input {
    margin-top: 0;
  }
  #estimate-inputs > .form-grid + .scope-pick {
    margin-top: 24px;
  }
  #estimate-inputs > .scope-pick + p {
    margin-top: 8px;
  }
  #estimate-inputs > #add-material {
    margin-top: 16px;
  }
  .material-choice {
    padding: 20px 0;
    gap: 20px;
    align-items: start;
  }
  .material-choice > div:first-child > .muted {
    margin-top: 6px;
  }
  .material-choice > div:first-child > button {
    margin-top: 12px;
  }
  .material-values {
    gap: 16px;
  }
  .custom-material {
    padding: 20px;
    margin: 20px 0;
  }
  .custom-material > .scope-pick {
    margin-bottom: 16px;
  }
  .custom-material > button {
    margin-top: 20px;
  }
  .estimate-summary {
    margin-top: 28px;
    padding: 24px;
  }
  .estimate-summary > .table-wrap + p {
    margin-top: 20px;
  }
  .estimate-summary > p:last-child {
    margin-bottom: 0;
  }
  @media (max-width: 640px) {
    :root {
      --space-field: 18px;
      --space-section: 28px;
    }
    #modal .form-grid {
      grid-template-columns: minmax(0, 1fr);
    }
    #estimate-inputs > .automatic-dimensions,
    .custom-material,
    .estimate-summary {
      padding: 16px;
    }
    .material-values {
      gap: 12px;
    }
  }
}
@media screen {
  .panel-body > button {
    margin-inline-end: 12px;
  }
  #modal form > .fields + p {
    margin-top: 20px;
  }
  #modal form > h3 {
    margin-top: 28px;
    margin-bottom: 16px;
  }
  #modal:has(#mail-form) {
    width: 680px;
  }
  #mail-form .fields > label {
    grid-column: 1 / -1;
  }
  #mail-form .fields > label > span {
    display: block;
    margin-top: 10px;
    line-height: 1.6;
  }
}
@media screen {
  #mail-form textarea[name="body"] {
    min-height: 160px;
    height: 160px;
  }
}

/* Shared form rhythm and separate labour panel. */
.required-star {
  color: #9a6700;
  font-weight: 800;
}
.required-legend {
  margin: 0 0 20px;
  grid-column: 1 / -1;
}
.estimate-section {
  margin: 28px 0;
}
.estimate-section > h3 {
  margin: 0 0 16px;
}
.estimate-section > p {
  margin: 12px 0 20px;
}
.labour-widget {
  margin: 36px 0;
  padding: 28px;
  border: 1px solid #c7d9e8;
  border-left: 4px solid #0070ad;
  border-radius: 14px;
  background: #f6faff;
}
.labour-widget h2 {
  font-size: 25px;
  margin: 0 0 10px;
}
.labour-widget > p {
  margin: 10px 0 24px;
}
.material-add-row {
  display: flex;
  gap: 16px;
  align-items: end;
  margin: 20px 0;
}
.material-add-row label {
  flex: 1;
}
.material-values output {
  display: block;
  margin-top: 8px;
  line-height: 1.6;
}
.form-section-title {
  margin: 16px 0 0;
  padding-top: 24px;
  border-top: 1px solid #e1e8ef;
}
@media (max-width: 700px) {
  .labour-widget {
    padding: 20px;
  }
  .material-add-row {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Document layout based on the supplied Neox quotation and invoice. */
.paper.reference-document {
  font-family: Arial, sans-serif;
  color: #111;
  font-size: 12px;
  line-height: 1.5;
  padding: 44px;
}
.reference-document h2 {
  color: #111;
  font-size: 18px;
  margin: 0 0 6px;
}
.reference-header {
  display: grid;
  grid-template-columns: 1fr 0.85fr 1.1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 26px;
}
.reference-header p {
  margin: 0;
}
.reference-client {
  margin-top: 20px;
}
.reference-logo {
  align-self: center;
}
.reference-logo img {
  width: 100%;
  height: auto;
  object-fit: contain;
}
.reference-meta {
  margin: 36px 0 0;
  font-size: 11px;
}
.reference-meta > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 4px;
}
.reference-meta dt {
  font-weight: 700;
}
.reference-meta dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}
.reference-intro {
  margin: 20px 0 30px;
}
.reference-project {
  margin: 14px 0;
}
.reference-document h3 {
  font-size: 12px;
  background: #f2f2f2;
  padding: 3px 5px;
  margin: 0 0 7px;
  color: #111;
}
.reference-scope {
  margin: 0 0 22px;
}
.reference-scope p {
  margin: 3px 5px;
}
.reference-investment,
.reference-payments {
  border-top: 2px solid #111;
  margin: 26px 0;
  break-inside: avoid;
}
.paper.reference-document table {
  width: 100%;
  margin: 0;
  font-size: inherit;
}
.paper.reference-document td,
.paper.reference-document th {
  padding: 5px;
  color: #111;
  border: 0;
}
.reference-subtotals {
  background: #cbdcf9;
  margin-top: 18px;
  padding: 4px 5px;
}
.reference-subtotals > div,
.reference-grand {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.reference-grand {
  background: #d9ead3;
  padding: 5px;
  margin-top: 18px;
}
.reference-terms-notice {
  font-style: italic;
  margin-top: 22px;
}
.reference-document .signature-block {
  border-top: 2px solid #111;
  padding-top: 0;
  margin-top: 16px;
  break-inside: avoid;
}
.reference-document .signature-space {
  height: 52px;
}
.reference-document .signature-block p {
  margin: 7px 0;
}
.reference-footer {
  margin-top: 28px;
  padding-top: 10px;
  border-top: 1px solid #ddd;
  color: #555;
  font-size: 10px;
}
.paper.reference-document .reference-invoice-table {
  border-collapse: collapse;
  border: 1px solid #111;
}
.paper.reference-document .reference-invoice-table td,
.paper.reference-document .reference-invoice-table th {
  border: 1px solid #111;
  padding: 10px;
  vertical-align: top;
}
.reference-invoice-table th {
  background: white;
  height: 36px;
  vertical-align: bottom;
}
.reference-invoice-table th:last-child {
  width: 26%;
}
.reference-invoice-table .invoice-item {
  height: 64px;
}
.invoice-work-description {
  margin: 8px 0;
  padding-left: 18px;
  font-weight: normal;
}
.invoice-work-description li {
  break-inside: avoid;
}
@media print {
  .paper.reference-document .reference-invoice-table .invoice-item {
    break-inside: auto;
  }
}
.reference-invoice-table .invoice-total {
  background: #d9ead3;
}
.paper.reference-document .reference-invoice-table .invoice-description td {
  padding: 2px 10px;
  border-top: 0;
  border-bottom: 0;
}
.document-notes {
  white-space: pre-wrap;
}
.terms-appendix {
  break-before: page;
  margin-top: 48px;
  font-size: 10px;
  line-height: 1.5;
}
.terms-appendix h2 {
  font-size: 20px;
}
.terms-appendix h3 {
  margin-top: 18px;
  break-after: avoid;
}
.terms-appendix p {
  margin: 0 0 5px;
  orphans: 3;
  widows: 3;
}
.terms-version {
  font-weight: 700;
  margin-bottom: 20px !important;
}
@media print {
  .paper.reference-document {
    padding: 0;
    font-size: 10pt;
  }
  .reference-header {
    gap: 5mm;
  }
  .reference-document h3 {
    font-size: 10pt;
  }
  .reference-meta {
    font-size: 9pt;
  }
  .reference-document {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .terms-appendix {
    margin-top: 0;
    font-size: 9pt;
  }
  .reference-header,
  .reference-grand,
  .reference-project {
    break-inside: avoid;
  }
  .reference-document h3 {
    break-after: avoid;
  }
  .reference-header {
    margin-bottom: 16px;
  }
  .reference-client {
    margin-top: 12px;
  }
  .reference-logo img {
    max-height: 145px;
  }
  .reference-intro {
    margin: 12px 0 18px;
  }
  .reference-investment,
  .reference-payments {
    margin: 18px 0;
  }
  .reference-subtotals,
  .reference-grand {
    margin-top: 12px;
  }
  .reference-document .signature-block {
    margin-top: 12px;
    font-size: 9pt;
  }
  .reference-document .signature-block p {
    margin: 4px 0;
  }
  .reference-document .signature-space {
    height: 38px;
  }
  .reference-footer {
    margin-top: 16px;
    padding-top: 8px;
  }
  .paper.reference-quote {
    font-size: 9.5pt;
    line-height: 1.4;
  }
  .reference-quote .signature-space {
    height: 48px;
  }
}
@media screen and (max-width: 600px) {
  .paper.reference-document {
    padding: 22px;
  }
  .reference-header {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .reference-meta {
    grid-column: 1 / -1;
    margin: 0;
  }
  .reference-meta > div {
    grid-template-columns: 1fr 1fr;
  }
}

.approval-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding: 20px 24px;
  border-radius: 12px;
  border: 1px solid #edcba4;
  background: #fff3e2;
  color: #70420f;
  margin: 0 0 24px;
}
.approval-banner strong {
  font-size: 18px;
}
.approval-banner p {
  margin: 5px 0 0;
}
.approval-banner.approved {
  background: #eef8f3;
  border-color: #bcdbc9;
  color: #1b583d;
}
.approval-banner.rejected {
  background: #fff0ef;
  border-color: #e9bcb7;
  color: #922f26;
}
.project-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 20px;
  margin: 0 0 28px;
}
.project-metrics > div {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: white;
  border: 1px solid #e0e8f1;
  border-radius: 12px;
  padding: 24px;
}
.project-metrics strong {
  font-size: 28px;
}
.project-metrics small {
  color: #5c6e84;
}
.file-list {
  margin-top: 20px;
}
.file-list > div,
.notification {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid #e1e8f0;
}
.file-list strong {
  overflow-wrap: anywhere;
}
.dossier-history {
  list-style: none;
  padding: 0;
}
.dossier-history li {
  border-left: 2px solid #c7d9e8;
  padding: 0 0 24px 20px;
}
.dossier-history span {
  display: block;
  color: #5c6e84;
  margin-top: 4px;
}
.dossier-history p {
  margin: 8px 0 0;
}
.notification p {
  margin: 6px 0;
}
.notification.pending {
  background: #fff3e2;
  padding: 20px;
  border-radius: 10px;
}
.mail-toolbar {
  display: flex;
  align-items: end;
  gap: 20px;
  margin-bottom: 20px;
}
.mail-toolbar label {
  flex: 1;
}
.inbox-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.5fr);
  gap: 24px;
  align-items: start;
}
.inbox-messages {
  max-height: 75vh;
  overflow: auto;
}
.mail-row {
  display: grid;
  grid-template-columns: 1fr auto;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #e1e8f0;
  border-radius: 0;
  text-align: left;
  gap: 8px;
  padding: 20px;
}
.mail-row > strong,
.mail-row > span:not(.mail-from),
.mail-row > small {
  grid-column: 1 / -1;
  white-space: normal;
  overflow-wrap: anywhere;
}
.mail-row time,
.mail-row > span:not(.mail-from) {
  color: #5c6e84;
  font-size: 13px;
  font-weight: 400;
}
.mail-row.selected {
  background: #edf5fc;
  box-shadow: inset 3px 0 #0070ad;
}
.mail-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  line-height: 1.7;
  margin: 28px 0;
}
.registry-check {
  padding-top: 20px;
}
.registry-result {
  border: 1px solid #e1e8f0;
  border-radius: 10px;
  margin-top: 14px;
  padding: 16px;
  background: #f8fafc;
}
.registry-result p {
  margin: 7px 0;
}
.registry-result.verified {
  background: #eff8f3;
  border-color: #c1dacb;
}
@media (max-width: 900px) {
  .inbox-layout {
    grid-template-columns: 1fr;
  }
  .inbox-messages {
    max-height: 45vh;
  }
}
@media (max-width: 650px) {
  .file-list > div,
  .notification {
    align-items: stretch;
    flex-direction: column;
  }
  .approval-banner {
    padding: 20px;
  }
}

/* Feedback: compact, named actions and document typography. */
.icon-button {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-button[aria-pressed="true"] {
  background: #e7f0f8;
  color: #004a85;
}
.small-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.document-save,
.document-status {
  margin-left: auto;
}
.phone-fields {
  display: grid;
  grid-template-columns: minmax(135px, 0.7fr) minmax(130px, 1fr);
  gap: 12px;
}
.mail-body-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.invoice-additions {
  grid-column: 1/-1;
}
.invoice-addition {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin: 12px 0;
}
.invoice-addition label {
  flex: 1;
}
.terms-appendix .terms-list-item {
  display: flex;
  gap: 10px;
  padding-left: 20px;
}
.terms-list-item > span:first-child {
  flex: 0 0 20px;
}

.agreement-pdf {
  width: 100%;
  height: 420px;
  border: 1px solid #d7e0e8;
  border-radius: 8px;
}
.agreement-candidate {
  padding: 12px 0;
  border-bottom: 1px solid #e2e8ef;
}

/* 2.18: installment styles are also included in PDF export. */
.invoice-term-table tr.term-previous {
  background: #d0d5dc;
  color: #394451;
}
.invoice-term-table tfoot th,
.invoice-term-table tfoot td {
  border-top: 1px solid #bfcbd5;
  padding-top: 12px;
  background: white;
}
.invoice-term-table tfoot th {
  text-align: right;
}
/* Original PDF conditions: editing is done in the source document outside Neox. */
.terms-settings-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.4fr);
  gap: 24px;
  align-items: start;
}
.terms-settings-layout .panel {
  margin: 0;
}
.terms-current {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 0;
  margin: 20px 0;
  border-block: 1px solid var(--border, #e0e5ec);
  overflow-wrap: anywhere;
}
.terms-file-label {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-weight: 600;
}
.terms-file-label input {
  width: 100%;
  font-weight: 400;
}
.terms-file-status {
  min-height: 24px;
  overflow-wrap: anywhere;
}
.terms-pdf-view {
  min-width: 0;
  height: calc(100vh - 230px);
  min-height: 520px;
  background: #edf1f6;
  overflow: auto;
}
.terms-pdf-view > p {
  padding: 24px;
}
.terms-pdf-view iframe {
  border: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.terms-legacy-preview {
  padding: 36px;
  background: #fff;
  color: #26384a;
  margin: 20px;
  font-size: 12px;
  line-height: 1.7;
}
.terms-legacy-preview .terms-appendix {
  margin: 0;
  padding: 0;
  break-before: auto;
}
.terms-preview-panel .panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
}
.terms-preview-panel .panel-head h2 {
  font-size: 16px;
  margin: 0;
}
.terms-pdf-appendix {
  margin-top: 28px;
  padding: 22px;
  border: 1px solid #dce4ec;
  border-radius: 10px;
  background: #f4f7fb;
}
.terms-pdf-dialog {
  width: min(960px, 94vw);
  max-width: 94vw;
  padding: 0;
}
.terms-pdf-dialog > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
}
.terms-pdf-dialog h2 {
  font-size: 18px;
}
.terms-pdf-dialog .terms-pdf-view {
  height: 75vh;
}
@media (max-width: 900px) {
  .terms-settings-layout {
    grid-template-columns: 1fr;
  }
  .terms-pdf-view {
    height: 70vh;
  }
}
@media print {
  .terms-pdf-appendix {
    display: none !important;
  }
}

.terms-file-label {
  position: relative;
}
.terms-file-pick {
  display: block;
  padding: 12px 16px;
  border: 1px solid #c7d5e5;
  border-radius: 8px;
  color: var(--text, #26384a);
  background: var(--surface, #fff);
  cursor: pointer;
  font-weight: 500;
}
.terms-file-label:focus-within .terms-file-pick {
  outline: 2px solid #5686ba;
  outline-offset: 2px;
}

/* Text editor reuses the quotation's terms renderer and document styles. */
.terms-text-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.terms-text-form > label {
  font-weight: 600;
}
.terms-text-form > p {
  margin: 0;
}
.terms-text-form textarea {
  width: 100%;
  min-height: 320px;
  height: calc(100vh - 530px);
  resize: vertical;
  line-height: 1.65;
  font-size: 14px;
}
.terms-text-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
#terms-save-status {
  flex-basis: 100%;
  font-size: 12px;
  color: var(--muted);
}
.terms-preview-scroll {
  height: calc(100vh - 250px);
  min-height: 520px;
  overflow: auto;
  padding: 16px;
  background: #edf1f6;
}
.terms-preview-scroll .terms-preview-paper {
  width: 210mm;
  min-width: 210mm;
  min-height: 297mm;
  max-width: none;
  box-sizing: border-box;
  margin: 0 auto;
}
.terms-preview-paper > .terms-appendix {
  margin-top: 0;
}
.terms-preview-panel .terms-appendix h2 {
  font-size: 20px;
}
@media (max-width: 900px) {
  .terms-text-form textarea {
    height: 440px;
  }
  .terms-preview-scroll {
    height: 65vh;
  }
}

.terms-zoom {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 400;
}
.terms-zoom select {
  width: auto;
  padding: 6px 10px;
  min-height: 34px;
}
.inbox-shared-address {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -12px 0 24px;
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* Navigation-aligned access controls */
.permission-picker {
  border: 1px solid var(--border, #dce3eb);
  border-radius: 12px;
  padding: 18px;
  min-width: 0;
}
.permission-picker legend {
  font-weight: 650;
  padding: 0 6px;
}
.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.permission-group {
  border: 1px solid var(--border, #dce3eb);
  border-radius: 10px;
  overflow: hidden;
  align-self: start;
}
.permission-choice {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  margin: 0 !important;
  cursor: pointer;
  font-size: 14px;
}
.permission-choice input {
  width: 18px !important;
  height: 18px !important;
  min-height: 0 !important;
  padding: 0;
  flex: 0 0 18px;
  accent-color: var(--primary, #426fa6);
}
.permission-parent {
  background: var(--surface-soft, #f5f8fc);
}
.permission-children {
  padding: 4px 0 4px 16px;
  border-top: 1px solid var(--border, #dce3eb);
}
.permission-count {
  margin-left: auto;
  color: var(--muted, #617083);
  font-size: 12px;
}
.permission-choice:has(input:focus-visible) {
  outline: 2px solid var(--primary, #426fa6);
  outline-offset: -3px;
}
.permission-all .permission-grid {
  opacity: 0.5;
}
.google-connect {
  padding: 26px;
}
.google-connect h2 {
  margin-top: 0;
}
.google-mailbox {
  background: var(--surface-soft, #f5f8fc);
  border: 1px solid var(--border, #dce3eb);
  border-radius: 12px;
  padding: 16px;
  margin: 18px 0;
  overflow-wrap: anywhere;
}
.google-mailbox > strong {
  display: block;
  margin-top: 4px;
}
.google-mailbox p {
  margin-bottom: 0;
}
.google-setup {
  margin: 18px 0;
}
.google-setup summary {
  cursor: pointer;
  padding: 10px 0;
  font-weight: 600;
}
.google-setup ol {
  padding-left: 22px;
}
.google-setup li {
  margin-bottom: 12px;
}
.google-signin {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--border, #dce3eb);
  border-radius: 8px;
  background: var(--surface, white);
  color: var(--text, #22354b);
  font-weight: 600;
  text-decoration: none;
}
.google-signin:focus-visible {
  outline: 2px solid var(--primary, #426fa6);
  outline-offset: 3px;
}
.google-signin[hidden] {
  display: none;
}
.google-actions {
  margin-top: 20px;
}
@media (max-width: 600px) {
  .permission-grid {
    grid-template-columns: 1fr;
  }
}
