:root {
  color-scheme: light;
  --bg: #edf1f7;
  --canvas: #fbfcff;
  --canvas-2: #f4f7fb;
  --ink: #172033;
  --ink-2: #3f4c63;
  --muted: #6f7b8f;
  --faint: #9aa6b8;
  --line: #dbe2ec;
  --line-strong: #cbd5e3;
  --accent: #315fd6;
  --accent-2: #254fb8;
  --accent-soft: #edf3ff;
  --good: #0b6b43;
  --good-soft: #eef8f2;
  --warn: #946116;
  --warn-soft: #fff8e8;
  --bad: #9f302a;
  --bad-soft: #fff0ee;
  --shadow: 0 16px 38px rgba(28, 39, 59, 0.07);
  --shadow-soft: 0 8px 22px rgba(28, 39, 59, 0.045);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #f9fbff;
  color: var(--ink-2);
  padding: 8px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 650;
}

button:hover {
  border-color: #aeb9ca;
  color: var(--ink);
  background: #ffffff;
}

button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

button.primary:hover {
  background: var(--accent-2);
}

button.secondary {
  border-color: #c6d4f7;
  background: var(--accent-soft);
  color: #284fae;
}

button.ghost {
  border-color: transparent;
  background: transparent;
}

button.small {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}

button.danger {
  color: var(--bad);
}

.icon-button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  font-weight: 700;
}

.attachment-button {
  max-width: 180px;
  justify-content: flex-start;
}

.attachment-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fdfdff;
  color: var(--ink);
  padding: 9px 10px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(49, 95, 214, 0.11);
}

textarea {
  min-height: 126px;
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 650;
}

a {
  color: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: #f8faff;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 8px 16px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #172033;
  color: #fff;
  font-weight: 800;
}

.brand-copy {
  display: grid;
  min-width: 0;
}

.brand-copy strong {
  font-size: 14px;
}

.brand-copy span,
.sidebar-label,
.muted,
.label {
  color: var(--muted);
}

.nav {
  display: grid;
  gap: 3px;
}

.nav button {
  width: 100%;
  justify-content: flex-start;
  border-color: transparent;
  background: transparent;
  min-height: 38px;
  padding: 9px 10px;
  color: var(--ink-2);
}

.nav button svg,
.empty-state svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.nav button.active {
  border-color: #c6d4f7;
  background: #edf3ff;
  color: #284fae;
  box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar-card {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--canvas-2);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.sidebar-card strong {
  font-size: 13px;
  word-break: break-all;
}

.sidebar-label {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 800;
}

.sidebar-foot {
  display: grid;
  gap: 8px;
  padding: 4px 8px 2px;
  color: var(--muted);
  font-size: 13px;
}

.sidebar-foot a {
  text-decoration: none;
}

.main {
  min-width: 0;
  background: var(--bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(237, 241, 247, 0.92);
  backdrop-filter: blur(14px);
}

.page-title-block {
  min-width: 0;
}

.page-title-block h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.18;
  letter-spacing: 0;
}

.page-title-block p {
  margin: 4px 0 0;
  color: var(--muted);
}

.topbar-actions,
.form-actions,
.inline-actions,
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.workspace-strip {
  margin: 18px 24px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--canvas);
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) minmax(160px, 1fr) minmax(160px, 1.2fr) auto;
  gap: 12px;
  align-items: center;
}

.workspace-strip > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.workspace-strip strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.label {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 800;
}

.notice {
  margin: 14px 24px 0;
  border: 1px solid #fedf89;
  background: var(--warn-soft);
  color: #7a2e0e;
  border-radius: var(--radius);
  padding: 11px 13px;
}

.notice.bad {
  border-color: #fecdca;
  background: var(--bad-soft);
  color: var(--bad);
}

.notice.good {
  border-color: #abefc6;
  background: var(--good-soft);
  color: var(--good);
}

.view {
  padding: 18px 24px 28px;
  display: grid;
  gap: 16px;
}

