:root {
  font:
    14px system-ui,
    sans-serif;
  color: #dbe5f3;
  background: #0c1220;
  color-scheme: dark;
  --line: #29364d;
  --muted: #94a5bd;
  --accent: #7ce0c3;
  --ansible: #38bdf8;
  --condition: #fbbf24;
  --input: #c084fc;
  --message: #94a3b8;
  --auto: #34d399;
  --notify: #f43f5e;
  --portal: #2dd4bf;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 12px;
  background: #1b2940;
  color: #e4edf8;
}
button:hover {
  background: #304260;
}
button.primary {
  background: #79dfc2;
  color: #102621;
  border: 0;
  font-weight: 700;
}
button.danger {
  color: #ffabae;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
input,
select,
textarea {
  width: 100%;
  background: #101a2b;
  color: #eef4ff;
  border: 1px solid #34435d;
  border-radius: 6px;
  padding: 9px;
}
textarea {
  min-height: 76px;
  resize: vertical;
}
label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 12px 0 5px;
}
h1 {
  font-size: 25px;
  margin: 0 0 8px;
}
h2 {
  font-size: 17px;
}
p {
  line-height: 1.6;
  color: var(--muted);
}
#app {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 210px;
  flex: none;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 12px;
  border-right: 1px solid var(--line);
  background: #111b2c;
  overflow-y: auto;
}
.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-fold {
  background: none;
  border: 0;
  padding: 2px 8px;
  color: var(--muted);
}
/* Folded: a thin strip with the unfold button, leaving the width to wide pages like the editor. */
body.nav-folded .sidebar {
  width: 40px;
  padding: 20px 4px;
}
body.nav-folded .sidebar > :not(.sidebar-top),
body.nav-folded .brand {
  display: none;
}
body.nav-folded .sidebar-top {
  justify-content: center;
}
.brand {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.6px;
  padding: 0 10px;
}
.brand span {
  color: var(--accent);
}
nav {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}
.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #6b7d97;
  padding: 0 10px 4px;
}
.sidebar a {
  display: block;
  padding: 8px 10px;
  border-radius: 7px;
  color: #a7b7cf;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar a:hover {
  background: #1b2940;
  color: #e4edf8;
}
.sidebar a.active {
  color: #7ce0c3;
  background: #1b3437;
}
.sidebar-user {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.content {
  flex: 1;
  min-width: 0;
}
.page {
  padding: 24px;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.toolbar h1 {
  flex: 0 1 auto;
  margin-right: auto;
  white-space: nowrap;
}
/* Buttons keep their labels; when the row is full they move to the next line instead of shrinking. */
.toolbar {
  flex-wrap: wrap;
}
.toolbar button {
  white-space: nowrap;
}
.toolbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
/* The editor fills the screen: the toolbar takes what it needs, the columns get the rest. */
.page.editor-page {
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.editor-page > .workspace {
  flex: 1;
  height: auto;
  min-height: 450px;
}
.workspace {
  --side-w: 240px;
  --insp-w: 360px;
  display: grid;
  grid-template-columns: var(--side-w) 12px minmax(320px, 1fr);
  height: calc(100vh - 110px);
  min-height: 550px;
}
.workspace.has-inspector {
  grid-template-columns: var(--side-w) 12px minmax(320px, 1fr) 12px var(--insp-w);
}
.workspace:not(.has-inspector) > #inspector,
.workspace:not(.has-inspector) > .col-resize-insp {
  display: none;
}
/* Drag handle between columns: a thin line that lights up on hover, drag and keyboard focus. */
.col-resize {
  cursor: col-resize;
  position: relative;
  touch-action: none;
}
.col-resize::after {
  content: "";
  position: absolute;
  inset: 8px 5px;
  border-radius: 2px;
}
.col-resize:hover::after,
.col-resize:focus-visible::after,
.col-resize.dragging::after {
  background: var(--accent);
}
.col-resize:focus-visible {
  outline: none;
}
.inspector-close {
  margin-left: auto;
  background: none;
  border: 0;
  padding: 4px 8px;
  color: var(--muted);
}
.panel {
  background: #121d2e;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  overflow: auto;
}
.panel h2 {
  margin: 0 0 12px;
}
.hint {
  font-size: 13px;
  color: var(--muted);
}
.warn {
  padding: 12px 25px;
  background: #503c17;
  color: #ffdc94;
}
.login-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.login {
  width: 380px;
  max-width: 100%;
  margin-bottom: 8vh;
  padding: 30px;
  background: #141f31;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.login-brand {
  font-size: 26px;
  padding: 0;
}
.login-subtitle {
  margin: 4px 0 18px;
}
.login .hint {
  margin: 6px 0 0;
}
.login-error {
  margin: 16px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #3a1d24;
  color: #ffabae;
  line-height: 1.4;
}
.login button {
  margin-top: 20px;
  width: 100%;
}
#toast {
  display: none;
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  background: #31405a;
  border: 1px solid #6e88ae;
  border-radius: 8px;
  max-width: 600px;
  padding: 15px;
  white-space: pre-wrap;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 18px;
}
.card {
  background: #141f31;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.row > * {
  flex: 1;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}
.check input {
  width: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
}
td,
th {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 13px;
}
th {
  color: var(--muted);
}
.badge {
  font-size: 12px;
  background: #26394b;
  padding: 4px 7px;
  border-radius: 4px;
}
.success {
  color: #8ce0b7;
}
.failed,
.interrupted {
  color: #ffb1a9;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  max-width: 650px;
}
.small {
  font-size: 13px;
}
.button-edit {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  margin-top: 12px;
}
dialog {
  background: #152136;
  color: #e4edf8;
  border: 1px solid #405571;
  border-radius: 12px;
  width: 620px;
  max-width: 90vw;
}
.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.dialog-close {
  flex: none;
  margin-top: 14px;
  padding: 4px 10px;
  background: none;
  color: var(--muted);
}
.dialog-close:hover {
  color: #fff;
}
dialog::backdrop {
  background: #0009;
}
.empty {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}
@media (max-width: 1100px) {
  .workspace {
    --side-w: 200px;
    --insp-w: 300px;
  }
  .page {
    padding: 12px;
  }
}

.runs-table {
  table-layout: fixed;
}
.runs-table td,
.runs-table th {
  overflow-wrap: anywhere;
}
.runs-table .badge {
  display: inline-block;
}
.run-history .runs-table th:nth-child(1) {
  width: 44px;
}
.run-history .runs-table th:nth-child(2) {
  width: 170px;
}
.run-history .runs-table th:nth-child(4) {
  width: 170px;
}
.run-history .runs-table th:nth-child(5) {
  width: 130px;
}
.run-history .runs-table th:nth-child(6) {
  width: 140px;
}
.run-row {
  cursor: pointer;
}
.run-row:hover,
.run-row.open {
  background: #17243a;
}
.run-toggle {
  padding: 2px 9px;
  background: none;
}
.run-reason {
  margin-top: 4px;
  font-size: 13px;
  color: #fca5a5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.run-time {
  white-space: nowrap;
}
.run-detail-row > td {
  padding-top: 0;
}
.run-detail summary {
  cursor: pointer;
  color: var(--muted);
  padding: 8px 0;
}
.run-output {
  width: 100%;
  max-width: none;
  max-height: 420px;
  overflow: auto;
  margin: 8px 0;
  padding: 14px;
  background: #0c1422;
  border: 1px solid var(--line);
  border-radius: 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Test / Prod Interactive Stage Switcher */
.stage-switch {
  display: inline-flex;
  align-items: center;
  background: #0f192b;
  border: 1px solid #2d4260;
  border-radius: 14px;
  padding: 2px;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  font-weight: 700;
  gap: 2px;
  flex: none;
  position: relative;
}
.stage-switch:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* Visually hidden but still focusable, so the switch works from the keyboard. */
.stage-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.stage-pill {
  padding: 4px 10px;
  border-radius: 10px;
  color: var(--muted);
  transition: all 0.15s ease;
}
.stage-switch input:not(:checked) ~ .stage-pill.prod {
  background: #164e3f;
  color: #34d399;
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.4);
}
.stage-switch input:checked ~ .stage-pill.test {
  background: #583c12;
  color: #fbbf24;
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.4);
}

/* Mobile Responsiveness & Mobile Tabs */
@media (min-width: 901px) {
  .mobile-tabs {
    display: none !important;
  }
}

@media (max-width: 900px) {
  .workspace,
  .editor-page > .workspace {
    display: block;
    height: auto;
    min-height: 0;
  }
  .page.editor-page {
    height: auto;
  }
  .workspace > * {
    max-height: none;
  }
  .col-resize {
    display: none;
  }
  /* On the phone the properties are a tab of their own, shown with a hint until a step is picked. */
  .workspace:not(.has-inspector) > #inspector {
    display: block;
  }
  .steps-panel {
    padding: 0;
    overflow: visible;
  }
  .toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .toolbar h1 {
    flex-basis: 100%;
  }
  .mobile-tabs {
    display: flex !important;
    gap: 8px;
    margin-bottom: 12px;
  }
  .mobile-tab-btn {
    flex: 1;
    text-align: center;
    padding: 10px 6px;
    font-size: 13px;
    font-weight: 600;
  }
  .mobile-tab-btn.active {
    background: #1b3437;
    color: var(--accent);
    border-color: var(--accent);
  }
}

