/* TruRender Client Portal - matches the site: Poppins, charcoal #383838, gold #FFC840. */
.trq-portal {
	--trq-ink: #383838;
	--trq-muted: #6b6b6b;
	--trq-gold: #FFC840;
	--trq-gold-dark: #f0b423;
	--trq-gold-soft: #fff8e6;
	--trq-line: #e2e2e2;
	--trq-card: #fff;
	--trq-ok: #2e7d32;
	--trq-err: #b32d2e;
	max-width: 1100px;
	margin: 0 auto;
	padding: 40px 24px 64px;
	color: var(--trq-ink);
	font-family: "Poppins", sans-serif;
	font-size: 15px;
	line-height: 1.55;
	text-align: left;
}
.trq-portal *,
.trq-portal *::before,
.trq-portal *::after {
	box-sizing: border-box;
}
.trq-portal,
.trq-portal h2,
.trq-portal h3,
.trq-portal h4,
.trq-portal p,
.trq-portal a,
.trq-portal label,
.trq-portal input,
.trq-portal textarea,
.trq-portal button,
.trq-portal summary,
.trq-portal dt,
.trq-portal dd,
.trq-portal li {
	font-family: "Poppins", sans-serif !important;
	letter-spacing: normal;
}
.trq-portal h2,
.trq-portal h3,
.trq-portal h4 {
	color: var(--trq-ink);
	margin: 0 0 12px;
	line-height: 1.3;
}
.trq-portal h2::before,
.trq-portal h3::before,
.trq-portal h4::before { display: none !important; content: none !important; }
.trq-portal h2 { font-size: 1.6em; font-weight: 600; }
.trq-portal h3 { font-size: 1.1em; font-weight: 600; }
.trq-portal h4 { font-size: 0.95em; font-weight: 600; margin-top: 18px; }
.trq-portal a { color: var(--trq-ink); }

.trq-p-muted { color: var(--trq-muted); }
.trq-p-small { font-size: 0.85em; }
.trq-p-center { text-align: center; }

