/* ========================================
   Standard Kepler — Bloomberg Terminal Style
   Black and white only. Monospace. High contrast.
   ======================================== */

:root {
  --term-bg: #000000;
  --term-fg: #ffffff;
  --term-dim: #aaaaaa;
  --term-muted: #777777;
  --term-border: #333333;
  --term-border-light: #555555;
  --term-highlight: #ffffff;
  --term-font: 'JetBrains Mono', 'Consolas', 'Monaco', 'Courier New', monospace;

  --term-bar-height: 32px;
  --term-pad: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.bloomberg-terminal {
  margin: 0;
  padding: 0;
  font-family: var(--term-font);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--term-fg);
  background-color: var(--term-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection {
  background-color: var(--term-fg);
  color: var(--term-bg);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--term-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--term-border);
  border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--term-border-light);
}

/* Top / Bottom Bars */
.terminal-bar {
  height: var(--term-bar-height);
  background-color: var(--term-bg);
  border-color: var(--term-border);
  border-style: solid;
  display: flex;
  align-items: center;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: fixed;
  left: 0;
  right: 0;
  z-index: 100;
}

.terminal-bar--top {
  top: 0;
  border-bottom-width: 1px;
}

.terminal-bar--bottom {
  bottom: 0;
  border-top-width: 1px;
}

.terminal-bar .container-fluid {
  padding-left: var(--term-pad);
  padding-right: var(--term-pad);
}

/* Top Menu Bar */
.terminal-menu-bar {
  position: fixed;
  top: var(--term-bar-height);
  left: 0;
  right: 0;
  height: var(--term-bar-height);
  background-color: var(--term-bg);
  border-bottom: 1px solid var(--term-border);
  z-index: 99;
  display: flex;
  align-items: center;
}

.terminal-menu-bar .container-fluid {
  padding-left: var(--term-pad);
  padding-right: var(--term-pad);
}

.terminal-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
  width: 100%;
}

.terminal-menu__item {
  position: relative;
}

.terminal-menu__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--term-dim);
  text-decoration: none;
  transition: color 150ms ease, background-color 150ms ease;
  border: 1px solid transparent;
}

.terminal-menu__link:hover,
.terminal-menu__link:focus-visible,
.terminal-menu__link.is-active {
  color: #000000;
  background-color: #ffffff;
  border-color: #ffffff;
}

.terminal-menu__dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 260px;
  background-color: var(--term-bg);
  border: 1px solid var(--term-border);
  list-style: none;
  padding: 6px;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 150ms ease, transform 150ms ease, visibility 150ms;
  z-index: 120;
}

.terminal-menu__item:hover .terminal-menu__dropdown,
.terminal-menu__item:focus-within .terminal-menu__dropdown,
.terminal-menu__item.is-open .terminal-menu__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.terminal-menu__dropdown li {
  margin-bottom: 2px;
}

.terminal-menu__dropdown li:last-child {
  margin-bottom: 0;
}

.terminal-menu__dropdown a {
  display: block;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--term-dim);
  text-decoration: none;
  transition: color 150ms ease, background-color 150ms ease;
}

.terminal-menu__dropdown a:hover,
.terminal-menu__dropdown a:focus-visible {
  color: #000000;
  background-color: #ffffff;
}

/* Mobile Menu */
@media (max-width: 767.98px) {
  .terminal-menu {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .terminal-menu::-webkit-scrollbar {
    display: none;
  }

  .terminal-menu__link {
    white-space: nowrap;
  }

  .terminal-menu__dropdown {
    position: fixed;
    top: calc(var(--term-bar-height) * 2);
    left: 0;
    right: 0;
    width: 100%;
    min-width: auto;
    border-left: none;
    border-right: none;
    border-top: 1px solid var(--term-border);
  }
}

.terminal-label {
  color: var(--term-muted);
}

.terminal-value {
  color: var(--term-fg);
  font-weight: 600;
  margin-left: 6px;
}

.terminal-title {
  color: var(--term-fg);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.terminal-separator {
  color: var(--term-muted);
  margin: 0 8px;
}

/* Main Content */
.terminal-main {
  flex: 1;
  padding-top: calc((var(--term-bar-height) * 2) + var(--term-pad));
  padding-bottom: calc(var(--term-bar-height) + var(--term-pad));
}

.terminal-main .container-fluid {
  padding-left: var(--term-pad);
  padding-right: var(--term-pad);
}

.terminal-section {
  margin-bottom: 18px;
}

.terminal-section--last {
  margin-bottom: 0;
}

/* Panels */
.terminal-panel {
  border: 1px solid var(--term-border);
  background-color: var(--term-bg);
}

.terminal-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--term-border);
  background-color: rgba(255, 255, 255, 0.03);
}

