* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* .view, .header-buttons and friends set display, which beats the UA [hidden] rule */
[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  color: #e0e0e0;
  background: #1a1a2e;
  display: flex;
  justify-content: center;
  padding: 20px 16px;
}

.shell {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

h1 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

h2 {
  font-size: 11px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.muted {
  color: #999;
  font-size: 12px;
  margin-bottom: 8px;
}

.header-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-back {
  background: none;
  border: none;
  color: #ccc;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
}

.btn-badge {
  padding: 5px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

.btn-badge.has-keys {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
}

.btn-badge.no-keys {
  background: rgba(128, 128, 128, 0.15);
  color: #888;
}

.btn-badge.locked {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.btn-icon {
  background: #16162a;
  border: 1px solid #2a2a4a;
  color: #ccc;
  font-size: 15px;
  cursor: pointer;
  padding: 5px 9px;
  border-radius: 8px;
}

.a2hs-hint {
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: #fde68a;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.4;
}

.error-banner {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12.5px;
}

.view {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.resources-list, .keys-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.resource-item, .key-item {
  background: #16162a;
  border: 1px solid #252542;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.resource-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: #fff;
  word-break: break-all;
  flex: 1;
}

.resource-actions, .key-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.empty-state {
  background: #16162a;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  color: #777;
  font-size: 13px;
}

.resource-input-row, .key-generate-row {
  display: flex;
  gap: 8px;
}

input[type="text"], input[type="url"], textarea {
  flex: 1;
  background: #16162a;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 10px 12px;
  color: #fff;
  font-size: 13px;
}

textarea {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  margin-bottom: 8px;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.btn.small {
  padding: 10px 14px;
  background: #3b82f6;
  color: #fff;
}

.btn.primary {
  background: #4ade80;
  color: #0f172a;
  width: 100%;
}

.btn.secondary {
  background: #252542;
  color: #e0e0e0;
}

.btn.danger {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.pubkey-box, .data-section {
  background: #16162a;
  border: 1px solid #252542;
  border-radius: 10px;
  padding: 12px;
}

.pubkey-actions {
  display: flex;
  gap: 8px;
}

.file-label {
  display: inline-block;
  width: 100%;
}

.version-footer {
  margin-top: 16px;
  text-align: center;
  font-size: 11px;
  color: #555;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
