:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1f2933;
  background: #f5f7fa;
}

body {
  margin: 0;
}

.site-header {
  background: #ffffff;
  border-bottom: 1px solid #d9e2ec;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 24px;
}

.site-header__brand {
  color: #102a43;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}

.site-header__nav {
  display: flex;
  gap: 16px;
}

.site-header__nav a {
  color: #334e68;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.site-header__user {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 10px;
  color: #334e68;
  font-size: 13px;
  font-weight: 600;
}

.site-header__user form {
  margin: 0;
}

.site-header__user button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #0f609b;
  border-radius: 6px;
  background: #ffffff;
  color: #0f609b;
  font: inherit;
  cursor: pointer;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 24px;
}

.auth-panel {
  display: grid;
  min-height: calc(100vh - 180px);
  place-items: center;
}

.auth-card {
  width: min(100%, 420px);
  padding: 28px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(16, 42, 67, 0.08);
}

.auth-card--wide {
  width: min(100%, 620px);
}

.auth-card h1 {
  margin: 0 0 8px;
  color: #102a43;
  font-size: 26px;
}

.auth-card__lead {
  margin: 0 0 22px;
  color: #52606d;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: #334e68;
  font-weight: 700;
}

.auth-form input,
.totp-setup textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid #bcccdc;
  border-radius: 6px;
  background: #ffffff;
  color: #102a43;
  font: inherit;
}

.auth-form__submit {
  margin-top: 4px;
}

.totp-setup {
  display: grid;
  gap: 10px;
  margin: 0 0 20px;
  padding: 16px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #f8fafc;
}

.totp-setup p {
  margin: 0;
  color: #334e68;
}

.totp-secret {
  padding: 12px;
  border-radius: 6px;
  background: #e0f2fe;
  color: #102a43;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  overflow-wrap: anywhere;
}

.totp-qr {
  width: 180px;
  height: 180px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #ffffff;
  justify-self: center;
}

.totp-setup__hint {
  font-size: 13px;
}

.totp-setup__warning {
  padding: 10px 12px;
  border: 1px solid #f7c948;
  border-radius: 6px;
  background: #fffbea;
  color: #8d2b0b;
  font-weight: 700;
}

.status-panel {
  background: #ffffff;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  padding: 24px;
}

.status-panel h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.status-panel p {
  margin: 0;
  color: #52606d;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.page-heading h1 {
  margin: 0 0 6px;
  font-size: 28px;
}

.page-heading p {
  margin: 0;
  color: #52606d;
}

.page-actions {
  display: flex;
  flex-shrink: 0;
  flex-wrap: nowrap;
  gap: 12px;
}

.page-actions .button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid #0f609b;
  border-radius: 6px;
  background: #0f609b;
  color: #ffffff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button:disabled {
  border-color: #bcccdc;
  background: #d9e2ec;
  color: #627d98;
  cursor: not-allowed;
}

.button--secondary {
  background: #ffffff;
  color: #0f609b;
}

.button--danger {
  border-color: #ba2525;
  background: #ba2525;
  color: #ffffff;
}

