:root {
  --ink: #16324f;
  --ink-soft: #4b6b88;
  --ink-faint: #7894ad;
  --blue: #3f9fe8;
  --blue-deep: #1f6fb2;
  --blue-soft: #dff4ff;
  --blue-mist: #f2fbff;
  --pink: #ffb7cf;
  --pink-soft: #fff0f6;
  --amber: #ffcf6e;
  --green: #41c99a;
  --danger: #e85d75;
  --terminal-bg: #0b1220;
  --terminal-panel: #0e1728;
  --terminal-fg: #dbeafe;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-strong: rgba(255, 255, 255, 0.96);
  --line: rgba(88, 159, 214, 0.22);
  --line-strong: rgba(88, 159, 214, 0.36);
  --shadow: 0 18px 50px rgba(31, 111, 178, 0.15);
  --shadow-soft: 0 8px 24px rgba(31, 111, 178, 0.1);
  --radius: 22px;
  --font-ui: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Yu Gothic", sans-serif;
  --font-mono: "Cascadia Code", "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-ui);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--blue-deep);
}

code,
pre {
  font-family: var(--font-mono);
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(63, 159, 232, 0.28);
}

:focus-visible {
  outline: 3px solid rgba(63, 159, 232, 0.45);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.muted {
  color: var(--ink-faint);
}

.noscript {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 999px;
  background: #fff3f6;
  color: var(--danger);
  box-shadow: var(--shadow-soft);
  z-index: 999;
}

/* ------------------------------------------------------------------ */
/* Login                                                               */
/* ------------------------------------------------------------------ */

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 12%, rgba(255, 255, 255, 0.95), transparent 32%),
    radial-gradient(circle at 88% 82%, rgba(255, 205, 224, 0.5), transparent 30%),
    linear-gradient(145deg, #eaf9ff 0%, #d8f2ff 45%, #c8eaff 100%);
}

.login-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.login-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(63, 159, 232, 0.16) 1.2px, transparent 1.2px),
    radial-gradient(rgba(255, 183, 207, 0.22) 1.2px, transparent 1.2px);
  background-position: 0 0, 26px 26px;
  background-size: 52px 52px;
  opacity: 0.45;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.75);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.55), rgba(143, 211, 255, 0.18));
  box-shadow: inset 0 0 24px rgba(255, 255, 255, 0.8);
  animation: bubble-float 12s ease-in-out infinite;
}

.bubble-1 {
  width: 180px;
  height: 180px;
  left: -50px;
  top: 8%;
}

.bubble-2 {
  width: 90px;
  height: 90px;
  right: 8%;
  top: 12%;
  animation-delay: -3s;
}

.bubble-3 {
  width: 220px;
  height: 220px;
  right: -70px;
  bottom: -50px;
  animation-delay: -6s;
}

.bubble-4 {
  width: 54px;
  height: 54px;
  left: 18%;
  bottom: 14%;
  animation-delay: -8s;
}

.paw-float,
.star-float {
  position: absolute;
  user-select: none;
  opacity: 0.5;
  animation: float-soft 7s ease-in-out infinite;
}

.paw-float {
  font-size: 26px;
  filter: saturate(0.7);
}

.paw-1 {
  left: 8%;
  top: 58%;
  transform: rotate(-18deg);
}

.paw-2 {
  right: 14%;
  bottom: 18%;
  font-size: 34px;
  animation-delay: -2.4s;
  transform: rotate(16deg);
}

.paw-3 {
  right: 24%;
  top: 34%;
  font-size: 20px;
  animation-delay: -4.8s;
  transform: rotate(-8deg);
}

.star-float {
  color: #ffffff;
  font-size: 30px;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.9);
}

.star-1 {
  left: 24%;
  top: 12%;
  animation-delay: -1.2s;
}

.star-2 {
  right: 18%;
  top: 66%;
  font-size: 20px;
  animation-delay: -3.6s;
}

.login-shell {
  position: relative;
  z-index: 2;
  width: min(94vw, 560px);
  padding: 24px 0;
}

.login-card {
  position: relative;
  padding: 26px 34px 24px;
  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.9), rgba(245, 253, 255, 0.78));
  box-shadow:
    0 30px 80px rgba(31, 111, 178, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  text-align: center;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 150px;
  height: 5px;
  transform: translateX(-50%);
  border-radius: 0 0 999px 999px;
  background: linear-gradient(90deg, transparent, var(--blue), var(--pink), transparent);
  opacity: 0.8;
}

