@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :focus-visible {
    @apply outline-none ring-2 ring-primary/45 ring-offset-2 ring-offset-base-100;
  }

  ::selection {
    @apply bg-primary/20 text-base-content;
  }
}

@layer components {
  .app-shell,
  .public-shell {
    @apply min-h-screen bg-base-100 text-base-content antialiased;
  }

  .app-shell .drawer-content {
    @apply bg-base-200/55;
  }

  .site-header {
    @apply sticky top-0 z-30 border-b border-base-300 bg-base-100/95 backdrop-blur-md;
  }

  .site-footer,
  .app-footer {
    @apply border-t border-base-300 text-base-content/50;
  }

  .app-sidebar {
    @apply border-r border-base-300 bg-base-100 text-base-content;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
  }

  .brand-link {
    @apply inline-flex items-center gap-2.5 text-sm font-semibold tracking-[-0.015em] text-base-content;
  }

  .brand-mark {
    @apply grid h-8 w-8 grid-cols-2 grid-rows-2 place-items-center rounded-lg border border-primary/20 bg-primary text-primary-content shadow-sm;
    padding: 0.42rem;
  }

  .brand-mark span {
    @apply h-1 w-1 rounded-full bg-current;
  }

  .brand-mark span:first-child {
    @apply col-span-2 h-1 w-3 rounded-full;
  }

  .theme-toggle {
    @apply btn btn-ghost btn-sm btn-square border border-transparent text-base-content/55 hover:border-base-300 hover:bg-base-200 hover:text-base-content;
  }

  .app-nav-label {
    @apply mb-2 mt-2 px-3 text-[0.62rem] font-semibold uppercase tracking-[0.19em] text-base-content/40;
  }

  .app-nav-link {
    @apply flex min-h-10 items-center gap-3 rounded-lg px-3 text-[0.82rem] font-medium text-base-content/60 transition-colors hover:bg-base-200 hover:text-base-content;
  }

  .app-nav-link svg {
    @apply shrink-0 text-base-content/45;
  }

  .app-nav-link-active {
    @apply bg-primary/10 font-semibold text-primary hover:bg-primary/10 hover:text-primary;
  }

  .app-nav-link-active svg {
    @apply text-primary;
  }

  .app-page {
    @apply mx-auto w-full max-w-[90rem] px-4 sm:px-6 xl:px-8;
  }

  .public-page {
    @apply mx-auto w-full max-w-5xl px-4 sm:px-6;
  }

  .app-panel,
  .public-panel {
    @apply rounded-xl border border-base-300 bg-base-100;
    box-shadow: 0 1px 2px hsl(var(--bc) / 0.025);
  }

  .app-card,
  .public-card {
    @apply rounded-xl border border-base-300 bg-base-100 p-5 sm:p-6;
    box-shadow: 0 1px 2px hsl(var(--bc) / 0.025);
  }

  .app-subpanel {
    @apply rounded-lg border border-base-300/80 bg-base-200/45 p-4;
  }

  .app-empty-state {
    @apply rounded-xl border border-dashed border-base-300 bg-base-100 px-6 py-12 text-center text-sm text-base-content/55;
  }

  .app-fieldset {
    @apply space-y-3 rounded-xl border border-base-300 bg-base-100 p-4 sm:p-5;
  }

  .app-kicker,
  .public-eyebrow {
    @apply text-[0.64rem] font-semibold uppercase tracking-[0.2em] text-primary;
  }

  .app-title,
  .public-title {
    @apply text-2xl font-semibold tracking-[-0.03em] text-base-content sm:text-[1.75rem];
  }

  .app-description,
  .public-subtitle {
    @apply max-w-3xl text-sm leading-6 text-base-content/60;
  }

  .app-meta,
  .public-meta-chip {
    @apply inline-flex items-center gap-2 text-[0.68rem] font-medium uppercase tracking-[0.14em] text-base-content/45;
  }

  .app-meta::before,
  .public-meta-chip::before {
    content: "";
    @apply inline-block h-1 w-1 rounded-full bg-primary/70;
  }

  .metric-card {
    @apply relative min-w-0 border-b border-base-300 bg-base-100 px-5 py-5 last:border-b-0 sm:border-b-0 sm:border-r sm:last:border-r-0;
  }

  .metric-label {
    @apply text-[0.68rem] font-semibold uppercase tracking-[0.14em] text-base-content/45;
  }

  .metric-value {
    @apply mt-2 text-3xl font-semibold tracking-[-0.04em] text-base-content tabular-nums;
  }

  .metric-context {
    @apply mt-1 text-xs leading-5 text-base-content/50;
  }

  .panel-heading {
    @apply flex flex-wrap items-start justify-between gap-3 border-b border-base-300 px-5 py-4;
  }

  .panel-title {
    @apply text-sm font-semibold tracking-tight text-base-content;
  }

  .panel-description {
    @apply mt-1 text-xs leading-5 text-base-content/50;
  }

  .filter-bar {
    @apply rounded-xl border border-base-300 bg-base-100 p-3 sm:p-4;
  }

  .filter-bar .label {
    @apply min-h-0 px-0 pb-1.5 pt-0;
  }

  .filter-bar .label-text {
    @apply text-[0.68rem] font-semibold uppercase tracking-[0.12em] text-base-content/45;
  }

  .data-table {
    @apply table;
  }

  .data-table thead {
    @apply border-b border-base-300 bg-base-200/60;
  }

  .data-table thead th {
    @apply h-11 text-[0.64rem] font-semibold uppercase tracking-[0.14em] text-base-content/45;
  }

  .data-table tbody tr {
    @apply border-base-300/80 transition-colors hover:bg-base-200/45;
  }

  .data-table tbody td {
    @apply py-3.5 align-middle;
  }

  @media (max-width: 767px) {
    .data-table {
      width: 100%;
      table-layout: fixed;
    }
  }

  .status-dot {
    @apply inline-flex items-center gap-2 whitespace-nowrap text-xs font-medium text-base-content/65;
  }

  .status-dot::before {
    content: "";
    @apply h-1.5 w-1.5 rounded-full bg-base-content/30;
  }

  .status-dot-progress::before {
    @apply bg-info;
  }

  .status-dot-completed::before {
    @apply bg-success;
  }

  .public-shell {
    @apply bg-base-100;
  }

  .public-nav-link {
    @apply inline-flex h-9 items-center border-b-2 border-transparent text-[0.68rem] font-semibold uppercase tracking-[0.14em] text-base-content/55 transition hover:text-base-content;
  }

  .public-nav-link-active {
    @apply border-primary text-primary;
  }

  .public-list {
    @apply divide-y divide-base-300;
  }

  .public-list-row {
    @apply grid gap-3 px-4 py-4 transition-colors hover:bg-base-200/55 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start sm:px-5;
  }

  .public-prose {
    @apply prose prose-base max-w-none;
  }

  .public-prose :where(h1, h2, h3, h4, strong, code) {
    color: hsl(var(--bc));
  }

  .public-prose :where(p, li, blockquote) {
    color: hsl(var(--bc) / 0.82);
  }

  .public-prose :where(a) {
    color: hsl(var(--p));
    text-decoration: none;
  }

  .public-prose :where(a:hover) {
    text-decoration: underline;
  }

  .public-prose :where(blockquote) {
    @apply rounded-lg bg-base-200;
    border-color: hsl(var(--p) / 0.3);
    border-left-width: 4px;
  }

  .public-prose :where(pre) {
    @apply rounded-lg bg-neutral text-neutral-content;
  }

  .public-prose :where(img) {
    @apply rounded-lg;
  }
}
/* Host-overridable widget tokens. :where() keeps specificity at zero. */
:where(.ideabug-root, .ideabug-bell, .ideabug-pulse-dot) {
  --ib-accent: #0f766e;
  --ib-accent-strong: #0b5f59;
  --ib-bg: #ffffff;
  --ib-surface: #f5f7f6;
  --ib-fg: #202724;
  --ib-muted: #66706c;
  --ib-border: #dfe4e1;
  --ib-hover: #f0f3f1;
  --ib-unread: #edf8f5;
  --ib-notification: #dc6b35;
  --ib-danger: #b42318;
  --ib-success: #16794a;
  --ib-shadow: 0 24px 70px rgba(22, 32, 28, 0.17), 0 4px 16px rgba(22, 32, 28, 0.08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ideabug-root {
  color: var(--ib-fg);
  font-size: 14px;
  line-height: 1.45;
}

.ideabug-root *,
.ideabug-root *::before,
.ideabug-root *::after,
.ideabug-bell *,
.ideabug-bell *::before,
.ideabug-bell *::after {
  box-sizing: border-box;
}

.ideabug-root button,
.ideabug-root input,
.ideabug-root textarea {
  font: inherit;
}

.ideabug-root button:focus-visible,
.ideabug-root input:focus-visible,
.ideabug-root textarea:focus-visible,
.ideabug-bell:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--ib-accent) 55%, transparent);
  outline-offset: 2px;
}

