:root {
  color-scheme: light;
  --bg: #f3f7fa;
  --surface: #ffffff;
  --surface-hover: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --title: #102536;
  --text: #526c7d;
  --muted: #7b95a7;
  --accent: #0ea77c;
  --accent-dark: #0b8c67;
  --accent-light: #e6f7f2;
  --gold: #c9a227;
  --gold-light: #fff8e1;
  --orange: #e57d1d;
  --orange-light: #fff3e6;
  --cyan: #0a9bc8;
  --cyan-light: #e6f6fb;
  --danger: #e53935;
  --danger-light: #fdecec;
  --shadow: 0 10px 40px rgba(16, 37, 54, 0.08);
  --shadow-lg: 0 20px 60px rgba(16, 37, 54, 0.12);
  --radius: 22px;
  --radius-sm: 14px;
  --radius-xs: 10px;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg); }

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 78% 8%, rgba(14, 167, 124, 0.06), transparent 32rem),
    radial-gradient(circle at 10% 60%, rgba(10, 155, 200, 0.05), transparent 28rem),
    var(--bg);
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }

.swap-shell {
  width: min(100%, 560px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 16px 150px;
}

.swap-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.swap-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
}

.swap-brand > span:last-child {
  display: grid;
  line-height: 1.1;
}

.swap-brand strong {
  color: var(--title);
  font-size: 24px;
  letter-spacing: 0.01em;
}

.swap-brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 2.5px solid #fff;
  border-radius: 9px;
  background: linear-gradient(90deg, #0ea77c 0 35%, #8fd14f 35% 66%, #0a9bc8 66%);
  box-shadow: 0 4px 14px rgba(14, 167, 124, 0.22);
}

.brand-mark:before,
.brand-mark:after {
  content: "";
  position: absolute;
  top: 8px;
  width: 4px;
  height: 12px;
  background: #fff;
  border-radius: 1px;
}

.brand-mark:before { left: 11px; }
.brand-mark:after { right: 11px; }

.brand-mark span {
  position: absolute;
  top: 9px;
  width: 6px;
  height: 13px;
  background: #f5a623;
  border-radius: 1px;
}

.brand-mark span:first-child { left: -4px; }
.brand-mark span:last-child { right: -4px; }

.swap-header-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.back-link {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.back-link:hover { color: var(--accent); }

.notification-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.notification-button:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(14, 167, 124, 0.12);
}

.notification-bell { display: grid; place-items: center; line-height: 1; }

.notification-bell svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
}

.notification-button.has-unread .notification-dot {
  opacity: 1;
  box-shadow: 0 0 0 3px rgba(14, 167, 124, 0.14);
}

.wallet-button {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  overflow: hidden;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  font-weight: 900;
  font-size: 13px;
  white-space: nowrap;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.wallet-button [data-wallet-label] {
  overflow: hidden;
  text-overflow: ellipsis;
}

.wallet-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(14, 167, 124, 0.28);
}

.wallet-icon {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 18px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.wallet-icon:after {
  content: "";
  position: absolute;
  right: -4px;
  top: 3px;
  width: 7px;
  height: 5px;
  border: 2px solid currentColor;
  border-radius: 2px;
  background: inherit;
}

.swap-main { padding-top: 22px; }

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.swap-card { padding: 22px 18px 22px; }

.swap-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.swap-card-head h1 {
  margin: 0;
  color: var(--title);
  font-size: 28px;
  letter-spacing: -0.02em;
}

.swap-card-head h1 span {
  color: var(--gold);
}

.swap-card-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.swap-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.swap-toolbar button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface);
  transition: all 0.18s ease;
}

.swap-toolbar button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.swap-mode-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f1f5f9;
}

.swap-mode-tabs button {
  flex: 1;
  min-width: 88px;
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  color: var(--text);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  transition: all 0.18s ease;
}

.swap-mode-tabs button.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 4px 14px rgba(14, 167, 124, 0.22);
}

.swap-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: #f8fafc;
}

.swap-option-row span {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.swap-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.swap-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.swap-toggle-track {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: var(--border-strong);
  transition: background 0.18s ease;
  position: relative;
}

.swap-toggle-track:after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.18s ease;
}

.swap-toggle input:checked + .swap-toggle-track {
  background: var(--accent);
}

.swap-toggle input:checked + .swap-toggle-track:after {
  transform: translateX(20px);
}

.swap-toggle small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.swap-input-section {
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.swap-input-section:last-of-type { margin-bottom: 0; }

.swap-input-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.swap-section-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.swap-balance {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.swap-balance strong {
  color: var(--accent-dark);
  font-weight: 800;
}

.swap-amount-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.swap-amount-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 167, 124, 0.1);
}

.swap-amount-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--title);
  background: transparent;
  font-size: 28px;
  font-weight: 800;
}

