/* Partyline PWA — mobile-first app shell. Neutral charcoal system; the app
   icon is the only splash of color. */

:root {
	--ink: #18181b;       /* near-black — primary / brand */
	--ink-2: #27272a;     /* pressed / hover on dark */
	--paper: #ffffff;
	--surface: #f4f4f5;   /* subtle fills (drop zones, chips, banners) */
	--line: #e4e4e7;      /* hairline borders */
	--muted: #71717a;     /* secondary text */
	--danger: #e5484d;
	--radius: 14px;
	--safe-top: env(safe-area-inset-top, 0px);
	--safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
	margin: 0;
	height: 100%;
	background: var(--ink);
	color: var(--ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	overscroll-behavior: none;
}

#app {
	display: flex;
	flex-direction: column;
	min-height: 100%;
	background: var(--paper);
	max-width: 640px;
	margin: 0 auto;
}

/* Header */
.pl-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: calc(12px + var(--safe-top)) 16px 12px;
	background: var(--ink);
	color: var(--paper);
	position: sticky;
	top: 0;
	z-index: 10;
}
.pl-header .pl-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.pl-header .pl-brand img { width: 28px; height: 28px; border-radius: 7px; display: block; }
.pl-header .pl-user { font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, 0.65); }

/* Main */
.pl-main { flex: 1; padding: 20px 16px calc(20px + var(--safe-bottom)); }

.pl-hero { text-align: center; padding: 32px 8px; }
.pl-hero h1 { font-size: 26px; margin: 0 0 8px; letter-spacing: -0.02em; }
.pl-hero p { color: var(--muted); margin: 0 auto; max-width: 34ch; line-height: 1.5; }

/* Buttons */
.pl-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 16px 20px;
	border: none;
	border-radius: var(--radius);
	background: var(--ink);
	color: var(--paper);
	font-size: 17px;
	font-weight: 700;
	cursor: pointer;
	text-decoration: none;
	transition: transform 0.08s ease, opacity 0.15s ease;
}
.pl-btn, .pl-btn:hover, .pl-btn:focus { text-decoration: none; }
.pl-btn:active { transform: scale(0.98); }
.pl-btn--primary { background: var(--ink); color: var(--paper); }
.pl-btn--lime { background: var(--ink); color: var(--paper); }
.pl-btn--ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); }
.pl-btn[disabled] { opacity: 0.4; cursor: default; }

.pl-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }

/* Install banner */
.pl-install {
	display: none;
	align-items: center;
	gap: 12px;
	margin: 16px 0 0;
	padding: 12px 14px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	font-size: 14px;
}
.pl-install.show { display: flex; }
.pl-install .pl-btn { width: auto; padding: 10px 14px; font-size: 14px; }

/* Footer */
.pl-footer { padding: 16px; text-align: center; color: var(--muted); font-size: 12px; }

/* Steps / screens */
.pl-screen { animation: plFade 0.2s ease; }
@keyframes plFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.pl-step { display: flex; align-items: center; font-size: 17px; font-weight: 800; color: var(--ink); margin: 28px 0 12px; letter-spacing: -0.01em; }
.pl-screen > .pl-step:first-child { margin-top: 4px; }
.pl-stepnum {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	margin-right: 10px;
	background: var(--ink);
	color: #fff;
	font-size: 13px;
	font-weight: 800;
}
.pl-hint { font-size: 13px; color: var(--muted); margin: 0 0 12px; }

/* Post-immediately checkbox (editors/admins only) */
.pl-check { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 15px; font-weight: 700; color: var(--ink); cursor: pointer; }
.pl-check input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--ink); }
.pl-check-note { font-weight: 400; color: var(--muted); font-size: 13px; }
.pl-turnstile { margin: 4px 0 14px; }

