/* Silo — wallet connect: sheet, wallet rows, connected navbar chip and menu.
   Real connections run over EIP-6963 / EIP-1193 (see js/silo-wallet.js). */

.sw-root {
  --sw-paper: #fcfcfb;
  --sw-soft: #f4f4f2;
  --sw-chip: #ededec;
  --sw-line: #e7e7e4;
  --sw-text: #17181a;
  --sw-muted: #7c848c;
  --sw-dim: #9aa1a9;
  --sw-pink: #ff80ab;
  --sw-pink-deep: #e0447c;
  --sw-tag-bg: #e4f3ec;
  --sw-tag-fg: #1a7f57;
  --sw-error-bg: #fbe9e8;
  --sw-error-fg: #a53b35;
  --sw-danger: #c0453f;
}

/* ===== backdrop + sheet ===== */
.sw-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(31, 30, 27, 0.16);
  animation: sw-fade 0.18s ease both;
}
.sw-sheet {
  position: fixed;
  z-index: 10051;
  top: 50%;
  left: 50%;
  width: min(408px, calc(100vw - 28px));
  max-height: min(660px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
  corner-shape: squircle;
  background: var(--sw-paper);
  box-shadow: 0 28px 70px -18px rgba(15, 23, 42, 0.34), 0 0 0 1px rgba(15, 23, 42, 0.05);
  animation: sw-rise 0.28s cubic-bezier(0.25, 1, 0.4, 1) both;
}
@keyframes sw-fade { from { opacity: 0; } }
@keyframes sw-rise {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 12px)) scale(0.97); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.sw-sheet { transform: translate(-50%, -50%); }

.sw-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 12px;
}
.sw-title {
  flex: 1;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.018em;
  color: var(--sw-text);
}
.sw-x {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 9px;
  corner-shape: squircle;
  background: var(--sw-chip);
  color: var(--sw-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.sw-x:hover { background: var(--sw-chip); filter: brightness(0.94); color: var(--sw-text); }
.sw-x svg { width: 14px; height: 14px; }

.sw-body {
  overflow-y: auto;
  padding: 0 12px 6px;
}
.sw-group {
  padding: 10px 6px 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sw-dim);
}

/* ===== one wallet ===== */
.sw-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 13px;
  corner-shape: squircle;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
}
.sw-row:hover { background: var(--sw-soft); }
.sw-row:focus-visible {
  outline: 2px solid var(--sw-pink);
  outline-offset: -2px;
}
.sw-row[disabled] { cursor: progress; }
.sw-logo {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  corner-shape: squircle;
  object-fit: cover;
  background: var(--sw-chip);
}
.sw-name {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--sw-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sw-tag {
  flex: none;
  padding: 3px 8px;
  border-radius: 7px;
  corner-shape: squircle;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  background: var(--sw-tag-bg);
  color: var(--sw-tag-fg);
}
.sw-tag.is-install {
  background: var(--sw-chip);
  color: var(--sw-muted);
}
.sw-spin {
  flex: none;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  border: 2px solid rgba(224, 68, 124, 0.25);
  border-top-color: var(--sw-pink-deep);
  animation: sw-spin 0.7s linear infinite;
}
@keyframes sw-spin { to { transform: rotate(360deg); } }

.sw-foot {
  padding: 10px 18px 16px;
  font-size: 11px;
  line-height: 1.55;
  color: var(--sw-dim);
  border-top: 1px solid var(--sw-line);
}
.sw-foot a { color: var(--sw-muted); text-decoration: underline; }

.sw-error {
  margin: 0 6px 8px;
  padding: 9px 11px;
  border-radius: 11px;
  corner-shape: squircle;
  background: var(--sw-error-bg);
  color: var(--sw-error-fg);
  font-size: 11.5px;
  font-weight: 550;
  line-height: 1.5;
}

/* ===== navbar chip once connected ===== */
.sw-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px 0 7px;
  border: 0;
  border-radius: 11px;
  corner-shape: squircle;
  background: var(--sw-chip);
  color: var(--sw-text);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.15s ease;
}
.sw-chip:hover { background: var(--sw-chip); filter: brightness(0.94); }
.sw-chip img {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  corner-shape: squircle;
  object-fit: cover;
}
.sw-chip .sw-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #22a06b;
}

/* ===== connected menu ===== */
.sw-menu {
  position: fixed;
  z-index: 10051;
  width: 268px;
  padding: 6px;
  border-radius: 16px;
  corner-shape: squircle;
  background: var(--sw-paper);
  box-shadow: 0 20px 50px -14px rgba(15, 23, 42, 0.3), 0 0 0 1px rgba(15, 23, 42, 0.05);
  animation: sw-pop 0.2s cubic-bezier(0.25, 1, 0.4, 1) both;
}
@keyframes sw-pop {
  from { opacity: 0; transform: translateY(-5px) scale(0.98); }
}
.sw-acct {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px 11px;
}
.sw-acct img {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  corner-shape: squircle;
  object-fit: cover;
}
.sw-acct-text { min-width: 0; }
.sw-addr {
  font-size: 13px;
  font-weight: 650;
  color: var(--sw-text);
  font-variant-numeric: tabular-nums;
}
.sw-net {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 500;
  color: var(--sw-dim);
}
.sw-stat {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  font-size: 12px;
}
.sw-stat span { color: var(--sw-dim); font-weight: 500; }
.sw-stat b {
  color: var(--sw-text);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.sw-sep {
  height: 1px;
  margin: 5px 4px;
  background: var(--sw-line);
}
.sw-act {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  corner-shape: squircle;
  background: none;
  color: var(--sw-text);
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}
.sw-act:hover { background: var(--sw-soft); }
.sw-act svg { width: 14px; height: 14px; color: var(--sw-muted); }
.sw-act.is-danger { color: var(--sw-danger); }
.sw-act.is-danger svg { color: var(--sw-danger); }

@media (prefers-reduced-motion: reduce) {
  .sw-backdrop, .sw-sheet, .sw-menu { animation-duration: 0.01ms; }
  .sw-spin { animation-duration: 2s; }
}

/* ===== dark theme (html[data-silo-theme="dark"], see css/silo-theme.css) ===== */
html[data-silo-theme="dark"] .sw-root {
  --sw-paper: #1a1c1f;
  --sw-soft: #222428;
  --sw-chip: #26282c;
  --sw-line: #2a2d31;
  --sw-text: #f2f3f5;
  --sw-muted: #9aa1ab;
  --sw-dim: #70767f;
  --sw-tag-bg: rgba(47, 190, 132, 0.16);
  --sw-tag-fg: #2fbe84;
  --sw-error-bg: rgba(255, 115, 115, 0.14);
  --sw-error-fg: #ff7373;
  --sw-danger: #ff7373;
}
html[data-silo-theme="dark"] .sw-backdrop { background: rgba(0, 0, 0, 0.55); }
html[data-silo-theme="dark"] .sw-sheet,
html[data-silo-theme="dark"] .sw-menu {
  box-shadow: 0 28px 70px -18px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.07);
}
