.simpage {
  padding-top: 40px;
}

.simpage-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.simpage-title {
  margin-bottom: 10px;
}

.simpage-sub {
  max-width: 760px;
}

.simpage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.simpage-note {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in oklab, var(--bg-3) 88%, var(--accent-soft));
}

.simpage-note .badge {
    white-space: nowrap;
}

.simpage-note p {
  margin: 0;
  color: var(--text-3);
}

[data-app-sim] {
  position: relative;
}

.sim-app {
    max-height: 90vh;
    position: relative;
    overflow: scroll;
    overflow-x: hidden;
    scrollbar-width: none;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: linear-gradient(180deg, color-mix(in oklab, var(--bg-2) 92%, var(--accent-soft)), var(--bg-1) 20%, var(--bg-2)),
    radial-gradient(circle at top right, color-mix(in oklab, var(--accent-soft) 55%, transparent), transparent 42%);
    box-shadow: var(--shadow-card), 0 30px 90px -45px rgba(0, 180, 216, 0.45);
}

.sim-app::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--accent) 35%, white), transparent);
  pointer-events: none;
}

.sim-window-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--bg-4) 94%, white), var(--bg-2));
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-3);
}

.sim-titlebar-left,
.sim-titlebar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sim-window-dots {
  display: inline-flex;
  gap: 6px;
}

.sim-window-dots span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--bg-4);
  border: 1px solid var(--border-strong);
}

.sim-window-dots span:nth-child(1) {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.42);
}

.sim-window-dots span:nth-child(2) {
  background: rgba(245, 158, 11, 0.25);
  border-color: rgba(245, 158, 11, 0.42);
}

.sim-window-dots span:nth-child(3) {
  background: rgba(0, 212, 100, 0.25);
  border-color: rgba(0, 212, 100, 0.42);
}

.sim-window-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sim-window-tag {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
}

.sim-shell {
  display: grid;
  grid-template-columns: 60px 1fr;
  height: 780px;
}

.sim-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 8px;
  border-right: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg-1) 94%, var(--bg-4));
}

.sim-sidebar-spacer {
  flex: 1;
}

.sim-side-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sim-side-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text-3);
  transition: transform 0.16s ease, border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.sim-side-btn:hover {
  transform: translateY(-1px);
  color: var(--text);
  border-color: var(--border-strong);
}

.sim-side-btn.is-active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

.sim-side-btn.is-danger {
  color: var(--err);
}

.sim-side-btn.is-warning {
  color: #f59e0b;
}

.sim-side-btn svg,
.sim-icon-btn svg,
.sim-row-icon svg,
.sim-toggle-btn svg {
  max-width: 48px;
  max-height: 48px;
}

button.sim-row-icon.cloud {
    min-width: 48px;
    min-height: 48px;
}

.cloud {
  background: #13131e;
}

article.sim-row.is-mounted button.cloud {
    background: none;
}

article.sim-row.is-mounted.is-selected button svg {
    color: #00b4d8;
}

.sim-main {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.sim-home-view {
  display: grid;
  grid-template-columns: minmax(320px, var(--sim-list-width, 396px)) 14px minmax(340px, 1fr);
  min-height: 0;
  flex: 1;
}

.sim-list-panel,
.sim-right-panel,
.sim-settings-view,
.sim-users-view {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.sim-list-panel {
  border-right: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg-1) 94%, transparent);
}

.sim-right-panel,
.sim-settings-view,
.sim-users-view {
  background: color-mix(in oklab, var(--bg-2) 96%, transparent);
}

.sim-splitter {
  position: relative;
  cursor: col-resize;
  background: color-mix(in oklab, var(--bg-1) 84%, transparent);
}

.sim-splitter::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 18px;
  bottom: 18px;
  width: 1px;
  background: var(--border);
  transform: translateX(-50%);
}

.sim-splitter::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 54px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent-soft) 72%, var(--bg-4));
  border: 1px solid var(--accent-border);
  transform: translate(-50%, -50%);
}

[data-app-sim][data-resizing="true"] {
  cursor: col-resize;
}

[data-app-sim][data-resizing="true"] .sim-splitter::after {
  background: color-mix(in oklab, var(--accent-soft) 90%, var(--bg-4));
}

.sim-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.sim-panel-head h2 {
  margin: 0;
  font-size: 15px;
  color: var(--text);
}

.sim-panel-kicker {
  display: none;
}

.sim-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sim-icon-btn,
.sim-row-icon,
.sim-toggle-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text-3);
}

.sim-row.is-mounted .sim-row-icon {
    color: #00b4d8;
    width: 48px;
}

.sim-icon-btn:hover,
.sim-row-icon:hover,
.sim-toggle-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.sim-icon-btn.is-danger {
  color: var(--err);
}