.button--small {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.link-button {
  border: 0;
  background: transparent;
  color: #0f609b;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0;
}

.link-button--danger {
  color: #ba2525;
}

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

.table-actions form {
  margin: 0;
}

.flash-list {
  margin: 0 0 20px;
}

.flash-list p {
  margin: 0 0 8px;
  border: 1px solid #f0b429;
  border-radius: 6px;
  background: #fffbea;
  padding: 12px 14px;
  color: #513c06;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #ffffff;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid #d9e2ec;
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: #f0f4f8;
  color: #334e68;
  font-size: 13px;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table a {
  color: #0f609b;
  font-weight: 700;
  text-decoration: none;
}

.status {
  display: inline-flex;
  border-radius: 999px;
  background: #e6f6ff;
  padding: 4px 10px;
  color: #0b69a3;
  font-size: 13px;
  font-weight: 700;
}

.status--muted {
  background: #f0f4f8;
  color: #627d98;
}

.property-list-table {
  min-width: 980px;
  table-layout: fixed;
}

.property-list-table th:nth-child(1),
.property-list-table td:nth-child(1) {
  width: 25%;
}

.property-list-table th:nth-child(2),
.property-list-table td:nth-child(2) {
  width: 86px;
}

.property-list-table th:nth-child(3),
.property-list-table td:nth-child(3) {
  width: 102px;
}

.property-list-table th:nth-child(4),
.property-list-table td:nth-child(4) {
  width: 23%;
}

.property-list-table th:nth-child(5),
.property-list-table td:nth-child(5) {
  width: 92px;
}

.property-list-table th:nth-child(6),
.property-list-table td:nth-child(6) {
  width: 88px;
}

.property-list-table th:nth-child(7),
.property-list-table td:nth-child(7) {
  width: 126px;
}

.property-list-table th:nth-child(8),
.property-list-table td:nth-child(8) {
  width: 108px;
}

.property-list-badge {
  white-space: nowrap;
}

.property-list-action {
  min-width: 76px;
  white-space: nowrap;
}

.empty-state,
.form-panel,
.memo-panel,
.notice-panel,
.danger-panel {
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #ffffff;
  padding: 24px;
}

.danger-panel {
  border-color: #f8b4b4;
  background: #fff5f5;
  margin-bottom: 16px;
}

.warning-panel {
  display: grid;
  gap: 12px;
  border: 1px solid #f0b429;
  border-radius: 8px;
  background: #fffbea;
  margin-bottom: 20px;
  padding: 18px;
}

.warning-panel h2 {
  margin: 0;
  color: #513c06;
  font-size: 18px;
}

.warning-panel p {
  margin: 0;
  color: #513c06;
}

.danger-panel h2 {
  margin: 0 0 8px;
  color: #8a1f1f;
}

.danger-panel p {
  margin: 0 0 8px;
  color: #5f2120;
}

.empty-state h1,
.empty-state h2,
.memo-panel h2 {
  margin: 0 0 8px;
}

.empty-state p,
.memo-panel p {
  margin: 0 0 16px;
  color: #52606d;
}

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

.form-grid--single {
  grid-template-columns: 1fr;
}

.form-section {
  border-bottom: 1px solid #d9e2ec;
  margin-bottom: 24px;
  padding-bottom: 24px;
}

.form-section h2 {
  margin: 0 0 16px;
  color: #102a43;
  font-size: 20px;
}

.form-grid__wide {
  grid-column: 1 / -1;
}

.form-grid label {
  display: grid;
  gap: 8px;
  color: #334e68;
  font-weight: 700;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #bcccdc;
  border-radius: 6px;
  padding: 10px 12px;
  color: #102a43;
  font: inherit;
}

.data-table input,
.data-table select,
.checklist-table input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #bcccdc;
  border-radius: 6px;
  padding: 8px 10px;
  color: #102a43;
  font: inherit;
}

.input--compact {
  max-width: 72px;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #334e68;
  font-weight: 700;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 16px;
}

.inline-form input {
  min-width: min(320px, 100%);
  box-sizing: border-box;
  border: 1px solid #bcccdc;
  border-radius: 6px;
  padding: 10px 12px;
  color: #102a43;
  font: inherit;
}

.settings-export-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 20px;
}

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

.settings-import-card {
  display: grid;
  gap: 12px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  padding: 16px;
}

.settings-import-card h3 {
  margin: 0;
  color: #102a43;
  font-size: 18px;
}

.settings-import-card label {
  display: grid;
  gap: 6px;
  color: #334e68;
  font-weight: 700;
}

.settings-import-card input,
.settings-import-card textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #bcccdc;
  border-radius: 6px;
  padding: 10px 12px;
  color: #102a43;
  font: inherit;
}

.usage-mark {
  font-size: 20px;
  text-align: center;
  white-space: nowrap;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}

.form-actions--start {
  justify-content: flex-start;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.detail-grid div {
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
}

.detail-grid span {
  display: block;
  margin-bottom: 8px;
  color: #627d98;
  font-size: 13px;
  font-weight: 700;
}

.detail-grid strong {
  color: #102a43;
  font-size: 18px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stats-grid div {
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
}

.stats-grid span {
  display: block;
  margin-bottom: 8px;
  color: #627d98;
  font-size: 13px;
  font-weight: 700;
}

.stats-grid strong {
  color: #102a43;
  font-size: 28px;
}

.checkbox-field {
  align-content: center;
  grid-template-columns: auto 1fr;
}

.checkbox-field input {
  width: auto;
}

.sys-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

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

.choice-button {
  display: grid;
  align-content: center;
  min-height: 160px;
  border: 1px solid #bcccdc;
  border-radius: 8px;
  background: #ffffff;
  padding: 24px;
  color: #102a43;
  text-decoration: none;
}

.choice-button strong {
  display: block;
  margin-bottom: 10px;
  font-size: 26px;
}

.choice-button span {
  color: #52606d;
  line-height: 1.6;
}

.choice-button:hover {
  border-color: #0f609b;
  box-shadow: 0 8px 20px rgba(15, 96, 155, 0.12);
}

.choice-button--disabled {
  background: #f0f4f8;
  color: #627d98;
  cursor: not-allowed;
}

.choice-button--disabled:hover {
  border-color: #bcccdc;
  box-shadow: none;
}

.notice-panel {
  margin-bottom: 16px;
  color: #52606d;
}

.pdf-import {
  display: grid;
  gap: 12px;
}

.pdf-import__title {
  color: #334e68;
  font-weight: 800;
}

.pdf-import__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.pdf-import__file {
  box-sizing: border-box;
  max-width: 100%;
  border: 1px solid #bcccdc;
  border-radius: 6px;
  background: #ffffff;
  padding: 9px 12px;
  color: #102a43;
  font: inherit;
}

.pdf-import__status {
  min-height: 20px;
  margin: 0;
  font-weight: 700;
}

.pdf-import__status.is-error {
  color: #ba2525;
}

.pdf-import__status.is-success {
  color: #147d64;
}

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

.key-value-list div {
  display: grid;
  gap: 4px;
  border-bottom: 1px solid #edf2f7;
  padding-bottom: 8px;
}

.key-value-list span {
  color: #627d98;
  font-size: 13px;
  font-weight: 700;
}

.key-value-list strong {
  color: #102a43;
}

.document-shell {
  display: grid;
  gap: 20px;
}

.document-phase-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 14px;
  max-width: min(980px, 100%);
  overflow-x: auto;
  padding-bottom: 2px;
}

.document-phase-nav__badge {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid #d9e2ec;
  border-radius: 999px;
  background: #f0f4f8;
  padding: 0 14px;
  color: #334e68;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.document-phase-nav__badge:hover {
  border-color: #9fb3c8;
  background: #e6f6ff;
  color: #0f609b;
}

.document-phase-nav__badge.is-active {
  border-color: #0f609b;
  background: #0f609b;
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(15, 96, 155, 0.18);
}

.document-property-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
}

