:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #18202b;
  --muted: #657080;
  --line: #dce1e8;
  --soft-line: #edf0f4;
  --accent: #176b5f;
  --accent-strong: #0f4f47;
  --accent-soft: #e6f2ef;
  --warning-soft: #fff3dd;
  --shadow: 0 18px 60px rgba(26, 35, 48, 0.08);
}

* {
  box-sizing: border-box;
}

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

button,
select {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 30px;
  background: #111821;
  color: #f8fafc;
  border-right: 1px solid #0d1219;
}

.brand-block h1,
.content-header h2 {
  margin: 0;
  letter-spacing: 0;
}

.brand-block h1 {
  font-size: 30px;
  line-height: 1.05;
}

.eyebrow,
.section-label,
.metric-label,
.email-number,
.subject-row span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar .eyebrow,
.sidebar .section-label {
  color: #9eacbc;
}

.controls {
  display: grid;
  gap: 18px;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid #2b3747;
  border-radius: 8px;
  background: #0f1620;
}

.mode-button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #b9c5d2;
  cursor: pointer;
  font-weight: 750;
}

.mode-button:hover,
.mode-button.active {
  background: #223044;
  color: #ffffff;
}

.controls label {
  display: grid;
  gap: 8px;
}

.controls label span {
  color: #c7d1de;
  font-size: 13px;
  font-weight: 650;
}

select {
  width: 100%;
  min-height: 44px;
  padding: 0 38px 0 12px;
  border: 1px solid #334154;
  border-radius: 8px;
  background: #182230;
  color: #f8fafc;
  outline: none;
}

select:focus {
  border-color: #5ed3bf;
  box-shadow: 0 0 0 3px rgba(94, 211, 191, 0.18);
}

.quick-list {
  display: grid;
  gap: 12px;
}

.pain-buttons {
  display: grid;
  gap: 8px;
}

.pain-button {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #2b3747;
  border-radius: 8px;
  background: transparent;
  color: #dbe5ef;
  text-align: left;
  cursor: pointer;
}

.pain-button:hover,
.pain-button.active {
  border-color: #5ed3bf;
  background: rgba(94, 211, 191, 0.12);
  color: #ffffff;
}

.content {
  min-width: 0;
  padding: 34px 36px 48px;
}

.content-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.content-header h2 {
  margin-top: 6px;
  font-size: 34px;
  line-height: 1.08;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.secondary-button,
.icon-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

.secondary-button {
  min-height: 40px;
  padding: 0 14px;
  box-shadow: 0 8px 24px rgba(26, 35, 48, 0.06);
}

.secondary-button:hover,
.icon-button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.summary-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.summary-band div {
  display: grid;
  gap: 6px;
  min-height: 78px;
  padding: 16px;
  background: var(--panel);
}

.summary-band strong {
  font-size: 18px;
}

.email-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.email-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 34px rgba(26, 35, 48, 0.06);
}

.email-card:first-child {
  border-color: #b7d9d1;
}

.email-card.recommended {
  border-color: #176b5f;
  box-shadow: 0 14px 38px rgba(23, 107, 95, 0.14);
}

.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.card-topline h3 {
  margin: 4px 0 0;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0;
}

.icon-button {
  align-self: flex-start;
  min-width: 58px;
  min-height: 34px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.subject-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--accent-soft);
}

.subject-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--accent-strong);
}

.email-body {
  display: grid;
  gap: 11px;
  color: #283342;
  font-size: 15px;
  line-height: 1.48;
}

.email-body p {
  margin: 0;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
}

.hidden {
  display: none !important;
}

@media (max-width: 940px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .email-grid,
  .summary-band {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 26px 18px 36px;
  }

  .content-header {
    display: grid;
  }
}

@media (max-width: 560px) {
  .sidebar {
    padding: 22px 18px;
  }

  .content-header h2 {
    font-size: 28px;
  }
}
