.v1-menubar {
  border-bottom: 0;
  background: #2d2d30;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 4px;
  overflow: visible;
  position: relative;
  z-index: 10000;
  /* Base (LTR) order: logo/File/Options/Tools/Help on the left, window
     controls on the right. Full mirror below flips this for RTL. */
  direction: ltr;
}

/* Full RTL mirror: flex order reverses on its own once direction flips
   (window controls -> left edge, logo/menu triggers -> right edge) - these
   overrides fix the pieces that don't mirror automatically: each dropdown's
   physical left-anchor, the submenu flyout's left-anchor, the submenu
   arrow glyph, and the brand/window-controls edge margins. */
html[dir="rtl"] .v1-menubar {
  direction: rtl;
}

html[dir="rtl"] .v1-menu-dropdown {
  left: auto;
  right: 0;
}

html[dir="rtl"] .v1-menu-dd-flyout {
  left: auto;
  right: 100%;
}

html[dir="rtl"] .v1-menu-dd-arrow {
  display: inline-block;
  transform: scaleX(-1);
}

html[dir="rtl"] .v1-menu-brand {
  margin: 0 2px 0 6px;
}

html[dir="rtl"] .v1-menubar-action--square {
  margin-right: 0;
  margin-left: 6px;
}

html[dir="rtl"] .v1-window-controls {
  margin-right: 0;
  margin-left: -4px;
}

.v1-menu-brand {
  width: 34px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 6px 0 2px;
  flex: 0 0 auto;
}

.v1-menu-brand-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
  opacity: 0.95;
}

.v1-menu-group {
  position: relative;
}

.v1-menu-spacer {
  margin-left: auto;
  flex: 1 1 auto;
  min-width: 12px;
}

.v1-session-name-spacer {
  flex: 1 1 auto;
  min-width: 12px;
}

.v1-session-name-label {
  flex: 0 1 auto;
  max-width: 40vw;
  color: #a8adb5;
  font: 500 12px/1 var(--font-ui);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  pointer-events: none;
  user-select: none;
}

.v1-window-controls {
  display: flex;
  align-items: stretch;
  height: 100%;
  margin-right: -4px;
}

.v1-menubar-separator {
  width: 1px;
  height: 16px;
  background: #4a4f58;
  margin: 0 6px;
  flex: 0 0 auto;
  opacity: 0.9;
}

.v1-menubar-action {
  border: 0;
  background: transparent;
  color: #c7c7c7;
  font-size: 12px;
  font-family: var(--font-ui);
  line-height: 1;
  height: 100%;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  white-space: nowrap;
}

.v1-menubar-action:hover {
  background: #46484c;
  color: #ffffff;
}