.document-property-summary div {
  display: grid;
  gap: 6px;
}

.document-property-summary span {
  color: #627d98;
  font-size: 13px;
  font-weight: 700;
}

.document-property-summary strong {
  color: #102a43;
}

.document-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.document-menu__button {
  min-height: 44px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #ffffff;
  padding: 0 18px;
  color: #102a43;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.document-menu__button.is-active {
  border-color: #0b4f4a;
  background: #0b4f4a;
  color: #ffffff;
}

.document-panel {
  display: grid;
  gap: 16px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #ffffff;
  padding: 24px;
}

.document-panel[hidden] {
  display: none;
}

.document-panel h2 {
  margin: 0 0 8px;
  color: #102a43;
}

.document-panel p {
  margin: 0;
  color: #52606d;
}

.document-placeholder {
  border: 1px dashed #bcccdc;
  border-radius: 8px;
  background: #f8fafc;
  padding: 18px;
}

.document-placeholder span {
  display: block;
  margin-bottom: 8px;
  color: #334e68;
  font-weight: 800;
}

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 20px;
}

.settings-tabs__item {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid #d9e2ec;
  border-radius: 6px;
  background: #ffffff;
  padding: 0 14px;
  color: #334e68;
  font-weight: 800;
  text-decoration: none;
}

.settings-tabs__item.is-active {
  border-color: #0f609b;
  background: #0f609b;
  color: #ffffff;
}

.checklist-config-table {
  min-width: 920px;
}

.checklist-manager__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.checklist-status {
  min-height: 20px;
  color: #52606d;
  font-weight: 700;
}

.checklist-status.is-error {
  color: #ba2525;
}

.checklist-status.is-success {
  color: #147d64;
}

.checklist-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
}

.checklist-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  background: #ffffff;
}

.checklist-table th,
.checklist-table td {
  border-bottom: 1px solid #d9e2ec;
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
}

.checklist-table th {
  background: #f0f4f8;
  color: #334e68;
  font-size: 13px;
}

.checklist-table tr:last-child td {
  border-bottom: 0;
}

.checklist-table th:first-child,
.checklist-table td:first-child {
  width: 54px;
}

.checklist-table th:nth-child(3),
.checklist-table td:nth-child(3) {
  width: 180px;
}

.checklist-choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.checklist-choice {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #102a43;
  font-weight: 800;
}

.income-config-table {
  min-width: 1120px;
}

.construction-budget-config-table {
  min-width: 1480px;
}

.assessment-export-table {
  min-width: 980px;
}

.income-phase-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.income-phase-tabs__button {
  min-height: 36px;
  border: 1px solid #d9e2ec;
  border-radius: 6px;
  background: #ffffff;
  padding: 0 14px;
  color: #334e68;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.income-phase-tabs__button.is-active {
  border-color: #0f609b;
  background: #0f609b;
  color: #ffffff;
}

.income-phase-panel[hidden] {
  display: none;
}

.income-phase-panel.is-readonly {
  color: #52606d;
}

.income-phase-panel.is-readonly input[readonly] {
  background: #f0f4f8;
  color: #52606d;
}

.income-readonly-note {
  margin: 0;
  border: 1px solid #d9e2ec;
  border-radius: 6px;
  background: #f8fafc;
  padding: 10px 12px;
  color: #52606d;
  font-size: 14px;
  font-weight: 700;
}

.income-expense-table th:nth-child(3),
.income-expense-table td:nth-child(3) {
  width: 260px;
}

.income-expense-table th:nth-child(4),
.income-expense-table td:nth-child(4) {
  width: 96px;
  text-align: right;
}

