:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #eef3fb;
  --line: #d8dee9;
  --line-strong: #b7c1d1;
  --text: #1f2937;
  --muted: #667085;
  --red: #d93025;
  --blue: #1a73e8;
  --yellow: #f9ab00;
  --green: #188038;
  --ink: #202124;
  --shadow: 0 18px 45px rgba(25, 42, 70, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(247, 249, 252, 0.92)),
    repeating-linear-gradient(90deg, rgba(26, 115, 232, 0.06) 0 1px, transparent 1px 80px);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.skip-link,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.skip-link:focus {
  z-index: 20;
  width: auto;
  height: auto;
  padding: 10px 14px;
  clip: auto;
  background: var(--ink);
  color: white;
}

.workspace-shell {
  width: min(1540px, calc(100% - 28px));
  margin: 14px auto 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.topbar {
  display: grid;
  grid-template-columns: 220px minmax(260px, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 74px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 150px;
  height: auto;
}

.search {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  height: 48px;
  min-width: 0;
  padding: 0 8px 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--surface-2);
}

.search:focus-within {
  border-color: rgba(26, 115, 232, 0.45);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

.search-icon {
  color: var(--muted);
  font-size: 21px;
  line-height: 1;
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: var(--line-strong);
  background: #f5f8fd;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 8px;
}

.source-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(217, 48, 37, 0.2);
  border-radius: 8px;
  background: rgba(217, 48, 37, 0.08);
  color: #a3271f;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.mobile-tabs {
  display: none;
}

.app-frame {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr) 330px;
  min-height: 720px;
}

.sidebar,
.inspector {
  background: rgba(248, 251, 255, 0.92);
}

.sidebar {
  padding: 18px 12px 20px;
  border-right: 1px solid var(--line);
}

.compose {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 148px;
  height: 48px;
  margin: 0 0 18px 4px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: #c2e7ff;
  color: #0b3658;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(26, 115, 232, 0.13);
}

.compose span:first-child {
  font-size: 22px;
  line-height: 1;
}

.folder-list,
.rail-section {
  display: grid;
  gap: 4px;
  margin-bottom: 22px;
}

.folder,
.rail-link,
.people a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  text-decoration: none;
}

.folder strong {
  color: var(--muted);
  font-size: 12px;
}

.folder.active,
.rail-link.active,
.folder:hover,
.rail-link:hover,
.people a:hover {
  background: #fce8e6;
  color: #a50e0e;
}

.rail-heading {
  padding: 0 12px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.content {
  min-width: 0;
  padding: 18px;
  background: var(--surface);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(217, 48, 37, 0.08), transparent 42%),
    linear-gradient(45deg, rgba(26, 115, 232, 0.08), transparent 50%),
    #fff;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 12px;
  color: var(--ink);
  font-size: clamp(42px, 6vw, 82px);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
}

.lede {
  max-width: 760px;
  margin-bottom: 0;
  color: #4b5563;
  font-size: 18px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(86px, 1fr));
  gap: 8px;
  min-width: 310px;
}

.hero-metrics div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
}

.hero-metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.hero-metrics strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 18px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0 12px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
}

.filter.active,
.filter:hover,
.filter:focus-visible {
  border-color: rgba(26, 115, 232, 0.35);
  background: #e8f0fe;
  color: #174ea6;
}

.result-count {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.mail-list {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.mail-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 108px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.mail-row:last-of-type {
  border-bottom: 0;
}

.mail-row:hover,
.mail-row.active {
  background: #f8fbff;
}

.sender-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--surface-2);
  color: #174ea6;
  font-size: 13px;
  font-weight: 900;
}

.mail-copy {
  min-width: 0;
}

.mail-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.mail-line strong {
  color: var(--ink);
  white-space: nowrap;
}

.mail-line span,
.mail-copy p {
  color: var(--muted);
}

.mail-line span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-copy p {
  margin: 5px 0 0;
  font-size: 14px;
}

.mail-meta {
  display: grid;
  justify-items: end;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.tag {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 9px;
  border-radius: 8px;
  font-weight: 900;
}

.tag.red {
  background: #fce8e6;
  color: #a50e0e;
}

.tag.blue {
  background: #e8f0fe;
  color: #174ea6;
}

.tag.yellow {
  background: #fef7e0;
  color: #8a5a00;
}

.tag.green {
  background: #e6f4ea;
  color: #137333;
}

.empty-state {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.inspector {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px 14px;
  border-left: 1px solid var(--line);
}

.ai-box,
.source-box,
.module-grid,
.faq {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.ai-box {
  border-color: rgba(26, 115, 232, 0.26);
  background: linear-gradient(140deg, #fff, #f2f7ff);
}

.ai-box p:last-child,
.source-box p:last-child,
.faq p:last-child {
  margin-bottom: 0;
}

.source-box a,
.site-footer a {
  color: #174ea6;
  font-weight: 800;
}

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

.module-grid a {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

details {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

details:first-of-type {
  border-top: 0;
}

summary {
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.site-footer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  width: min(1540px, calc(100% - 28px));
  margin: 18px auto 28px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.site-footer img {
  width: 42px;
  height: 42px;
}

.site-footer p {
  margin-bottom: 0;
  color: var(--muted);
}

@media (max-width: 1180px) {
  .app-frame {
    grid-template-columns: 224px minmax(0, 1fr);
  }

  .inspector {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .module-grid,
  .faq {
    align-self: stretch;
  }
}

@media (max-width: 840px) {
  .workspace-shell,
  .site-footer {
    width: 100%;
    margin-top: 0;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 12px;
  }

  .brand img {
    width: 128px;
  }

  .search {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .top-actions {
    justify-content: end;
  }

  .top-actions .icon-button {
    display: none;
  }

  .mobile-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    background: #fff;
  }

  .mobile-tabs a {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
  }

  .app-frame {
    display: block;
    min-height: 0;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .compose {
    display: none;
  }

  .folder-list,
  .rail-section {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin: 0 0 10px;
    padding-bottom: 2px;
  }

  .rail-heading,
  .people {
    display: none;
  }

  .folder,
  .rail-link {
    flex: 0 0 auto;
    width: auto;
    min-height: 34px;
    border: 1px solid var(--line);
    background: white;
    white-space: nowrap;
  }

  .folder strong {
    margin-left: 8px;
  }

  .content {
    padding: 12px;
  }

  .hero-panel,
  .toolbar,
  .mail-row,
  .site-footer {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-panel {
    gap: 18px;
    padding: 20px;
  }

  h1 {
    font-size: clamp(42px, 13vw, 58px);
  }

  .lede {
    font-size: 16px;
  }

  .hero-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
  }

  .toolbar {
    gap: 10px;
    justify-items: start;
  }

  .mail-row {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    min-height: 0;
  }

  .mail-meta {
    grid-column: 2;
    justify-items: start;
    grid-auto-flow: column;
    justify-content: start;
  }

  .mail-line {
    display: block;
  }

  .mail-line strong,
  .mail-line span {
    display: block;
    white-space: normal;
  }

  .inspector {
    display: grid;
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .site-footer {
    margin-bottom: 0;
  }
}

@media (max-width: 420px) {
  .source-chip {
    max-width: 138px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .filter {
    padding: 0 11px;
  }
}