/* Step list editor */
.steps-panel {
  overflow: auto;
  padding: 0 4px 40px;
}
.icon-btn {
  padding: 6px 8px;
}
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.crumb {
  background: none;
  border-color: transparent;
  color: var(--muted);
  padding: 5px 8px;
}
.crumb.active {
  color: var(--accent);
  font-weight: 600;
}
.crumb-sep {
  color: var(--muted);
}
.branch-head h2 {
  margin: 4px 0 0;
  font-size: 20px;
}
.branch-head p {
  margin: 4px 0 16px;
  max-width: 720px;
}
.step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 760px;
}
.step-card {
  position: relative;
  background: #141f31;
  border: 1px solid var(--line);
  border-left: 4px solid var(--message);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
}
.step-card:hover {
  border-color: #3b4d6b;
}
.step-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.step-card.has-error {
  border-color: #f87171;
}
.step-card.kind-ansible { border-left-color: var(--ansible); }
.step-card.kind-condition { border-left-color: var(--condition); }
.step-card.kind-input { border-left-color: var(--input); }
.step-card.kind-auto { border-left-color: var(--auto); }
.step-card.kind-notify_admin { border-left-color: var(--notify); }
.step-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.step-num {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  background: #22324a;
  color: #dbe5f3;
  font-weight: 700;
}
.step-type {
  flex: 1;
  font-weight: 600;
}
.step-tag {
  background: #1b3437;
  color: var(--accent);
  border-radius: 4px;
  padding: 2px 6px;
}
.step-delete {
  background: none;
  border: 0;
  color: var(--muted);
  padding: 2px 6px;
}
.step-delete:hover {
  color: #ffabae;
  background: #3a1e25;
}
.step-text {
  margin: 8px 0 4px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #eef4ff;
}
.step-text.empty {
  color: var(--muted);
  font-style: italic;
}
.step-summary {
  font-size: 13px;
  color: var(--muted);
}
.step-issue {
  font-size: 13px;
  margin-top: 6px;
}
.step-issue.error {
  color: #fca5a5;
}
.step-issue.warn {
  color: #fcd34d;
}
.step-exits {
  margin-top: 10px;
  border-top: 1px dashed var(--line);
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: default;
}
/* The label (button text, stage switch) and the target controls each get a full line. */
.exit {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
}
.exit-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  min-width: 0;
}
.exit.tone-ok .exit-label { color: #86efac; }
.exit.tone-bad .exit-label { color: #fca5a5; }
.exit.tone-next .exit-label { color: var(--muted); }
.exit-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
/* The target keeps a readable width; in a narrow column the buttons move under it. */
.exit-target {
  flex: 1 1 220px;
  min-width: 0;
  padding: 6px 8px;
}
.exit-open,
.exit-add {
  padding: 6px 9px;
  font-size: 13px;
  white-space: nowrap;
}
.exit-add {
  border-style: dashed;
  color: var(--accent);
  background: none;
}
.tg-button {
  display: inline-block;
  background: #22324a;
  border-radius: 6px;
  padding: 5px 9px;
  color: #eef4ff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.add-button {
  align-self: flex-start;
  border-style: dashed;
  background: none;
  color: var(--accent);
  padding: 6px 10px;
  font-size: 13px;
}

/* Branch sidebar */
.branch-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.branch-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  border-radius: 7px;
  padding: 2px 6px 6px 0;
}
.branch-item .stage-switch {
  margin-left: 8px;
}
.branch-item.active {
  background: #1b3437;
}
.branch-link {
  flex: 1 1 70%;
  min-width: 0;
  text-align: left;
  background: none;
  border: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 8px;
}
.branch-item.active .branch-link {
  color: var(--accent);
  font-weight: 600;
}
.issue-count {
  background: #7f1d1d;
  color: #fecaca;
  border-radius: 9px;
  font-size: 12px;
  padding: 1px 6px;
}
.add-branch {
  width: 100%;
  margin-top: 8px;
  border-style: dashed;
  color: var(--accent);
  background: none;
}
.issues {
  margin-top: 22px;
}
.issues h2 {
  margin-bottom: 4px;
}
.issues p {
  margin: 0 0 8px;
}
.ok-note {
  color: #86efac !important;
}
.issue {
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 4px;
  padding: 7px 9px;
  background: none;
  border-left: 3px solid #fcd34d;
}
.issue.error {
  border-left-color: #f87171;
}
.issue-step {
  display: block;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.issue-text {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.cleanup {
  width: 100%;
  margin-top: 6px;
  font-size: 12px;
}
.flow-settings {
  margin-top: 22px;
}
.flow-settings summary,
.extra summary {
  cursor: pointer;
  color: var(--muted);
}

/* Inspector */
.inspector-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.inspector-head h2 {
  margin: 0;
}
.inspector-icon {
  font-size: 20px;
}
.inspector-panel h3 {
  margin: 22px 0 4px;
  font-size: 14px;
}
.var-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin-top: 6px;
}
.chip {
  padding: 2px 7px;
  font-size: 11px;
  border-radius: 10px;
  background: #1a2a3f;
  color: #c4b5fd;
}
.tg-preview {
  background: #0e1a2b;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}
.tg-bubble {
  background: #1e2f47;
  border-radius: 10px 10px 10px 2px;
  padding: 8px 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
}
.tg-var {
  color: #c4b5fd;
  background: #2e2350;
  border-radius: 4px;
  padding: 0 3px;
}
.tg-keys {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}
.tg-key {
  text-align: center;
  background: #24374f;
  border-radius: 6px;
  padding: 7px;
  font-size: 13px;
}
.tg-key.test {
  outline: 1px dashed #fbbf24;
}
.button-edit-top {
  display: flex;
  gap: 4px;
  align-items: center;
}
.button-edit-top input {
  flex: 1;
  min-width: 0;
}
.button-edit details {
  margin-top: 6px;
}
.extra {
  margin-top: 22px;
}
.extra button {
  margin-top: 12px;
}
.delete-step {
  display: block;
  margin-top: 16px;
}

/* Step picker dialog */
.step-picker h3 {
  margin: 16px 0 8px;
  font-size: 14px;
}
.kind-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.kind-option {
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  text-align: left;
  padding: 10px;
}
.kind-icon {
  grid-row: span 2;
  font-size: 20px;
  align-self: center;
}
.kind-title {
  font-weight: 600;
}
.kind-hint {
  font-size: 13px;
  color: var(--muted);
}
.step-picker > button:last-child {
  margin-top: 16px;
}

@media (max-width: 900px) {
  /* The sidebar folds into a scrollable top bar. */
  #app {
    flex-direction: column;
  }
  .sidebar {
    width: auto;
    height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }
  nav,
  .nav-group {
    flex-direction: row;
    min-width: 0;
  }
  .sidebar {
    flex-wrap: wrap;
    justify-content: space-between;
  }
  nav {
    order: 1;
    flex: 1 0 100%;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .nav-group,
  .sidebar a {
    flex: none;
  }
  .nav-title {
    display: none;
  }
  .sidebar-user {
    flex-direction: row;
    border-top: 0;
    padding-top: 0;
  }
  .sidebar-user a {
    max-width: 120px;
  }
  .nav-fold {
    display: none;
  }
  body.nav-folded .sidebar {
    width: auto;
    padding: 10px 12px;
  }
  body.nav-folded .sidebar > :not(.sidebar-top) {
    display: flex;
  }
  body.nav-folded .brand {
    display: block;
  }
  .exit {
    grid-template-columns: 1fr;
  }
  .kind-grid {
    grid-template-columns: 1fr;
  }
}

/* Chat simulator */
.sim-branch {
  margin-bottom: 16px;
}
dialog.sim-dialog {
  width: 1000px;
  max-width: 96vw;
}
.sim-dialog > p {
  margin-top: 0;
}
.sim-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  height: min(70vh, 680px);
}
.sim-phone {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #0e1a2b;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.sim-chat {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sim-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 85%;
}
.sim-row.user {
  align-self: flex-end;
  align-items: flex-end;
}
.sim-row.system {
  align-self: center;
  align-items: center;
  max-width: 95%;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.sim-row.system.error {
  color: #fca5a5;
}
.sim-row.system.ok {
  color: #86efac;
}
.sim-bubble {
  background: #1e2f47;
  border-radius: 12px 12px 12px 3px;
  padding: 8px 11px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
}
.sim-row.user .sim-bubble {
  background: #2b5278;
  border-radius: 12px 12px 3px 12px;
}
.sim-keys {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
  min-width: 240px;
}
.sim-key {
  background: #24374f;
  padding: 7px 10px;
}
.sim-key:disabled {
  opacity: 0.45;
}
.sim-step-link {
  background: none;
  border: 0;
  padding: 2px 4px;
  font-size: 12px;
  color: var(--muted);
}
.sim-step-link:hover {
  color: var(--accent);
  background: none;
}
.sim-pending {
  align-self: stretch;
  border: 1px dashed #fbbf24;
  border-radius: 10px;
  padding: 10px 12px;
  background: #221b0e;
}
.sim-pending-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.sim-pending p {
  margin: 8px 0 0;
}
.sim-composer {
  display: flex;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid var(--line);
}
.sim-side {
  overflow-y: auto;
  padding-right: 4px;
}
.sim-side label:first-child {
  margin-top: 0;
}
.sim-restart {
  width: 100%;
  margin-top: 4px;
}
.sim-side h3 {
  margin: 18px 0 4px;
  font-size: 14px;
}
.sim-side p {
  margin: 0 0 8px;
}
.sim-var-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 6px;
  align-items: center;
  margin: 4px 0;
}
.sim-var-row span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.sim-var-row input {
  padding: 5px 7px;
}
.sim-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 2px;
  background: #0f192b;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 4px;
}
.sim-modes button {
  border: 0;
  background: none;
  padding: 7px 6px;
  font-size: 12px;
  color: var(--muted);
}
.sim-modes button.active {
  background: #1b3437;
  color: var(--accent);
  font-weight: 700;
}
.sim-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  margin: 8px 0 0;
  font-size: 12px;
}
.sim-facts dt {
  color: var(--muted);
}
.sim-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.sim-typing {
  font-style: italic;
}
.sim-var-row code {
  font-size: 12px;
  overflow-wrap: anywhere;
  color: #ddd6fe;
}
@media (max-width: 900px) {
  .sim-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .sim-phone {
    height: 60vh;
  }
}

