/* === CSS: pflow-service.css [root] === */
:root {
	--bg: #f4f6f8;
	--panel: #ffffff;
	--text: #17202a;
	--muted: #637082;
	--line: #d9e0e8;
	--line-strong: #bfccd9;
	--primary: #165dff;
	--primary-dark: #0f46c5;
	--green: #217a4b;
	--orange: #b36200;
	--red: #c93232;
	--cyan: #08748a;
	--radius: 8px;
	--shadow: 0 18px 45px rgba(25, 35, 50, .08);
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	line-height: 1.45;
}

a {
	color: var(--primary);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

code {
	display: inline-block;
	max-width: 100%;
	overflow-wrap: anywhere;
	background: #101820;
	color: #e9eef4;
	border-radius: 6px;
	padding: 3px 6px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 12px;
}

.app-header {
	position: sticky;
	top: 0;
	z-index: 10;
	min-height: 68px;
	display: flex;
	align-items: center;
	gap: 18px;
	padding: 10px 22px;
	background: rgba(255, 255, 255, .96);
	border-bottom: 1px solid var(--line);
	backdrop-filter: blur(12px);
}

.brand-mark {
	display: inline-flex;
	align-items: center;
	width: 170px;
	min-width: 140px;
	height: 46px;
}

.brand-mark img {
	max-width: 100%;
	max-height: 44px;
	object-fit: contain;
}

.app-nav {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-wrap: wrap;
}

.app-nav a {
	display: inline-flex;
	align-items: center;
	min-height: 38px;
	padding: 8px 11px;
	border-radius: 6px;
	color: #263242;
	font-size: 14px;
	font-weight: 700;
}

.app-nav a.active,
.app-nav a:hover {
	background: #edf3ff;
	color: var(--primary-dark);
	text-decoration: none;
}

.userbar {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--muted);
	font-size: 14px;
	white-space: nowrap;
}

.app-main {
	width: min(1480px, calc(100% - 32px));
	margin: 0 auto;
	padding: 26px 0 60px;
}

.is-auth .app-header {
	position: static;
	justify-content: center;
}

.is-public .app-header {
	position: static;
	justify-content: flex-start;
}

.public-userbar {
	margin-left: auto;
	display: flex;
	align-items: center;
}

.is-auth .app-main,
.is-public .app-main {
	width: min(980px, calc(100% - 24px));
}

.page-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 18px;
	margin: 0 0 18px;
}

h1,
h2,
h3,
p {
	margin-top: 0;
}

h1 {
	font-size: 28px;
	line-height: 1.15;
	margin-bottom: 6px;
}

h2 {
	font-size: 18px;
	line-height: 1.25;
	margin-bottom: 14px;
}

h3 {
	font-size: 15px;
	margin: 20px 0 10px;
}

.muted,
small {
	color: var(--muted);
}

.panel,
.auth-panel,
.public-panel {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 22px;
}

.panel + .panel,
.ticket-layout + .panel {
	margin-top: 18px;
}

.auth-shell,
.public-shell {
	min-height: calc(100vh - 170px);
	display: grid;
	place-items: center;
	padding: 28px 0;
}

.auth-panel,
.public-panel {
	width: min(460px, 100%);
}

.public-panel.wide {
	width: min(620px, 100%);
}

.auth-logo {
	display: block;
	max-width: 190px;
	max-height: 58px;
	margin-bottom: 22px;
	object-fit: contain;
}

.auth-divider {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 18px 0;
	color: var(--muted);
	font-size: 13px;
	font-weight: 900;
	text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
	content: "";
	height: 1px;
	flex: 1;
	background: var(--line);
}

.btn {
	appearance: none;
	border: 1px solid transparent;
	border-radius: 6px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 40px;
	padding: 9px 13px;
	font: inherit;
	font-size: 14px;
	font-weight: 800;
	cursor: pointer;
	text-decoration: none;
	white-space: nowrap;
}

.btn:hover {
	text-decoration: none;
}

.btn-primary {
	background: var(--primary);
	border-color: var(--primary);
	color: #fff;
}

.btn-primary:hover {
	background: var(--primary-dark);
	border-color: var(--primary-dark);
}

.btn-light {
	background: #fff;
	border-color: var(--line-strong);
	color: #263242;
}

.btn-light:hover {
	background: #f5f8fb;
}

