.bo-drawer {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
}

.bo-drawer.is-open {
  display: block;
}

.bo-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.44);
}

.bo-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(720px, 100%);
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(251, 252, 255, 0.98), rgba(244, 246, 255, 0.98));
  border-left: 1px solid var(--bo-line);
  box-shadow: var(--bo-shell-shadow);
}

.bo-drawer__head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  padding: 18px 22px 16px;
  border-bottom: 1px solid var(--bo-line);
  background: rgba(251, 252, 255, 0.92);
  backdrop-filter: blur(24px);
}

.bo-drawer__head-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.bo-drawer__head-copy {
  min-width: 0;
}

.bo-drawer__title {
  margin: 0;
  font-family: var(--bo-font-display);
  font-size: 24px;
}

.bo-drawer__sub {
  margin: 6px 0 0;
  color: var(--bo-muted);
}

.bo-drawer__close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--bo-line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--bo-ink);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
}

.bo-drawer__close svg {
  width: 18px;
  height: 18px;
}

.bo-drawer__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bo-drawer__body > * {
  flex: 0 0 auto;
  min-height: max-content;
}

.bo-drawer__section {
  display: grid;
  gap: 12px;
}

.bo-drawer__section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.bo-drawer__section-title {
  margin: 0;
  color: var(--bo-muted);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}

.bo-drawer__grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bo-drawer__grid--stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.bo-drawer__card {
  padding: 18px;
  border: 1px solid var(--bo-line);
  border-radius: 18px;
  background: var(--bo-panel-soft);
}

.bo-drawer__card strong {
  display: block;
}

.bo-drawer__card--wide {
  margin-top: 0;
}

.bo-drawer__copy {
  margin-top: 8px;
  line-height: 1.55;
}

.bo-drawer__value {
  margin-top: 10px;
  color: var(--bo-muted);
  line-height: 1.55;
}

.bo-drawer__stack {
  display: grid;
  gap: 12px;
}

.bo-drawer__hero {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--bo-line);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(91, 124, 250, 0.08), transparent 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(247, 249, 255, 0.98));
  box-shadow: 0 22px 40px rgba(32, 52, 124, 0.07);
}

.bo-drawer__hero-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.bo-drawer__hero-title {
  font-family: var(--bo-font-display);
  font-size: 24px;
  line-height: 1.08;
}

.bo-drawer__hero-meta {
  margin-top: 6px;
  color: var(--bo-muted);
  line-height: 1.5;
}

.bo-drawer__pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bo-drawer__fact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.bo-drawer__fact {
  padding: 14px 16px;
  border: 1px solid var(--bo-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
}

.bo-drawer__fact-label {
  display: block;
  color: var(--bo-muted);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}

.bo-drawer__fact-value {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
}

.bo-drawer__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.bo-drawer__toolbar .bo-btn-secondary,
.bo-drawer__toolbar .bo-btn,
.bo-drawer__actions .bo-btn-secondary {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border-color: var(--bo-line);
  background: rgba(255, 255, 255, 0.94);
  color: var(--bo-ink);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
}

.bo-drawer__toolbar .bo-btn-secondary:hover,
.bo-drawer__toolbar .bo-btn:hover,
.bo-drawer__actions .bo-btn-secondary:hover,
.bo-drawer__close:hover {
  transform: translateY(-1px);
}

.bo-drawer__toolbar .bo-btn {
  border-color: rgba(17, 17, 17, 0.08);
  background: linear-gradient(180deg, #171717 0%, #0f0f10 100%);
  color: #ffffff;
  box-shadow: 0 14px 26px rgba(17, 17, 17, 0.16);
}

.bo-drawer__toolbar .bo-btn:disabled,
.bo-drawer__toolbar .bo-btn-secondary:disabled,
.bo-drawer__actions .bo-btn-secondary:disabled {
  box-shadow: none;
}

.bo-drawer__fold {
  border: 1px solid var(--bo-line);
  border-radius: 22px;
  background: var(--bo-panel-soft);
  overflow: hidden;
}

.bo-drawer__fold-summary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.bo-drawer__fold-summary::after {
  content: '+';
  color: var(--bo-muted);
  font-size: 20px;
  line-height: 1;
}

.bo-drawer__fold.is-open .bo-drawer__fold-summary::after {
  content: '−';
}

.bo-drawer__fold-meta {
  margin-top: 6px;
  color: var(--bo-muted);
  font-size: 13px;
}

.bo-drawer__fold-body {
  display: none;
  padding: 12px 18px 18px;
  border-top: 1px solid var(--bo-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(247, 249, 255, 0.94));
}

.bo-drawer__fold.is-open .bo-drawer__fold-body {
  display: block;
}

.bo-drawer__rows {
  display: grid;
  gap: 10px;
}

.bo-drawer__row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border: 1px solid var(--bo-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
}

.bo-drawer__row-main {
  display: grid;
  gap: 4px;
  max-width: 52%;
}

.bo-drawer__row-label {
  color: var(--bo-muted);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}

.bo-drawer__row-subtext {
  color: var(--bo-muted);
  font-size: 13px;
  line-height: 1.45;
}

.bo-drawer__row-value {
  text-align: right;
  color: var(--bo-ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

.bo-drawer__row-value--stack {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.bo-drawer__row-copy {
  margin-top: 6px;
  color: var(--bo-muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.bo-drawer__inline-block {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--bo-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
}

.bo-drawer__note-card {
  padding: 16px 18px;
  border: 1px solid var(--bo-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
}

.bo-drawer__note-meta {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--bo-muted);
}

.bo-drawer__note-body {
  margin-top: 10px;
  color: var(--bo-ink);
  line-height: 1.6;
}

.bo-drawer__composer {
  padding: 18px;
  border: 1px solid var(--bo-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
}

.bo-drawer__field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--bo-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.bo-drawer__textarea {
  width: 100%;
  min-height: 116px;
  padding: 14px;
  border: 1px solid var(--bo-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--bo-ink);
  resize: vertical;
}

.bo-drawer__composer-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
  gap: 10px;
  flex-wrap: wrap;
}

.bo-drawer__timeline {
  display: grid;
  gap: 10px;
}

.bo-drawer__timeline-item {
  padding: 14px 16px;
  border: 1px solid var(--bo-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
}

.bo-drawer__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--bo-line);
  background: rgba(251, 252, 255, 0.92);
  backdrop-filter: blur(24px);
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .bo-drawer__fact-grid,
  .bo-drawer__grid--stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .bo-drawer__hero-head,
  .bo-drawer__row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .bo-drawer__row-main,
  .bo-drawer__row-value {
    max-width: none;
    text-align: left;
  }

  .bo-drawer__row-value--stack {
    justify-items: start;
  }

  .bo-drawer__fact-grid,
  .bo-drawer__grid,
  .bo-drawer__grid--stats {
    grid-template-columns: 1fr;
  }
}

.bo-link {
  color: var(--bo-accent-strong);
  font-weight: 700;
  text-decoration: none;
}

.bo-link:hover {
  text-decoration: underline;
}