/* User actions journal */
.journal-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px;
}
.journal-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}
.journal-field:first-child {
  flex: 1 1 260px;
}
.journal-filters .check {
  margin: 0 0 9px;
}
.journal-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-basis: 100%;
}
.journal-chip:empty {
  display: none;
}
.journal-table th:nth-child(1) {
  width: 150px;
}
.journal-table th:nth-child(4) {
  width: 130px;
}
.journal-user {
  color: var(--accent);
  text-decoration: none;
}
.journal-user:hover {
  text-decoration: underline;
}
.journal-input {
  white-space: pre-wrap;
}
.journal-error > td {
  background: #2a1a20;
}
.badge.kind-action {
  color: var(--ansible);
}
.badge.kind-text,
.badge.kind-contact {
  color: var(--input);
}
.badge.kind-button,
.badge.kind-company,
.badge.kind-switch_company {
  color: var(--accent);
}
@media (max-width: 900px) {
  .journal-field,
  .journal-field:first-child {
    flex: 1 1 100%;
  }
  .journal-table thead {
    display: none;
  }
  .journal-table,
  .journal-table tbody,
  .journal-table tr,
  .journal-table td {
    display: block;
    width: 100%;
  }
  .journal-table tr:not(.run-detail-row) {
    border-top: 1px solid var(--line);
    padding-top: 8px;
  }
  .journal-table td {
    border: 0;
    padding: 4px 8px;
  }
}

