/* Dhake & Associates | Editorial audit workspace, 15 October 2026
   Adapted from supplied flat financial design reference: spruce + mint,
   strong type, quiet rules, and minimal surface elevation. */
:root {
  --clr-primary: #006642;
  --clr-primary-lt: #008254;
  --clr-primary-hover: #00482f;
  --clr-accent: #008254;
  --clr-accent-lt: #e8fdac;
  --clr-bg: #fff;
  --clr-card: #fff;
  --clr-border: #d8d9da;
  --clr-border-lt: #ebebec;
  --clr-text: #171d1a;
  --clr-text-muted: #5d6561;
  --clr-success: #008254;
  --clr-success-bg: #effcf8;
  --clr-highlight: #effcf8;
  --sidebar-w: 248px;
  --radius: 3px;
  --shadow-sm: none;
  --shadow: none;
  --shadow-lg: none;
  --font-main: "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;
}
html { font-size: 15px; scroll-padding-top: 86px; }
body {
  background: white;
  color: var(--clr-text);
  font-family: var(--font-main);
  line-height: 1.5;
}
.main-panel { background: white; }
.sr-only {
  position: absolute!important;
  width: 1px!important; height: 1px!important;
  padding: 0!important; margin: -1px!important;
  overflow: hidden!important; clip: rect(0,0,0,0)!important;
  white-space: nowrap!important; border: 0!important;
}
:where(button,a,input,select,[tabindex]):focus-visible {
  outline: 3px solid #008254;
  outline-offset: 3px;
}
input[type="checkbox"], input[type="radio"] {
  accent-color: var(--clr-primary-lt);
  width: 18px; height: 18px; flex-shrink: 0;
}
button, .quick-btn, .nav-btn { -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .47; cursor: not-allowed; }

