/* Karma Reports v10.23 — targeted layout refinement only.
   Strictly scoped to the Reports route. */

/* -------------------------------------------------------------------------- */
/* 1. Remove the helper toolbar container and float Download PDF over preview. */
/* -------------------------------------------------------------------------- */
body[data-karma-view="reports"] #root [class~="min-w-0"][class~="flex-col"] {
  position: relative !important;
}

body[data-karma-view="reports"] #root [class~="min-w-0"][class~="flex-col"] > [class~="border-b"] {
  position: absolute !important;
  top: 14px !important;
  right: 14px !important;
  z-index: 20 !important;
  display: block !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  pointer-events: none !important;
}

/* The instruction text is removed completely; only the PDF action remains. */
body[data-karma-view="reports"] #root [class~="min-w-0"][class~="flex-col"] > [class~="border-b"] > :not(button),
body[data-karma-view="reports"] #root [class~="min-w-0"][class~="flex-col"] > [class~="border-b"] p {
  display: none !important;
}

body[data-karma-view="reports"] #root [class~="min-w-0"][class~="flex-col"] > [class~="border-b"] button {
  position: relative !important;
  inset: auto !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 0 16px !important;
  border: 0 !important;
  border-radius: 16px !important;
  background: var(--kr11-surface-high) !important;
  color: var(--kr11-on-surface) !important;
  box-shadow: none !important;
  pointer-events: auto !important;
}

body[data-karma-view="reports"] #root [class~="min-w-0"][class~="flex-col"] > [class~="border-b"] button:hover:not(:disabled) {
  background: var(--kr11-surface-highest) !important;
}

/* Preview now starts immediately, without a separate toolbar row above it. */
body[data-karma-view="reports"] #root [class~="min-w-0"][class~="flex-col"] > [class~="flex-1"][class~="relative"] {
  flex: 1 1 100% !important;
  min-height: 0 !important;
}

/* -------------------------------------------------------------------------- */
/* 2. Generate button stands on its own, without a surrounding tonal card.     */
/* -------------------------------------------------------------------------- */
body[data-karma-view="reports"] #root [class~="w-72"] > [class~="border-t"] {
  margin: 0 14px 14px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body[data-karma-view="reports"] #root [class~="w-72"] > [class~="border-t"] > button {
  width: 100% !important;
  margin: 0 !important;
}

/* -------------------------------------------------------------------------- */
/* 3. Phone: remove only the outer background of “Настройки страницы”.         */
/* -------------------------------------------------------------------------- */
@media (max-width: 899px) {
  body[data-karma-view="reports"] #root [class~="w-72"] > [class~="p-4"][class~="space-y-5"] > div:nth-of-type(3) {
    background: transparent !important;
    box-shadow: none !important;
  }

  body[data-karma-view="reports"] #root [class~="w-72"] > [class~="border-t"] {
    margin: 12px 0 0 !important;
    padding: 0 !important;
    background: transparent !important;
  }

  body[data-karma-view="reports"] #root [class~="min-w-0"][class~="flex-col"] > [class~="border-b"] {
    top: 14px !important;
    right: 14px !important;
  }
}
