:root {
  --ink: #0B1118;
  --ink-2: #121A24;
  --ink-3: #1A2430;
  --slate: #8A97A8;
  --mist: #C8D0DB;
  --paper: #E8EEF5;
  --teal: #2EE6A6;
  --teal-dim: rgba(46, 230, 166, 0.16);
  --teal-glow: rgba(46, 230, 166, 0.45);
  --coral: #FF6B6B;
  --coral-dim: rgba(255, 107, 107, 0.18);
  --line: rgba(232, 238, 245, 0.08);
  --font-display: "Syne", sans-serif;
  --font-body: "DM Sans", sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --chrome-h: 48px;
}

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

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

.stage,
.log__body,
.servers__list,
.smtp__form {
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 238, 245, 0.22) transparent;
}

.stage::-webkit-scrollbar,
.screen::-webkit-scrollbar,
.log__body::-webkit-scrollbar,
.servers__list::-webkit-scrollbar,
.smtp__form::-webkit-scrollbar {
  width: 8px;
}

.stage::-webkit-scrollbar-thumb,
.screen::-webkit-scrollbar-thumb,
.log__body::-webkit-scrollbar-thumb,
.servers__list::-webkit-scrollbar-thumb,
.smtp__form::-webkit-scrollbar-thumb {
  background: rgba(232, 238, 245, 0.18);
  border-radius: 4px;
}

.stage::-webkit-scrollbar-thumb:hover,
.screen::-webkit-scrollbar-thumb:hover,
.log__body::-webkit-scrollbar-thumb:hover {
  background: rgba(46, 230, 166, 0.35);
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

input {
  outline: none;
}

/* ——— Ambient ——— */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ambient__mesh {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse 50% 40% at 20% 10%, rgba(46, 230, 166, 0.12), transparent 55%),
    radial-gradient(ellipse 45% 35% at 85% 75%, rgba(40, 120, 160, 0.14), transparent 50%),
    radial-gradient(ellipse 60% 50% at 50% 100%, rgba(18, 40, 55, 0.8), transparent 60%),
    linear-gradient(165deg, #0B1118 0%, #0E1620 45%, #0A1016 100%);
  animation: meshDrift 28s ease-in-out infinite alternate;
}

.ambient__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  will-change: transform;
}

.ambient__orb--a {
  width: 420px;
  height: 420px;
  left: -80px;
  top: 20%;
  background: rgba(46, 230, 166, 0.18);
  animation: orbA 22s var(--ease-out) infinite alternate;
}

.ambient__orb--b {
  width: 360px;
  height: 360px;
  right: -60px;
  bottom: 5%;
  background: rgba(60, 140, 180, 0.16);
  animation: orbB 26s var(--ease-out) infinite alternate;
}

.ambient__noise {
  position: absolute;
  inset: 0;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
  mix-blend-mode: overlay;
}

@keyframes meshDrift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-2%, 1.5%, 0) scale(1.04); }
}

@keyframes orbA {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(80px, 40px, 0); }
}

@keyframes orbB {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-60px, -50px, 0); }
}

/* ——— Chrome ——— */
.chrome {
  position: relative;
  z-index: 40;
  height: var(--chrome-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 18px;
  -webkit-app-region: drag;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 17, 24, 0.55);
  backdrop-filter: blur(12px);
}

.chrome__brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.chrome__mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--teal);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.worm-mark {
  font-size: 16px;
  line-height: 1;
  display: inline-block;
  animation: wormWiggle 2.8s ease-in-out infinite;
  filter: drop-shadow(0 0 6px var(--teal-glow));
}

.chrome__status {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
}

.chrome__status.is-live {
  color: var(--teal);
}

.chrome__status.is-error {
  color: var(--coral);
}

.chrome__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  -webkit-app-region: no-drag;
}

.chrome__btn {
  margin-right: 8px;
  padding: 6px 12px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mist);
  border: 1px solid var(--line);
  border-radius: 2px;
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.15s var(--ease-spring);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.chrome__state {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--slate);
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.chrome__btn.is-ready {
  border-color: rgba(46, 230, 166, 0.35);
}