.login-mascot-wrap {
  position: relative;
  width: 208px;
  margin: -6px auto 4px;
}

.login-mascot {
  display: block;
  width: 100%;
  filter: drop-shadow(0 16px 24px rgba(31, 111, 178, 0.16));
  animation: mascot-bob 5s ease-in-out infinite;
}

.mascot-bubble {
  position: absolute;
  right: -56px;
  top: 28px;
  padding: 7px 12px;
  border-radius: 14px 14px 14px 4px;
  background: #fff;
  color: var(--blue-deep);
  font-size: 0.72rem;
  white-space: nowrap;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--line);
}

.mascot-bubble::after {
  content: "";
  position: absolute;
  left: -6px;
  bottom: 5px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: rotate(45deg);
}

.login-kicker {
  margin: 0 0 6px;
  color: var(--blue-deep);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.login-card h1 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  letter-spacing: 0.04em;
  background: linear-gradient(120deg, var(--blue-deep), #2a86c9 50%, #e07fa4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-sub {
  margin: 8px 0 22px;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.login-form {
  text-align: left;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 0.03em;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  padding: 11px 13px;
  font-size: 0.86rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.field textarea {
  resize: vertical;
  min-height: 86px;
  line-height: 1.5;
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(63, 159, 232, 0.12);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #a9bccd;
}

.password-wrap {
  position: relative;
  display: block;
}

.password-wrap input {
  padding-right: 46px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  border-radius: 10px;
  padding: 6px;
  transition: background 0.18s ease, color 0.18s ease;
}

.icon-btn:hover {
  background: rgba(63, 159, 232, 0.1);
  color: var(--blue-deep);
}

.password-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
}

.password-eye.is-active {
  background: rgba(63, 159, 232, 0.12);
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 13px;
  padding: 11px 18px;
  background: linear-gradient(135deg, #53b5f5, #2a86d4);
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 22px rgba(42, 134, 212, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.primary-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(42, 134, 212, 0.34);
  filter: saturate(1.06);
}

.primary-btn:active:not(:disabled) {
  transform: translateY(0);
}

.primary-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.primary-btn.wide {
  width: 100%;
}

.login-btn {
  width: 100%;
  min-height: 52px;
  margin-top: 2px;
  font-size: 1rem;
  border-radius: 15px;
}

.login-btn.is-success {
  background: linear-gradient(135deg, #58d3a4, #2aa77a);
  box-shadow: 0 10px 22px rgba(42, 167, 122, 0.26);
}

.login-btn-paw {
  font-size: 1.1rem;
  transition: transform 0.2s ease;
}

.login-btn:hover .login-btn-paw {
  transform: rotate(-14deg) scale(1.1);
}

.form-error {
  margin: 0 0 12px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(232, 93, 117, 0.28);
  background: rgba(255, 240, 244, 0.9);
  color: #c33c57;
  font-size: 0.78rem;
  line-height: 1.45;
}

.form-error.shake {
  animation: shake 0.38s ease;
}

.login-hint {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 0.72rem;
  line-height: 1.65;
  color: var(--ink-soft);
}

.login-hint p {
  margin: 3px 0;
}

.login-hint code {
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(63, 159, 232, 0.1);
  color: var(--blue-deep);
  font-size: 0.68rem;
}

.login-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
}

.login-features span {
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(223, 244, 255, 0.8);
  color: var(--blue-deep);
  font-size: 0.66rem;
  border: 1px solid rgba(88, 159, 214, 0.16);
}

.login-footer {
  margin-top: 18px;
  text-align: center;
  font-size: 0.68rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.login-footer p {
  margin: 2px 0;
}

/* ------------------------------------------------------------------ */
/* App shell                                                           */
/* ------------------------------------------------------------------ */

.app-body {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 8% 8%, rgba(255, 255, 255, 0.9), transparent 28%),
    radial-gradient(circle at 92% 92%, rgba(255, 205, 224, 0.35), transparent 30%),
    linear-gradient(145deg, #eaf9ff 0%, #ddf4ff 48%, #c9eaff 100%);
}

.app-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.app-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(63, 159, 232, 0.12) 1.2px, transparent 1.2px),
    radial-gradient(rgba(255, 183, 207, 0.18) 1.2px, transparent 1.2px);
  background-position: 0 0, 26px 26px;
  background-size: 52px 52px;
  opacity: 0.5;
}

.app-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.55;
}

.app-glow-1 {
  width: 360px;
  height: 360px;
  left: -120px;
  top: 18%;
  background: radial-gradient(circle, rgba(143, 211, 255, 0.55), transparent 68%);
}

.app-glow-2 {
  width: 420px;
  height: 420px;
  right: -140px;
  bottom: -80px;
  background: radial-gradient(circle, rgba(255, 183, 207, 0.4), transparent 68%);
}

.app-paw {
  position: absolute;
  opacity: 0.22;
  user-select: none;
  font-size: 38px;
  animation: float-soft 9s ease-in-out infinite;
}

.app-paw-1 {
  right: 4%;
  top: 16%;
  transform: rotate(18deg);
}

.app-paw-2 {
  left: 6%;
  bottom: 10%;
  font-size: 26px;
  transform: rotate(-14deg);
  animation-delay: -4s;
}

.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  padding: 10px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(18px);
  box-shadow: 0 4px 22px rgba(31, 111, 178, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 220px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  box-shadow: 0 6px 16px rgba(31, 111, 178, 0.2);
}

.brand-text h1 {
  margin: 0;
  font-size: 1.04rem;
  letter-spacing: 0.02em;
}

.brand-text p {
  margin: 2px 0 0;
  font-size: 0.64rem;
  letter-spacing: 0.13em;
  color: var(--blue-deep);
  text-transform: uppercase;
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9fb3c5;
  box-shadow: 0 0 0 3px rgba(159, 179, 197, 0.16);
}

.status-pill.is-online {
  color: #16825f;
  border-color: rgba(65, 201, 154, 0.35);
  background: rgba(232, 255, 247, 0.78);
}

.status-pill.is-online .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(65, 201, 154, 0.2);
}

.status-pill.is-connecting {
  color: #9b6b0a;
  border-color: rgba(255, 207, 110, 0.5);
  background: rgba(255, 250, 233, 0.85);
}

.status-pill.is-connecting .status-dot {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(255, 207, 110, 0.22);
  animation: pulse-dot 1.2s ease-in-out infinite;
}

.status-pill.is-error {
  color: #b8324c;
  border-color: rgba(232, 93, 117, 0.35);
  background: rgba(255, 240, 244, 0.85);
}

.status-pill.is-error .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(232, 93, 117, 0.18);
}

