:root {
	--dc-ink: #1c2b2a;
	--dc-ink-soft: #2c3f3c;
	--dc-paper: #f6f1e7;
	--dc-paper-raised: #fffdf8;
	--dc-accent: #ff6f59;
	--dc-accent-soft: #ffe3dc;
	--dc-sage: #7fa694;
	--dc-sage-soft: #e4efe9;
	--dc-text: #22302d;
	--dc-meta: #7c8a86;
	--dc-line: #e7ded0;
	--dc-nav-h: 60px;
	--dc-header-h: 64px;
	--dc-input-h: 60px;
	--font-display: "Fraunces", Georgia, serif;
	--font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
	margin: 0;
	height: 100%;
	background: #14201f;
	color: var(--dc-text);
	font-family: var(--font-body);
}

/* Lock the whole theme to a phone-width "app" frame, even on desktop browsers */
.dc-app {
	max-width: 480px;
	width: 100%;
	margin: 0 auto;
	min-height: 100dvh;
	background: var(--dc-paper);
	position: relative;
	overflow: hidden;
}

@media (min-width: 481px) {
	body { display: flex; justify-content: center; }
	.dc-app {
		min-height: 100dvh;
		box-shadow: 0 0 48px rgba(0,0,0,0.35);
	}
}

/* ---------- Chat ---------- */
.dc-chat-container {
	display: flex;
	flex-direction: column;
	height: 100dvh;
	background: var(--dc-paper);
	background-image: radial-gradient(circle at 1px 1px, rgba(28,43,42,0.05) 1px, transparent 1px);
	background-size: 22px 22px;
}

.dc-chat-header {
	background: var(--dc-ink);
	color: #fff;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 16px;
	padding-top: calc(10px + env(safe-area-inset-top));
	height: var(--dc-header-h);
	flex-shrink: 0;
	z-index: 5;
	border-bottom: 3px solid var(--dc-accent);
}

.dc-avatar {
	width: 40px; height: 40px;
	border-radius: 50%;
	background: var(--dc-accent);
	display: flex; align-items: center; justify-content: center;
	font-size: 19px;
	flex-shrink: 0;
	box-shadow: 0 0 0 2px rgba(255,255,255,0.15);
}

.dc-header-info { line-height: 1.3; min-width: 0; }
.dc-header-name { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; letter-spacing: 0.01em; }
.dc-header-status { font-size: 0.72rem; color: rgba(255,255,255,0.6); font-family: var(--font-mono); text-transform: lowercase; }

#dc-chat-window {
	flex: 1;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 18px 14px;
	display: flex;
	flex-direction: column;
}

.dc-msg-row { display: flex; margin-bottom: 10px; }
.dc-msg-row.dc-row-bot { justify-content: flex-start; }
.dc-msg-row.dc-row-user { justify-content: flex-end; }

.dc-msg {
	max-width: 78%;
	padding: 10px 13px 9px;
	border-radius: 14px;
	line-height: 1.45;
	font-size: 0.93rem;
	position: relative;
	word-break: break-word;
	box-shadow: 0 1px 2px rgba(28,43,42,0.06);
}

.dc-msg-bot {
	background: var(--dc-paper-raised);
	border: 1px solid var(--dc-line);
	border-bottom-left-radius: 3px;
	color: var(--dc-text);
}
.dc-msg-user {
	background: var(--dc-ink);
	color: #fdf9f2;
	border-bottom-right-radius: 3px;
}

.dc-msg-meta {
	display: block;
	text-align: right;
	font-size: 0.63rem;
	font-family: var(--font-mono);
	color: var(--dc-meta);
	margin-top: 4px;
	margin-left: 10px;
}
.dc-msg-user .dc-msg-meta { color: rgba(253,249,242,0.55); }

.dc-ticks { color: var(--dc-accent); margin-left: 4px; }

.dc-input-row {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	padding-bottom: calc(10px + env(safe-area-inset-bottom));
	background: var(--dc-paper-raised);
	border-top: 1px solid var(--dc-line);
	flex-shrink: 0;
}

#dc-input {
	flex: 1;
	padding: 12px 16px;
	border-radius: 24px;
	border: 1px solid var(--dc-line);
	background: var(--dc-paper);
	font-size: 16px; /* prevents iOS zoom-on-focus */
	font-family: var(--font-body);
	min-width: 0;
	color: var(--dc-text);
}
#dc-input:focus { outline: none; border-color: var(--dc-accent); background: #fff; }

#dc-send, #dc-mic {
	border: none;
	background: var(--dc-ink);
	color: #fff;
	width: 42px;
	height: 42px;
	flex-shrink: 0;
	border-radius: 50%;
	cursor: pointer;
	font-size: 1.05rem;
	transition: transform 0.12s ease;
}
#dc-send:active, #dc-mic:active { transform: scale(0.92); }