.sim-toolbar-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 11px;
}

.sim-list {
  flex: 1;
  overflow: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sim-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg-3) 96%, transparent);
  box-shadow: 0 10px 25px -22px rgba(0, 0, 0, 0.6);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.sim-row:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
}

.sim-row.is-selected {
  border-color: var(--accent-border);
  background: color-mix(in oklab, var(--bg-3) 86%, var(--accent-soft));
}

.sim-row.is-mounted {
  border-color: rgba(0, 180, 216, 0.48);
  background: #10202a;
  box-shadow: 0 18px 40px -30px rgba(0, 180, 216, 0.35);
}

.sim-row.is-mounted .sim-drive-chip,
.sim-row.is-mounted .sim-toggle-btn {
  border-color: rgba(0, 212, 100, 0.42);
}

.sim-row.is-mounted .sim-row-icon {
  color: #00b4d8;
}

.sim-conn-meta {
  min-width: 0;
}

.sim-conn-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.sim-conn-host {
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-4);
  font-family: var(--mono);
  font-size: 11px;
}

.sim-drive-chip {
  min-width: 42px;
  padding: 5px 9px;
  border-radius: 9px;
  border: 1px solid var(--accent-border);
  background: var(--bg-4);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.sim-row.is-mounted .sim-drive-chip,
.sim-row.is-mounted .sim-toggle-btn {
  background: rgba(0, 212, 100, 0.10);
  color: var(--ok);
}

.sim-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    position: relative;
    margin-left: auto;
}

article.sim-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.sim-row-actions .sim-info-btn {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}

.sim-row-icon {
  color: #6a7a8a;
}

.sim-toggle-btn {
  color: var(--text-3);
}

.sim-row.is-loading .sim-row-actions {
  min-width: 118px;
  justify-content: flex-end;
}

.sim-loading-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
}

.sim-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid color-mix(in oklab, var(--accent) 20%, transparent);
  border-top-color: currentColor;
  border-radius: 999px;
  animation: sim-spin 0.8s linear infinite;
}

.sim-panel-scroll {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  scrollbar-width: none;
}

.sim-users-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sim-users-hero,
.sim-section-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in oklab, var(--bg-3) 94%, transparent);
  box-shadow: 0 20px 45px -34px rgba(0, 0, 0, 0.62);
}

.sim-users-hero {
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  background:
    linear-gradient(135deg, color-mix(in oklab, var(--accent-soft) 65%, var(--bg-3)), color-mix(in oklab, var(--bg-3) 96%, transparent)),
    color-mix(in oklab, var(--bg-3) 94%, transparent);
}

.sim-users-hero h3,
.sim-section-card-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
}

.sim-users-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.15fr) minmax(280px, 0.95fr);
  gap: 16px;
  align-items: start;
}

.sim-users-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sim-section-card {
  padding: 18px;
}

.sim-section-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.sim-users-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sim-user-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg-2) 94%, transparent);
}

.sim-user-row.is-current {
  border-color: rgba(0, 180, 216, 0.42);
  background: rgba(0, 180, 216, 0.12);
}

.sim-user-avatar {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: color-mix(in oklab, var(--bg-4) 84%, transparent);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}

.sim-user-avatar.is-admin {
  border-color: var(--accent-border);
  color: var(--accent);
  background: color-mix(in oklab, var(--accent-soft) 70%, var(--bg-4));
}

.sim-user-copy {
  min-width: 0;
}

.sim-user-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.sim-user-line strong {
  color: var(--text);
  font-size: 13px;
}

.sim-user-copy p {
  margin: 0;
  color: var(--text-4);
  font-family: var(--mono);
  font-size: 11px;
}

.sim-user-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg-4) 84%, transparent);
  color: var(--text-3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sim-user-badge.is-admin,
.sim-user-badge.is-current {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
}

.sim-panel-body,
.sim-form-body {
  padding: 18px;
}

.sim-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  margin: 0 auto;
  max-width: 320px;
  text-align: center;
  color: var(--text-3);
}

.sim-empty-state h3 {
  margin: 0 0 8px;
  color: var(--text);
}

.sim-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 11px;
}

.sim-status-chip i,
.sim-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  background: var(--text-4);
}

.sim-status-chip.is-mounted,
.sim-status-chip.is-mounted i,
.sim-status-dot {
  background: rgba(0, 212, 100, 0.12);
  color: var(--ok);
}

.sim-status-chip.is-mounted i,
.sim-status-dot {
  background: var(--ok);
  box-shadow: 0 0 12px rgba(0, 212, 100, 0.5);
}

.sim-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.sim-section-label {
  margin: 18px 0 10px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sim-info-list {
  display: grid;
  gap: 10px;
}

.sim-info-item {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-3);
}

