.accounting-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.accounting-hero,
.accounting-tool-header,
.accounting-calculator-panel,
.accounting-section {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.accounting-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 150px;
}

.accounting-hero h1,
.accounting-tool-header h1 {
  margin: 0;
  color: var(--text);
  font-size: 28px;
  line-height: 1.25;
}

.accounting-hero p,
.accounting-tool-header p {
  margin-top: 8px;
  max-width: 860px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.accounting-kicker {
  margin: 0 0 6px !important;
  color: var(--primary) !important;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.accounting-tool-header {
  display: flex;
  align-items: center;
  gap: 18px;
}

.accounting-tool-icon {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--primary-light);
  color: var(--primary);
  font-size: 24px;
}

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

.accounting-form-grid .tool-row {
  margin-bottom: 0;
}

.accounting-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.accounting-field-error {
  min-height: 18px;
  margin-top: 5px;
  color: #c0392b;
  font-size: 12px;
  line-height: 1.5;
}

.accounting-error {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid #f5b7b1;
  border-radius: var(--radius);
  background: #fff5f5;
  color: #922b21;
  line-height: 1.6;
}

.accounting-result-panel {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.accounting-result-empty {
  margin: 0;
  color: var(--text-muted);
}

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

.accounting-result-item {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-white);
}

.accounting-result-label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 13px;
}

.accounting-result-value {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
}

.accounting-result-note {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.accounting-process {
  margin-top: 16px;
  padding: 14px;
  border-left: 3px solid var(--primary);
  background: var(--bg-white);
  border-radius: var(--radius);
}

.accounting-process h3,
.accounting-table-wrap h3 {
  margin: 0 0 10px;
  font-size: 16px;
  color: var(--text);
}

.accounting-process ol,
.accounting-process ul {
  margin: 0;
  padding-left: 20px;
  color: var(--text-secondary);
  line-height: 1.8;
}

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

.accounting-info-block {
  min-width: 0;
}

.accounting-steps,
.accounting-formula-list {
  margin: 12px 0 0;
  padding-left: 22px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.accounting-disclaimer {
  background: #fffaf0;
  border-color: #f1d7a8;
}

.accounting-disclaimer p {
  margin: 10px 0 0;
  color: var(--text-secondary);
  line-height: 1.8;
}

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

.accounting-link-list a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
}

.accounting-link-list a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.accounting-link-list span {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.accounting-extra-links {
  margin-top: 16px;
}

.accounting-table-wrap {
  margin-top: 16px;
  overflow-x: auto;
}

.accounting-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.accounting-table th,
.accounting-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
}

.accounting-table th:first-child,
.accounting-table td:first-child {
  text-align: left;
}

.accounting-table th {
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.accounting-table td {
  color: var(--text-secondary);
  font-size: 13px;
}

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

.tool-input[aria-invalid="true"],
.tool-select[aria-invalid="true"] {
  border-color: #c0392b;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12);
}

@media (max-width: 900px) {
  .accounting-result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .accounting-hero,
  .accounting-tool-header,
  .accounting-calculator-panel,
  .accounting-section {
    padding: 18px;
  }

  .accounting-tool-header {
    align-items: flex-start;
  }

  .accounting-hero h1,
  .accounting-tool-header h1 {
    font-size: 22px;
  }

  .accounting-form-grid,
  .accounting-result-grid,
  .accounting-info-grid,
  .accounting-link-list {
    grid-template-columns: 1fr;
  }

  .accounting-actions .btn {
    flex: 1 1 140px;
    justify-content: center;
  }
}