#dc-mic.dc-listening { background: var(--dc-accent); animation: dc-pulse 1s infinite; }

@keyframes dc-pulse {
	0% { box-shadow: 0 0 0 0 rgba(255,111,89,0.45); }
	70% { box-shadow: 0 0 0 12px rgba(255,111,89,0); }
	100% { box-shadow: 0 0 0 0 rgba(255,111,89,0); }
}

.dc-typing {
	display: inline-flex;
	gap: 4px;
	padding: 12px 14px;
}
.dc-typing span {
	width: 6px; height: 6px; border-radius: 50%;
	background: var(--dc-sage);
	animation: dc-blink 1.2s infinite;
}
.dc-typing span:nth-child(2) { animation-delay: 0.2s; }
.dc-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dc-blink { 0%, 60%, 100% { opacity: 0.3; } 30% { opacity: 1; } }

/* ---------- Bottom nav ---------- */
.dc-bottom-nav {
	display: flex;
	flex-shrink: 0;
	background: var(--dc-ink);
	height: var(--dc-nav-h);
	padding-bottom: env(safe-area-inset-bottom);
}

.dc-nav-item {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	text-decoration: none;
	color: rgba(255,255,255,0.5);
	font-size: 0.66rem;
	font-family: var(--font-mono);
	letter-spacing: 0.02em;
}

.dc-nav-icon { font-size: 1.2rem; }
.dc-nav-active { color: var(--dc-accent); }
.dc-nav-active .dc-nav-icon { filter: drop-shadow(0 0 6px rgba(255,111,89,0.5)); }

/* ---------- Dashboard ---------- */
.dc-dashboard {
	display: flex;
	flex-direction: column;
	height: 100dvh;
	background: var(--dc-paper);
}

.dc-dashboard-header {
	background: var(--dc-ink);
	color: #fdf9f2;
	padding: 16px 20px;
	padding-top: calc(16px + env(safe-area-inset-top));
	font-family: var(--font-display);
	font-weight: 600;
	font-size: 1.2rem;
	flex-shrink: 0;
	border-bottom: 3px solid var(--dc-accent);
}

.dc-dashboard-body {
	padding: 20px 18px 32px;
	overflow-y: auto;
	flex: 1;
	-webkit-overflow-scrolling: touch;
}

.dc-dashboard-body h3 {
	font-family: var(--font-mono);
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--dc-meta);
	margin: 24px 0 8px;
	font-weight: 500;
}
.dc-dashboard-body h3:first-child { margin-top: 4px; }

.dc-stat {
	font-family: var(--font-display);
	font-size: 2.4rem;
	font-weight: 600;
	color: var(--dc-ink);
}

/* Streak trail: a row of dots, like markers on a journal's page edge */
#dc-mood-trend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 4px;
	padding: 14px;
	background: var(--dc-paper-raised);
	border: 1px solid var(--dc-line);
	border-radius: 14px;
}
.dc-mood-bar {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	box-shadow: 0 0 0 3px var(--dc-paper-raised), 0 0 0 4px var(--dc-line);
}

.dc-back-link { display: none; }

.dc-kiarahub-input {
	width: 100%;
	padding: 12px 14px;
	border-radius: 10px;
	border: 1px solid var(--dc-line);
	background: var(--dc-paper-raised);
	font-size: 16px;
	font-family: var(--font-body);
	color: var(--dc-text);
}
.dc-kiarahub-input:focus { outline: none; border-color: var(--dc-accent); }

/* ---------- Auth modal ---------- */
.dc-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 1000;
	background: rgba(20, 32, 31, 0.6);
	display: flex;
	align-items: flex-end;
	justify-content: center;
}

.dc-modal-sheet {
	position: relative;
	width: 100%;
	max-width: 480px;
	max-height: 92dvh;
	overflow-y: auto;
	background: var(--dc-ink);
	border-radius: 22px 22px 0 0;
	border-top: 3px solid var(--dc-accent);
	padding-bottom: env(safe-area-inset-bottom);
	animation: dc-modal-up 0.22s ease-out;
}

@media (min-width: 520px) {
	.dc-modal-overlay { align-items: center; }
	.dc-modal-sheet { border-radius: 20px; margin: 20px; border-top: none; }
}

@keyframes dc-modal-up {
	from { transform: translateY(24px); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}

.dc-modal-close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	width: 34px;
	height: 34px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 1.3rem;
	line-height: 1;
	cursor: pointer;
}

.dc-login-hero-modal { padding: 44px 0 20px; }