.swap-amount-input::placeholder { color: #94a3b8; }

.swap-token-select {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--title);
  background: linear-gradient(135deg, var(--gold-light), #fff);
  font-weight: 900;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.swap-token-select:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(201, 162, 39, 0.14);
}

.swap-token-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.04);
}

.swap-token-select svg { color: var(--gold); }

.swap-percent-buttons {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.swap-percent-buttons button {
  flex: 1;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  background: var(--surface);
  font-size: 12px;
  font-weight: 800;
  transition: all 0.18s ease;
}

.swap-percent-buttons button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.swap-switch-wrap {
  position: relative;
  display: grid;
  place-items: center;
  height: 18px;
  margin: -6px 0;
}

.swap-switch {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--accent);
  background: var(--surface);
  box-shadow: 0 6px 20px rgba(16, 37, 54, 0.1);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.swap-switch:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
  transform: rotate(180deg);
  box-shadow: 0 8px 24px rgba(14, 167, 124, 0.18);
}

.swap-limit-price {
  margin-bottom: 14px;
}

.swap-limit-price .swap-input-row {
  margin-bottom: 8px;
}

.swap-limit-price .swap-amount-input {
  font-size: 22px;
}

.swap-limit-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.swap-info {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
}

.swap-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}

.swap-info-row:last-child { border-bottom: 0; }

.swap-info-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.swap-info-row strong {
  color: var(--title);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}

.swap-info-row strong.is-warning { color: var(--orange); }

.swap-info-row strong.is-danger { color: var(--danger); }

.swap-impact-hint {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
}

.swap-impact-hint.is-warning {
  background: var(--orange-light);
  color: var(--orange);
}

.swap-action {
  width: 100%;
  min-height: 54px;
  margin-top: 18px;
  border: 0;
  border-radius: var(--radius-sm);
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  font-size: 17px;
  font-weight: 900;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.swap-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 38px rgba(14, 167, 124, 0.26);
}

.swap-action:disabled {
  cursor: not-allowed;
  filter: saturate(0.45);
  opacity: 0.72;
}

.swap-action.is-loading { position: relative; cursor: wait; }

.swap-status {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  line-height: 1.55;
}

.swap-status.is-error { color: var(--danger); }

.swap-security-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
}

.swap-security-tip svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.swap-contacts {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: center;
}

.swap-contacts h3 {
  margin: 0 0 10px;
  color: var(--title);
  font-size: 14px;
}

.swap-contacts p {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.6;
}

.mobile-bottom-nav { display: none; }

@media (max-width: 720px) {
  .mobile-bottom-nav {
    position: fixed;
    z-index: 90;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: 60px;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    border-top: 1px solid #e1edf1;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 -8px 24px rgba(32, 68, 92, 0.08);
    backdrop-filter: blur(18px);
  }

  .mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    border-radius: 10px;
    color: #7a8e9a;
    text-decoration: none;
    font-size: 10px;
    font-weight: 700;
  }

  .mobile-bottom-nav a > span {
    font-size: 22px;
    line-height: 1;
  }

  .mobile-bottom-nav a > b {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-bottom-nav a.active {
    color: #0ea77c;
    background: rgba(14, 167, 124, 0.1);
  }
}

.swap-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.swap-modal[hidden] { display: none !important; }

.swap-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 37, 54, 0.45);
  backdrop-filter: blur(4px);
}

.swap-modal-panel {
  position: relative;
  width: 100%;
  max-height: 80vh;
  padding: 20px 18px 28px;
  border-top: 1px solid var(--border);
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  box-shadow: 0 -20px 80px rgba(16, 37, 54, 0.12);
  animation: modalSlideUp 0.22s ease both;
}

.swap-modal-tx {
  max-width: 420px;
  border-radius: 24px;
  margin: auto 18px;
  text-align: center;
  animation: modalFadeIn 0.2s ease both;
}

.swap-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.swap-modal-head h2 {
  margin: 0;
  color: var(--title);
  font-size: 20px;
}

.swap-modal-close {
  border: 0;
  color: var(--text);
  background: transparent;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.swap-modal-close:hover { color: var(--accent); }

.swap-token-search {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  outline: 0;
  color: var(--title);
  background: #f8fafc;
  font-size: 14px;
  margin-bottom: 14px;
}

.swap-token-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 167, 124, 0.1);
}

.swap-token-search::placeholder { color: #94a3b8; }

.swap-import-hint {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  background: var(--cyan-light);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.swap-token-list {
  display: grid;
  gap: 8px;
  max-height: 45vh;
  overflow: auto;
  padding-right: 4px;
}

.swap-token-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: inherit;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
}

.swap-token-item:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.swap-token-item img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.04);
}

.swap-token-item span { display: block; }

.swap-token-item .token-name {
  color: var(--title);
  font-size: 14px;
  font-weight: 800;
}

