.epd-dialog {
  box-sizing: border-box;
  width: min(640px, calc(100% - 32px));
  max-width: 640px;
  max-height: min(820px, calc(100dvh - 32px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #dce5e1;
  border-radius: 8px;
  background: #fff;
  color: #20342d;
  box-shadow: 0 24px 80px rgba(16, 42, 32, .22);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0;
}
.epd-dialog::backdrop { background: rgba(19, 35, 30, .48); }
.epd-shell { display: flex; flex-direction: column; max-height: min(820px, calc(100dvh - 32px)); }
.epd-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 16px; border-bottom: 1px solid #e7ece9; }
.epd-eyebrow { margin: 0 0 3px; color: #49745e; font-size: 12px; font-weight: 700; }
.epd-title { margin: 0; color: #18352a; font-size: 21px; font-weight: 700; line-height: 1.35; }
.epd-close { display: grid; place-items: center; flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #456258; font-size: 24px; line-height: 1; cursor: pointer; }
.epd-close:hover { background: #eef4f0; }
.epd-close svg { width: 20px; height: 20px; fill: currentColor; }
.epd-body { min-height: 0; overflow: auto; padding: 20px 24px 24px; }
.epd-section-title { margin: 0 0 12px; font-size: 15px; font-weight: 700; color: #223b31; }
.epd-list { display: grid; gap: 8px; }
.epd-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 62px; padding: 10px 14px; border: 1px solid #dce5e1; border-radius: 6px; background: #fff; color: inherit; text-align: left; cursor: pointer; transition: background-color .18s ease, border-color .18s ease; }
.epd-item:hover { border-color: #8eb39e; background: #f6faf7; }
.epd-item[aria-current="true"] { border-color: #458562; background: #eef7f1; }
.epd-item-main { display: grid; min-width: 0; gap: 2px; }
.epd-item-name { overflow-wrap: anywhere; font-size: 15px; font-weight: 700; }
.epd-item-detail { color: #50645b; font-size: 13px; }
.epd-current { flex: none; color: #246443; font-size: 12px; font-weight: 700; }
.epd-roster { margin-top: 12px; border-top: 1px solid #e7ece9; padding-top: 10px; }
.epd-roster summary { color: #285a40; font-weight: 600; cursor: pointer; }
.epd-roster-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 12px; margin: 10px 0 0; padding-left: 20px; color: #40594a; }
.epd-roster-list li { overflow-wrap: anywhere; }
.epd-empty { margin: 0; padding: 22px 14px; border: 1px dashed #cbd9d0; border-radius: 6px; color: #566b60; text-align: center; }
.epd-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.epd-button { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 14px; border: 1px solid #c3d4c9; border-radius: 6px; background: #fff; color: #205239; font: inherit; font-weight: 600; line-height: 1.3; cursor: pointer; transition: background-color .18s ease, border-color .18s ease; }
.epd-button:hover { border-color: #7ba98b; background: #f0f7f2; }
.epd-button:disabled { color: #8a9a90; background: #f5f7f5; cursor: not-allowed; }
.epd-button-primary { border-color: #206a47; background: #206a47; color: #fff; }
.epd-button-primary:hover { border-color: #175437; background: #175437; }
.epd-button svg { width: 16px; height: 16px; fill: currentColor; }
.epd-tools { margin-top: 22px; padding-top: 18px; border-top: 1px solid #e7ece9; }
.epd-tools-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.epd-tool-link, .epd-tool-current { display: block; min-height: 40px; box-sizing: border-box; padding: 9px 10px; border: 1px solid #e0e8e3; border-radius: 6px; color: #315e46; text-decoration: none; overflow-wrap: anywhere; }
.epd-tool-link:hover { border-color: #94b59f; background: #f3f8f4; text-decoration: none; }
.epd-tool-current { background: #f4f6f4; color: #65756b; }
.epd-tool-current small { color: #65756b; }
.epd-form { display: grid; gap: 16px; }
.epd-form-title { margin: 0; color: #243c30; font-size: 16px; }
.epd-field { display: grid; gap: 6px; min-width: 0; color: #294336; font-weight: 600; }
.epd-field input, .epd-field select, .epd-field textarea { box-sizing: border-box; width: 100%; min-height: 42px; padding: 9px 10px; border: 1px solid #bfcfc4; border-radius: 6px; background: #fff; color: #20342d; font: inherit; }
.epd-field textarea { min-height: 116px; resize: vertical; }
.epd-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.epd-field-hint { color: #5b6e61; font-size: 12px; font-weight: 400; }
.epd-status { margin: 12px 0 0; color: #255c3c; font-size: 13px; }
.epd-status[data-error="true"] { color: #a33636; }
.epd-dialog :is(button, input, select, textarea, a):focus-visible { outline: 3px solid #357956; outline-offset: 2px; }
.epd-dialog [hidden] { display: none !important; }
@media (max-width: 480px) {
  .epd-dialog, .epd-shell { max-height: calc(100dvh - 16px); }
  .epd-dialog { width: calc(100% - 16px); }
  .epd-head { padding: 18px 16px 14px; }
  .epd-body { padding: 16px; }
  .epd-roster-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .epd-form-row { grid-template-columns: 1fr; }
}
@media (max-width: 350px) { .epd-tools-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .epd-dialog *, .epd-dialog *::before, .epd-dialog *::after { transition: none !important; } }
@media print { .epd-dialog { display: none !important; } }