.ideabug-bell {
  position: relative;
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  color: var(--ib-fg);
  background: var(--ib-bg);
  border: 1px solid var(--ib-border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(22, 32, 28, 0.06);
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.ideabug-bell:hover {
  background: var(--ib-hover);
  border-color: color-mix(in srgb, var(--ib-accent) 35%, var(--ib-border));
  transform: translateY(-1px);
}

.ideabug-bell svg { width: 19px; height: 19px; }

.ideabug-bell-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--ib-notification);
  border: 2px solid var(--ib-bg);
}

.ideabug-bell-badge:not(.is-hidden):not(.is-count)::after,
.ideabug-has-unread .ideabug-pulse-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--ib-notification);
  animation: ideabug-pulse 1.8s ease-out infinite;
  pointer-events: none;
}

@keyframes ideabug-pulse {
  0% { transform: scale(1); opacity: 0.35; }
  100% { transform: scale(3.1); opacity: 0; }
}

.ideabug-pulse-dot {
  display: none;
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ib-notification);
  vertical-align: middle;
}

.ideabug-has-unread .ideabug-pulse-dot { display: inline-block; }
.ideabug-opted-out .ideabug-pulse-dot { display: none; }

[data-ideabug-unread-count][hidden],
[data-ideabug-unread-count][aria-hidden="true"] { display: none !important; }

