#web-wallet-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  background: #fff;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  color: #1b1b1c;
}

#web-wallet-modal.is-open {
  display: flex;
}

.ww-layout {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.ww-sidebar {
  width: 38%;
  min-width: 320px;
  max-width: 520px;
  background: linear-gradient(180deg, #eef2ff 0%, #e8e4ff 45%, #f3efff 100%);
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.ww-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 48px;
}

.ww-logo svg {
  width: 36px;
  height: 40px;
  flex-shrink: 0;
}

.ww-logo span {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0500ff;
  line-height: 1;
}

.ww-step {
  font-size: 14px;
  color: #6b6b7b;
  margin-bottom: 12px;
}

.ww-sidebar h1 {
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 auto;
  max-width: 12ch;
}

.ww-illustration {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}

.ww-illustration img,
.ww-illustration svg {
  width: min(100%, 340px);
  height: auto;
}

.ww-help {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #6b6b7b;
  text-decoration: none;
  margin-top: 24px;
}

.ww-help:hover {
  color: #1b1b1c;
}

.ww-main {
  flex: 1;
  background: #fff;
  padding: 48px 64px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.ww-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  font-size: 15px;
  color: #1b1b1c;
  cursor: pointer;
  margin-bottom: 40px;
}

.ww-back:hover {
  opacity: 0.7;
}

.ww-main h2 {
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 32px;
}

.ww-methods {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 720px;
}

.ww-method {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 22px 24px;
  border: none;
  border-radius: 16px;
  background: #f3f3f5;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}

.ww-method:hover {
  background: #ebebef;
}

.ww-method-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #1b1b1c;
}

.ww-method-text {
  flex: 1;
  font-size: 17px;
  font-weight: 600;
  color: #1b1b1c;
}

.ww-method-arrow {
  color: #8a8a97;
  flex-shrink: 0;
}

/* Screens */
.ww-screen {
  display: none;
  width: 100%;
  height: 100%;
}

.ww-screen.is-active {
  display: flex;
}

/* Loading */
.ww-screen-loading {
  align-items: center;
  justify-content: center;
  background: #fff;
}

.ww-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.ww-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid #ebebef;
  border-top-color: #0500ff;
  border-radius: 50%;
  animation: ww-spin 0.8s linear infinite;
}

@keyframes ww-spin {
  to { transform: rotate(360deg); }
}

.ww-loading-text {
  font-size: 15px;
  color: #6b6b7b;
  margin: 0;
}

/* Recovery phrase */
.ww-screen-recovery {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  background: #fff;
  overflow-y: auto;
}

.ww-recovery-topbar {
  flex-shrink: 0;
  padding: 24px 32px 0;
}

.ww-recovery-topbar .ww-logo {
  margin-bottom: 0;
}

.ww-logo-sm svg {
  width: 28px;
  height: 32px;
}

.ww-logo-sm span {
  font-size: 18px;
}

.ww-recovery-wrap {
  flex: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 40px;
  box-sizing: border-box;
}

.ww-recovery-header {
  margin-bottom: 28px;
}

.ww-recovery-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0 0 16px -8px;
  padding: 0;
  border: none;
  background: none;
  color: #1b1b1c;
  cursor: pointer;
  border-radius: 50%;
}

.ww-recovery-back:hover {
  background: #f3f3f5;
}

.ww-recovery-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  line-height: 1.3;
}

.ww-recovery-divider {
  border: none;
  border-top: 1px solid #ebebef;
  margin: 0;
}

.ww-tabs {
  display: flex;
  background: #f3f3f5;
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 24px;
}

.ww-tab {
  flex: 1;
  padding: 10px 12px;
  border: none;
  border-radius: 999px;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: #8a8a97;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.ww-tab.is-active {
  background: #fff;
  color: #1b1b1c;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.ww-word-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0;
  margin-bottom: 20px;
  border: none;
  background: none;
  font-size: 15px;
  font-weight: 500;
  color: #1b1b1c;
  cursor: pointer;
  text-align: left;
}

.ww-word-count:hover {
  opacity: 0.8;
}

.ww-word-count-static {
  font-size: 15px;
  font-weight: 500;
  color: #1b1b1c;
  margin: 0 0 20px;
}

.ww-word-count-menu {
  list-style: none;
  margin: -12px 0 20px;
  padding: 8px 0;
  background: #fff;
  border: 1px solid #ebebef;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.ww-word-count-menu li {
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
}

.ww-word-count-menu li:hover {
  background: #f3f3f5;
}

.ww-phrase-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 32px;
}

.ww-phrase-field {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #e5e5ea;
  border-radius: 12px;
  overflow: hidden;
  min-height: 48px;
}

.ww-phrase-num {
  flex-shrink: 0;
  width: 32px;
  text-align: center;
  font-size: 14px;
  color: #8a8a97;
}

.ww-phrase-sep {
  width: 1px;
  height: 20px;
  background: #e5e5ea;
  flex-shrink: 0;
}

.ww-phrase-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 12px 10px 12px 8px;
  font-size: 15px;
  background: transparent;
  color: #1b1b1c;
  min-width: 0;
}

.ww-private-key-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #e5e5ea;
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 32px;
  outline: none;
  box-sizing: border-box;
}

.ww-private-key-input:focus {
  border-color: #0500ff;
}

.ww-confirm {
  display: block;
  width: 100%;
  padding: 16px 24px;
  border: none;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  background: #ebebef;
  color: #b0b0b8;
  transition: background 0.2s, color 0.2s;
}

.ww-confirm:not(:disabled) {
  background: #0500ff;
  color: #fff;
}

.ww-confirm:not(:disabled):hover {
  background: #0400d9;
}

@media (max-width: 900px) {
  .ww-layout {
    flex-direction: column;
  }

  .ww-sidebar {
    width: 100%;
    max-width: none;
    min-width: 0;
    padding: 32px 24px 24px;
    min-height: auto;
  }

  .ww-sidebar h1 {
    font-size: 28px;
    margin-bottom: 16px;
  }

  .ww-illustration {
    display: none;
  }

  .ww-main {
    padding: 24px;
  }

  .ww-phrase-grid {
    grid-template-columns: 1fr;
  }
}
