[data-yam-address] {
  cursor: pointer;
}

button.yam-address-trigger {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
}

.yam-address-card {
  width: min(560px, calc(100vw - 32px));
  max-height: min(88vh, 760px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--border, var(--line, #303a4a));
  border-radius: 16px;
  color: var(--text, var(--ink, #f1f4f9));
  background: var(--surface, #171d28);
  box-shadow: var(--shadow-dialog, var(--shadow, 0 24px 90px rgba(0, 0, 0, 0.58)));
}

.yam-address-card::backdrop {
  background: rgba(8, 11, 16, 0.62);
}

.yam-address-card-shell {
  display: grid;
  gap: 14px;
  padding: 20px 20px 18px;
}

.yam-address-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.yam-address-card-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.yam-address-card-identicon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-subtle, #242c3a);
}

.yam-address-card-header h2 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
}

.yam-address-card-chain {
  margin: 2px 0 0;
  color: var(--muted, #abb5c4);
  font-size: 0.78rem;
  font-weight: 650;
}

.yam-address-card-close {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--border, var(--line, #303a4a));
  border-radius: 999px;
  color: var(--muted, #abb5c4);
  background: transparent;
}

.yam-address-card-close:hover {
  color: var(--text, var(--ink, #f1f4f9));
  border-color: var(--text, var(--ink, #f1f4f9));
}

.yam-address-card-close svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.yam-address-card-address-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.yam-address-card-full {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 10px;
  overflow: hidden;
  border: 1px solid var(--border, var(--line, #303a4a));
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface, #171d28) 86%, #000);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.78rem;
  word-break: break-all;
}

.yam-address-card-copy,
.yam-address-card-link,
.yam-address-card-form button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border, var(--line, #303a4a));
  border-radius: 999px;
  color: var(--muted, #abb5c4);
  background: var(--surface, #171d28);
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.yam-address-card-copy:hover,
.yam-address-card-link:hover,
.yam-address-card-form button:hover {
  color: var(--text, var(--ink, #f1f4f9));
  border-color: var(--text, var(--ink, #f1f4f9));
}

.yam-address-card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.yam-address-card-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px 0 8px;
}

.yam-address-card-logo {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  display: block;
  object-fit: contain;
}

.yam-address-card-logo.is-on-light {
  padding: 1px;
  box-sizing: border-box;
  border-radius: 50%;
  background: #fff;
}

.yam-address-card-body {
  display: grid;
  gap: 8px;
}

.yam-address-card-lead,
.yam-address-card-also,
.yam-address-card-help,
.yam-address-card-status,
.yam-address-card-section {
  margin: 0;
  color: var(--muted, #abb5c4);
  font-size: 0.84rem;
}

.yam-address-card-lead strong {
  color: var(--text, var(--ink, #f1f4f9));
  font-weight: 750;
}

.yam-address-card-section {
  margin-top: 4px;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.yam-address-card-status.is-error,
.yam-address-card-status[data-tone="error"] {
  color: var(--danger, var(--risk, #e07886));
}

.yam-address-card-status[data-tone="ok"] {
  color: var(--success, var(--positive, #65c7cf));
}

.yam-address-card-rows {
  display: grid;
  gap: 6px;
}

.yam-address-card-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 7px 10px;
  border: 1px solid var(--border, var(--line, #303a4a));
  border-radius: 9px;
  background: var(--surface-raised, var(--surface-soft, #1d2431));
  font-size: 0.84rem;
}

.yam-address-card-row-name {
  font-weight: 700;
}

.yam-address-card-row-name.is-muted,
.yam-address-card-row-meta {
  color: var(--faint, #7f8a9b);
  font-size: 0.74rem;
  font-weight: 500;
}

.yam-address-card-row-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.yam-address-card-submitter {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border-radius: 999px;
  object-fit: cover;
  background: var(--surface-subtle, #242c3a);
}

.yam-address-card-anon-mark {
  display: grid;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: var(--amber-soft, #3c2d17);
  color: var(--amber, #e3ad56);
  font-size: 0.64rem;
  font-weight: 800;
}

.yam-address-card-anon {
  color: var(--amber, #e3ad56);
  font-weight: 700;
}

.yam-address-card-confidence {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--tide-soft, #13373c);
  color: var(--tide, #51b9c2);
  font-size: 0.7rem;
  font-weight: 700;
}

.yam-address-card-confidence.is-low {
  background: var(--amber-soft, #3c2d17);
  color: var(--amber, #e3ad56);
}

.yam-address-card-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.yam-address-card-tag {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--cobalt-soft, #202b4e);
  color: var(--cobalt-strong, #a6b6f7);
  font-size: 0.7rem;
  font-weight: 650;
}

.yam-address-card-form {
  display: grid;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid var(--border, var(--line, #303a4a));
}

.yam-address-card-form h3 {
  margin: 8px 0 0;
  font-size: 0.92rem;
  font-weight: 750;
}

.yam-address-card-form label {
  display: grid;
  gap: 5px;
  color: var(--muted, #abb5c4);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.yam-address-card-form input,
.yam-address-card-form select,
.yam-address-card-form .yam-select-trigger {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border, var(--line, #303a4a));
  border-radius: 10px;
  color: var(--text, var(--ink, #f1f4f9));
  background: color-mix(in srgb, var(--surface, #171d28) 86%, #000);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.yam-address-card-form input:focus,
.yam-address-card-form select:focus,
.yam-address-card-form .yam-select-trigger:focus-visible {
  outline: none;
  border-color: var(--accent, var(--cobalt, #8299ef));
}

.yam-address-card-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 10px;
}

.yam-address-card-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.yam-address-card-form-actions .yam-address-card-status {
  flex: 1 1 auto;
}

.yam-address-card-form button[type="submit"] {
  color: var(--on-accent, var(--ledger, #10151e));
  background: var(--accent, var(--cobalt, #8299ef));
  border-color: transparent;
}

.yam-address-card-form button[type="submit"]:hover {
  color: var(--on-accent, var(--ledger, #10151e));
  border-color: transparent;
  filter: brightness(1.06);
}

@media (max-width: 560px) {
  .yam-address-card-form-grid {
    grid-template-columns: 1fr;
  }

  .yam-address-card-form-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
