.dhf-app {
  --dhf-ink: #202833;
  --dhf-muted: #647184;
  --dhf-line: #d7dde6;
  --dhf-wash: #f5f7fa;
  --dhf-brand: #23664b;
  --dhf-danger: #a13a2b;
  color: var(--dhf-ink);
  font-family: inherit;
}

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

.dhf-head h2 {
  margin: 0 0 6px;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  letter-spacing: 0;
}

.dhf-head p,
.dhf-group-title span,
.dhf-slot small {
  color: var(--dhf-muted);
}

.dhf-actions,
.dhf-dialog-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dhf-button,
.dhf-tab,
.dhf-link {
  min-height: 38px;
  border: 1px solid var(--dhf-line);
  border-radius: 6px;
  background: #fff;
  color: var(--dhf-ink);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 8px 12px;
  text-decoration: none;
}

.dhf-button.primary,
.dhf-tab.is-active {
  background: var(--dhf-brand);
  border-color: var(--dhf-brand);
  color: #fff;
}

.dhf-link {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--dhf-brand);
}

.dhf-link.danger {
  color: var(--dhf-danger);
}

.dhf-notice {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid #e7cf84;
  background: #fff5d4;
  border-radius: 6px;
}

.dhf-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.dhf-panel {
  display: none;
}

.dhf-panel.is-active {
  display: block;
}

.dhf-panel h3 {
  margin: 0 0 14px;
}

.dhf-group {
  border: 1px solid var(--dhf-line);
  border-radius: 8px;
  background: #fff;
  margin: 0 0 16px;
  overflow: hidden;
}

.dhf-group-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--dhf-wash);
  border-bottom: 1px solid var(--dhf-line);
}

.dhf-group-title h4 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.dhf-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  padding: 12px;
}

.dhf-slot {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  min-height: 82px;
  padding: 11px;
  border: 1px solid var(--dhf-line);
  border-radius: 8px;
  background: #fbfcfd;
}

.dhf-slot.is-filled {
  background: #e8f4ee;
  border-color: #b7d9c7;
}

.dhf-slot strong,
.dhf-slot span,
.dhf-slot small,
.dhf-entry {
  display: block;
}

.dhf-entry {
  min-width: 120px;
  text-align: right;
}

.dhf-name {
  font-weight: 700;
}

.dhf-dialog {
  width: min(520px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 22px 60px rgba(25, 33, 43, .22);
}

.dhf-dialog::backdrop {
  background: rgba(25, 33, 43, .48);
}

.dhf-dialog form {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.dhf-dialog h3 {
  margin: 0;
}

.dhf-dialog p {
  margin: 0;
  color: var(--dhf-muted);
}

.dhf-dialog label {
  display: grid;
  gap: 5px;
  font-weight: 700;
}

.dhf-dialog input,
.dhf-dialog textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--dhf-line);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
}

@media (max-width: 720px) {
  .dhf-head,
  .dhf-group-title,
  .dhf-slot {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .dhf-entry {
    text-align: left;
  }
}

@media print {
  .dhf-tabs,
  .dhf-actions,
  .dhf-button,
  .dhf-link,
  .dhf-notice {
    display: none !important;
  }

  .dhf-panel {
    display: block !important;
    break-after: page;
  }

  .dhf-group,
  .dhf-slot {
    break-inside: avoid;
  }

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