/* HARNESS-ONLY STYLES — the standalone console's status bar, Settings dialog
   and Live/Demo pair, mirrored from platform-admin (dev @ b5fee1a,
   src/styles.css) value for value.

   ★ NOT IN THE FEDERATED SHEET, ON PURPOSE. This file lives in public/ and is
   linked from index.html, so Vite never bundles it and remoteEntry.js never
   names it: none of these classes (.modal, .status-bar, .chip…) can reach a
   host page. im#1220 / G12 rule 3 — harness chrome stays out of the federated
   sheet; scheduler-console #346's pattern. Uses chrome.css's tokens, which the
   harness always loads.

   platform-admin styles button / h2 / input with bare element rules; this repo
   has none (antd would inherit them), so those composites are restated here
   as scoped classes. */

/* ---- Layout: the screen plus the status bar beneath it, one column ---- */

.app-main-column {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ---- Rail foot: the Live/Demo pair (pos-ui's dev toggle, value for value) ---- */

.nav-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
}

.nav-foot {
  padding-top: 12px;
  padding-left: 6px;
}

/* Banded like the kicker: a rule above and below, centered. visibility:hidden
   in live mode hides the rules with the text while still reserving the height. */
.nav-synthetic-label {
  margin-top: 10px;
  padding: 5px 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  color: #7c3aed;
  border-top: 1px solid rgba(22, 32, 28, 0.18);
  border-bottom: 1px solid rgba(22, 32, 28, 0.18);
}

.dev-data-toggle-group {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.dev-data-toggle {
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  background: #d9d9d9;
  color: #7a6222;
  cursor: pointer;
  transition:
    background 0.15s ease,
    transform 0.15s ease;
}

.dev-data-toggle:hover {
  background: var(--gold-soft);
  transform: translateY(-1px);
}

.dev-data-toggle.active,
.dev-data-toggle.active:hover {
  /* Disabled because it's the CURRENT mode, not because it's unavailable —
     solid dark-gold, never washed out. */
  opacity: 1;
  background: var(--gold-soft);
  color: #7a6222;
  cursor: default;
  transform: none;
}

.dev-data-toggle-sep {
  color: var(--gold);
  font-size: 11px;
  opacity: 0.6;
}

/* The rail's pair, carried onto Home (right of the toolbar). */
.home-data-mode {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.home-data-mode .nav-synthetic-label {
  margin-top: 0;
  align-self: stretch;
}

.home-data-mode .dev-data-toggle-group {
  margin-top: 4px;
}

/* ---- Status bar (components/StatusBar.jsx) ---- */

.status-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: grid;
  /* Console and session, left | backend, right | the Settings gear. */
  grid-template-columns: 1fr auto auto auto;
  align-items: baseline;
  gap: 0.1rem 1rem;
  padding: 0.3rem 1rem;
  /* Gold, like the rail's dividers (pos-ui's is a light gray rule). */
  border-top: 1px solid var(--gold);
  /* Light gray, inset (founder, 2026-09-25): a status bar, not a banner. */
  background: #eceef0;
  box-shadow:
    inset 0 2px 4px -1px rgba(16, 24, 40, 0.14),
    inset 0 -1px 0 rgba(255, 255, 255, 0.7);
  color: var(--forest-deep, #14483a);
  font-size: 0.8rem;
  line-height: 1.35;
}

.status-bar-console {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.1rem 0.5rem;
}

.status-bar-name {
  font-weight: 700;
}

.status-bar-field {
  font-weight: 500;
  color: rgba(22, 32, 28, 0.72);
}

.status-bar-field::before {
  content: '·';
  margin-right: 0.5rem;
  color: rgba(22, 32, 28, 0.45);
}

.status-bar-backend {
  justify-self: end;
  text-align: right;
  font-weight: 500;
  color: rgba(22, 32, 28, 0.62);
  font-variant-numeric: tabular-nums;
}

/* Labels in gold, hosts in the bar's own ink; the mode in light blue (pos-ui's). */
.status-bar-label {
  color: var(--gold, #b08a3e);
  font-weight: 700;
}

.status-bar-label-blue {
  color: #5aaee8;
}

@media (max-width: 767px) {
  .status-bar {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .status-bar-backend {
    justify-self: center;
    text-align: center;
  }
}

/* Settings from the bar: the hosts' gray at rest, the labels' blue on hover (pos-ui's). */
.status-bar .status-bar-gear {
  align-self: center;
  display: inline-flex;
  padding: 0.15rem;
  border: 0;
  border-radius: 4px;
  background: none;
  box-shadow: none;
  color: rgba(22, 32, 28, 0.62);
  cursor: pointer;
}

.status-bar .status-bar-gear:hover,
.status-bar .status-bar-gear:focus-visible {
  transform: none;
  background: none;
  box-shadow: none;
  color: #5aaee8;
}

/* ---- Dialog (components/Modal.tsx) — pos-ui's .modal-backdrop / .modal-plain recipe ---- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(38, 42, 40, 0.58);
  backdrop-filter: grayscale(0.7) blur(1px);
}

/* Settings over the screen it was opened from: a light scrim with no greyscale, so a Display
   change shows behind it in its real colours. */
.modal-backdrop-see-through {
  padding: 0.5rem;
  background: rgba(38, 42, 40, 0.16);
  backdrop-filter: none;
}

/* Clear of the left nav (212px) on a wide screen, so the rail stays in view. */
@media (min-width: 900px) {
  .modal-backdrop-see-through {
    padding-left: calc(212px + 0.5rem);
  }
}

.modal.modal-plain {
  width: min(42rem, 100%);
  min-height: 17rem;
  max-height: 90vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.2rem 1.2rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-paper, 4px);
  box-shadow: var(--shadow);
}

.modal.modal-plain.modal-settings {
  width: min(84rem, 100%);
  height: min(56rem, 88vh);
}

.modal-settings .settings-layout {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

/* The .panel-header band, pulled to the sheet's edges — with a gold rule beneath it, matching
   the rail's dividers. */
.modal-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: -1rem -1.2rem 0.9rem;
  padding: 0.9rem 1.2rem 0.7rem;
  background:
    linear-gradient(
      0deg,
      #fcfdfb 0%,
      rgba(230, 236, 221, 0.82) 40%,
      rgba(197, 209, 180, 0.9) 100%
    ),
    url('/images/abstract-bg-white-1-thin.jpg') center/cover no-repeat;
  border-radius: var(--radius-paper, 4px) var(--radius-paper, 4px) 0 0;
  border-bottom: 1px solid var(--gold);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.modal-head-text {
  flex: 1;
}

.modal-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.modal-head .modal-close {
  border: none;
  background: transparent;
  box-shadow: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-faded);
  padding: 0 0.25rem;
}

.modal-head .modal-close:hover {
  transform: none;
  background: transparent;
  box-shadow: none;
}

.modal-actions {
  margin-top: auto;
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gold);
}

.modal-actions .modal-ok,
.modal-actions .modal-cancel {
  min-width: 8rem;
}

/* ---- Settings: the section rail beside the section (pos-ui's) ---- */

.settings-layout {
  display: flex;
  min-height: 100%;
  min-width: 0;
}

.settings-rail {
  width: 14rem;
  flex-shrink: 0;
  padding: 1.125rem 0.875rem;
  background: #fff;
  border-right: 1px solid var(--gold);
  overflow-y: auto;
}

.settings-rail-kicker {
  padding: 0 12px 10px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.09375rem;
  text-transform: uppercase;
  color: var(--ink-faded);
}

.settings-section {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid rgba(22, 32, 28, 0.15);
  border-radius: 0.625rem;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
  background: rgba(210, 218, 199, 0.12);
  box-shadow:
    0 14px 30px -12px rgba(20, 50, 41, 0.5),
    0 3px 8px -4px rgba(20, 50, 41, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition:
    transform 0.25s,
    box-shadow 0.25s,
    background 0.25s;
}

.settings-section:hover {
  transform: translateY(-2px);
}

.settings-section.is-current {
  background: var(--forest-tint);
  color: var(--forest);
  font-weight: 600;
}

.settings-section-icon {
  display: inline-flex;
  opacity: 0.7;
}

.settings-section.is-current .settings-section-icon {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .settings-section {
    transition: none;
  }
  .settings-section:hover {
    transform: none;
  }
}

.settings-rail-hint {
  margin: 0.875rem 0 0;
  padding: 0 12px;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--ink-faded);
}

.settings-content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 0 1.25rem 1.25rem;
}

.settings-content h2 {
  margin-top: 0.25rem;
}

@media (max-width: 640px) {
  .settings-layout {
    flex-direction: column;
  }
  .settings-rail {
    width: auto;
    border-right: none;
    border-bottom: 1px solid var(--gold);
  }
  .settings-content {
    padding: 1rem 0 0;
  }
}

/* ---- Settings → Display (pos-ui's switch list) ---- */

.display-settings-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  max-width: 40rem;
}

.display-setting {
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.display-setting-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  font-weight: 600;
}

.display-setting-row input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--forest);
}