.v1-menubar-action--square {
  width: 26px;
  min-width: 26px;
  height: 22px;
  padding: 0;
  margin-right: 6px;
  border: 1px solid #4a4f58;
  border-radius: 6px;
  background: linear-gradient(180deg, #2f333a 0%, #272a30 100%);
  color: #ffb18d;
  font-size: 12px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.v1-menubar-action--square:hover {
  background: linear-gradient(180deg, #3d2f2c 0%, #342522 100%);
  border-color: #8a4f41;
  color: #ffd2c0;
}

.v1-menubar-action--square:active {
  transform: translateY(1px);
}

.v1-menubar-action--square.is-active {
  background: linear-gradient(180deg, #1f3a52 0%, #16283a 100%);
  border-color: #4a90d9;
  color: #9fd4ff;
}

.v1-menubar-action--square.is-active:hover {
  background: linear-gradient(180deg, #244a68 0%, #1c3348 100%);
  border-color: #5fa4ea;
  color: #c3e4ff;
}

.v1-menubar-toggle {
  height: 100%;
  display: inline-flex;
  align-items: center;
  color: #c7c7c7;
  font-family: var(--font-ui);
  font-size: 12px;
  padding: 0 8px;
  cursor: pointer;
  user-select: none;
}

.v1-menubar-toggle:hover {
  background: #46484c;
  color: #ffffff;
}

.v1-menubar-toggle input[type="checkbox"] {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: #0e639c;
}

.v1-window-btn {
  width: 46px;
  border: 0;
  background: transparent;
  color: #c7c7c7;
  font-size: 13px;
  font-family: var(--font-ui);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.v1-window-btn:hover {
  background: #46484c;
  color: #ffffff;
}

.v1-window-btn.close:hover {
  background: #c42b1c;
  color: #ffffff;
}

.v1-menu-trigger {
  border: 0;
  background: transparent;
  color: #cccccc;
  font-size: 12px;
  padding: 5px 11px;
  font-family: var(--font-ui);
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.2;
}

.v1-menu-group.open .v1-menu-trigger,
.v1-menu-trigger:hover {
  background: #094771;
  color: #ffffff;
}

.v1-menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 320px;
  background: #252526;
  border: 1px solid #3c3c3c;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  padding: 6px 0;
  z-index: 10020;
}

.v1-menu-group.open .v1-menu-dropdown {
  display: block;
}

.v1-menu-dd-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: #cccccc;
  text-align: start;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  font-size: 13px;
  font-family: var(--font-ui);
  line-height: 1.3;
  padding: 6px 16px;
  cursor: pointer;
}

.v1-menu-dd-item[hidden] {
  display: none;
}

.v1-menu-dd-item:hover,
.v1-menu-dd-item.active {
  background: #094771;
  color: #ffffff;
}

.v1-menu-dd-item[aria-disabled="true"] {
  color: #7a7d82;
  cursor: default;
}

.v1-menu-dd-item[aria-disabled="true"]:hover {
  background: transparent;
  color: #7a7d82;
}

.v1-menu-dd-item .shortcut {
  color: #9da0a6;
  font-family: var(--font-ui);
  letter-spacing: 0.01em;
}

.v1-menu-dd-item:hover .shortcut {
  color: #d7e5f8;
}

.v1-menu-dd-sep {
  height: 1px;
  margin: 6px 0;
  background: #3c3c3c;
}

.v1-menu-dd-submenu {
  position: relative;
}

.v1-menu-dd-item--submenu .v1-menu-dd-arrow {
  color: #9da0a6;
  font-size: 11px;
}

.v1-menu-dd-item--submenu:hover .v1-menu-dd-arrow {
  color: #d7e5f8;
}

.v1-menu-dd-flyout {
  display: none;
  position: absolute;
  top: -7px;
  left: 100%;
  min-width: 260px;
  max-height: 320px;
  overflow-y: auto;
  background: #252526;
  border: 1px solid #3c3c3c;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  padding: 6px 0;
  z-index: 10021;
}

.v1-menu-dd-submenu:hover .v1-menu-dd-flyout,
.v1-menu-dd-submenu.open .v1-menu-dd-flyout {
  display: block;
}

.v1-menu-dd-flyout-item {
  font-family: var(--font-mono);
  font-size: 12px;
}

.v1-menu-dd-flyout-empty {
  padding: 6px 16px;
  color: #7a7d82;
  font-size: 12px;
  font-style: italic;
}

.v1-exit-modal[hidden] {
  display: none;
}

.v1-exit-modal {
  position: fixed;
  inset: 0;
  z-index: 12050;
  background: rgba(9, 10, 12, 0.58);
  display: grid;
  place-items: center;
  padding: 18px;
}

.v1-exit-panel {
  width: min(430px, 100%);
  border: 1px solid #3c414a;
  border-radius: 0;
  background: #232830;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.55);
  padding: 0;
  display: grid;
  gap: 0;
}

.v1-exit-head {
  display: flex;
  align-items: center;
  min-height: 34px;
  border-bottom: 1px solid #30343b;
  background: #252a31;
  padding: 6px 10px;
}

.v1-exit-head h3 {
  margin: 0;
  color: var(--txt);
  font: 600 12px/1.2 var(--font-ui);
}

.v1-exit-message {
  margin: 0;
  padding: 12px 10px 10px;
  color: #cfd6e2;
  font: 400 13px/1.45 var(--font-ui);
}

.v1-exit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 10px 10px;
}

.v1-exit-btn {
  border: 1px solid #4a4f58;
  border-radius: 0;
  background: #2c3139;
  color: #d6dce8;
  font: 500 12px/1 var(--font-ui);
  min-height: 30px;
  padding: 0 12px;
  cursor: pointer;
}

.v1-exit-btn:hover {
  background: #39424f;
  border-color: #4a4f58;
}

.v1-exit-btn:focus-visible {
  outline: 2px solid #7fb7ff;
  outline-offset: 1px;
}

.v1-exit-btn--primary {
  border-color: #0f6ab2;
  background: #1c7fd0;
  color: #ffffff;
}

.v1-exit-btn--primary:hover {
  background: #2790e7;
  border-color: #2e8fe0;
}

.v1-session-missing-ext-list {
  max-height: 220px;
  overflow-y: auto;
  margin: 0 10px 10px;
  border: 1px solid #30343b;
  background: #1c2027;
}

.v1-session-missing-ext-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  color: #cfd6e2;
  font: 400 13px/1.3 var(--font-ui);
  cursor: pointer;
}

.v1-session-missing-ext-row + .v1-session-missing-ext-row {
  border-top: 1px solid #30343b;
}

.v1-session-missing-ext-row input[type="checkbox"] {
  flex: 0 0 auto;
}

.v1-session-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  border: none;
  background: none;
  padding: 3px 4px;
  min-width: 0;
  overflow: hidden;
}

.v1-session-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.v1-session-row-date {
  color: #8a93a3;
  font: 400 11px/1.4 var(--font-ui);
  flex-shrink: 0;
  white-space: nowrap;
}

.v1-session-row-name {
  color: #5b9dff;
  font: 500 12px/1.4 var(--font-ui);
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 1;
  min-width: 0;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v1-session-row-name:hover,
.v1-session-row-name:focus-visible {
  text-decoration: underline;
  outline: none;
}

.v1-session-row-folder {
  color: #7c8494;
  font: 400 11px/1.4 var(--font-ui);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v1-session-row-remove {
  border: none;
  background: none;
  color: #8a93a3;
  font: 400 14px/1 var(--font-ui);
  cursor: pointer;
  padding: 0 4px;
  flex-shrink: 0;
  opacity: 0;
}

.v1-session-row:hover .v1-session-row-remove,
.v1-session-row-remove:focus-visible {
  opacity: 1;
}

.v1-session-row-remove:hover {
  color: #ff6b6b;
}