.income-ratio-cell {
  color: #334e68;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.income-amount-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.income-amount-cell .status {
  flex: 0 0 auto;
  white-space: nowrap;
}

.income-amount-input {
  max-width: 180px;
  text-align: right;
}

.income-amount-input[readonly] {
  background: #f0f4f8;
  color: #334e68;
  font-weight: 800;
}

.construction-budget-summary {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  border: 1px solid #bcccdc;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 14px;
  color: #102a43;
}

.construction-budget-patterns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
}

.construction-budget-patterns__option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid #bcccdc;
  border-radius: 8px;
  background: #ffffff;
  padding: 7px 12px;
  color: #102a43;
  font-weight: 800;
}

.construction-budget-patterns__output {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid #9fb3c8;
  border-radius: 8px;
  background: #ffffff;
  padding: 6px 10px;
  color: #102a43;
  font-weight: 800;
}

.construction-budget-patterns__output select {
  min-width: 96px;
  border: 1px solid #bcccdc;
  border-radius: 6px;
  background: #ffffff;
  padding: 5px 8px;
  color: #102a43;
  font: inherit;
}

.construction-budget-summary span {
  font-size: 20px;
  font-weight: 900;
}

.construction-budget-category-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 16px;
}

.construction-budget-category-summary__item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #ffffff;
  padding: 6px 12px;
  color: #102a43;
}

.construction-budget-category-summary__item--derived {
  border-color: #b3d4fc;
  background: #f5fbff;
}

.construction-budget-category-summary__item strong {
  font-size: 13px;
}

.construction-budget-category-summary__item span {
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.construction-budget-rounding {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  color: #102a43;
  font-size: 13px;
  font-weight: 800;
}

.construction-budget-rounding input {
  width: 140px;
}

.construction-budget-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 0 10px;
}

.construction-budget-panel__header h3 {
  margin: 0;
}

.construction-budget-panel__header strong {
  color: #102a43;
  font-size: 16px;
}

.construction-budget-table {
  min-width: 100%;
  max-width: 100%;
  table-layout: fixed;
  font-size: 14px;
}

.construction-budget-table th:nth-child(1),
.construction-budget-table td:nth-child(1) {
  width: 92px;
}

.construction-budget-table th:nth-child(2),
.construction-budget-table td:nth-child(2) {
  width: 240px;
}

.construction-budget-table th:nth-child(3),
.construction-budget-table td:nth-child(3) {
  width: 76px;
}

.construction-budget-table th:nth-child(4),
.construction-budget-table td:nth-child(4) {
  width: 54px;
  text-align: center;
}

.construction-budget-table th:nth-child(5),
.construction-budget-table td:nth-child(5) {
  width: 84px;
  text-align: right;
}

.construction-budget-table th:nth-child(6),
.construction-budget-table td:nth-child(6) {
  width: 96px;
  text-align: right;
}

.construction-budget-table th:nth-child(7),
.construction-budget-table td:nth-child(7) {
  width: auto;
}

.construction-number-input,
.construction-budget-table__amount,
.construction-budget-table__price,
.construction-budget-table__subtotal td:nth-child(2) {
  text-align: right;
}

.construction-number-input {
  width: 64px;
  min-width: 0;
}

.construction-budget-table__amount {
  color: #102a43;
  font-weight: 900;
}

.construction-budget-table__text,
.construction-budget-table__price,
.construction-budget-table__memo {
  display: block;
  color: #102a43;
  line-height: 1.5;
}

.construction-budget-table__price {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.construction-budget-table__memo {
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.45;
}

.construction-budget-table__subtotal td {
  background: #f8fafc;
  color: #102a43;
  font-weight: 900;
}

.contract-case-dropzone {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  width: fit-content;
  max-width: 100%;
  border: 1px dashed #9fb3c8;
  border-radius: 8px;
  background: #f8fafc;
  padding: 0 16px;
  color: #102a43;
  cursor: pointer;
}

.contract-case-dropzone strong {
  font-weight: 900;
}

.contract-case-dropzone span {
  color: #627d98;
  font-size: 13px;
  font-weight: 700;
}

.contract-case-dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.contract-case-dropzone.is-dragover,
.contract-case-dropzone.is-uploading {
  border-color: #0f609b;
  background: #eef8ff;
}

.contract-case-list {
  display: grid;
  gap: 12px;
}

.contract-case-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 168px;
  gap: 16px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #ffffff;
  padding: 14px 70px 14px 14px;
}

.contract-case-card__content {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.contract-case-card__main {
  display: grid;
  gap: 4px;
}

.contract-case-card__main strong {
  color: #102a43;
  font-size: 16px;
}

.contract-case-card__main span {
  color: #52606d;
  font-size: 13px;
  font-weight: 700;
}

.contract-case-card__details,
.contract-case-card__raw dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 14px;
  margin: 0;
}

.contract-case-card__details div,
.contract-case-card__raw div {
  min-width: 0;
}