.sim-info-item strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text-4);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sim-info-item span {
  color: var(--text);
  word-break: break-word;
}

.sim-info-item span.is-mono {
  font-family: var(--mono);
  font-size: 12px;
}

.sim-sys-grid {
  display: grid;
  gap: 14px;
}

.sim-sys-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-3);
}

.sim-sys-card h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 13px;
}

.sim-sys-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--text-3);
  font-size: 12px;
}

.sim-progress {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg-4);
}

.sim-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}

.sim-form-grid {
  display: grid;
  gap: 14px;
}

/* .sim-form-grid.split {
  grid-template-columns: minmax(0, 1fr) 110px;
} */

.sim-form-grid.split.equal label.sim-field.is-select {
    display: flex;
    flex-direction: column;
}

.sim-form-grid.split.equal label.sim-field.is-select span {
    margin-right: auto;
}

.sim-form-grid.equal {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sim-field {
    width: 100%;
    /* display: flex; */
    gap: 6px;
    justify-content: space-between;
    align-items: center;
}

input.sim-input[data-settings-field="check_interval_seconds"] {
    max-width: 75px;
}

.sim-field.is-select {
  position: relative;
}

.sim-field.is-select::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 12px;
  height: 12px;
  background: var(--text-4);
  pointer-events: none;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat center / contain;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat center / contain;
}

.sim-field > span {
  color: var(--text-4);
  font-size: 12px;
  font-weight: 600;
}

.sim-input,
.sim-select {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text);
  font-family: var(--sans);
}

.sim-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  cursor: pointer;
}

.sim-select option {
  background: var(--bg-2);
  color: var(--text);
}

.sim-select option:checked {
  background: color-mix(in oklab, var(--accent-soft) 60%, var(--bg-2));
  color: var(--accent);
}

.sim-input.is-mono,
.sim-select.is-mono {
  font-family: var(--mono);
}

.sim-input:focus,
.sim-select:focus {
  outline: none;
  border-color: var(--accent-border);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent-soft) 55%, transparent);
}

.sim-checkbox {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-2);
  cursor: pointer;
}

.sim-checkbox input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.sim-checkbox-indicator {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Crect x='1' y='1' width='14' height='14' rx='4' fill='%2314141f' stroke='%23243243' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat center / 16px 16px;
}

.sim-checkbox-indicator::after {
  content: none;
}

.sim-checkbox:hover .sim-checkbox-indicator {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Crect x='1' y='1' width='14' height='14' rx='4' fill='%2314141f' stroke='%233a5068' stroke-width='1.5'/%3E%3C/svg%3E");
}

.sim-checkbox input:focus-visible + .sim-checkbox-indicator {
  box-shadow: 0 0 0 4px rgba(0, 180, 216, 0.18);
}

.sim-checkbox-indicator.is-checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Crect x='1' y='1' width='14' height='14' rx='4' fill='%2300b4d8' stroke='%2300b4d8' stroke-width='1.5'/%3E%3Cpath d='M4 8.2L6.7 10.8L12 5.4' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.sim-checkbox:hover .sim-checkbox-indicator.is-checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Crect x='1' y='1' width='14' height='14' rx='4' fill='%2322c4e8' stroke='%2322c4e8' stroke-width='1.5'/%3E%3Cpath d='M4 8.2L6.7 10.8L12 5.4' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.sim-checkbox-compact {
  gap: 8px;
  font-size: 12px;
}

.sim-inline-message {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.10);
  color: #fecaca;
}

.sim-inline-message.is-info {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
}

.sim-inline-message strong {
  display: block;
  margin-bottom: 4px;
}

.sim-inline-message p {
  margin: 0;
  white-space: pre-line;
}

.sim-form-hint {
  margin: 6px 0 0;
  color: var(--text-4);
  font-size: 12px;
  white-space: pre-line;
}

.sim-inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.sim-btn {
  min-height: 32px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
}

.sim-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.sim-btn-primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #071118;
  font-weight: 700;
}

.sim-btn-danger {
  border-color: rgba(239, 68, 68, 0.35);
  color: #fecaca;
  background: rgba(239, 68, 68, 0.10);
}

.sim-btn-warning {
  border-color: rgba(245, 158, 11, 0.32);
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
}

.sim-form-footer,
.sim-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sim-form-footer {
  padding: 14px 18px 18px;
  border-top: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg-1) 94%, transparent);
}

.sim-form-footer .sim-footer-actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
}

.sim-statusbar {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg-0) 84%, var(--bg-3));
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 12px;
}

.sim-status-left,
.sim-status-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sim-status-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sim-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 7, 10, 0.56);
  backdrop-filter: blur(8px);
}

