/* ─── AK Chat Platform — Journey Drawer ──────────────────────────────────────
   The admin's "Log something" sheet, shown as a slide-out on the chat page.
   The detail box takes whatever height is left over, so the form fits a phone
   and a big monitor without ever scrolling Close and Save off the bottom. */

#jr-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
  z-index: 200;
}
#jr-drawer-overlay.open { opacity: 1; visibility: visible; }

#journey-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 480px;
  max-width: 100vw;
  height: 100vh;
  background: var(--secondary);
  border-left: 1px solid var(--border);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 24px rgba(0,0,0,0.4);
}
#journey-drawer.open { transform: translateX(0); }

/* ── Header ────────────────────────────────────────────────────────────────── */
#jr-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.jr-drawer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.jr-drawer-title svg { color: var(--primary); }

#jr-drawer-close {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 15px;
  transition: background var(--transition), color var(--transition);
}
#jr-drawer-close:hover { background: var(--tertiary); color: var(--text); }

#jr-month {
  text-align: right;
  padding: 12px 16px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}

/* ── The form ──────────────────────────────────────────────────────────────── */
#jr-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 14px 16px 0;
  overflow: hidden;
}

#jr-body h3 {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}

.jr-field { margin-bottom: 13px; flex-shrink: 0; }

.jr-field label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 5px;
  font-weight: 600;
}

.jr-field input,
.jr-field select,
.jr-field textarea {
  width: 100%;
  background: var(--bg-dark);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 14px;
  font-family: inherit;
}
.jr-field input:focus,
.jr-field select:focus,
.jr-field textarea:focus { outline: none; border-color: var(--primary); }

.jr-two { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }

/* The detail box swallows the leftover room, whatever the screen is. */
.jr-field-grow {
  flex: 1;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}
.jr-field-grow textarea {
  flex: 1;
  resize: none;
  line-height: 1.55;
}

/* ── Close / Save ──────────────────────────────────────────────────────────── */
#jr-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 14px 16px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  flex-shrink: 0;
}

@media (max-width: 520px) {
  #journey-drawer { width: 100vw; }
  .jr-two { grid-template-columns: 1fr; }
}