.contract-case-card dt {
  color: #627d98;
  font-size: 12px;
  font-weight: 800;
}

.contract-case-card dd {
  margin: 2px 0 0;
  color: #102a43;
  overflow-wrap: anywhere;
}

.contract-case-card__raw summary {
  color: #0f609b;
  cursor: pointer;
  font-weight: 800;
}

.contract-case-card > [data-contract-action="delete"] {
  position: absolute;
  top: 14px;
  right: 14px;
}

.contract-case-sales-sheet {
  position: relative;
  align-self: stretch;
  min-height: 154px;
}

.contract-case-sales-sheet input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.contract-case-sales-sheet__drop,
.contract-case-sales-sheet__thumb {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 154px;
  border: 1px dashed #9fb3c8;
  border-radius: 8px;
  background: #f8fafc;
  color: #102a43;
  cursor: pointer;
}

.contract-case-sales-sheet__drop {
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 12px;
}

.contract-case-sales-sheet__drop strong {
  font-weight: 900;
}

.contract-case-sales-sheet__drop span {
  color: #627d98;
  font-size: 12px;
  font-weight: 800;
}

.contract-case-sales-sheet__thumb {
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  padding: 0;
  border-style: solid;
}

.contract-case-sales-sheet__thumb img {
  display: block;
  width: 100%;
  height: 124px;
  object-fit: cover;
  background: #ffffff;
}

.contract-case-sales-sheet__thumb span {
  overflow: hidden;
  padding: 7px 8px;
  color: #102a43;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contract-case-sales-sheet.is-dragover .contract-case-sales-sheet__drop,
.contract-case-sales-sheet.is-uploading .contract-case-sales-sheet__drop,
.contract-case-sales-sheet.is-dragover .contract-case-sales-sheet__thumb,
.contract-case-sales-sheet.is-uploading .contract-case-sales-sheet__thumb {
  border-color: #0f609b;
  background: #eef8ff;
  box-shadow: inset 0 0 0 2px rgba(15, 96, 155, 0.16);
}

.contract-sheet-modal[hidden] {
  display: none;
}

.contract-sheet-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
}

.contract-sheet-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 42, 67, 0.56);
}

.contract-sheet-modal__dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1520px, calc(100vw - 24px));
  height: min(960px, calc(100vh - 24px));
  overflow: hidden;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(16, 42, 67, 0.3);
}

.contract-sheet-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #d9e2ec;
  padding: 12px 14px;
}

.contract-sheet-modal__header strong {
  overflow: hidden;
  color: #102a43;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contract-sheet-modal__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.contract-sheet-modal__actions .button {
  min-height: 36px;
  padding: 0 12px;
}

.contract-sheet-modal__zoom {
  min-width: 52px;
  color: #334e68;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.contract-sheet-modal__body {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  min-height: 0;
}

.contract-sheet-modal__list {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  border-right: 1px solid #d9e2ec;
  background: #f8fafc;
  padding: 12px;
}

.contract-sheet-modal__item {
  display: grid;
  gap: 6px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #ffffff;
  padding: 6px;
  color: #102a43;
  cursor: pointer;
  text-align: left;
}

.contract-sheet-modal__item.is-active {
  border-color: #0f609b;
  box-shadow: 0 0 0 2px rgba(15, 96, 155, 0.16);
}

.contract-sheet-modal__item img {
  width: 100%;
  height: 96px;
  object-fit: contain;
  background: #ffffff;
}