/* Photo */
.pl-photo-drop {
	width: 100%;
	aspect-ratio: 4 / 3;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	border: 2px dashed #cbd5e1;
	border-radius: var(--radius);
	background: #f8fafc;
	color: var(--muted);
	font-size: 17px;
	font-weight: 600;
	cursor: pointer;
}
.pl-photo-drop span { font-size: 28px; }
.pl-photo-canvas { width: 100%; border-radius: var(--radius); display: block; background: #000; margin-top: 12px; }

/* Photo choice: take vs. select */
.pl-photo-actions { display: flex; gap: 10px; }
.pl-photo-btn2 {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	aspect-ratio: 3 / 2;
	border: 2px dashed #cbd5e1;
	border-radius: var(--radius);
	background: #f8fafc;
	color: var(--muted);
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}
.pl-photo-btn2 span { font-size: 26px; }
.pl-photo-btn2:active { background: #eef2f6; }

/* "or" divider between dictate and type */
.pl-or { display: flex; align-items: center; gap: 12px; margin: 16px 0 12px; color: var(--muted); font-size: 13px; }
.pl-or::before, .pl-or::after { content: ""; flex: 1; height: 1px; background: #e5e7eb; }

/* Filter chips */
.pl-filters { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 2px; -webkit-overflow-scrolling: touch; }
.pl-chip {
	flex: 0 0 auto;
	padding: 8px 14px;
	border: 2px solid #e5e7eb;
	border-radius: 999px;
	background: #fff;
	color: var(--ink);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}
.pl-chip.is-active { border-color: var(--ink); background: var(--ink); color: #fff; }

/* Multi-photo thumbnail strip */
.pl-thumbs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.pl-thumb { position: relative; width: 72px; height: 72px; border-radius: 10px; overflow: hidden;
	border: 2px solid #e5e7eb; cursor: pointer; background: #000; flex: 0 0 auto; }
.pl-thumb.is-active { border-color: var(--ink); }
.pl-thumb canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.pl-thumb-del { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border: none;
	border-radius: 50%; background: rgba(0,0,0,0.6); color: #fff; font-size: 12px; line-height: 20px;
	text-align: center; cursor: pointer; padding: 0; }
.pl-thumb-cover { position: absolute; left: 0; bottom: 0; right: 0; background: var(--ink); color: #fff;
	font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; text-align: center; padding: 2px 0; }
.pl-cover-btn { display: inline-block; margin-top: 10px; padding: 7px 12px; border: 1px solid #e5e7eb;
	border-radius: 999px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 700; cursor: pointer; }

/* Optional video */
.pl-video-btn { width: 100%; margin-top: 12px; aspect-ratio: auto; flex-direction: row; padding: 16px; }
.pl-video-note { margin-top: 8px; }
.pl-video-chip { margin-top: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid #e5e7eb;
	background: #fafafa; font-size: 14px; color: var(--ink); display: flex; align-items: center; gap: 10px; }
.pl-video-chip.is-warn  { background: #fff7ed; border-color: #fdba74; color: #9a3412; }
.pl-video-chip.is-error { background: #fdecec; border-color: #f3bcbc; color: #b32020; }
.pl-video-chip .pl-video-name { flex: 1 1 auto; line-height: 1.4; word-break: break-word; }
.pl-video-chip .pl-video-del { flex: 0 0 auto; border: none; background: rgba(0,0,0,0.55); color: #fff;
	width: 22px; height: 22px; border-radius: 50%; font-size: 13px; line-height: 22px; text-align: center; cursor: pointer; padding: 0; }

/* Record */
.pl-record { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 8px 0; }
.pl-recbtn {
	width: 76px;
	height: 76px;
	border-radius: 50%;
	border: 4px solid var(--ink);
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: transform 0.1s ease;
}
.pl-recbtn:active { transform: scale(0.95); }
.pl-recdot { width: 30px; height: 30px; border-radius: 8px; background: var(--danger); transition: all 0.15s ease; }
.pl-recbtn.is-recording { border-color: var(--danger); }
.pl-recbtn.is-recording .pl-recdot { border-radius: 50%; animation: plPulse 1s infinite; }
@keyframes plPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.pl-recbtn[disabled] { opacity: 0.5; cursor: default; }
.pl-status { font-size: 14px; color: var(--muted); text-align: center; min-height: 20px; }
.pl-status.is-busy { color: var(--ink); font-weight: 600; }
.pl-status.is-error { color: var(--danger); font-weight: 600; }

/* Preview form */
.pl-preview-img { width: 100%; border-radius: var(--radius); display: block; margin-bottom: 8px; }
.pl-label { display: block; font-size: 13px; font-weight: 700; margin: 16px 0 6px; }
.pl-input, .pl-textarea {
	width: 100%;
	padding: 12px 14px;
	border: 2px solid #e5e7eb;
	border-radius: var(--radius);
	font-size: 16px;
	font-family: inherit;
	color: var(--ink);
	background: #fff;
}
.pl-input:focus, .pl-textarea:focus { outline: none; border-color: var(--ink); }
.pl-textarea { resize: vertical; line-height: 1.5; }

/* Saved drafts list */
.pl-drafts { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 20px; }
.pl-draft {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px;
	border: 1px solid #e5e7eb;
	border-radius: var(--radius);
	background: #fff;
	cursor: pointer;
}
.pl-draft:active { background: #f8fafc; }
.pl-draft-thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; background: #f1f5f9; }
.pl-draft-noimg { display: flex; align-items: center; justify-content: center; font-size: 22px; }
.pl-draft-main { flex: 1; min-width: 0; }
.pl-draft-title { font-weight: 700; font-size: 15px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-draft-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.pl-draft-time { font-size: 12px; color: var(--muted); }
.pl-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.03em; }
.pl-badge.is-draft { background: #fef3c7; color: #92400e; }
.pl-badge.is-sent { background: #e0e7ff; color: #3730a3; }
.pl-badge.is-published { background: #dcfce7; color: #166534; }
.pl-draft-del { flex: 0 0 auto; width: 34px; height: 34px; border: none; background: transparent; color: var(--muted); font-size: 18px; border-radius: 8px; cursor: pointer; }
.pl-draft-del:active { background: #fee2e2; color: var(--danger); }

/* Utility */
.pl-hidden { display: none !important; }
