:root {
  --ink: #172026;
  --muted: #5e6872;
  --paper: #f4f0e8;
  --panel: #ffffff;
  --line: #d7dddf;
  --green: #0f766e;
  --green-dark: #083f3b;
  --blue: #315f7c;
  --coral: #cf6d50;
  --gold: #d59a35;
  --red: #9f2d3a;
  --shadow: 0 24px 70px rgba(18, 28, 34, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.1), rgba(244, 240, 232, 0) 390px),
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(26px, 5vw, 62px) 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(32px, 5vw, 64px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 950;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: var(--green-dark);
  color: #fff;
}

.top-badge {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(23, 32, 38, 0.1);
  background: rgba(255, 255, 255, 0.75);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 850;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 450px);
  gap: clamp(28px, 5vw, 74px);
  align-items: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: 0.94;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3.8vw, 3.1rem);
  line-height: 1;
}

h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.hero p:last-child {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.6;
}

.inbox-source,
.metrics article,
.queue-panel,
.review-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.inbox-source {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.inbox-source h2 {
  font-size: clamp(1.55rem, 3vw, 2.35rem);
}

.inbox-source p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-list span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 9px;
  background: #edf4f3;
  color: var(--green-dark);
  font-size: 0.82rem;
  font-weight: 900;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 850;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

input {
  min-height: 44px;
  padding: 0 11px;
}

textarea {
  resize: vertical;
  padding: 11px;
  line-height: 1.45;
}

.inbox-source button,
.review-actions button,
.secondary-button {
  min-height: 44px;
  border: 0;
  padding: 10px 14px;
  font-weight: 950;
}

.inbox-source button,
.review-actions button:first-child,
#process-button {
  background: var(--green-dark);
  color: #fff;
}

.secondary-button {
  background: #e8ecec;
  color: var(--ink);
  border: 1px solid var(--line);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: clamp(26px, 4vw, 42px) 0;
}

.metrics article {
  display: grid;
  gap: 10px;
  min-height: 128px;
  padding: 22px;
  box-shadow: none;
}

.metrics span {
  color: var(--muted);
  font-weight: 850;
}

.metrics strong {
  align-self: end;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 18px;
  align-items: start;
}

.queue-panel,
.review-panel {
  padding: clamp(16px, 3vw, 24px);
  box-shadow: none;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.status {
  min-height: 22px;
  margin: 0 0 14px;
  color: var(--muted);
  font-weight: 850;
}

.status.error {
  color: var(--red);
}

.email-list {
  display: grid;
  gap: 10px;
}

.email-card {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fbfdfc;
  text-align: left;
}

.email-card.active {
  border-color: var(--green);
  box-shadow: inset 4px 0 0 var(--green);
}

.email-card strong {
  font-size: 1rem;
}

.email-card span,
.from-line,
.review-empty p,
#review-reason,
#review-body {
  color: var(--muted);
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-pill,
.urgent-pill,
.state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 8px;
  font-size: 0.8rem;
  font-weight: 950;
}

.category-pill {
  background: #edf4f3;
  color: var(--green-dark);
}

.urgent-pill {
  background: #ffe9df;
  color: var(--red);
}

.state-pill {
  background: #eef1f4;
  color: var(--blue);
}

.review-empty {
  display: grid;
  align-content: center;
  min-height: 420px;
}

.review-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.urgent-banner,
.approval-banner {
  margin: 14px 0;
  padding: 12px;
  font-weight: 950;
}

.urgent-banner {
  background: #ffe9df;
  color: var(--red);
}

.approval-banner {
  background: #e5f4ef;
  color: var(--green-dark);
}

.review-detail section {
  margin-top: 18px;
}

.review-detail p {
  margin: 0;
  line-height: 1.55;
}

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

@media (max-width: 980px) {
  .hero,
  .workspace,
  .metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1240px);
    padding-top: 18px;
  }

  .topbar,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-badge {
    width: 100%;
  }

  h1 {
    font-size: clamp(2.8rem, 16vw, 4.2rem);
  }
}