.setup-strip {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--canvas);
  box-shadow: var(--shadow-soft);
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(220px, 0.45fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.setup-strip > div:first-child {
  display: grid;
  gap: 2px;
}

.setup-strip > div:first-child span {
  color: var(--muted);
  font-size: 13px;
}

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

.setup-step {
  min-width: 0;
  min-height: 54px;
  justify-content: flex-start;
  border-color: var(--line);
  background: #f9fbff;
  text-align: left;
}

.setup-step span {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #e8edf5;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 800;
  flex: 0 0 auto;
}

.setup-step.done span {
  background: var(--good-soft);
  color: var(--good);
}

.setup-step strong,
.setup-step em {
  display: block;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setup-step em {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.mail-hero {
  border: 1px solid #c6d4f7;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fdfdff 0%, #eef4ff 100%);
  box-shadow: var(--shadow-soft);
  padding: 18px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.mail-hero h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.18;
}

.mail-hero p {
  margin: 6px 0 0;
  color: var(--muted);
  max-width: 760px;
}

.mail-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mail-stats,
.inbox-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.command-bar {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--canvas);
  box-shadow: var(--shadow-soft);
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.command-summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--muted);
  flex-wrap: wrap;
}

.command-summary strong {
  color: var(--ink);
  font-size: 16px;
}

.command-summary span {
  margin-right: 10px;
  font-size: 12px;
  font-weight: 700;
}

.overview-head,
.admin-titlebar {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--canvas);
  box-shadow: var(--shadow-soft);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.overview-head h2,
.admin-titlebar h2 {
  margin: 0;
  font-size: 19px;
}

.overview-head p,
.admin-titlebar p {
  margin: 3px 0 0;
  color: var(--muted);
}

.mail-client {
  min-height: calc(100vh - 185px);
  display: grid;
  grid-template-columns: 220px minmax(360px, 0.92fr) minmax(360px, 1.08fr);
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--canvas);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.mail-rail {
  border-right: 1px solid var(--line);
  background: #f8faff;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.compose-trigger {
  width: 100%;
  justify-content: flex-start;
}

.mail-search input {
  min-height: 38px;
}

.folder-nav {
  display: grid;
  gap: 2px;
}

.folder-nav button {
  min-height: 36px;
  width: 100%;
  justify-content: flex-start;
  border-color: transparent;
  background: transparent;
  color: var(--ink-2);
  padding: 7px 8px;
}

.folder-nav button.active {
  border-color: #c6d4f7;
  background: var(--accent-soft);
  color: #284fae;
}

.folder-nav button svg,
.reader-actions svg,
.mail-toolbar svg,
.admin-titlebar svg,
.overview-head svg,
.compose-trigger svg {
  width: 16px;
  height: 16px;
}

.folder-nav button span {
  flex: 1;
  text-align: left;
}

.folder-nav button em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.rail-section {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: grid;
  gap: 8px;
  min-height: 0;
}

.rail-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.mini-inbox-list {
  display: grid;
  gap: 4px;
  max-height: 240px;
  overflow: auto;
}

.mini-inbox-list button {
  min-height: 44px;
  display: grid;
  justify-items: start;
  gap: 1px;
  border-color: transparent;
  background: transparent;
  padding: 7px 8px;
  text-align: left;
}

.mini-inbox-list button.active,
.mini-inbox-list button:hover {
  border-color: var(--line);
  background: #fff;
}

.mini-inbox-list strong,
.mini-inbox-list span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-inbox-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.mail-results {
  min-width: 0;
  border-right: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.mail-toolbar {
  min-height: 58px;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mail-toolbar strong,
.mail-toolbar span {
  display: block;
}

.mail-toolbar span {
  color: var(--muted);
  font-size: 12px;
}

.message-list {
  overflow: auto;
}

.mail-row {
  width: 100%;
  min-height: 82px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 11px 12px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  text-align: left;
  color: var(--ink);
}

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

.mail-row.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.mail-row-icons {
  color: var(--muted);
  display: grid;
  place-items: center;
  padding-top: 2px;
}

.mail-row-icons svg {
  width: 16px;
  height: 16px;
}

.mail-row-main,
.mail-row-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.mail-row-main strong,
.mail-row-main span,
.mail-row-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-row-main span {
  color: var(--ink-2);
  font-weight: 700;
}

.mail-row-main small,
.mail-row-meta time {
  color: var(--muted);
  font-size: 12px;
}

.mail-row-meta {
  justify-items: end;
  max-width: 150px;
}

.mail-row-meta .label-stack {
  min-width: 0;
  justify-content: flex-end;
}

.mail-reader {
  min-width: 0;
  padding: 18px;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 14px;
  overflow: auto;
}

.reader-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.reader-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

.reader-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

.reader-actions,
.reader-labels,
.reader-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.reader-body {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 16px;
  color: var(--ink-2);
  white-space: pre-wrap;
  line-height: 1.6;
  overflow: auto;
}

.admin-access {
  margin-top: 0;
}

.compose-modal {
  width: min(640px, 100%);
}

.inbox-overview-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 12px;
}

.compact-metric {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--canvas);
  box-shadow: 0 1px 2px rgba(28, 39, 59, 0.025);
  padding: 12px;
  display: grid;
  gap: 2px;
}

.compact-metric span,
.compact-metric em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}

