.batch-export-card { margin-bottom: 9px; }
.batch-export-form { display: grid; gap: 10px; margin-top: 12px; }
.batch-date-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.batch-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.batch-toolbar .button { flex: 1 1 120px; }
.batch-option {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--text);
  font-size: 0.72rem;
  line-height: 1.4;
}
.batch-option input { margin-top: 0; accent-color: var(--accent); }
.batch-export-card #batch-summary:empty { display: none; }
.batch-activity-groups { display: grid; gap: 10px; }
.batch-date-group {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px;
  background: rgba(7, 16, 29, 0.28);
}
.batch-date-group h4 { margin: 0; font-size: 0.76rem; }
.batch-queue-box {
  display: none;
  gap: 9px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 10px;
  background: rgba(7, 16, 29, 0.34);
}

.batch-queue-box.is-workspace-visible {
  display: grid;
}

.batch-queue-box.is-inactive:not(.is-expanded) {
  gap: 0;
  padding-block: 9px;
}

.batch-queue-box.is-inactive:not(.is-expanded) > :not(.batch-queue-header) {
  display: none;
}

.batch-queue-box.is-inactive .batch-queue-header {
  grid-template-columns: minmax(0, 1fr) auto 38px;
  min-height: 38px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.batch-queue-box.is-inactive .batch-queue-header::after {
  content: "";
  display: grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background-color: var(--panel-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239baac0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 21px 21px;
  transition: transform 160ms ease;
}

.batch-queue-box.is-inactive.is-expanded .batch-queue-header::after {
  transform: rotate(180deg);
}

.batch-queue-box.is-inactive .batch-queue-header:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 9px;
}

.batch-queue-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}
.batch-queue-header > strong { min-width: 0; overflow-wrap: anywhere; }
.batch-counts { color: var(--muted); font-size: 0.68rem; }
.batch-items { display: grid; gap: 7px; width: 100%; min-width: 0; }
.batch-item {
  display: grid;
  gap: 6px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 8px 9px;
  background: rgba(24, 40, 65, 0.45);
}
.batch-item-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  min-width: 0;
}
.batch-item-head .status-pill { max-width: 180px; text-align: center; }
.batch-item-title { display: grid; gap: 2px; min-width: 0; }
.batch-item-title strong { font-size: 0.74rem; overflow-wrap: anywhere; }
.batch-item-title span { color: var(--muted); font-size: 0.64rem; }
.batch-item-message { margin: 0; color: var(--muted); font-size: 0.67rem; line-height: 1.35; overflow-wrap: anywhere; }
.batch-item-warning[hidden] { display: none !important; }
.batch-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 36px;
  align-items: center;
}
.batch-item-actions .button { min-height: 36px; padding: 6px 9px; font-size: 0.66rem; }
.batch-progress { width: 100%; height: 7px; border-radius: 999px; overflow: hidden; background: rgba(155, 170, 192, 0.16); }
.batch-progress > span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 180ms ease; }
.batch-summary-ok { color: var(--accent); font-weight: 650; }
.batch-summary-warn { color: var(--warn); }
.batch-summary-error { color: #ff9a9a; font-weight: 650; }

.batch-confirm-dialog {
  position: fixed;
  inset: 0;
  width: min(280px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 20px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--text);
  background: var(--surface, #111d30);
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.42);
}
.batch-confirm-dialog::backdrop {
  background: rgba(0, 6, 16, 0.72);
  backdrop-filter: blur(5px);
}
.batch-confirm-dialog[open] {
  display: grid;
  gap: 18px;
}
.batch-confirm-dialog h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1.2;
  text-align: center;
}
.batch-confirm-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.batch-confirm-actions .button {
  min-height: 46px;
  margin: 0;
}
body.batch-confirm-open { overflow: hidden; }

.batch-export-card.has-custom-date-range .batch-export-form {
  position: relative;
}

.batch-export-card.has-custom-date-range .batch-toolbar {
  display: contents;
}

.batch-export-card.has-custom-date-range #batch-all,
.batch-export-card.has-custom-date-range #batch-none {
  display: none !important;
}

.batch-export-card.has-custom-date-range .batch-range-picker {
  width: calc(100% - 64px);
  min-width: 0;
}

.batch-export-card.has-custom-date-range .batch-range-trigger {
  min-height: 62px;
}

.batch-export-card.has-custom-date-range #batch-find {
  position: absolute;
  top: 0;
  right: 0;
  width: 56px;
  min-width: 56px;
  height: 62px;
  min-height: 62px;
  padding: 0;
  border: 1px solid rgba(125, 211, 252, 0.2);
  border-radius: 15px;
  color: var(--accent);
  background: linear-gradient(145deg, rgba(20, 37, 61, 0.96), rgba(11, 24, 42, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  font-size: 0;
  flex: none;
}

.batch-export-card.has-custom-date-range #batch-find::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 17px;
  height: 17px;
  border: 2px solid currentColor;
  border-radius: 999px;
  transform: translate(-62%, -62%);
}

.batch-export-card.has-custom-date-range #batch-find::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(4px, 7px) rotate(45deg);
  transform-origin: left center;
}

.batch-export-card.has-custom-date-range #batch-find:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 420px) {
  .batch-date-grid { grid-template-columns: 1fr; }
  .batch-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .batch-toolbar .button:last-child { grid-column: 1 / -1; }
  .batch-item-head .status-pill { max-width: 132px; white-space: normal; }

  .batch-export-card.has-custom-date-range .batch-toolbar {
    display: contents;
  }

  .batch-export-card.has-custom-date-range .batch-toolbar .button:last-child {
    grid-column: auto;
  }
}

@media (max-width: 360px) {
  .batch-export-card.has-custom-date-range .batch-range-picker {
    width: calc(100% - 60px);
  }

  .batch-export-card.has-custom-date-range .batch-range-trigger {
    min-height: 58px;
  }

  .batch-export-card.has-custom-date-range #batch-find {
    width: 52px;
    min-width: 52px;
    height: 58px;
    min-height: 58px;
  }
}
