:root {
  color-scheme: light dark;
  --bg-page: #f5f7fb;
  --bg-card: rgba(255, 255, 255, 0.94);
  --bg-card-dark: rgba(20, 24, 29, 0.85);
  --bg-soft: rgba(31, 122, 109, 0.08);
  --text-primary: #14232d;
  --text-muted: rgba(20, 35, 45, 0.72);
  --accent: #1f7a6d;
  --accent-strong: #15594f;
  --border: rgba(21, 89, 79, 0.14);
  --border-strong: rgba(21, 89, 79, 0.32);
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow-soft: 0 28px 60px rgba(15, 59, 54, 0.16);
  --shadow-card: 0 16px 40px rgba(15, 59, 54, 0.12);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #f5f7fb 0%, #eef4f1 45%, #f6fbff 100%);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  padding: clamp(16px, 4vw, 48px);
}

body.dark {
  background: radial-gradient(circle at top, #10151d 0%, #0d1219 45%, #090d12 100%);
  color: #e9f6f4;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: -1;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  padding: 12px 18px;
  background: var(--accent);
  color: white;
  border-radius: 999px;
  box-shadow: 0 16px 40px rgba(15, 59, 54, 0.32);
  z-index: 10;
}

.social-shell {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  gap: clamp(24px, 5vw, 40px);
}

.social-hero {
  display: grid;
  gap: 24px;
  padding: clamp(24px, 4vw, 48px);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow-soft);
}

body.dark .social-hero {
  background: var(--bg-card-dark);
  border-color: rgba(255, 255, 255, 0.08);
}

.social-hero__eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.75rem;
  color: var(--accent-strong);
  font-weight: 600;
}

.social-hero__title {
  margin: 8px 0 0;
  font-size: clamp(2.2rem, 5vw, 3rem);
  letter-spacing: -0.02em;
}

.social-hero__lead {
  margin: 12px 0 0;
  max-width: 720px;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.social-hero__aside {
  padding: clamp(16px, 3vw, 24px);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  box-shadow: 0 18px 40px rgba(15, 59, 54, 0.12);
}

.social-hero__aside h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
}

.social-hero__aside ul {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.98rem;
}

.social-grid {
  display: grid;
  gap: clamp(24px, 4vw, 36px);
}

@media (min-width: 980px) {
  .social-grid {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    align-items: start;
  }
}

.social-panel {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow-card);
  padding: clamp(20px, 3vw, 32px);
  display: grid;
  gap: clamp(20px, 3vw, 28px);
}

body.dark .social-panel {
  background: var(--bg-card-dark);
  border-color: rgba(255, 255, 255, 0.08);
}

.panel-header h2 {
  margin: 0 0 6px;
  font-size: 1.45rem;
}

.panel-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.6;
}

.panel-form {
  display: grid;
  gap: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.field {
  display: grid;
  gap: 6px;
}

.field__label {
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.8);
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 122, 109, 0.18);
}

.primary-action {
  justify-self: start;
  padding: 12px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: white;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 16px 28px rgba(15, 59, 54, 0.24);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 36px rgba(15, 59, 54, 0.28);
}

.ghost-action {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--accent-strong);
  font-weight: 600;
  cursor: pointer;
}

.key-form {
  display: grid;
  gap: 16px;
}

.key-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.key-feedback {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.panel-list {
  display: grid;
  gap: 18px;
}

.empty-state {
  margin: 0;
  padding: 20px;
  border-radius: 16px;
  background: rgba(31, 122, 109, 0.08);
  color: var(--text-muted);
  border: 1px dashed var(--border-strong);
}

.campaign-card,
.credential-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  padding: 20px;
  box-shadow: 0 16px 30px rgba(15, 59, 54, 0.12);
  display: grid;
  gap: 14px;
}

body.dark .campaign-card,
body.dark .credential-card {
  background: rgba(20, 24, 29, 0.85);
}

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

.card-header h3 {
  margin: 0;
  font-size: 1.15rem;
}

.card-meta {
  display: grid;
  gap: 6px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.card-meta span {
  display: flex;
  gap: 8px;
  align-items: center;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.card-actions select {
  width: auto;
  min-width: 160px;
}

textarea[data-field],
textarea[data-credential-id] {
  min-height: 90px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(31, 122, 109, 0.12);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-strong);
  font-weight: 600;
}

.delete-button {
  border: none;
  background: none;
  color: rgba(220, 53, 69, 0.85);
  font-weight: 600;
  cursor: pointer;
}

.secret-wrapper {
  display: grid;
  gap: 10px;
}

.secret-details {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(31, 122, 109, 0.12);
  border: 1px solid var(--border);
}

.secret-details span {
  display: flex;
  gap: 8px;
}

.locked-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
}

a.card-link {
  color: var(--accent-strong);
  text-decoration: none;
}

a.card-link:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  body {
    padding: 16px;
  }

  .social-hero__aside ul {
    padding-left: 16px;
  }

  .card-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .card-actions select {
    width: 100%;
  }
}