.trq-p-card {
	display: block;
	background: var(--trq-card);
	border: 1px solid var(--trq-line);
	border-radius: 12px;
	padding: 22px;
	margin-bottom: 18px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Notices */
.trq-p-notice {
	border-radius: 10px;
	padding: 12px 16px;
	margin-bottom: 18px;
	border: 1px solid;
}
.trq-p-notice ul { margin: 0; padding-left: 18px; }
.trq-p-notice-success { background: #edf7ee; border-color: #b7dfba; color: #1e5b22; }
.trq-p-notice-error { background: #fdecec; border-color: #f2b8b8; color: #8a1f1f; }

/* Forms */
.trq-portal label {
	display: block;
	font-weight: 500;
	margin-bottom: 14px;
}
.trq-portal input[type="text"],
.trq-portal input[type="email"],
.trq-portal input[type="password"],
.trq-portal textarea {
	display: block;
	width: 100%;
	margin-top: 6px;
	padding: 11px 13px;
	font-size: 15px;
	color: var(--trq-ink);
	background: #fff;
	border: 1px solid #d4d4d4;
	border-radius: 8px;
	box-shadow: none;
}
.trq-portal input:focus,
.trq-portal textarea:focus {
	outline: none;
	border-color: var(--trq-gold);
	box-shadow: 0 0 0 3px rgba(255, 200, 64, 0.35);
}
.trq-portal .trq-p-inline {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 400;
}
.trq-portal input[type="checkbox"] { accent-color: var(--trq-gold); width: 16px; height: 16px; }

/* Buttons (scoped + state-locked so the theme's button hover/focus colors can't override) */
.trq-portal .trq-p-btn,
.trq-portal .trq-p-btn:hover,
.trq-portal .trq-p-btn:focus,
.trq-portal .trq-p-btn:active {
	display: inline-block;
	border: none;
	border-radius: 100px;
	padding: 11px 26px;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	outline: none;
}
.trq-portal .trq-p-btn-sm,
.trq-portal .trq-p-btn-sm:hover,
.trq-portal .trq-p-btn-sm:focus { padding: 8px 18px; font-size: 14px; }
.trq-portal .trq-p-btn-primary,
.trq-portal .trq-p-btn-primary:focus,
.trq-portal .trq-p-btn-primary:active { background: var(--trq-gold); color: #fff; }
.trq-portal .trq-p-btn-primary:hover { background: var(--trq-gold-dark); color: #fff; }
.trq-portal .trq-p-btn-secondary,
.trq-portal .trq-p-btn-secondary:focus,
.trq-portal .trq-p-btn-secondary:active { background: var(--trq-ink); color: #fff; }
.trq-portal .trq-p-btn-secondary:hover { background: #555; color: #fff; }
.trq-portal .trq-p-btn:focus-visible { box-shadow: 0 0 0 3px rgba(56, 56, 56, 0.35); }
.trq-portal .trq-p-link { color: var(--trq-ink); text-decoration: underline; font-size: 0.9em; }

/* Sign-in / set password */
.trq-p-auth { max-width: 440px; margin: 0 auto; }
.trq-p-auth .trq-p-card { padding: 30px; }
.trq-p-auth .trq-p-btn { width: 100%; text-align: center; margin-top: 4px; }
.trq-p-forgot { margin-top: 18px; border-top: 1px solid var(--trq-line); padding-top: 14px; }
.trq-p-forgot summary { cursor: pointer; font-size: 0.9em; color: var(--trq-muted); }
.trq-p-forgot form { margin-top: 12px; }

/* Top bar */
.trq-p-topbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-bottom: 18px;
	flex-wrap: wrap;
}
.trq-p-topbar-actions { display: flex; align-items: center; gap: 16px; }
.trq-p-hello { font-weight: 500; }
.trq-p-back { text-decoration: none; font-weight: 500; }
.trq-p-title { margin-bottom: 14px; }

/* Dashboard */
.trq-p-projects {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 16px;
}
.trq-portal a.trq-p-project {
	text-decoration: none;
	color: var(--trq-ink);
	margin: 0;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.trq-portal a.trq-p-project:hover { border-color: var(--trq-gold); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06); }
.trq-p-project-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.trq-p-service { font-weight: 600; }
.trq-p-ref { font-size: 0.8em; color: var(--trq-muted); white-space: nowrap; }
.trq-p-stage-pill {
	display: inline-block;
	background: var(--trq-gold-soft);
	border: 1px solid var(--trq-gold);
	border-radius: 100px;
	padding: 3px 12px;
	font-size: 0.85em;
	font-weight: 500;
	margin-bottom: 12px;
}
.trq-p-bar { height: 6px; background: #eee; border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.trq-p-bar span { display: block; height: 100%; background: var(--trq-gold); }
.trq-p-empty { text-align: center; padding: 40px 20px; }

/* Project page */
.trq-p-project-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.trq-p-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.trq-p-side .trq-p-card { position: sticky; top: 20px; }

/* Timeline */
.trq-p-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.trq-p-timeline li {
	position: relative;
	padding: 0 0 16px 30px;
	display: flex;
	flex-wrap: wrap;
	column-gap: 10px;
	align-items: baseline;
}
.trq-p-timeline li::before {
	content: "";
	position: absolute;
	left: 7px;
	top: 18px;
	bottom: -2px;
	width: 2px;
	background: #e6e6e6;
}
.trq-p-timeline li:last-child::before { display: none; }
.trq-p-timeline li.is-done::before { background: var(--trq-gold); }
.trq-p-dot {
	position: absolute;
	left: 0;
	top: 4px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 2px solid #d0d0d0;
	background: #fff;
}
.trq-p-timeline li.is-done .trq-p-dot { background: var(--trq-gold); border-color: var(--trq-gold); }
.trq-p-timeline li.is-current .trq-p-dot { border-color: var(--trq-gold); box-shadow: 0 0 0 4px rgba(255, 200, 64, 0.3); }
.trq-p-timeline li.is-todo .trq-p-step { color: #a0a0a0; }
.trq-p-timeline li.is-current .trq-p-step { font-weight: 600; }
.trq-p-date { font-size: 0.8em; color: var(--trq-muted); }
.trq-p-note { flex-basis: 100%; font-size: 0.88em; color: var(--trq-muted); margin-top: 2px; }

/* Messages */
.trq-p-thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; max-height: 460px; overflow-y: auto; }
.trq-p-msg { max-width: 85%; padding: 10px 14px; border-radius: 12px; }
.trq-p-msg.is-client { align-self: flex-end; background: var(--trq-gold-soft); border: 1px solid #f3dfa6; }
.trq-p-msg.is-studio { align-self: flex-start; background: #f3f3f3; border: 1px solid #e6e6e6; }
.trq-p-msg-meta { font-size: 0.75em; color: var(--trq-muted); margin-bottom: 3px; }
.trq-p-msg-form { display: flex; gap: 10px; align-items: flex-end; }
.trq-p-msg-form textarea { margin-top: 0; flex: 1; }

/* Files */
.trq-p-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.trq-p-file { border: 1px solid var(--trq-line); border-radius: 10px; overflow: hidden; background: #fafafa; }
.trq-p-thumb { display: block; aspect-ratio: 4 / 3; background: #eee; }
.trq-p-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.trq-p-thumb-doc { display: flex; align-items: center; justify-content: center; font-weight: 600; color: var(--trq-muted); }
.trq-p-file-meta { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.trq-p-file-name { font-size: 0.88em; word-break: break-word; }
.trq-p-tag {
	align-self: flex-start;
	background: var(--trq-ink);
	color: #fff;
	font-size: 0.72em;
	border-radius: 100px;
	padding: 1px 9px;
	margin-bottom: 3px;
}
.trq-p-filelist { list-style: none; margin: 0 0 14px; padding: 0; }
.trq-p-filelist li {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	padding: 8px 12px;
	border: 1px solid var(--trq-line);
	border-radius: 8px;
	margin-bottom: 6px;
	background: #fafafa;
}
.trq-p-inline-form { margin: 0 0 0 auto; }
.trq-portal .trq-p-remove,
.trq-portal .trq-p-remove:hover,
.trq-portal .trq-p-remove:focus {
	background: none;
	border: none;
	color: var(--trq-err);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
}
.trq-p-upload { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.trq-portal .trq-p-drop {
	flex: 1;
	min-width: 220px;
	margin: 0;
	border: 2px dashed #c4c4c4;
	border-radius: 10px;
	padding: 14px;
	font-weight: 400;
	font-size: 0.88em;
	color: var(--trq-muted);
	background: #fff;
	cursor: pointer;
}
.trq-p-drop input { margin-bottom: 6px; max-width: 100%; }
.trq-p-drop span { display: block; }

/* Details */
.trq-p-details { margin: 0 0 14px; }
.trq-p-details dt { font-size: 0.78em; text-transform: uppercase; letter-spacing: 0.04em !important; color: var(--trq-muted); margin-top: 10px; }
.trq-p-details dt:first-child { margin-top: 0; }
.trq-p-details dd { margin: 2px 0 0; }

@media (max-width: 860px) {
	.trq-p-grid { grid-template-columns: 1fr; }
	.trq-p-side .trq-p-card { position: static; }
}
@media (max-width: 520px) {
	.trq-portal { padding: 24px 16px 48px; }
	.trq-p-card { padding: 16px; }
	.trq-p-topbar-actions { gap: 12px; }
	.trq-p-msg { max-width: 95%; }
	.trq-p-msg-form { flex-direction: column; align-items: stretch; }
}

/* ---------- v0.4.0: review, pins, revisions, compare ---------- */
.trq-portal [hidden] { display: none !important; }
.trq-p-files-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.trq-p-file-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.trq-p-approved { display: inline-block; color: #1e5b22; background: #edf7ee; border: 1px solid #b7dfba; border-radius: 100px; padding: 2px 10px; font-size: 0.8em; font-weight: 500; }
.trq-p-rounds { display: flex; gap: 6px; margin-bottom: 8px; }
.trq-p-round { flex: 1; height: 8px; border-radius: 4px; background: #eee; }
.trq-p-round.is-used { background: var(--trq-gold); }
.trq-p-draftbar {
	display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
	background: var(--trq-gold-soft); border: 1px solid var(--trq-gold); border-radius: 12px;
	padding: 14px 18px; margin-bottom: 18px;
}
.trq-p-draftbar > div { display: flex; flex-direction: column; }
.trq-p-draftbar.is-extra { background: #fff3e0; border-color: #f0a040; }
.trq-p-draftbar form { margin: 0; }

.trq-p-review-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.trq-p-review-head .trq-p-title { margin: 4px 0 0; font-size: 1.25em; word-break: break-word; }
.trq-p-review-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.trq-p-review-actions form { margin: 0; }
.trq-p-hint { margin: 8px 0 10px; }
.trq-p-stage { position: relative; display: block; line-height: 0; border-radius: 10px; overflow: hidden; background: #eee; margin-bottom: 18px; cursor: crosshair; user-select: none; }
.trq-p-stage img { width: 100%; height: auto; display: block; }
.trq-portal .trq-p-pin {
	position: absolute; transform: translate(-50%, -50%);
	width: 28px; height: 28px; border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	font-size: 13px; font-weight: 600; line-height: 1; text-decoration: none;
	background: var(--trq-gold); color: var(--trq-ink); border: 2px solid #fff;
	box-shadow: 0 2px 6px rgba(0,0,0,.35); cursor: pointer;
}
.trq-portal .trq-p-pin.is-draft { background: #fff; border: 2px dashed var(--trq-ink); }
.trq-portal .trq-p-pin.is-resolved { background: #9e9e9e; color: #fff; }
.trq-portal .trq-p-pin.from-studio { background: var(--trq-ink); color: #fff; }
.trq-portal .trq-p-pin.is-new { background: var(--trq-ink); color: #fff; animation: trq-pulse 1.2s infinite; }
@keyframes trq-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(56,56,56,.5); } 50% { box-shadow: 0 0 0 8px rgba(56,56,56,0); } }
.trq-p-pinform .trq-p-row { display: flex; align-items: center; gap: 14px; }
.trq-portal .trq-p-plain,
.trq-portal .trq-p-plain:hover,
.trq-portal .trq-p-plain:focus { background: none; border: none; padding: 0; cursor: pointer; color: var(--trq-ink); text-decoration: underline; font-size: 0.88em; }
.trq-portal .trq-p-danger,
.trq-portal .trq-p-danger:hover { color: var(--trq-err); }

.trq-p-pinlist { list-style: none; margin: 0; padding: 0; }
.trq-p-pinlist > li { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--trq-line); transition: background .3s; }
.trq-p-pinlist > li:first-child { border-top: none; }
.trq-p-pinlist > li.is-flash { background: var(--trq-gold-soft); }
.trq-p-pinlist > li.is-resolved .trq-p-pin-body > div:not(.trq-p-msg-meta):not(.trq-p-pin-actions) { color: var(--trq-muted); }
.trq-p-pin-num { flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--trq-gold); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.trq-p-pin-num.is-draft { background: #fff; border: 2px dashed var(--trq-ink); }
.trq-p-pin-num.is-resolved { background: #9e9e9e; color: #fff; }
.trq-p-pin-body { flex: 1; min-width: 0; }
.trq-p-badge { display: inline-block; margin-left: 6px; font-size: 0.85em; border-radius: 100px; padding: 0 8px; background: #eee; color: var(--trq-ink); }
.trq-p-badge.is-draft { background: #fff3e0; color: #8a4b00; }
.trq-p-badge.is-resolved { background: #edf7ee; color: #1e5b22; }
.trq-p-reply { margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: #f3f3f3; }
.trq-p-reply.from-client { background: var(--trq-gold-soft); }
.trq-p-pin-actions { display: flex; align-items: center; gap: 16px; margin-top: 8px; flex-wrap: wrap; }
.trq-p-pin-actions form { margin: 0; }
.trq-p-pin-actions details { width: 100%; }
.trq-p-pin-actions summary { cursor: pointer; font-size: 0.88em; text-decoration: underline; display: inline; }
.trq-p-pin-actions details form { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

.trq-p-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.trq-portal .trq-p-strip a { flex: 0 0 140px; text-decoration: none; color: var(--trq-ink); font-size: 0.8em; border: 2px solid transparent; border-radius: 8px; overflow: hidden; }
.trq-portal .trq-p-strip a.is-current { border-color: var(--trq-gold); }
.trq-p-strip img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.trq-p-strip span { display: block; padding: 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.trq-p-compare-pick { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.trq-p-compare-pick label { flex: 1; min-width: 200px; margin: 0; }
.trq-portal .trq-p-compare-pick select { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid #d4d4d4; border-radius: 8px; background: #fff; font-family: "Poppins", sans-serif; font-size: 14px; color: var(--trq-ink); }
.trq-p-compare { position: relative; line-height: 0; border-radius: 10px; overflow: hidden; background: #eee; user-select: none; }
.trq-p-compare img { width: 100%; height: auto; display: block; }
.trq-p-compare-a { position: absolute; inset: 0; }
.trq-p-compare-a img { width: 100%; height: 100%; object-fit: cover; }
.trq-p-compare-handle { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1px; background: #fff; pointer-events: none; box-shadow: 0 0 6px rgba(0,0,0,.4); }
.trq-p-compare-handle span { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 38px; height: 38px; border-radius: 50%; background: var(--trq-gold); color: var(--trq-ink); display: flex; align-items: center; justify-content: center; font-size: 18px; line-height: 1; }
.trq-p-compare input[type="range"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
@media (max-width: 520px) {
	.trq-portal .trq-p-pin { width: 24px; height: 24px; font-size: 12px; }
	.trq-p-draftbar .trq-p-btn { width: 100%; text-align: center; }
	.trq-p-draftbar form { width: 100%; }
}

/* v0.4.2 */
.trq-p-client-name { font-size: 0.8em; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em !important; color: var(--trq-muted); margin-bottom: 4px; }
.trq-p-roundlist { list-style: none; margin: 10px 0 6px; padding: 0; }
.trq-p-roundlist li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--trq-line); font-size: 0.88em; }
.trq-p-roundlist li:first-child { border-top: none; }

/* v0.5.0 - quote, acceptance, payments, locks */
.trq-p-quote { border-color: #b7dfba; }
.trq-p-price { font-size: 2em; font-weight: 700; color: #2E7D32; line-height: 1.1; margin: 2px 0 10px; }
.trq-p-quote-note { background: #f5faf5; border-left: 3px solid #2E7D32; border-radius: 6px; padding: 10px 12px; margin-bottom: 14px; font-size: 0.92em; }
.trq-p-accept { margin: 4px 0 6px; }
.trq-portal .trq-p-agree { align-items: flex-start; font-size: 0.88em; margin-bottom: 12px; }
.trq-portal .trq-p-agree input { margin-top: 3px; flex: 0 0 auto; }
.trq-portal .trq-p-btn-block,
.trq-portal .trq-p-btn-block:hover,
.trq-portal .trq-p-btn-block:focus { display: block; width: 100%; text-align: center; }
.trq-p-paylines { list-style: none; margin: 12px 0; padding: 0; border-top: 1px solid var(--trq-line); }
.trq-p-paylines li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 0; border-bottom: 1px solid var(--trq-line); font-size: 0.9em; }
.trq-p-paylines li span:first-child { flex: 1; }
.trq-p-paylines .trq-p-badge { margin-left: 0; }
.trq-p-payform { margin: 10px 0 6px; }
.trq-p-payform .trq-p-btn { width: 100%; text-align: center; }
.trq-p-locked { font-size: 0.82em; color: var(--trq-muted); }
.trq-p-lockbar { background: #fff8e6; border: 1px solid #f3dfa6; border-radius: 8px; padding: 8px 12px; font-size: 0.88em; }

/* v0.5.1 - render versions */
.trq-p-versions { display: flex; gap: 6px; flex-wrap: wrap; margin: 3px 0; }
.trq-portal .trq-p-versions a { font-size: 0.75em; text-decoration: none; border: 1px solid var(--trq-line); border-radius: 100px; padding: 1px 8px; color: var(--trq-ink); background: #fff; }
.trq-portal .trq-p-versions a.is-current { background: var(--trq-ink); color: #fff; border-color: var(--trq-ink); }
.trq-p-paylines li.trq-p-payline-total span:first-child { font-weight: 600; }

/* Keep the footer at the bottom of the screen on short portal pages (all screen sizes). */
body:has(> .trq-portal) {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
}
body:has(> .trq-portal) > .trq-portal {
	flex: 1 0 auto;
	width: 100%;
}
body:has(> .trq-portal) > header,
body:has(> .trq-portal) > footer {
	flex-shrink: 0;
	width: 100%;
}
