/* rwx chimera */

:root {
  --xp-blue-border: #0055ea;
  --xp-window-bg: #ece9d8;
  --xp-font: Tahoma, "Segoe UI", Arial, sans-serif;
  --xp-titlebar-bg: linear-gradient(180deg, #0058ee 0%, #3593ff 4%, #288eff 6%, #127dff 8%, #036ffc 10%, #0262ee 14%, #0057e5 20%, #0054e3 24%, #0055e7 56%, #0054e1 66%, #004dd0 76%, #0046c5 86%, #0036a6 100%);
  --xp-btn-bg: linear-gradient(180deg, #ffffff 0%, #ecebe5 86%, #d8d0c4 100%);
  --xp-btn-hover: linear-gradient(180deg, #fef4dc 0%, #fde49d 86%, #f8cd62 100%);
}

* {
  box-sizing: border-box;
}

body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: transparent !important;
  font-family: var(--xp-font);
  font-size: 11px;
  color: #000;
  overflow: hidden;
  user-select: none;
}

/* fallback */
@media screen and (min-width: 721px) {
  body:not(.desktop-app) {
    background-color: #5a7edc;
    background-image: radial-gradient(circle at 50% 30%, #799ef0 0%, #3b5cb8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* container */
.app-container {
  width: 100%;
  height: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* titlebar */
.title-bar {
  background: var(--xp-titlebar-bg) !important;
  height: 30px !important;
  min-height: 30px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 6px 0 8px !important;
  border-top-left-radius: 8px !important;
  border-top-right-radius: 8px !important;
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  border: 1px solid #0022aa !important;
  border-bottom: none !important;
  cursor: move !important;
  user-select: none !important;
  box-sizing: border-box !important;
  width: 100% !important;
}

/* content frame */
.window-content-frame {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-left: 3px solid var(--xp-blue-border);
  border-right: 3px solid var(--xp-blue-border);
  border-bottom: 3px solid var(--xp-blue-border);
  border-top: none;
  background: var(--xp-window-bg);
  overflow: hidden;
  box-sizing: border-box;
}

/* maximized */
.app-container.maximized {
  width: 100vw !important;
  height: 100vh !important;
}

.app-container.maximized .title-bar {
  border-radius: 0 !important;
  border: none !important;
}

.app-container.maximized .window-content-frame {
  border: none !important;
}

.title-bar-text {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: bold;
  color: #ffffff;
  text-shadow: 1px 1px 2px #0a246a;
  letter-spacing: 0.3px;
  pointer-events: none;
}

.title-bar-text img {
  width: 16px;
  height: 16px;
  filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.4));
}

.title-bar-controls {
  display: flex;
  align-items: center;
  gap: 2px;
}

.title-bar-controls button {
  cursor: pointer;
}

/* menu */
.window-menu {
  background: #ece9d8;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px;
  border-bottom: 1px solid #d0cebf;
  font-size: 11px;
}

.menu-item {
  padding: 2px 6px;
  cursor: pointer;
  position: relative;
  border-radius: 2px;
}

.menu-item:hover, .menu-item.active {
  background: #316ac5;
  color: white;
}

.menu-item u {
  text-decoration: underline;
}

.menu-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid #716f64;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.35);
  display: none;
  flex-direction: column;
  min-width: 170px;
  z-index: 999;
  padding: 2px 0;
}

.menu-item.active .menu-dropdown {
  display: flex;
}

.menu-dropdown-item {
  padding: 4px 16px 4px 10px;
  font-size: 11px;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.menu-dropdown-item:hover {
  background: #316ac5;
  color: white;
}

.menu-dropdown-separator {
  height: 1px;
  background: #d4d0c8;
  margin: 3px 0;
}

.menu-dropdown-item.lang-item {
  justify-content: flex-start;
  gap: 6px;
  padding: 3px 14px 3px 8px;
}

.menu-dropdown-item.lang-item .lang-check {
  display: inline-block;
  width: 14px;
  font-size: 11px;
  font-weight: bold;
  text-align: center;
}

/* body */
.window-body {
  padding: 8px 12px 8px 12px;
  background: #ece9d8;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  overflow: hidden;
}

/* groupbox */
fieldset.xp-groupbox {
  border: 1px solid #d4d0c8;
  box-shadow: inset 1px 1px 0 #fff, 1px 1px 0 #fff;
  border-radius: 1px;
  padding: 5px 10px 7px 10px;
  margin: 0;
  background: #faf8f5;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

legend.xp-legend {
  font-weight: bold;
  color: #003399;
  font-size: 12.5px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

legend.xp-legend img {
  width: 15px;
  height: 15px;
}

/* inputs */
.xp-input {
  border: 1px solid #7f9db9;
  box-shadow: inset 1px 1px 1px rgba(0, 0, 0, 0.15);
  background: #ffffff;
  font-family: var(--xp-font);
  font-size: 12.5px;
  padding: 4px 6px;
  color: #000;
  border-radius: 0;
  outline: none;
}

.xp-input:focus {
  border-color: #225ad9;
  box-shadow: inset 1px 1px 1px rgba(0, 0, 0, 0.15), 0 0 2px rgba(34, 90, 217, 0.4);
}

/* textarea */
#inputPhrase,
textarea.xp-input {
  resize: vertical !important;
  max-width: 100% !important;
  min-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
  min-height: 54px;
  max-height: 180px;
  font-size: 13px;
  line-height: 1.35;
  padding: 5px 7px;
}

/* selects */
select,
select.xp-input,
select:hover,
select:focus,
select:active {
  height: 25px;
  font-size: 12px;
  padding: 2px 24px 2px 7px !important;
  color: #000000 !important;
  background-color: #ffffff !important;
  background-repeat: no-repeat !important;
  background-position: calc(100% - 2px) center !important;
  background-size: 16px 17px !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  outline: none !important;
}

select option {
  color: #000000 !important;
  background-color: #ffffff !important;
}

/* select hints */
.custom-select-container {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.xp-styled-select {
  width: 100%;
}

.select-hint-overlay {
  position: absolute;
  right: 24px;
  color: #707070 !important;
  font-size: 11px;
  font-family: "Courier New", Consolas, monospace;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

/* toggle */
.xp-toggle-btn {
  height: 25px !important;
  padding: 0 9px !important;
  font-size: 12px !important;
  color: #0c337c !important;
  font-weight: bold !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  cursor: pointer !important;
  user-select: none !important;
}

.xp-toggle-btn.active {
  background: linear-gradient(180deg, #dbd5c8 0%, #d0c8be 100%) !important;
  border-color: #003c74 !important;
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.4) !important;
  color: #002288 !important;
  font-weight: bold !important;
}

.xp-toggle-indicator {
  font-size: 12px;
  color: #0c337c;
  line-height: 1;
}

.xp-toggle-btn.active .xp-toggle-indicator {
  color: #002288;
  font-weight: bold;
}

/* split preview */
.split-preview {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #f0efe8;
  border: 1px inset #d0cebf;
  padding: 4px 8px;
  border-radius: 2px;
  margin-top: 5px;
  white-space: nowrap;
}

.split-pill {
  padding: 2.5px 8px;
  border-radius: 3px;
  font-size: 11.5px;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 135px;
  display: inline-block;
  vertical-align: middle;
}

.split-pill-1 {
  background: #e6f0fa;
  border: 1px solid #8ab4f8;
  color: #1a56c4;
}

.split-pill-2 {
  background: #eaf8e6;
  border: 1px solid #81c995;
  color: #1e7e34;
}

.split-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: #555;
  white-space: nowrap;
  flex-shrink: 0;
}

/* slider */
input[type="range"].xp-range-slider,
.xp-range-slider {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 90px !important;
  min-width: 90px !important;
  max-width: 90px !important;
  height: 16px;
  background: transparent !important;
  cursor: pointer;
  vertical-align: middle;
  padding: 0;
  margin: 0;
  flex-shrink: 0 !important;
}

.xp-range-slider:focus {
  outline: none;
}

.xp-range-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  background: #d4ceba !important;
  border-top: 1px solid #808080 !important;
  border-left: 1px solid #808080 !important;
  border-bottom: 1px solid #ffffff !important;
  border-right: 1px solid #ffffff !important;
  border-radius: 1px;
}

input[type="range"].xp-range-slider::-webkit-slider-thumb,
.xp-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none !important;
  appearance: none !important;
  height: 15px !important;
  width: 11px !important;
  background-image: none !important;
  background: linear-gradient(180deg, #ffffff 0%, #ece9d8 40%, #c8c3b4 100%) !important;
  border: 1px solid #003c74 !important;
  border-radius: 2px !important;
  margin-top: -6px !important;
  transform: none !important;
  box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.25) !important;
  cursor: ew-resize !important;
}

input[type="range"].xp-range-slider::-webkit-slider-thumb:hover,
.xp-range-slider::-webkit-slider-thumb:hover {
  background-image: none !important;
  border-color: #e68b2c !important;
  background: linear-gradient(180deg, #fef4dc 0%, #fde49d 86%, #f8cd62 100%) !important;
}

input[type="range"].xp-range-slider::-webkit-slider-thumb:active,
.xp-range-slider::-webkit-slider-thumb:active {
  background-image: none !important;
  background: #dbd5c8 !important;
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.3) !important;
}

input[type="range"].xp-range-slider::-moz-range-thumb,
.xp-range-slider::-moz-range-thumb {
  height: 15px !important;
  width: 11px !important;
  background-image: none !important;
  background: linear-gradient(180deg, #ffffff 0%, #ece9d8 40%, #c8c3b4 100%) !important;
  border: 1px solid #003c74 !important;
  border-radius: 2px !important;
  transform: none !important;
  cursor: ew-resize !important;
}

/* pipeline grid */
.pipeline-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: #222;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* buttons */
button:not(.title-bar-controls button):not(.xp-dialog-close):not(.bubble-close-btn):not(.balloon-close),
.xp-button,
a.xp-button,
.xp-dialog-btn,
.xp-toggle-btn {
  background: linear-gradient(180deg, #ffffff 0%, #ecebe5 45%, #e2ded5 50%, #d8d0c4 100%) !important;
  border: 1px solid #003c74 !important;
  border-radius: 3px !important;
  box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #c8c0b4 !important;
  font-family: var(--xp-font) !important;
  font-size: 11.5px !important;
  color: #0c337c !important;
  cursor: pointer !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-weight: bold;
  outline: none;
  user-select: none;
  text-decoration: none;
  box-sizing: border-box;
  min-width: 0;
  transition: none;
}

/* hover */
button:not(.title-bar-controls button):not(.xp-dialog-close):not(.bubble-close-btn):not(.balloon-close):hover,
.xp-button:hover,
a.xp-button:hover,
.xp-dialog-btn:hover,
.xp-toggle-btn:hover {
  background: linear-gradient(180deg, #fffdf8 0%, #ffe9b8 45%, #ffd274 50%, #fec040 100%) !important;
  border-color: #e68b2c !important;
  box-shadow: inset 0 1px 0 #ffffff, inset 0 -1px 0 #d68725 !important;
  color: #002288 !important;
}

/* active */
button:not(.title-bar-controls button):not(.xp-dialog-close):not(.bubble-close-btn):not(.balloon-close):active,
button.active:not(.title-bar-controls button),
.xp-button:active,
.xp-button.active,
a.xp-button:active,
.xp-dialog-btn:active,
.xp-toggle-btn.active {
  background: linear-gradient(180deg, #dbd5c8 0%, #d0c8be 100%) !important;
  border-color: #003c74 !important;
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.4) !important;
  color: #002288 !important;
}

/* primary */
.xp-button-primary {
  font-weight: bold !important;
  box-shadow: inset 0 0 0 1px #316ac5, inset 1px 1px 0 #ffffff, inset -1px -1px 0 #c8c0b4 !important;
  border-color: #003c74 !important;
}

.xp-button-primary:hover {
  border-color: #e68b2c !important;
  box-shadow: inset 0 0 0 1px #e68b2c, inset 0 1px 0 #ffffff, inset 0 -1px 0 #d68725 !important;
}

/* output */
.output-box {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 1px 0 2px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.output-main-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.output-input-wrap {
  flex: 1 1 0%;
  min-width: 0;
  max-width: 100%;
  display: flex;
  overflow: hidden;
}

input[type="text"].output-input,
.output-input {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  font-family: "Courier New", Consolas, monospace;
  font-size: 16px;
  font-weight: bold;
  color: #0b2e75;
  background: #fdfdfd;
  padding: 5px 8px;
  letter-spacing: 0.5px;
  border: 1px solid #7f9db9;
  box-sizing: border-box !important;
  height: 52px !important;
  min-height: 52px !important;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

input[type="text"].output-input:focus,
.output-input:focus {
  text-overflow: clip;
}

/* separator */
.output-v-sep {
  width: 1px;
  align-self: stretch;
  background: linear-gradient(180deg, rgba(34, 90, 217, 0) 0%, rgba(34, 90, 217, 0.75) 50%, rgba(34, 90, 217, 0) 100%);
  margin: 0 2px;
  flex-shrink: 0;
}

/* actions */
.output-action-cluster {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3px;
  width: 180px;
  min-width: 180px;
  max-width: 180px;
  flex-shrink: 0;
  height: 52px;
}

.output-top-actions {
  display: flex;
  gap: 3px;
  width: 100%;
}

.xp-btn-compact {
  width: 30px !important;
  min-width: 30px !important;
  max-width: 30px !important;
  height: 24.5px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  font-size: 13.5px !important;
  cursor: pointer;
}

.xp-btn-copy-wide {
  flex: 1;
  height: 24.5px !important;
  font-size: 12px !important;
  font-weight: bold !important;
  letter-spacing: 0.5px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  color: #0c337c !important;
}

.xp-btn-copy-wide:hover {
  color: #002288 !important;
}

.xp-btn-bitwarden-wide {
  width: 100% !important;
  height: 24.5px !important;
  font-size: 11.5px !important;
  font-weight: bold !important;
  color: #0c337c !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  padding: 0 4px !important;
}

.xp-btn-bitwarden-wide:hover {
  color: #002288 !important;
}

#separatorSelect {
  padding-left: 7px !important;
}

.status-pane-github {
  display: flex;
  align-items: center;
  padding: 0 6px !important;
}

.status-github-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #0b2e75 !important;
  text-decoration: none !important;
  font-weight: bold;
  font-size: 11px;
}

.status-github-link:hover {
  color: #e65100 !important;
  text-decoration: underline !important;
}

.status-github-link:hover svg {
  fill: #e65100;
}

/* anatomy */
.anatomy-container {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  margin-top: 3px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.badge-row {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.badge-row-secondary {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.anatomy-label-spacer {
  visibility: hidden;
  user-select: none;
  pointer-events: none;
}

.anatomy-length {
  margin-left: auto;
  color: #666;
  font-size: 11.5px;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.badge-sep {
  color: #999;
  font-size: 10px;
  user-select: none;
  flex-shrink: 0;
}

.badge-tag {
  padding: 1.5px 6px;
  border-radius: 2px;
  font-family: "Courier New", monospace;
  font-weight: bold;
  font-size: 10.5px;
  line-height: 1.2;
  border: 1px solid #ccc;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  min-width: 0;
  flex-shrink: 1;
}

.badge-tag.badge-warn {
  background: #fef9c3;
  border-color: #fde047;
  color: #854d0e;
  font-size: 10px;
  padding: 1px 5px;
  font-family: inherit;
  font-weight: bold;
  max-width: none;
  cursor: help;
  flex-shrink: 0;
}

.badge-hex { background: #f3e8fd; border-color: #d1b3f7; color: #5b21b6; }
.badge-b64 { background: #e0f2fe; border-color: #7dd3fc; color: #0369a1; }
.badge-word { background: #fef3c7; border-color: #fde047; color: #92400e; }
.badge-num { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.badge-sym { background: #dcfce7; border-color: #86efac; color: #166534; }

/* strength */
.strength-container {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.strength-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
}

.strength-score-label {
  font-weight: bold;
  font-size: 14px;
}

.score-0 { color: #b91c1c; }
.score-1 { color: #c2410c; }
.score-2 { color: #d97706; }
.score-3 { color: #15803d; }
.score-4 { color: #047857; }

/* progress bar */
.xp-segmented-bar {
  height: 18px;
  background: #ffffff;
  border: 1px solid #686868;
  box-shadow: inset 0 0 1px 0 #686868;
  border-radius: 3px;
  display: flex;
  gap: 2px;
  padding: 1px;
}

.xp-segment {
  flex: 1;
  height: 100%;
  background: #e4e2d8;
  border-radius: 1px;
}

.xp-segment.active-0 { background: linear-gradient(180deg, #fca5a5 0%, #dc2626 100%); }
.xp-segment.active-1 { background: linear-gradient(180deg, #fdba74 0%, #ea580c 100%); }
.xp-segment.active-2 { background: linear-gradient(180deg, #fde047 0%, #ca8a04 100%); }
.xp-segment.active-3 { background: linear-gradient(180deg, #86efac 0%, #16a34a 100%); }
.xp-segment.active-4 {
  background: repeating-linear-gradient(90deg, #fff 0, #fff 1px, transparent 0, transparent 8px),
              linear-gradient(180deg, #acedad 0%, #4cda50 30%, #2ed330 50%, #42d845 70%, #8fe791 100%);
}

.crack-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 2px;
}

.crack-box {
  background: #ffffff;
  border: 1px solid #d4d0c8;
  padding: 5px 8px;
  border-radius: 2px;
  font-size: 11.5px;
}

.crack-box-val {
  font-size: 12.5px;
  font-weight: bold;
  color: #0c337c;
  margin-top: 2px;
}

/* status bar */
.status-bar {
  background: #ece9d8;
  border-top: 1px solid #919b9c;
  display: flex;
  padding: 2px 4px;
  gap: 3px;
  font-size: 10px;
  color: #333;
}

.status-pane {
  background: #ece9d8;
  border: 1px solid;
  border-color: #919b9c #fff #fff #919b9c;
  padding: 2px 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-pane-flex {
  flex: 1;
}

/* dialog */
.xp-dialog-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  border-radius: 8px 8px 0 0;
  animation: fadeIn 0.12s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.xp-dialog-window {
  width: 470px;
  max-width: 92%;
  background: #ece9d8;
  border: 3px solid #0055ea;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  font-family: var(--xp-font);
  position: relative;
  box-sizing: border-box;
  max-height: 94vh;
}

.xp-dialog-titlebar {
  background: linear-gradient(180deg, #0058ee 0%, #3593ff 4%, #288eff 6%, #127dff 8%, #036ffc 10%, #0262ee 14%, #0057e5 20%, #0054e3 40%, #0055e7 60%, #0054e1 80%, #0041c4 100%);
  padding: 3px 4px 3px 8px;
  height: 28px;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 5px 5px 0 0;
  border-bottom: 1px solid #0022aa;
  user-select: none;
}

.xp-dialog-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #ffffff;
  font-weight: bold;
  font-size: 11px;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.7);
}

.xp-dialog-close {
  background: linear-gradient(180deg, #e7735a 0%, #d8472c 50%, #b82a0e 100%);
  border: 1px solid #ffffff;
  color: #ffffff;
  font-weight: bold;
  font-size: 11px;
  width: 21px;
  height: 21px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  margin-right: 2px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
}

.xp-dialog-close:hover {
  background: linear-gradient(180deg, #ff957d 0%, #f05e42 50%, #d33516 100%);
}

.xp-dialog-close:active {
  background: linear-gradient(180deg, #b82a0e 0%, #d8472c 50%, #e7735a 100%);
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.xp-dialog-body {
  padding: 12px 14px 10px 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #ece9d8;
  max-height: calc(94vh - 80px);
  overflow-y: auto;
}

.xp-dialog-icon-col {
  flex-shrink: 0;
  padding-top: 2px;
}

.xp-dialog-content-col {
  flex: 1;
  font-size: 11px;
  color: #000;
  line-height: 1.35;
}

.xp-dialog-headline {
  font-size: 12px;
  font-weight: bold;
  color: #0c337c;
  margin-bottom: 6px;
}

.xp-dialog-message {
  font-size: 11px;
  color: #222;
}

.xp-dialog-message a {
  color: #003399;
  font-weight: bold;
  text-decoration: underline;
}

.xp-dialog-message a:hover {
  color: #e65100;
}

.xp-dialog-buttons {
  padding: 8px 14px 10px 14px;
  background: #ece9d8;
  display: flex;
  justify-content: center;
  gap: 10px;
  border-top: 1px solid #d4ceba;
}

.xp-dialog-btn {
  min-width: 85px !important;
  height: 24px !important;
  font-size: 11.5px !important;
  font-weight: bold !important;
  color: #0c337c !important;
  cursor: pointer;
}

/* balloon */
.xp-balloon {
  position: absolute;
  top: 40px;
  right: 15px;
  max-width: 320px;
  width: auto;
  min-width: 260px;
  background-color: #ffffdd;
  border: 1px solid #000000;
  border-radius: 6px;
  padding: 7px 10px;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  display: none;
  animation: balloonPop 0.2s ease-out;
}

/* mascot */
.xp-mascot-guide {
  position: absolute;
  top: 36px;
  right: 12px;
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  animation: mascotFadeIn 0.2s ease-out;
}

@keyframes mascotFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.mascot-speech-bubble {
  background-color: #ffffdd;
  border: 1px solid #000000;
  border-radius: 6px;
  padding: 7px 9px 8px 9px;
  max-width: 260px;
  box-shadow: 2px 3px 10px rgba(0, 0, 0, 0.35);
  position: relative;
  font-family: var(--xp-font);
}

.mascot-speech-bubble::before {
  content: "";
  position: absolute;
  right: -8px;
  top: 13px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid #000000;
}

.mascot-speech-bubble::after {
  content: "";
  position: absolute;
  right: -7px;
  top: 14px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid #ffffdd;
}

.mascot-speech-bubble.bubble-warning {
  background-color: #fffdf2;
  border-color: #b45309;
  box-shadow: 2px 3px 12px rgba(180, 83, 9, 0.25), 2px 3px 10px rgba(0, 0, 0, 0.35);
}

.mascot-speech-bubble.bubble-warning::before {
  border-left-color: #b45309;
}

.mascot-speech-bubble.bubble-warning::after {
  border-left-color: #fffdf2;
}

.mascot-speech-bubble.bubble-warning .bubble-header {
  color: #92400e;
}

.bubble-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: bold;
  color: #0c337c;
}

.bubble-close-btn {
  cursor: pointer;
  font-size: 11px;
  color: #777;
  padding: 0 2px;
  line-height: 1;
}

.bubble-close-btn:hover {
  color: #000;
}

.bubble-body {
  font-size: 10.5px;
  color: #222;
  line-height: 1.35;
}

.mascot-avatar {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  cursor: pointer;
  filter: drop-shadow(1px 2px 4px rgba(0, 0, 0, 0.3));
  transition: transform 0.15s ease;
}

.mascot-avatar:hover {
  transform: scale(1.08);
}

.mascot-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.balloon-text a {
  color: #003399 !important;
  font-weight: bold !important;
  text-decoration: underline !important;
}

.balloon-text a:hover {
  color: #e65100 !important;
}

/* tip box */
.xp-tip-box {
  background: #ffffff;
  border: 1px solid #d4d0c8;
  border-radius: 3px;
  padding: 6px 10px;
  margin-top: 5px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11.5px;
  line-height: 1.4;
}

.xp-tip-header {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: #333;
}

.xp-tip-header img {
  margin-top: 3px;
  flex-shrink: 0;
}

.xp-tip-title {
  color: #0c337c;
  font-weight: bold;
}

.xp-entropy-val {
  color: #0b2e75;
  font-weight: bold;
}

.xp-tip-header a, .xp-link {
  color: #0c337c;
  font-weight: bold;
  text-decoration: underline;
  cursor: pointer;
}

.xp-tip-header a:hover, .xp-link:hover {
  color: #e65100;
}

.xp-test-link {
  color: #0c337c;
  font-weight: bold;
  text-decoration: underline;
  font-size: 11px;
  margin-right: 2px;
  cursor: pointer;
}

.xp-test-link:hover {
  color: #e65100;
}

.xp-tip-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  padding-top: 4px;
  border-top: 1px dashed #dcd8c8;
  color: #555;
  font-size: 10.5px;
}

select option:disabled {
  color: #888888 !important;
  background-color: #f2f2f2 !important;
}

.xp-test-badge {
  background: #f0f4fc;
  border: 1px solid #9bb7e8;
  color: #072a6b;
  padding: 1px 5px;
  border-radius: 2px;
  text-decoration: none;
  font-weight: bold;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}

.xp-test-badge:hover {
  background: #2b70dc;
  color: #ffffff;
  border-color: #0022aa;
}

@keyframes balloonPop {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.balloon-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: bold;
  font-size: 11px;
  margin-bottom: 3px;
}

.balloon-title {
  display: flex;
  align-items: center;
  gap: 5px;
}

.balloon-title img {
  width: 14px;
  height: 14px;
}

.balloon-close {
  cursor: pointer;
  font-weight: bold;
  color: #666;
}

.balloon-close:hover {
  color: #b91c1c;
}

.balloon-text {
  font-size: 11px;
  line-height: 1.3;
  color: #222;
}

/* hidden */
[style*="display: none"],
[style*="display:none"],
.hidden {
  display: none !important;
}

/* context menu */
.xp-context-menu {
  position: fixed;
  background: #ffffff;
  border: 1px solid #716f64;
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.35);
  display: none;
  flex-direction: column;
  min-width: 155px;
  z-index: 10000;
  padding: 2px 0;
  user-select: none;
  font-family: var(--xp-font);
}

.xp-context-item {
  padding: 4px 16px 4px 18px;
  font-size: 11px;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
}

.xp-context-item:hover:not(.disabled) {
  background: #316ac5;
  color: #ffffff;
}

.xp-context-item.disabled {
  color: #888888;
  cursor: default;
  pointer-events: none;
}

.xp-context-separator {
  height: 1px;
  background: #d4d0c8;
  margin: 3px 1px;
}

.xp-ctx-shortcut {
  font-size: 10px;
  opacity: 0.7;
}

.xp-context-item:hover:not(.disabled) .xp-ctx-shortcut {
  color: #ffffff;
  opacity: 0.9;
}

/* lang tweaks */
html[lang="ja"] .window-body,
html[lang="zh"] .window-body {
  gap: 5px;
  padding: 5px 12px 6px 12px;
  overflow: hidden;
}

html[lang="ja"] fieldset.xp-groupbox,
html[lang="zh"] fieldset.xp-groupbox {
  padding: 4px 10px 4px 10px;
}

html[lang="ja"] #inputPhrase,
html[lang="ja"] textarea.xp-input,
html[lang="zh"] #inputPhrase,
html[lang="zh"] textarea.xp-input {
  min-height: 48px;
}

html[lang="ja"] .xp-toggle-btn,
html[lang="zh"] .xp-toggle-btn {
  padding: 0 6px !important;
  font-size: 11px !important;
}

html[lang="ja"] .xp-tip-box,
html[lang="zh"] .xp-tip-box {
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1.35;
}

html[lang="ja"] .crack-box,
html[lang="zh"] .crack-box {
  padding: 3px 6px;
}
