:root {
  color-scheme: dark light;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  --background-dark: #0b0d17;
  --background-light: #f5f7fb;
  --card-dark: #161b2e;
  --card-light: #ffffff;
  --text-dark: #e2e8f0;
  --text-light: #1a202c;
  --accent: #6366f1;
  --border: rgba(148, 163, 184, 0.3);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background-dark);
  color: var(--text-dark);
}

body.theme-light {
  background: var(--background-light);
  color: var(--text-light);
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.button:hover {
  border-color: var(--accent);
}

.card {
  background: var(--card-dark);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.25);
}

body.theme-light .card {
  background: var(--card-light);
}

.card h2 {
  margin-top: 0;
  margin-bottom: 1rem;
}

.container-list,
.stack-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.container-list li,
.stack-list li {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.9rem 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.05);
}

body.theme-light .container-list li,
body.theme-light .stack-list li {
  background: rgba(79, 70, 229, 0.08);
}

.stack-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.stack-header strong {
  font-size: 1.05rem;
}

.inner-list {
  list-style: none;
  margin: 0.25rem 0 0 0;
  padding-left: 1rem;
  color: rgba(148, 163, 184, 0.85);
  font-size: 0.9rem;
}

.inner-list li {
  margin: 0.2rem 0;
}

.container-list strong {
  font-size: 1.1rem;
}

.muted {
  color: rgba(148, 163, 184, 0.75);
  font-size: 0.9rem;
}

body.theme-light .muted {
  color: rgba(71, 85, 105, 0.8);
}

#settings-dialog {
  border: none;
  border-radius: 14px;
  padding: 0;
  background: transparent;
}

.settings-card {
  min-width: 320px;
  max-width: 420px;
  background: var(--card-dark);
  color: inherit;
  border-radius: 14px;
  padding: 1.75rem;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

body.theme-light .settings-card {
  background: var(--card-light);
}

.settings-card h3 {
  margin: 0 0 0.5rem 0;
}

.settings-card label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.settings-card input[type="password"] {
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.6);
  color: inherit;
}

body.theme-light .settings-card input[type="password"] {
  background: rgba(241, 245, 249, 0.9);
}

.settings-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.theme-options {
  display: flex;
  gap: 1rem;
}

.theme-options label {
  align-items: center;
  flex-direction: row;
  gap: 0.4rem;
}

@media (max-width: 640px) {
  .container {
    padding: 1.5rem 1rem;
  }

  .settings-card {
    min-width: auto;
    width: 100%;
  }
}
