:root {
  --bg: #e7ebe7;
  --ink: #101a14;
  --soft: #44554b;
  --muted: #6d7d74;
  --line: rgba(16, 26, 20, 0.12);
  --accent: #0d7a4f;
  --accent-deep: #08613e;
  --danger: #9a3412;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "Outfit", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(ellipse 70% 45% at 0% 0%, rgba(13, 122, 79, 0.12), transparent 55%),
    linear-gradient(180deg, #f3f6f3 0%, var(--bg) 100%);
}

.page {
  width: min(640px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3.5rem 0 4rem;
}

.top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.top__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

.auth-pill {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--soft);
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gate {
  max-width: 420px;
  margin: 4rem auto 0;
}

.gate .logo {
  margin-bottom: 0.35rem;
}

.gate .tagline {
  margin-bottom: 1.25rem;
}

.gate .auth-form {
  animation: in 0.55s ease 0.08s both;
}

.gate .auth-form .field input {
  max-width: none;
}

.gate .btn--primary {
  width: 100%;
}

.logo {
  margin: 0;
  font-size: clamp(2.8rem, 8vw, 3.8rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  animation: in 0.6s ease both;
}

.tagline {
  margin: 0.65rem 0 0;
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--soft);
  animation: in 0.6s ease 0.05s both;
}

textarea {
  display: block;
  width: 100%;
  min-height: 7rem;
  margin: 0 0 0.9rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  font-family: var(--mono);
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink);
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
  animation: in 0.6s ease 0.1s both;
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 122, 79, 0.16);
}

.bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1rem;
  animation: in 0.6s ease 0.14s both;
}

.bar--tight {
  margin-bottom: 0.35rem;
  animation: none;
}

.auth-tabs {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.2rem;
  margin-bottom: 0.75rem;
  background: rgba(16, 26, 20, 0.05);
  border-radius: 10px;
}

.auth-tab {
  font: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  border: none;
  background: transparent;
  color: var(--soft);
  border-radius: 8px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}

.auth-tab.is-on {
  background: #fff;
  color: var(--ink);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.auth-form .field input {
  max-width: none;
}

.auth-user {
  margin: 0 0 0.55rem;
  font-weight: 650;
}

.btn--tiny {
  margin-left: auto;
  padding: 0.25rem 0.55rem;
  font-size: 0.72rem;
}

select,
.btn {
  font: inherit;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0.7rem 0.95rem;
  cursor: pointer;
}

select {
  appearance: none;
  padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2344554b' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.btn:hover {
  border-color: rgba(13, 122, 79, 0.35);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(180deg, #12915e, var(--accent));
}

.btn--accent {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(180deg, #0f8a5a, var(--accent-deep));
}

.btn.is-on {
  border-color: rgba(13, 122, 79, 0.4);
  color: var(--accent-deep);
  background: rgba(13, 122, 79, 0.08);
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
}

.panel[hidden],
.nets[hidden],
[hidden] {
  display: none !important;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.field select {
  font: inherit;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  background: #fff;
  width: 100%;
  max-width: 10rem;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 122, 79, 0.16);
}

#settingsPanel .field input,
#settingsPanel .field select,
#wordsPanel .field input {
  max-width: none;
}

.smtp-box {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.35rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.smtp-box__title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.smtp-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.smtp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--soft);
  cursor: pointer;
  user-select: none;
}

.check input {
  accent-color: var(--accent);
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
}

.hint {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted);
}

.word-live {
  margin: -0.35rem 0 0.85rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}

.word-live.is-ok {
  color: var(--accent-deep);
}

.word-live.is-bad {
  color: #a33a2c;
}

.word-meta {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.word-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-height: 14rem;
  overflow: auto;
  padding: 0.15rem 0.1rem 0.35rem;
}

.word-chip {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0.28rem 0.5rem;
  cursor: pointer;
  line-height: 1.2;
}

.word-chip:hover,
.word-chip:focus-visible {
  border-color: var(--accent);
  color: var(--accent-deep);
  outline: none;
}

.word-section {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-bottom: 0.85rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.word-section:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: none;
}