.dc-login-hero {
	flex: 0 0 auto;
	text-align: center;
	color: #fdf9f2;
	padding: 56px 0 30px;
}

.dc-login-logo {
	width: 64px;
	height: 64px;
	margin: 0 auto 14px;
	border-radius: 50%;
	background: var(--dc-accent);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.9rem;
}

.dc-login-title {
	font-family: var(--font-display);
	font-size: 1.7rem;
	font-weight: 600;
	margin: 0 0 6px;
}

.dc-login-subtitle {
	font-size: 0.88rem;
	color: rgba(253,249,242,0.65);
	margin: 0;
}

.dc-login-card,
.dc-login-card-modal {
	background: var(--dc-paper-raised);
	border-radius: 22px 22px 0 0;
	padding: 26px 22px 30px;
}

@media (min-width: 520px) {
	.dc-login-card-modal { border-radius: 0 0 20px 20px; }
}

.dc-login-heading {
	font-family: var(--font-display);
	margin: 0 0 6px;
	font-size: 1.25rem;
	color: var(--dc-text);
}

.dc-login-text {
	color: var(--dc-meta);
	font-size: 0.87rem;
	margin: 0 0 18px;
	line-height: 1.45;
}

.dc-login-error {
	background: var(--dc-accent-soft);
	color: #b3421f;
	padding: 10px 12px;
	border-radius: 10px;
	font-size: 0.85rem;
	margin-bottom: 16px;
}

.dc-social-btn-wrap { margin-bottom: 12px; }

.dc-social-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 13px 16px;
	border-radius: 12px;
	border: 1px solid var(--dc-line);
	background: #fff;
	color: var(--dc-text);
	font-size: 0.94rem;
	font-weight: 600;
	font-family: var(--font-body);
	cursor: pointer;
	margin-bottom: 12px;
	text-decoration: none;
	box-sizing: border-box;
}

