:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #65716d;
  --line: #d9e0dc;
  --paper: #f7f8f5;
  --panel: #ffffff;
  --brand: #0b315c;
  --brand-2: #155a8a;
  --accent: #d4a437;
  --danger: #b13f32;
  --ok: #227553;
  --info: #3268a8;
  --shadow: 0 16px 38px rgba(23, 33, 31, 0.12);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-company-colors="false"] {
  --brand: #1f3a34;
  --brand-2: #2f6f61;
  --accent: #d49b35;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #eef5fb;
  --muted: #aebdca;
  --line: #395067;
  --paper: #0a1d31;
  --panel: #112940;
  --shadow: 0 16px 38px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  --logo-overlay: 0.68;
  background-color: #03152d;
  background-image:
    linear-gradient(rgba(247, 248, 245, var(--logo-overlay)), rgba(247, 248, 245, var(--logo-overlay))),
    url("assets/mark-high-logo.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover, contain;
  background-attachment: fixed;
  color: var(--ink);
}

body[data-background="full"] {
  background-size: cover, cover;
}

body[data-background="watermark"] {
  background-size: cover, contain;
}

body[data-background="plain"] {
  background-color: var(--paper);
  background-image: none;
}

html[data-theme="dark"] body:not(.customer-document) {
  background-image:
    linear-gradient(rgba(3, 21, 45, var(--logo-overlay)), rgba(3, 21, 45, var(--logo-overlay))),
    url("assets/mark-high-logo.png");
}

html[data-theme="dark"] body[data-background="plain"] {
  background-image: none;
}

.app-corner-logo {
  display: none;
  position: fixed;
  right: 22px;
  bottom: 18px;
  z-index: 0;
  width: min(260px, 34vw);
  opacity: 0.16;
  pointer-events: none;
}

body[data-background="plain"] .app-corner-logo {
  display: block;
}

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

button {
  cursor: pointer;
}

.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--paper);
}

.rich-toolbar .ghost-btn {
  min-height: 34px;
  padding: 6px 10px;
}

.rich-size,
.rich-font,
.rich-block {
  width: auto;
  min-width: 105px;
}

.rich-font {
  min-width: 135px;
}

.rich-editor {
  min-height: 150px;
  padding: 12px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  background: #fff;
  line-height: 1.5;
}

.rich-editor:focus {
  border-color: var(--brand);
  outline: 2px solid rgba(31, 58, 52, 0.18);
}

.writing-help {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.rich-editor p,
.rich-output p {
  margin: 0 0 0.8em;
}

.rich-editor ul,
.rich-editor ol,
.rich-output ul,
.rich-output ol {
  margin: 0.5em 0 0.9em;
  padding-left: 1.6em;
}

.rich-editor ul,
.rich-output ul {
  list-style: disc outside;
}

.rich-editor ol,
.rich-output ol {
  list-style: decimal outside;
}

.rich-editor u,
.rich-output u {
  text-decoration: underline;
}

.rich-editor h2,
.rich-output h2,
.rich-editor h3,
.rich-output h3 {
  margin: 0.7em 0 0.35em;
  line-height: 1.2;
}

.rich-editor h2,
.rich-output h2 {
  font-size: 1.45em;
}

.rich-editor h3,
.rich-output h3 {
  font-size: 1.2em;
}

.scope-item-description {
  min-height: 135px;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 20px;
  background: #03152d;
  color: #f7fbf8;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
}

.brand-logo {
  width: 78px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 8px;
  object-fit: contain;
  background: #03152d;
}

.drawer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand span,
.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.sidebar .brand span {
  color: #b7c5bf;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-btn,
.mobile-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  text-align: left;
}

.nav-btn {
  width: 100%;
  padding: 0 12px;
}

.nav-btn.active {
  background: rgba(255, 255, 255, 0.12);
}

.main {
  min-width: 0;
  min-height: 100vh;
  padding: 24px;
  background: rgba(247, 248, 245, 0.22);
  backdrop-filter: blur(1px);
}

html[data-theme="dark"] .main {
  background: rgba(3, 21, 45, 0.36);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid rgba(217, 224, 220, 0.8);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 1px 0 rgba(23, 33, 31, 0.05);
  backdrop-filter: blur(5px);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.7rem, 3vw, 2.55rem);
  line-height: 1.05;
}

h2 {
  font-size: 1.2rem;
}

h3 {
  font-size: 1rem;
}

