.expense-application-mask {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(15, 23, 42, 0.26);
  backdrop-filter: blur(10px);
}

.expense-application-dialog {
  width: min(1040px, calc(100vw - 56px));
  max-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #dbe5ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

.application-dialog-header,
.application-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid #e8eef4;
}

.application-dialog-footer {
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid #e8eef4;
  border-bottom: 0;
}

.application-dialog-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--theme-primary-active);
  font-size: 12px;
  font-weight: 800;
}

.application-dialog-header h2 {
  margin: 0;
  color: #102033;
  font-size: 20px;
  font-weight: 850;
}

.dialog-icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dbe5ee;
  border-radius: 8px;
  background: #fff;
  color: #4b5f73;
  cursor: pointer;
}

.application-dialog-body {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(420px, 1.08fr);
  gap: 18px;
  min-height: 0;
  padding: 20px 22px;
  overflow: auto;
  background: #f7fafc;
}

.application-input-panel,
.application-ontology-panel {
  border: 1px solid #e1e9f0;
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.application-field-label {
  display: block;
  margin-bottom: 10px;
  color: #425466;
  font-size: 13px;
  font-weight: 800;
}

.application-input-panel textarea {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  border: 1px solid #cfd9e3;
  border-radius: 8px;
  padding: 12px;
  color: #182536;
  font: inherit;
  line-height: 1.55;
  outline: none;
}

.application-input-panel textarea:focus {
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 3px var(--theme-focus-ring);
}

.application-example-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.application-example-chip {
  border: 1px solid #dbe5ee;
  border-radius: 8px;
  background: #f8fbfd;
  color: #395066;
  padding: 7px 10px;
  font-size: 12px;
  cursor: pointer;
}

.primary-parse-btn,
.confirm-btn,
.secondary-btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 850;
  cursor: pointer;
}

.primary-parse-btn,
.confirm-btn {
  border: 0;
  background: var(--theme-gradient-primary);
  color: #fff;
}

.primary-parse-btn {
  width: 100%;
}

.secondary-btn {
  border: 1px solid #dbe5ee;
  background: #fff;
  color: #395066;
}

.primary-parse-btn:disabled,
.confirm-btn:disabled {
  background: #b7c5d1;
  cursor: not-allowed;
}

.application-error {
  margin: 12px 0 0;
  color: #dc2626;
  font-size: 13px;
}

.ontology-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  color: #425466;
  font-size: 13px;
  font-weight: 850;
}

.ontology-panel-head strong {
  color: var(--theme-primary-active);
}

.ontology-empty-state {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #6b7c8f;
  text-align: center;
}

.ontology-empty-state i {
  color: #94a3b8;
  font-size: 34px;
}

.ontology-empty-state p {
  max-width: 360px;
  margin: 0;
  line-height: 1.6;
}

.ontology-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.ontology-chip {
  border-radius: 8px;
  background: var(--theme-primary-soft);
  color: var(--theme-primary-active);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

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

.application-field-card {
  min-height: 76px;
  border: 1px solid #e4ebf2;
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
}

.application-field-card span,
.application-reason-block span,
.application-missing-block span {
  display: block;
  margin-bottom: 7px;
  color: #6b7c8f;
  font-size: 12px;
  font-weight: 800;
}

.application-field-card strong {
  color: #182536;
  font-size: 15px;
}

.application-policy-strip,
.application-reason-block,
.application-missing-block {
  margin-top: 12px;
  border: 1px solid #dbe5ee;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.application-policy-strip {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.application-policy-strip i {
  margin-top: 2px;
  color: var(--theme-primary);
  font-size: 20px;
}

.application-policy-strip.required {
  border-color: #fed7aa;
  background: #fff7ed;
}

.application-policy-strip.required i {
  color: #ea580c;
}

.application-policy-strip strong {
  color: #182536;
}

.application-policy-strip p,
.application-reason-block p {
  margin: 5px 0 0;
  color: #4b5f73;
  line-height: 1.55;
}

.application-missing-block div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.application-missing-block em {
  border-radius: 8px;
  background: #fff7ed;
  color: #c2410c;
  padding: 5px 8px;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 860px) {
  .expense-application-mask {
    align-items: stretch;
    padding: 14px;
  }

  .expense-application-dialog {
    width: 100%;
    max-height: calc(100vh - 28px);
  }

  .application-dialog-body {
    grid-template-columns: 1fr;
  }

  .application-field-grid {
    grid-template-columns: 1fr;
  }
}
