:root {
  color-scheme: dark;
  --bg: #0b0c0e;
  --panel: #141619;
  --panel2: #1a1d21;
  --border: #2a2e34;
  --text: #f2f3f5;
  --muted: #989fa8;
  --red: #d7322f;
  --red2: #ff5049;
  --green: #48c78e;
  --yellow: #e8b84d;
  --blue: #6ca6ff;
}

* {
  box-sizing: border-box;
}

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

body {
  padding-bottom: 60px;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px 24px;
  background: rgba(11, 12, 14, .94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 20px;
  font-weight: 750;
}

.dragon-small {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--red);
  color: white;
}

.subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.logout {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.page {
  width: min(1120px, calc(100% - 28px));
  margin: 22px auto;
}

.notice {
  margin-bottom: 18px;
  padding: 13px 16px;
  color: #c8ccd2;
  border: 1px solid #30353c;
  border-radius: 12px;
  background: #111317;
  font-size: 13px;
}

.stats {
  display: grid;
  grid-template-columns:
    repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  min-height: 104px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

.stat strong {
  font-size: 31px;
}

.stat.warning strong {
  color: var(--yellow);
}

.stat.ready strong {
  color: var(--green);
}

.panel {
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--panel);
}

.panel h2,
.reviews-heading h2 {
  margin: 0 0 5px;
  font-size: 18px;
}

.panel p,
.reviews-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.actions form {
  margin: 0;
}

.actions button,
.primary {
  min-height: 43px;
  padding: 0 17px;
  border: 1px solid #3a4048;
  border-radius: 10px;
  background: #20242a;
  color: var(--text);
  font-weight: 650;
}

.actions button:hover {
  background: #292e35;
}

.actions .sheet {
  border-color: #375747;
  background: #1b3227;
}

.actions .primary,
.primary {
  border-color: var(--red);
  background: var(--red);
  color: white;
}

.actions .primary:hover,
.primary:hover {
  background: var(--red2);
}

.job-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.job-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #555b64;
}

.job-dot.running {
  background: var(--green);
  box-shadow:
    0 0 0 5px rgba(72,199,142,.12);
  animation: pulse 1.4s infinite;
}

@keyframes pulse {
  50% {
    opacity: .45;
  }
}

#job-log {
  max-height: 260px;
  overflow: auto;
  margin: 17px 0 0;
  padding: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #c7ccd2;
  background: transparent;
  font-size: 12px;
  line-height: 1.5;
}

#job-log:empty {
  display: none;
}

.job-error {
  border-color: #703935;
}

.job-success {
  border-color: #315742;
}

.reviews-heading {
  margin: 30px 2px 13px;
}

.reviews {
  display: grid;
  gap: 12px;
}

.review-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--panel);
}

.review-top,
.block-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.store {
  display: block;
  font-size: 15px;
}

.reviewer {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.rating {
  flex: 0 0 auto;
  font-size: 17px;
  font-weight: 750;
}

.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.badge {
  padding: 3px 7px;
  border-radius: 999px;
  font-weight: 650;
}

.badge.ready {
  color: #9be5bd;
  background: #173525;
}

.badge.sent {
  color: #a7c7ff;
  background: #182942;
}

.badge.pending {
  color: #f4ce76;
  background: #3a2e16;
}

.badge.answered {
  color: #bbc0c7;
  background: #292d32;
}

.block {
  margin-top: 16px;
}

.block-title {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.review-text,
.response-text,
.translation {
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 14px;
}

.response-block {
  padding: 14px;
  border-radius: 11px;
  background: var(--panel2);
}

.copy-button {
  padding: 5px 9px;
  border: 1px solid #3a4048;
  border-radius: 8px;
  background: transparent;
  color: #dfe2e6;
  font-size: 12px;
}

.empty-review {
  margin-top: 15px;
  color: var(--muted);
  font-style: italic;
  font-size: 13px;
}

details {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--border);
}

summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
}

.translation {
  margin-top: 10px;
  color: #c9cdd2;
}

.login-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: min(390px, 100%);
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
}

.dragon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 14px;
  background: var(--red);
  color: white;
  font-size: 29px;
  font-weight: 800;
}

.login-card h1 {
  margin: 0;
}

.muted {
  color: var(--muted);
}

.login-card label {
  display: block;
  margin: 24px 0 7px;
  color: var(--muted);
  font-size: 13px;
}

.login-card input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid #383e46;
  border-radius: 10px;
  outline: none;
  background: #0f1114;
  color: white;
}

.login-card input:focus {
  border-color: #6b727d;
}

.login-card button {
  width: 100%;
  margin-top: 12px;
}

.error {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 9px;
  color: #ffc3bf;
  background: #3b1c1a;
  font-size: 13px;
}

@media (max-width: 760px) {
  .topbar {
    padding: 14px 16px;
  }

  .page {
    width: min(
      100% - 20px,
      1120px
    );
    margin-top: 12px;
  }

  .stats {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .stat {
    min-height: 90px;
  }

  .actions {
    display: grid;
    grid-template-columns:
      1fr 1fr;
  }

  .actions form,
  .actions button {
    width: 100%;
  }

  .review-card {
    padding: 15px;
  }
}

@media (max-width: 430px) {
  .stats {
    grid-template-columns:
      1fr 1fr;
  }

  .actions {
    grid-template-columns: 1fr;
  }

  .subtitle {
    display: none;
  }
}


/* =========================================================
   MANUAL REPLIED STATUS
   ========================================================= */

.review-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.review-actions form {
  margin: 0;
}

.mark-replied-button,
.undo-replied-button {
  min-height: 38px;
  padding: 0 13px;
  border-radius: 9px;
  font-weight: 700;
}

.mark-replied-button {
  border: 1px solid #37664d;
  background: #193827;
  color: #a5e9c3;
}

.mark-replied-button:hover {
  background: #214a34;
}

.undo-replied-button {
  border: 1px solid #464c54;
  background: #20242a;
  color: #c5cad0;
}

.undo-replied-button:hover {
  background: #2a2f36;
}

.badge.replied {
  color: #9be5bd;
  background: #173525;
}

.review-complete {
  opacity: .68;
}

.review-complete:hover {
  opacity: 1;
}