.dc-fb-btn { background: #1877f2; color: #fff; border-color: #1877f2; }
.dc-social-icon { font-weight: 800; font-style: italic; font-size: 1.1rem; }

.dc-login-divider {
	text-align: center;
	color: #c9beac;
	font-size: 0.78rem;
	margin: 6px 0 16px;
	position: relative;
}
.dc-login-divider::before,
.dc-login-divider::after {
	content: '';
	position: absolute;
	top: 50%;
	width: 38%;
	height: 1px;
	background: var(--dc-line);
}
.dc-login-divider::before { left: 0; }
.dc-login-divider::after { right: 0; }

.dc-login-footer {
	text-align: center;
	color: rgba(253,249,242,0.4);
	font-size: 0.7rem;
	font-family: var(--font-mono);
	padding: 16px 0 22px;
}

.dc-auth-tabs {
	display: flex;
	background: var(--dc-paper);
	border-radius: 12px;
	padding: 4px;
	margin-bottom: 18px;
}

.dc-auth-tab {
	flex: 1;
	border: none;
	background: transparent;
	padding: 10px 0;
	border-radius: 9px;
	font-size: 0.87rem;
	font-weight: 600;
	font-family: var(--font-body);
	color: var(--dc-meta);
	cursor: pointer;
}

.dc-auth-tab-active {
	background: var(--dc-ink);
	color: #fdf9f2;
}

.dc-email-form {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 4px;
}

.dc-text-input {
	width: 100%;
	padding: 13px 14px;
	border-radius: 12px;
	border: 1px solid var(--dc-line);
	font-size: 16px;
	font-family: var(--font-body);
	box-sizing: border-box;
	background: var(--dc-paper);
	color: var(--dc-text);
}
.dc-text-input:focus { outline: none; border-color: var(--dc-accent); background: #fff; }

.dc-primary-btn {
	background: var(--dc-ink);
	color: #fdf9f2;
	border-color: var(--dc-ink);
	margin-top: 4px;
}

.dc-forgot-link { text-align: center; margin: 0 0 18px; }
.dc-forgot-link a { color: var(--dc-meta); font-size: 0.8rem; text-decoration: none; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
	#dc-mic.dc-listening,
	.dc-typing span,
	.dc-modal-sheet { animation: none; }
}

/* ---------- KiaraHub hub cards (used by Reels ad slides) ---------- */
.dc-hub-intro {
	color: var(--dc-meta);
	font-size: 0.88rem;
	line-height: 1.5;
	margin: 0 0 20px;
}
.dc-hub-intro a { color: var(--dc-ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--dc-accent); }

.dc-hub-grid {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.dc-hub-card {
	display: block;
	background: var(--dc-paper-raised);
	border: 1px solid var(--dc-line);
	border-left: 4px solid var(--dc-ink);
	border-radius: 16px;
	padding: 16px 18px;
	text-decoration: none;
	color: inherit;
	transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.dc-hub-card:active { transform: scale(0.98); }

.dc-hub-card-coral { border-left-color: var(--dc-accent); }
.dc-hub-card-sage { border-left-color: var(--dc-sage); }
.dc-hub-card-ink { border-left-color: var(--dc-ink); }

.dc-hub-card-top {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}

.dc-hub-icon {
	font-size: 1.4rem;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--dc-paper);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.dc-hub-eyebrow {
	font-family: var(--font-mono);
	font-size: 0.66rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--dc-meta);
}

.dc-hub-title {
	font-family: var(--font-display);
	font-size: 1.08rem;
	font-weight: 600;
	margin: 0 0 6px;
	color: var(--dc-text);
	line-height: 1.3;
}

.dc-hub-text {
	font-size: 0.85rem;
	color: var(--dc-meta);
	line-height: 1.45;
	margin: 0 0 10px;
}

.dc-hub-link {
	font-family: var(--font-mono);
	font-size: 0.78rem;
	font-weight: 500;
	color: var(--dc-accent);
}

.dc-hub-promo-banner {
	display: block;
	background: var(--dc-ink);
	color: #fdf9f2;
	text-decoration: none;
	padding: 12px 14px;
	margin: 10px 10px 0;
	border-radius: 12px;
	font-size: 0.82rem;
	border: 1px solid var(--dc-ink);
}
.dc-hub-promo-banner strong { color: var(--dc-accent); }

/* ---------- Reels feed ---------- */
.dc-reels-empty {
	height: 100dvh;
	height: calc(100dvh - var(--dc-nav-h));
	background: #000;
	color: #fff;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	text-align: center;
	padding: 24px;
}
.dc-reels-empty-icon { font-size: 2.5rem; }
.dc-reels-empty a { color: var(--dc-accent); }

.dc-reels {
	height: 100dvh;
	height: calc(100dvh - var(--dc-nav-h));
	overflow-y: scroll;
	scroll-snap-type: y mandatory;
	background: #000;
}

.dc-reel {
	position: relative;
	height: 100dvh;
	height: calc(100dvh - var(--dc-nav-h));
	scroll-snap-align: start;
	scroll-snap-stop: always;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #000;
	overflow: hidden;
}

.dc-reel-yt-wrap {
	position: absolute;
	inset: 0;
}
.dc-reel-yt-frame {
	width: 100%;
	height: 100%;
	border: none;
}

.dc-reel-embed-wrap {
	width: 100%;
	height: 100%;
	overflow-y: auto;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #111;
	padding: 12px;
}

.dc-reel-caption {
	position: absolute;
	left: 14px;
	right: 14px;
	bottom: 18px;
	color: #fff;
	font-size: 0.82rem;
	text-shadow: 0 1px 4px rgba(0,0,0,0.6);
	pointer-events: none;
	z-index: 2;
}

/* Ad slide — visually distinct from content, clearly labeled */
.dc-reel-ad {
	background: var(--dc-ink);
	padding: 32px 26px;
	flex-direction: column;
	align-items: stretch;
	justify-content: center;
}

.dc-reel-ad-badge {
	position: absolute;
	top: 18px;
	left: 18px;
	background: rgba(255,255,255,0.14);
	color: #fdf9f2;
	font-family: var(--font-mono);
	font-size: 0.66rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	padding: 5px 10px;
	border-radius: 20px;
	z-index: 2;
}

.dc-reel-ad-body {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: #fdf9f2;
}

.dc-reel-ad-icon {
	font-size: 3rem;
	margin-bottom: 18px;
}

.dc-reel-ad-eyebrow {
	font-family: var(--font-mono);
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: rgba(253,249,242,0.55);
	margin-bottom: 8px;
}

.dc-reel-ad-title {
	font-family: var(--font-display);
	font-size: 1.7rem;
	font-weight: 600;
	line-height: 1.25;
	margin: 0 0 12px;
}

.dc-reel-ad-text {
	font-size: 0.95rem;
	color: rgba(253,249,242,0.75);
	line-height: 1.5;
	margin: 0 0 26px;
}

.dc-reel-ad-cta {
	display: inline-block;
	background: var(--dc-accent);
	color: var(--dc-ink);
	font-weight: 600;
	font-size: 0.9rem;
	padding: 13px 20px;
	border-radius: 12px;
	text-align: center;
}

.dc-reel-ad-coral .dc-reel-ad-cta { background: var(--dc-accent); }
.dc-reel-ad-sage .dc-reel-ad-cta { background: var(--dc-sage); color: var(--dc-ink); }
.dc-reel-ad-ink .dc-reel-ad-cta { background: #fdf9f2; color: var(--dc-ink); }