/* Service settings: grouped into tabs, one shared save bar. */
.settings {
  max-width: 980px;
}
.settings-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin: 16px 0 18px;
  overflow-x: auto;
  scrollbar-width: none;
}
.settings-tabs button {
  flex: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 7px 7px 0 0;
  color: #a7b7cf;
  padding: 10px 14px;
  white-space: nowrap;
}
.settings-tabs button:hover {
  background: #1b2940;
}
.settings-tabs button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: #1b3437;
}
.settings-tabs button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.settings-panel {
  display: grid;
  gap: 18px;
}
.settings-panel[hidden] {
  display: none;
}
.settings-panel .card h2 {
  margin-top: 0;
}
.settings-panel .card > button {
  margin: 16px 8px 0 0;
}
.settings-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 18px;
  padding: 14px 0;
  background: #0c1220;
  border-top: 1px solid var(--line);
}
@media (max-width: 700px) {
  .settings-footer {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Servers */
.server-row {
  cursor: pointer;
}
.server-row:hover > td {
  background: #1a2840;
}
.servers-table .badge {
  display: inline-block;
  margin: 0 2px 3px 0;
}
.badge.server-on {
  background: #1b3437;
  color: #7ce0c3;
}
.badge.server-off {
  background: #503c17;
  color: #ffdc94;
}
.badge.server-archive {
  color: var(--muted);
}
dialog.server-dialog {
  width: 920px;
}
.server-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0 14px;
}
.server-clients {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.server-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.chip-remove {
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--muted);
}
.chip-remove:hover {
  color: #fff;
}
.server-line {
  display: grid;
  gap: 8px;
  align-items: end;
  margin-bottom: 8px;
}
.server-iface {
  grid-template-columns: 1fr 90px 2fr auto;
}
.server-service {
  grid-template-columns: 1.4fr 90px 90px 1.6fr 1.2fr auto auto auto;
}
.service-rule {
  grid-template-columns: 1.2fr 100px 2.4fr 90px auto 1.2fr auto;
}
.server-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  min-width: 0;
}
.server-cell.check {
  flex-direction: row;
  margin: 0 0 9px;
  white-space: nowrap;
}
.server-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
@media (max-width: 800px) {
  .server-iface,
  .server-service,
  .service-rule {
    grid-template-columns: 1fr 1fr;
  }
}
.account-access {
  grid-template-columns: 1.2fr 2fr auto;
}
.server-section {
  border-top: 1px solid var(--line);
  padding: 4px 0 16px;
}
.server-section:first-child {
  border-top: 0;
}
.server-section > .server-actions {
  margin-top: 8px;
  flex-wrap: wrap;
}
.server-run {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.server-run > label {
  display: none;
}
.server-run > select,
.server-run > .picker {
  flex: 1;
  min-width: 0;
}
.user-count {
  cursor: pointer;
  white-space: nowrap;
}
.user-count:hover strong {
  color: var(--accent);
  text-decoration: underline;
}
.servers-table a {
  color: var(--accent);
  text-decoration: none;
}
.servers-table a:hover {
  text-decoration: underline;
}
th.sortable,
span.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
th.sortable:hover,
th.sortable[aria-sort="ascending"],
th.sortable[aria-sort="descending"],
span.sortable:hover,
span.sortable[aria-sort="ascending"],
span.sortable[aria-sort="descending"] {
  color: var(--accent);
}
dialog.ask-dialog {
  width: 440px;
}
.ask-message {
  color: #dbe5f3;
  white-space: pre-line;
  margin: 0 0 20px;
}
.ask-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
button.danger-solid {
  background: #e5484d;
  color: #fff;
  border: 0;
  font-weight: 700;
}
button.danger-solid:hover {
  background: #f2555a;
}
dialog.role-dialog {
  width: 620px;
}
.role-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 14px 0 0;
  padding: 4px 14px 10px;
}
.role-group legend {
  color: var(--muted);
  font-size: 13px;
  padding: 0 6px;
}
.role-group label.check {
  align-items: flex-start;
  line-height: 1.4;
  font-size: 13px;
  color: #dbe5f3;
}
.role-group label.check input {
  margin-top: 2px;
}
.ask-actions .role-delete {
  margin-right: auto;
}
.login-error::first-letter {
  text-transform: uppercase;
}