.terminal-panel__label {
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--term-fg);
}

.terminal-panel__status {
  font-size: 11px;
  color: var(--term-muted);
  letter-spacing: 0.04em;
}

.terminal-panel__body {
  padding: 16px;
  margin: 0;
  color: var(--term-dim);
}

.terminal-panel__body--lead {
  color: var(--term-fg);
  font-size: 15px;
  line-height: 1.6;
}

.terminal-panel__body a {
  color: var(--term-fg);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.terminal-panel__body a:hover,
.terminal-panel__body a:focus-visible {
  color: var(--term-dim);
}

/* Prompt */
.terminal-prompt {
  padding: 10px 12px;
  border: 1px solid var(--term-border);
  background-color: var(--term-bg);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
}

.terminal-prompt__user {
  color: var(--term-fg);
  font-weight: 700;
}

.terminal-prompt__path {
  color: var(--term-muted);
}

.terminal-prompt__cursor {
  color: var(--term-fg);
  font-weight: 700;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.terminal-prompt__type {
  color: var(--term-dim);
}

.terminal-prompt__input {
  color: var(--term-fg);
  outline: none;
  min-width: 120px;
  flex: 1;
  caret-color: var(--term-fg);
}

.terminal-prompt__input:empty::before {
  content: '_';
  color: var(--term-muted);
}

/* Data Cells */
.terminal-data-row {
  border-bottom: 1px solid var(--term-border);
}

.terminal-data-cell {
  padding: 14px 12px;
  border-right: 1px solid var(--term-border);
  border-bottom: 1px solid var(--term-border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.terminal-data-cell:nth-child(2n) {
  border-right: none;
}

@media (min-width: 768px) {
  .terminal-data-cell:nth-child(2n) {
    border-right: 1px solid var(--term-border);
  }
  .terminal-data-cell:nth-child(3n) {
    border-right: none;
  }
}

@media (min-width: 992px) {
  .terminal-data-cell:nth-child(3n) {
    border-right: 1px solid var(--term-border);
  }
  .terminal-data-cell:nth-child(6n) {
    border-right: none;
  }
}

.terminal-data-cell__label {
  font-size: 11px;
  color: var(--term-muted);
  letter-spacing: 0.05em;
}

.terminal-data-cell__value {
  font-size: 16px;
  font-weight: 700;
  color: var(--term-fg);
}

.terminal-data-cell__change {
  font-size: 11px;
  letter-spacing: 0.02em;
}

.terminal-data-cell__change--up {
  color: var(--term-fg);
}

.terminal-data-cell__change--up::before {
  content: '+';
  display: none;
}

.terminal-data-cell__change--down {
  color: var(--term-dim);
}

/* Tables */
.terminal-table-wrap {
  overflow-x: auto;
}

.terminal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.terminal-table thead th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--term-border);
  color: var(--term-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: 11px;
  white-space: nowrap;
}

.terminal-table tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--term-dim);
  vertical-align: top;
}

.terminal-table tbody tr:hover td {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--term-fg);
}

.terminal-table tbody tr:last-child td {
  border-bottom: none;
}

.terminal-table tbody td a {
  color: var(--term-fg);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.terminal-table tbody td a:hover,
.terminal-table tbody td a:focus-visible {
  color: var(--term-dim);
}

.terminal-status--draft {
  color: var(--term-muted);
}

/* Panel Subsections */
.terminal-panel__subheader {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid var(--term-border);
  border-bottom: 1px solid var(--term-border);
  background-color: rgba(255, 255, 255, 0.02);
}

.terminal-section-divider {
  height: 1px;
  background-color: var(--term-border);
  margin: 0;
}

/* Service Cards */
.terminal-card {
  border: 1px solid var(--term-border);
  padding: 16px;
  height: 100%;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.terminal-card:hover {
  border-color: var(--term-border-light);
  background-color: rgba(255, 255, 255, 0.03);
}

.terminal-card__id {
  font-size: 11px;
  color: var(--term-muted);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.terminal-card__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--term-fg);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.terminal-card__desc {
  color: var(--term-dim);
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 14px;
}

.terminal-card__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.terminal-card__list li {
  position: relative;
  padding-left: 14px;
  color: var(--term-dim);
  font-size: 12px;
  line-height: 1.8;
}

.terminal-card__list li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--term-muted);
}