.chrome__btn.is-ready .chrome__state {
  background: var(--teal);
  box-shadow: 0 0 8px rgba(46, 230, 166, 0.45);
}

.chrome__btn:hover {
  color: var(--teal);
  border-color: rgba(46, 230, 166, 0.35);
  background: var(--teal-dim);
}

.chrome__btn:active {
  transform: scale(0.96);
}

.chrome__win {
  width: 36px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--slate);
  font-size: 14px;
  border-radius: 2px;
  transition: background 0.15s, color 0.15s;
}

.chrome__win:hover {
  background: rgba(232, 238, 245, 0.06);
  color: var(--paper);
}

.chrome__win--close:hover {
  background: var(--coral);
  color: #fff;
}

/* ——— Stage / screens ——— */
.stage {
  position: relative;
  z-index: 1;
  height: calc(100% - var(--chrome-h));
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 32px 40px 48px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(18px) scale(0.985);
  filter: blur(8px);
  transition: none;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 100%;
}

.screen--boot {
  align-items: center;
  justify-content: center;
}

.screen.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  filter: none;
}

.screen[hidden] {
  display: flex !important;
}

/* ——— Boot ——— */
.boot {
  position: relative;
  text-align: center;
  width: min(640px, 100%);
}

.boot__glow {
  position: absolute;
  left: 50%;
  top: 40%;
  width: 280px;
  height: 280px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--teal-glow), transparent 65%);
  opacity: 0;
  filter: blur(20px);
  pointer-events: none;
}

.screen--boot.is-active .boot__letter,
.screen--boot.is-active .boot__tag,
.screen--boot.is-active .boot__bar,
.screen--boot.is-active .boot__hint {
  opacity: 1;
  transform: none;
}

.screen--boot.is-active .boot__worm {
  opacity: 1;
}

.screen--boot.is-active .boot__glow {
  opacity: 0.85;
}

.boot__logo {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(56px, 10vw, 96px);
  line-height: 0.95;
  letter-spacing: 0.02em;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.12em 0.18em;
}

.boot__worm {
  display: inline-block;
  font-size: clamp(44px, 9vw, 80px);
  line-height: 1;
  opacity: 0;
  transform: translateY(24px) scale(0.85);
  filter: drop-shadow(0 0 16px var(--teal-glow));
}

.boot__worm--trail {
  transform: translateY(24px) scale(0.85) scaleX(-1);
}

@keyframes wormWiggle {
  0%, 100% { transform: rotate(-8deg) translateY(0); }
  50% { transform: rotate(8deg) translateY(-3px); }
}

.boot__worm--lead {
  animation: wormWiggle 2.6s ease-in-out infinite;
}

.boot__worm--trail {
  animation: wormWiggleTrail 2.6s ease-in-out infinite;
}

@keyframes wormWiggleTrail {
  0%, 100% { transform: scaleX(-1) rotate(-8deg) translateY(0); }
  50% { transform: scaleX(-1) rotate(8deg) translateY(-3px); }
}

.boot__word {
  display: inline-flex;
}

.boot__word--accent {
  color: var(--teal);
}

.boot__letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px) rotateX(40deg);
  transform-origin: 50% 100%;
}

.boot__tag {
  margin: 20px 0 0;
  font-size: 14px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--slate);
  opacity: 0;
}

.boot__bar {
  margin: 36px auto 0;
  width: min(280px, 70%);
  height: 2px;
  background: rgba(232, 238, 245, 0.08);
  overflow: hidden;
  opacity: 0;
}

.boot__bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, transparent, var(--teal), transparent);
  box-shadow: 0 0 12px var(--teal-glow);
}

.boot__hint {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--slate);
  opacity: 0;
}

/* ——— Listening (Telegram) ——— */
.listen {
  width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 28px;
}

.listen__pulse {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.listen__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(46, 230, 166, 0.45);
  animation: listenPulse 2.4s var(--ease-out) infinite;
}

.listen__ring--delay {
  animation-delay: 1.2s;
}