/* Hypervisors a new-server search polls */
.scan-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  margin: 4px 0 8px;
}
.vm-match {
  margin-top: 4px;
  color: var(--accent);
  font-size: 12px;
}
.flow-state {
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 7px;
  white-space: nowrap;
}
.flow-state.unsaved {
  color: #ffdc94;
  background: #3d2f12;
}
.flow-state.draft {
  color: #93c5fd;
  background: #172a45;
}
.flow-state.live {
  color: var(--muted);
}
.toolbar .icon-btn {
  min-width: 38px;
  font-size: 16px;
  line-height: 1;
}
.stage-legend {
  margin: -6px 0 12px;
}
/* Page title with its main actions on the same line. */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.page-head h1 {
  flex: 1 1 auto;
  margin: 0;
}
.menu {
  position: relative;
}
.menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  padding: 6px;
  background: #18263c;
  border: 1px solid #405571;
  border-radius: 10px;
  box-shadow: 0 10px 30px #0009;
}
.menu-list[hidden] {
  display: none;
}
.menu-list button {
  background: none;
  border: 0;
  text-align: left;
  white-space: nowrap;
}
.menu-list button:hover,
.menu-list button:focus-visible {
  background: #26394f;
}
/* Filters: selects flow inline on a wide screen; chips list what is narrowing the list. */
.filter-more {
  display: contents;
}
.filter-more > .journal-field:first-child {
  flex: 0 1 auto;
}
.filter-toggle {
  display: none;
}
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-basis: 100%;
}
.filter-chips:empty {
  display: none;
}
input.filter-set,
select.filter-set {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
@media (min-width: 701px) {
  .filter-chips:not(.has-hidden) {
    display: none;
  }
  /* Only the link-only conditions need a chip next to visible fields. */
  .filter-chips.has-hidden .filter-chip:not(.chip-hidden) {
    display: none;
  }
}
.filter-chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: #1b3437;
  border-color: #2c5852;
  color: #a7f3d0;
  font-size: 13px;
}
.filter-reset {
  min-width: 38px;
  font-size: 17px;
  line-height: 1;
}
/* Fields, the search box and the buttons share one baseline and one height. */
.filter-bar .journal-field {
  margin: 0;
}
.filter-bar input,
.filter-bar select,
.filter-bar > button {
  height: 38px;
}
/* Inventory membership is bookkeeping, not health: neutral colours, no "green = up". */
.badge.inv-on {
  background: #22324a;
  color: #cfe0f5;
}
.badge.inv-off {
  background: #3d2f12;
  color: #ffdc94;
}
.badge.inv-archive {
  color: var(--muted);
}
.server-link {
  color: #eef4ff;
  font-weight: 700;
  text-decoration: none;
}
.server-link:hover {
  color: var(--accent);
  text-decoration: underline;
}
@media (max-width: 700px) {
  /* Phone: search stays, the rest folds behind "Фильтры". */
  .filter-toggle {
    display: inline-block;
  }
  .filter-bar:not(.open) .filter-more {
    display: none;
  }
  .filter-bar.open .filter-more {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-basis: 100%;
  }
  .filter-bar .journal-field {
    min-width: 0;
    flex: 1 1 100%;
  }
  .filter-bar > .journal-field:first-child {
    flex: 1 1 100%;
  }
  /* Tables become cards: one block per row, the column title before each value. */
  .servers-table,
  .servers-table tbody,
  .servers-table tr,
  .servers-table td,
  .runs-table,
  .runs-table tbody,
  .runs-table tr,
  .runs-table td {
    display: block;
    width: 100%;
  }
  .servers-table thead,
  .servers-table tr:has(> th),
  .runs-table thead,
  .runs-table tr:has(> th) {
    display: none;
  }
  /* Short run lists (a server card's latest runs) are cards too; the runs page adds a toggle column. */
  .runs-table tr:has(> td):not(.run-detail-row, .run-row) {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    margin-top: 10px;
  }
  .runs-table tr.run-row {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px 10px 44px;
    margin-top: 10px;
  }
  .runs-table td {
    padding: 2px 0;
    border: 0;
  }
  .runs-table tr.run-row > td:first-child {
    position: absolute;
    left: 6px;
    top: 8px;
    width: auto;
  }
  .runs-table .run-reason {
    white-space: normal;
  }
  .card:has(> .runs-table) {
    padding: 0;
    background: none;
    border: 0;
  }
  .servers-table tr {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
  }
  .servers-table td {
    display: flex;
    gap: 10px;
    padding: 3px 0;
    border: 0;
    overflow-wrap: anywhere;
  }
  .servers-table td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 104px;
    color: var(--muted);
    font-size: 13px;
  }
  .servers-table td:first-child {
    display: block;
    padding-bottom: 6px;
  }
  .servers-table td:first-child::before {
    content: none;
  }
  .servers-table td:empty {
    display: none;
  }
  .card:has(> .servers-table) {
    padding: 0;
    background: none;
    border: 0;
  }
}
/* A row's main action as a real button that looks like the row's title. */
.link-button {
  background: none;
  border: 0;
  padding: 0;
  font-weight: 700;
  color: #eef4ff;
  text-align: left;
}
.link-button:hover {
  background: none;
  color: var(--accent);
  text-decoration: underline;
}
/* One clearly visible keyboard focus everywhere; mouse clicks do not show it. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline-offset: 0;
  border-color: var(--accent);
}
/* Multi-value filter: looks like a select, opens a list of checkboxes. */
.multi-select {
  position: relative;
}
.multi-toggle {
  height: 38px;
  min-width: 150px;
  max-width: 240px;
  width: 100%;
  padding: 0 28px 0 9px;
  text-align: left;
  background: #101a2b;
  border: 1px solid #34435d;
  border-radius: 6px;
  color: #eef4ff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  position: relative;
}
.multi-toggle::after {
  content: "▾";
  position: absolute;
  right: 10px;
  color: var(--muted);
}
.multi-toggle:hover {
  background: #101a2b;
  border-color: #4a5d7c;
}
.filter-set > .multi-toggle {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.multi-list {
  left: 0;
  right: auto;
  max-height: 320px;
  overflow: auto;
  gap: 0;
}
.multi-list .check {
  margin: 0;
  padding: 7px 8px;
  border-radius: 6px;
  color: #dbe5f3;
  font-size: 14px;
  cursor: pointer;
}
.multi-list .check:hover {
  background: #26394f;
}
.multi-clear {
  margin-top: 4px;
  border-top: 1px solid var(--line) !important;
  border-radius: 0;
  color: var(--muted);
}
@media (max-width: 700px) {
  .multi-toggle {
    max-width: none;
  }
  .multi-list {
    right: 0;
  }
}
.server-users-summary p {
  margin: 0 0 4px;
}
/* Searchable picker for long lists. */
.picker {
  position: relative;
}
.picker-list {
  left: 0;
  right: 0;
  max-height: 320px;
  overflow: auto;
  gap: 0;
}
.picker-option {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  background: none;
  border: 0;
  text-align: left;
}
.picker-option .hint {
  white-space: nowrap;
}
.picker-option.active,
.picker-option:hover {
  background: #26394f;
}
.picker-option.chosen {
  color: var(--accent);
}
.picker-group {
  padding: 6px 12px 2px;
  font-size: 12px;
  color: #6b7d97;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.picker-empty {
  padding: 8px 12px;
}
/* Page and action states. */
.page-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
}
.start-state {
  flex: 1;
  align-self: center;
}
.failed-state {
  max-width: 520px;
  margin: 40px auto;
  border: 1px solid #5b2a33;
  border-radius: 12px;
  background: #241821;
}
.failed-state h2 {
  color: #ffabae;
  margin-top: 0;
}
.action-error {
  align-self: center;
  color: #ffabae;
  font-size: 13px;
  line-height: 1.4;
  max-width: 520px;
}
/* A run just started from a dialog: highlighted until the page is left. */
.run-row.fresh > td {
  background: #183a33;
}
.run-row.fresh > td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}
.run-output-tools {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}
.run-output-tools button {
  padding: 4px 10px;
  font-size: 13px;
}
.load-more {
  display: block;
  margin: 14px auto 0;
}
.load-more[hidden] {
  display: none;
}
.copy-btn {
  padding: 1px 6px;
  margin-left: 4px;
  font-size: 13px;
  background: none;
  border-color: transparent;
  color: var(--muted);
  vertical-align: baseline;
}
.copy-btn:hover {
  color: var(--accent);
  background: #1b2940;
}
/* Long cards: the title with its tabs and the save bar stay in view while the form scrolls. */
dialog.server-dialog {
  padding-top: 0;
  padding-bottom: 0;
}
dialog.server-dialog > .dialog-head {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0 -1em;
  padding: 14px 1em 0;
  background: #152136;
}
dialog.server-dialog > .settings-tabs {
  position: sticky;
  top: 52px;
  z-index: 5;
  margin: 0 -1em 18px;
  padding: 0 1em;
  background: #152136;
}
dialog.server-dialog .form-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 18px -1em 0;
  padding: 12px 1em 14px;
  background: #152136;
  border-top: 1px solid var(--line);
}
dialog.server-dialog > div:last-child:not(.form-actions):not([hidden]) {
  padding-bottom: 16px;
}
.field-error {
  margin: 4px 0 0;
  color: #ffabae;
  font-size: 13px;
  line-height: 1.4;
}
[aria-invalid="true"] {
  border-color: #f87171;
}
.book-modes {
  margin: 6px 0 4px;
}
.code-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}
.run-summary:empty {
  display: none;
}
.run-summary {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #5c4a1e;
  border-radius: 8px;
  background: #2a2312;
}
.run-summary p {
  margin: 0;
  color: #ffdc94;
}
.run-summary details {
  margin-top: 6px;
}
.run-summary summary {
  cursor: pointer;
  color: var(--muted);
}
.run-summary-hosts {
  color: #dbe5f3 !important;
  margin-top: 6px !important;
  line-height: 1.5;
}
/* Long tables keep their column titles in view while the page scrolls. */
.page .servers-table thead th,
.page .runs-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #141f31;
}
/* Server list, compact: tighter cells, two facts per column, a quick "Действия" per row. */
.page .servers-table td,
.page .servers-table th {
  padding: 8px 10px;
}
.page .servers-table th {
  white-space: nowrap;
}
.server-services {
  margin-top: 4px;
}
.server-row-actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}
.row-action {
  padding: 4px 10px;
  font-size: 13px;
}
.count-sep {
  margin: 0 8px;
  color: #4b5b74;
}
.count-warn {
  color: #ffdc94;
}
.page .servers-table td {
  line-height: 1.35;
}
.page .servers-table .badge {
  padding: 2px 6px;
  margin: 0 2px 0 0;
}
.page .servers-table .copy-btn {
  padding: 0 4px;
  line-height: 1.2;
}
.page .servers-table .server-services {
  margin-top: 3px;
}
@media (max-width: 700px) {
  /* The card's quick action sits across from the server name. */
  .page .servers-table tr.server-row {
    position: relative;
  }
  .page .servers-table td.server-row-actions {
    position: absolute;
    top: 8px;
    right: 10px;
    width: auto;
    padding: 0;
  }
  .page .servers-table td.server-row-actions:empty {
    display: none;
  }
}