.target-label {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 5px 9px;
  border-radius: 8px;
  background: rgba(223, 244, 255, 0.7);
  color: var(--blue-deep);
  font-family: var(--font-mono);
  font-size: 0.66rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink-soft);
  padding: 7px 10px;
  font-size: 0.73rem;
  font-weight: 600;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.ghost-btn:hover {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--blue-deep);
  transform: translateY(-1px);
}

.ghost-btn.danger:hover {
  color: var(--danger);
  border-color: rgba(232, 93, 117, 0.35);
  background: #fff6f8;
}

.btn-emoji {
  font-size: 0.9rem;
}

.sidebar-toggle {
  display: none;
  font-size: 1.1rem;
}

.app-layout {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 376px minmax(0, 1fr);
  gap: 16px;
  padding: 16px 20px 20px;
}

.sidebar {
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 2px 5px 8px 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(63, 159, 232, 0.3) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 7px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(63, 159, 232, 0.26);
  border-radius: 999px;
}

.mascot-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(239, 250, 255, 0.78));
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

.mascot-wrap {
  position: relative;
  flex: 0 0 94px;
  width: 94px;
  height: 94px;
}

.mascot-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(31, 111, 178, 0.14));
  animation: mascot-bob 6s ease-in-out infinite;
}

.mascot-ear {
  display: none;
}

.mascot-copy {
  min-width: 0;
}

.speech-bubble {
  position: relative;
  margin: 0 0 7px;
  padding: 9px 11px;
  border-radius: 12px 12px 12px 4px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.76rem;
  line-height: 1.45;
  box-shadow: 0 4px 12px rgba(31, 111, 178, 0.06);
}

.speech-bubble::before {
  content: "";
  position: absolute;
  left: -6px;
  bottom: 8px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: rotate(45deg);
}

.mascot-caption {
  margin: 0;
  color: var(--ink-faint);
  font-size: 0.65rem;
}

.panel-section {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

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

.section-head h2 {
  margin: 0;
  font-size: 0.86rem;
  letter-spacing: 0.02em;
}

.section-head h2 span {
  margin-right: 2px;
}

.section-sub {
  color: var(--ink-faint);
  font-size: 0.64rem;
  white-space: nowrap;
}

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(223, 244, 255, 0.72);
  border: 1px solid rgba(88, 159, 214, 0.12);
}

