/* Pneumail app, shadcn new-york conventions: inset sidebar on a tinted ground, content in a rounded panel.
   Neutrals carry the UI. Teal marks where you are. Brass means a person must decide. */
@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap");

:root {
	--sidebar: #f5f6f5;
	--bg: #ffffff;
	--panel: #ffffff;
	--sunk: #f4f5f5;
	--hover: #ebeeed;
	--ink: #111716;
	--muted: #646e6c;
	--faint: #949d9b;
	--line: #e5e8e7;
	--primary: #111716;
	--primary-ink: #ffffff;
	--tube: #1d5c63;
	--tube-soft: #e3eeee;
	--brass: #94600f;
	--brass-soft: #f7eddb;
	--good: #1c7246;
	--good-soft: #e3f3e9;
	--bad: #b2372e;
	--bad-soft: #fce8e5;
	--ring: #1d5c63;
	--ui: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
	--mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
	--r: 10px;
	--shadow: 0 1px 2px rgba(16, 24, 23, .05), 0 0 0 1px rgba(16, 24, 23, .06);
	color-scheme: light;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--sidebar: #0c1010; --bg: #121717; --panel: #161c1c; --sunk: #1a2121; --hover: #1f2727; --ink: #e8eeec;
		--muted: #97a3a0; --faint: #6c7876; --line: #263030; --primary: #e8eeec; --primary-ink: #0f1414;
		--tube: #7cc3ca; --tube-soft: #173031; --brass: #e4b56b; --brass-soft: #33291a; --good: #6fc799; --good-soft: #13291e;
		--bad: #f08c82; --bad-soft: #351a1a; --ring: #7cc3ca; --shadow: 0 0 0 1px rgba(255,255,255,.06); color-scheme: dark;
	}
}
:root[data-theme="dark"] {
	--sidebar: #0c1010; --bg: #121717; --panel: #161c1c; --sunk: #1a2121; --hover: #1f2727; --ink: #e8eeec;
	--muted: #97a3a0; --faint: #6c7876; --line: #263030; --primary: #e8eeec; --primary-ink: #0f1414;
	--tube: #7cc3ca; --tube-soft: #173031; --brass: #e4b56b; --brass-soft: #33291a; --good: #6fc799; --good-soft: #13291e;
	--bad: #f08c82; --bad-soft: #351a1a; --ring: #7cc3ca; --shadow: 0 0 0 1px rgba(255,255,255,.06); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--sidebar); color: var(--ink); font: 14px/1.5 var(--ui); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
h1, h2, h3 { text-wrap: balance; }
[hidden] { display: none !important; }
svg.lucide { width: 16px; height: 16px; stroke-width: 1.75; flex: none; }

/* Shell: sidebar + inset panel */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100%; transition: grid-template-columns .2s ease; }
body.collapsed .app { grid-template-columns: 60px minmax(0, 1fr); }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 10px 10px 12px; overflow: hidden auto; }
.ws { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; border: 0; background: transparent; width: 100%; text-align: left; cursor: pointer; }
.ws:hover { background: var(--hover); }
.ws .logo { width: 32px; height: 32px; border-radius: 8px; background: #0b2c63; display: grid; place-items: center; flex: none; }
.ws .logo svg { width: 18px; height: 18px; }
.ws .t { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.ws .t b { font-weight: 600; font-size: 14px; }
.ws .t span { font-size: 12px; color: var(--muted); }
.ws > svg.lucide:last-child { margin-left: auto; color: var(--faint); }
.quick { display: grid; grid-template-columns: minmax(0, 1fr) 34px; gap: 6px; margin: 4px 0 6px; }
.quick .new { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border-radius: 8px; background: var(--primary); color: var(--primary-ink); text-decoration: none; font-weight: 550; }
.quick .search { display: grid; place-items: center; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; }
.group-label { font-size: 12px; font-weight: 500; color: var(--faint); padding: 12px 10px 4px; white-space: nowrap; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border-radius: 7px; text-decoration: none; color: var(--muted); font-weight: 500; white-space: nowrap; }
.nav a:hover { background: var(--hover); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }
.nav a[aria-current="page"] svg.lucide { color: var(--tube); }
.nav .badge { margin-left: auto; font-size: 12px; color: var(--faint); }
.nav .badge.you { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--brass); color: #fff; font-weight: 600; display: grid; place-items: center; }
.meter { margin-top: auto; padding: 12px; border-radius: 10px; background: var(--panel); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.meter .row { display: flex; justify-content: space-between; font-size: 12.5px; }
.meter .row span:first-child { color: var(--muted); }
.capsule { position: relative; height: 12px; border-radius: 99px; border: 1.5px solid var(--tube); padding: 1.5px; }
.capsule i { display: block; height: 100%; border-radius: 99px; background: var(--tube); }
.user { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; border: 0; background: transparent; width: 100%; text-align: left; }
.user:hover { background: var(--hover); }
.avatar { width: 30px; height: 30px; border-radius: 8px; background: #d9e4e3; color: #1d5c63; display: grid; place-items: center; font-weight: 600; font-size: 12px; flex: none; }
.user .t { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.user .t b { font-weight: 600; font-size: 13px; }
.user .t span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.user > svg.lucide:last-child { margin-left: auto; color: var(--faint); }
body.collapsed .rail .t, body.collapsed .rail .group-label, body.collapsed .rail .nav span, body.collapsed .rail .badge:not(.you),
body.collapsed .rail .meter, body.collapsed .quick .new span, body.collapsed .ws > svg.lucide:last-child, body.collapsed .user > svg.lucide:last-child { display: none; }
body.collapsed .quick { grid-template-columns: 1fr; }
body.collapsed .quick .search { display: none; }
body.collapsed .quick .new { justify-content: center; padding: 0; }
body.collapsed .nav a { justify-content: center; padding: 0; position: relative; }
body.collapsed .nav .badge.you { position: absolute; top: 2px; right: 4px; min-width: 8px; width: 8px; height: 8px; padding: 0; font-size: 0; }
body.collapsed .user { margin-top: auto; }

.main { min-width: 0; margin: 8px 8px 8px 0; background: var(--bg); border-radius: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: clip; }
.top { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 20px 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; position: sticky; top: 0; background: var(--bg); z-index: 10; }
.top h1 { font-size: 15px; font-weight: 600; margin: 0; }
.top .spacer { flex: 1; }
.toggle { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.toggle:hover { background: var(--hover); color: var(--ink); }
.vsep { width: 1px; height: 18px; background: var(--line); }
.crumb { color: var(--muted); text-decoration: none; }
.crumb:hover { color: var(--ink); }
.id { font-family: var(--mono); font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; background: transparent; cursor: pointer; }
.page { padding: 24px 28px; display: flex; flex-direction: column; gap: 24px; }
.sec { font-size: 14px; font-weight: 600; margin: 0 0 10px; }

/* Controls (shadcn Button, Badge) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; border: 1px solid var(--line); background: var(--panel); padding: 0 12px; border-radius: 8px; font-weight: 500; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; box-shadow: 0 1px 1px rgba(16,24,23,.04); }
.btn:hover { background: var(--sunk); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { opacity: .9; }
.btn.decide { background: var(--brass); border-color: var(--brass); color: #fff; }
.btn.decide:hover { opacity: .92; }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; line-height: 18px; }
.pill.you { background: var(--brass-soft); border-color: transparent; color: var(--brass); font-weight: 600; }
.pill.sched { background: var(--tube-soft); border-color: transparent; color: var(--tube); }
.pill.live { background: var(--good-soft); border-color: transparent; color: var(--good); }
.pill.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.6s ease-in-out infinite; }
.pill.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.pill.done { border-color: transparent; color: var(--good); padding-left: 0; }
.pill.done::before { content: "✓"; }
@keyframes pulse { 50% { opacity: .35; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 1px 2px rgba(16,24,23,.03); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }

/* Fact rows */
.facts { display: flex; flex-direction: column; }
.fact { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.fact:last-child { border-bottom: 0; }
.fact > span:first-child { color: var(--muted); }
.fact .ok { color: var(--good); font-weight: 700; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12.5px; font-weight: 500; color: var(--muted); padding: 9px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--sunk); }
.table .r { text-align: right; }
.scroll { overflow-x: auto; }

/* Author mark */
.by { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.by i { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 9.5px; font-weight: 700; background: #d9e4e3; color: #1d5c63; }
.by i.agent { border-radius: 5px; background: var(--ink); color: var(--panel); }

/* Emails render on white in Front Door's own brand, the way an inbox shows them */
.surface { background: #ffffff; color: #14171c; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.phone { width: 300px; max-width: 100%; border: 9px solid #141a19; border-radius: 36px; background: #f3f4f6; overflow: hidden; box-shadow: 0 18px 40px -16px rgba(16, 24, 23, .35); }
.inbox-head { background: #ffffff; color: #222; padding: 12px 14px 10px; font-family: -apple-system, Helvetica, Arial, sans-serif; font-size: 12px; border-bottom: 1px solid #e3e5e8; }
.inbox-head b { display: block; font-size: 14px; }
.inbox-head span { color: #888; }
.mail-body { padding: 20px 18px; font-size: 14px; line-height: 1.55; color: #2f3747; }
.mail-body .eyebrow { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #7a4a00; font-weight: 700; margin-bottom: 8px; }
.mail-body h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: 23px; line-height: 1.2; margin: 0 0 12px; color: #14171c; letter-spacing: -.01em; }
.mail-body p { margin: 0 0 12px; }
.mail-body .mbtn { display: inline-block; background: #0b2c63; color: #fff; padding: 11px 18px; border-radius: 8px; font-weight: 600; font-size: 14px; margin: 4px 0 14px; text-decoration: none; }
.mail-body .mcols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 12.5px; }
.mail-body .mcols div { background: #e8eef8; border-radius: 8px; padding: 10px; color: #14171c; }
.mail-body svg, .mail-body img { width: 100%; height: auto; border-radius: 10px; display: block; margin-bottom: 14px; }
.mail-foot { padding: 14px 18px 20px; font-size: 11px; color: #5b6271; line-height: 1.55; font-family: -apple-system, Helvetica, Arial, sans-serif; background: #f3f4f6; }

/* Gauge toward a limit */
.gauge { display: flex; flex-direction: column; gap: 6px; }
.gauge .track { position: relative; height: 8px; border-radius: 99px; background: var(--sunk); }
.gauge .fill { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--good); }
.gauge .limit { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--bad); right: 0; }

/* Mockup state switcher: a design tool, not product UI */
.states { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 50; display: flex; gap: 2px; align-items: center; background: #141a19; color: #e9efed; border-radius: 99px; padding: 4px 4px 4px 12px; font-size: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.states button { border: 0; background: transparent; color: #b9c6c3; padding: 4px 10px; border-radius: 99px; cursor: pointer; font-size: 12px; font-weight: 500; }
.states button[aria-pressed="true"] { background: #e9efed; color: #141a19; }

@media (max-width: 860px) {
	.app, body.collapsed .app { grid-template-columns: 1fr; }
	.rail { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 60; background: var(--sidebar); transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.2); padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
	body.menu-open .rail { transform: none; }
	.main { margin: 0; border-radius: 0; box-shadow: none; min-height: 100vh; }
	.top { padding-left: max(10px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); top: env(safe-area-inset-top, 0px); }
	.page { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
	.fact { grid-template-columns: 96px minmax(0, 1fr) auto; }
	.states { left: 16px; right: auto; }
	body.collapsed .rail .t, body.collapsed .rail .group-label, body.collapsed .rail .nav span, body.collapsed .rail .meter { display: revert; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Activity drawer */
.drawer-bg { position: fixed; inset: 0; z-index: 70; background: rgba(10, 16, 15, .35); display: flex; justify-content: flex-end; }
.drawer { width: 440px; max-width: 100%; height: 100%; background: var(--bg); padding: 16px 20px calc(20px + env(safe-area-inset-bottom, 0px)); overflow: auto; box-shadow: -10px 0 40px rgba(0,0,0,.15); }
.dh { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.dh h2 { font-size: 16px; margin: 0; }
.trail { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.trail li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.trail li div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.trail li span:not(.by) { color: var(--muted); font-size: 13px; }
.trail code { font-family: var(--mono); font-size: 11.5px; background: var(--sunk); border-radius: 6px; padding: 4px 6px; overflow-wrap: anywhere; color: var(--muted); }
.trail time { font-size: 12px; color: var(--faint); white-space: nowrap; }
.states.min button[data-k] { display: none; }
.states .lab { color: #e9efed !important; padding-left: 0 !important; }
/* A small tube for rows that are sending */
.minitube { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--good); font-weight: 500; }
.minitube span { position: relative; width: 56px; height: 10px; border-radius: 99px; border: 1.5px solid var(--tube); padding: 1.5px; }
.minitube span i { display: block; height: 100%; border-radius: 99px; background: var(--tube); }
.info { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--line); font-size: 10px; color: var(--muted); cursor: help; font-style: normal; margin-left: 4px; }