/* Navigation is now a quiet editorial rail, not a tile dashboard */
.sidebar {
  background: #fff;
  color: #111d17;
  border-right: 1px solid var(--clr-border-lt);
  box-shadow: none;
  scrollbar-color: #d7e7df transparent;
}
.sb-brand {
  background: white;
  min-height: 112px;
  padding: 28px 20px 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  border-bottom: 1px solid var(--clr-border-lt);
}
.brand-wordmark {
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -.045em;
  white-space: nowrap;
  line-height: 1.24;
  color: #161b19;
}
.brand-wordmark span { color: var(--clr-primary-lt); }
.brand-subtitle {
  font-size: .73rem;
  font-weight: 500;
  color: #69716d;
  letter-spacing: .015em;
}
.sb-section {
  padding: 21px 13px 12px;
}
.sb-label {
  color: #6b746f;
  font-size: .70rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 8px;
  padding: 0 9px;
}
.quick-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 57px;
  margin: 0;
  padding: 10px 9px;
  color: #232d27;
  background: white;
  border: none;
  border-bottom: 1px solid #eef0ef;
  border-radius: 0;
  box-shadow: none;
  text-align: left;
}
.quick-btn:hover, .quick-btn.active {
  background: #effcf8;
  color: var(--clr-primary);
  border-color: #d0eadd;
  transform: none;
  box-shadow: none;
}
.quick-key {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  flex: 0 0 30px;
  color: #00784f;
  background: #effcf8;
  font-size: .80rem;
  font-weight: 800;
  border-radius: 50%;
  font-variant-numeric: tabular-nums;
}
.qb-name {
  color: #171f1a;
  white-space: normal;
  font-size: .84rem;
  font-weight: 650;
  line-height: 1.3;
}
.qb-sr, .quick-btn.active .qb-sr {
  color: #67746c;
  font-size: .70rem;
  margin-top: 3px;
}
.nav-btn {
  display: block;
  margin: 3px 0;
  padding: 12px 11px;
  min-height: 45px;
  font-size: .88rem;
  font-weight: 570;
  border: none;
  border-left: 3px solid transparent;
  border-radius: 2px;
  background: none;
  color: #3f4b44;
  box-shadow: none;
}
.nav-btn:hover, .nav-btn.active {
  transform: none;
  background: #effcf8;
  border-left-color: #008254;
  color: #006642;
  box-shadow: none;
}
.nav-btn.active { font-weight: 720; }
.sb-close {
  color: #23452f;
  background: #effcf8;
  border-radius: 2px;
  font-size: .88rem;
  width: auto; min-width: 52px;
  height: 44px;
  padding: 0 10px;
}
.sb-close:hover { background: #d9f4e8; }

/* Editorial top navigation */
.topbar {
  background: white;
  border-bottom: 1px solid #ebebec;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  height: 72px;
  min-height: 72px;
  padding: 0 clamp(18px, 3vw, 44px);
  gap: 15px;
}
.topbar-office { color: #101715; font-size: .93rem; font-weight: 740; }
.topbar-sub { color: #737a76; font-size: .73rem; }
.mobile-topbar-title { display: none; }
.topbar-actions { gap: 9px; }
.topbar-actions button {
  border-radius: 2px;
  min-height: 43px;
  padding: 10px 15px;
  font-size: .8rem;
  font-weight: 710;
  box-shadow: none;
  line-height: 1.2;
}
.btn-staff {
  color: #006642;
  background: #f7f7f7;
  border: 1px solid #d8d9da;
}
.btn-staff:hover { background: #e3faf2; border-color: #008254; }
.btn-save, .btn-calculate, .topbar-print {
  background: #008254;
  color: #fff;
  border: 1px solid #008254;
  border-radius: 2px;
  box-shadow: none;
}
.btn-save:hover:not(:disabled), .btn-calculate:hover:not(:disabled), .topbar-print:hover:not(:disabled) {
  filter: none;
  background: #006642;
  border-color: #006642;
  color: #fff;
  box-shadow: none;
  transform: none;
}
.btn-topbar-preview {
  background: #f7f7f7;
  color: #00482f;
  border: 1px solid #d8d9da;
}
.btn-topbar-preview:hover:not(:disabled) { background: #effcf8; }
.label-compact { display: none; }
.topbar-menu {
  color: #00482f;
  border: 1px solid #d8d9da;
  border-radius: 2px;
  background: white;
  font-size: .85rem;
  font-weight: 700;
  min-width: 52px;
  min-height: 44px;
  box-shadow: none;
}

/* One compact green editorial band. Flat information sections beneath it. */
.page-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px clamp(22px, 3.4vw, 48px) 70px;
}
.workspace-intro {
  color: white;
  background: linear-gradient(105deg, #00482f, #006642 70%, #008254);
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: clamp(28px,4vw,48px) clamp(25px,4vw,50px);
  margin: 10px 0 38px;
  overflow: hidden;
}
.workspace-intro:after { display:none; }
.workspace-kicker {
  color: #c6ffdb;
  font-size: .73rem;
  font-weight: 760;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.workspace-intro h1 {
  color: white;
  font-size: clamp(1.7rem, 3.1vw, 2.8rem);
  font-weight: 760;
  letter-spacing: -.045em;
  line-height: 1.15;
  margin: 12px 0 16px;
  max-width: 740px;
}
.workspace-intro p {
  color: #e2f6e9;
  font-size: 1rem;
  line-height: 1.6;
  max-width: 650px;
}
.workspace-facts {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 24px;
  color: #d0f6e5;
  font-size: .78rem;
}
.workspace-facts span {
  border: none;
  border-radius: 0;
  padding: 0;
  background: none;
  box-shadow: none;
  color: inherit;
  font-size: .78rem;
  font-weight: 620;
}
.workspace-facts span + span::before {
  content: "·";
  color: #a8ea4c;
  margin-right: 14px;
}
.workflow-lead {
  font-size: 1.26rem;
  font-weight: 740;
  letter-spacing: -.025em;
  color: #141b17;
  line-height: 1.35;
  margin: 0 0 12px;
}
.workflow-lead span {
  display: block;
  font-size: .86rem;
  font-weight: 430;
  color: #626e66;
  letter-spacing: 0;
  margin-top: 6px;
}
.workflow-section {
  border: none;
  border-top: 1px solid #d8d9da;
  background: white;
  box-shadow: none;
  overflow: visible;
  padding: 25px 0 26px;
  margin: 0;
  border-radius: 0;
  scroll-margin-top: 85px;
}
.workflow-section .card-header {
  display: grid;
  grid-template-columns: 38px minmax(0,1fr);
  gap: 8px;
  align-items: center;
  border: none;
  background: white;
  color: #141b17;
  padding: 0 0 17px;
  border-radius: 0;
}
.workflow-section .card-header h3 {
  color: #121714;
  font-size: 1.27rem;
  font-weight: 745;
  letter-spacing: -.025em;
  line-height: 1.34;
}
.workflow-section .card-num {
  font-size: .88rem;
  font-weight: 780;
  background: none;
  color: #008254;
  border-radius: 0;
  width: 30px; height: 32px;
  justify-content: flex-start;
  flex-shrink: 0;
}
.workflow-section .card-body { padding: 0 0 0 46px; overflow: visible; }
.workflow-section .result-header {
  grid-template-columns: 38px minmax(150px,1fr) auto;
}
.card, .qc-form-card, .note-card {
  border-color: #ebebec;
  border-radius: 0;
  box-shadow: none;
}
.card:hover, .qc-form-card:hover, .note-card:hover { box-shadow: none; }
.card-header {
  color: #161c19;
  background: white;
  border-bottom: 1px solid #ebebec;
  padding-top: 16px;
  padding-bottom: 16px;
}
.card-header h3 {
  color: #141a17;
  font-weight: 740;
  font-size: 1.09rem;
}
.card-num {
  border-radius: 0;
  color: #008254;
  background: #effcf8;
}
.card-body { padding: 22px 0; }
.form-row { gap: 15px 22px; margin-bottom: 19px; }
.form-group { min-width: 210px; gap: 7px; }
.form-group label,
.lookup-label {
  font-size: .87rem;
  font-weight: 670;
  color: #242b26;
  text-transform: none;
  letter-spacing: 0;
}
.form-group input:not([type=checkbox]):not([type=radio]),
.form-group select,
.form-group textarea {
  width: 100%;
  font-size: .94rem;
  min-height: 46px;
  line-height: 1.4;
  padding: 11px 13px;
  color: #141b17;
  border: 1px solid #cacfc9;
  border-radius: 2px;
  background: #fff;
  box-shadow: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #008254;
  box-shadow: 0 0 0 3px rgba(0,130,84,.10);
}
.form-group input::placeholder, #societySearch::placeholder { color: #838d86; }
.lookup-label { display:block; margin-bottom:5px; }
.lookup-intro { color: #5c675f; font-size: .87rem; margin: 0 0 14px; line-height: 1.5; }
#section-society-type .card-body { padding: 0 0 0 46px; }
.society-search-wrap {
  position: relative;
  max-width: 910px;
  isolation: isolate;
}
#societySearch {
  font-size: 1rem;
  font-weight: 540;
  color: #15221a;
  border: 1px solid #bfc9c3;
  border-radius: 2px;
  padding: 12px 48px 12px 15px;
  min-height: 54px;
  caret-color: #008254;
  background: #fff;
  width: 100%;
  box-shadow: none;
}
#societySearch:focus {
  outline: 3px solid rgba(0,130,84,.12);
  outline-offset: 0;
  border-color: #008254;
}
.search-icon {
  top: 10px;
  right: 16px;
  font-family: Arial,sans-serif;
  font-size: 1.6rem;
  line-height: 1.5;
  color: #006642;
}
.search-underline { display: none; }
.search-hint {
  color: #626b65;
  font-size: .78rem;
  line-height: 1.5;
  margin-top: 8px;
}
.dropdown-list {
  display: block;
  position: absolute!important;
  left: 0; right: 0;
  top: calc(100% + 5px);
  width: 100%;
  height: auto!important;
  max-height: min(340px,45vh)!important;
  margin-top: 0;
  z-index: 120;
  border: 1px solid #cad9d0;
  border-radius: 2px;
  padding: 4px;
  background: white;
  overflow-y: auto;
  box-shadow: 0 12px 28px rgba(11,32,20,.11);
  scrollbar-color: #b6d4c4 #fff;
}
.dropdown-list[hidden] { display: none!important; }
.dropdown-list li {
  padding: 12px 13px;
  border-bottom: 1px solid #eef1ee;
  min-height: 47px;
  color: #1d2922;
  cursor: pointer;
  font-size: .88rem;
  line-height: 1.4;
  user-select: none;
  border-radius: 0;
}
.dropdown-list li:last-child { border-bottom: none; }
.dropdown-list li.active,
.dropdown-list li:hover,
.dropdown-list li[aria-selected="true"] {
  background: #effcf8;
  color: #00482f;
}
.dropdown-list li .sr-num {
  font-size: .8rem;
  color: #007b52;
  font-weight: 740;
  width: 30px;
  text-align: left;
  opacity: 1;
}
.dropdown-list li.dd-empty {
  color: #6b736d;
  font-style: normal;
  min-height: 54px;
}
.selected-line {
  max-width: 910px;
  border: none;
  border-left: 3px solid #008254;
  border-radius: 0;
  background: #effcf8;
  color: #183d2a;
  padding: 12px 15px;
  margin-top: 20px;
  font-size: .9rem;
  gap: 8px 13px;
}
.selected-line .sel-sr {
  background: transparent;
  color: #006642;
  padding: 0;
  font-size: .82rem;
  font-weight: 720;
  white-space: nowrap;
}
.selected-line .sel-name { color: #171d1a; font-weight: 650; }
.type-shortcuts {
  display: flex;
  align-items: center;
  gap: 6px 12px;
  flex-wrap: wrap;
  margin-top: 19px;
  max-width: 910px;
}
.type-shortcuts-label {
  font-size: .78rem;
  font-weight: 680;
  color: #515b54;
  margin-right: 6px;
}
.type-shortcuts button {
  font-family: inherit;
  font-size: .83rem;
  color: #006642;
  font-weight: 680;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  padding: 7px 4px;
  border: none;
  border-radius: 0;
  background: none;
  cursor: pointer;
  min-height: 43px;
}
.type-shortcuts button:hover { color: #003f29; background: #effcf8; }
.type-shortcuts .browse-rates { color: #005fb9; }
.type-shortcuts .browse-rates:hover { color: #004788; }

/* Flat input collections and clear transaction controls */
.radio-label, .location-option {
  border-radius: 2px;
  color: #25352a;
}
.location-option {
  min-height: 47px;
  border: 1px solid #d8d9da;
  margin-bottom: 0;
  border-top-width: 0;
  font-size: .88rem;
}
.location-option:first-of-type { border-top-width: 1px; }
.location-option.selected, .location-option:hover {
  border-color: #008254;
  background: #effcf8;
  color: #00482f;
}
.location-rate {
  background: none;
  color: #006642;
  border-radius: 0;
  padding: 0;
  font-size: .83rem;
}
.calculate-row {
  justify-content: flex-start;
  display:flex;
  gap: 12px;
  margin: 5px 0 26px;
  padding: 8px 0 12px 46px;
}
.btn-calculate {
  min-height: 49px;
  font-size: .93rem;
  font-weight: 740;
  border-radius: 2px;
  letter-spacing: 0;
  padding: 13px 25px;
  background: #008254;
  border: 1px solid #008254;
  color: white;
  box-shadow: none;
}
.btn-reset {
  min-height: 49px;
  border: 1px solid #d8d9da;
  color: #006642;
  border-radius: 2px;
  background: #f7f7f7;
  padding: 12px 18px;
  font-size: .87rem;
  font-weight: 700;
}
.btn-reset:hover { background: #effcf8; }
.result-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.result-actions button,
.result-header .result-actions > button,
.result-actions > button:not(.btn-save) {
  min-height: 42px;
  border: 1px solid #cbd7cf;
  border-radius: 2px;
  padding: 9px 13px;
  background: #f7f7f7;
  color: #006642;
  font-size: .80rem;
  font-weight: 680;
}
.result-actions button:hover:not(:disabled) { background: #effcf8; color: #00482f; }
.result-actions > .btn-save {
  color: white;
  background: #008254;
  border: 1px solid #008254;
}
#resultBody { overflow-x: auto; }
.result-info-grid {
  padding: 20px 21px;
  background: #effcf8;
  border: none;
  border-left: 3px solid #008254;
  border-radius: 0;
  gap: 13px 30px;
  margin-bottom: 23px;
}
.info-label {
  color: #54655a;
  font-size: .72rem;
  font-weight: 660;
}
.info-value {
  font-size: .89rem;
  font-weight: 680;
  color: #171d1a;
  overflow-wrap: anywhere;
}
.calc-table, .gr-schedule-table, .gr-table, .history-table { border-collapse: collapse; }
.calc-table th, .gr-schedule-table th, .gr-table th, .history-table th {
  background: #effcf8;
  color: #202b23;
  border-bottom: 1px solid #d8d9da;
  text-transform: none;
  letter-spacing: .01em;
  font-size: .79rem;
  font-weight: 710;
  padding: 12px 13px;
}
.calc-table td, .gr-schedule-table td, .gr-table td {
  border-bottom: 1px solid #ebebec;
  padding: 12px 13px;
  color: #3d4540;
}
.calc-table tr:nth-child(even) td { background: #fff; }
.calc-table tr.subtotal td { background: #effcf8; color: #121a15; }
.calc-table tr.ceiling td { background: #f7f7f7; color: #394b3e; }
.calc-table tr.total-row td { background: #006642; color: white; }
.gr-schedule-table tr:hover td, .gr-table tr:hover td { background: #effcf8; }
.gr-schedule-table .badge-method { border-radius: 2px; padding: 5px 8px; }
.btn-table-calc {
  min-height: 42px;
  border: 1px solid #008254;
  color: #006642;
  background: #effcf8;
  border-radius: 2px;
  font-size: .82rem;
  padding: 7px 12px;
}
.btn-table-calc:hover { color: #fff; background: #008254; }
.additional-block { border-bottom: 1px solid #ebebec; padding: 20px 0; }
.additional-block:last-child { border-bottom: none; }
.additional-block h4 {
  color: #171d1a;
  font-size: 1.05rem;
  font-weight: 730;
  letter-spacing: -.015em;
}
.travel-result-box, .variance-result-box {
  background: #effcf8;
  border: none;
  border-radius: 0;
}
.final-fee-box {
  background: #effcf8;
  border: 1px solid #e3faf2;
  border-radius: 0;
  padding: 14px 18px;
}
.fee-row.grand-total { border-radius: 0; background: #006642; color: #fff; }
.fee-row.grand-total .fee-label, .fee-row.grand-total .fee-amount { color: white; }

/* Every quick calculator uses the same neutral, flat workflow */
.qc-hero, .qc-green, .qc-blue, .qc-orange {
  color: #171d1a;
  background: #effcf8;
  border: none;
  border-bottom: 2px solid #008254;
  border-radius: 0;
  box-shadow: none;
  padding: 27px 0 24px;
  margin: 9px 0 25px;
}
.qc-hero h2 { color: #151b17; font-size: 1.45rem; font-weight: 760; letter-spacing: -.03em; }
.qc-hero p { color: #506656; opacity: 1; }
.qc-icon { display: none; }
.qc-grid { gap: 0; border-top: 1px solid #d8d9da; margin-bottom: 15px; }
.qc-form-card, .qc-grid .card {
  border: none;
  border-bottom: 1px solid #d8d9da;
  border-radius: 0;
  box-shadow: none;
}
.qc-form-card + .qc-form-card { border-left: 1px solid #ebebec; }
.qc-form-card .card-body { padding: 20px 23px 25px; }
.qc-form-card .card-header { background: #fff; border-bottom: 1px solid #ebebec; }
.qc-guide-box, .qc-rate-badge {
  background: #effcf8;
  border: none;
  border-left: 2px solid #b7ecda;
  border-radius: 0;
  padding: 14px 17px;
  color: #4b6051;
}
.qc-guide-box strong { color: #00482f; }
.qcr-item { min-height: 33px; gap: 12px; border-bottom: 1px solid #cbe5d8; }
.qcr-item:last-child { border-bottom: none; }
.qcr-item strong, .qcr-item.cap strong { color: #006642; }
.qc-result-area .card {
  border: 0;
  border-top: 1px solid #d8d9da;
  border-radius: 0!important;
  box-shadow: none;
}
.qc-result-area .card-body { padding: 24px 0; }

/* Rate notes are editorial sections, not a grid of tiles */
.notes-grid { display: grid; grid-template-columns: 1fr; gap: 0; }
.note-card {
  border: none;
  border-bottom: 1px solid #ebebec;
  border-radius: 0;
  box-shadow: none;
  background: white;
  padding: 4px 0;
}
.note-header { background: #fff; border: 0; padding: 16px 0 7px; }
.note-header h4 { color: #151b17; font-size: 1.00rem; font-weight: 730; }
.note-body { padding: 0 0 20px; color: #424b44; line-height: 1.62; }
.note-pill { border-radius: 0; background: #effcf8; color: #006642; }
.notes-category-title { border-bottom: 1px solid #d8d9da; padding-bottom: 10px; }
.note-sub { color: #4c5650; }
.nc-sr-tags span { cursor: pointer; }
.history-intro h2 { color: #151b17; font-size: 1.65rem; }
.history-intro p { color: #626a64; }
.history-table thead { background: #effcf8; }
.history-table th { color: #273429; }
.history-table tr:hover td { background: #effcf8; }
.history-table .row-actions button { border-radius: 2px; color: #006642; }
.site-footer {
  margin-top: auto;
  padding: 22px 34px;
  background: #f7f7f7;
  border-top: 1px solid #ebebec;
  color: #515b54;
  font-size: .77rem;
}
.site-footer strong { color: #222c25; }
.site-footer a { color: #005fb9; }
.modal-overlay { z-index: 355; }
.modal-box, .staff-modal-box { border-radius: 4px; box-shadow: 0 20px 38px rgba(0,32,16,.14); }
.modal-header { background: #006642; }
.modal-close { border-radius: 2px; min-height: 40px; min-width: 44px; font-size: .88rem; }
.toast { border-radius: 2px; background: #00482f; }
.toast.error { background: #9e2929; }
.gst-note { color: #38634c; }

/* Tablet / touch: no fixed-width form regions or horizontal body overflow */
@media (max-width: 1100px) {
  .page-inner { padding-left: 28px; padding-right: 28px; }
  .topbar-actions { gap: 6px; }
  .topbar-actions button { padding: 9px 10px; font-size: .76rem; }
}
@media (max-width: 992px) {
  .sidebar { box-shadow: 15px 0 30px rgba(0,30,16,.12); }
  .topbar-menu { display: block; }
  .topbar { padding: 0 16px; height: 66px; min-height: 66px; }
  .sb-overlay { background: rgba(10,26,17,.48); }
  .mobile-topbar-title { display: block; font-size: .95rem; font-weight: 740; color: #121b15; margin-right: auto; }
  .topbar-text { display: none; }
  .topbar-actions { margin-left: auto; }
  .page-inner { padding-top: 13px; }
}
@media (max-width: 720px) {
  .page-inner { padding: 11px 19px 52px; margin: 0 auto; }
  .workspace-intro { padding: 28px 22px; margin: 9px -19px 28px; }
  .workspace-intro h1 { font-size: 1.90rem; }
  .workspace-intro p { font-size: .95rem; }
  .workspace-facts { flex-direction: column; gap: 5px; margin-top: 16px; }
  .workspace-facts span + span::before { display: none; }
  .workflow-section { padding: 23px 0 28px; }
  .workflow-section .card-header { grid-template-columns: 28px 1fr; gap: 7px; }
  .workflow-section .card-header h3 { font-size: 1.13rem; }
  .workflow-section .card-num { width: 25px; font-size: .82rem; }
  .workflow-section .card-body, #section-society-type .card-body { padding-left: 0; }
  .workflow-section .result-header { grid-template-columns: 28px 1fr; }
  .workflow-section .result-header .result-actions { grid-column: 1 / -1; margin: 9px 0 0; width:100%; }
  .result-actions button { min-height: 44px; }
  .form-row { flex-direction: column; gap: 16px; }
  .form-group { min-width: 0; }
  .calculate-row { padding-left: 0; gap: 9px; }
  .calculate-row .btn-calculate, .calculate-row .btn-reset { flex: 1 1 100%; width: 100%; }
  .result-info-grid { grid-template-columns: 1fr; gap: 12px; }
  .calc-table { min-width: 560px; }
  .qc-grid { grid-template-columns: 1fr; gap: 0; }
  .qc-form-card + .qc-form-card { border-left: none; }
  .qc-form-card .card-body { padding: 18px 0 24px; }
  .qc-form-card .card-header { padding-left: 0; padding-right: 0; }
  .qc-hero { padding: 22px 0; }
  .qc-hero h2 { font-size: 1.25rem; }
  .qc-result-area .card-body { padding: 14px 0; }
  .notes-category-title h3 { font-size: 1.06rem; }
  .topbar-actions .btn-topbar-preview, .topbar-actions .topbar-print { display: none; }
}
@media (max-width: 430px) {
  html { font-size: 14.5px; }
  .topbar { padding: 0 11px; gap: 7px; }
  .topbar-menu { padding: 8px; min-width: 46px; }
  .topbar-actions { gap: 5px; }
  .topbar-actions button { min-height: 43px; padding: 9px 10px; font-size: .77rem; }
  .label-full { display: none; }
  .label-compact { display: inline; }
  #btnSaveCalculation:disabled { display: none; }
  .page-inner { padding: 8px 16px 43px; }
  .workspace-intro { margin: 8px -16px 26px; padding: 25px 19px; }
  .workspace-intro h1 { font-size: 1.8rem; }
  .type-shortcuts { gap: 2px 11px; }
  .type-shortcuts-label { flex-basis: 100%; }
  .type-shortcuts button { padding: 5px 0; }
  .selected-line { flex-direction: column; align-items: flex-start; }
  .qc-hero { margin-top: 7px; }
  .modal-box { width: calc(100vw - 18px); }
}
@media (prefers-reduced-motion: reduce) {
  .page { animation: none!important; }
}
@media print {
  /* Maintain the existing A4 working-paper layout. */
  .workspace-intro, .workflow-section, .topbar, .sidebar,
  .site-footer, .toast, .modal-overlay { display: none!important; }
}

/* Quiet unavailable actions: the toolbar only exposes actions that can run. */
.topbar-actions button:disabled { display: none!important; }

@media print {
  #printSheet .official-report-card {
    padding: 12px 16px!important;
    page-break-inside: auto!important;
  }
  #printSheet .calc-table th { padding: 4px 7px!important; font-size: 7.8pt!important; }
  #printSheet .calc-table td { padding: 3px 7px!important; font-size: 8pt!important; }
  #printSheet .print-info-table td { padding: 4px 7px!important; }
  #printSheet .print-signatures { margin-top: 10px!important; gap: 10px!important; }
  #printSheet .print-sig-box strong { margin-bottom: 9px!important; }
  #printSheet .print-cert-text { margin-bottom: 10px!important; }
  #printSheet .print-disclaimer { margin-top: 8px!important; }
}

@media print {
  #printSheet { zoom: .88; }
  #printSheet .print-signatures { break-inside: avoid!important; page-break-inside: avoid!important; }
}

/* Authenticated ERP identity form: sober, precise errors and touch-friendly inputs */
.staff-login-intro { margin: 0 0 19px; color:#4c5f54; line-height:1.65; font-size:.88rem; }
.staff-modal-box label { color:#253b2f; }
.staff-modal-box input { min-height:48px; border-radius:3px; background:#fff; }
.staff-modal-box #staffError { color:#a12424; }
.staff-modal-box .btn-calculate { background:#006642; color:white; box-shadow:none; border-radius:3px; }
.staff-modal-box .btn-calculate:hover { background:#00482f; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   RESULT & WORKING-PAPER SYSTEM — responsive browser preview and A4 print
   All document rules are scoped to .paper-document.
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
body.report-preview-open { overflow: hidden; }
#reportPreviewModal { padding: clamp(8px,2vw,24px); }
#reportPreviewModal .report-modal-box {
  width: min(100%, 1040px)!important;
  max-width: 1040px!important;
  max-height: min(96vh,96dvh)!important;
  border-radius: 9px!important;
  box-shadow: 0 26px 70px rgba(10,31,22,.25)!important;
  overflow: hidden!important;
}
#reportPreviewModal .modal-header {
  display: flex;
  flex: 0 0 auto;
  gap: 15px;
  padding: 14px 22px;
  min-height: 72px;
  background: #006642;
}
#reportPreviewModal .modal-header > div:first-child { min-width: 0; }
#reportPreviewModal .modal-header h3 { font-size: 1.02rem!important; font-weight: 740; line-height: 1.3; color:#fff!important; }
#reportPreviewModal .modal-header p { margin-top: 3px!important; color: #d7f3e3!important; line-height: 1.35; }
#reportPreviewModal .modal-header > div:last-child {
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}
#reportPreviewModal .btn-modal-print {
  background: #fff;
  color: #005639;
  border: 1px solid #fff;
  border-radius: 3px;
  padding: 10px 16px;
  min-height: 43px;
  cursor: pointer;
  font-size: .85rem;
}
#reportPreviewModal .btn-modal-print:hover { background: #d7f3e3; }
#reportPreviewModal .modal-close {
  color: #fff;
  background: transparent;
  border-radius: 3px;
  min-height: 43px;
  padding: 7px 11px;
  font-size: .82rem;
  font-weight: 700;
  opacity: 1;
}
#reportPreviewModal .modal-close:hover { background: rgba(255,255,255,.15); }
#reportPreviewContent.report-preview-body {
  min-height: 0;
  overflow-y: auto!important;
  padding: clamp(12px, 2.5vw, 34px)!important;
  background: #edf3ef!important;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

/* Screen document: deliberately independent of legacy print-only selectors. */
.paper-document {
  width: 100%;
  max-width: 840px;
  margin: 0 auto;
  padding: clamp(22px,4vw,46px);
  background: #fff;
  color: #1c2620;
  border: 1px solid #dfe7df;
  box-shadow: 0 10px 36px rgba(20,51,33,.075);
  font-size: .93rem;
  line-height: 1.53;
  font-family: "Segoe UI", Arial, system-ui, sans-serif;
  overflow-wrap: anywhere;
}
.paper-document *, .paper-document *::before, .paper-document *::after { box-sizing: border-box; }
.paper-document :where(h2,h3,p,dt,dd) { margin: 0; }
.paper-document h3 { color: #14241b; font-weight: 750; }
.paper-header { padding-bottom: 22px; border-bottom: 2px solid #006642; }
.paper-brand { font-size: 1.14rem; font-weight: 790; letter-spacing: -.04em; color: #006642; }
.paper-eyebrow {
  margin-top: 9px!important;
  text-transform: uppercase;
  letter-spacing: .085em;
  font-size: .69rem;
  font-weight: 720;
  color: #62796a;
}
.paper-header h2 { font-weight: 790; font-size: clamp(1.38rem,2.3vw,1.84rem); line-height: 1.22; letter-spacing: -.033em; margin: 6px 0 8px; color: #17251c; }
.paper-lead { color: #57645b; font-size: .87rem; line-height: 1.6; max-width: 675px; }
.paper-meta {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 12px 24px;
  padding: 17px 0 15px;
  border-bottom: 1px solid #e5ece7;
  font-size: .82rem;
  color: #303d33;
}
.paper-meta span { min-width: 0; }
.paper-meta strong { color: #596a60; font-weight: 660; margin-right: 7px; }
.paper-draft {
  margin: 16px 0 0;
  padding: 11px 14px;
  background: #fff9e8;
  border-left: 3px solid #b9811a;
  font-size: .85rem;
  color: #694a12;
  line-height: 1.5;
}
.paper-draft strong { color: #67470f; }
.paper-section { padding: 24px 0 0; break-inside: auto; }
.paper-section > h3 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 0 0 13px;
  font-size: 1.00rem;
  font-weight: 750;
  letter-spacing: -.01em;
  color: #111c14;
}
.paper-section > h3 span { color: #008254; font-size: .77rem; font-weight: 790; letter-spacing: .02em; }
.paper-field-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 15px 21px;
  margin: 0;
  padding: 18px 20px;
  background: #effcf8;
}
.paper-field { min-width: 0; display: block; }
.paper-field dt { font-weight: 660; font-size: .73rem; text-transform: uppercase; letter-spacing: .01em; color: #567160; line-height:1.34; }
.paper-field dd { font-size: .91rem; font-weight: 690; color: #17241a; margin-top: 4px; line-height:1.45; }
.paper-field dd.paper-missing { font-weight: 530; color: #885d1d; }
.paper-explainer {
  font-size: .87rem;
  line-height: 1.5;
  margin: 0 0 12px!important;
  color: #365b42;
  background: #effcf8;
  padding: 10px 13px;
  border-left: 2px solid #008254;
}
.paper-table-wrap { max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
.paper-breakdown { width:100%; border-collapse:collapse; table-layout:fixed; border:0; font-size:.86rem; }
.paper-breakdown .paper-col-label { width: 43%; }
.paper-breakdown .paper-col-basis { width: 36%; }
.paper-breakdown .paper-col-money { width: 21%; }
.paper-breakdown th {
  background: #effcf8;
  color: #30493b;
  padding: 11px 13px;
  border-bottom: 1px solid #cdddcf;
  text-align: left;
  font-weight: 720;
  font-size: .77rem;
  line-height: 1.4;
}
.paper-breakdown td {
  color: #29372e;
  padding: 11px 13px;
  border-bottom: 1px solid #e8eeea;
  text-align: left;
  vertical-align: top;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.paper-breakdown .number { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.paper-breakdown .paper-subtotal td { background:#f8faf8; font-weight: 680; color: #16251c; }
.paper-breakdown .paper-limit-note td { color: #755413; font-size: .8rem; font-style:italic; }
.paper-breakdown .paper-fee-total td { background: #006642; font-weight: 760; color: #fff; }
.paper-money-list { border-top:1px solid #e1e9e3; }
.paper-money-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 52px;
  padding: 10px 3px;
  border-bottom: 1px solid #e8eee9;
}
.paper-money-description { min-width:0; font-size: .9rem; color: #26342a; }
.paper-money-description > span { display:block; font-weight: 590; }
.paper-money-description small { display:block; max-width: 480px; margin-top: 3px; line-height:1.4; font-size: .74rem; color: #748077; }
.paper-money-amount { display: block; white-space:nowrap; color:#1a2c21; font-size: .97rem; font-weight: 720; font-variant-numeric:tabular-nums; text-align:right; }
.paper-grand {
  display:grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap:14px;
  align-items:center;
  padding:17px 18px;
  margin-top: 11px;
  background: #006642;
  color: #fff;
  font-size: 1.04rem;
  font-weight: 730;
  border-radius: 2px;
}
.paper-grand > span { min-width:0; }
.paper-grand strong { white-space:nowrap; color:#fff; font-size:1.19rem; font-weight:800; font-variant-numeric:tabular-nums; }
.paper-variance { border-top: 1px solid #e0e9e3; margin-top: 20px; padding-top:20px; }
.paper-variance .paper-money-row { min-height:43px; }
.paper-variance-state {
  margin:13px 0 0!important;
  padding:10px 13px;
  font-size: .84rem;
  line-height:1.5;
  background: #effcf8;
  color:#145d3d;
  border-left: 3px solid #008254;
}
.paper-variance-state.above, .paper-variance-state.below { background:#fff9e8; color:#714e10; border-left-color:#bc8f25; }
.paper-signatures {
  display:grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 23px;
  margin-top: 39px;
  break-inside:avoid;
}
.paper-signatures > div { min-width:0; border-top:1px solid #aabeb0; padding-top: 8px; }
.paper-signatures strong { display:block; color:#293c2d; font-size:.82rem; font-weight:710; }
.paper-signatures span { display:block; margin-top:12px; color:#889389; font-size:.72rem; }
.paper-legal {
  color:#68736b;
  font-size:.72rem;
  line-height:1.52;
  margin-top:27px;
  padding-top:13px;
  border-top:1px solid #dfe9e1;
}

/* Result screens: one flat information hierarchy, no bordered/stacked tiles. */
#page-calculator #section-result .calc-table,
.quick-result-panel .calc-table { min-width: 0; table-layout: auto; }
#page-calculator #section-result .calc-table td,
.quick-result-panel .calc-table td { overflow-wrap:anywhere; }
#page-calculator #section-result .calc-table th.amount,
.quick-result-panel .calc-table th.amount { white-space: nowrap; }
.quick-result-panel {
  border:none!important;
  border-top:1px solid #d8d9da!important;
  border-radius:0!important;
  box-shadow:none!important;
  margin-top: 16px;
  padding:0 0 23px;
}
.quick-result-panel .card-header {
  border-bottom:1px solid #dce6df;
  background:#fff;
  padding:19px 0 14px;
  display:flex;
  flex-wrap:wrap;
  gap:8px 13px;
}
.quick-result-panel .card-header h3 { font-weight:750; line-height:1.32; min-width:210px; }
.quick-result-panel .card-num {
  width:auto; min-width:45px; padding:6px 9px;
  height:auto; border-radius:2px;
  font-size:.72rem; text-transform:uppercase; letter-spacing:.04em;
  background:#effcf8; color:#006642;
}
.quick-result-panel .result-actions { gap:7px; margin-left:auto; }
.quick-result-panel .card-body { padding:21px 0 0; }
.quick-result-panel .result-info-grid { border:none; border-left:3px solid #008254; }
.quick-result-panel .liquidation-notice, #section-result .liquidation-notice {
  background:#fff9e8;
  border:none;
  border-left:3px solid #bb8a2b;
  color:#6b501b;
  border-radius:0;
  padding:12px 15px;
  line-height:1.5;
}
.quick-result-panel .liq-icon, #section-result .liq-icon { display:none; }
.quick-adjustments {
  padding:22px 0 15px;
  border-top:1px solid #e0e7e0;
  border-bottom:1px solid #e0e7e0;
  margin:21px 0 18px;
  background:white;
}
.quick-adjustments h4 {
  font-size:1.03rem;
  font-weight:750;
  letter-spacing:-.012em;
  color:#202d23;
  margin-bottom:15px;
  text-transform:none;
}
.quick-report-hint { color:#65746b; font-size:.82rem; line-height:1.5; margin:15px 0 0; }
.not-applicable { opacity:.42; }
.not-applicable input { cursor:not-allowed; }
.not-applicable .location-rate { color:inherit; }
.quick-result-panel .final-fee-box, #section-final .final-fee-box {
  padding: 0;
  border:1px solid #dbe6de;
  border-radius:0;
  box-shadow:none;
  background:#fff;
  overflow:hidden;
}
.quick-result-panel .fee-row, #section-final .fee-row {
  display:grid;
  grid-template-columns: minmax(0,1fr) max-content;
  gap:14px;
  align-items:center;
  min-height:51px;
  padding:12px 17px;
  background:white;
}
.quick-result-panel .fee-row.highlight, #section-final .fee-row.highlight { background:#effcf8; }
.quick-result-panel .fee-row.grand-total, #section-final .fee-row.grand-total {
  background:#006642;
  color:white;
  border-bottom:none;
  font-size: 1rem;
}
.quick-result-panel .fee-row.grand-total .fee-label,
.quick-result-panel .fee-row.grand-total .fee-amount,
#section-final .fee-row.grand-total .fee-label,
#section-final .fee-row.grand-total .fee-amount { color:white!important; }
.quick-result-panel .fee-row .fee-note,
#section-final .fee-row .fee-note { display:inline-block; max-width:460px; margin-top:4px; line-height:1.4; }
.quick-result-panel .fee-row .fee-amount, #section-final .fee-row .fee-amount {
  white-space:nowrap;
  text-align:right;
  align-self:center;
  font-variant-numeric:tabular-nums;
}
.quick-result-panel .variance-badge { text-align:left; border-radius:2px; }

/* Responsive document: match preview and print without horizontal clipping. */
@media (max-width:760px) {
  #reportPreviewModal .report-modal-box { max-height:97dvh!important; width:100%!important; }
  #reportPreviewModal .modal-header { padding:10px 12px; min-height:62px; gap:8px; }
  #reportPreviewModal .modal-header h3 { font-size:.84rem!important; }
  #reportPreviewModal .modal-header p { display:none; }
  #reportPreviewModal .btn-modal-print { min-height:42px; padding:7px 10px; font-size:.76rem; }
  #reportPreviewModal .modal-close { min-width:42px; font-size:.76rem; padding:6px 7px; }
  #reportPreviewContent.report-preview-body { padding: 8px!important; }
  .paper-document { padding:20px 16px; font-size:.86rem; }
  .paper-meta, .paper-field-grid { grid-template-columns:1fr; gap:12px; }
  .paper-field-grid { padding:14px 13px; }
  .paper-section { padding-top:19px; }
  .paper-breakdown { min-width: 500px; }
  .paper-signatures { gap:13px; }
  .quick-result-panel .card-header h3 { min-width: 0; flex-basis:100%; }
}
@media (max-width:460px) {
  .paper-signatures { grid-template-columns:1fr; gap:14px; }
  .paper-grand { padding:12px; font-size:.92rem; }
  .paper-grand strong { font-size:1.05rem; }
  .quick-result-panel .result-actions { width:100%; }
  .quick-result-panel .result-actions button { flex:1 1 30%; }
  .quick-result-panel .fee-row, #section-final .fee-row { padding:10px; gap:9px; }
  .quick-result-panel .fee-row .fee-amount, #section-final .fee-row .fee-amount { font-size:.85rem; }
}
@page { size: A4 portrait; margin: 14mm 13mm; }
@media print {
  html,body {
    background:#fff!important;
    width:100%!important;
    font-size:10pt!important;
    line-height:1.35!important;
    margin:0!important;
    padding:0!important;
  }
  .paper-document, #printSheet .paper-document {
    display:block!important;
    width:100%!important;
    max-width:none!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    box-shadow:none!important;
    background:white!important;
    color:#121c15!important;
    font-family:"Segoe UI",Arial,sans-serif!important;
    font-size:9pt!important;
    line-height:1.35!important;
    break-inside:auto!important;
  }
  #printSheet { zoom:1!important; }
  .paper-header { padding-bottom:12px; border-bottom:1.6px solid #006642; }
  .paper-brand { font-size:12pt; }
  .paper-eyebrow { font-size:7pt; margin-top:4px!important; }
  .paper-header h2 { font-size:15pt; margin:5px 0; }
  .paper-lead { font-size:8.5pt; }
  .paper-meta { grid-template-columns:repeat(2,minmax(0,1fr)); font-size:8pt; padding:10px 0; gap:7px 18px; }
  .paper-draft { margin-top:10px; padding:6px 9px; font-size:8pt; }
  .paper-section { padding-top:12px; }
  .paper-section > h3 { font-size:10pt; padding-bottom:7px; }
  .paper-section > h3 span { font-size:8pt; }
  .paper-field-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 15px; padding:9px 12px; }
  .paper-field dt { font-size:7pt; }
  .paper-field dd { font-size:8.5pt; margin-top:2px; }
  .paper-explainer { font-size:8pt; padding:7px 9px; margin-bottom:8px!important; }
  .paper-breakdown { min-width:0!important; width:100%; font-size:8pt; }
  .paper-breakdown th, .paper-breakdown td { padding:6px 8px; font-size:8pt; }
  .paper-breakdown th { font-size:7.5pt; }
  .paper-breakdown thead { display:table-header-group; }
  .paper-breakdown tr { break-inside:avoid; }
  .paper-money-row { padding:6px 0; min-height:0; }
  .paper-money-description { font-size:8.5pt; }
  .paper-money-description small { font-size:7.2pt; margin-top:1px; }
  .paper-money-amount { font-size:9pt; }
  .paper-grand { padding:9px 12px; margin-top:7px; font-size:10pt; }
  .paper-grand strong { font-size:12pt; }
  .paper-variance { margin-top:11px; padding-top:10px; }
  .paper-variance-state { padding:7px 10px; font-size:8pt; }
  .paper-signatures { grid-template-columns:repeat(3,minmax(0,1fr)); margin-top:25px; gap:17px; }
  .paper-signatures strong { font-size:8pt; }
  .paper-signatures span { font-size:7pt; margin-top:8px; }
  .paper-legal { margin-top:15px; padding-top:8px; font-size:7pt; }
  * { -webkit-print-color-adjust:exact; print-color-adjust:exact; }
}

/* Compact A4 footer spacing avoids an orphaned legal paragraph on page two. */
@page { size: A4 portrait; margin: 10mm 11mm; }
@media print {
  .paper-signatures { margin-top: 16px; gap: 13px; }
  .paper-signatures span { margin-top: 5px; }
  .paper-legal { margin-top: 8px; padding-top: 5px; line-height: 1.35; font-size: 6.8pt; break-inside: avoid; }
  .paper-section { padding-top: 10px; }
  .paper-field-grid { gap: 6px 12px; padding: 8px 11px; }
  .paper-money-row { padding: 5px 0; }
  .paper-variance-state { margin-top: 7px!important; }
}