.listen__core {
  position: relative;
  z-index: 1;
  font-size: 28px;
  line-height: 1;
  filter: drop-shadow(0 0 10px var(--teal-glow));
  animation: listenCore 1.8s ease-in-out infinite alternate;
}

@keyframes listenPulse {
  0% {
    transform: scale(0.55);
    opacity: 0.85;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

@keyframes listenCore {
  from {
    transform: scale(1) rotate(-6deg);
    filter: drop-shadow(0 0 8px var(--teal-glow));
  }
  to {
    transform: scale(1.12) rotate(6deg);
    filter: drop-shadow(0 0 18px var(--teal-glow));
  }
}

.listen__head .panel__sub {
  max-width: 46ch;
}

.listen__format {
  width: 100%;
  padding: 18px 20px;
  background: rgba(18, 26, 36, 0.72);
  border: 1px solid var(--line);
  border-left: 2px solid var(--teal);
}

.listen__format-label {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--slate);
}

.listen__code {
  margin: 0;
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  font-size: 14px;
  line-height: 1.65;
  color: var(--paper);
  white-space: pre-wrap;
}

.listen__hint {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--slate);
}

.listen__hint code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  color: var(--teal);
  background: var(--teal-dim);
  padding: 2px 6px;
  border-radius: 2px;
}

.listen__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.listen__chip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  background: rgba(18, 26, 36, 0.55);
}

.listen__chip--inline {
  flex-direction: row;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.listen__chip-label {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--slate);
}

.listen__chip-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--teal);
  word-break: break-word;
}

/* ——— Panels / forms ——— */
.panel {
  width: min(520px, 100%);
}

.panel__eyebrow {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--teal);
}

.panel__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(36px, 5vw, 48px);
  letter-spacing: -0.02em;
  line-height: 1;
}

.panel__sub {
  margin: 12px 0 0;
  max-width: 36ch;
  font-size: 15px;
  line-height: 1.45;
  color: var(--slate);
}

.form {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form--grid {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 16px 14px;
}

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

.field--narrow {
  grid-column: span 1;
}

.field--full {
  grid-column: 1 / -1;
}

.field__label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--slate);
}

.field__input {
  padding: 14px 16px;
  background: rgba(18, 26, 36, 0.85);
  border: 1px solid var(--line);
  border-radius: 2px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.field__input:focus {
  border-color: rgba(46, 230, 166, 0.55);
  box-shadow: 0 0 0 3px var(--teal-dim);
  background: var(--ink-2);
}

.field__input::placeholder {
  color: rgba(138, 151, 168, 0.55);
}

.form__error {
  margin: 0;
  font-size: 13px;
  color: var(--coral);
}

.form__ok {
  margin: 0;
  font-size: 13px;
  color: var(--teal);
}

.form__ok.is-flash {
  animation: smtpFlash 0.55s var(--ease-out);
}

@keyframes smtpFlash {
  0% { opacity: 0; transform: translateY(4px); }
  40% { opacity: 1; transform: translateY(0); }
  100% { opacity: 1; }
}

.form__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.smtp__actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-top: 4px;
}

.smtp__actions .btn {
  flex: 1;
}

/* ——— Buttons ——— */
.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: transform 0.18s var(--ease-spring), background 0.2s, color 0.2s, border-color 0.2s, opacity 0.2s;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

.btn:not(:disabled):hover {
  transform: translateY(-1px);
}

.btn:not(:disabled):active {
  transform: scale(0.97);
}

.btn--primary {
  background: var(--teal);
  color: #06120E;
  box-shadow: 0 0 0 0 transparent;
}

.btn--primary:not(:disabled):hover {
  box-shadow: 0 8px 28px rgba(46, 230, 166, 0.28);
}

.btn--ghost {
  background: transparent;
  color: var(--mist);
  border: 1px solid var(--line);
}

.btn--ghost:not(:disabled):hover {
  border-color: rgba(46, 230, 166, 0.35);
  color: var(--teal);
}

.btn--stack {
  flex-direction: column;
  gap: 4px;
  min-height: 56px;
  padding: 10px 18px;
}