.display-setting-state {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(22, 32, 28, 0.62);
}

.display-setting-note {
  margin: 0.35rem 0 0 1.7rem;
  font-size: 0.82rem;
  color: rgba(22, 32, 28, 0.7);
}

/* ---- Settings → Environment ---- */

.facts-list {
  margin: 1rem 0 0;
  max-width: 44rem;
  border-top: 1px solid var(--line);
}

.facts-row {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}

.facts-row dt {
  font-weight: 600;
  color: var(--ink-faded);
}

.facts-row dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.env-chip {
  margin-left: 8px;
}

/* ---- Small shared pieces the Settings sections use ---- */

.row-subtle {
  font-size: 0.75rem;
  color: var(--ink-faded);
}

.chip {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  vertical-align: middle;
}

.chip-neutral {
  color: var(--ink-faded);
  border-color: var(--card-border);
}

/* ---- platform-admin's element-level composites, scoped to the dialog ---- */

.modal h2,
.settings-content h2 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

/* platform-admin's bare `h2` size and foot gap, for the section headings. */
.settings-content h2 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.modal-actions .modal-ok,
.modal-actions .modal-cancel {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  /* platform-admin's bare `button` padding — the piece the size came from. */
  padding: 0.5rem 1.1rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background:
    linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.65),
        rgba(255, 255, 255, 0) 48%
      )
      padding-box,
    linear-gradient(180deg, #f7faf2 0%, #dce3d0 46%, #b9c6a8 100%) padding-box,
    linear-gradient(
        180deg,
        rgba(148, 179, 194, 0.5) 0%,
        rgba(148, 179, 194, 0.85) 40%,
        rgba(84, 116, 132, 0.9) 100%
      )
      border-box;
  color: var(--forest-deep);
  box-shadow:
    0 14px 30px -12px rgba(20, 50, 41, 0.5),
    0 3px 8px -4px rgba(20, 50, 41, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition:
    transform 0.25s,
    box-shadow 0.25s,
    background 0.25s,
    border-color 0.25s;
}

.modal-actions .modal-ok:hover,
.modal-actions .modal-cancel:hover {
  transform: translateY(-2px);
  background:
    linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.4),
        rgba(255, 255, 255, 0) 55%
      )
      padding-box,
    linear-gradient(180deg, #d2dac7 0%, #bcc9ae 50%, #a6b794 100%) padding-box,
    linear-gradient(180deg, #94b3c2 0%, #5f8296 100%) border-box;
}

/* ---- Settings → Environment: the build variables, Variable | Value ----
   Lined up with the facts list above it (founder, 2026-10-06): the same
   width, the same 14rem first column, and a visible divider under every row. */

.settings-content .facts-list,
.env-vars {
  max-width: 44rem;
}

.settings-content .facts-list {
  border-top-color: rgba(22, 32, 28, 0.16);
}

.settings-content .facts-row {
  grid-template-columns: 14rem 1fr;
  border-bottom-color: rgba(22, 32, 28, 0.16);
}

#environment-variables-heading {
  margin-top: 1.75rem;
}

