/* Inky support widget — themed to the console.
 *
 * The widget ships its own light theme: blue accent, 20px radius, 400x560 panel, slate greys,
 * 15px inputs. The console is ink-on-warm-white with a 12px panel radius and a system font, so
 * this file re-points the vendor's OWN custom properties at our design tokens instead of
 * restyling every internal rule. `!important` is required on the custom properties because the
 * widget writes `--inky-accent` and the launcher background INLINE (inline custom properties beat
 * a normal stylesheet declaration).
 *
 * Loaded after app.css so the tokens below are always resolved when the widget appears.
 */

.inky-widget {
  --inky-accent: var(--ink) !important;
  --inky-accent-contrast: #ffffff !important;
  --inky-surface: var(--surface) !important;
  --inky-muted: var(--ink-muted) !important;
  --inky-border: var(--border-subtle) !important;
  --inky-chat-bg: var(--surface-subtle) !important;
  /* keep the vendor's safe-area behaviour while pinning our own offset */
  right: max(20px, env(safe-area-inset-right)) !important;
  bottom: max(20px, env(safe-area-inset-bottom)) !important;
  font-family: var(--font) !important;
  -webkit-font-smoothing: antialiased;
}

/* A console card: white, hairline border, 12px radius, soft warm shadow — not the vendor's 20px
   pill-ish panel with a coloured header bar. */
/* the vendor's left-positioned variant keeps its own side */
.inky-widget--left { right: auto !important; left: max(20px, env(safe-area-inset-left)) !important; }

.inky-widget__panel {
  width: min(380px, calc(100vw - 32px)) !important;
  height: min(540px, 74vh) !important;
  max-height: min(540px, 80dvh) !important;
  border-radius: var(--radius-panel) !important;
  border: 1px solid var(--border-subtle) !important;
  box-shadow: 0 18px 48px rgba(25, 33, 30, 0.18) !important;
  overflow: hidden !important;
}

.inky-widget__head {
  background: var(--surface) !important;
  color: var(--ink) !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  box-shadow: none !important;
  padding: 12px 14px !important;
}
.inky-widget__title {
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
}
.inky-widget__close {
  background: transparent !important;
  color: var(--ink-muted) !important;
}
.inky-widget__close:hover { background: var(--surface-subtle) !important; }

.inky-widget__chat-main,
.inky-widget__messages { background: var(--surface-subtle) !important; }

.inky-widget__bubble {
  font-size: 14px !important;
  line-height: 1.5 !important;
  border-radius: var(--radius-panel) !important;
}
.inky-widget__bubble--visitor { background: var(--ink) !important; color: #ffffff !important; }
.inky-widget__bubble--ai {
  background: var(--surface) !important;
  color: var(--ink) !important;
  border: 1px solid var(--border-subtle) !important;
}

.inky-widget__foot,
.inky-widget__input-row {
  background: var(--surface) !important;
  border-top: 1px solid var(--border-subtle) !important;
}
.inky-widget__input {
  background: var(--surface) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-control) !important;
  color: var(--ink) !important;
  font-family: var(--font) !important;
  font-size: 14px !important;
  padding: 9px 12px !important;
}
.inky-widget__input::placeholder { color: var(--ink-muted) !important; }
.inky-widget__send {
  background: var(--ink) !important;
  color: #ffffff !important;
  border-radius: var(--radius-control) !important;
}

.inky-widget__bottom-nav {
  background: var(--surface) !important;
  border-top: 1px solid var(--border-subtle) !important;
}
.inky-widget__nav-btn { color: var(--ink-muted) !important; font-family: var(--font) !important; }
.inky-widget__nav-btn[aria-selected="true"] { color: var(--ink) !important; }

/* The console hides the vendor bubble (D1) and opens the panel from its own Support entry; keep
   the launcher themed anyway so a future un-hide is not off-brand. */
.inky-widget__launcher {
  background: var(--ink) !important;
  color: #ffffff !important;
  box-shadow: 0 10px 24px rgba(25, 33, 30, 0.28) !important;
}

@media (max-width: 430px) {
  .inky-widget { right: max(12px, env(safe-area-inset-right)) !important; bottom: max(12px, env(safe-area-inset-bottom)) !important; }
  .inky-widget--left { right: auto !important; left: max(12px, env(safe-area-inset-left)) !important; }
  .inky-widget__panel {
    width: calc(100vw - 24px) !important;
    /* both bounds, because the base rule's max-height otherwise caps this one */
    height: min(70vh, 540px) !important;
    max-height: min(70vh, 540px) !important;
  }
}