.btn__hint {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--slate);
  font-weight: 500;
  font-family: var(--font-body, inherit);
}

.btn__hint.is-ready {
  color: var(--teal);
}

.btn--danger {
  background: var(--coral-dim);
  color: var(--coral);
  border: 1px solid rgba(255, 107, 107, 0.35);
}

.btn--danger:not(:disabled):hover {
  background: rgba(255, 107, 107, 0.28);
}

.btn--lg {
  min-height: 56px;
  padding: 0 36px;
  font-size: 15px;
}

.btn__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.35) 50%, transparent 65%);
  transform: translateX(-120%);
  pointer-events: none;
}

.btn--primary:not(:disabled):hover .btn__shine {
  animation: shine 0.7s var(--ease-out);
}

@keyframes shine {
  to { transform: translateX(120%); }
}

.btn.is-loading {
  pointer-events: none;
  cursor: wait;
  gap: 10px;
}

.btn.is-loading .btn__spinner {
  display: inline-block;
}

.btn.is-loading .btn__label {
  opacity: 1;
}

.btn__spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  flex-shrink: 0;
  animation: btnSpin 0.65s linear infinite;
}

@keyframes btnSpin {
  to { transform: rotate(360deg); }
}

/* ——— Run screen ——— */
.run {
  width: min(860px, 100%);
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100%;
  max-height: 100%;
}

.run__head .panel__sub {
  max-width: 42ch;
}

.run__core {
  display: flex;
  align-items: center;
  gap: 48px;
  flex-wrap: wrap;
}

.ring-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  flex-shrink: 0;
}

.ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring__track {
  fill: none;
  stroke: rgba(232, 238, 245, 0.08);
  stroke-width: 6;
}

.ring__progress {
  fill: none;
  stroke: var(--teal);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 326.726;
  stroke-dashoffset: 326.726;
  filter: drop-shadow(0 0 6px var(--teal-glow));
}

.ring__center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  padding-top: 2px;
}

.ring__pct {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 42px;
  letter-spacing: -0.03em;
  line-height: 1;
}

.ring__unit {
  font-size: 14px;
  color: var(--slate);
}

.ring__burst {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 200px;
  height: 200px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.stats {
  display: flex;
  gap: 36px;
  flex-wrap: wrap;
}

.stat__value {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 40px;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--paper);
}

.stat[data-flash="fail"] .stat__value {
  color: var(--coral);
}

.stat__label {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--slate);
}

.run__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.log {
  flex: 1;
  min-height: 160px;
  max-height: 240px;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.log__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--slate);
}

.log__clear {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate);
  transition: color 0.15s;
}

.log__clear:hover {
  color: var(--teal);
}

.log__body {
  flex: 1;
  overflow-y: auto;
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
  font-size: 12px;
  line-height: 1.55;
  padding-right: 8px;
}

.log__body::-webkit-scrollbar {
  width: 6px;
}

.log__body::-webkit-scrollbar-thumb {
  background: rgba(232, 238, 245, 0.12);
  border-radius: 3px;
}

.log__line {
  padding: 4px 0;
  color: var(--mist);
  opacity: 0;
  transform: translateX(-12px);
  border-left: 2px solid transparent;
  padding-left: 10px;
}

.log__line.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}

.log__line.is-error {
  color: #ffb4b4;
  border-left-color: var(--coral);
  animation: failFlash 0.55s var(--ease-out);
}

.log__line.is-ok {
  border-left-color: var(--teal);
}

@keyframes failFlash {
  0% { background: transparent; }
  30% { background: var(--coral-dim); }
  100% { background: transparent; }
}

/* ——— Servers slide-over ——— */
.servers {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

.servers.is-open {
  pointer-events: auto;
}

.servers__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 12, 0.55);
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
}

.servers.is-open .servers__backdrop {
  opacity: 1;
}

.servers__sheet {
  position: absolute;
  top: 0;
  right: 0;
  width: min(400px, 92vw);
  height: 100%;
  background: linear-gradient(180deg, #121A24 0%, #0B1118 100%);
  border-left: 1px solid var(--line);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transform: translateX(104%);
  transition: transform 0.45s var(--ease-out);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.35);
}