.contract-sheet-modal__item span {
  overflow: hidden;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contract-sheet-modal__viewer {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: #242628;
}

.contract-sheet-modal__frame {
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  border: 0;
  background: #242628;
}

.contract-sheet-modal__unit-price {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 2;
  max-width: min(620px, calc(100% - 36px));
  border: 1px solid rgba(15, 96, 155, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 24px rgba(16, 42, 67, 0.2);
  color: #102a43;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.35;
  padding: 10px 14px;
  pointer-events: none;
  white-space: normal;
}

@media (max-width: 900px) {
  .contract-case-card {
    grid-template-columns: 1fr;
    padding-right: 14px;
  }

  .contract-case-card > [data-contract-action="delete"] {
    position: static;
    justify-self: start;
  }

  .contract-sheet-modal__body {
    grid-template-columns: 1fr;
    grid-template-rows: 132px minmax(0, 1fr);
  }

  .contract-sheet-modal__list {
    grid-auto-flow: column;
    grid-auto-columns: 140px;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 1px solid #d9e2ec;
  }
}

.property-map-frame {
  overflow: hidden;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #f8fafc;
  aspect-ratio: 16 / 9;
  min-height: 420px;
}

.property-map-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.property-map-section-title h3 {
  margin: 4px 0 -4px;
  color: #102a43;
  font-size: 18px;
}

.photo-manager__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.photo-manager__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.photo-category-grid {
  display: grid;
  gap: 18px;
}

.photo-category {
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #f8fafc;
  padding: 16px;
}

.photo-category.is-file-dragover {
  border-color: #0f609b;
  background: #eef8ff;
  box-shadow: inset 0 0 0 2px rgba(15, 96, 155, 0.16);
}

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

.photo-category__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.photo-category__header h3 {
  margin: 0;
  color: #102a43;
  font-size: 18px;
}

.photo-category__status {
  min-height: 20px;
  margin: 0 0 12px;
  color: #52606d;
  font-weight: 700;
}

.photo-category__status.is-error {
  color: #ba2525;
}

.photo-category__status.is-success {
  color: #147d64;
}

.registry-manager__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.registry-category-grid {
  display: grid;
  gap: 18px;
}

.registry-category {
  display: grid;
  gap: 12px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #f8fafc;
  padding: 16px;
}

.registry-category.is-file-dragover {
  border-color: #0f609b;
  background: #eef8ff;
  box-shadow: inset 0 0 0 2px rgba(15, 96, 155, 0.16);
}

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

.registry-category__header h3 {
  margin: 0;
  color: #102a43;
  font-size: 18px;
}

.registry-category__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.registry-category__status {
  min-height: 20px;
  color: #52606d;
  font-weight: 700;
}

.registry-category__status.is-error {
  color: #ba2525;
}

.registry-category__status.is-success {
  color: #147d64;
}

.registry-dropzone {
  display: grid;
  gap: 4px;
  justify-items: start;
  min-height: 0;
  border: 0;
  background: transparent;
  color: #334e68;
  text-align: left;
}

.registry-dropzone span {
  color: #627d98;
  font-size: 13px;
}

.registry-file-list {
  display: grid;
  gap: 8px;
}

.registry-empty {
  color: #627d98;
}

.registry-file {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 12px;
  color: #102a43;
  cursor: pointer;
  text-align: left;
}

.registry-file:hover {
  border-color: #0f609b;
}

.registry-file__icon {
  display: inline-grid;
  place-items: center;
  min-height: 34px;
  border-radius: 999px;
  background: #e6f6ff;
  color: #0f609b;
  font-size: 12px;
  font-weight: 800;
}

.registry-file__name {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.registry-file__meta {
  color: #627d98;
  font-size: 13px;
}

.hearing-manager {
  --hearing-border: #d9e2ec;
  --hearing-soft: #f8fafc;
  --hearing-muted: #627d98;
  min-width: 0;
}

.hearing-section-heading span,
.hearing-add-form label span,
.hearing-person-fields label span,
.hearing-date-fields label span {
  color: #486581;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.hearing-entry-panel {
  margin-bottom: 24px;
  border: 1px solid var(--hearing-border);
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
}

.hearing-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.hearing-section-heading--list {
  margin-top: 8px;
}

.hearing-section-heading h3 {
  margin: 0;
  color: #102a43;
  font-size: 18px;
}

.hearing-add-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.hearing-add-form label,
.hearing-person-fields label,
.hearing-date-fields label {
  display: grid;
  gap: 5px;
}

.hearing-add-form input,
.hearing-add-form textarea,
.hearing-table input,
.hearing-table textarea {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #bcccdc;
  border-radius: 7px;
  background: #ffffff;
  padding: 9px 10px;
  color: #102a43;
  font: inherit;
}

.hearing-add-form input:focus,
.hearing-add-form textarea:focus,
.hearing-table input:focus,
.hearing-table textarea:focus {
  border-color: #0f609b;
  box-shadow: 0 0 0 3px rgba(15, 96, 155, 0.1);
  outline: none;
}

.hearing-add-form__comment {
  grid-column: 1 / -1;
}

.hearing-field--company,
.hearing-field--branch,
.hearing-field--staff {
  grid-column: span 2;
}

.hearing-field--date,
.hearing-field--method {
  grid-column: span 3;
}

.hearing-field--date input[type="date"],
.hearing-date-fields input[type="date"] {
  width: 95%;
}

.hearing-add-form textarea {
  min-height: 92px;
  resize: vertical;
}

.hearing-add-form .button {
  justify-self: end;
  min-width: 96px;
}

.hearing-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--hearing-border);
  border-radius: 8px;
  background: #ffffff;
}

.hearing-table {
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
  background: #ffffff;
  table-layout: fixed;
}

.hearing-table th,
.hearing-table td {
  border-bottom: 1px solid #e6edf3;
  padding: 14px;
  vertical-align: top;
}

.hearing-table tbody tr:last-child td {
  border-bottom: 0;
}

.hearing-table th {
  background: #f0f4f8;
  color: #243b53;
  font-size: 13px;
  font-weight: 900;
  text-align: left;
}

.hearing-table th:first-child,
.hearing-table td:first-child {
  width: 78px;
}

.hearing-table th:nth-child(2),
.hearing-table td:nth-child(2) {
  width: 30%;
}

.hearing-table th:nth-child(3),
.hearing-table td:nth-child(3) {
  width: 22%;
}

.hearing-table th:last-child,
.hearing-table td:last-child {
  width: 88px;
  text-align: center;
  vertical-align: middle;
}

.hearing-person-fields,
.hearing-date-fields {
  display: grid;
  gap: 10px;
}

.hearing-table textarea {
  min-height: 150px;
  resize: vertical;
}

.hearing-table .input--compact {
  max-width: 68px;
  text-align: center;
}

@media (max-width: 1200px) {
  .hearing-add-form {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .hearing-field--company,
  .hearing-field--branch,
  .hearing-field--staff,
  .hearing-field--date,
  .hearing-field--method {
    grid-column: span 1;
  }

  .hearing-add-form__comment {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .hearing-table {
    min-width: 900px;
  }
}

@media (max-width: 720px) {
  .hearing-add-form {
    grid-template-columns: 1fr;
  }

  .hearing-section-heading {
    display: grid;
  }
}

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

.photo-empty {
  margin: 0;
  color: #627d98;
}

.photo-thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #ffffff;
  padding: 0;
  cursor: pointer;
}

.photo-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
  opacity: 1;
  transition: opacity 0.18s ease;
}

.photo-thumb.is-loading,
.photo-thumb.is-error {
  background:
    linear-gradient(135deg, #17212b 0%, #26384a 46%, #17212b 100%);
}

.photo-thumb.is-loading img,
.photo-thumb.is-error img {
  opacity: 0;
}

.photo-thumb.is-loading::before {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    linear-gradient(
      115deg,
      transparent 30%,
      rgba(255, 255, 255, 0.18) 45%,
      rgba(255, 255, 255, 0.32) 50%,
      rgba(255, 255, 255, 0.18) 55%,
      transparent 70%
    );
  animation: photo-thumb-shimmer 1.35s ease-in-out infinite;
}

.photo-thumb.is-loading::after,
.photo-thumb.is-error::after {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
}

.photo-thumb.is-loading::after {
  content: "NOW LOADING";
}

.photo-thumb.is-uploading::after {
  content: "UPLOADING";
  position: absolute;
  left: 50%;
  bottom: 8px;
  z-index: 2;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(16, 42, 67, 0.76);
  padding: 4px 8px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.photo-thumb.is-error::after {
  content: "LOAD FAILED";
  color: #ffd9d9;
}

@keyframes photo-thumb-shimmer {
  0% {
    transform: translateX(-35%) rotate(0.001deg);
  }

  100% {
    transform: translateX(35%) rotate(0.001deg);
  }
}

.photo-thumb.is-selected {
  border-color: #0f609b;
}

.photo-thumb.is-dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.photo-thumb__check {
  display: none;
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: rgba(16, 42, 67, 0.55);
  z-index: 3;
}

.photo-manager.is-delete-mode .photo-thumb__check {
  display: block;
}

.photo-thumb.is-selected .photo-thumb__check {
  background: #0f609b;
}

.photo-thumb.is-selected .photo-thumb__check::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 3px;
  width: 6px;
  height: 11px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.photo-modal[hidden] {
  display: none;
}

.photo-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.photo-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 42, 67, 0.72);
}

.photo-modal__dialog {
  position: relative;
  display: grid;
  gap: 12px;
  max-width: min(960px, 96vw);
  max-height: 92vh;
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.photo-modal__dialog img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
}

.photo-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.photo-confirm-modal[hidden] {
  display: none;
}

.photo-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 1010;
  display: grid;
  place-items: center;
  padding: 24px;
}

