:root {
  color-scheme: light;
  font-family: "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f5f7fb;
  color: #1f2937;
}

.container {
  width: min(960px, 92%);
  margin: 0 auto;
  padding: 32px 0 48px;
}

.card {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.08);
  padding: 24px;
}

h1 {
  margin: 0 0 14px;
  font-size: 28px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

h2 {
  margin: 0 0 12px;
  font-size: 20px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

h3 {
  margin: 0 0 10px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

p {
  margin: 0 0 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.muted {
  color: #6b7280;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.actions a,
.module-card a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

button {
  border: none;
  background: #2563eb;
  color: #ffffff;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
}

.topbar {
  justify-content: space-between;
  align-items: center;
}

.action-link {
  align-self: center;
  color: #1d4ed8;
}

button.secondary {
  background: #4b5563;
}

button:disabled {
  background: #93c5fd;
  cursor: not-allowed;
}

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

.status {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.error {
  background: #fef2f2;
  color: #b91c1c;
}

.success {
  background: #ecfdf5;
  color: #047857;
}

.module-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
}

.module-card a {
  display: inline-block;
  margin-top: 10px;
  text-decoration: none;
  color: #1d4ed8;
  font-weight: 600;
}

.stream-box {
  width: 100%;
  min-height: 220px;
  margin-top: 10px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 12px;
  background: #111827;
  color: #e5e7eb;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow-x: hidden;
  font-size: 13px;
}

.link-list a {
  display: block;
  margin-top: 8px;
  color: #0ea5e9;
  text-decoration: underline;
}

@media (max-width: 768px) {
  .container {
    width: 100%;
    padding: 16px 12px 24px;
  }

  .card {
    border-radius: 12px;
    padding: 16px;
  }

  h1 {
    font-size: 22px;
    margin-bottom: 10px;
  }

  h2 {
    font-size: 18px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .topbar button {
    width: 100%;
  }

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

  .actions button,
  .actions a {
    width: 100%;
    text-align: center;
  }

  input,
  textarea,
  button,
  .status,
  .module-card {
    font-size: 16px;
  }
}