.env-vars {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  table-layout: fixed;
}

.env-vars th,
.env-vars td {
  text-align: left;
}

.env-vars thead th {
  padding: 0 0 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faded);
  border-bottom: 1px solid rgba(22, 32, 28, 0.16);
}

.env-vars thead th:first-child {
  width: 14rem;
}

/* Every row gets its divider, the last one included. */
.env-vars tbody th,
.env-vars tbody td {
  padding: 0.5rem 0;
  vertical-align: middle;
  font-weight: 400;
  border-bottom: 1px solid rgba(22, 32, 28, 0.16);
}

.env-vars thead th + th,
.env-vars tbody td {
  padding-left: 1rem;
}

.env-var-name {
  display: block;
  text-align: left;
  font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.env-vars .env-var-input {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  border: 1px solid rgba(22, 32, 28, 0.2);
  border-radius: 8px;
  background: #f6f7f8;
  font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
  font-size: 0.8rem;
  color: var(--ink);
  cursor: default;
}

.env-vars .env-var-input::placeholder {
  font-family: 'Manrope', sans-serif;
  font-style: italic;
  color: #8b938e;
}

.env-vars .env-var-input:focus-visible {
  outline: none;
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(31, 74, 61, 0.15);
}

.env-vars-foot {
  margin-top: 12px;
}

/* UI-R1 version facts in the status bar. */
.status-bar-version {
  justify-self: end;
  font-weight: 500;
  color: rgba(22, 32, 28, 0.62);
  font-variant-numeric: tabular-nums;
}

.status-bar-latest {
  color: #1f7a4d;
  font-weight: 700;
}

.status-bar .status-bar-reload {
  padding: 0 6px;
  border: 1px solid #b26b00;
  border-radius: 999px;
  background: #fff6e0;
  box-shadow: none;
  color: #8a5a00;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* Settings → Environment: the Reload offer beside the published build. */
.facts-row .env-reload {
  margin-left: 4px;
  padding: 1px 8px;
  border: 1px solid #b26b00;
  border-radius: 999px;
  background: #fff6e0;
  box-shadow: none;
  color: #8a5a00;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
