:root {
  color-scheme: dark;
  font-family: -apple-system, "Segoe UI", Inter, Avenir, Helvetica, Arial, sans-serif;
  font-size: 15px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #18181a;
  color: #e8e8e8;
  display: flex;
  justify-content: center;
  padding: 40px 16px 80px;
}

.shell {
  max-width: 480px;
  width: 100%;
}

header {
  margin-bottom: 20px;
}

h1 {
  font-size: 20px;
  margin: 0;
}

h2 {
  font-size: 14px;
  color: #d97757;
  margin: 24px 0 8px;
}

.lead {
  color: #c9c9cd;
  line-height: 1.6;
}

.note {
  font-size: 12.5px;
  color: #8a8a8e;
  line-height: 1.6;
  margin-top: 16px;
}

pre {
  background: #0f0f10;
  border: 1px solid #2c2c2e;
  border-radius: 10px;
  padding: 12px 14px;
  overflow-x: auto;
  font-size: 12.5px;
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

.steps {
  color: #c9c9cd;
  line-height: 1.9;
  padding-left: 20px;
}

#pair-form {
  display: flex;
  gap: 8px;
}
#pair-code {
  flex: 1;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.empty {
  color: #8a8a8e;
  text-align: center;
  margin-top: 40px;
  font-size: 13px;
}

.card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #232324;
  border: 1px solid #333335;
  border-radius: 10px;
  padding: 6px;
}

.card.active {
  border-color: #d97757;
  box-shadow: 0 0 0 1px #d97757 inset;
}

.card-main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  min-width: 0;
}
.card-main:hover {
  background: #2c2c2e;
}

.avatar {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  background: #d97757;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
}

.card-info {
  min-width: 0;
}

.card-name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-token {
  font-size: 11px;
  color: #9a9a9e;
  font-family: ui-monospace, monospace;
}

.badge {
  font-size: 10px;
  font-weight: 600;
  color: #d97757;
  border: 1px solid #d97757;
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

.menu-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 6px;
  color: #9a9a9e;
}
.menu-btn:hover {
  background: #323234;
}

.menu {
  position: absolute;
  right: 6px;
  top: 42px;
  background: #29292b;
  border: 1px solid #3a3a3d;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  min-width: 170px;
  z-index: 10;
  overflow: hidden;
}
.menu[hidden] {
  display: none;
}

.menu button {
  border: none;
  background: none;
  color: #e8e8e8;
  text-align: left;
  padding: 8px 12px;
  font-size: 12.5px;
  cursor: pointer;
}
.menu button:hover {
  background: #323234;
}
.menu button.danger {
  color: #e0665a;
}

.add-card {
  margin-top: 8px;
  width: 100%;
  border: 1px dashed #3a3a3d;
  background: transparent;
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #c9c9cd;
  cursor: pointer;
}
.add-card:hover {
  border-color: #d97757;
  color: #d97757;
}

dialog {
  border: none;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  width: 300px;
  background: #29292b;
  color: #e8e8e8;
}
dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

dialog form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #c9c9cd;
  margin-bottom: 10px;
}

input[type="text"],
input[type="password"] {
  background: #1e1e1f;
  border: 1px solid #3a3a3d;
  color: #e8e8e8;
  border-radius: 6px;
  padding: 7px 9px;
  font-size: 13px;
  font-family: inherit;
}

.error {
  color: #e0665a;
  font-size: 12px;
  margin: 10px 0 0;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

button {
  font-family: inherit;
}

button.primary {
  background: #d97757;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
}
.dialog-actions button:not(.primary) {
  background: transparent;
  border: 1px solid #3a3a3d;
  color: #e8e8e8;
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 12.5px;
  cursor: pointer;
}

.toast {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f0f10;
  border: 1px solid #333335;
  color: white;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12.5px;
}
.toast.error {
  background: #4a1f1a;
  border-color: #e0665a;
}
