.ed-dialog {
  --ed-ink: #194c40;
  --ed-paper: #fffdf7;
  --ed-line: #dcded2;
  --ed-rust: #a6482b;
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  width: min(450px, calc(100vw - 32px));
  max-width: none;
  max-height: min(94vh, 94dvh);
  margin: auto;
  border: 1px solid #d0d6c8;
  border-radius: 18px;
  padding: 0;
  background: var(--ed-paper);
  color: var(--ed-ink);
  box-shadow: 0 22px 82px #152e2740;
  font-family: inherit;
  overflow: auto;
  overscroll-behavior: contain;
  color-scheme: light;
}
.ed-dialog::backdrop { background: rgb(22 40 34 / 45%); }
.ed-dialog [hidden] { display: none !important; }
.ed-dialog *, .ed-dialog *::before, .ed-dialog *::after { box-sizing: border-box; }
.ed-dialog button, .ed-dialog select { font: inherit; }
.ed-dialog button { cursor: pointer; }
.ed-dialog [aria-busy="true"] { cursor: wait; }
body:has(.ed-dialog[open]) { overflow: hidden; }
.ed-sheet { padding: 27px; }
.ed-header { display: flex; align-items: center; gap: 13px; margin: 0 0 23px; border-bottom: 1px solid var(--ed-line); padding-bottom: 21px; }
.ed-flag {
  display: inline-flex; flex: 0 0 48px; width: 48px; aspect-ratio: 4/3;
  overflow: hidden; border-radius: 4px; box-shadow: 0 0 0 1px #273f3425; background: #eee;
}
.ed-flag img { width: 100%; height: 100%; object-fit: cover; }
.ed-identity { min-width: 0; flex: 1; }
.ed-identity h2 { margin: 0; padding: 0; color: var(--ed-ink); font: 650 clamp(21px, 4.2vw, 26px)/1.35 "STSong","Songti SC","Noto Serif CJK SC","SimSun",serif; letter-spacing: .015em; }
.ed-identity h2:focus { outline: none; }
.ed-location { margin: 4px 0 0; color: #627167; font: 13px/1.4 Georgia,"Microsoft YaHei",sans-serif; }
.ed-close { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; padding: 8px; border: 1px solid var(--ed-line); border-radius: 50%; background: transparent; color: #56665a; }
.ed-close svg { width: 100%; height: 100%; }
.ed-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.ed-fieldset legend, .ed-confirm-title { margin: 0; padding: 0; font-size: 17px; font-weight: 650; line-height: 1.5; color: var(--ed-ink); }
.ed-hint, .ed-confirm p { margin: 5px 0 16px; color: #5e695f; font-size: 13px; line-height: 1.65; }
.ed-decades { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.ed-chip, .ed-all {
  position: relative; display: flex; justify-content: center; align-items: center;
  min-height: 43px; padding: 7px 3px; border: 1px solid var(--ed-line); border-radius: 7px;
  background: #f6f6ed; color: #354d40; line-height: 1.25; font-size: 14px; font-weight: 580;
  font-variant-numeric: tabular-nums;
}
.ed-all { gap: 7px; cursor: pointer; }
.ed-all::after { content: ""; display: block; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); }
.ed-all select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.ed-chip[aria-pressed="true"], .ed-all.ed-selected { color: white; background: var(--ed-ink); border-color: var(--ed-ink); }
.ed-unknown { display: inline-flex; align-items: center; gap: 8px; min-height: 39px; margin: 5px 0 0; padding: 3px 4px; border: 0; background: transparent; color: #526557; font-size: 13px; }
.ed-dot { display: grid; width: 15px; height: 15px; place-items: center; color: var(--ed-ink); border: 1.5px solid #718375; border-radius: 100%; }
.ed-unknown[aria-pressed="true"] { color: var(--ed-ink); font-weight: 650; }
.ed-unknown[aria-pressed="true"] .ed-dot::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ed-year-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--ed-line); padding-top: 15px; margin-top: 4px; }
.ed-year-line label { color: #324c3e; font-size: 14px; font-weight: 610; }
.ed-year-line label span { color: #657268; font-size: 12px; font-weight: 400; }
.ed-year { max-width: 55%; min-height: 38px; padding: 4px 8px; color: var(--ed-ink); background: #fffefa; border: 1px solid var(--ed-line); border-radius: 6px; }
.ed-year:disabled { color: #758078; background: #f5f4ed; }
.ed-order-line { margin-top: 10px; border: 0; padding-top: 0; }
.ed-order-line .ed-year { min-width: 0; text-overflow: ellipsis; }
.ed-footer, .ed-confirm-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 25px; }
.ed-save, .ed-confirm-remove, .ed-keep { min-height: 43px; padding: 9px 22px; border: 1px solid transparent; border-radius: 7px; font-weight: 640; line-height: 1.4; }
.ed-save, .ed-confirm-remove { background: var(--ed-ink); color: #fff; }
.ed-remove { margin-right: auto; padding: 8px 2px; border: 0; color: var(--ed-rust); background: transparent; font-size: 13px; }
.ed-confirm-remove { background: var(--ed-rust); }
.ed-keep { background: transparent; color: var(--ed-ink); border-color: var(--ed-line); }
.ed-error { margin: 12px 0 0; color: var(--ed-rust); font-size: 13px; line-height: 1.5; }
.ed-dialog :is(button, select):focus-visible, .ed-all:has(select:focus-visible) { outline: 3px solid #36845a; outline-offset: 3px; }
@media (hover: hover) {
  .ed-close:hover, .ed-chip:not([aria-pressed="true"]):hover, .ed-all:not(.ed-selected):hover, .ed-keep:hover { background: #eaf0e6; border-color: #819984; }
  .ed-save:hover { background: #123b32; }
  .ed-confirm-remove:hover { background: #81331e; }
  .ed-unknown:hover, .ed-remove:hover { text-decoration: underline; text-underline-offset: 3px; }
}
@media (max-width: 420px) {
  .ed-sheet { padding: 21px 18px; }
  .ed-header { gap: 10px; margin-bottom: 18px; padding-bottom: 17px; }
  .ed-confirm-actions { justify-content: stretch; }
  .ed-confirm-actions button { flex: 1; }
}