.btn-success {
	background: var(--green);
	border-color: var(--green);
	color: #fff;
}

.btn-danger {
	background: var(--red);
	border-color: var(--red);
	color: #fff;
}

.btn-info {
	background: var(--cyan);
	border-color: var(--cyan);
	color: #fff;
}

.btn-sm {
	min-height: 32px;
	padding: 6px 9px;
	font-size: 13px;
}

.btn.full {
	width: 100%;
	margin-top: 10px;
}

.form-stack {
	display: grid;
	gap: 14px;
}

.form-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
}

.priority-field {
	grid-column: 1 / -1;
	display: grid;
	grid-template-columns: minmax(220px, .85fr) minmax(280px, 1.15fr);
	align-items: end;
	gap: 14px;
}

.project-form {
	display: grid;
	gap: 18px;
}

label {
	display: grid;
	gap: 7px;
	font-size: 14px;
	font-weight: 800;
}

input,
select,
textarea {
	width: 100%;
	min-height: 40px;
	border: 1px solid #c8d2df;
	border-radius: 6px;
	background: #fff;
	padding: 10px 11px;
	font: inherit;
	color: var(--text);
	transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

select {
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
	padding-right: 38px;
	background-color: #fff;
	background-image:
		linear-gradient(45deg, transparent 50%, #637082 50%),
		linear-gradient(135deg, #637082 50%, transparent 50%),
		linear-gradient(to right, #e4eaf1, #e4eaf1);
	background-position:
		calc(100% - 18px) 50%,
		calc(100% - 12px) 50%,
		calc(100% - 34px) 50%;
	background-size:
		6px 6px,
		6px 6px,
		1px 22px;
	background-repeat: no-repeat;
	box-shadow: 0 1px 0 rgba(23, 32, 42, .03);
}

select:hover {
	border-color: #9fafc0;
	background-color: #fbfdff;
}

textarea {
	resize: vertical;
	min-height: 130px;
}

input:focus,
select:focus,
textarea:focus {
	outline: 3px solid rgba(22, 93, 255, .16);
	border-color: var(--primary);
	box-shadow: 0 4px 14px rgba(22, 93, 255, .08);
}

.priority-meter {
	--priority-color: var(--red);
	--priority-bg: #fff3f0;
	--priority-fill: 64%;
	min-height: 60px;
	border: 1px solid color-mix(in srgb, var(--priority-color) 38%, #ffffff);
	border-radius: 8px;
	background: var(--priority-bg);
	padding: 12px;
	display: grid;
	grid-template-columns: minmax(110px, 180px) minmax(0, 1fr);
	align-items: center;
	gap: 12px;
	transition: min-height .18s ease, padding .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.priority-meter-bar {
	height: 32px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .75);
	box-shadow: inset 0 0 0 1px rgba(23, 32, 42, .12);
	overflow: hidden;
}

.priority-meter-bar span {
	display: block;
	width: var(--priority-fill);
	height: 100%;
	border-radius: inherit;
	background: var(--priority-color);
	box-shadow: 0 8px 22px color-mix(in srgb, var(--priority-color) 26%, transparent);
	transition: width .18s ease, background .18s ease;
}

.priority-meter-copy {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.priority-meter-copy strong {
	font-size: 15px;
	line-height: 1.2;
}

.priority-meter-copy small {
	font-size: 12px;
	line-height: 1.35;
}

.priority-meter[data-priority="low"] {
	--priority-color: var(--green);
	--priority-bg: #eef8f2;
	--priority-fill: 30%;
}

.priority-meter[data-priority="medium"] {
	--priority-color: var(--orange);
	--priority-bg: #fff6e8;
	--priority-fill: 48%;
}

.priority-meter[data-priority="high"] {
	--priority-color: var(--red);
	--priority-bg: #fff1ed;
	--priority-fill: 66%;
}

.priority-meter[data-priority="very_high"] {
	--priority-color: #d4451f;
	--priority-bg: #fff0e8;
	--priority-fill: 84%;
	min-height: 76px;
	padding: 14px;
	box-shadow: 0 0 0 4px rgba(212, 69, 31, .08);
}

.priority-meter[data-priority="very_high"] .priority-meter-bar {
	height: 42px;
}

.priority-meter[data-priority="very_high"] .priority-meter-copy strong {
	font-size: 17px;
}

.priority-meter[data-priority="insane"] {
	--priority-color: var(--red);
	--priority-bg: #ffe8e8;
	--priority-fill: 100%;
	min-height: 96px;
	padding: 16px;
	border-color: var(--red);
	box-shadow: 0 0 0 5px rgba(201, 50, 50, .14), 0 18px 40px rgba(201, 50, 50, .12);
}

.priority-meter[data-priority="insane"] .priority-meter-bar {
	height: 54px;
}

.priority-meter[data-priority="insane"] .priority-meter-copy strong {
	font-size: 19px;
}

.input-control,
.password-control {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 6px;
}

.password-control {
	grid-template-columns: minmax(0, 1fr) auto auto;
}

.input-control input,
.password-control input {
	min-width: 0;
}

.input-tool {
	appearance: none;
	min-width: 42px;
	border: 1px solid #c8d2df;
	border-radius: 6px;
	background: #fff;
	color: var(--text);
	font: inherit;
	font-size: 13px;
	font-weight: 900;
	cursor: pointer;
	padding: 0 10px;
}

.input-tool:hover {
	background: #f5f8fb;
}

.checkline {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 700;
}

.checkline input[type="checkbox"],
.checkbox-list input[type="checkbox"] {
	appearance: none;
	-webkit-appearance: none;
	position: relative;
	flex: 0 0 46px;
	width: 46px;
	min-width: 46px;
	height: 26px;
	min-height: 26px;
	margin: 0;
	padding: 0;
	border: 1px solid #bdc8d4;
	border-radius: 999px;
	background: #dce3eb;
	cursor: pointer;
	box-shadow: inset 0 1px 2px rgba(23, 32, 42, .12);
	transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.checkline input[type="checkbox"]::before,
.checkbox-list input[type="checkbox"]::before {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 6px rgba(23, 32, 42, .22);
	transition: transform .18s ease;
}

.checkline input[type="checkbox"]:checked,
.checkbox-list input[type="checkbox"]:checked {
	border-color: var(--green);
	background: var(--green);
	box-shadow: inset 0 1px 2px rgba(23, 32, 42, .08), 0 0 0 1px rgba(33, 122, 75, .08);
}

.checkline input[type="checkbox"]:checked::before,
.checkbox-list input[type="checkbox"]:checked::before {
	transform: translateX(20px);
}

.checkline input[type="checkbox"]:focus,
.checkbox-list input[type="checkbox"]:focus {
	outline: 3px solid rgba(22, 93, 255, .16);
	outline-offset: 2px;
}

.switch-grid,
.checkbox-list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px 16px;
}

.settings-grid {
	display: grid;
	grid-template-columns: repeat(5, minmax(120px, 1fr));
	gap: 12px;
}

.settings-disclosure summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	cursor: pointer;
	font-size: 16px;
	font-weight: 900;
	list-style-position: outside;
}

.settings-disclosure summary span {
	display: grid;
	gap: 4px;
}

.settings-disclosure summary small {
	font-size: 13px;
	font-weight: 600;
}

.settings-disclosure[open] summary {
	padding-bottom: 16px;
	border-bottom: 1px solid var(--line);
	margin-bottom: 18px;
}

.system-settings-form code {
	display: inline-block;
	max-width: 100%;
	overflow-wrap: anywhere;
}

.form-grid.compact {
	grid-template-columns: repeat(2, minmax(160px, 1fr));
}

.offer-reply-box {
	display: grid;
	gap: 12px;
	border: 1px solid #f2b84b;
	border-left: 5px solid #f09a22;
	border-radius: 8px;
	background: #fff8e8;
	padding: 14px;
}

.offer-reply-box legend {
	padding: 0 6px;
	font-weight: 950;
	color: #7a4300;
}

.offer-reply-box .badge {
	justify-self: start;
}

.checkbox-list label {
	display: flex;
	align-items: center;
	gap: 8px;
	border: 1px solid var(--line);
	border-radius: 6px;
	padding: 9px 10px;
	font-weight: 700;
}

.form-actions,
.inline-actions,
.head-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-bottom: 14px;
}

.tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.tabs a {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 7px 11px;
	border: 1px solid var(--line);
	border-radius: 6px;
	color: #263242;
	background: #fff;
	font-weight: 800;
	font-size: 14px;
}

.tabs a.active {
	background: #edf3ff;
	border-color: #b8ccff;
	color: var(--primary-dark);
}

.filter-form {
	display: flex;
	align-items: center;
	gap: 8px;
}

.table-wrap {
	width: 100%;
	overflow-x: auto;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: #fff;
}

.data-table {
	width: 100%;
	border-collapse: collapse;
	min-width: 940px;
}

.data-table th,
.data-table td {
	padding: 12px 13px;
	border-bottom: 1px solid var(--line);
	text-align: left;
	vertical-align: top;
}

.data-table th {
	background: #f8fafc;
	font-size: 12px;
	text-transform: uppercase;
	color: var(--muted);
}

.data-table tr:last-child td {
	border-bottom: 0;
}

.ticket-main {
	min-width: 300px;
}

.offer-cell {
	min-width: 170px;
}

.offer-summary {
	display: grid;
	gap: 5px;
	align-content: start;
}

.offer-summary strong {
	display: block;
	font-size: 14px;
	color: var(--text);
}

.offer-summary small {
	color: var(--muted);
	font-weight: 800;
}

.offer-summary.compact strong {
	font-size: 13px;
}

.offer-notice {
	display: grid;
	gap: 8px;
}

.offer-notice .offer-summary {
	grid-template-columns: auto 1fr;
	align-items: center;
	column-gap: 10px;
}

.offer-notice .offer-summary small {
	grid-column: 2;
}

.ticket-main strong,
.ticket-main span,
.ticket-main small {
	display: block;
}

.quick-form {
	display: grid;
	grid-template-columns: minmax(130px, 1fr) minmax(150px, 1fr) minmax(130px, 1fr) auto;
	gap: 8px;
	align-items: center;
	min-width: 560px;
}

.badge {
	display: inline-flex;
	align-items: center;
	min-height: 26px;
	border-radius: 999px;
	padding: 3px 9px;
	font-size: 12px;
	font-weight: 900;
	border: 1px solid transparent;
	white-space: nowrap;
}

.badge-neutral {
	background: #eef1f4;
	color: #4b5968;
}

.badge-success {
	background: #e9f7ef;
	color: var(--green);
	border-color: #bfe5ce;
}

.badge-warning {
	background: #fff5e5;
	color: var(--orange);
	border-color: #f2d2a6;
}

.badge-danger {
	background: #fff0f0;
	color: var(--red);
	border-color: #efb8b8;
}

.badge-panic {
	background: #220607;
	color: #fff;
	border-color: #ff4d4d;
}

.badge-info {
	background: #e8f7fa;
	color: var(--cyan);
	border-color: #b8e1e8;
}

.alert {
	border-radius: 6px;
	border: 1px solid var(--line);
	padding: 13px 14px;
	margin-bottom: 16px;
}

.alert-success {
	background: #eefaf3;
	border-color: #b8e3c8;
	color: #134d2c;
}

.alert-warning {
	background: #fff8e8;
	border-color: #eed49b;
	color: #744500;
}

.alert-danger {
	background: #fff0f0;
	border-color: #efb8b8;
	color: #7c1717;
}

.toast-stack {
	position: fixed;
	z-index: 1000;
	top: 18px;
	right: 18px;
	display: grid;
	gap: 10px;
	width: min(420px, calc(100vw - 36px));
	pointer-events: none;
}

.toast {
	border: 1px solid var(--line);
	border-radius: 8px;
	padding: 13px 15px;
	background: #fff;
	box-shadow: 0 18px 45px rgba(25, 35, 50, .16);
	font-size: 14px;
	font-weight: 800;
	line-height: 1.35;
	transform: translateY(-8px);
	opacity: 0;
	animation: toast-in .18s ease forwards;
	transition: opacity .22s ease, transform .22s ease;
}

.toast.is-hiding {
	opacity: 0;
	transform: translateY(-8px);
}

.toast-success {
	background: #eefaf3;
	border-color: #b8e3c8;
	color: #134d2c;
}

.toast-warning {
	background: #fff8e8;
	border-color: #eed49b;
	color: #744500;
}

.toast-danger {
	background: #fff0f0;
	border-color: #efb8b8;
	color: #7c1717;
}

@keyframes toast-in {
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.empty-state {
	padding: 28px;
	text-align: center;
	color: var(--muted);
}

.split-layout,
.ticket-layout {
	display: flex;
	align-items: flex-start;
	gap: 18px;
}

.grow {
	flex: 1 1 auto;
	min-width: 0;
}

.side-panel {
	width: 340px;
	flex: 0 0 340px;
}

.meta-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	margin-bottom: 18px;
}

.meta-grid div {
	border: 1px solid var(--line);
	border-radius: 6px;
	padding: 10px 12px;
	min-width: 0;
}

.meta-grid span {
	display: block;
	color: var(--muted);
	font-size: 12px;
	font-weight: 800;
	text-transform: uppercase;
	margin-bottom: 4px;
}

.meta-grid strong,
.meta-grid small {
	display: block;
	overflow-wrap: anywhere;
}

.message-body {
	white-space: normal;
	overflow-wrap: anywhere;
}

.timeline {
	display: grid;
	gap: 12px;
}

.timeline-item {
	border: 1px solid var(--line);
	border-radius: 6px;
	padding: 14px;
	background: #fff;
}

.timeline-item.staff {
	border-left: 4px solid var(--primary);
}

.timeline-item.internal_note,
.timeline-item.is-internal {
	border-left: 4px solid var(--text);
	background: #f8fafc;
}

.timeline-item.customer,
.timeline-item.email {
	border-left: 4px solid var(--orange);
}

.timeline-item header {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
	color: var(--muted);
}

.internal-badge {
	display: inline-flex;
	align-items: center;
	margin-left: 8px;
	border: 1px solid var(--line);
	border-radius: 999px;
	padding: 2px 8px;
	color: var(--text);
	background: #fff;
	font-size: 12px;
	font-weight: 700;
}

.attachment-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}

.attachment {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border: 1px solid var(--line);
	border-radius: 6px;
	padding: 7px 9px;
	background: #f8fafc;
	font-size: 13px;
	font-weight: 800;
}

.attachment span {
	color: var(--muted);
	font-weight: 700;
}

.back-link {
	display: inline-block;
	margin-bottom: 8px;
	color: var(--muted);
	font-weight: 800;
}

.public-ticket {
	padding: 18px 0 46px;
}

.public-head {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 18px;
}

.public-head img {
	width: 170px;
	max-height: 54px;
	object-fit: contain;
}

.ticket-form {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 22px;
	display: grid;
	gap: 16px;
}

.ticket-form.priority-insane {
	border-color: var(--red);
	box-shadow: 0 0 0 4px rgba(201, 50, 50, .13), var(--shadow);
}

.panic-note {
	display: none;
	border: 1px solid #efb8b8;
	border-radius: 6px;
	background: #fff0f0;
	color: #7c1717;
	padding: 12px 14px;
	font-weight: 900;
}

.ticket-form.priority-insane .panic-note {
	display: block;
}

.hp-field {
	position: absolute;
	left: -10000px;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.quote-box {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px 14px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 16px;
	margin: 18px 0;
}

.quote-box span {
	color: var(--muted);
	font-weight: 800;
}

.quote-box strong {
	font-size: 20px;
}

@media (max-width: 980px) {
	.app-header {
		align-items: flex-start;
		flex-wrap: wrap;
	}
	.userbar {
		margin-left: 0;
		width: 100%;
		justify-content: space-between;
	}
	.toolbar,
	.split-layout,
	.ticket-layout {
		flex-direction: column;
	}
	.side-panel {
		width: 100%;
		flex-basis: auto;
	}
	.switch-grid,
	.checkbox-list,
	.meta-grid,
	.settings-grid,
	.priority-field {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 720px) {
	.app-main {
		width: min(100% - 20px, 1480px);
		padding-top: 18px;
	}
	.page-head,
	.public-head {
		flex-direction: column;
	}
	.form-grid,
	.form-grid.compact {
		grid-template-columns: 1fr;
	}
	.quick-form {
		grid-template-columns: 1fr;
		min-width: 280px;
	}
	.filter-form {
		width: 100%;
		align-items: stretch;
		flex-direction: column;
	}
	.btn {
		white-space: normal;
	}
}

/* === CSS: z-htmx-confirm.css [core] === */
.confirm-modal[hidden]{ display:none; }
  .confirm-modal{ position:fixed; inset:0; z-index:9999; }
  .confirm-modal__backdrop{ position:absolute; inset:0; background:rgba(0,0,0,.5); }
  .confirm-modal__panel{
    position:relative; margin:auto; top:30vh; max-width:520px; width:calc(100% - 2rem);
    background:#111; color:#fff; border-radius:12px;
  corner-shape: superellipse(1.5); padding:1.25rem; box-shadow:0 10px 40px rgba(0,0,0,.4);
  }
  .confirm-modal__title{ margin:0 0 .5rem; font-size:1.125rem; }
.confirm-modal__text{ margin:0 0 1rem; opacity:.9; white-space:pre-wrap; }
  .confirm-modal__actions{ display:flex; gap:.5rem; justify-content:flex-end; }
  .btn{ padding:.6rem .9rem; border-radius:.6rem;
  corner-shape: superellipse(1.5); border:0; cursor:pointer; }
  .btn--ghost{ background:transparent; color:#fff; outline:1px solid rgba(255,255,255,.25); }
  .btn--danger{ background:#e5484d; color:#fff; }

/* === CSS: z-nsb-box.css [core] === */
#nsbbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  background: rgba(10, 8, 12, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

#nsbbox.open {
  display: flex;
}

#nsbbox .nsb-media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(92vw, 1280px);
  max-width: 100%;
  max-height: calc(100vh - 8rem);
}

#nsbbox img,
#nsbbox iframe {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 8rem);
  border: 0;
  border-radius: 1rem;
  corner-shape: superellipse(1.5);
  background: #0b0b0d;
  box-shadow: 0 1.25rem 4rem rgba(0, 0, 0, 0.45);
}

#nsbbox img {
  width: auto;
  height: auto;
  object-fit: contain;
}

#nsbbox iframe {
  width: min(92vw, 1280px);
  height: min(80vh, 820px);
}

#nsbbox .nsb-caption {
  position: absolute;
  left: 50%;
  bottom: 1.35rem;
  transform: translateX(-50%);
  max-width: min(90vw, 900px);
  margin: 0;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  corner-shape: superellipse(1.5);
  background: rgba(9, 9, 12, 0.72);
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.4;
  text-align: center;
}

#nsbbox .nsb-close,
#nsbbox .nsb-prev,
#nsbbox .nsb-next {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(12, 12, 16, 0.82);
  color: #fff;
  cursor: pointer;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1;
  text-align: center;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

#nsbbox .nsb-close:hover,
#nsbbox .nsb-prev:hover,
#nsbbox .nsb-next:hover {
  transform: scale(1.06);
  background: rgba(24, 24, 30, 0.96);
  border-color: rgba(255, 255, 255, 0.36);
}