.mode-tab {
  border: 0;
  border-radius: 9px;
  padding: 8px 6px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 700;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.mode-tab.is-active {
  background: #fff;
  color: var(--blue-deep);
  box-shadow: 0 3px 10px rgba(31, 111, 178, 0.12);
}

.mode-panel {
  margin-top: 12px;
}

.info-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(88, 159, 214, 0.16);
  font-size: 0.73rem;
}

.info-label {
  color: var(--ink-faint);
}

.info-value {
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.panel-note {
  margin: 10px 0;
  color: var(--ink-faint);
  font-size: 0.66rem;
  line-height: 1.55;
}

.field-row {
  display: flex;
  gap: 8px;
}

.field.grow {
  flex: 1;
}

.field.port-field {
  flex: 0 0 82px;
}

#ssh-form .field {
  margin-bottom: 10px;
}

#ssh-form .field input,
#ssh-form .field textarea {
  padding: 9px 11px;
  font-size: 0.78rem;
}

#ssh-form .field textarea {
  min-height: 70px;
  font-size: 0.68rem;
}

.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 3px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: rgba(223, 244, 255, 0.62);
}

.auth-option {
  position: relative;
  cursor: pointer;
}

.auth-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.auth-option span {
  display: block;
  text-align: center;
  padding: 7px 6px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 600;
  transition: background 0.18s ease, color 0.18s ease;
}

.auth-option input:checked + span {
  background: #fff;
  color: var(--blue-deep);
  box-shadow: 0 2px 8px rgba(31, 111, 178, 0.1);
}

.check-line {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 4px 0 10px;
  color: var(--ink-soft);
  font-size: 0.68rem;
  cursor: pointer;
}

.check-line input {
  accent-color: var(--blue);
}

.connected-summary {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(65, 201, 154, 0.25);
  background: rgba(232, 255, 247, 0.7);
}

.summary-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(65, 201, 154, 0.14);
}

.connected-summary div {
  flex: 1;
  min-width: 0;
}

.connected-summary strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.connected-summary p {
  margin: 2px 0 0;
  color: var(--ink-faint);
  font-size: 0.62rem;
  word-break: break-all;
}

.mini-btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink-soft);
  padding: 5px 8px;
  font-size: 0.68rem;
  font-weight: 600;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.mini-btn:hover {
  background: #fff;
  color: var(--blue-deep);
  border-color: var(--line-strong);
}

.mini-btn.danger:hover {
  color: var(--danger);
  border-color: rgba(232, 93, 117, 0.35);
}

.recipe-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.recipe-group {
  border: 1px solid rgba(88, 159, 214, 0.16);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.56);
  padding: 10px;
}

.recipe-group-head {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-bottom: 8px;
}

.recipe-group-icon {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(223, 244, 255, 0.8);
  font-size: 0.86rem;
}

.recipe-group-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
}

.recipe-group-desc {
  margin: 2px 0 0;
  color: var(--ink-faint);
  font-size: 0.63rem;
  line-height: 1.45;
}