.ideabug-bell-badge.is-count {
  width: auto;
  height: 18px;
  min-width: 18px;
  top: -7px;
  right: -7px;
  padding: 0 5px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border: 0;
}

.ideabug-bell-badge.is-hidden { display: none; }

.ideabug-panel {
  position: fixed;
  z-index: 999999;
  display: none;
  width: 400px;
  max-width: calc(100vw - 24px);
  height: 600px;
  max-height: calc(100vh - 24px);
  flex-direction: column;
  overflow: hidden;
  color: var(--ib-fg);
  background: var(--ib-bg);
  border: 1px solid var(--ib-border);
  border-radius: 18px;
  box-shadow: var(--ib-shadow);
  transform-origin: top right;
  animation: ideabug-panel-in 170ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ideabug-panel.is-open { display: flex; }

@keyframes ideabug-panel-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ideabug-panel-header {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px 12px;
}

.ideabug-panel-identity { display: flex; min-width: 0; align-items: center; gap: 11px; }

.ideabug-panel-mark {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  place-items: center;
  padding: 8px;
  color: #fff;
  background: var(--ib-accent);
  border-radius: 10px;
}

.ideabug-panel-mark i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.ideabug-panel-mark i:first-child { width: 12px; grid-column: span 2; border-radius: 999px; }
.ideabug-panel-title { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.ideabug-panel-subtitle { margin-top: 1px; color: var(--ib-muted); font-size: 11px; }

.ideabug-panel-close,
.ideabug-modal-close {
  display: inline-flex;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--ib-muted);
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 9px;
}

.ideabug-panel-close:hover,
.ideabug-modal-close:hover { color: var(--ib-fg); background: var(--ib-hover); }
.ideabug-panel-close svg { width: 17px; height: 17px; }

.ideabug-tabs {
  display: flex;
  gap: 22px;
  padding: 0 16px;
  background: var(--ib-bg);
  border-bottom: 1px solid var(--ib-border);
}

.ideabug-tab {
  position: relative;
  min-width: 0;
  padding: 10px 0 11px;
  color: var(--ib-muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  background: transparent;
  border: 0;
}

.ideabug-tab::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: transparent;
  border-radius: 999px 999px 0 0;
}

.ideabug-tab:hover { color: var(--ib-fg); }
.ideabug-tab.is-active { color: var(--ib-accent); }
.ideabug-tab.is-active::after { background: var(--ib-accent); }

.ideabug-body {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: contain;
  scrollbar-color: var(--ib-border) transparent;
}

.ideabug-scroll-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--ib-border) transparent;
}

