:root {
  color-scheme: light;
  --bg: #f8fafc;
  --ink: #111827;
  --muted: #64748b;
  --line: #d7dee8;
  --accent: #0f766e;
  --danger: #b91c1c;
  --panel: #ffffff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  padding: 0.75rem 1rem;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

button.danger {
  background: var(--danger);
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.85rem 0.95rem;
  color: var(--ink);
  background: white;
}

h1,
p {
  margin-top: 0;
}

.muted,
.form-hint {
  color: var(--muted);
}

.submit-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1rem;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(37, 99, 235, 0.08)),
    var(--bg);
}

.submit-shell {
  width: min(100%, 32rem);
}

.submit-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: clamp(1.25rem, 5vw, 2rem);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
}

.submit-panel h1 {
  font-size: clamp(2rem, 10vw, 3.5rem);
  line-height: 1;
  margin-bottom: 0.65rem;
}

.submit-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.feedback {
  min-height: 1.5rem;
  margin-top: 1rem;
  font-weight: 700;
}

.feedback.success {
  color: #166534;
}

.feedback.error {
  color: var(--danger);
}

.feedback.pending {
  color: #2563eb;
}

.cloud-body {
  overflow: hidden;
  background: var(--bg);
}

.cloud-stage {
  display: grid;
  grid-template-rows: auto 1fr;
  position: relative;
  width: 100vw;
  height: 100vh;
}

.cloud-title {
  margin: 0;
  padding: clamp(1rem, 2.5vh, 1.75rem) 20rem 0.5rem clamp(1rem, 3vw, 2.5rem);
  color: #111827;
  font-size: clamp(2.2rem, 5vw, 5rem);
  font-weight: 850;
  line-height: 1;
  text-align: left;
}

#word-cloud {
  display: block;
  width: 100vw;
  height: 100%;
  min-height: 0;
}

.cloud-submit-panel {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  bottom: auto;
  left: auto;
  z-index: 20;
  width: 17rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  padding: 1rem;
  text-align: center;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.cloud-submit-button {
  display: block;
  width: 100%;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.cloud-submit-panel p {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.admin-body {
  background: #eef2f7;
}

.admin-shell {
  width: min(100%, 76rem);
  margin: 0 auto;
  padding: 1.5rem;
}

.admin-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-header h1 {
  margin-bottom: 0.25rem;
}

.admin-login {
  display: flex;
  width: min(100%, 25rem);
  gap: 0.5rem;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

#admin-status {
  color: var(--muted);
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

table {
  width: 100%;
  min-width: 62rem;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 0.75rem;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f8fafc;
  color: #334155;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.raw-text {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.status-pill {
  display: inline-block;
  min-width: 4.5rem;
  border-radius: 999px;
  padding: 0.25rem 0.5rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 800;
}

.status-allow {
  background: #dcfce7;
  color: #166534;
}

.status-review {
  background: #fef3c7;
  color: #92400e;
}

.status-block {
  background: #fee2e2;
  color: #991b1b;
}

.row-actions {
  white-space: nowrap;
}

.row-actions button {
  margin: 0 0.25rem 0.25rem 0;
  padding: 0.45rem 0.55rem;
  font-size: 0.85rem;
}

@media (max-width: 680px) {
  .cloud-submit-panel {
    top: 0.75rem;
    right: 0.75rem;
    bottom: auto;
    left: auto;
    width: 10.75rem;
    padding: 0.6rem;
  }

  .cloud-submit-button {
    padding: 0.7rem 0.85rem;
    font-size: 0.9rem;
  }

  .cloud-submit-panel p {
    font-size: 0.72rem;
    line-height: 1.25;
  }

  .cloud-title {
    padding-right: 12.25rem;
    font-size: clamp(1.75rem, 8vw, 3rem);
  }

  .admin-header,
  .admin-login {
    display: grid;
    width: 100%;
  }

  .admin-shell {
    padding: 1rem;
  }
}