.word-export {
  margin: 0;
}

.active-seed-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 16rem;
  overflow: auto;
}

.active-seed {
  display: grid;
  gap: 0.35rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid rgba(13, 122, 79, 0.2);
  border-radius: 12px;
  background: rgba(13, 122, 79, 0.06);
}

.active-seed__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.active-seed__note {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

.nets {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.chain-group__label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.chain-group__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chain-pick {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--soft);
  cursor: pointer;
  user-select: none;
}

.chain-pick:has(input:checked) {
  color: var(--ink);
  border-color: rgba(13, 122, 79, 0.35);
  background: rgba(13, 122, 79, 0.08);
}

.chain-pick input {
  margin: 0;
  accent-color: var(--accent);
}

.dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--c, #888);
}

.status {
  min-height: 1.35rem;
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.status.is-ok {
  color: var(--accent-deep);
}

.status.is-err {
  color: var(--danger);
}

.progress {
  margin: 0 0 1rem;
}

.progress__bar {
  height: 0.35rem;
  border-radius: 999px;
  background: rgba(16, 26, 20, 0.08);
  overflow: hidden;
}

.progress__bar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.2s ease;
}

.results {
  animation: in 0.35s ease both;
}

.results h2 {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.hits {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.hit {
  display: grid;
  gap: 0.25rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(154, 52, 18, 0.18);
  background: rgba(154, 52, 18, 0.06);
}

.hit-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding-bottom: 0.75rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
}

.hit-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.hit--seed {
  border-color: rgba(13, 122, 79, 0.22);
  background: rgba(13, 122, 79, 0.07);
}

.hit__phrase {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.45;
  word-break: break-word;
}

.hit__top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 650;
}

.hit__std {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--danger);
}

.hit__badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-deep);
  border: 1px solid rgba(13, 122, 79, 0.28);
  background: rgba(13, 122, 79, 0.1);
  border-radius: 6px;
  padding: 0.12rem 0.35rem;
}

.hit__bal {
  font-family: var(--mono);
  font-size: 0.88rem;
}

.hit__path {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  word-break: break-all;
}

.hit__addr {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--soft);
  word-break: break-all;
  text-decoration: none;
}

.hit__addr:hover {
  color: var(--accent-deep);
}

.empty {
  padding: 1rem;
  border-radius: 12px;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
  font-size: 0.92rem;
}

.note {
  margin: 2rem 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
}

body.vault-open {
  overflow: hidden;
}

.vault-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(10, 18, 14, 0.35);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.vault-backdrop.is-visible {
  opacity: 1;
}

.vault-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  width: min(420px, 100vw);
  height: 100vh;
  padding: 1.1rem 1rem 1.25rem;
  background:
    linear-gradient(180deg, #f7faf7 0%, #eef2ee 100%);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 40px rgba(16, 26, 20, 0.12);
  transform: translateX(100%);
  transition: transform 0.22s ease;
}

.vault-sidebar.is-open {
  transform: translateX(0);
}

.vault-sidebar__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.vault-sidebar__head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.vault-sidebar__count {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.vault-sidebar__export {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
}

.vault-sidebar__export .btn {
  flex: 1;
}

.vault-sidebar__list {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-right: 0.15rem;
}

.vault-card {
  display: grid;
  gap: 0.4rem;
  padding: 0.8rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
}

.vault-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.vault-card__meta {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

.vault-card__actions {
  display: flex;
  gap: 0.3rem;
}

.vault-card__phrase {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.6rem;
  border: 1px solid rgba(13, 122, 79, 0.18);
  border-radius: 10px;
  background: rgba(13, 122, 79, 0.06);
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--ink);
  text-align: left;
  word-break: break-word;
  cursor: pointer;
}

.vault-card__phrase:hover,
.vault-card__phrase:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.vault-card__summary {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--soft);
}

.vault-card__wallets {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.vault-card__wallet {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--soft);
}

.vault-card__bal {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  text-align: right;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 520px) {
  .bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  select {
    grid-column: 1 / -1;
  }

  .vault-sidebar {
    width: 100vw;
  }
}