.ideabug-section-title {
  padding: 17px 16px 7px;
  color: var(--ib-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.ideabug-item {
  position: relative;
  margin: 0 8px;
  padding: 12px 12px 12px 16px;
  cursor: pointer;
  border-radius: 10px;
  transition: background 120ms ease;
}

.ideabug-item:hover { background: var(--ib-hover); }
.ideabug-item.is-unread { background: var(--ib-unread); }
.ideabug-item.is-unread::before {
  content: "";
  position: absolute;
  top: 17px;
  left: 7px;
  width: 4px;
  height: 4px;
  background: var(--ib-accent);
  border-radius: 50%;
}

.ideabug-item-title { color: var(--ib-fg); font-size: 13px; font-weight: 650; line-height: 1.35; }
.ideabug-item-meta { margin-top: 3px; color: var(--ib-muted); font-size: 11px; }
.ideabug-item-preview {
  display: -webkit-box;
  margin-top: 5px;
  overflow: hidden;
  color: var(--ib-muted);
  font-size: 12px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ideabug-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  margin-top: auto;
  padding: 11px 16px;
  background: var(--ib-surface);
  border-top: 1px solid var(--ib-border);
}

.ideabug-link {
  padding: 0;
  color: var(--ib-accent);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  border: 0;
}

.ideabug-link:hover { color: var(--ib-accent-strong); text-decoration: underline; }
.ideabug-link[disabled] { opacity: 0.45; cursor: not-allowed; }

.ideabug-btn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  background: var(--ib-accent);
  border: 1px solid var(--ib-accent);
  border-radius: 10px;
  transition: background 120ms ease;
}

.ideabug-btn:hover { background: var(--ib-accent-strong); }
.ideabug-btn[disabled] { opacity: 0.55; cursor: wait; }
.ideabug-btn-ghost { color: var(--ib-fg); background: transparent; border-color: var(--ib-border); }

.ideabug-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 12px;
  padding: 10px 12px;
  color: var(--ib-fg);
  font-size: 12px;
  background: var(--ib-unread);
  border: 1px solid color-mix(in srgb, var(--ib-accent) 22%, var(--ib-border));
  border-radius: 10px;
}

.ideabug-empty {
  display: grid;
  min-height: 100%;
  flex: 1;
  place-content: center;
  padding: 64px 28px;
  color: var(--ib-muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.ideabug-spinner-wrap { display: flex; min-height: 100%; flex: 1; align-items: center; justify-content: center; padding: 60px 16px; }
.ideabug-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--ib-border);
  border-top-color: var(--ib-accent);
  border-radius: 50%;
  animation: ideabug-spin 0.75s linear infinite;
}

@keyframes ideabug-spin { to { transform: rotate(360deg); } }

.ideabug-suggest-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin: 12px 16px 2px;
  padding: 3px;
  background: var(--ib-surface);
  border: 1px solid var(--ib-border);
  border-radius: 10px;
  flex: 0 0 auto;
}

.ideabug-suggest-tab {
  padding: 7px 8px;
  color: var(--ib-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 7px;
}

.ideabug-suggest-tab:hover { color: var(--ib-fg); }
.ideabug-suggest-tab.is-active { color: var(--ib-fg); background: var(--ib-bg); box-shadow: 0 1px 3px rgba(22, 32, 28, 0.08); }

.ideabug-suggest-body {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  overflow-y: auto;
}

.ideabug-form { display: flex; min-height: 100%; flex: 1; flex-direction: column; gap: 14px; padding: 18px 16px 20px; }
.ideabug-form > .ideabug-btn { margin-top: auto; }
.ideabug-form-intro { display: flex; flex-direction: column; gap: 3px; }
.ideabug-form-intro strong { font-size: 15px; letter-spacing: -0.01em; }
.ideabug-form-intro span { color: var(--ib-muted); font-size: 12px; line-height: 1.5; }

.ideabug-field { display: flex; flex-direction: column; gap: 6px; }
.ideabug-field > span { color: var(--ib-fg); font-size: 11px; font-weight: 700; }
.ideabug-field small { color: var(--ib-muted); font-size: 10px; font-weight: 500; }

.ideabug-segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid var(--ib-border);
  border-radius: 10px;
}

