/* Tacuit app. One stylesheet, system fonts only, nothing loaded from anywhere else. */

:root {
	--bg: #0b0b10;
	--panel: #111118;
	--panel-2: #181822;
	--panel-3: #20202c;
	--line: #262633;
	--text: #efeee8;
	--dim: #a09eab;
	--acc: #d6ff3f;
	--acc-ink: #11150a;
	--danger: #ff7a6b;
	--ok: #7dffb0;
	--serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
	--sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
	color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
	height: 100%;
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 16px/1.5 var(--sans);
	-webkit-font-smoothing: antialiased;
	-webkit-text-size-adjust: 100%;
	overscroll-behavior: none;
}

#tacuit { height: 100%; height: 100dvh; position: relative; }

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
p { margin: 0 0 .7em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0 14px; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

.u-dim { color: var(--dim); }
.u-small { font-size: 13px; }
.u-word { font-family: var(--serif); font-style: italic; font-weight: 500; letter-spacing: -.01em; font-size: 26px; }
.u-word.big { font-size: 64px; opacity: .16; }

.u-ico { display: inline-flex; width: 20px; height: 20px; flex: none; }
.u-ico.sm { width: 13px; height: 13px; }
.u-ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.u-boot, .u-noscript { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; }
.u-boot .u-word { font-size: 40px; animation: u-breathe 1.6s ease-in-out infinite; }
.u-noscript { color: var(--dim); align-content: end; padding-bottom: 20vh; }

/* buttons */
.u-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 0 18px; border-radius: 12px;
	border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
	font-weight: 600; font-size: 15px; white-space: nowrap;
	transition: background .15s, border-color .15s, transform .1s;
}
.u-btn:hover { background: var(--panel-3); border-color: #34344a; }
.u-btn:active { transform: scale(.98); }
.u-btn.pri { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.u-btn.pri:hover { background: var(--acc); border-color: var(--acc); filter: brightness(1.12); }
.u-btn.ghost { background: transparent; border-color: transparent; color: var(--dim); }
.u-btn.ghost:hover { background: var(--panel-2); color: var(--text); }
.u-btn.danger { color: var(--danger); }
.u-btn.danger:hover { border-color: rgba(255, 122, 107, .5); }
.u-btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.u-btn.wide { width: 100%; }

.u-iconbtn {
	width: 44px; height: 44px; flex: none; display: grid; place-items: center;
	border: 0; border-radius: 12px; background: transparent; color: var(--dim);
}
.u-iconbtn:hover { background: var(--panel-2); color: var(--text); }

/* welcome */
.u-welcome {
	min-height: 100%; display: grid; place-items: center; padding: 24px 18px;
	background:
		radial-gradient(60% 50% at 80% 0%, rgba(214, 255, 63, .09), transparent 70%),
		radial-gradient(50% 40% at 0% 100%, rgba(120, 110, 255, .10), transparent 70%),
		var(--bg);
	overflow: auto;
}
.u-card { width: 100%; max-width: 460px; }
.u-card h1 { margin: 0; font-size: 54px; line-height: 1; }
.u-card h2 { margin: 22px 0 8px; font-size: 20px; }
.u-lead { margin: 10px 0 26px; font-size: 20px; color: var(--dim); }
.u-facts { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 12px; }
.u-facts li { display: flex; gap: 12px; align-items: flex-start; }
.u-facts .u-ico { color: var(--acc); margin-top: 2px; }
.u-choice {
	display: block; width: 100%; text-align: left; padding: 16px 18px; margin-bottom: 10px;
	border-radius: 16px; border: 1px solid var(--line); background: var(--panel);
	transition: border-color .15s, background .15s, transform .1s;
}
.u-choice strong { display: block; font-size: 17px; }
.u-choice span { display: block; color: var(--dim); font-size: 14px; margin-top: 2px; }
.u-choice:hover { border-color: #3a3a52; background: var(--panel-2); }
.u-choice:active { transform: scale(.99); }
.u-choice.pri { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.u-choice.pri span { color: var(--acc-ink); opacity: .72; }
.u-choice.pri:hover { background: var(--acc); border-color: var(--acc); filter: brightness(1.1); }
.u-card .u-small { margin-top: 18px; }

/* shell */
.u-shell { display: grid; grid-template-columns: 330px minmax(0, 1fr); height: 100%; }
.u-side {
	display: flex; flex-direction: column; min-height: 0;
	background: var(--panel); border-right: 1px solid var(--line);
	padding: 18px 16px calc(14px + env(safe-area-inset-bottom));
}
.u-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.u-conn { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--dim); letter-spacing: .04em; text-transform: uppercase; }
.u-conn i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(125, 255, 176, .5); animation: u-pulse 2.4s infinite; }
.u-conn.off i { background: var(--danger); animation: none; }

.u-me { display: grid; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); margin-bottom: 12px; font-size: 13px; }
.u-alias { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0; border: 0; background: none; text-align: left; }
.u-alias strong { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-alias span { font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.u-chip { justify-self: start; margin-top: 4px; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line); color: var(--dim); font-size: 12px; }

.u-list-h { margin: 20px 4px 8px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.u-list { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.u-empty { padding: 14px 6px; font-size: 14px; }
.u-item {
	display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
	padding: 10px; border: 0; border-radius: 14px; background: transparent; min-height: 60px;
}
.u-item:hover { background: var(--panel-2); }
.u-item.on { background: var(--panel-3); }
.u-item-t { flex: 1; min-width: 0; display: grid; }
.u-item-t strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-item-t small { color: var(--dim); font-size: 13px; }
.u-item.unread .u-item-t small { color: var(--acc); }
.u-badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--acc); color: var(--acc-ink); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.u-av {
	--h: 80;
	width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center;
	font-family: var(--serif); font-style: italic; font-size: 19px;
	background-color: hsl(var(--h) 45% 22%); color: hsl(var(--h) 90% 82%);
	border: 1px solid hsl(var(--h) 50% 34%);
}
.u-bottom { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; margin-top: 8px; border-top: 1px solid var(--line); }

/* chat */
.u-chat { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.u-chat.idle > .u-head, .u-chat.idle > .u-msgs, .u-chat.idle > .u-compose, .u-chat.idle > .u-banner { display: none; }
.u-idle { display: none; flex: 1; place-content: center; justify-items: center; text-align: center; padding: 30px; gap: 4px; }
.u-idle p { max-width: 380px; }
.u-chat.idle > .u-idle { display: grid; }

.u-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); min-height: 68px; }
.u-who { flex: 1; min-width: 0; display: grid; }
.u-who strong { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-who span { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }
.u-back { display: none; }

.u-banner { padding: 12px 16px; background: #1b1a10; border-bottom: 1px solid #3a3718; font-size: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.u-banner[hidden] { display: none; }
.u-banner p { margin: 0; flex: 1 1 240px; color: #f1e9a8; }
.u-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.u-row .u-field { flex: 1 1 200px; }

.u-msgs {
	flex: 1; min-height: 0; overflow-y: auto; padding: 22px 18px 10px;
	display: flex; flex-direction: column; gap: 10px;
	-webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
	transition: filter .2s;
}
.u-quiet { margin: auto; text-align: center; max-width: 380px; padding: 20px; }
.u-quiet .u-ico { width: 30px; height: 30px; color: var(--acc); opacity: .8; margin-bottom: 10px; }
.u-quiet p:first-of-type { font-family: var(--serif); font-style: italic; font-size: 22px; }

.u-msg { display: flex; flex-direction: column; max-width: min(78%, 560px); animation: u-in .22s ease-out; }
.u-msg.in { align-self: flex-start; align-items: flex-start; }
.u-msg.out { align-self: flex-end; align-items: flex-end; }
.u-bubble {
	position: relative; overflow: hidden; padding: 10px 14px 12px; border-radius: 18px;
	background: var(--panel-2); border: 1px solid var(--line);
	white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; font-size: 16px; line-height: 1.45;
}
.u-msg.in .u-bubble { border-bottom-left-radius: 6px; }
.u-msg.out .u-bubble { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); border-bottom-right-radius: 6px; }
.u-msg.out.is-sending .u-bubble { opacity: .6; }
.u-msg.is-failed .u-bubble { background: transparent; border: 1px dashed #4a3a3a; color: var(--danger); }
.u-note { font-size: 14px; font-style: italic; }
.u-meta { min-height: 18px; margin: 3px 6px 0; font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.u-left { color: var(--text); font-weight: 600; }

.u-fuse { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .08); }
.u-msg.out .u-fuse { background: rgba(0, 0, 0, .14); }
.u-fuse b { position: relative; display: block; height: 100%; width: 100%; background-color: var(--acc); animation: u-burn linear both; }
.u-fuse b::after { content: ""; position: absolute; right: -2px; top: -2px; width: 7px; height: 7px; border-radius: 50%; background-color: #fff; box-shadow: 0 0 8px 3px var(--acc), 0 0 2px 1px #fff; animation: u-spark .18s steps(2) infinite; }
.u-msg.out .u-fuse b::after { box-shadow: 0 0 8px 3px rgba(255, 255, 255, .8); }
.u-msg.out .u-fuse b { background-color: var(--acc-ink); }

.u-msg.gone { pointer-events: none; }
.u-msg.gone .u-bubble { animation: u-vanish .42s ease-in .2s forwards; }
.u-msg.gone .u-bubble::after { content: ""; position: absolute; inset: 0; background-color: #000; transform-origin: left center; animation: u-redact .2s ease-out both; }
.u-msg.gone .u-meta { opacity: 0; transition: opacity .2s; }

/* composer */
.u-compose { padding: 10px 14px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--panel); }
.u-timers { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 13px; flex-wrap: wrap; }
.u-timers > span { margin-right: 4px; }
.u-timer { min-width: 46px; height: 32px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--line); background: transparent; color: var(--dim); font-size: 13px; font-weight: 600; }
.u-timer:hover { color: var(--text); border-color: #3a3a52; }
.u-timer.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.u-line { display: flex; align-items: flex-end; gap: 10px; }
.u-input {
	flex: 1; min-height: 48px; max-height: 140px; resize: none; padding: 12px 16px; border-radius: 16px;
	border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.4;
}
.u-input::placeholder { color: #6f6d7b; }
.u-input:focus { outline: none; border-color: #4a4a66; }
.u-sendbtn { width: 48px; height: 48px; flex: none; border: 0; border-radius: 16px; background: var(--acc); color: var(--acc-ink); display: grid; place-items: center; transition: transform .1s, background .15s; }
.u-sendbtn:hover { filter: brightness(1.12); }
.u-sendbtn:active { transform: scale(.94); }

/* privacy shield while the window is not in front */
.u-shield { display: none; position: absolute; inset: 68px 0 0; place-content: center; justify-items: center; gap: 8px; color: var(--dim); font-size: 14px; pointer-events: none; }
#tacuit.away .u-chat:not(.idle) .u-msgs { filter: blur(18px); }
#tacuit.away .u-chat:not(.idle) .u-shield { display: grid; }

/* dialogs */
.u-veil { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 18px; background: rgba(5, 5, 9, .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: u-fade .15s ease-out; overflow: auto; }
.u-dialog { width: 100%; max-width: 420px; padding: 24px; border-radius: 22px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.u-dialog.wide { max-width: 500px; }
.u-dialog h2 { margin: 0 0 10px; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 28px; }
.u-dialog p { font-size: 15px; }
.u-field { width: 100%; min-height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); margin: 4px 0 10px; }
.u-field:focus { outline: none; border-color: var(--acc); }
.u-field.mono { font-family: var(--mono); font-size: 13px; }
.u-row .u-field { margin: 0; }
.u-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.u-menu { display: grid; gap: 8px; }
.u-menu .u-btn { justify-content: flex-start; }
.u-number { margin: 14px 0; padding: 18px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); font-family: var(--mono); font-size: 22px; letter-spacing: .04em; text-align: center; line-height: 1.7; word-spacing: .3em; }

.u-toasts { position: fixed; left: 0; right: 0; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 30; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.u-toast { padding: 10px 16px; border-radius: 99px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); animation: u-in .2s ease-out; transition: opacity .4s, transform .4s; text-align: center; }
.u-toast.out { opacity: 0; transform: translateY(8px); }

/* phone: one pane at a time */
@media (max-width: 760px) {
	.u-shell { grid-template-columns: minmax(0, 1fr); }
	.u-shell .u-chat { display: none; }
	.u-shell.in-chat .u-side { display: none; }
	.u-shell.in-chat .u-chat { display: flex; }
	.u-side { border-right: 0; padding-top: calc(16px + env(safe-area-inset-top)); }
	.u-back { display: grid; margin-left: -6px; }
	.u-head { padding: calc(8px + env(safe-area-inset-top)) 8px 8px 10px; gap: 8px; }
	.u-msg { max-width: 86%; }
	.u-msgs { padding: 16px 12px 8px; }
	.u-card h1 { font-size: 46px; }
	.u-number { font-size: 19px; }
	.u-sets { max-height: 50vh; }
	.u-dialog { padding: 20px 18px; }
	.u-set { gap: 12px; }
}

@keyframes u-burn { from { width: 100%; } to { width: 0%; } }
@keyframes u-spark { from { opacity: 1; } to { opacity: .45; } }
@keyframes u-vanish {
	0% { opacity: 1; filter: blur(0); transform: none; letter-spacing: 0; }
	100% { opacity: 0; filter: blur(14px); transform: translateY(-6px) scale(.97); letter-spacing: .12em; }
}
@keyframes u-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes u-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes u-breathe { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes u-pulse { 0% { box-shadow: 0 0 0 0 rgba(125, 255, 176, .5); } 70%, 100% { box-shadow: 0 0 0 7px rgba(125, 255, 176, 0); } }

@media (prefers-reduced-motion: reduce) {
	.u-msg, .u-toast, .u-veil, .u-boot .u-word, .u-conn i { animation: none; }
	.u-msg.gone .u-bubble { animation-duration: .01s; }
}

/* files */
.u-fileinput { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.u-attach { height: 48px; width: 48px; border-radius: 16px; border: 1px solid var(--line); }
.u-bubble.has-file { padding: 8px 8px 12px; }
.u-bubble.has-file .u-text { display: block; padding: 6px 6px 0; }
.u-pic { display: block; max-width: 100%; width: auto; height: auto; max-height: 52vh; border-radius: 12px; background-color: #000; }
.u-file { display: flex; align-items: center; gap: 12px; padding: 8px 10px; min-width: 200px; position: relative; flex-wrap: wrap; }
.u-file .u-ico { width: 26px; height: 26px; }
.u-file-t { display: grid; min-width: 0; flex: 1; }
.u-file-t strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.u-file-t small { font-size: 12px; opacity: .75; }
.u-prog { flex: 1 0 100%; height: 4px; border-radius: 4px; background: rgba(127, 127, 127, .3); overflow: hidden; }
.u-prog b { display: block; height: 100%; background-color: currentColor; transition: width .25s; }
.u-save { margin: 6px 6px 0; }
.u-msg.out .u-save { display: none; }

/* hold to read */
.u-secret { transition: filter .12s, opacity .12s; }
.u-msgs.veil .u-msg:not(.peek) .u-secret { filter: blur(14px); opacity: .22; }
.u-msgs.veil .u-msg { cursor: pointer; touch-action: none; }
.u-hint { display: block; font-size: 13px; font-weight: 600; padding: 2px 6px 0; }
.u-msg.is-cover .u-bubble { border-style: dashed; }
.u-msg.peek .u-hint { display: none; }

/* system notes in a conversation */
.u-msg.sys { align-self: center; align-items: center; max-width: 92%; }
.u-msg.sys .u-bubble { border-color: #5a4a1c; color: #f1d98a; text-align: center; }

/* capture key pressed, or wiping */
#tacuit.blackout > * { visibility: hidden; }
#tacuit.blackout { background: #000; }

/* settings */
.u-sets { max-height: min(62vh, 620px); overflow-y: auto; margin: 0 -8px; padding: 0 8px; }
.u-group { padding: 6px 0 4px; }
.u-group h3 { margin: 14px 0 4px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--acc); font-weight: 600; }
.u-set { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.u-set:last-child { border-bottom: 0; }
.u-set strong { font-size: 15px; }
.u-set p { margin: 2px 0 0; font-size: 13px; line-height: 1.4; }
.u-switch { position: relative; flex: none; width: 50px; height: 30px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); transition: background .15s, border-color .15s; }
.u-switch i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--dim); transition: transform .15s, background .15s; }
.u-switch[aria-checked="true"] { background: var(--acc); border-color: var(--acc); }
.u-switch[aria-checked="true"] i { transform: translateX(20px); background: var(--acc-ink); }
.u-select { flex: none; min-height: 38px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-size: 14px; }
.u-err { min-height: 20px; margin: 0 0 6px; color: var(--danger); font-size: 14px; }
.u-settings { padding-left: 8px; }
.u-settings .u-ico { width: 17px; height: 17px; }
.u-card .u-field { margin-top: 0; }
.u-card .u-unlock { margin-bottom: 14px; }

@media print { html, body, #tacuit { display: none !important; } }

/* verified contacts, maximum security preset */
.u-ok { color: var(--ok); }
.u-max { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; margin: 4px 0 6px; border: 1px solid #4a5a1a; border-radius: 16px; background-color: rgba(214, 255, 63, .06); }
.u-max p { margin: 2px 0 0; font-size: 13px; line-height: 1.4; }

/* ---------- 1.2: themes ---------- */
#tacuit[data-theme="1"] { --acc: #ffb648; --acc-ink: #1b1202; }
#tacuit[data-theme="2"] { --acc: #7fe3ff; --acc-ink: #04141b; }
#tacuit[data-theme="3"] { --acc: #ff5d6c; --acc-ink: #1d0306; }
.u-welcome { background:
	radial-gradient(60% 50% at 80% 0%, color-mix(in srgb, var(--acc) 11%, transparent), transparent 70%),
	radial-gradient(50% 40% at 0% 100%, rgba(120, 110, 255, .10), transparent 70%),
	var(--bg); }
.u-max { border-color: color-mix(in srgb, var(--acc) 38%, transparent); background-color: color-mix(in srgb, var(--acc) 6%, transparent); }

/* ---------- 1.2: motion and decoration ---------- */
@keyframes u-redact { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes u-sweep { to { transform: rotate(360deg); } }
@keyframes u-ping { 0% { transform: scale(.2); opacity: .9; } 100% { transform: scale(1); opacity: 0; } }
@keyframes u-dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75%, 100% { content: "..."; } }
@keyframes u-line { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes u-introout { to { opacity: 0; visibility: hidden; } }
@keyframes u-drift { from { background-position: 0 0, 0 0; } to { background-position: 44px 44px, 44px 44px; } }

/* a faint moving grid behind the welcome card and the empty chat pane */
.u-welcome, .u-idle { position: relative; isolation: isolate; }
.u-welcome::before, .u-chat.idle::before {
	content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
	background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
	background-size: 44px 44px; animation: u-drift 9s linear infinite;
	-webkit-mask-image: radial-gradient(70% 70% at 50% 45%, #000 30%, transparent 100%); mask-image: radial-gradient(70% 70% at 50% 45%, #000 30%, transparent 100%);
}
.u-chat.idle { isolation: isolate; }

/* radar */
.u-radar { position: absolute; width: 520px; height: 520px; left: 50%; top: 50%; margin: -260px 0 0 -260px; z-index: -1; pointer-events: none; opacity: .55; }
.u-card { position: relative; }
.u-card .u-radar { left: auto; right: -210px; top: -170px; margin: 0; opacity: .5; }
.u-radar i { position: absolute; inset: 0; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--acc) 22%, transparent); }
.u-radar i:nth-child(2) { inset: 17%; }
.u-radar i:nth-child(3) { inset: 34%; animation: u-ping 3.6s ease-out infinite; border-color: color-mix(in srgb, var(--acc) 55%, transparent); }
.u-radar b { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, color-mix(in srgb, var(--acc) 26%, transparent), transparent 22%); animation: u-sweep 5.5s linear infinite; -webkit-mask-image: radial-gradient(circle, #000 0, #000 69%, transparent 70%); mask-image: radial-gradient(circle, #000 0, #000 69%, transparent 70%); }
.u-idle .u-word.big { opacity: .22; }

/* opening sequence */
.u-intro { position: fixed; inset: 0; z-index: 40; display: grid; place-content: center; justify-items: start; gap: 18px; padding: 32px; background-color: var(--bg); pointer-events: none; animation: u-introout .45s ease 1.2s forwards; }
.u-intro .u-word { font-size: 46px; }
.u-intro ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-family: var(--mono); font-size: 13px; color: var(--dim); letter-spacing: .04em; }
.u-intro li { opacity: 0; animation: u-line .3s ease forwards; }
.u-intro li::before { content: "\2713"; color: var(--acc); margin-right: 10px; }
.u-intro li:nth-child(1) { animation-delay: .1s; }
.u-intro li:nth-child(2) { animation-delay: .42s; }
.u-intro li:nth-child(3) { animation-delay: .74s; }

/* channel state and the session key dial */
.u-wait::after { content: ""; animation: u-dots 1.2s steps(1) infinite; display: inline-block; width: 1.2em; text-align: left; }
.u-ring { width: 30px; height: 30px; flex: none; display: grid; place-items: center; }
.u-ring svg { width: 24px; height: 24px; }
.u-ring-bg { fill: none; stroke: var(--line); stroke-width: 2.2; }
.u-ring-arc { fill: none; stroke: var(--acc); stroke-width: 2.2; stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.u-ring-dot { fill: var(--acc); animation: u-breathe 2s ease-in-out infinite; }

/* burn now */
.u-burn { margin-left: 10px; padding: 0; border: 0; background: none; color: var(--danger); font: inherit; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; opacity: .85; }
.u-burn:hover { opacity: 1; }

/* sidebar extras */
.u-fate { justify-self: start; margin-top: 4px; font-size: 12px; color: var(--danger); font-variant-numeric: tabular-nums; }
.u-fate[hidden] { display: none; }
.u-bottom { gap: 4px; }
.u-bottom .u-settings { margin-right: auto; }
.u-hide { width: 38px; height: 38px; }
.u-hide .u-ico { width: 18px; height: 18px; }
.u-item { transition: background-color .15s, transform .12s; }
.u-item:active { transform: scale(.985); }
.u-msg.in.is-live .u-bubble { box-shadow: 0 0 0 1px color-mix(in srgb, var(--acc) 16%, transparent), 0 8px 30px rgba(0, 0, 0, .35); }

/* masked typing */
.u-input.masked { -webkit-text-security: disc; }
@supports not (-webkit-text-security: disc) { .u-input.masked { filter: blur(5px); } }

/* cover screen: deliberately plain, the opposite of the app */
#tacuit.covered > :not(.u-cover) { visibility: hidden; }
.u-cover { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background-color: #fbfaf7; color: #26251f; font: 16px/1.55 var(--sans); padding: 26px clamp(18px, 6vw, 80px); color-scheme: light; }
.u-cover header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.u-cover h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.02em; cursor: default; -webkit-user-select: none; user-select: none; }
.c-search { width: min(240px, 46vw); height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid #dedbd2; background-color: #f1efe9; color: #26251f; font: inherit; font-size: 14px; }
.c-search:focus { outline: 2px solid #c9c5b8; }
.c-date { margin: 22px 0 10px; color: #8b887c; font-size: 13px; }
.c-note { flex: 1; width: 100%; border: 0; resize: none; background: transparent; color: #26251f; font: inherit; font-size: 18px; line-height: 1.6; outline: none; }
.c-note::placeholder { color: #b9b6aa; }

/* shown only if the browser refused the app's files */
.u-stuck { max-width: 420px; margin: 26px auto 0; color: var(--dim); font-size: 14px; opacity: 0; animation: u-line .4s ease 9s forwards; }
.u-boot { align-content: center; }

@media (max-width: 760px) {
	.u-card .u-radar { right: -300px; top: -230px; }
	.u-ring { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.u-radar b, .u-radar i, .u-welcome::before, .u-chat.idle::before, .u-fuse b::after, .u-ring-dot, .u-wait::after { animation: none; }
	.u-msg.gone .u-bubble::after { animation-duration: .01s; }
	.u-stuck { animation-delay: 9s; }
}
.u-welcome { overflow-x: hidden; overflow-y: auto; }
.u-chat { overflow: hidden; }

/* ---------- 1.3: groups, voice notes, QR, languages ---------- */
.u-pq { flex: none; padding: 2px 7px; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--acc) 45%, transparent); color: var(--acc); font: 600 10px/1.4 var(--mono); letter-spacing: .08em; }
.u-av.grp { border-radius: 14px; font-style: normal; font-family: var(--mono); }
.u-from { margin: 0 6px 3px; font-size: 12px; font-weight: 600; color: var(--acc); }
.u-list-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.u-newgroup { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 99px; border: 1px solid var(--line); background: transparent; color: var(--dim); font: inherit; font-size: 11px; letter-spacing: .04em; text-transform: none; }
.u-newgroup:hover { color: var(--text); border-color: #3a3a52; }
.u-newgroup[hidden] { display: none; }
.u-chat.is-group .u-attach { display: none; }
.u-people { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.u-people li { padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background-color: var(--bg); }
.u-pick { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; max-height: 190px; overflow-y: auto; }
.u-chip.pick { padding: 8px 14px; font-size: 14px; background: transparent; color: var(--text); margin: 0; }
.u-chip.pick[aria-pressed="true"] { background-color: var(--acc); border-color: var(--acc); color: var(--acc-ink); font-weight: 600; }

.u-voice { display: flex; align-items: center; gap: 12px; padding: 6px 8px; min-width: 190px; }
.u-play { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0; display: grid; place-items: center; background-color: var(--acc); color: var(--acc-ink); }
.u-msg.out .u-play { background-color: var(--acc-ink); color: var(--acc); }
.u-play .u-ico svg { fill: currentColor; stroke: none; }
.u-wave { display: flex; align-items: center; gap: 3px; height: 26px; flex: 1; }
.u-wave i { width: 3px; border-radius: 3px; background-color: currentColor; opacity: .6; height: 40%; }
.u-wave i:nth-child(2n) { height: 85%; } .u-wave i:nth-child(3n) { height: 55%; } .u-wave i:nth-child(5n) { height: 100%; }
.u-voice small { font-size: 12px; font-variant-numeric: tabular-nums; opacity: .8; }
.u-rec { display: flex; align-items: center; gap: 10px; padding: 8px 4px 0; font-size: 14px; }
.u-rec-dot { width: 10px; height: 10px; border-radius: 50%; background-color: var(--danger); animation: u-breathe 1s ease-in-out infinite; }
.u-rec-time { font-variant-numeric: tabular-nums; margin-right: auto; color: var(--dim); }
.u-compose.recording .u-line { opacity: .35; pointer-events: none; }

.u-qrbox { display: flex; align-items: center; gap: 16px; margin: 4px 0 14px; }
.u-qr { width: 132px; height: 132px; flex: none; border-radius: 12px; image-rendering: pixelated; background-color: #fff; }
.u-qrbox p { margin: 0; font-size: 13px; }
.u-foot2 { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.u-lang { min-height: 34px; font-size: 13px; }

/* right-to-left languages */
#tacuit[dir="rtl"] .u-back svg, #tacuit[dir="rtl"] .u-sendbtn svg { transform: scaleX(-1); }
#tacuit[dir="rtl"] .u-side { border-right: 0; border-left: 1px solid var(--line); }
#tacuit[dir="rtl"] .u-msg.in .u-bubble { border-bottom-left-radius: 18px; border-bottom-right-radius: 6px; }
#tacuit[dir="rtl"] .u-msg.out .u-bubble { border-bottom-right-radius: 18px; border-bottom-left-radius: 6px; }
#tacuit[dir="rtl"] .u-switch[aria-checked="true"] i { transform: translateX(-20px); }
#tacuit[dir="rtl"] .u-switch i { left: auto; right: 3px; }
#tacuit[dir="rtl"] .u-bottom .u-settings { margin-right: 0; margin-left: auto; }
#tacuit[dir="rtl"] .u-burn { margin-left: 0; margin-right: 10px; }
#tacuit[dir="rtl"] .u-number, #tacuit[dir="rtl"] .u-field.mono, #tacuit[dir="rtl"] .u-pq { direction: ltr; }
@media (max-width: 760px) { .u-qr { width: 112px; height: 112px; } }

/* ---------- 1.4: key marks, constant traffic, code fingerprint, calmer depth ---------- */
.u-av.mark { background-color: hsl(var(--h) 38% 13%); border-color: hsl(var(--h) 45% 28%); padding: 0; }
.u-sigil { width: 100%; height: 100%; display: block; fill: none; stroke-linecap: round; }
.u-sigil path.on { stroke: hsl(var(--h) 88% 70%); }
.u-sigil path.off { stroke: hsl(var(--h) 30% 26%); stroke-opacity: .55; }
.u-sigil circle { fill: hsl(var(--h) 88% 70%); stroke: none; }
.u-av.big { width: 76px; height: 76px; }
.u-me { position: relative; }
.u-av.me { position: absolute; top: 10px; inset-inline-end: 12px; width: 34px; height: 34px; }
.u-item:hover .u-sigil, .u-item.on .u-sigil { animation: u-turn 9s linear infinite; }
@keyframes u-turn { to { transform: rotate(360deg); } }
.u-sigil { transform-origin: 50% 50%; }
.u-marks { display: flex; align-items: center; gap: 16px; margin: 4px 0 14px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background-color: rgba(255, 255, 255, .02); }
.u-marks p { margin: 0; }
.u-number.sm { font-size: 17px; letter-spacing: .08em; padding: 10px 12px; margin: 8px 0 0; text-align: start; }
.u-print { display: block; }
.u-beat { display: none; font: 600 10px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--acc); border: 1px solid currentColor; border-radius: 999px; padding: 3px 7px; margin-inline-start: 4px; }
#tacuit.constant .u-beat { display: inline-block; animation: u-beat 1.5s ease-in-out infinite; }
@keyframes u-beat { 0%, 100% { opacity: .55; } 12% { opacity: 1; } }
.u-msgs { background-image: radial-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px); background-size: 22px 22px; background-position: 11px 11px; }
.u-head { backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.u-quiet { position: relative; }
.u-quiet::before { content: ""; position: absolute; left: 50%; top: 2px; width: 120px; height: 120px; margin-left: -60px; border-radius: 50%; border: 1px solid var(--line); opacity: .7; animation: u-ripple 3.6s ease-out infinite; pointer-events: none; }
@keyframes u-ripple { from { transform: scale(.35); opacity: .7; } to { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .u-item:hover .u-sigil, .u-item.on .u-sigil, #tacuit.constant .u-beat, .u-quiet::before { animation: none; } }

/* ---------- 1.5: on-screen keys, tamper watch, device check, this channel ---------- */
.u-keyhold:empty { display: none; }
.u-keyhold { margin-top: 10px; }
.u-keys { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 16px; background-color: rgba(255, 255, 255, .025); user-select: none; -webkit-user-select: none; direction: ltr; }
.u-keyrow { display: flex; justify-content: center; gap: 5px; }
.u-key { flex: 1 1 0; min-width: 0; max-width: 44px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background-color: var(--panel-2, #181822); color: var(--text); font: 500 16px/1 var(--mono); cursor: pointer; padding: 0; transition: background-color .1s, transform .06s; }
.u-key:hover { border-color: var(--acc); }
.u-key:active { background-color: var(--acc); color: var(--acc-ink, #11150a); transform: scale(.94); }
.u-key.wide { flex: 2 1 0; max-width: 110px; font: 600 12px/1 var(--sans); letter-spacing: .04em; text-transform: uppercase; }
.u-key.space { flex: 5 1 0; max-width: 260px; font: 600 12px/1 var(--sans); letter-spacing: .04em; text-transform: uppercase; }
.u-keys.up .u-key[data-key="shift"] { background-color: var(--acc); color: var(--acc-ink, #11150a); }
.u-keysbtn.on { color: var(--acc); border-color: var(--acc); }
.u-btn.u-keysbtn { margin-top: 8px; display: inline-flex; align-items: center; gap: 8px; }
.u-compose .u-keyhold { margin: 10px 0 0; }
.u-touched { display: none; font: 600 10px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--danger); border: 1px solid currentColor; border-radius: 999px; padding: 3px 7px; margin-inline-start: 4px; }
#tacuit.touched .u-touched { display: inline-block; }
.u-sweepbox { border-color: var(--line); background-color: rgba(255, 255, 255, .025); }
.u-sweepbox .u-btn { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.u-sweep { position: relative; display: grid; gap: 2px; margin: 12px 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background-color: var(--bg); }
.u-check { display: flex; gap: 14px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--line); transition: background-color .3s; }
.u-check:last-child { border-bottom: 0; }
.u-check > i { flex: none; width: 12px; height: 12px; margin-top: 5px; border-radius: 50%; border: 2px solid var(--line); }
.u-check strong { display: block; font-size: 15px; }
.u-check p { margin: 2px 0 0; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.u-check.wait { opacity: .5; }
.u-check.wait > i { border-top-color: var(--acc); animation: u-spin .7s linear infinite; }
.u-check.ok > i { border-color: var(--ok); background-color: var(--ok); box-shadow: 0 0 10px rgba(125, 255, 176, .5); }
.u-check.warn > i { border-color: #ffcf6b; background-color: #ffcf6b; }
.u-check.bad > i { border-color: var(--danger); background-color: var(--danger); }
.u-check.bad { background-color: rgba(255, 110, 90, .06); }
.u-check.warn { background-color: rgba(255, 207, 107, .05); }
@keyframes u-spin { to { transform: rotate(360deg); } }
.u-sweep-sum { font-family: var(--serif); font-style: italic; font-size: 22px; margin: 4px 0 10px; min-height: 1.4em; }
.u-sweep-sum.ok { color: var(--ok); }
.u-sweep-sum.warn { color: #ffcf6b; }
button.u-ring { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 50%; }
button.u-ring:hover { filter: brightness(1.3); }
.u-wire { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 4px 0 14px; }
.u-wire .u-av { width: 56px; height: 56px; }
.u-wire > i { flex: 1; max-width: 90px; height: 2px; background: linear-gradient(90deg, transparent, var(--acc), transparent); background-size: 200% 100%; animation: u-flow 1.6s linear infinite; }
.u-wire .u-ico { width: 26px; height: 26px; color: var(--acc); }
@keyframes u-flow { from { background-position: 200% 0; } to { background-position: 0 0; } }
.u-facts { display: grid; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin: 12px 0; background-color: var(--bg); }
.u-fact { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.u-fact:last-child { border-bottom: 0; }
.u-fact span { color: var(--dim); }
.u-fact code { font-family: var(--mono); font-size: 14px; color: var(--acc); direction: ltr; white-space: pre; }
.u-fact.no code { color: #ffcf6b; }
@media (prefers-reduced-motion: reduce) { .u-check.wait > i, .u-wire > i { animation: none; } }
@media (max-width: 420px) { .u-key { height: 38px; font-size: 15px; } .u-keyrow { gap: 4px; } .u-keys { padding: 8px 6px; } }

/* ---------- 2.0: many relays, courier, local link ---------- */
.u-fact code { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.u-group .u-fact { border: 1px solid var(--line); border-radius: 12px; margin-top: 8px; }
.u-addrelay { margin-top: 10px; }
.u-addrelay .u-row { display: flex; gap: 8px; margin-top: 8px; }
.u-addrelay .u-field { flex: 1; min-width: 0; }
.u-pair { margin-top: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); }
.u-pq.u-direct { letter-spacing: .06em; }
.u-qrbox + .u-field { margin-top: 10px; }