h1,
h2,
h3 {
  color: var(--brand);
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3 {
  color: #f0c65c;
}

.topbar-actions,
.row-actions,
.modal-actions,
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-actions {
  max-width: 100%;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-chip {
  max-width: 180px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.save-status {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.global-search {
  width: min(230px, 26vw);
  min-width: 150px;
}

.wide-modal {
  width: min(1100px, calc(100vw - 24px));
}

#jobHubModal {
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
}

.job-hub-summary {
  margin: 0 0 16px;
}

.job-hub-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
  margin: 16px 0;
}

.job-hub-details div {
  min-width: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.job-hub-details dt {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.job-hub-details dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.job-hub-copy {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.job-hub-copy p {
  margin: 6px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.job-hub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.job-hub-signatures,
.job-hub-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.job-hub-signature,
.job-hub-photo-grid article {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.job-hub-signature small,
.job-hub-photo-grid small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.job-hub-photo {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
}

.job-hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.job-hub-section {
  margin: 0;
  padding: 16px;
}

.job-hub-list {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.password-user-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.password-user-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f8f5;
}

.password-user-card > div:first-child {
  display: grid;
  gap: 3px;
}

.password-user-card span {
  color: var(--muted);
  font-size: .84rem;
}

.password-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
}

.icon-btn,
.primary-btn,
.ghost-btn,
.danger-btn {
  min-height: 42px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  padding: 0;
}

.primary-btn,
.ghost-btn,
.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  font-weight: 700;
}

.primary-btn {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  box-shadow: inset 0 -2px 0 rgba(212, 164, 55, 0.55);
}

.danger-btn {
  border-color: rgba(177, 63, 50, 0.25);
  color: var(--danger);
}

.file-import input {
  display: none;
}

.menu-btn,
.mobile-nav {
  display: none;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.metric,
.panel,
.record-card {
  background: rgba(255, 255, 255, 0.90);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(23, 33, 31, 0.03);
  backdrop-filter: blur(4px);
}

html[data-theme="dark"] .metric,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .record-card,
html[data-theme="dark"] .topbar {
  background: rgba(17, 41, 64, 0.92);
}

.metric {
  padding: 16px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 1.55rem;
}

.tax-projection-metric {
  border-color: rgba(212, 164, 55, 0.72);
  box-shadow: inset 0 3px 0 rgba(212, 164, 55, 0.88);
}

.tax-projection-metric small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.4;
}

.tax-worker-scenario {
  border-color: rgba(51, 122, 183, 0.62);
  box-shadow: inset 0 3px 0 rgba(51, 122, 183, 0.78);
}

.tax-estimate-breakdown {
  display: grid;
  gap: 4px;
  margin: 12px 0 0;
  font-size: 0.78rem;
}

.tax-estimate-breakdown div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.tax-estimate-breakdown dt,
.tax-estimate-breakdown dd {
  margin: 0;
}

.tax-estimate-breakdown dd {
  font-weight: 700;
}

.tax-projection-note {
  margin: -4px 0 18px;
}

.tax-projection-note p {
  margin: 6px 0;
}

.tax-profile-panel {
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.55);
}

html[data-theme="dark"] .tax-profile-panel {
  background: rgba(255, 255, 255, 0.04);
}

.tax-profile-panel summary {
  padding: 13px 15px;
  cursor: pointer;
  font-weight: 800;
}

.tax-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 0 15px 15px;
}

.tax-profile-grid .field {
  margin: 0;
}

.tax-profile-grid small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.35;
}

.tax-rate-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.tax-profile-check {
  display: flex;
  align-items: center;
  gap: 8px;
  grid-column: 1 / -1;
  font-weight: 700;
}

.tax-profile-check input {
  width: auto;
}

.tax-profile-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  grid-column: 1 / -1;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.7fr);
  gap: 16px;
}

.panel {
  padding: 16px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.record-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.record-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.record-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.record-meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.waiting-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.waiting-list-card {
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: start;
}

.waiting-list-rank {
  display: grid;
  place-items: center;
  width: 54px;
  min-height: 54px;
  border-radius: 14px;
  background: var(--brand);
  color: white;
  font-size: 1.15rem;
  font-weight: 800;
}

.waiting-list-details {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.waiting-list-notes {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--brand) 6%, transparent);
  color: var(--text);
}

.waiting-list-actions {
  max-width: 230px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef3f0;
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 700;
}

.pill.ok {
  background: #e8f4ee;
  color: var(--ok);
}

.pill.warn {
  background: #fff4df;
  color: #8a5b0a;
}

.pill.danger {
  background: #fae9e6;
  color: var(--danger);
}

.progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ece8;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand-2);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

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

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

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

.pay-schedule-editor {
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.pay-schedule-title,
.pay-schedule-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pay-schedule-title small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

#payScheduleRows {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.pay-schedule-row {
  display: grid;
  grid-template-columns: 34px minmax(190px, 1.5fr) minmax(170px, 1fr) minmax(130px, 0.8fr) auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f8f5;
}

.pay-schedule-row .field {
  min-width: 0;
}

.pay-schedule-row [data-pay-due] {
  min-width: 0;
  text-overflow: ellipsis;
}

.pay-schedule-table-wrap {
  overflow-x: visible;
}

.pay-schedule-table {
  table-layout: fixed;
  min-width: 0;
}

.pay-schedule-table .pay-schedule-due-column {
  width: 52%;
}

.pay-schedule-table .pay-schedule-percent-column {
  width: 20%;
}

.pay-schedule-table .pay-schedule-amount-column {
  width: 28%;
}

.pay-schedule-table th,
.pay-schedule-table td {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pay-schedule-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  font-weight: 800;
}

.pay-schedule-calculated {
  display: grid;
  gap: 6px;
  padding-bottom: 5px;
}

.pay-schedule-calculated span,
.pay-schedule-summary span {
  color: var(--muted);
  font-size: 0.82rem;
}

.pay-schedule-summary {
  justify-content: flex-end;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: #eef3f0;
}

.pay-schedule-summary strong {
  margin-right: 14px;
}

.pay-schedule-summary .invalid {
  color: var(--danger);
}

.bid-rooms-section {
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.bid-rooms-title,
.bid-room-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bid-rooms-title small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

#bidRoomList {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.bid-room-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f8f5;
}

.bid-room-head h3 {
  margin: 0;
  color: var(--brand);
}

.bid-room-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.bid-room-fields .full {
  grid-column: 1 / -1;
}

.bid-attachments-section {
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.attachment-picker {
  position: relative;
  cursor: pointer;
}

.attachment-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.bid-attachment-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.bid-attachment-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f8f5;
}

.bid-attachment-thumb,
.attachment-file-icon {
  width: 64px;
  height: 54px;
  border-radius: 8px;
  object-fit: cover;
  background: #e7ece7;
}

.attachment-file-icon {
  display: block;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 26px;
}

.bid-attachment-info {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.bid-attachment-info strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bid-attachment-info span {
  color: var(--muted);
  font-size: .84rem;
}

.payment-email-option {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f8f5;
}

.payment-email-option label,
.payment-email-option > strong {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--brand);
  font-weight: 800;
}

.payment-email-option input {
  width: auto;
  margin: 0;
}

.payment-email-option small {
  display: block;
  margin: 5px 0 0;
  color: var(--muted);
}

.receipt-capture {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) 180px;
  gap: 12px;
  margin-bottom: 14px;
}

.receipt-scan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -2px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f8f5;
}

.receipt-scan-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.receipt-scan-status.is-reading {
  color: var(--brand);
  font-weight: 700;
}

.receipt-scan-status.is-success {
  color: #21613b;
}

.receipt-scan-status.is-error {
  color: #8a342d;
}

.receipt-suggestion-panel {
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f8f5;
}

.receipt-suggestion-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.receipt-suggestion-head strong,
.receipt-suggestion-head small {
  display: block;
}

.receipt-suggestion-head small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.4;
}

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

.receipt-scan-preview {
  margin: 0 0 12px;
  color: var(--brand);
  font-weight: 700;
}

.receipt-scan-preview summary {
  cursor: pointer;
}

.receipt-scan-preview img {
  display: block;
  width: 100%;
  max-height: 300px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  object-fit: contain;
}

.receipt-suggestion-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.receipt-suggestion-card.is-missing {
  color: var(--muted);
}

.receipt-suggestion-card small,
.receipt-suggestion-card span {
  display: block;
}

.receipt-suggestion-card small {
  margin-bottom: 3px;
  color: var(--muted);
  font-weight: 700;
}

.receipt-suggestion-source {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.receipt-image-preview-panel {
  min-width: 0;
}

.receipt-image-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.receipt-image-actions button {
  flex: 1 1 auto;
}

.receipt-review-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f8f5;
  color: var(--brand);
}

.receipt-review-check input {
  width: auto;
  margin-top: 3px;
}

.receipt-review-check strong,
.receipt-review-check small {
  display: block;
}

.receipt-review-check small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 500;
}