.servers.is-open .servers__sheet {
  transform: translateX(0);
}

.servers__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.servers__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
}

.servers__list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.servers__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(26, 36, 48, 0.65);
  border: 1px solid var(--line);
  border-radius: 2px;
}

.servers__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.servers__name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.servers__host {
  font-size: 12px;
  color: var(--slate);
}

.servers__remove {
  flex-shrink: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--coral);
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 2px;
  transition: background 0.15s, border-color 0.15s;
}

.servers__remove:hover {
  background: var(--coral-dim);
  border-color: rgba(255, 107, 107, 0.3);
}

.servers__form {
  display: grid;
  grid-template-columns: 1fr 90px;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.servers__empty {
  margin: 24px 0;
  font-size: 13px;
  color: var(--slate);
  text-align: center;
}

.smtp__lead {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--slate);
}

.smtp__status {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(26, 36, 48, 0.65);
  border: 1px solid var(--line);
  border-radius: 2px;
}

.smtp__status-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
}

.smtp__status-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--mist);
  text-align: right;
  word-break: break-all;
}

.smtp__status-value.is-ready {
  color: var(--teal);
}

.smtp__form {
  display: grid;
  grid-template-columns: 1fr 90px;
  gap: 12px;
  flex: 1;
  align-content: start;
  overflow-y: auto;
  padding-top: 4px;
}

#smtpStatus:not(.is-ready),
#templateStatus:not(.is-ready) {
  color: var(--slate);
}

.servers__sheet--wide {
  width: min(560px, 92vw);
}

.chrome__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  color: #06120e;
  background: var(--teal);
  border-radius: 999px;
}

.mx-panel .servers__sheet {
  width: min(640px, 94vw);
  overflow: hidden;
  min-height: 0;
}

.mx-panel .servers__head {
  flex-shrink: 0;
}

.mx__scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 6px;
  margin-right: -2px;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.mx__scroll::-webkit-scrollbar {
  width: 10px;
}

.mx__scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}

.mx__scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.mx__scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.32);
  background-clip: padding-box;
}

.mx__list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 0 0 auto;
}

.mx__item {
  border: 1px solid var(--line);
  background: rgba(18, 26, 36, 0.55);
}

.mx__summary {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 14px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.mx__summary:hover,
.mx__item.is-expanded .mx__summary {
  background: rgba(255, 255, 255, 0.03);
}

.mx__chevron {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  margin-top: 3px;
  border-right: 2px solid var(--slate);
  border-bottom: 2px solid var(--slate);
  transform: rotate(-45deg);
  transition: transform 0.2s ease, border-color 0.15s ease;
}

.mx__item.is-expanded .mx__chevron {
  transform: rotate(45deg);
  margin-top: 1px;
  border-color: var(--teal);
}

.mx__summary-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.mx__email {
  display: block;
  font-weight: 700;
  color: var(--paper);
}

.mx__domain {
  display: block;
  font-size: 12px;
  color: var(--slate);
}

.mx__hits {
  flex: 0 0 auto;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
  white-space: nowrap;
  padding-top: 2px;
}

.mx__mx {
  display: block;
  font-size: 12px;
  line-height: 1.5;
  color: var(--mist);
  word-break: break-word;
}

.mx__mx-label {
  display: inline-block;
  margin-right: 8px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
}

.mx__body {
  padding: 0 14px 14px 38px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.mx__body-lead {
  margin: 12px 0 14px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--slate);
}

.mx__body-lead strong {
  color: var(--paper);
  font-weight: 600;
}

.mx__body-lead em {
  font-style: normal;
  color: var(--mist);
}

.mx__note {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--coral);
}

.mx__form {
  display: grid;
  grid-template-columns: 1fr 90px;
  gap: 10px;
}

.mx__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  grid-column: 1 / -1;
}

.mx__actions .btn {
  flex: 1;
  min-width: 120px;
}

.mx__test-status {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--slate);
}

.mx__test-status.is-ok {
  color: var(--teal);
}

