/* Terminal mode + shared module chrome.
   Linked after style.css. Palette/type from existing variables only. */

/* ---------------------------------------------------------------- docks */

.dock {
  position: absolute;
  z-index: 20;
  font-size: 13px;
  line-height: 1.35;
  background: var(--panel);
  border: 1px solid var(--rule);
  color: var(--ink);
}

/* ---------------------------------------------------------- top-bar tools */

.tb-btn {
  appearance: none;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1.2;
  padding: 2px 8px;
  border: 1px solid var(--rule);
  border-radius: 0;
  color: var(--steel);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}

.tb-btn.is-on {
  border-color: var(--flare);
  color: var(--flare);
}

/* ---------------------------------------------- selection fallbacks */

.sel-toggle {
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  vertical-align: middle;
  accent-color: var(--steel);
  cursor: pointer;
}

.is-selected {
  outline: 1px solid var(--flare);
}

/* ======================================================= body.terminal */

body.terminal #board {
  display: block;
}

body.terminal #right {
  position: fixed;
  inset: 48px 0 0 0;
}

body.terminal #map {
  height: 100%;
}

body.terminal #left {
  position: fixed;
  left: 0;
  top: 48px;
  bottom: 0;
  width: 400px;
  overflow: auto;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border-right: 1px solid var(--rule);
  z-index: 15;
}

body.terminal .map-panel,
body.terminal .dock {
  z-index: 20;
}

/* ---------------------------------------------------------------- top bar */

body.terminal #topbar {
  flex: 0 0 40px;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  font-size: 11px;
  flex-wrap: nowrap;
  overflow: hidden;
}

body.terminal .tb-block {
  padding: 4px 10px;
  gap: 0;
}

body.terminal .wordmark {
  font-size: 13px;
}

body.terminal .tb-clock #clock {
  font-size: 12px;
}

body.terminal .tb-quotes {
  flex: 1 1 auto;
  flex-basis: auto;
  border-top: none;
  overflow: hidden;
}

body.terminal .ticker {
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
}

body.terminal .quote .q-name,
body.terminal .quote .q-val {
  font-size: 10px;
}

/* -------------------------------------------------------- denser panels */

body.terminal .panel {
  margin: 0;
}

body.terminal .panel-head {
  padding: 4px 10px;
}

body.terminal .empty {
  padding: 8px 10px;
}

/* --------------------------------------------------------- denser cards */

body.terminal .card {
  padding: 6px 10px 5px;
  font-size: 12px;
  line-height: 1.35;
}

body.terminal .card-head {
  gap: 6px;
  margin-bottom: 1px;
}

body.terminal .theater {
  font-size: 13px;
}

body.terminal .card-title {
  margin: 0 0 4px;
  font-size: 12px;
}

body.terminal .line {
  margin: 0 0 2px;
  font-size: 11px;
}

body.terminal .interp {
  margin: 4px 0;
  padding-left: 7px;
}

body.terminal .interp .headline {
  font-size: 12px;
  margin: 0 0 2px;
}

body.terminal .interp p {
  margin: 0 0 2px;
  font-size: 12px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow: hidden;
}

body.terminal .card:hover .interp p,
body.terminal .card:focus-within .interp p {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
}

body.terminal .conj {
  margin: 4px 0 3px;
  padding: 5px 7px;
}

body.terminal .alert {
  padding: 3px 10px;
  font-size: 11px;
}

body.terminal #market-table {
  font-size: 11px;
}

body.terminal #market-table th,
body.terminal #market-table td {
  padding: 3px 10px;
}

/* --------------------------------------------------------------- #keys */

body.terminal #keys {
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 21;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  padding: 4px 10px;
  pointer-events: none;
}

/* -------------------------------------------------------------- 1100px */

@media (max-width: 1100px) {
  body.terminal #left {
    width: 320px;
  }
}

/* ------------------------------------------------------ reduced motion */

@media (prefers-reduced-motion: reduce) {
  body.terminal .interp p,
  body.terminal .card:hover .interp p,
  body.terminal .card:focus-within .interp p {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    overflow: visible;
  }
}