.photo-confirm-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 42, 67, 0.62);
}

.photo-confirm-modal__dialog {
  position: relative;
  width: min(420px, 92vw);
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(16, 42, 67, 0.28);
  padding: 22px;
}

.photo-confirm-modal__dialog h2 {
  margin: 0 0 10px;
  color: #102a43;
  font-size: 20px;
}

.photo-confirm-modal__dialog p {
  margin: 0;
  color: #52606d;
  line-height: 1.7;
}

.photo-confirm-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.registry-modal[hidden] {
  display: none;
}

.registry-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.registry-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 42, 67, 0.72);
}

.registry-modal__dialog {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  width: min(1080px, 96vw);
  height: min(820px, 92vh);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

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

.registry-modal__header strong {
  overflow: hidden;
  color: #102a43;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.registry-modal__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.registry-modal__frame,
.registry-modal__image {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 1px solid #d9e2ec;
  border-radius: 6px;
  background: #f8fafc;
}

.registry-modal__image {
  object-fit: contain;
}

.pdf-modal[hidden] {
  display: none;
}

.pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.pdf-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 42, 67, 0.72);
}

.pdf-modal__dialog {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  width: min(1120px, 96vw);
  height: min(820px, 92vh);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.pdf-modal__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.pdf-modal__progress[hidden] {
  display: none;
}

.pdf-modal__progress {
  display: grid;
  gap: 8px;
}

.pdf-modal__progress-label {
  color: #334e68;
  font-size: 14px;
  font-weight: 700;
}

.pdf-modal__progress-track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #d9e2ec;
}