.ideabug-segmented button {
  padding: 9px 8px;
  color: var(--ib-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  background: var(--ib-bg);
  border: 0;
  border-right: 1px solid var(--ib-border);
}

.ideabug-segmented button:last-child { border-right: 0; }
.ideabug-segmented button:hover { background: var(--ib-hover); }
.ideabug-segmented button.is-active { color: var(--ib-accent); background: var(--ib-unread); }

.ideabug-input,
.ideabug-textarea {
  width: 100%;
  padding: 10px 11px;
  color: var(--ib-fg);
  font-size: 13px;
  line-height: 1.45;
  background: var(--ib-bg);
  border: 1px solid var(--ib-border);
  border-radius: 10px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.ideabug-input::placeholder,
.ideabug-textarea::placeholder { color: color-mix(in srgb, var(--ib-muted) 72%, transparent); }
.ideabug-input:focus,
.ideabug-textarea:focus { border-color: var(--ib-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ib-accent) 13%, transparent); outline: none; }
.ideabug-textarea { min-height: 112px; resize: vertical; }

.ideabug-success { margin: auto 0; padding: 64px 28px; text-align: center; }
.ideabug-success strong { display: block; font-size: 16px; }
.ideabug-success p { margin: 7px auto 14px; color: var(--ib-muted); font-size: 12px; line-height: 1.55; }

.ideabug-status-new { color: var(--ib-fg); background: var(--ib-hover); }
.ideabug-status-in_progress { color: var(--ib-accent); background: var(--ib-unread); }
.ideabug-status-completed { color: var(--ib-success); background: color-mix(in srgb, var(--ib-success) 12%, transparent); }

.ideabug-roadmap-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 8px;
  padding: 12px;
  border-radius: 10px;
}

.ideabug-roadmap-card:hover { background: var(--ib-hover); }
.ideabug-roadmap-card-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.ideabug-chip {
  display: inline-flex;
  padding: 2px 7px;
  color: var(--ib-muted);
  font-size: 10px;
  line-height: 1.45;
  text-transform: capitalize;
  background: var(--ib-surface);
  border: 1px solid var(--ib-border);
  border-radius: 999px;
}

.ideabug-vote {
  display: inline-flex;
  min-width: 48px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 9px;
  color: var(--ib-muted);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  background: var(--ib-bg);
  border: 1px solid var(--ib-border);
  border-radius: 999px;
}

.ideabug-vote:hover { color: var(--ib-accent); border-color: color-mix(in srgb, var(--ib-accent) 35%, var(--ib-border)); }
.ideabug-vote.is-voted { color: var(--ib-accent); background: var(--ib-unread); border-color: var(--ib-accent); }
.ideabug-vote svg { width: 13px; height: 13px; }

.ideabug-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(15, 23, 20, 0.56);
  backdrop-filter: blur(2px);
  animation: ideabug-fade-in 140ms ease-out;
}

.ideabug-modal-overlay.is-open { display: flex; }
@keyframes ideabug-fade-in { from { opacity: 0; } to { opacity: 1; } }

.ideabug-modal {
  position: relative;
  display: flex;
  width: min(680px, 100%);
  max-height: calc(100vh - 56px);
  flex-direction: column;
  overflow: hidden;
  color: var(--ib-fg);
  background: var(--ib-bg);
  border: 1px solid var(--ib-border);
  border-radius: 18px;
  box-shadow: 0 32px 90px rgba(15, 23, 20, 0.3);
  animation: ideabug-panel-in 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ideabug-modal-header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--ib-border);
}

.ideabug-modal-title-block { min-width: 0; }
.ideabug-modal-title { margin: 0; font-size: 21px; font-weight: 700; line-height: 1.3; letter-spacing: -0.025em; }
.ideabug-modal-meta { margin-top: 5px; color: var(--ib-muted); font-size: 11px; }
.ideabug-modal-close { font-size: 21px; }

