/* ZeroPulp Designer - phone layout. Phones only (max-width 767.98px); nothing here applies at tablet or
   desktop widths. Pairs with js/designer/designerMobile.js, which mirrors the same breakpoint onto
   body.zp-m for JS that needs it. Loaded after designerExperience.css so these rules win.
   Screens covered so far: the header and the home page (prompt box + "Your processes" list). */

@media (max-width: 767.98px)
{

.zp-root
{
	height: 100dvh;
}

/* ---- Header: logo + Designer chip left, initials avatar right ---- */
.zp-header
{
	height: 52px;
	padding: 0 12px 0 16px;
	gap: 8px;
}

.zp-logo
{
	gap: 8px;
	min-width: 0;
}

.zp-logo img
{
	width: 26px;
	height: 26px;
}

.zp-logo > span:first-of-type
{
	font-size: 17px !important;
}

.zp-badge
{
	font-size: 9px;
	padding: 3px 7px;
}

/* process breadcrumb and the header's action buttons give way to the phone's own detail screens */
.zp-breadcrumb,
.zp-header-actions,
.zp-user-caret,
.zp-user > div:not(.zp-avatar)
{
	display: none !important;
}

.zp-user
{
	padding-left: 0;
	border-left: 0;
}

.zp-avatar
{
	width: 32px;
	height: 32px;
}

/* the account menu fits the screen instead of hanging 300px off the right edge */
.zp-user-menu
{
	position: fixed;
	top: 56px;
	right: 8px;
	left: 8px;
	width: auto;
	max-height: calc(100dvh - 68px);
	overflow-y: auto;
}

/* ---- Home: prompt ---- */
.zp-home-hero-inner
{
	padding: 28px 16px 24px;
}

.zp-home-hero h1
{
	font-size: 24px;
	line-height: 1.2;
}

.zp-home-hero p
{
	font-size: 13px;
	margin: 8px auto 18px;
}

.zp-prompt-card
{
	padding: 12px 12px 10px;
	border-radius: 16px;
}

.zp-prompt-card textarea
{
	font-size: 16px; /* 16px stops iOS zooming the page on focus */
	min-height: 84px;
}

.zp-lib-btn
{
	height: 36px;
}

.zp-build-btn
{
	height: 36px;
	padding: 0 20px;
}

/* the prompt library opens as a bottom sheet rather than a 360px dropdown */
.zp-lib-dropdown
{
	position: fixed;
	top: auto;
	left: 0;
	right: 0;
	bottom: 0;
	width: auto;
	max-height: 70dvh;
	overflow-y: auto;
	border-radius: 16px 16px 0 0;
	padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
	z-index: 60;
}

.zp-lib-tabs
{
	flex-wrap: nowrap;
	overflow-x: auto;
}

.zp-lib-tab
{
	height: 36px;
	flex: none;
}

.zp-lib-item
{
	padding: 14px 12px;
	font-size: 14px;
}

/* ---- Home: Your processes - one card per row ---- */
.zp-home-apps
{
	padding: 20px 16px 32px;
}

.zp-app-grid
{
	grid-template-columns: minmax(0, 1fr);
	gap: 8px;
}

/* compact rows: no thumbnail (the form / flow preview), so a long list stays short */
.zp-proc-thumb,
.zp-app-thumb
{
	display: none;
}

.zp-app-card
{
	border-radius: 12px;
}

.zp-app-body
{
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 8px;
	padding: 10px 14px;
	border-top: 0;
}

.zp-app-name-row,
.zp-proc-card-desc
{
	flex: 0 0 100%;
	min-width: 0;
}

.zp-app-name
{
	font-size: 15px;
}

.zp-proc-card-desc
{
	margin-top: 0;
	-webkit-line-clamp: 1;
}

.zp-app-chips
{
	margin-top: 4px;
	flex: 0 1 auto;
}

.zp-app-modified
{
	margin: 4px 0 0 auto;
	white-space: nowrap;
}

/* a card is a tap target on touch: no hover lift to stick after a tap */
.zp-app-card:hover
{
	border-color: #e2e5ec;
	box-shadow: 0 1px 2px rgba(20, 24, 32, .04);
}

.zp-prod-block
{
	margin: 32px 16px 0;
	padding: 28px 20px;
}


/* ------------------------------------------------------------------------------------------
   Process screen - one thing at a time (see designerMobile.js): the build checklist while a
   process builds for the first time, otherwise its kick-off form with a Chat tab beside it.
   ------------------------------------------------------------------------------------------ */

/* header: "<  Process name  [chip]" - the logo becomes the back chevron, the breadcrumb the title */
.zp-header-detail .zp-logo img,
.zp-header-detail .zp-logo > span,
.zp-header-detail .zp-header-spacer,
.zp-header-detail .zp-breadcrumb-sep
{
	display: none !important;
}

.zp-header-detail .zp-logo
{
	width: 32px;
	height: 32px;
	justify-content: center;
	flex: none;
}

.zp-header-detail .zp-logo::before
{
	content: "\2039";
	font-size: 30px;
	line-height: 1;
	color: #5b6472;
	margin-top: -3px;
}

.zp-header-detail .zp-breadcrumb
{
	display: flex !important;
	flex: 1;
	min-width: 0;
	margin-left: 0;
	gap: 8px;
}

/* the whole process name, wrapping onto as many lines as it needs - people should know what
   they are working on - so the header grows with it */
.zp-header-detail
{
	height: auto;
	min-height: 52px;
	padding-top: 6px;
	padding-bottom: 6px;
}

.zp-header-detail .zp-breadcrumb-app
{
	font-size: 15px;
	font-weight: 700;
	line-height: 1.25;
	color: #1a1f26;
	min-width: 0;
	white-space: normal;
	overflow-wrap: anywhere;
}

.zp-header-detail .zp-breadcrumb .zp-proc-chip,
.zp-m-chip
{
	flex: none;
	font-size: 11px;
	font-weight: 600;
	border-radius: 99px;
	padding: 3px 9px;
	white-space: nowrap;
}

.zp-m-chip
{
	color: #5b6472;
	background: #f3f5f8;
	border: 1px solid #e8eaf0;
	font-family: inherit;
	cursor: pointer;
}

.zp-m-chip-caret
{
	font-size: 9px;
	margin-left: 2px;
}

.zp-m-chip-live
{
	color: #15803d;
	background: #eefbf2;
	border-color: #cdeed9;
}

/* the phone's own status chip (zp-m-chip) names the version */
.zp-header-detail .zp-breadcrumb .zp-version-chip
{
	display: none;
}

/* the build's running timer is noise on a phone */
.zp-header-detail .zp-breadcrumb .zp-proc-chip ~ *:not(.zp-m-chip)
{
	display: none;
}

/* the rail never shows; the chat only on its tab; the preview gives way to it */
.zp-detail .zp-detail-sidebar,
.zp-detail .zp-preview-header,
.zp-detail .zp-chat-collapse-toggle,
.zp-detail .zp-chat-resize-handle
{
	display: none !important;
}

.zp-detail-body
{
	flex-direction: column;
}

.zp-detail .zp-chat-panel
{
	display: none;
	width: 100% !important;
	flex: 1;
	border-right: 0;
}

.zp-detail.zp-m-tab-chat .zp-chat-panel
{
	display: flex;
}

.zp-detail.zp-m-tab-chat .zp-preview-panel
{
	display: none;
}

.zp-preview-body
{
	padding: 14px;
}

/* tab strip (built processes) */
.zp-m-tabs
{
	position: relative;
	display: flex;
	gap: 22px;
	padding: 0 16px;
	background: #fff;
	border-bottom: 1px solid #e2e5ec;
	flex-shrink: 0;
}

.zp-m-tab
{
	background: none;
	border: 0;
	border-bottom: 2px solid transparent;
	padding: 12px 0 10px;
	font: inherit;
	font-size: 14px;
	color: #5b6472;
	cursor: pointer;
}

.zp-m-tab-on
{
	color: #1a1f26;
	font-weight: 700;
	border-bottom-color: #7c3aed;
}

/* bottom bar - where the portal's action bar sits */
.zp-m-bar
{
	display: flex;
	gap: 8px;
	padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
	background: #fff;
	border-top: 1px solid #e2e5ec;
	flex-shrink: 0;
}

.zp-m-bar-btn
{
	flex: 1;
	min-width: 0;
	white-space: nowrap;
	padding: 0 8px;
	height: 44px;
	border: 1px solid #dde1e9;
	border-radius: 10px;
	background: #fff;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	color: #3a4150;
	cursor: pointer;
}

.zp-m-bar-primary
{
	background: #7c3aed;
	border-color: #7c3aed;
	color: #fff;
}

.zp-m-bar-btn[disabled]
{
	opacity: .45;
	cursor: default;
}

/* build checklist card: full width, no desktop padding */
.zp-preview-body-building
{
	align-items: flex-start;
	padding: 14px;
}

.zp-building-card
{
	align-self: flex-start; /* the desktop centres it vertically, which clips the top of a card taller than the screen */
	margin-top: 0;    /* the desktop centres with auto margins - pin it to the top here */
	margin-bottom: 0;
	padding: 18px 16px 14px;
	border-radius: 16px;
	box-shadow: none;
}

.zp-building-header-sub
{
	font-size: 12px;
}

.zp-building-row
{
	gap: 10px;
	padding: 9px 4px;
}

.zp-building-row-glyph
{
	display: none;
}

/* kick-off form page: the card fills the width */
.zp-startform-card
{
	border-radius: 12px;
}

.zp-startform-card-head
{
	padding: 14px 16px;
	font-size: 15px;
}

.zp-startform-card .zp-form-content.zp-startform-inline
{
	padding: 16px 16px 24px;
}

/* the in-card Tweak button is replaced by the bar's "Tweak with AI" (which presses it); its popover
   opens as a bottom sheet */
.zp-startform-card-head .zp-form-tweak-btn
{
	display: none;
}

.zp-startform-card-head .zp-form-tweak-popover
{
	position: fixed;
	top: auto;
	left: 0;
	right: 0;
	bottom: 0;
	width: auto;
	max-height: 75dvh;
	overflow-y: auto;
	border-radius: 16px 16px 0 0;
	z-index: 60;
}


/* "Please answer a few questions" / "Please review and approve the plan" - floats above the bar and
   opens the chat, where the card is */
.zp-m-alert
{
	position: fixed;
	left: 12px;
	right: 12px;
	bottom: calc(76px + env(safe-area-inset-bottom, 0px));
	z-index: 50;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 14px;
	border: 1px solid #d9c8f7;
	border-radius: 14px;
	background: #f4efff;
	box-shadow: 0 10px 28px rgba(60, 40, 120, .22);
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	color: #4c1d95;
	text-align: left;
	cursor: pointer;
}

.zp-m-alert-go
{
	flex: none;
	font-size: 13px;
	font-weight: 600;
	color: #7c3aed;
}

/* the question / plan card, shown in the chat on a phone */
.zp-m-interaction
{
	max-width: none;
	margin: 12px 0;
}

.zp-m-interaction .zp-chat-card
{
	padding: 16px;
	border-radius: 16px;
}


/* "Tweak" sheet */
.zp-m-sheet-backdrop
{
	position: fixed;
	inset: 0;
	z-index: 70;
	display: flex;
	align-items: flex-end;
	background: rgba(20, 12, 50, .45);
}

.zp-m-sheet
{
	width: 100%;
	background: #fff;
	border-radius: 18px 18px 0 0;
	padding: 18px 16px calc(16px + env(safe-area-inset-bottom, 0px));
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.zp-m-sheet-title
{
	font-size: 17px;
	font-weight: 800;
}

.zp-m-sheet-sub
{
	font-size: 13px;
	color: #5b6472;
	line-height: 1.45;
}

.zp-m-sheet textarea
{
	width: 100%;
	border: 1px solid #dcd7ee;
	border-radius: 12px;
	padding: 12px;
	font: inherit;
	font-size: 16px; /* stops iOS zooming on focus */
	resize: none;
}

.zp-m-sheet textarea:focus
{
	outline: none;
	border-color: #7c3aed;
}

.zp-m-sheet-error
{
	font-size: 12px;
	color: #c1392b;
}

.zp-m-sheet-actions
{
	display: flex;
	gap: 8px;
}


/* the desktop dialogs (Publish confirm, version note...) are a fixed 520px */
.zp-modal
{
	width: calc(100% - 32px);
	max-width: 520px;
	max-height: calc(100dvh - 32px);
	overflow-y: auto;
	padding: 20px;
}


/* "<form name> [Kick-off form] v" - names the form on screen; opens the forms drawer */
.zp-m-formbar
{
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	flex-shrink: 0;
	padding: 10px 16px;
	border: 0;
	border-bottom: 1px solid #e2e5ec;
	background: #fff;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.zp-m-formbar-name
{
	flex: 0 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 14px;
	font-weight: 700;
	color: #1a1f26;
}

.zp-m-formbar-tag
{
	flex: none;
	font-size: 10.5px;
	font-weight: 600;
	color: #6d28d9;
	background: #f4efff;
	border-radius: 99px;
	padding: 2px 8px;
}

.zp-m-formbar-caret
{
	flex: none;
	margin: 0 4px 0 -2px;
	font-size: 18px;
	line-height: 1;
	color: #5b6472;
}

/* version sheet actions */
.zp-m-action
{
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 12px;
	border: 1px solid #e2e5ec;
	border-radius: 12px;
	background: #fff;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.zp-m-action[disabled]
{
	opacity: .45;
	cursor: default;
}

.zp-m-action-icon
{
	width: 34px;
	height: 34px;
	flex: none;
	border-radius: 10px;
	background: #f1eafd;
	color: #7c3aed;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 15px;
}

.zp-m-action-primary .zp-m-action-icon
{
	background: #7c3aed;
	color: #fff;
}

.zp-m-action-text
{
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.zp-m-action-text b
{
	font-size: 15px;
	color: #1a1f26;
}

.zp-m-action-text span
{
	font-size: 12px;
	color: #5b6472;
}

/* forms dropdown - opens under the form name row */
.zp-m-formwrap
{
	position: relative;
	flex-shrink: 0;
}

.zp-m-formmenu-backdrop
{
	position: fixed;
	inset: 0;
	z-index: 55;
}

.zp-m-formmenu
{
	position: absolute;
	top: calc(100% + 4px);
	left: 12px;
	right: 12px;
	z-index: 60;
	max-height: 55dvh;
	overflow-y: auto;
	padding: 6px;
	background: #fff;
	border: 1px solid #d1d5db;
	border-radius: 12px;
	box-shadow: 0 16px 40px rgba(20, 12, 50, .22);
}

.zp-m-formmenu-empty
{
	padding: 12px;
	font-size: 13px;
	color: #8b93a1;
}

.zp-m-form-start
{
	align-self: flex-start;
	font-size: 11px;
	font-weight: 700;
	color: #6d28d9;
	background: #f4efff;
	border-radius: 99px;
	padding: 2px 8px;
}

.zp-m-form-row
{
	display: flex;
	flex-direction: column;
	gap: 3px;
	width: 100%;
	padding: 10px 12px;
	border: 0;
	border-radius: 8px;
	background: none;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.zp-m-form-row-on
{
	background: #f1eafd;
}

.zp-m-form-name
{
	font-size: 14px;
	font-weight: 600;
	color: #1a1f26;
}

.zp-m-form-meta
{
	font-size: 12px;
	color: #8b93a1;
}


/* Workflow tab: the canvas fills the screen edge to edge; one finger pans (the container scrolls
   natively), two fingers pinch-zoom (designerMobile.js), so the browser's own pinch is switched off here */
.zp-detail.zp-m-tab-flow .zp-preview-body
{
	padding: 0;
	overflow: hidden;
}

.zp-detail.zp-m-tab-flow .zp-flow-graph
{
	border: 0;
	border-radius: 0;
	box-shadow: none;
	touch-action: pan-x pan-y;
	-webkit-overflow-scrolling: touch;
}

/* zoom control: floats over the canvas, above the bottom bar */
.zp-m-zoom
{
	position: fixed;
	right: 12px;
	bottom: calc(80px + env(safe-area-inset-bottom, 0px));
	z-index: 40;
	display: flex;
	align-items: center;
	gap: 2px;
	padding: 4px;
	background: #fff;
	border: 1px solid #e2e5ec;
	border-radius: 12px;
	box-shadow: 0 8px 20px rgba(20, 12, 50, .16);
}

.zp-m-zoom-btn
{
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 10px;
	background: none;
	color: #3a4150;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.zp-m-zoom-btn:active
{
	background: #f3f0fb;
	color: #7c3aed;
}

/* tapping a step opens its detail: a 640px dialog on desktop, nearly the full screen here */
.zp-component-detail-modal
{
	width: calc(100% - 24px);
	max-height: calc(100dvh - 24px);
}

.zp-component-detail-header
{
	padding: 16px;
}

.zp-component-detail-body
{
	padding: 16px;
}


/* (i) at the right end of the tab strip */
.zp-m-info
{
	margin-left: auto;
	align-self: center;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-right: -8px;
	color: #5b6472;
	cursor: pointer;
}

.zp-m-info:hover,
.zp-m-info-open
{
	color: #7c3aed;
}

.zp-m-info-pop
{
	display: none;
	position: absolute;
	top: calc(100% + 6px);
	right: 12px;
	width: min(280px, calc(100vw - 24px));
	padding: 12px 14px;
	background: #1a1f26;
	color: #fff;
	border-radius: 10px;
	box-shadow: 0 10px 28px rgba(20, 12, 50, .3);
	font-size: 13px;
	font-weight: 400;
	line-height: 1.45;
	text-align: left;
	z-index: 65;
}

.zp-m-info:hover .zp-m-info-pop,
.zp-m-info:focus .zp-m-info-pop,
.zp-m-info-open .zp-m-info-pop
{
	display: block;
}

}