.sim-modal {
  width: min(560px, 100%);
  border-radius: 18px;
  border: 1px solid var(--border-strong);
  background: var(--bg-2);
  box-shadow: 0 40px 120px -60px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  animation: sim-modal-in 0.18s ease;
}

.sim-modal-head {
  padding: 18px 18px 10px;
}

.sim-modal-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
}

.sim-modal-body {
  padding: 0 18px 18px;
  color: var(--text-3);
  white-space: pre-line;
}

.sim-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 18px 18px;
}

.sim-radio-group {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.sim-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-3);
}

.sim-popup {
  position: absolute;
  top: 28px;
  right: 24px;
  z-index: 15;
  width: min(500px, calc(100% - 48px));
  border-radius: 18px;
  border: 1px solid var(--border-strong);
  background: #06080b;
  overflow: hidden;
  box-shadow: 0 40px 120px -65px rgba(0, 0, 0, 0.95);
}

.sim-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #d8e4f0;
  font-family: var(--mono);
  font-size: 12px;
}

.sim-popup-body {
  padding: 18px;
  color: #bcd2ea;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
}

.sim-popup-body p {
  margin: 0 0 12px;
}

.sim-popup-body p:last-child {
  margin-bottom: 0;
}

.sim-popup-accent {
  color: #68e2ff;
}

.sim-debug-overlay {
  align-items: stretch;
  justify-content: flex-end;
  padding: 24px;
}

.sim-debug-surface {
  width: min(860px, 100%);
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sim-debug-toolbar,
.sim-debug-log {
  border-radius: 18px;
  border: 1px solid var(--border-strong);
  background: color-mix(in oklab, var(--bg-2) 96%, transparent);
  box-shadow: 0 40px 120px -60px rgba(0, 0, 0, 0.9);
}

.sim-debug-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
}

.sim-debug-copy {
  min-width: 0;
}

.sim-debug-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.sim-debug-title-row h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
}

.sim-debug-copy p {
  margin: 0;
  color: var(--text-3);
  font-size: 12px;
}

.sim-debug-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sim-debug-log {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px;
  font-family: var(--mono);
}

.sim-debug-entry {
  display: grid;
  grid-template-columns: 82px 64px minmax(0, 1fr);
  gap: 12px;
  padding: 6px 0;
  color: #c8d6e5;
  font-size: 12px;
}

.sim-debug-entry.is-warning {
  color: #f59e0b;
}

.sim-debug-entry.is-error {
  color: #ef4444;
}

.sim-debug-entry-time,
.sim-debug-entry-level {
  color: inherit;
  opacity: 0.82;
}

.sim-debug-entry-message {
  min-width: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.sim-login-shell {
  min-height: 780px;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(circle at top, rgba(0, 180, 216, 0.16), transparent 35%),
    linear-gradient(180deg, color-mix(in oklab, var(--bg-2) 92%, white), var(--bg-1));
}

.sim-login-card {
  width: min(420px, 100%);
  padding: 24px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg-3) 94%, transparent);
  box-shadow: var(--shadow-card);
}

.sim-login-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 16px;
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
}

.sim-login-mark svg {
  width: 26px;
  height: 26px;
}

.sim-login-title {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 24px;
}

.sim-login-copy {
  margin: 0 0 18px;
  color: var(--text-3);
}

.sim-login-note {
  margin-top: 12px;
  color: var(--text-4);
  font-size: 12px;
}

@keyframes sim-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes sim-modal-in {
  from {
    transform: translateY(10px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@media (max-width: 1150px) {
  .simpage-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .sim-home-view {
    grid-template-columns: 1fr;
  }

  .sim-splitter {
    display: none;
  }

  .sim-list-panel {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    max-height: 380px;
  }

  .sim-users-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .sim-shell {
    grid-template-columns: 1fr;
  }

  .sim-sidebar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .sim-side-group {
    flex-direction: row;
  }

  .sim-sidebar-spacer {
    display: none;
  }

  .sim-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .sim-user-row {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .sim-user-row .sim-row-actions {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .sim-drive-chip {
    order: 4;
    justify-self: start;
  }

  .sim-row-actions {
    order: 3;
    justify-self: end;
  }

  .sim-form-grid.split {
    grid-template-columns: 1fr;
  }

  .sim-popup {
    right: 12px;
    width: calc(100% - 24px);
  }

  .sim-statusbar,
  .sim-form-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .sim-form-footer .sim-footer-actions {
    margin-left: 0;
    width: 100%;
  }

  .sim-form-footer .sim-footer-actions .sim-btn {
    flex: 1;
  }
}

@media (max-width: 475px) {
  .simpage-note {
    flex-direction: column;
  }

  article.sim-row.is-mounted.is-selected {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .sim-row-actions {
      justify-content: flex-start;
      min-width: 100%;
  }
}