/* -------------------------------------------------------------------------- */
/* Custom Font                                                                */
/* -------------------------------------------------------------------------- */


/* -------------------------------------------------------------------------- */
/* App-like interaction & base behaviour                                      */
/* -------------------------------------------------------------------------- */

html,
body {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  user-select: text;
  -webkit-user-select: text;
}

/* Faster tapping / reduce delay on touch devices */
* {
  touch-action: manipulation;
}

/* Remove link highlight on mobile */
a {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

/* Prevent image callout menu on iOS */
img {
  -webkit-touch-callout: none;
}

/* -------------------------------------------------------------------------- */
/* Layout                                                                     */
/* -------------------------------------------------------------------------- */

body {
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  overscroll-behavior-y: none;

  /* iOS safe area */
  /*padding-bottom: calc(40px + env(safe-area-inset-bottom));*/

  margin: 0;

  background-color: #ebe7e3;
}

footer {
  background-color: #d8d7d1 !important;
}

/* -------------------------------------------------------------------------- */
/* Selection / copy behaviour                                                 */
/* -------------------------------------------------------------------------- */

/* UI / navigation / chrome – not selectable */
.navbar,
.navbar *,
footer,
footer *,
.btn,
.btn *,
.nav-link,
.dropdown-menu,
.dropdown-menu *,
.modal-header,
.modal-footer,
.pagination,
.pagination * {
  user-select: none;
  -webkit-user-select: none;
}

/* Copy-friendly sections (About, Help, Legal, etc.)
   Wrap those pages or main sections in a .copy-friendly container */
.copy-friendly,
.copy-friendly * {
  user-select: text !important;
  -webkit-user-select: text !important;
}

/* Forms / inputs – selectable/editable (and prevent iOS zoom) */
/* Restore selectable form fields */
input,
textarea {
  font-size: 16px;
  -webkit-appearance: none;
  border-radius: 12px;
}

select {
  font-size: 16px;
}

/* -------------------------------------------------------------------------- */
/* Motion, press effects, accessibility                                       */
/* -------------------------------------------------------------------------- */

/* Buttons always feel interactive */
.btn {
  transform-origin: center;
  transition: transform 0.1s ease;
}

.btn:active {
  transform: scale(0.98);
}

/* Cards are NON-interactive by default */
.card {
  cursor: default;
}

/* Linked / button-wrapped cards are interactive */
a .card,
a.card,
button .card,
button.card {
  cursor: pointer;
  transform-origin: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

/* Subtle hover affordance (desktop pointer only) */
@media (hover: hover) and (pointer: fine) {
  a:hover .card,
  a:hover.card,
  button:hover .card,
  button:hover.card {
    transform: translateY(-4px) rotate(0.5deg);
    box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.1);
  }
}

/* Press feedback for linked cards */
a:active .card,
a:active.card,
button:active .card,
button:active.card {
  transform: scale(0.99);
}

/* Keyboard focus (accessibility) */
a:focus-visible .card,
a:focus-visible.card,
button:focus-visible .card,
button:focus-visible.card {
  outline: 2px solid #0c5b8e;
  outline-offset: 4px;
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .btn:active,
  a:active .card,
  a:active.card,
  button:active .card,
  button:active.card {
    transform: none !important;
  }
}

/* -------------------------------------------------------------------------- */
/* Navbar                                                                     */
/* -------------------------------------------------------------------------- */

.navbar-toggler {
  border-style: none;
}

/* -------------------------------------------------------------------------- */
/* Typography & brand                                                         */
/* -------------------------------------------------------------------------- */

.form-label {
  font-weight: 600;
}

/* Ensure inline forms don't affect button sizing */
form.d-inline {
  margin: 0;
  padding: 0;
  line-height: inherit;
}

form.d-inline button {
  vertical-align: middle;
}

/* -------------------------------------------------------------------------- */
/* Colour system & buttons                                                    */
/* -------------------------------------------------------------------------- */

/* Text colours */
.text-primary {
  color: #1437B1 !important;
}

.text-success {
  color: #377E4F !important;
}

.text-danger {
  color: #C13035 !important;
}

/* Primary links */
.link-primary {
  color: #1D47DB !important;
  text-decoration: underline;
  text-decoration-color: #1D47DB !important;
  text-underline-offset: 2px;
}

.link-primary:hover,
.link-primary:focus {
  color: #1437B1 !important;
  text-decoration-color: #1437B1 !important;
}

/* Primary buttons */
.btn-primary {
  background-color: #1D47DB !important;
  border-color: #1D47DB !important;
  color: #ffffff !important;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #1437B1 !important;
  border-color: #1437B1 !important;
  color: #ffffff !important;
}

.btn-outline-primary {
  color: #1D47DB !important;
  border-color: #1D47DB !important;
  background-color: transparent !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background-color: #1D47DB !important;
  border-color: #1D47DB !important;
  color: #ffffff !important;
}

/* Success buttons */
.btn-success {
  background-color: #479E63 !important;
  border-color: #479E63 !important;
  color: #ffffff !important;
}

.btn-success:hover,
.btn-success:focus {
  background-color: #377E4F !important;
  border-color: #377E4F !important;
  color: #ffffff !important;
}

.btn-outline-success {
  color: #479E63 !important;
  border-color: #479E63 !important;
  background-color: transparent !important;
}

.btn-outline-success:hover,
.btn-outline-success:focus {
  background-color: #377E4F !important;
  border-color: #377E4F !important;
  color: #ffffff !important;
}

/* Danger buttons */
.btn-danger {
  background-color: #D7353A !important;
  border-color: #D7353A !important;
  color: #ffffff !important;
}

.btn-danger:hover,
.btn-danger:focus {
  background-color: #C13035 !important;
  border-color: #C13035 !important;
  color: #ffffff !important;
}

.btn-outline-danger {
  color: #D7353A !important;
  border-color: #D7353A !important;
  background-color: transparent !important;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
  background-color: #C13035 !important;
  border-color: #C13035 !important;
  color: #ffffff !important;
}

/* -------------------------------------------------------------------------- */
/* Panels / cards / backgrounds                                               */
/* -------------------------------------------------------------------------- */

.bg-card-custom {
  background-color: #f5f3ef;
}

.bg-label-custom {
  background-color: #f5f3ef;
}

.bg-custom {
  background-color: #dcd8ce !important;
}

.text-custom {
  color: #dcd8ce;
}

.panel {
  background-color: #e2ddd7;
}

.section-panel {
  background-color: #f3f1ee;
}

.action-panel {
  background-color: #e3ddd8;
}

.dark-panel {
  background-color: #484847;
}

.ai-panel {
  background-color: #cedee8;
  border: 1px solid #9dbdd1;
}

.playbook-panel {
  background-color: #e3e8df;
  border: 1px solid #c8d3c1;
}

/* -------------------------------------------------------------------------- */
/* Activity Stream Styling
/* -------------------------------------------------------------------------- */

.activity-icon-badge {
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 999px;
  background: rgba(108, 117, 125, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.activity-icon-glyph {
  font-size: 1.5rem;
  line-height: 1;
  display: inline-block;
}

/* -------------------------------------------------------------------------- */
/* Report Content Styling                                                     */
/* -------------------------------------------------------------------------- */

.report-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.report-content h3 {
  margin-top: 2rem;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.report-content h4 {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.report-content p {
  margin-bottom: 1rem;
}

.report-content ul {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.report-content li {
  margin-bottom: 0.5rem;
}

/* -------------------------------------------------------------------------- */
/* Markdown rendered content                                                  */
/* -------------------------------------------------------------------------- */

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.markdown-content h1 { font-size: 1.5rem; }
.markdown-content h2 { font-size: 1.35rem; }
.markdown-content h3 { font-size: 1.2rem; }

.markdown-content p {
  margin-bottom: 0.75rem;
}

.markdown-content ul,
.markdown-content ol {
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
}

.markdown-content li {
  margin-bottom: 0.35rem;
}

.markdown-content blockquote {
  border-left: 3px solid #dee2e6;
  padding: 0.5rem 1rem;
  margin: 0.75rem 0;
  color: #6c757d;
}

.markdown-content pre {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  overflow-x: auto;
}

.markdown-content code {
  font-size: 0.875em;
}

.markdown-content p code {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  padding: 0.125rem 0.375rem;
}

.markdown-content hr {
  margin: 1rem 0;
  border: 0;
  border-top: 1px solid #dee2e6;
}

.markdown-content table {
  width: 100%;
  margin-bottom: 0.75rem;
  border-collapse: collapse;
}

.markdown-content th,
.markdown-content td {
  border: 1px solid #dee2e6;
  padding: 0.5rem 0.75rem;
}

.markdown-content th {
  background-color: #f8f9fa;
  font-weight: 600;
}

.markdown-content > *:last-child {
  margin-bottom: 0;
}