:root {
	color-scheme: dark;
	--page: #151718;
	--panel: #202324;
	--bar: #1b1e20;
	--field: #191c1e;
	--text: #f5f5f2;
	--muted: #b6b9b8;
	--line: #424644;
	--control-line: #78847d;
	--brand: #dab57c;
	--on-brand: #201b14;
	--link: #a7d3ff;
	--note: #332e22;
	--bad: #ffb6ab;
	--open: #174f86;
	--on-open: #fff;
	--pending: #dfb163;
	--on-pending: #30210d;
	--solution: #a13c39;
	--resolved: #97d7b2;
	--agent-icon: #80a0be;
	--customer-icon: #84a58e;
	--note-icon: #cba561;
	--logo-surface: #232528;
	font: 16px/1.5 Roboto, "Segoe UI", Arial, sans-serif;
}
:root[data-theme=light] {
	color-scheme: light;
	--page: #f3f6f9;
	--panel: #fff;
	--bar: #fff;
	--field: #fff;
	--text: #202624;
	--muted: #52615b;
	--line: #c5d0dc;
	--control-line: #748078;
	--brand: #195a86;
	--on-brand: #fff;
	--link: #16598b;
	--note: #fff7df;
	--bad: #993e29;
	--resolved: #266441;
	--agent-icon: #517491;
	--customer-icon: #567561;
	--note-icon: #906718;
	--logo-surface: #fff;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--text); }
h1, h2, h3, h4, h5, h6, .app-header__brand { font-family: industry, sans-serif; }
h1 {
	margin: 0 0 1.4rem;
	font-size: clamp(1.8rem, 4vw, 2.6rem);
	line-height: 1.14;
	letter-spacing: -.035em;
	overflow-wrap: anywhere;
}
h2 { margin: 0 0 1rem; font-size: 1.15rem; }
a { color: var(--link); }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
[hidden] { display: none !important; }

.shell { width: min(72rem, 100%); padding-inline: clamp(1rem, 4vw, 3rem); margin-inline: auto; }
.shell--content { padding-block: 2.5rem 4rem; }
.panel { padding: 1.25rem; background: var(--panel); border: 1px solid var(--line); border-radius: .65rem; }

.button, .field__control {
	max-width: 100%;
	min-height: 2.625rem;
	padding: .5rem .8rem;
	border: 1px solid var(--control-line);
	border-radius: .4rem;
	background: var(--field);
	color: var(--text);
	font: inherit;
	line-height: 1.4;
}
.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
}
.button--primary { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.button:disabled { opacity: .6; cursor: default; }
.field { display: grid; min-width: 0; gap: .3rem; color: var(--muted); font-size: .9rem; font-weight: 600; }
.field__control { width: 100%; font-weight: 400; }
@media (forced-colors: none) {
	select.field__control {
		appearance: none;
		padding-right: 2.25rem;
		background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
		background-position: right calc(.8rem + .3rem) center, right .8rem center;
		background-size: .3rem .3rem;
		background-repeat: no-repeat;
	}
}
.field__control::placeholder { color: var(--muted); opacity: 1; }
.field__control--multiline { resize: vertical; }
.back-link { display: inline-block; margin-bottom: 1.2rem; }
.back-link, .app-header__account, .ticket-details__label, .ticket-message__kind, .ticket-form__audience {
	color: var(--muted);
	font-size: .9rem;
}

.app-header { background: var(--bar); border-bottom: 1px solid var(--line); }
.app-header__inner, .app-header__brand, .page-heading, .ticket-filters__actions, .ticket-form__actions {
	display: flex;
	align-items: center;
	gap: 1rem;
}
.app-header__inner { min-height: 4.25rem; padding-block: .45rem; flex-wrap: wrap; }
.app-header__brand { margin-inline-end: auto; gap: .8rem; color: var(--text); font-weight: 600; text-decoration: none; }
.app-header__logo { width: 6.5rem; height: 2rem; object-fit: contain; background: var(--logo-surface); border-radius: .3rem; padding: .22rem .4rem; }
.app-header__sign-out { font-size: .9rem; }
.app-header__account { min-width: 0; overflow-wrap: anywhere; }
.app-header__account:empty { display: none; }

.page-heading { justify-content: space-between; margin-bottom: 1.5rem; }
.page-heading__title { margin: 0; }

.ticket-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 1rem; }
.ticket-filters__field--search { flex: 1 1 15rem; }
.ticket-queue__results { margin-top: 1rem; padding: 0; overflow: hidden; }
.ticket-queue__message { display: grid; justify-items: start; gap: .65rem; margin: 0; padding: 1.25rem; }
.ticket-queue__pages { margin-top: 1rem; }