.compact-metric strong {
  font-size: 24px;
  line-height: 1.08;
}

.mail-workspace {
  display: grid;
  grid-template-columns: minmax(270px, 0.36fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.mail-column {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--canvas);
  box-shadow: var(--shadow-soft);
  padding: 14px;
  min-width: 0;
}

.inbox-directory {
  position: sticky;
  top: 92px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.section-title h2,
.section-title h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
}

.section-title p {
  margin: 3px 0 0;
  color: var(--muted);
}

.section-title.slim {
  margin-top: 4px;
}

.search-box {
  margin-bottom: 12px;
}

.inbox-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 290px);
  overflow: auto;
  padding-right: 2px;
}

.access-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f6f9ff;
  margin-bottom: 12px;
}

.access-panel summary {
  cursor: pointer;
  padding: 11px 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 750;
  color: var(--ink-2);
}

.access-panel summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.access-grid {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.access-grid > div {
  padding: 12px;
  display: grid;
  gap: 3px;
  border-right: 1px solid var(--line);
}

.access-grid > div:last-child {
  border-right: 0;
}

.access-panel strong {
  font-size: 13px;
}

.conversation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 14px;
  align-items: start;
}

.conversation-feed {
  min-width: 0;
}

.message-feed,
.thread-list,
.thread-directory {
  display: grid;
  gap: 10px;
}

.message-card,
.thread-row,
.thread-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--canvas);
  padding: 12px;
}

.message-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
}

.message-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #edf3ff;
  color: var(--accent);
}

.message-avatar svg,
.setup-step svg {
  width: 15px;
  height: 15px;
}

.message-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.message-line,
.message-meta,
.thread-card-head,
.thread-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.message-line strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-meta,
.thread-row span,
.thread-card span,
.thread-card time,
.thread-row time {
  color: var(--muted);
  font-size: 12.5px;
}

.message-main p {
  margin: 0;
  color: var(--ink-2);
}

.subdued-row {
  opacity: 0.72;
}

.thread-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, auto) auto;
  gap: 12px;
  align-items: center;
}

.thread-drawer {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.thread-drawer summary {
  cursor: pointer;
  color: var(--ink-2);
  font-weight: 750;
  margin-bottom: 10px;
}

.thread-drawer summary span {
  color: var(--muted);
  font-size: 12px;
}

.thread-row strong,
.thread-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-card {
  display: grid;
  gap: 10px;
}

.compose-card {
  border: 1px solid #c6d4f7;
  border-radius: var(--radius);
  background: #f7faff;
  padding: 14px;
  display: grid;
  gap: 12px;
  position: sticky;
  top: 92px;
}

.compose-card h3 {
  margin: 0;
}

.compose-card p {
  margin: 3px 0 0;
  color: var(--muted);
}

.address-preview {
  border: 1px solid #c6d4f7;
  border-radius: var(--radius);
  background: #f0f5ff;
  padding: 12px;
  display: grid;
  gap: 3px;
}

.address-preview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.address-preview strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
}

.grow {
  flex: 1 1 320px;
}

.panel {
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(28, 39, 59, 0.025);
}

.panel-head {
  padding: 15px 16px 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.panel-head h2,
.panel h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
}

.panel-head p {
  margin: 3px 0 0;
  color: var(--muted);
}

.panel-body {
  padding: 15px 16px 16px;
}

.hero-panel {
  border: 1px solid #cbd9f6;
  background: linear-gradient(180deg, #fdfdff 0%, #eef4ff 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.8fr);
  gap: 18px;
}

.hero-title {
  margin: 0;
  font-size: 26px;
  line-height: 1.18;
  letter-spacing: 0;
}

.hero-copy {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 720px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.step {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.75);
  padding: 12px;
  display: grid;
  gap: 5px;
}

.step strong {
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-num {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
}

.quick-actions {
  display: grid;
  gap: 9px;
}

.quick-actions button {
  justify-content: space-between;
}

.grid {
  display: grid;
  gap: 14px;
}

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

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

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

.metric {
  padding: 14px;
  display: grid;
  gap: 4px;
}

.metric .metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric strong {
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0;
}

.metric .metric-detail {
  min-height: 21px;
}

.status,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 3px 8px;
  background: #f2f4f7;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.status.good {
  color: var(--good);
  background: var(--good-soft);
}

.status.bad {
  color: var(--bad);
  background: var(--bad-soft);
}

.status.warn {
  color: var(--warn);
  background: var(--warn-soft);
}

.split {
  display: grid;
  grid-template-columns: minmax(300px, 0.78fr) minmax(0, 1.35fr);
  gap: 14px;
  align-items: start;
}

.toolbar {
  justify-content: space-between;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}

.toolbar label {
  min-width: 220px;
}

.list {
  display: grid;
  gap: 8px;
}

.row-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--canvas);
  cursor: pointer;
  display: grid;
  gap: 5px;
}