.pdf-modal__progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: #0f609b;
  transition: width 0.18s ease;
}

.pdf-modal__frame {
  width: 100%;
  height: 100%;
  border: 1px solid #d9e2ec;
  border-radius: 6px;
  background: #f8fafc;
}

.pdf-modal__preview {
  overflow: auto;
  display: grid;
  justify-items: center;
  gap: 18px;
  min-height: 0;
  border: 1px solid #d9e2ec;
  border-radius: 6px;
  background: #eef2f7;
  padding: 18px;
}

.pdf-preview-page {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
  width: min(90%, 920px);
  aspect-ratio: 297 / 210;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(16, 42, 67, 0.16);
  padding: 22px;
}

.pdf-preview-page__title {
  color: #102a43;
  font-size: 14px;
  font-weight: 800;
}

.pdf-preview-page__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 14px;
  min-height: 0;
}

.pdf-preview-page__cell {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  border: 1px solid #e6edf5;
  background: #ffffff;
  padding: 5px;
}

.pdf-preview-page__cell img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.income-export-rule-form,
.income-export-rule-list {
  display: grid;
  gap: 18px;
}

.income-export-rule-card {
  display: grid;
  gap: 16px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
}

.income-export-rule-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.income-export-rule-card__header h3 {
  margin: 0 0 4px;
  color: #102a43;
  font-size: 18px;
}

.income-export-rule-card__header p {
  margin: 0;
  color: #486581;
  font-size: 14px;
}

.income-export-item-picker {
  display: grid;
  gap: 10px;
}

.income-export-item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 14px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.income-export-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  align-items: end;
  gap: 8px;
  min-width: 0;
}

.income-export-item-row label:last-child {
  display: grid;
  gap: 3px;
}

.income-export-item-row label:last-child span {
  color: #627d98;
  font-size: 12px;
  font-weight: 700;
}

.income-export-item-row input[type="text"] {
  min-width: 0;
  padding: 8px 10px;
}

.income-export-modal[hidden] {
  display: none;
}

.income-export-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
}

.income-export-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 42, 67, 0.42);
}

.income-export-modal__dialog {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
  width: min(820px, 96vw);
  max-height: 88vh;
  overflow: auto;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #ffffff;
  padding: 22px;
  box-shadow: 0 18px 48px rgba(16, 42, 67, 0.22);
}

.income-export-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.income-export-modal__header h2 {
  margin: 0 0 6px;
}

.income-export-modal__header p {
  margin: 0;
  color: #486581;
}

.income-export-modal__base {
  display: grid;
  gap: 6px;
}

.income-export-modal__rules {
  display: grid;
  gap: 10px;
}

.income-export-modal__group {
  display: grid;
  gap: 10px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.income-export-modal__group-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.income-export-modal__group-header h3,
.income-export-modal__group-header p {
  margin: 0;
}

.income-export-modal__group-header h3 {
  color: #102a43;
  font-size: 18px;
}

.income-export-modal__group-header p {
  color: #627d98;
  font-size: 13px;
  font-weight: 700;
}

.income-export-modal__group-options {
  display: grid;
  gap: 8px;
}

.income-export-modal__rule {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.income-export-modal__rule--compact {
  background: #ffffff;
}

.income-export-modal__rule strong,
.income-export-modal__rule small {
  display: block;
}

.income-export-modal__rule small {
  margin-top: 3px;
  color: #486581;
}

@media (max-width: 720px) {
  .site-header__inner,
  .page-heading {
    display: grid;
  }

  .form-grid,
  .detail-grid,
  .stats-grid,
  .choice-grid,
  .key-value-list,
  .settings-import-grid,
  .document-property-summary {
    grid-template-columns: 1fr;
  }

  .form-actions {
    justify-content: stretch;
  }

  .photo-manager__header,
  .photo-category__header,
  .checklist-manager__header,
  .registry-manager__header,
  .registry-category__header,
  .registry-modal__header,
  .pdf-modal__actions {
    display: grid;
  }

  .photo-category__actions,
  .registry-category__actions {
    justify-content: stretch;
  }

  .registry-file {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .registry-file__meta {
    grid-column: 2;
  }

  .registry-modal {
    padding: 10px;
  }

  .registry-modal__dialog {
    width: 98vw;
    height: 94vh;
    padding: 10px;
  }

  .button {
    width: 100%;
  }

  .pdf-modal {
    padding: 10px;
  }

  .pdf-modal__dialog {
    width: 98vw;
    height: 94vh;
    padding: 10px;
  }

  .pdf-modal__preview {
    padding: 10px;
  }

  .pdf-preview-page {
    width: 860px;
    max-width: none;
  }
}