.ticket-list { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ticket-list__heading, .ticket-list__cell { padding: .8rem 1rem; text-align: start; overflow-wrap: anywhere; }
.ticket-list__heading { color: var(--muted); font-size: .83rem; }
.ticket-list__heading--subject { width: 48%; }
.ticket-list__row { border-top: 1px solid var(--line); }
.ticket-list__link { font-weight: 600; }
.ticket-list__label, .ticket-layout__jump { display: none; }
.ticket-list__cell--status .ticket-status { max-width: 100%; white-space: normal; }
.ticket-status {
	display: inline-block;
	padding: .2rem .6rem;
	border: 1px solid var(--line);
	border-radius: 1rem;
	font-size: .83rem;
	font-weight: 600;
	color: var(--text);
	white-space: nowrap;
}
.button--update, .ticket-status--open { background: var(--open); border-color: var(--open); color: var(--on-open); }
.button--question, .ticket-status--pending { background: var(--pending); border-color: var(--pending); color: var(--on-pending); }
.button--solution { background: var(--solution); border-color: var(--solution); color: #fff; }
.ticket-status--resolved { color: var(--resolved); }

.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(15rem, 23%); gap: 1.3rem; }
.ticket-details { align-self: start; }
.ticket-details__value { margin: .12rem 0 1rem; overflow-wrap: anywhere; }
.ticket-details__status-action { width: 100%; margin-top: 1.2rem; }
.ticket-form { display: grid; gap: 1rem; }
.ticket-form__actions { flex-wrap: wrap; }
.ticket-form__reply-buttons { display: flex; flex-wrap: wrap; gap: .5rem; max-width: 100%; }
.ticket-form__actions--reply-as { gap: .5rem; }
.ticket-form__reply-label { margin-inline-end: .25rem; color: var(--muted); }
.ticket-message { padding: 1rem 1.15rem; margin-bottom: .8rem; }
.ticket-message--internal, .ticket-form--internal { background: var(--note); border-inline-start: 3px solid var(--brand); }
.ticket-message__header { display: flex; align-items: flex-start; gap: .55rem; }
.ticket-message__byline { display: grid; min-width: 0; overflow-wrap: anywhere; }
.ticket-message__role-icon {
	flex: 0 0 2.5rem;
	height: 2.5rem;
	margin-top: .125rem;
	background-color: var(--customer-icon);
	mask: url("/icons/account-circle.svg") center / contain no-repeat;
}
.ticket-message__role-icon--agent { background-color: var(--agent-icon); mask-image: url("/icons/face-agent.svg"); }
:where([data-kind=internal]) .ticket-message__role-icon { background-color: var(--note-icon); mask-image: url("/icons/file-lock-outline.svg"); }
@media (forced-colors: active) {
	.ticket-message__role-icon { forced-color-adjust: none; background-color: CanvasText; }
}
.ticket-message__time { color: var(--muted); font-size: .8rem; }
.ticket-message__body { overflow-wrap: anywhere; margin: .6rem 0 0; }
.ticket-message__files { display: flex; flex-wrap: wrap; gap: .4rem; margin: .7rem 0 0; padding: 0; list-style: none; }

.rich-text > :first-child { margin-top: 0; }
.rich-text > :last-child { margin-bottom: 0; }
.rich-text p, .rich-text ul, .rich-text ol { margin: 0 0 .7em; }
.rich-text ul, .rich-text ol { padding-inline-start: 1.6em; }
.rich-text li > p { margin: 0; }
.rich-text img { max-width: 100%; height: auto; vertical-align: bottom; border-radius: .3rem; }
.rich-text a { overflow-wrap: anywhere; }

.composer__label { cursor: default; }
.composer__box { color: var(--text); background: var(--field); border: 1px solid var(--control-line); border-radius: .4rem; font-size: 1rem; font-weight: 400; }
.composer__box:focus-within { outline: 3px solid var(--link); outline-offset: 2px; }
.composer__toolbar { display: flex; flex-wrap: wrap; gap: .15rem; padding: .25rem; border-bottom: 1px solid var(--line); }
.composer__tool {
	display: inline-grid;
	place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	color: var(--text);
	background: none;
	border: 1px solid transparent;
	border-radius: .3rem;
	cursor: pointer;
}
.composer__tool:hover { border-color: var(--line); }
.composer__tool[aria-pressed=true] { color: var(--on-brand); background: var(--brand); }
.composer__tool--group { margin-inline-start: .6rem; }
.composer__icon { width: 1.3rem; height: 1.3rem; background-color: currentColor; mask: var(--icon) center / contain no-repeat; }
.composer__icon--bold { --icon: url("/icons/format-bold.svg"); }
.composer__icon--italic { --icon: url("/icons/format-italic.svg"); }
.composer__icon--link { --icon: url("/icons/link-variant.svg"); }
.composer__icon--bullets { --icon: url("/icons/format-list-bulleted.svg"); }
.composer__icon--numbers { --icon: url("/icons/format-list-numbered.svg"); }
.composer__icon--image { --icon: url("/icons/image-outline.svg"); }
.composer__icon--attach { --icon: url("/icons/paperclip.svg"); }
@media (forced-colors: active) {
	.composer__icon { forced-color-adjust: none; background-color: ButtonText; }
	.composer__tool[aria-pressed=true] { outline: 2px solid Highlight; }
}
.composer__content { min-height: calc(var(--composer-rows) * 1.5em + 1rem); padding: .5rem .8rem; overflow-wrap: anywhere; outline: none; }
.composer__files { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0 .5rem .5rem; list-style: none; }
.composer__files:empty { display: none; }

.file-chip {
	display: inline-flex;
	align-items: center;
	gap: .45rem;
	max-width: 100%;
	min-height: 2rem;
	padding: .2rem .7rem;
	border: 1px solid var(--line);
	border-radius: 1rem;
	font-size: .875rem;
}
.file-chip::before { content: ""; flex: 0 0 1rem; height: 1rem; background-color: var(--muted); mask: url("/icons/paperclip.svg") center / contain no-repeat; }
.file-chip--uploading { color: var(--muted); }
.file-chip__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip__size { flex: none; color: var(--muted); }
.file-chip__remove {
	flex: none;
	width: 1.75rem;
	height: 1.75rem;
	margin-inline-end: -.45rem;
	padding: 0;
	color: var(--text);
	background: none;
	border: 0;
	border-radius: 50%;
	font: inherit;
	font-size: 1.2rem;
	line-height: 1;
	cursor: pointer;
}
.file-chip__remove:hover { background: var(--line); }

.link-dialog { width: min(30rem, calc(100% - 2rem)); color: var(--text); }
.link-dialog::backdrop { background: rgb(0 0 0 / .55); }

.notice, .notice__recovery { display: grid; justify-items: start; gap: .6rem; }
.notice { margin: 0 0 1rem; padding: .8rem 1rem; border-inline-start: 3px solid var(--link); background: var(--panel); }
.notice__text { margin: 0; }
.notice--error { color: var(--bad); border-color: var(--bad); }

@media (max-width: 690px) {
	.shell--content { padding-block: 1.5rem; }
	.app-header__inner, .app-header__brand, .page-heading { gap: .5rem; }
	.app-header__logo { width: 5.4rem; }
	.ticket-filters__field { flex: 1 1 100%; }
	.ticket-layout { grid-template-columns: minmax(0, 1fr); }
	.ticket-layout__jump { display: inline-block; margin-bottom: 1rem; }
	.ticket-list, .ticket-list__body { display: block; }
	.ticket-list__head { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
	.ticket-list__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem 1rem; padding: 1rem; }
	.ticket-list__row:first-child { border-top: 0; }
	.ticket-list__cell { padding: 0; }
	.ticket-list__cell--subject, .ticket-list__cell--status { grid-column: 1 / -1; }
	.ticket-list__label { display: block; color: var(--muted); font-size: .8rem; }
}

@media (max-width: 26rem) {
	.ticket-form--reply { padding-inline: .75rem; }
	.ticket-form__reply-buttons { gap: .25rem; }
	.ticket-form__reply-buttons .button { padding-inline: .25rem; font-size: .875rem; }
}

@media (max-width: 34rem) {
	.app-header__inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
	.app-header__inner:has(.app-header__account:not(:empty)) .app-header__brand { grid-column: 1 / -1; }
}
