/* Official HubSpot variables for the updated form embed. */
:root {
  --hsf-background__padding: 0px;
  --hsf-global__font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  --hsf-global__font-size: 16px;
  --hsf-field-label__font-size: 14px;
  --hsf-button__background-color: #7668e9;
  --hsf-button__color: #fff;
  --hsf-button__border-radius: 10px;
  --hsf-richtext__font-size: 14px;
}

/* The feedback panel is independent of the chart and existing setup dialogs. */
body.feedback-enabled {
  padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}

.feedback-launcher {
  position: fixed;
  z-index: 35;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 16px;
  border: 1px solid #d9d6ee;
  border-radius: 999px;
  color: #574baf;
  background: #fff;
  box-shadow: 0 4px 18px rgba(35, 29, 69, 0.09);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.feedback-launcher:hover { background: #f4f2ff; }
.feedback-launcher svg { width: 17px; height: 17px; }
.feedback-launcher:focus-visible,
.feedback-close:focus-visible,
.feedback-direct-link:focus-visible {
  outline: 3px solid #7668e9;
  outline-offset: 3px;
}

.feedback-dialog {
  position: fixed;
  inset: auto 18px 76px auto;
  width: min(440px, calc(100vw - 36px));
  max-width: calc(100vw - 36px);
  max-height: calc(100vh - 110px);
  max-height: calc(100dvh - 110px);
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 22px 80px rgba(24, 20, 46, 0.2);
}

.feedback-dialog[open] { display: flex; flex-direction: column; }
.feedback-dialog::backdrop { background: rgba(31, 32, 37, 0.28); }
.feedback-header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 18px 16px 22px;
  border-bottom: 1px solid var(--line);
}

.feedback-header h2 { margin: 0; font-size: 18px; line-height: 1.5; }
.feedback-header p { margin: 5px 0 0; color: #646b61; font-size: 12px; line-height: 1.7; }
.feedback-close {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  place-items: center;
  margin: -7px -6px 0 0;
  border: 0;
  border-radius: 10px;
  color: #62695f;
  background: transparent;
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
}

.feedback-close:hover { background: var(--canvas); }
.feedback-body {
  min-height: 0;
  padding: 18px 22px 22px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.feedback-note { margin: 0 0 18px; color: #646b61; font-size: 11px; line-height: 1.8; }
.feedback-status {
  margin: 0 0 16px;
  padding: 12px;
  border-radius: 10px;
  color: #62695f;
  background: var(--canvas);
  font-size: 12px;
  line-height: 1.8;
}

.feedback-status[data-state="error"] { color: #8c3f30; background: #fff1eb; }
.feedback-status[data-state="success"] { color: #256548; background: #ecf8f0; }
.feedback-form { min-width: 0; width: 100%; }
.feedback-form iframe { display: block; max-width: 100%; border: 0; }
.feedback-footer { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.feedback-direct-link { color: #574baf; font-size: 12px; text-underline-offset: 4px; line-height: 1.8; }
.feedback-footer p { margin: 8px 0 0; color: #646b61; font-size: 11px; line-height: 1.7; }

@media (max-width: 640px) {
  .feedback-launcher { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); padding-inline: 14px; }
  .feedback-dialog {
    inset: auto 12px max(12px, env(safe-area-inset-bottom)) 12px;
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px - env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 24px - env(safe-area-inset-bottom, 0px));
  }
  .feedback-header { padding: 18px 14px 14px 18px; }
  .feedback-body { padding: 16px 18px 18px; }
}