.row-card:hover {
  border-color: #aeb9ca;
}

.row-card.active {
  border-color: #9bb6f1;
  box-shadow: inset 3px 0 0 var(--accent);
  background: #f1f6ff;
}

.row-card strong {
  word-break: break-word;
}

.row-card p {
  margin: 0;
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 12px;
}

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

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

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

tr:last-child td {
  border-bottom: 0;
}

th {
  color: var(--muted);
  background: var(--canvas-2);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

td {
  color: var(--ink-2);
}

td strong {
  color: var(--ink);
}

code,
.copy {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
}

.copyable {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.message-preview {
  display: grid;
  gap: 3px;
  min-width: 240px;
}

.message-preview .snippet {
  color: var(--muted);
  max-width: 520px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-workspace {
  margin-top: 14px;
}

.label-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 160px;
}

.label-editor {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) auto;
  gap: 8px;
  min-width: 360px;
}

.label-editor input {
  min-width: 0;
}

.tabs {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--canvas-2);
  padding: 3px;
}

.tabs button {
  min-height: 30px;
  border: 0;
  background: transparent;
  padding: 5px 10px;
  font-size: 12px;
}

.tabs button.active {
  background: var(--canvas);
  box-shadow: 0 1px 2px rgba(28, 39, 59, 0.055);
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--canvas-2);
  padding: 22px;
  display: grid;
  gap: 8px;
  justify-items: start;
  color: var(--muted);
}

.empty-state strong {
  color: var(--ink);
}

.message-body {
  white-space: pre-wrap;
  background: var(--canvas-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  max-height: 360px;
  overflow: auto;
}

.chart {
  height: 220px;
  display: flex;
  align-items: end;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(#e1e7f0 1px, transparent 1px) 0 25% / 100% 25%,
    linear-gradient(180deg, #f9fbff, #f4f7fb);
}

.bar {
  flex: 1;
  min-width: 7px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, #6d91df, #315fd6);
}

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

.resource {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.resource span {
  color: var(--muted);
  font-size: 12px;
}

.hidden {
  display: none !important;
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(16, 24, 40, 0.38);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-card {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--canvas);
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  gap: 14px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-head h2 {
  margin: 0;
  font-size: 19px;
}

.modal-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

@media (max-width: 1120px) {
  .cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-grid,
  .split,
  .mail-workspace,
  .mail-client,
  .conversation-layout,
  .setup-strip {
    grid-template-columns: 1fr;
  }

  .inbox-directory,
  .compose-card {
    position: static;
  }

  .mail-rail,
  .mail-results {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .mail-client {
    min-height: auto;
  }

  .mini-inbox-list {
    max-height: none;
  }

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

  .access-grid > div:nth-child(2) {
    border-right: 0;
  }
}

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

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

  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace-strip,
  .cols-2,
  .cols-3,
  .cols-4,
  .mail-stats,
  .inbox-overview-grid,
  .setup-steps,
  .access-grid,
  .steps,
  .form-grid.two {
    grid-template-columns: 1fr;
  }

  .mail-hero,
  .section-title,
  .overview-head,
  .admin-titlebar,
  .mail-toolbar,
  .reader-head,
  .message-line,
  .message-meta,
  .thread-card-head,
  .thread-card-foot {
    flex-direction: column;
    align-items: stretch;
  }

  .thread-row {
    grid-template-columns: 1fr;
  }

  .mail-row {
    grid-template-columns: 20px minmax(0, 1fr);
  }

  .mail-row-meta {
    grid-column: 2;
    justify-items: start;
    max-width: 100%;
  }

  .command-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .access-grid > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .access-grid > div:last-child {
    border-bottom: 0;
  }

  .workspace-strip {
    margin: 14px 14px 0;
  }

  .view {
    padding: 14px;
  }

  .topbar-actions,
  .topbar-actions button,
  .toolbar-left,
  .toolbar-right,
  .toolbar label {
    width: 100%;
  }

  .table-wrap table {
    min-width: 620px;
  }

  .label-editor {
    grid-template-columns: 1fr;
    min-width: 220px;
  }
}