.recipe-card,
.recipe-row {
  border: 1px solid rgba(88, 159, 214, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  padding: 9px 10px;
}

.recipe-card + .recipe-card,
.recipe-row + .recipe-row {
  margin-top: 7px;
}

.recipe-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.recipe-title {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
}

.badge {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(223, 244, 255, 0.9);
  color: var(--blue-deep);
  font-size: 0.58rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge.hot {
  background: #fff0f5;
  color: #c94f7c;
}

.badge.stable {
  background: #e9fff6;
  color: #17835f;
}

.badge.danger {
  background: #fff0f2;
  color: #c33c57;
}

.recipe-desc {
  margin: 4px 0 7px;
  color: var(--ink-soft);
  font-size: 0.65rem;
  line-height: 1.5;
}

.cmd-preview {
  margin: 0;
  padding: 7px 8px;
  max-height: 52px;
  overflow: hidden;
  border-radius: 8px;
  background: #0d1b2f;
  color: #9fd4ff;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  border: 1px solid rgba(143, 211, 255, 0.14);
}

.recipe-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
}

.recipe-actions .mini-btn {
  flex: 0 0 auto;
}

.run-btn {
  flex: 1;
  border: 0;
  border-radius: 8px;
  padding: 7px 10px;
  background: linear-gradient(135deg, #53b5f5, #2a86d4);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.run-btn:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
}

.run-btn.is-danger {
  background: linear-gradient(135deg, #f58aa0, #d94a67);
}

.recipe-select-wrap {
  position: relative;
}

.recipe-select {
  width: 100%;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 30px 8px 9px;
  background: #fff;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 600;
}

.recipe-select-wrap::after {
  content: "⌄";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-55%);
  color: var(--blue-deep);
  pointer-events: none;
}

.recipe-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.recipe-row .recipe-main {
  flex: 1;
  min-width: 0;
}

.recipe-row .recipe-title {
  font-size: 0.71rem;
}

.recipe-row .recipe-desc {
  margin-bottom: 0;
}

.recipe-row .run-btn {
  flex: 0 0 auto;
  padding: 6px 9px;
}

.skeleton-card {
  height: 64px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(223, 244, 255, 0.5), rgba(255, 255, 255, 0.85), rgba(223, 244, 255, 0.5));
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
  border: 1px solid rgba(88, 159, 214, 0.1);
}

.skeleton-card.short {
  height: 44px;
}

.sidebar-warning {
  margin: 0 2px 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(232, 93, 117, 0.25);
  background: rgba(255, 246, 248, 0.7);
  color: #9d4b5c;
  font-size: 0.63rem;
  line-height: 1.55;
}

/* ------------------------------------------------------------------ */
/* Terminal                                                            */
/* ------------------------------------------------------------------ */

.terminal-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid rgba(143, 211, 255, 0.18);
  background: var(--terminal-bg);
  box-shadow: 0 22px 60px rgba(12, 30, 54, 0.28);
  overflow: hidden;
}

.terminal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 12px;
  background: var(--terminal-panel);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.window-dots {
  display: flex;
  gap: 5px;
  flex: 0 0 auto;
}

.window-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: block;
}

.dot-red {
  background: #ff6b81;
}

.dot-amber {
  background: #ffcf6e;
}

.dot-green {
  background: #41c99a;
}

.terminal-title-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.terminal-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #d7ecff;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
}

.terminal-subtitle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #6684a6;
  font-size: 0.6rem;
}

.terminal-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.term-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #8faac7;
  font-size: 0.86rem;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.term-btn:hover {
  background: rgba(143, 211, 255, 0.08);
  color: #c9ecff;
  border-color: rgba(143, 211, 255, 0.12);
}

.term-btn.danger:hover {
  color: #ff9aac;
  background: rgba(232, 93, 117, 0.1);
  border-color: rgba(232, 93, 117, 0.2);
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  background: #0c1627;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.search-bar input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(143, 211, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #d7ecff;
  padding: 6px 9px;
  font-size: 0.72rem;
}

.search-bar input:focus {
  outline: none;
  border-color: rgba(143, 211, 255, 0.45);
}

.search-bar .mini-btn {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(143, 211, 255, 0.16);
  color: #a9c6e4;
}

.terminal-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 9px 11px;
  background:
    radial-gradient(circle at 80% 0%, rgba(63, 159, 232, 0.08), transparent 35%),
    var(--terminal-bg);
}

.terminal {
  width: 100%;
  height: 100%;
}

.terminal .xterm {
  height: 100%;
  padding: 1px;
}

.terminal .xterm-viewport {
  background: transparent !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(143, 211, 255, 0.22) transparent;
}

.terminal .xterm-viewport::-webkit-scrollbar {
  width: 8px;
}

.terminal .xterm-viewport::-webkit-scrollbar-thumb {
  background: rgba(143, 211, 255, 0.22);
  border-radius: 999px;
}

.terminal .xterm-screen {
  padding: 0;
}

.terminal-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(7, 14, 26, 0.72);
  backdrop-filter: blur(4px);
  transition: opacity 0.24s ease, visibility 0.24s ease;
}

.terminal-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.overlay-card {
  width: min(420px, 100%);
  padding: 20px 22px 22px;
  border-radius: 20px;
  border: 1px solid rgba(143, 211, 255, 0.2);
  background: linear-gradient(160deg, rgba(17, 32, 54, 0.96), rgba(11, 22, 39, 0.96));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.32);
  text-align: center;
  color: #d7ecff;
}

.overlay-mascot {
  width: 116px;
  height: 116px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(63, 159, 232, 0.2));
}

.overlay-card h3 {
  margin: 4px 0 6px;
  font-size: 1rem;
}

.overlay-card p {
  margin: 0 auto 14px;
  max-width: 340px;
  color: #8faac7;
  font-size: 0.74rem;
  line-height: 1.6;
}

