/* Connect messaging demos: tokens, fonts and the shared parts every option uses.
 * Values are the app's own (src/index.css, light theme). Rules kept from the client's direction and
 * Republic's house rules: no drop shadows, no gradient text, no glass, no one-sided accent borders,
 * no caps or tracked labels, no hover effects, motion on transform and opacity with an ease-out expo curve. */

@font-face { font-family: 'DM Sans'; font-weight: 400; font-display: swap; src: url('fonts/dm-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-weight: 500; font-display: swap; src: url('fonts/dm-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-weight: 600; font-display: swap; src: url('fonts/dm-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-weight: 700; font-display: swap; src: url('fonts/dm-sans-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter Tight'; font-weight: 500; font-display: swap; src: url('fonts/inter-tight-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter Tight'; font-weight: 600; font-display: swap; src: url('fonts/inter-tight-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter Tight'; font-weight: 700; font-display: swap; src: url('fonts/inter-tight-latin-700-normal.woff2') format('woff2'); }

:root {
	color-scheme: light;
	--primary: #304eff;
	--primary-ink: #2238d6;
	--primary-wash: rgba(48, 78, 255, 0.07);
	--primary-soft: rgba(48, 78, 255, 0.12);
	--primary-line: rgba(48, 78, 255, 0.28);
	--canvas: #f9f9fb;
	--card: #ffffff;
	--fg: #101119;
	--fg-2: #3d3f4f;
	--muted: #ececf0;
	--muted-fg: #717182;
	--subtle: #f4f4f7;
	--accent: #e9ebef;
	--border: rgba(16, 17, 25, 0.1);
	--border-strong: rgba(16, 17, 25, 0.16);
	--input: #f3f3f5;
	--navy: #000625;
	--nav-fg: #c5d0f5;
	--nav-muted: #9aa8de;
	--amber: #f59e0b;
	--amber-wash: #fffbeb;
	--amber-line: #f6c96b;
	--amber-ink: #8a4b0b;
	--green: #16a34a;
	--green-wash: #f0fdf4;
	--green-line: #9bdcb0;
	--green-ink: #166534;
	--danger: #d4183d;

	--r-sm: 6px;
	--r-md: 8px;
	--r-lg: 10px;
	--r-xl: 14px;
	--r-2xl: 18px;

	--ease: cubic-bezier(0.16, 1, 0.3, 1);
	--ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

	--font-sans: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
	--font-display: 'Inter Tight', 'DM Sans', ui-sans-serif, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
	margin: 0;
	min-height: 100%;
	background: var(--canvas);
	color: var(--fg);
	font-family: var(--font-sans);
	font-size: 16px;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

p, h1, h2, h3, h4, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.01em; font-weight: 600; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
button:disabled { cursor: not-allowed; }
input, textarea, select { font: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.sr-only {
	position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted-fg); }
.clip { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

[data-scroll='thin']::-webkit-scrollbar { width: 8px; height: 8px; }
[data-scroll='thin']::-webkit-scrollbar-thumb { background: rgba(16, 17, 25, 0.14); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }

.ic { display: inline-block; flex: none; vertical-align: middle; }

/* ---- buttons (identical at rest, hover and focus; focus shows the outline ring only) ---- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	height: 34px; padding: 0 14px; border-radius: var(--r-md);
	font-size: 14px; font-weight: 500; line-height: 1; white-space: nowrap;
	border: 1px solid transparent;
	transition: transform 160ms var(--ease), opacity 160ms var(--ease);
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-outline { background: var(--card); border-color: var(--border-strong); color: var(--fg); }
.btn-ghost { color: var(--fg-2); }
.btn-soft { background: var(--subtle); color: var(--fg); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 13px; }
.btn-xs { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 7px; gap: 5px; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: var(--r-md); color: var(--muted-fg); display: inline-grid; place-items: center; }
.btn-icon.sm { width: 28px; height: 28px; }
.btn .kbd, .kbd {
	display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px;
	border-radius: 5px; font-size: 11px; font-weight: 500; line-height: 1; font-family: var(--font-sans);
}
.btn-primary .kbd { background: rgba(255, 255, 255, 0.18); color: #fff; }
.kbd { border: 1px solid var(--border); background: var(--card); color: var(--muted-fg); }

/* ---- avatar ---- */
.av {
	display: inline-grid; place-items: center; flex: none;
	width: 32px; height: 32px; border-radius: 999px;
	background: var(--muted); color: var(--fg-2);
	font-size: 12px; font-weight: 600; letter-spacing: 0; line-height: 1;
	position: relative; user-select: none;
}
.av.xs { width: 22px; height: 22px; font-size: 9px; }
.av.sm { width: 28px; height: 28px; font-size: 11px; }
.av.lg { width: 44px; height: 44px; font-size: 15px; }
.av.xl { width: 56px; height: 56px; font-size: 18px; }
.av[data-tone='blue'] { background: #e6eaff; color: #2238d6; }
.av[data-tone='teal'] { background: #ddf4f1; color: #0f6b60; }
.av[data-tone='amber'] { background: #fdf0d5; color: #8a4b0b; }
.av[data-tone='rose'] { background: #fde4e8; color: #a3203f; }
.av[data-tone='violet'] { background: #ece6fd; color: #5b34c9; }
.av[data-tone='green'] { background: #e1f5e6; color: #1d6b37; }
.av[data-tone='slate'] { background: #e7eaf0; color: #3b4458; }
.av[data-tone='me'] { background: var(--primary); color: #fff; }

/* ---- pills ---- */
.pill {
	display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px;
	border-radius: 999px; border: 1px solid var(--border); background: var(--card);
	font-size: 12px; line-height: 1; color: var(--fg-2); white-space: nowrap;
}
.pill .dot { display: none; } /* no status dots in pills: the tint and the word carry it */
.pill[data-tone='blue'] { border-color: var(--primary-line); background: var(--primary-wash); color: var(--primary-ink); }
.pill[data-tone='amber'] { border-color: var(--amber-line); background: var(--amber-wash); color: var(--amber-ink); }
.pill[data-tone='green'] { border-color: var(--green-line); background: var(--green-wash); color: var(--green-ink); }
.pill[data-tone='quiet'] { background: var(--subtle); border-color: transparent; color: var(--fg-2); }

/* unread marker */
.udot { width: 8px; height: 8px; border-radius: 999px; background: var(--primary); flex: none; }

/* ---- form controls ---- */
.field {
	display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px;
	border-radius: var(--r-md); background: var(--input); border: 1px solid transparent;
	color: var(--muted-fg); font-size: 14px;
}
.field:focus-within { border-color: var(--primary-line); background: var(--card); }
.field input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--fg); font-size: 14px; }
.field input::placeholder { color: var(--muted-fg); }

/* segmented tabs, as the app's SegmentedTabs */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--subtle); position: relative; }
.seg button {
	position: relative; z-index: 1; height: 28px; padding: 0 12px; border-radius: 7px;
	font-size: 13px; font-weight: 500; color: var(--muted-fg); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
	transition: color 200ms var(--ease);
}
.seg button[aria-pressed='true'] { color: var(--fg); }
.seg .seg-ind {
	position: absolute; z-index: 0; top: 3px; left: 0; height: 28px; border-radius: 7px;
	background: var(--card); border: 1px solid var(--border);
	transition: transform 380ms var(--ease), width 380ms var(--ease);
}
.seg .n { font-size: 11px; color: var(--muted-fg); font-variant-numeric: tabular-nums; }

/* cards */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-xl); }

/* ---- toast ---- */
.toast-wrap { position: fixed; z-index: 960; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
@media (max-width: 760px) { .toast-wrap { right: 12px; left: 12px; bottom: auto; top: 76px; align-items: center; } }
.toast {
	display: flex; align-items: center; gap: 10px; max-width: 360px; padding: 10px 12px 10px 10px;
	border-radius: 12px; background: var(--fg); color: #fff; font-size: 13px; line-height: 1.35;
	opacity: 0; transform: translateY(8px); pointer-events: auto;
	transition: opacity 240ms var(--ease), transform 420ms var(--ease);
}
.toast.show { opacity: 1; transform: none; }
.toast .av { width: 26px; height: 26px; font-size: 10px; }
.toast b { font-weight: 600; }
.toast .t-act { margin-left: 6px; padding: 5px 9px; border-radius: 7px; background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 12px; font-weight: 500; white-space: nowrap; }

/* ---- popover menu ---- */
.menu {
	position: fixed; z-index: 940; min-width: 200px; max-width: 320px; padding: 4px;
	background: var(--card); border: 1px solid var(--border-strong); border-radius: 12px;
	opacity: 0; transform: translateY(4px) scale(0.98); transform-origin: top left; pointer-events: none;
	transition: opacity 160ms var(--ease), transform 240ms var(--ease);
}
.menu.open { opacity: 1; transform: none; pointer-events: auto; }
.menu .m-label { padding: 8px 10px 4px; font-size: 12px; color: var(--muted-fg); }
.menu .m-item {
	display: flex; width: 100%; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px;
	font-size: 13px; color: var(--fg); text-align: left;
}
.menu .m-item .ic { color: var(--muted-fg); }
.menu .m-item small { margin-left: auto; color: var(--muted-fg); font-size: 12px; }
.menu .m-item[aria-checked='true'] { background: var(--subtle); }
.menu .m-item.kb { background: var(--subtle); }
.menu hr { border: 0; height: 1px; background: var(--border); margin: 4px; }

/* ---- empty state ---- */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 32px 16px; color: var(--muted-fg); }
.empty .e-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--subtle); color: var(--fg-2); margin-bottom: 6px; }
.empty h3 { font-size: 15px; color: var(--fg); font-weight: 600; }
.empty p { font-size: 13px; max-width: 280px; line-height: 1.45; }

/* motion helpers */
.fade-up { animation: fadeUp 420ms var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeIn 300ms var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* quiet scrollbars everywhere: Chromium and Safari draw them with the webkit pseudos (the standard
   scrollbar-width/-color would switch those off and bring back Windows' arrow buttons), Firefox gets thin + tint */
::-webkit-scrollbar { width: 10px; height: 10px; background: transparent; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background-color: rgb(16 17 25 / 0.1); border: 3px solid transparent; border-radius: 999px; background-clip: padding-box; min-height: 40px; }
:hover::-webkit-scrollbar-thumb { background-color: rgb(16 17 25 / 0.22); }
::-webkit-scrollbar-thumb:active { background-color: rgb(16 17 25 / 0.34); }
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: rgb(16 17 25 / 0.16) transparent; } }