#nsbbox .nsb-close {
  top: 1.5rem;
  right: 1.5rem;
  font-size: 1.6rem;
  padding-top: 2px;
}

#nsbbox .nsb-prev,
#nsbbox .nsb-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  padding-bottom: 5px;
}

#nsbbox .nsb-prev:hover,
#nsbbox .nsb-next:hover {
  transform: translateY(-50%) scale(1.06);
}

#nsbbox .nsb-prev {
  left: 1.5rem;
  padding-right: 2px;
}

#nsbbox .nsb-next {
  right: 1.5rem;
  padding-left: 4px;
}

#nsbbox.nsbbox--iframe .nsb-prev,
#nsbbox.nsbbox--iframe .nsb-next {
  display: none;
}

#nsbbox.fade-out .nsb-media > * {
  opacity: 0;
  transform: translateX(var(--dir, 0));
}

#nsbbox .nsb-media > * {
  transition: opacity 280ms ease, transform 280ms ease;
}

@media (max-width: 900px) {
  #nsbbox {
    padding: 1rem;
  }

  #nsbbox .nsb-media,
  #nsbbox img,
  #nsbbox iframe {
    max-height: calc(100vh - 6.5rem);
  }

  #nsbbox .nsb-prev,
  #nsbbox .nsb-next {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.5rem;
  }

  #nsbbox .nsb-prev {
    left: 0.75rem;
  }

  #nsbbox .nsb-next {
    right: 0.75rem;
  }

  #nsbbox .nsb-close {
    top: 0.75rem;
    right: 0.75rem;
  }

  #nsbbox .nsb-caption {
    bottom: 0.85rem;
    font-size: 0.88rem;
    padding: 0.6rem 0.85rem;
  }
}

/* === CSS: zz-anim-preview.css [core] === */
#slow-anim * {
  transition-duration: 2.5s !important;
}