.swap-token-item .token-addr {
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

.swap-token-item .token-balance {
  margin-left: auto;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
}

.swap-settings-body { padding: 6px 2px; }

.swap-settings-label {
  display: block;
  margin-bottom: 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.swap-slippage-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.swap-slippage-row button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  background: var(--surface);
  font-weight: 900;
  transition: all 0.18s ease;
}

.swap-slippage-row button.is-active {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.swap-slippage-custom {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  background: #f8fafc;
}

.swap-slippage-custom input {
  width: 70px;
  border: 0;
  outline: 0;
  color: var(--title);
  background: transparent;
  font-size: 16px;
  font-weight: 800;
  text-align: right;
}

.swap-settings-hint {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.swap-tx-state { padding: 30px 20px; }

.swap-tx-spinner {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.swap-tx-state h2 {
  margin: 0 0 10px;
  color: var(--title);
  font-size: 20px;
}

.swap-tx-state p {
  margin: 0 0 18px;
  color: var(--text);
  font-size: 14px;
}

.swap-tx-state a {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.swap-tx-state.is-success .swap-tx-spinner {
  border-color: var(--accent);
  border-top-color: transparent;
  animation: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='none' stroke='%230ea77c' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E") center/60% no-repeat;
}

.swap-tx-state.is-error .swap-tx-spinner {
  border-color: var(--danger);
  border-top-color: transparent;
  animation: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='none' stroke='%23e53935' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E") center/60% no-repeat;
}

.swap-modal-close-tx {
  min-height: 44px;
  padding: 0 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--title);
  background: var(--surface);
  font-weight: 900;
  transition: all 0.18s ease;
}

.swap-modal-close-tx:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(88px, env(safe-area-inset-bottom) + 80px);
  z-index: 120;
  padding: 12px 17px;
  border-radius: var(--radius-xs);
  color: #fff;
  background: var(--title);
  font-size: 13px;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.notification-layer {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  background: rgba(16, 37, 54, 0.38);
  backdrop-filter: blur(8px);
}

.notification-layer[hidden] { display: none !important; }

.notification-drawer {
  width: min(440px, 100%);
  height: 100%;
  padding: 28px 24px 20px;
  overflow: auto;
  border-left: 1px solid var(--border);
  background: var(--surface);
  box-shadow: -20px 0 80px rgba(16, 37, 54, 0.1);
  animation: notificationSlideIn 220ms ease both;
}

.notification-drawer-head,
.notification-drawer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.notification-drawer-head { margin-bottom: 22px; }

.notification-drawer-head h2 {
  margin: 7px 0 0;
  color: var(--title);
}

.notification-close {
  border: 0;
  color: var(--text);
  background: transparent;
  font-size: 30px;
  cursor: pointer;
}

.notification-close:hover { color: var(--accent); }

.notification-list { display: grid; gap: 10px; }

.notification-item {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 15px 14px;
  border: 1px solid var(--border);
  border-radius: 15px;
  color: inherit;
  text-decoration: none;
  background: var(--surface);
  transition: border-color 180ms ease, transform 180ms ease;
}

.notification-item:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.notification-item.is-read { opacity: 0.63; }

.notification-tone {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.notification-tone-cyan { background: var(--cyan); }
.notification-tone-yellow { background: var(--gold); }
.notification-tone-purple { background: #a78bfa; }

.notification-item-copy { display: grid; gap: 5px; }

.notification-item-copy small {
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 800;
}

.notification-item-copy strong {
  color: var(--title);
  font-size: 14px;
  line-height: 1.35;
}

.notification-item-copy span {
  color: var(--text);
  font-size: 12px;
  line-height: 1.55;
}

.notification-item-arrow {
  color: var(--accent);
  font-size: 18px;
}

.notification-drawer-foot {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.notification-drawer-foot button,
.notification-drawer-foot a {
  color: var(--accent);
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

body.notification-open { overflow: hidden; }

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

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

@keyframes notificationSlideIn {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (min-width: 600px) {
  .swap-shell { padding-inline: 24px; }
  .swap-card { padding: 28px 26px; }
  .swap-modal { align-items: center; }
  .swap-modal-panel {
    max-width: 420px;
    border-radius: 24px;
    animation: modalFadeIn 0.2s ease both;
  }
}

@media (max-width: 380px) {
  .swap-card-head h1 { font-size: 24px; }
  .swap-amount-input { font-size: 24px; }
  .swap-toolbar button { width: 36px; height: 36px; }
  .swap-token-select { padding-inline: 10px; font-size: 13px; }
  .swap-percent-buttons button { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .swap-switch,
  .swap-action,
  .swap-token-item,
  .swap-toolbar button,
  .notification-button,
  .swap-mode-tabs button {
    transition: none;
  }
  .swap-switch:hover { transform: none; }
  .swap-action:hover { transform: none; }
  .swap-tx-spinner { animation: none; }
}