.mx__test-status.is-err {
  color: var(--coral);
}

.btn--primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

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

.field__hint {
  font-size: 12px;
  color: var(--slate);
  margin-top: 4px;
}

.field__input.is-saved {
  border-color: rgba(46, 230, 166, 0.35);
  color: var(--teal);
  letter-spacing: 0.12em;
}

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

.field__textarea {
  min-height: 180px;
  resize: vertical;
  font-family: ui-monospace, 'Cascadia Code', 'Consolas', monospace;
  font-size: 12px;
  line-height: 1.5;
}

.template__tags {
  grid-column: 1 / -1;
  margin-top: 4px;
}

.template__tags-title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mist);
}

.template__tags-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--slate);
}

.template__tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 140px;
  overflow-y: auto;
  padding: 2px 0;
}

.template__tag {
  padding: 4px 8px;
  font-size: 11px;
  font-family: ui-monospace, monospace;
  color: var(--teal);
  background: rgba(46, 230, 166, 0.08);
  border: 1px solid rgba(46, 230, 166, 0.25);
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.template__tag:hover {
  background: rgba(46, 230, 166, 0.16);
  border-color: rgba(46, 230, 166, 0.45);
}

.template__preview {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding: 12px;
  background: var(--ink-2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 2px;
}

.template__preview-label {
  margin: 0 0 6px;
  font-size: 11px;
  color: var(--mist);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.template__preview-subject {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--paper);
}

.template__preview-frame {
  width: 100%;
  height: 200px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  background: #fff;
}

.smtp__lead code {
  font-family: ui-monospace, monospace;
  font-size: 0.9em;
  color: var(--teal);
}

.listen__chip-value.is-ready {
  color: var(--teal);
}

/* ——— Toast ——— */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  z-index: 60;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 20px;
  background: var(--ink-3);
  border: 1px solid rgba(46, 230, 166, 0.35);
  color: var(--paper);
  font-size: 13px;
  border-radius: 2px;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  transition: opacity 0.3s, transform 0.35s var(--ease-out);
}

.toast.is-error {
  border-color: rgba(255, 107, 107, 0.45);
}

/* success pulse on connect */
.panel.is-success {
  animation: successPulse 0.7s var(--ease-out);
}

@keyframes successPulse {
  0% { filter: brightness(1); }
  40% { filter: brightness(1.15); }
  100% { filter: brightness(1); }
}

@media (max-width: 720px) {
  .screen {
    padding: 24px 20px;
    align-items: flex-start;
    overflow-y: auto;
  }

  .run__core {
    gap: 24px;
  }

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

  .field--narrow {
    grid-column: auto;
  }
}

/* Browser dashboard (served from Flask, not Electron shell) */
.chrome--web .chrome {
  -webkit-app-region: auto;
}

.chrome__link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chrome__icon-btn {
  margin-right: 0;
  margin-left: 4px;
  width: 34px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  color: var(--mist);
  border: 1px solid var(--line);
  border-radius: 2px;
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.15s var(--ease-spring);
}

.chrome__icon-btn:hover {
  color: var(--teal);
  border-color: rgba(46, 230, 166, 0.35);
  background: var(--teal-dim);
}

.chrome__icon-btn:active {
  transform: scale(0.96);
}

.chrome__gear {
  display: block;
}

.smtp__status-value.is-ready {
  color: var(--teal);
}

/* ——— First-login tip modal ——— */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s var(--ease-out);
}

.modal.is-open {
  pointer-events: auto;
  opacity: 1;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 12, 0.72);
  backdrop-filter: blur(4px);
}

.modal__sheet {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 28px 26px 24px;
  background: linear-gradient(165deg, rgba(26, 36, 48, 0.98), rgba(11, 17, 24, 0.98));
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  transform: translateY(12px);
  transition: transform 0.3s var(--ease-out);
}

.modal.is-open .modal__sheet {
  transform: translateY(0);
}

.modal__title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
}

.modal__body {
  margin: 0 0 22px;
  color: var(--mist);
  font-size: 14px;
  line-height: 1.5;
}

.modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