.terminal-card__link {
  display: inline-block;
  margin-top: 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--term-fg);
  text-decoration: none;
  border: 1px solid var(--term-border);
  padding: 6px 12px;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.terminal-card__link:hover,
.terminal-card__link:focus-visible {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: var(--term-border-light);
}

/* Approach Steps */
.terminal-step {
  border-left: 2px solid var(--term-border-light);
  padding-left: 14px;
  margin-bottom: 8px;
}

.terminal-step__num {
  font-size: 11px;
  font-weight: 700;
  color: var(--term-muted);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.terminal-step__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--term-fg);
  margin-bottom: 4px;
}

.terminal-step__desc {
  font-size: 12px;
  color: var(--term-dim);
  line-height: 1.5;
}

/* Article Body List */
.terminal-body-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}

.terminal-body-list li {
  position: relative;
  padding-left: 18px;
  color: var(--term-dim);
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 8px;
}

.terminal-body-list li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--term-muted);
}

/* Tags */
.terminal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px;
}

.terminal-tag {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--term-dim);
  border: 1px solid var(--term-border);
  border-radius: 3px;
  padding: 4px 8px;
}

/* Navigation */
.terminal-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px;
}

.terminal-nav__link {
  font-size: 13px;
  font-weight: 600;
  color: var(--term-fg);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 150ms ease;
}

.terminal-nav__link:hover,
.terminal-nav__link:focus-visible {
  color: var(--term-muted);
}

/* Headlines Ticker */
.terminal-ticker {
  overflow: hidden;
  white-space: nowrap;
  padding: 12px;
  border-top: 1px solid var(--term-border);
  background-color: rgba(255, 255, 255, 0.02);
}

.terminal-ticker__track {
  display: inline-block;
  animation: ticker 60s linear infinite;
}

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.terminal-ticker__item {
  display: inline-block;
  padding-right: 48px;
  color: var(--term-dim);
  font-size: 12px;
}

.terminal-ticker__item::before {
  content: '//';
  color: var(--term-muted);
  margin-right: 8px;
}

.terminal-ticker:hover .terminal-ticker__track {
  animation-play-state: paused;
}

/* Contact Info */
.terminal-info {
  padding: 16px;
}

.terminal-info__row {
  display: flex;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.terminal-info__row:last-child {
  border-bottom: none;
}

.terminal-info__key {
  min-width: 80px;
  color: var(--term-muted);
  font-size: 11px;
  letter-spacing: 0.05em;
}

.terminal-info__value {
  color: var(--term-fg);
}

.terminal-info__value a {
  color: var(--term-fg);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.terminal-info__value a:hover,
.terminal-info__value a:focus-visible {
  color: var(--term-dim);
}

/* Form */
.terminal-form {
  padding: 16px;
}

.terminal-form__field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.terminal-form__label {
  color: var(--term-dim);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.terminal-form__checkbox {
  appearance: none;
  width: 14px;
  height: 14px;
  border: 1px solid var(--term-border-light);
  background: var(--term-bg);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.terminal-form__checkbox:checked {
  background: var(--term-fg);
  border-color: var(--term-fg);
}

.terminal-form__checkbox:checked::after {
  content: 'X';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--term-bg);
  font-size: 10px;
  font-weight: 700;
}

.terminal-form__actions {
  margin-top: 16px;
}

.terminal-btn {
  display: inline-block;
  padding: 8px 18px;
  border: 1px solid var(--term-fg);
  background: var(--term-bg);
  color: var(--term-fg);
  font-family: var(--term-font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  text-transform: uppercase;
  transition: background-color 150ms ease, color 150ms ease;
}

.terminal-btn:hover,
.terminal-btn:focus-visible {
  background: var(--term-fg);
  color: var(--term-bg);
}

.terminal-form__output {
  margin-top: 14px;
  color: var(--term-dim);
  font-size: 12px;
  min-height: 18px;
}

/* Focus States */
a:focus-visible,
button:focus-visible,
input:focus-visible,
[contenteditable]:focus-visible {
  outline: 2px solid var(--term-fg);
  outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .terminal-ticker__track {
    animation: none;
    white-space: normal;
  }

  .terminal-ticker__item {
    display: block;
    padding: 4px 0;
    white-space: normal;
  }

  .terminal-prompt__cursor {
    animation: none;
  }
}

/* Small screen adjustments */
@media (max-width: 575.98px) {
  body.bloomberg-terminal {
    font-size: 12px;
  }

  .terminal-data-cell__value {
    font-size: 14px;
  }

  .terminal-panel__body--lead {
    font-size: 13px;
  }

  .terminal-card__title {
    font-size: 14px;
  }
}
