* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #0f172a;
  color: #fff;
}

a {
  color: inherit;
  text-decoration: none;
}

a:visited {
  color: inherit;
}

.center-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.page {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card {
  width: 100%;
  max-width: 420px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.wide-card {
  max-width: 900px;
}

.catalog-card {
  margin-bottom: 30px;
}

.card h1,
.card h2,
.card h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

.card p {
  color: #cbd5e1;
}

.login-form {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-form input,
.login-form textarea,
.inline-form input {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #475569;
  background: #0f172a;
  color: #fff;
  outline: none;
  font: inherit;
}

.login-form textarea {
  resize: vertical;
  min-height: 140px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #cbd5e1;
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.login-form button,
.logout-btn,
.link-btn,
.inline-form button,
.danger-btn,
.nav-btn {
  padding: 12px 14px;
  border: none;
  border-radius: 10px;
  background: #2563eb;
  color: white;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.secondary-btn {
  background: #475569;
}

.danger-btn {
  background: #dc2626;
}

.login-form button:hover,
.logout-btn:hover,
.link-btn:hover,
.inline-form button:hover,
.danger-btn:hover,
.nav-btn:hover {
  opacity: 0.92;
}

.error {
  color: #fca5a5;
  margin-top: 12px;
}

.success {
  color: #86efac;
  margin-top: 12px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid #334155;
  background: #020617;
  gap: 16px;
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-form {
  margin: 0;
}

.brand {
  font-weight: 700;
  font-size: 18px;
}

.voice-result {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #334155;
}

.voice-result audio,
.catalog-item audio {
  width: 100%;
  margin: 12px 0;
}

.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.catalog-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 18px;
}

.catalog-item {
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.65);
}

.catalog-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.catalog-header h3 {
  margin-bottom: 6px;
  word-break: break-word;
}

.catalog-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.mini-link,
.mini-link:visited {
  color: #93c5fd;
  text-decoration: none;
  font-size: 14px;
}

.mini-link:hover {
  text-decoration: underline;
}

.catalog-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.inline-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.inline-form input {
  min-width: 220px;
}

.danger-form {
  margin-left: auto;
}

.file-path code {
  display: inline-block;
  background: #0b1220;
  border: 1px solid #334155;
  padding: 8px 10px;
  border-radius: 8px;
  color: #cbd5e1;
  word-break: break-all;
}

@media (max-width: 700px) {
  .page {
    padding: 18px;
  }

  .catalog-header {
    flex-direction: column;
  }

  .danger-form {
    margin-left: 0;
  }

  .inline-form input {
    min-width: 100%;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}