.capture-box {
  position: relative;
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 160px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #f7f8f5;
  color: var(--brand);
  text-align: center;
  cursor: pointer;
}

.capture-box input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.capture-box:focus-within {
  outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent);
  outline-offset: 2px;
}

.capture-box small {
  color: var(--muted);
  font-weight: 500;
}

#receiptPreview,
#paymentProofPreview,
#photoPreview,
.receipt-thumb {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  object-fit: cover;
}

#receiptPreview {
  display: none;
  height: 220px;
  object-fit: contain;
}

#paymentProofPreview {
  display: none;
  height: 160px;
}

.receipt-file-preview,
.receipt-file-tile {
  display: none;
  min-height: 160px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: center;
}

.receipt-file-preview.has-file {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
}

.receipt-file-preview [data-icon],
.receipt-file-tile [data-icon] {
  width: 36px;
  height: 36px;
}

.receipt-file-preview small,
.receipt-file-tile small {
  color: var(--muted);
}

.receipt-file-tile {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  aspect-ratio: 4 / 3;
  max-height: 180px;
}

.receipt-year-field {
  min-width: 130px;
}

.receipt-year-field label {
  font-size: 0.78rem;
}

.receipt-period-controls {
  display: grid;
  grid-template-columns: minmax(110px, 0.45fr) minmax(150px, 0.65fr) minmax(240px, 1.5fr) minmax(230px, auto);
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.receipt-period-controls .field {
  margin: 0;
}

.receipt-search-field {
  min-width: 0;
}

.tax-packet-button,
.receipt-add-button {
  min-height: 44px;
}

.tax-packet-button {
  justify-content: center;
  white-space: normal;
  text-align: center;
}

.receipt-center-head {
  align-items: flex-start;
}

.receipt-total-row {
  background: #f7f8f5;
}

html[data-theme="dark"] .receipt-total-row {
  background: rgba(255, 255, 255, 0.07);
}

#photoPreview {
  display: none;
  height: 160px;
}

#receiptPreview.has-image,
#paymentProofPreview.has-image,
#photoPreview.has-image {
  display: block;
}

.receipt-thumb {
  aspect-ratio: 4 / 3;
  max-height: 180px;
}

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

