.exports-open { overflow: hidden; }
.exports-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 18px;
  background: color-mix(in srgb, var(--text) 42%, transparent);
}
.exports-overlay[hidden] { display: none; }
.exports-dialog {
  width: min(100%, 560px);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  padding: 22px;
  border-radius: var(--r-lg);
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-raise);
  font-family: var(--font-ui);
}
.exports-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.exports-head p { margin: 0 0 5px; color: var(--muted); font-size: var(--fs-label); font-weight: 500; }
.exports-head h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.022em; }
.exports-close {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: var(--r-full);
  background: var(--panel2);
  color: var(--text);
}
.exports-close svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.exports-close:focus-visible,
.exports-dialog button:focus-visible,
.exports-dialog input:focus-visible { outline: 3px solid color-mix(in srgb, var(--gold) 42%, transparent); outline-offset: 2px; }
.exports-form { display: grid; gap: 16px; margin-top: 16px; }
.exports-help { margin: 0; color: var(--muted); font-size: var(--fs-body-l); line-height: 1.55; }
.exports-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.exports-form legend { margin-bottom: 9px; color: var(--text); font-size: var(--fs-body-l); font-weight: 700; }
.exports-period { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 9px; }
.exports-period legend { grid-column: 1 / -1; }
.exports-range-presets { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; padding: 3px; border-radius: 13px; background: var(--panel2); }
.exports-range-presets button { min-height: 38px; padding: 4px 8px; border-radius: var(--r-sm); background: transparent; color: var(--muted); font-size: var(--fs-label); font-weight: 600; }
.exports-range-presets button small { display: block; font-size: var(--fs-caption); font-weight: 500; }
.exports-range-presets button[aria-pressed="true"] { background: var(--panel); color: var(--text); box-shadow: var(--shadow-card); }
.exports-period > span { padding-bottom: 13px; color: var(--muted); }
.exports-period label { display: grid; gap: 6px; color: var(--muted); font-size: var(--fs-label); font-weight: 500; }
.exports-period input {
  min-width: 0;
  min-height: 44px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--panel2);
  color: var(--text);
  font-family: var(--font-code);
}
.exports-kind { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.exports-kind legend { grid-column: 1 / -1; }
.exports-choice { position: relative; min-width: 0; }
.exports-choice input { position: absolute; opacity: 0; pointer-events: none; }
.exports-choice span {
  display: grid;
  align-content: center;
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel2);
  cursor: pointer;
}
.exports-choice strong { font-size: var(--fs-body-l); font-weight: 700; }
.exports-choice small { margin-top: 4px; color: var(--muted); font-size: var(--fs-label); line-height: 1.4; }
.exports-choice input:checked + span { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.exports-choice input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--gold) 42%, transparent); outline-offset: 2px; }
.exports-preview-button,
.exports-download { border-radius: var(--r-md); font-size: var(--fs-body-l); font-weight: 600; }
.exports-preview-button { min-height: 36px; }
.exports-download { min-height: 44px; }
.exports-preview-button { border: 1px solid var(--line-strong); background: transparent; color: var(--text); }
.exports-download { background: var(--gold); color: #fff; box-shadow: var(--shadow-cta); }
.exports-download:disabled { opacity: .58; cursor: wait; }
.exports-preview { padding: 14px; border-radius: var(--r-md); background: var(--panel2); }
.exports-preview dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; }
.exports-preview dl div { min-width: 0; }
.exports-preview dt { color: var(--muted); font-size: var(--fs-label); font-weight: 500; }
.exports-preview dd { margin: 3px 0 0; font: 700 var(--fs-title-m) var(--font-numeric); font-variant-numeric: tabular-nums; }
.exports-preview dd small { margin-left: 4px; color: var(--muted); font: 500 var(--fs-caption) var(--font-ui); }
/* 확인 필요는 0이 아닐 때만 색을 쓴다. 내보내기 전에 손봐야 할 것이 그것이다. */
.exports-preview dl div.needs-review dd { color: var(--red); }
.exports-preview p { margin: 12px 0 0; color: var(--muted); font-size: var(--fs-label); line-height: 1.45; }
.exports-status { min-height: 20px; margin: -4px 0; color: var(--muted); font-size: var(--fs-body); line-height: 1.5; }
.exports-status[data-tone="error"] { color: var(--red); }
.exports-status[data-tone="warning"] { color: var(--text); }
@media (max-width: 560px) {
  .exports-overlay { place-items: end center; padding: 0; }
  .exports-dialog { width: 100%; max-height: 88dvh; padding: 18px 18px max(20px, env(safe-area-inset-bottom)); border-radius: var(--r-xl) var(--r-xl) 0 0; }
  .exports-kind { grid-template-columns: 1fr; }
  .exports-range-presets button { font-size: var(--fs-caption); }
}
@media (prefers-reduced-motion: no-preference) {
  .exports-dialog { animation: exports-enter .18s ease-out; }
  @keyframes exports-enter { from { opacity: 0; transform: translateY(10px); } }
}

html[data-theme="dark"] .exports-dialog .exports-download { color: var(--primary-dark); }