.ideabug-modal-body { padding: 24px; overflow-y: auto; font-size: 14px; line-height: 1.7; }
.ideabug-modal-body :first-child { margin-top: 0; }
.ideabug-modal-body :last-child { margin-bottom: 0; }
.ideabug-modal-body h1,
.ideabug-modal-body h2,
.ideabug-modal-body h3 { margin: 1.4em 0 0.55em; font-weight: 650; line-height: 1.3; letter-spacing: -0.015em; }
.ideabug-modal-body h1 { font-size: 22px; }
.ideabug-modal-body h2 { font-size: 18px; }
.ideabug-modal-body h3 { font-size: 15px; }
.ideabug-modal-body p,
.ideabug-modal-body ul,
.ideabug-modal-body ol,
.ideabug-modal-body blockquote { margin: 0 0 1em; }
.ideabug-modal-body ul,
.ideabug-modal-body ol { padding-left: 1.5em; }
.ideabug-modal-body li { margin: 0.3em 0; }
.ideabug-modal-body a { color: var(--ib-accent); text-decoration: underline; text-underline-offset: 2px; }
.ideabug-modal-body img,
.ideabug-modal-body video,
.ideabug-modal-body figure { max-width: 100%; height: auto; margin: 1em 0; border-radius: 10px; }
.ideabug-modal-body figcaption,
.ideabug-modal-body .attachment__caption { margin-top: 0.35em; color: var(--ib-muted); font-size: 11px; }
.ideabug-modal-body blockquote { padding-left: 1em; color: var(--ib-muted); border-left: 3px solid var(--ib-border); }
.ideabug-modal-body pre { padding: 13px 14px; overflow-x: auto; font-size: 12px; background: var(--ib-surface); border-radius: 9px; }
.ideabug-modal-body code { padding: 1px 4px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; background: var(--ib-surface); border-radius: 4px; }
.ideabug-modal-body pre code { padding: 0; background: transparent; }
.ideabug-modal-body action-text-attachment,
.ideabug-modal-body .attachment { display: block; margin: 0.9em 0; }
.ideabug-modal-body action-text-attachment img,
.ideabug-modal-body .attachment--preview img { display: block; max-width: 100%; height: auto; border-radius: 10px; }

.ideabug-modal-footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 20px;
  background: var(--ib-surface);
  border-top: 1px solid var(--ib-border);
}

.ideabug-modal-footer .ideabug-modal-meta { margin: 0; }
.ideabug-modal-nav {
  position: absolute;
  top: 50%;
  z-index: 1;
  display: flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  color: var(--ib-fg);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  background: var(--ib-bg);
  border: 1px solid var(--ib-border);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(15, 23, 20, 0.14);
  transform: translateY(-50%);
}

.ideabug-modal-nav:hover { background: var(--ib-hover); }
.ideabug-modal-nav[disabled] { opacity: 0.28; cursor: not-allowed; }
.ideabug-modal-nav-prev { left: -54px; }
.ideabug-modal-nav-next { right: -54px; }

@media (max-width: 820px) {
  .ideabug-modal-nav { top: auto; bottom: 10px; transform: none; }
  .ideabug-modal-nav-prev { left: 10px; }
  .ideabug-modal-nav-next { right: 10px; }
}

@media (max-width: 640px) {
  .ideabug-panel {
    top: auto !important;
    right: 12px;
    bottom: 12px;
    left: 12px !important;
    width: auto;
    height: min(680px, calc(100dvh - 24px));
    max-height: calc(100dvh - 24px);
    border-radius: 18px;
    transform-origin: bottom center;
  }

  .ideabug-tabs { gap: 16px; overflow-x: auto; }
  .ideabug-tab { flex: 0 0 auto; }
  .ideabug-modal-overlay { align-items: flex-end; padding: 10px; }
  .ideabug-modal { max-height: calc(100dvh - 20px); border-radius: 18px; }
  .ideabug-modal-header { padding: 18px 18px 15px; }
  .ideabug-modal-body { padding: 18px; }
  .ideabug-modal-footer { min-height: 58px; padding-right: 58px; padding-left: 58px; }
  .ideabug-modal-footer .ideabug-modal-meta:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ideabug-panel,
  .ideabug-modal,
  .ideabug-modal-overlay,
  .ideabug-spinner,
  .ideabug-bell-badge::after,
  .ideabug-pulse-dot::after { animation: none !important; }
  .ideabug-bell { transition: none; }
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