.workflow-step {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.step-number {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

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

.crew-total-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.crew-total-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

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

.crew-total-numbers div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.crew-total-numbers span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.crew-total-numbers strong {
  display: block;
  color: var(--ink);
  font-size: 20px;
}

.price-result {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.customer-page {
  min-height: 100vh;
  padding: 24px;
}

body.customer-document {
  background-color: #e9eff5;
  background-image:
    linear-gradient(rgba(233, 239, 245, 0.86), rgba(233, 239, 245, 0.86)),
    url("assets/mark-high-logo.png");
  background-repeat: no-repeat;
  background-position: center top 32px;
  background-size: cover, min(760px, 82vw) auto;
  background-attachment: fixed;
  color: #17211f;
}

.customer-sheet {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  max-width: 980px;
  margin: 0 auto;
  padding: 24px;
  border: 1px solid #d9e0dc;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.customer-sheet > * {
  min-width: 0;
}

.customer-sheet h1,
.customer-sheet h2,
.customer-sheet p {
  overflow-wrap: anywhere;
}

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

.customer-logo {
  width: 150px;
  height: 76px;
  object-fit: contain;
  flex: 0 0 auto;
}

.customer-company {
  display: grid;
  gap: 3px;
  color: var(--muted);
  text-align: right;
}

.customer-company strong {
  color: var(--ink);
}

.signature-label {
  display: block;
  margin: 14px 0 6px;
}

.signature-pad {
  width: 100%;
  height: 220px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  touch-action: none;
}

.signature-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.signature-review-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.signature-preview {
  display: block;
  width: 100%;
  height: 150px;
  margin: 10px 0;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.response-actions {
  margin-top: 12px;
}

@media (max-width: 760px) {
  .signature-review-grid {
    grid-template-columns: 1fr;
  }
}

.pdf-frame {
  width: 100%;
  min-width: 0;
  height: min(78vh, 820px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.scope-pdf-note,
.scope-selection-help {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.scope-selection-panel {
  border: 2px solid color-mix(in srgb, var(--brand) 34%, var(--line));
}

.scope-selection-head {
  align-items: flex-start;
  gap: 16px;
}

.scope-selection-head > div:first-child {
  max-width: 650px;
}

.scope-selection-actions {
  flex: 0 0 auto;
}

.scope-option-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.scope-option-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  border: 2px solid var(--brand);
  border-radius: 14px;
  background: color-mix(in srgb, var(--brand) 6%, #fff);
  color: var(--ink);
  cursor: pointer;
  transition: opacity 160ms ease, border-color 160ms ease, background 160ms ease;
}

.scope-option-card:hover {
  background: color-mix(in srgb, var(--brand) 10%, #fff);
}

.scope-option-card.is-excluded {
  border-color: color-mix(in srgb, var(--muted) 55%, var(--line));
  border-style: dashed;
  background: color-mix(in srgb, var(--muted) 5%, #fff);
}

.scope-option-card.is-excluded .scope-option-price {
  color: var(--muted);
}

.scope-option-card.is-excluded .scope-option-status {
  background: color-mix(in srgb, var(--muted) 13%, #fff);
  color: var(--ink);
}

.scope-option-card:has(input:disabled) {
  cursor: default;
}

.scope-option-card input[type="checkbox"] {
  width: 28px;
  height: 28px;
  min-height: 28px;
  margin: 2px 0 0;
  accent-color: var(--brand);
}

.scope-option-card input[type="checkbox"]:disabled {
  opacity: 0.78;
}

.scope-option-content {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.scope-option-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  font-size: 1.08rem;
}

.scope-option-price {
  flex: 0 0 auto;
  color: var(--brand);
  font-size: 1.2rem;
  white-space: nowrap;
}

.scope-option-description {
  color: var(--ink);
  font-weight: 400;
}

.scope-option-description > :first-child {
  margin-top: 0;
}

.scope-option-description > :last-child {
  margin-bottom: 0;
}

.scope-option-status {
  width: fit-content;
  padding: 4px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 12%, #fff);
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.signature-pad:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 55%, #fff);
  outline-offset: 3px;
}

.scope-selection-summary {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-size: 1.04rem;
}

.scope-selection-summary strong {
  font-size: 1.18rem;
}

.scope-acceptance-text {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand) 7%, #fff);
  font-weight: 700;
}

.field {
  display: grid;
  gap: 6px;
}

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

label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.password-visibility {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  cursor: pointer;
}

.password-visibility input {
  width: auto;
  min-height: 0;
  margin: 0;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.modal {
  width: min(680px, calc(100vw - 24px));
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0;
}

.modal::backdrop {
  background: rgba(20, 37, 33, 0.45);
}

.auth-modal {
  width: min(520px, calc(100vw - 24px));
}

.auth-logo {
  display: block;
  width: min(320px, 86%);
  max-height: 130px;
  margin: 0 auto 14px;
  object-fit: contain;
}

body.auth-locked {
  background-size: cover, min(900px, 86vw) auto;
  background-position: center;
}

.auth-modal::backdrop {
  background: rgba(20, 37, 33, 0.72);
  backdrop-filter: blur(2px);
}

.appearance-panel {
  max-width: 980px;
  margin: 0 auto;
}

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

.appearance-grid small,
.appearance-note {
  color: var(--muted);
}

.range-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.appearance-check {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.appearance-check label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.appearance-check input {
  width: auto;
  min-height: auto;
}

.background-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.background-choice {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  text-align: left;
}

.background-choice.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 24%, transparent);
}

.background-sample {
  display: block;
  height: 92px;
  border-radius: 6px;
  background-color: #e9eff5;
  background-image: linear-gradient(rgba(247, 248, 245, .62), rgba(247, 248, 245, .62)), url("assets/mark-high-logo.png");
  background-repeat: no-repeat;
  background-position: center;
}

.background-sample.watermark {
  background-size: cover, contain;
}

.background-sample.full {
  background-size: cover, cover;
}

.background-sample.plain {
  background-color: var(--paper);
  background-image: url("assets/mark-high-logo.png");
  background-position: right 8px bottom 8px;
  background-size: 42%;
  opacity: .75;
}

.appearance-note {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: .88rem;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .rich-editor,
html[data-theme="dark"] .workflow-step,
html[data-theme="dark"] .price-result,
html[data-theme="dark"] .password-user-card,
html[data-theme="dark"] .bid-room-card,
html[data-theme="dark"] .bid-attachment-card,
html[data-theme="dark"] .payment-email-option,
html[data-theme="dark"] .receipt-scan-row,
html[data-theme="dark"] .receipt-suggestion-panel,
html[data-theme="dark"] .receipt-suggestion-card,
html[data-theme="dark"] .receipt-review-check,
html[data-theme="dark"] .capture-box {
  background: #0a1d31;
  color: var(--ink);
}

html[data-theme="dark"] .receipt-scan-status.is-success {
  color: #87d7a7;
}

html[data-theme="dark"] .receipt-scan-status.is-error {
  color: #ffaaa1;
}

.form-error {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--danger);
  font-weight: 700;
}

.modal form {
  padding: 18px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.modal-actions {
  justify-content: flex-end;
  margin: 18px 0 0;
  padding: 0;
}

.drawer,
.drawer-backdrop {
  display: none;
}

[data-icon] {
  display: inline-block;
  width: 20px;
  height: 20px;
  background: currentColor;
  mask: var(--icon) center / contain no-repeat;
  -webkit-mask: var(--icon) center / contain no-repeat;
}

[data-icon="briefcase"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M10 6V5a2 2 0 0 1 2-2h0a2 2 0 0 1 2 2v1'/%3E%3Crect x='3' y='6' width='18' height='14' rx='2'/%3E%3Cpath d='M3 12h18'/%3E%3C/svg%3E"); }
[data-icon="camera"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M14.5 4 16 7h3a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h3l1.5-3Z'/%3E%3Ccircle cx='12' cy='13' r='3'/%3E%3C/svg%3E"); }
[data-icon="calendar"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M8 2v4M16 2v4M3 10h18'/%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3C/svg%3E"); }
[data-icon="check"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m5 12 4 4L19 6'/%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3C/svg%3E"); }
[data-icon="clipboard"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M9 5a3 3 0 0 1 6 0h2a2 2 0 0 1 2 2v13H5V7a2 2 0 0 1 2-2h2Z'/%3E%3Cpath d='M9 5h6M9 12h6M9 16h4'/%3E%3C/svg%3E"); }
[data-icon="dashboard"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect x='3' y='3' width='7' height='8' rx='1'/%3E%3Crect x='14' y='3' width='7' height='5' rx='1'/%3E%3Crect x='14' y='12' width='7' height='9' rx='1'/%3E%3Crect x='3' y='15' width='7' height='6' rx='1'/%3E%3C/svg%3E"); }
[data-icon="download"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M12 3v12m0 0 4-4m-4 4-4-4M4 19h16'/%3E%3C/svg%3E"); }
[data-icon="file"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M14 2H6v20h12V6Z'/%3E%3Cpath d='M14 2v4h4'/%3E%3C/svg%3E"); }
[data-icon="invoice"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 2h12v20l-3-2-3 2-3-2-3 2Z'/%3E%3Cpath d='M9 8h6M9 12h6M9 16h4'/%3E%3C/svg%3E"); }
[data-icon="materials"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m3 8 9-5 9 5-9 5Z'/%3E%3Cpath d='M3 8v8l9 5 9-5V8M12 13v8'/%3E%3C/svg%3E"); }
[data-icon="menu"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M4 6h16M4 12h16M4 18h16'/%3E%3C/svg%3E"); }
[data-icon="plus"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); }
[data-icon="print"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M7 8V3h10v5M7 17H5a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2'/%3E%3Crect x='7' y='14' width='10' height='7'/%3E%3C/svg%3E"); }
[data-icon="refresh"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M20 6v5h-5M4 18v-5h5'/%3E%3Cpath d='M18.5 9A7 7 0 0 0 6.2 6.2L4 8M5.5 15A7 7 0 0 0 17.8 17.8L20 16'/%3E%3C/svg%3E"); }
[data-icon="save"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M5 3h12l2 2v16H5Z'/%3E%3Cpath d='M9 3v6h6V3M8 21v-7h8v7'/%3E%3C/svg%3E"); }
[data-icon="team"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-8 0v2M12 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8ZM22 21v-2a4 4 0 0 0-3-3.87M2 21v-2a4 4 0 0 1 3-3.87'/%3E%3C/svg%3E"); }
[data-icon="upload"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M12 21V9m0 0 4 4m-4-4-4 4M4 5h16'/%3E%3C/svg%3E"); }
[data-icon="x"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E"); }
[data-icon="settings"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .34 1.88l.06.06-2.83 2.83-.06-.06a1.7 1.7 0 0 0-1.88-.34 1.7 1.7 0 0 0-1.03 1.56V21h-4v-.08A1.7 1.7 0 0 0 8.97 19.36a1.7 1.7 0 0 0-1.88.34l-.06.06-2.83-2.83.06-.06A1.7 1.7 0 0 0 4.6 15a1.7 1.7 0 0 0-1.56-1.03H3v-4h.08A1.7 1.7 0 0 0 4.64 8.94a1.7 1.7 0 0 0-.34-1.88L4.24 7l2.83-2.83.06.06a1.7 1.7 0 0 0 1.88.34A1.7 1.7 0 0 0 10.04 3H14v.08a1.7 1.7 0 0 0 1.03 1.56 1.7 1.7 0 0 0 1.88-.34l.06-.06L19.8 7l-.06.06a1.7 1.7 0 0 0-.34 1.88 1.7 1.7 0 0 0 1.56 1.03H21v4h-.08A1.7 1.7 0 0 0 19.4 15Z'/%3E%3C/svg%3E"); }

@media print {
  @page {
    size: landscape;
    margin: 0.45in;
  }

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

  body {
    background: #fff !important;
    background-image: none !important;
    color: #111 !important;
    font-size: 10pt;
  }

  .app-corner-logo {
    display: none !important;
  }

  .app-shell {
    display: block !important;
    min-height: 0;
  }

  .sidebar,
  .mobile-nav,
  .drawer,
  .drawer-backdrop,
  .menu-btn,
  .topbar-actions,
  .row-actions,
  .panel-head button,
  .toolbar,
  .print-hide,
  dialog {
    display: none !important;
  }

  .main {
    padding: 0 !important;
  }

  .topbar {
    display: block !important;
    margin: 0 0 14px;
    padding: 0 0 10px;
    border-bottom: 2px solid #123d63;
  }

  .topbar h1 {
    font-size: 22pt;
  }

  .view {
    display: none !important;
  }

  .view.active {
    display: block !important;
  }

  .panel,
  .record-card,
  .metric {
    box-shadow: none !important;
    break-inside: avoid;
  }

  .panel {
    padding: 10px;
  }

  .metric-grid,
  .content-grid,
  .report-grid,
  .record-grid {
    gap: 8px;
  }

  .table-wrap {
    overflow: visible !important;
  }

  table {
    width: 100% !important;
    min-width: 0 !important;
    font-size: 8.5pt;
  }

  thead {
    display: table-header-group;
  }

  tr,
  img {
    break-inside: avoid;
  }

  th,
  td {
    padding: 6px 5px;
    overflow-wrap: anywhere;
  }

  .empty {
    min-height: 80px;
  }
}

@media (max-width: 980px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .main {
    padding: 16px;
  }

  .menu-btn,
  .mobile-nav {
    display: grid;
  }

  .mobile-nav {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: 8px;
    margin: 0 -16px 16px;
    padding: 0 16px 6px;
    overflow-x: auto;
  }

  .mobile-tab {
    padding: 0 12px;
    background: #fff;
    border: 1px solid var(--line);
    white-space: nowrap;
  }

  .mobile-tab.active {
    border-color: var(--brand);
    color: var(--brand);
  }

  html[data-theme="dark"] .mobile-tab {
    border-color: var(--line);
    background: var(--panel);
    color: var(--ink);
  }

  html[data-theme="dark"] .mobile-tab.active {
    border-color: var(--accent);
    color: #f0c65c;
  }

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

  .content-grid {
    display: grid;
  }

  .drawer-backdrop.open,
  .drawer.open {
    display: block;
  }

  .drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    background: rgba(20, 37, 33, 0.45);
  }

  .drawer {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 21;
    width: min(320px, 88vw);
    overflow-y: auto;
    padding: 18px;
    background: #142521;
    color: #fff;
    box-shadow: var(--shadow);
  }

  .drawer-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
  }

  .drawer .icon-btn {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.12);
  }

  .pay-schedule-row {
    grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr);
  }

  .pay-schedule-calculated {
    grid-column: 2;
  }
}

@media (max-width: 680px) {
  body[data-background="watermark"] {
    background-size: cover, 92vw auto;
  }

  body[data-background="full"] {
    background-size: cover, auto 62vh;
  }

  .app-corner-logo {
    width: 42vw;
    right: 10px;
    bottom: 10px;
  }

  .appearance-grid,
  .background-choice-grid {
    grid-template-columns: 1fr;
  }

  .scope-selection-head,
  .scope-option-heading,
  .scope-selection-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .scope-selection-actions {
    width: 100%;
  }

  .waiting-list-card {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .waiting-list-rank {
    width: 46px;
    min-height: 46px;
  }

  .waiting-list-actions {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
  }

  .waiting-list-actions > button {
    flex: 1 1 120px;
  }

  .scope-option-card {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    padding: 14px;
  }

  .scope-option-card input[type="checkbox"] {
    width: 24px;
    height: 24px;
    min-height: 24px;
  }

  .scope-option-heading {
    gap: 6px;
  }

  .scope-selection-summary {
    gap: 8px;
  }

  .bid-rooms-title,
  .bid-room-head,
  .pay-schedule-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .pay-schedule-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .pay-schedule-row .field,
  .pay-schedule-calculated,
  .pay-schedule-row .danger-btn {
    grid-column: 2;
  }

  .pay-schedule-summary {
    display: grid;
    grid-template-columns: 1fr auto;
    justify-content: stretch;
  }

  .bid-room-fields {
    grid-template-columns: 1fr;
  }

  .bid-room-fields .full {
    grid-column: auto;
  }

  .bid-attachment-card {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .bid-attachment-card .row-actions {
    grid-column: 1 / -1;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .primary-btn span:last-child {
    display: none;
  }

  #manualSaveBtn span:last-child {
    display: inline;
  }

  .toolbar,
  .modal-actions,
  .row-actions {
    flex-wrap: wrap;
  }

  .modal-actions > button,
  .customer-sheet .toolbar > button {
    flex: 1 1 140px;
  }

  .modal-actions > .primary-btn,
  .customer-sheet .toolbar > .primary-btn {
    flex-basis: 100%;
  }

  .table-wrap {
    position: relative;
  }

  td.row-actions {
    position: sticky;
    right: 0;
    z-index: 2;
    width: min(210px, 60vw);
    min-width: min(210px, 60vw);
    max-width: min(210px, 60vw);
    align-content: flex-start;
    background: var(--panel);
    border-left: 1px solid var(--line);
    box-shadow: -8px 0 14px rgba(23, 33, 31, 0.12);
  }

  td.row-actions > button {
    flex: 1 1 86px;
  }

  .metric-grid,
  .content-grid,
  .form-grid,
  .report-grid,
  .job-hub-grid {
    grid-template-columns: 1fr;
  }

  .job-hub-details,
  .job-hub-signatures,
  .job-hub-photo-grid {
    grid-template-columns: 1fr;
  }

  .job-hub-actions > button,
  .job-hub-actions > a {
    flex: 1 1 145px;
  }

  .global-search {
    width: min(100%, 230px);
  }

  .password-fields {
    grid-template-columns: 1fr;
  }

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

  .receipt-capture {
    grid-template-columns: 1fr;
  }

  .receipt-capture .capture-box {
    min-height: 108px;
  }

  .receipt-scan-row {
    align-items: stretch;
    flex-direction: column;
  }

  .receipt-suggestions {
    grid-template-columns: 1fr;
  }

  .customer-page {
    padding: 10px;
  }

  .customer-sheet {
    padding: 14px;
  }

  .customer-head {
    display: grid;
  }

  .customer-logo {
    width: 120px;
    height: 60px;
  }

  .customer-company {
    text-align: left;
  }
}
.workflow-note {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid #c7a84b;
  border-radius: 10px;
  background: #fff8dc;
  color: #3b3218;
}

#receiptsView > .panel + .panel {
  margin-top: 18px;
}

.bank-deposit-list-head {
  margin-top: 20px;
}

.field.full > .workflow-note {
  margin-bottom: 0;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.ai-pricing-warning { border-left: 5px solid var(--gold, #f5c84b); }
.ai-pricing-totals { margin: 1rem 0; }
.ai-pricing-review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.ai-pricing-review-grid section { padding: 1rem; border: 1px solid var(--line, #cad6e2); border-radius: 12px; }
.ai-pricing-review-grid h3 { margin-top: 0; }
@media (max-width: 720px) { .ai-pricing-review-grid { grid-template-columns: 1fr; } }

@media (max-width: 980px) {
  .receipt-period-controls {
    grid-template-columns: minmax(120px, 0.6fr) minmax(170px, 0.8fr) minmax(260px, 1.4fr);
  }

  .tax-packet-button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .tax-profile-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .tax-profile-check,
  .tax-profile-actions {
    grid-column: auto;
  }

  .tax-profile-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .receipt-center-head,
  #receiptsView .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

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

  .receipt-period-controls > *,
  .tax-packet-button,
  .receipt-add-button {
    grid-column: auto;
    width: 100%;
  }

  .tax-packet-button span:last-child,
  .receipt-add-button span:last-child {
    display: inline;
  }

  #receiptsView .toolbar {
    width: 100%;
  }

  #receiptsView .toolbar > button {
    flex: 1 1 150px;
  }
}