/* Monitoring: health colours, unlike the neutral inventory badges. */
.badge.mon-up {
  background: #1b3437;
  color: #7ce0c3;
}
.badge.mon-down {
  background: #4a1f27;
  color: #ffabae;
}
.badge.mon-warn {
  background: #503c17;
  color: #ffdc94;
}
.badge.mon-unknown {
  color: var(--muted);
}
.monitor-notices .warn {
  border-radius: 8px;
  margin-bottom: 10px;
}
.monitor-notices .warn a {
  color: #fff1cc;
}
.monitoring-table .monitor-service {
  font-weight: 700;
}
.monitoring-table .monitor-target,
.monitoring-table .monitor-message {
  overflow-wrap: anywhere;
}
.monitoring-table .monitor-target {
  font-family: ui-monospace, monospace;
  font-size: 12px;
}
.monitoring-table tr.monitor-down td:first-child {
  box-shadow: inset 3px 0 #f87171;
}
.monitoring-table .badge {
  display: inline-block;
}
.monitor-check-numbers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}
.settings-subtitle {
  margin: 8px 0 -6px;
}

/* Connections: folder tree on the left, servers to drag into it on the right */
.conn-notice .warn {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  margin-bottom: 10px;
}
.conn-search {
  max-width: 520px;
  margin-bottom: 12px;
}
.conn-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.conn-layout.conn-editing {
  grid-template-columns: minmax(0, 1fr) 320px;
}
.conn-tree {
  padding: 10px 12px;
}
.conn-folder-head,
.conn-row {
  padding-left: calc(var(--depth, 0) * 22px);
}
.conn-folder-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  border-radius: 6px;
}
.conn-folder-head:hover {
  background: #18263c;
}
.conn-toggle {
  flex: none;
  width: 26px;
  padding: 2px 0;
  background: none;
  border-color: transparent;
  color: var(--muted);
}
.conn-folder-name {
  font-weight: 600;
}
.conn-count {
  margin-right: auto;
}
.conn-roles {
  font-size: 11px;
}
.conn-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 6px;
  padding-bottom: 6px;
  border-top: 1px solid #1d2a40;
}
.conn-row > .conn-main {
  flex: 1;
  min-width: 0;
  margin-left: 32px;
}
.conn-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}
.conn-name {
  padding: 0;
  border: 0;
  background: none;
  color: #e4edf8;
  font-weight: 600;
  text-align: left;
}
.conn-name:hover {
  background: none;
  color: var(--accent);
  text-decoration: underline;
}
.conn-details {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
}
.conn-address {
  font-family: ui-monospace, monospace;
  font-size: 12px;
}
.conn-proto {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
}
.conn-proto.conn-rdp {
  background: #1d3a5c;
  color: #9fd0ff;
}
.conn-proto.conn-ssh {
  background: #233d2f;
  color: #9fe6bb;
}
.conn-actions {
  flex: none;
  display: flex;
  gap: 6px;
}
.conn-root-drop {
  margin-top: 10px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
}
.drop-over {
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
  background: #17303a;
}
.dragging {
  opacity: 0.5;
}
[draggable="true"] {
  cursor: grab;
}
.conn-machines {
  position: sticky;
  top: 12px;
  padding: 14px;
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
}
.conn-machines h2 {
  margin: 0;
}
.conn-machines .check {
  margin: 6px 0;
}
.conn-machine-list {
  overflow-y: auto;
  min-height: 0;
  margin: 0 -6px;
}
.conn-machine {
  padding: 8px 6px;
  border-top: 1px solid #1d2a40;
  border-radius: 6px;
}
.conn-machine:hover,
.conn-machine:focus-visible {
  background: #18263c;
}
.conn-machine-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.conn-machine .empty,
.conn-machine-list .empty {
  padding: 20px;
}
.conn-static {
  padding: 9px 0;
}
.conn-preview {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101a2b;
}
.conn-gw-hint {
  margin-top: 34px;
}
.conn-role-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0 18px;
}
.conn-cred {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.conn-cred > div {
  flex: 1;
}
dialog.conn-dialog {
  width: 760px;
}
@media (max-width: 900px) {
  .conn-layout.conn-editing {
    grid-template-columns: minmax(0, 1fr);
  }
  .conn-machines {
    position: static;
    max-height: 60vh;
  }
  .conn-folder-head,
  .conn-row {
    padding-left: calc(var(--depth, 0) * 12px);
  }
  .conn-row > .conn-main {
    margin-left: 8px;
  }
  .conn-gw-hint {
    margin-top: 0;
  }
}
.conn-howto {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}
.conn-howto summary {
  cursor: pointer;
  color: #dbe5f3;
}
.conn-howto ol {
  margin: 6px 0 0;
  padding-left: 20px;
}
.conn-disabled {
  display: inline-flex;
  cursor: help;
}
.conn-disabled button {
  pointer-events: none;
}
/* Services catalog: a card row plus "Новым серверам", and how the servers use it below */
.server-line.catalog-row {
  grid-template-columns: 1.3fr 80px 80px 1.4fr 1.1fr 110px auto auto auto;
}
.catalog-entry {
  padding: 4px 0 8px;
  border-bottom: 1px solid #1d2a40;
}
.catalog-usage {
  margin-top: 2px;
}
@media (max-width: 800px) {
  .server-line.catalog-row {
    grid-template-columns: 1fr 1fr;
  }
}
.catalog-other {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 4px;
}
/* A link styled as a button: "Подключиться" opens Guacamole in a new tab */
a.button-link {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 12px;
  background: #1b2940;
  color: #e4edf8;
  text-decoration: none;
}
a.button-link:hover {
  background: #304260;
}
a.button-link.row-action {
  padding: 4px 10px;
  font-size: 13px;
}
a.button-link.primary {
  background: #79dfc2;
  color: #102621;
  border: 0;
  font-weight: 700;
}
.guac-plan {
  margin-top: 14px;
}
/* Access page: a user or role per line, its action kept to the size of its label */
.access-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.access-row:last-of-type {
  margin-bottom: 12px;
}
.access-info {
  flex: 1;
  min-width: 0;
}
.access-row > button {
  flex: none;
}