.overlay-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.overlay-actions .ghost-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(143, 211, 255, 0.18);
  color: #b9d8f4;
}

.overlay-actions .ghost-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #e5f6ff;
}

.batch-running {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 11px;
  background: rgba(255, 207, 110, 0.12);
  border-top: 1px solid rgba(255, 207, 110, 0.18);
  color: #ffd98a;
  font-size: 0.66rem;
}

.batch-running-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.batch-running-label strong {
  font-family: var(--font-mono);
  color: #ffe9b3;
}

.batch-running .mini-btn {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 207, 110, 0.25);
  color: #ffd98a;
}

.quick-keys {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  padding: 7px 11px;
  background: var(--terminal-panel);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.quick-key {
  border: 1px solid rgba(143, 211, 255, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  color: #8faac7;
  padding: 3px 7px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  line-height: 1.5;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.quick-key:hover {
  background: rgba(143, 211, 255, 0.1);
  color: #d7ecff;
  border-color: rgba(143, 211, 255, 0.28);
}

.quick-key.accent {
  color: #8ff0c8;
  border-color: rgba(65, 201, 154, 0.25);
}

.quick-spacer {
  flex: 1;
}

.font-indicator {
  color: #5f7d9f;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  cursor: default;
}

.terminal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 12px;
  background: #09101c;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  color: #5f7d9f;
  font-family: var(--font-mono);
  font-size: 0.6rem;
}

.foot-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.latency-label {
  color: #4e8c74;
}

.clock {
  color: #5f7d9f;
}

/* ------------------------------------------------------------------ */
/* Modals                                                              */
/* ------------------------------------------------------------------ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 20, 35, 0.55);
  backdrop-filter: blur(6px);
  animation: fade-in 0.18s ease;
}

.modal {
  width: min(700px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: linear-gradient(160deg, #fbffff, #f2fbff);
  box-shadow: 0 28px 80px rgba(8, 28, 52, 0.28);
  padding: 20px 22px;
  animation: modal-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.modal.wide {
  width: min(1120px, 96vw);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-title {
  margin: 0;
  font-size: 1.02rem;
}

.modal-subtitle {
  margin: 3px 0 0;
  color: var(--ink-faint);
  font-size: 0.7rem;
}

.modal-close {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-soft);
  font-size: 1.1rem;
  line-height: 1;
}

.modal-close:hover {
  background: #fff;
  color: var(--danger);
}

.modal-body {
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.6;
}

.modal-note {
  margin: 8px 0;
  color: var(--ink-faint);
  font-size: 0.7rem;
}

.warning-box {
  margin: 10px 0;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid rgba(255, 207, 110, 0.45);
  background: rgba(255, 250, 233, 0.9);
  color: #8c6413;
  font-size: 0.71rem;
  line-height: 1.55;
  white-space: pre-line;
}

.primary-btn.is-danger {
  background: linear-gradient(135deg, #f58aa0, #d94a67);
  box-shadow: 0 10px 22px rgba(217, 74, 103, 0.28);
}

.primary-btn.is-danger:hover:not(:disabled) {
  box-shadow: 0 14px 28px rgba(217, 74, 103, 0.34);
}

.warning-text {
  color: #b8324c;
}

.batch-hint code {
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(63, 159, 232, 0.1);
  color: var(--blue-deep);
  font-size: 0.64rem;
}

.batch-server-card .mini-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.terminal-panel:fullscreen {
  border-radius: 0;
  border: 0;
  width: 100vw;
  height: 100vh;
}

.terminal-panel:fullscreen .terminal-wrap {
  padding: 14px;
}

.warning-box.danger {
  border-color: rgba(232, 93, 117, 0.35);
  background: rgba(255, 240, 244, 0.9);
  color: #a8324a;
}

.modal-command {
  margin: 10px 0;
  padding: 10px 12px;
  max-height: 190px;
  overflow: auto;
  border-radius: 10px;
  border: 1px solid rgba(143, 211, 255, 0.16);
  background: #0d1b2f;
  color: #a9dcff;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.upload-result p {
  margin: 4px 0;
  font-size: 0.74rem;
}

.upload-result code {
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(63, 159, 232, 0.1);
  color: var(--blue-deep);
  font-size: 0.68rem;
  word-break: break-all;
}

.modal-actions .ghost-btn {
  padding: 9px 13px;
  font-size: 0.76rem;
}

.modal-actions .primary-btn {
  font-size: 0.78rem;
}

.batch-tabs {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border-radius: 11px;
  background: rgba(223, 244, 255, 0.72);
  margin-bottom: 12px;
}

.batch-tab {
  border: 0;
  border-radius: 8px;
  padding: 7px 12px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
}

.batch-tab.is-active {
  background: #fff;
  color: var(--blue-deep);
  box-shadow: 0 2px 8px rgba(31, 111, 178, 0.1);
}

.batch-pane {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.batch-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
}

.batch-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.batch-field > span {
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 700;
}

.batch-field textarea,
.batch-field input,
.batch-field select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  padding: 9px 10px;
  font-size: 0.76rem;
}

.batch-field textarea {
  min-height: 150px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.55;
}

.batch-field textarea:focus,
.batch-field input:focus,
.batch-field select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(63, 159, 232, 0.12);
}

.batch-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(223, 244, 255, 0.5);
  border: 1px solid rgba(88, 159, 214, 0.14);
}

.batch-options label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 0.69rem;
  cursor: pointer;
}

.batch-options input[type="number"] {
  width: 70px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 0.7rem;
  background: #fff;
}

.batch-options input[type="checkbox"] {
  accent-color: var(--blue);
}

.batch-hint {
  color: var(--ink-faint);
  font-size: 0.66rem;
  line-height: 1.55;
}

.batch-run-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.batch-run-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
}

.batch-run-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 10px;
}

.batch-server-card {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.78);
  overflow: hidden;
}

.batch-server-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  background: rgba(223, 244, 255, 0.55);
  border-bottom: 1px solid rgba(88, 159, 214, 0.12);
}

.batch-server-head strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.batch-status {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(159, 179, 197, 0.18);
  color: var(--ink-soft);
  font-size: 0.58rem;
  font-weight: 700;
}

.batch-status.running {
  background: rgba(255, 207, 110, 0.25);
  color: #92630a;
}

.batch-status.done {
  background: rgba(65, 201, 154, 0.16);
  color: #17835f;
}

.batch-status.error {
  background: rgba(232, 93, 117, 0.14);
  color: #b8324c;
}

.batch-server-card .mini-btn {
  flex: 0 0 auto;
  font-size: 0.6rem;
  padding: 3px 6px;
}

.batch-log {
  height: 190px;
  overflow: auto;
  margin: 0;
  padding: 8px 10px;
  background: #0b1525;
  color: #b9d8f4;
  font-family: var(--font-mono);
  font-size: 0.63rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-all;
}

.batch-log:empty::before {
  content: "等待连接…";
  color: #4e6d8e;
}

.batch-server-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 9px;
  background: #09111e;
  color: #5f7d9f;
  font-family: var(--font-mono);
  font-size: 0.58rem;
}

.settings-grid {
  display: grid;
  gap: 12px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.settings-row.stack {
  display: block;
}

.settings-row.stack > strong {
  margin-bottom: 6px;
}

.settings-row .settings-copy {
  min-width: 0;
}

.settings-row strong {
  display: block;
  color: var(--ink);
  font-size: 0.76rem;
}

.settings-row p {
  margin: 2px 0 0;
  color: var(--ink-faint);
  font-size: 0.65rem;
  line-height: 1.5;
}

.settings-row input[type="range"] {
  width: 120px;
  accent-color: var(--blue);
}

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
  display: inline-block;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #c8d9e8;
  transition: background 0.2s ease;
}

.switch span::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.switch input:checked + span {
  background: var(--blue);
}

.switch input:checked + span::after {
  transform: translateX(18px);
}

.password-change-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.password-change-form .field {
  margin-bottom: 0;
}

.password-change-form .primary-btn {
  grid-column: 1 / -1;
}

/* ------------------------------------------------------------------ */
/* Toasts                                                              */
/* ------------------------------------------------------------------ */

.toast-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(380px, calc(100vw - 36px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 30px rgba(12, 38, 66, 0.18);
  color: var(--ink);
  font-size: 0.74rem;
  line-height: 1.5;
  backdrop-filter: blur(12px);
  animation: toast-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.toast.is-out {
  animation: toast-out 0.2s ease forwards;
}

.toast-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(223, 244, 255, 0.9);
  font-size: 0.78rem;
}

.toast.success {
  border-left: 4px solid var(--green);
}

.toast.error {
  border-left: 4px solid var(--danger);
}

.toast.info {
  border-left: 4px solid var(--blue);
}

.toast.warning {
  border-left: 4px solid var(--amber);
}

.toast-copy {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.toast-close {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--ink-faint);
  font-size: 0.9rem;
  line-height: 1;
  padding: 0 2px;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 1180px) {
  .app-layout {
    grid-template-columns: 340px minmax(0, 1fr);
    padding: 12px 14px 14px;
  }

  .btn-label {
    display: none;
  }

  .topbar-actions .ghost-btn {
    padding: 8px;
  }
}

@media (max-width: 980px) {
  .app-layout {
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 12px;
  }

  .brand {
    min-width: 180px;
  }

  .target-label {
    max-width: 160px;
  }
}

@media (max-width: 900px) {
  .app-body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .topbar {
    flex-wrap: wrap;
    min-height: 0;
    padding: 9px 12px;
    gap: 8px;
  }

  .brand {
    min-width: 0;
    flex: 1;
  }

  .brand-text p {
    display: none;
  }

  .topbar-status {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }

  .target-label {
    max-width: none;
    flex: 1;
  }

  .topbar-actions {
    gap: 4px;
  }

  .sidebar-toggle {
    display: inline-flex;
  }

  .app-layout {
    display: block;
    padding: 10px;
  }

  .sidebar {
    display: none;
    position: fixed;
    z-index: 60;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(92vw, 390px);
    padding: 14px;
    background: linear-gradient(160deg, #f2fcff, #dff4ff);
    box-shadow: -20px 0 60px rgba(8, 28, 52, 0.25);
    overflow-y: auto;
  }

  body.sidebar-open .sidebar {
    display: flex;
  }

  body.sidebar-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(8, 28, 52, 0.38);
    backdrop-filter: blur(2px);
  }

  .terminal-panel {
    min-height: 72vh;
  }

  .terminal-wrap {
    min-height: 56vh;
  }

  .btn-label {
    display: none;
  }
}

@media (max-width: 680px) {
  .login-shell {
    width: 94vw;
    padding: 14px 0;
  }

  .login-card {
    padding: 22px 20px 20px;
    border-radius: 26px;
  }

  .login-mascot-wrap {
    width: 160px;
  }

  .mascot-bubble {
    right: -24px;
    top: 18px;
    font-size: 0.64rem;
  }

  .brand-icon {
    width: 36px;
    height: 36px;
  }

  .brand-text h1 {
    font-size: 0.92rem;
  }

  .topbar-actions .ghost-btn {
    padding: 7px;
  }

  .btn-emoji {
    font-size: 0.96rem;
  }

  .terminal-head {
    padding: 7px 9px;
  }

  .terminal-actions {
    gap: 0;
  }

  .term-btn {
    width: 27px;
    height: 27px;
    font-size: 0.78rem;
  }

  .terminal-wrap {
    padding: 7px;
  }

  .quick-keys {
    padding: 6px 8px;
  }

  .quick-key {
    padding: 3px 6px;
  }

  .terminal-foot {
    padding: 6px 9px;
  }

  .modal {
    padding: 16px;
    border-radius: 18px;
  }

  .batch-grid {
    grid-template-columns: 1fr;
  }

  .batch-run-grid {
    grid-template-columns: 1fr;
  }

  .password-change-form {
    grid-template-columns: 1fr;
  }

  .toast-root {
    right: 10px;
    bottom: 10px;
    max-width: calc(100vw - 20px);
  }
}

@media (max-width: 460px) {
  .brand-text h1 {
    font-size: 0.82rem;
  }

  .topbar-actions .ghost-btn {
    padding: 6px;
  }

  .login-card h1 {
    font-size: 1.55rem;
  }

  .login-sub {
    margin-bottom: 16px;
    font-size: 0.78rem;
  }

  .login-mascot-wrap {
    width: 140px;
  }

  .mascot-bubble {
    display: none;
  }

  .overlay-mascot {
    width: 92px;
    height: 92px;
  }

  .overlay-card {
    padding: 16px;
  }

  .overlay-actions {
    flex-direction: column;
  }

  .overlay-actions .primary-btn,
  .overlay-actions .ghost-btn {
    width: 100%;
  }
}

/* ------------------------------------------------------------------ */
/* Animations                                                          */
/* ------------------------------------------------------------------ */

@keyframes bubble-float {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0, -14px, 0) scale(1.03);
  }
}

@keyframes float-soft {
  0%,
  100% {
    transform: translateY(0) rotate(-4deg);
  }
  50% {
    transform: translateY(-9px) rotate(4deg);
  }
}

@keyframes mascot-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.78);
  }
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-5px);
  }
  40% {
    transform: translateX(5px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(3px);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

