/* ==========================================================================
   Xennial — applications, part one
   Control Panel · Away Messages · Things We Were Promised
   ========================================================================== */

.app-head {
	margin: 0 0 18px;
	padding-bottom: 13px;
	border-bottom: 1px dashed var(--line);
}

.app-head--row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
}

.app-head--row .btn {
	flex: 0 0 auto;
	margin-top: 2px;
}

.app-head__title {
	margin: 0 0 5px;
	color: #26231e;
	font-family: var(--px);
	font-size: 17px;
	line-height: 1.35;
}

.app-head__sub {
	margin: 0;
	max-width: 62ch;
	color: var(--muted);
	font-family: var(--serif);
	font-size: 13.5px;
	font-style: italic;
	line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Control Panel
   -------------------------------------------------------------------------- */

.ctl {
	margin: 0 0 15px;
}

.ctl__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 4px;
}

.ctl__row label,
.ctl--select > label {
	color: #2f2b25;
	font-size: 12.5px;
	font-weight: 600;
	letter-spacing: 0.01em;
}

.ctl__row output {
	min-width: 48px;
	padding: 2px 6px;
	border: 1px solid #a8a192;
	background: #fffdf6;
	box-shadow: var(--bevel-in);
	color: var(--teal-deep);
	font-family: var(--px);
	font-size: 10px;
	text-align: right;
}

.range {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 22px;
	margin: 0;
	background: transparent;
	cursor: pointer;
}

.range::-webkit-slider-runnable-track {
	height: 18px;
	border: 1px solid #7c766a;
	background:
		repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 2px, transparent 2px 11px),
		linear-gradient(90deg, var(--teal) 0 var(--fill, 50%), #cec8ba var(--fill, 50%) 100%);
	box-shadow: var(--bevel-in);
}

.range::-moz-range-track {
	height: 18px;
	border: 1px solid #7c766a;
	background:
		repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 2px, transparent 2px 11px),
		linear-gradient(90deg, var(--teal) 0 var(--fill, 50%), #cec8ba var(--fill, 50%) 100%);
	box-shadow: var(--bevel-in);
}

.range::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 15px;
	height: 22px;
	margin-top: -3px;
	border: 1px solid #5d584e;
	border-radius: 1px;
	background: linear-gradient(180deg, #f8f4ea, #d2ccbf);
	box-shadow: var(--bevel);
}

.range::-moz-range-thumb {
	width: 14px;
	height: 21px;
	border: 1px solid #5d584e;
	border-radius: 1px;
	background: linear-gradient(180deg, #f8f4ea, #d2ccbf);
	box-shadow: var(--bevel);
}

.range:focus-visible {
	outline: 2px solid #ffd27a;
	outline-offset: 3px;
}

.ctl__hint {
	margin: 3px 0 0;
	color: #81796c;
	font-family: var(--serif);
	font-size: 11px;
	font-style: italic;
	line-height: 1.4;
}

.ctl--select {
	margin-top: 20px;
}

.ctl--select > label {
	display: block;
	margin-bottom: 5px;
}

.select-wrap {
	position: relative;
}

.select-wrap::after {
	content: "▼";
	position: absolute;
	top: 50%;
	right: 9px;
	translate: 0 -50%;
	color: var(--teal-deep);
	font-size: 7px;
	pointer-events: none;
}

.select-wrap select {
	width: 100%;
	height: 36px;
	padding: 0 28px 0 9px;
	border: 1px solid #7c766a;
	border-radius: 1px;
	appearance: none;
	background: linear-gradient(180deg, #fffdf6, #ece7db);
	box-shadow: var(--bevel);
	color: var(--ink);
	font-size: 12.5px;
}

.ctl-group {
	margin: 20px 0 0;
	padding: 14px 0 4px;
	border: 0;
	border-top: 1px dashed var(--line);
}

.ctl-group legend {
	padding: 0 8px 0 0;
	color: var(--teal);
	font-family: var(--px);
	font-size: 9px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.chk {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 9px;
	padding: 5px 0;
	color: #3a352e;
	font-size: 12.5px;
	line-height: 1.4;
	cursor: pointer;
}

.chk input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.chk__box {
	position: relative;
	flex: 0 0 auto;
	width: 17px;
	height: 17px;
	margin-top: 1px;
	border: 1px solid #7c766a;
	background: #fffdf6;
	box-shadow: var(--bevel-in);
}

.chk input:checked + .chk__box {
	background: linear-gradient(180deg, #2f857e, #1e625d);
	box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.2), inset -1px -1px 0 rgba(255, 255, 255, 0.18);
}

.chk input:checked + .chk__box::after {
	content: "✓";
	position: absolute;
	inset: -1px;
	display: grid;
	place-items: center;
	color: #fffdf6;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
}

.chk input:focus-visible + .chk__box {
	outline: 2px solid #ffd27a;
	outline-offset: 2px;
}

.chk small {
	color: #8a8274;
	font-family: var(--serif);
	font-size: 10.5px;
	font-style: italic;
}

.chk--disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.ctl__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 9px;
	margin-top: 20px;
	padding-top: 15px;
	border-top: 1px solid var(--line);
}

.ctl__actions .linkish {
	margin-left: auto;
	font-size: 10.5px;
}

.ctl__status {
	margin: 14px 0 0;
	padding: 8px 10px;
	border-left: 3px solid var(--gold);
	background: #eee7d5;
	color: #5c5138;
	font-family: var(--serif);
	font-size: 12px;
	font-style: italic;
	line-height: 1.45;
}

.ctl__ignored {
	margin: 6px 0 0;
	color: #8b8375;
	font-size: 10px;
	letter-spacing: 0.03em;
}

.ctl__ignored span {
	color: var(--rust);
	font-family: var(--px);
	font-size: 9px;
}

/* --------------------------------------------------------------------------
   Away messages
   -------------------------------------------------------------------------- */

.mood-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-bottom: 16px;
}

.mood-tab {
	height: 31px;
	padding: 0 12px;
	border: 1px solid #8d8679;
	border-radius: 2px 2px 0 0;
	background: linear-gradient(180deg, #eae5d8, #d2ccbf);
	box-shadow: inset 1px 1px 0 #fffdf6, inset -1px 0 0 #b0a99b;
	color: #4b463d;
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.mood-tab:hover {
	background: linear-gradient(180deg, #f6f2e8, #ddd7ca);
}

.mood-tab.is-active {
	border-color: var(--teal-deep);
	background: linear-gradient(180deg, #2f857e, #1e625d);
	box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.22), inset -1px -1px 0 rgba(0, 0, 0, 0.2);
	color: #f9f5ea;
}

.away-stage {
	max-width: 580px;
	margin: 0 auto;
}

.aim {
	border: 1px solid #5a554b;
	border-radius: 2px;
	background: #fbf7ed;
	box-shadow: 0 10px 26px rgba(48, 38, 22, 0.16), var(--bevel);
	overflow: hidden;
}

.aim__bar {
	display: flex;
	align-items: center;
	height: 27px;
	padding: 0 8px 0 10px;
	background:
		repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 3px),
		linear-gradient(180deg, #3f7f78, #24534f);
	color: #f5f2e7;
}

.aim__app {
	flex: 1 1 auto;
	font-family: var(--px);
	font-size: 8px;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

.aim__btns {
	display: flex;
	gap: 3px;
}

.aim__btns i {
	display: block;
	width: 13px;
	height: 13px;
	border: 1px solid #5f5a50;
	background: linear-gradient(#f2eee4, #d2ccbf);
	box-shadow: var(--bevel);
}

.aim__body {
	padding: 18px 20px 16px;
	background:
		radial-gradient(circle at 90% 10%, rgba(189, 146, 44, 0.08), transparent 40%),
		#fbf7ed;
}

.aim__id {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 14px;
}

.aim__avatar {
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	width: 38px;
	height: 38px;
	border: 1px solid #4d483f;
	background:
		linear-gradient(135deg, #2f857e 0 50%, #216f69 50% 100%);
	box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.3), inset -1px -1px 0 rgba(0, 0, 0, 0.25);
	color: #f8f4e9;
	font-family: var(--px);
	font-size: 17px;
}

.aim__who {
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
}

.aim__who strong {
	font-size: 12.5px;
	letter-spacing: 0.02em;
}

.aim__presence {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	color: #7c6a3c;
	font-size: 10px;
}

.aim__time {
	margin-left: auto;
	color: #8c8476;
	font-family: var(--serif);
	font-size: 10.5px;
	font-style: italic;
	white-space: nowrap;
}

.aim__msg {
	min-height: 86px;
	margin: 0;
	padding-left: 14px;
	border-left: 3px solid var(--gold);
	color: #2b2721;
	font-family: var(--serif);
	font-size: 20px;
	font-style: italic;
	line-height: 1.5;
	display: flex;
	align-items: center;
}

.aim__msg.is-changing {
	animation: msgFlicker 0.32s steps(3, end);
}

@keyframes msgFlicker {
	0% { opacity: 0; translate: 0 3px; }
	40% { opacity: 0.5; }
	70% { opacity: 0.2; }
	100% { opacity: 1; translate: 0; }
}

.aim__mood {
	margin: 14px 0 0;
	color: #8a8172;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.aim__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 7px 11px;
	border-top: 1px dashed #c9c1b1;
	background: #f1ebdd;
	color: #8a8172;
	font-size: 10px;
}

.aim__cursor {
	color: var(--teal);
	font-size: 11px;
	animation: cursorBlink 1.1s steps(1, end) infinite;
}

@keyframes cursorBlink {
	0%, 49% { opacity: 1; }
	50%, 100% { opacity: 0; }
}

.away-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 16px;
}

.away-controls .btn {
	flex: 1 1 auto;
}

.away-custom {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	margin: 18px 0 5px;
	color: #5d574c;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.away-count {
	color: #8b8375;
	font-family: var(--mono);
	font-size: 9.5px;
	letter-spacing: 0;
}

.away-note {
	margin: 14px 0 2px;
	color: #6a6358;
	font-family: var(--serif);
	font-size: 12px;
	font-style: italic;
}

.away-fine {
	margin: 0;
	color: #8b8375;
	font-size: 10px;
}

/* --------------------------------------------------------------------------
   Things We Were Promised
   -------------------------------------------------------------------------- */

.pathbar {
	margin: 0 0 14px;
	padding: 5px 9px;
	border: 1px solid #a8a192;
	background: #ece7db;
	box-shadow: var(--bevel-in);
	color: #655f54;
	font-family: var(--mono);
	font-size: 10px;
	letter-spacing: 0.01em;
}

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

.pathbar__hint {
	color: #8b8375;
	font-family: var(--serif);
	font-size: 10.5px;
	font-style: italic;
}

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

.promise-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-height: 190px;
	padding: 13px 14px 12px;
	border: 1px solid #b8b0a0;
	border-top: 3px solid var(--teal);
	border-radius: 1px;
	background: #fbf7ed;
	box-shadow: inset 1px 1px 0 #fffdf6, 0 2px 0 rgba(90, 80, 60, 0.08);
	color: var(--ink);
	text-align: left;
	transition: translate 0.15s ease, box-shadow 0.15s ease;
}

.promise-card:hover {
	translate: 0 -2px;
	box-shadow: inset 1px 1px 0 #fffdf6, 0 6px 14px rgba(50, 40, 25, 0.14);
}

.promise-card:focus-visible {
	outline: 2px solid #ffd27a;
	outline-offset: 2px;
}

.promise-card__file {
	color: #8b8374;
	font-family: var(--mono);
	font-size: 9px;
	letter-spacing: 0.01em;
}

.promise-card__title {
	color: #24211c;
	font-family: var(--px);
	font-size: 11px;
	line-height: 1.45;
}

.promise-card__row {
	display: block;
	color: #5a544a;
	font-size: 11.5px;
	line-height: 1.45;
}

.promise-card__row b {
	display: block;
	margin-bottom: 1px;
	font-family: var(--px);
	font-size: 7.5px;
	font-weight: 400;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.promise-card__row--promised b {
	color: var(--teal);
}

.promise-card__row--delivered b {
	color: var(--rust);
}

.promise-card__open {
	margin-top: auto;
	padding-top: 7px;
	color: var(--teal);
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.promise-detail {
	animation: detailIn 0.22s ease-out both;
}

@keyframes detailIn {
	from { opacity: 0; translate: 0 6px; }
	to { opacity: 1; translate: 0; }
}

.detail-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
	padding-bottom: 9px;
	border-bottom: 1px solid var(--line);
}

.detail-top .linkish {
	font-size: 10.5px;
}

.detail-file {
	color: #8b8374;
	font-family: var(--mono);
	font-size: 9.5px;
}

.detail-title {
	margin: 0 0 3px;
	color: #24211c;
	font-family: var(--px);
	font-size: clamp(16px, 2.4vw, 21px);
	line-height: 1.35;
}

.detail-meta {
	margin: 0 0 16px;
	color: #8b8374;
	font-family: var(--serif);
	font-size: 10.5px;
	font-style: italic;
}

.promise-cols {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0;
	margin-bottom: 18px;
	border: 1px solid #c3bbab;
}

.promise-col {
	padding: 11px 13px 12px;
}

.promise-col--promised {
	border-right: 1px solid #c3bbab;
	background: #e6efe9;
}

.promise-col--delivered {
	background: #f6e3d8;
}

.promise-col__label {
	display: block;
	margin-bottom: 3px;
	font-family: var(--px);
	font-size: 8px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.promise-col--promised .promise-col__label {
	color: var(--teal-deep);
}

.promise-col--delivered .promise-col__label {
	color: #8a3d22;
}

.promise-col p {
	margin: 0;
	color: #3a352d;
	font-size: 12.5px;
	line-height: 1.5;
}

.detail-body {
	max-width: 66ch;
	color: #302c26;
	font-family: var(--serif);
	font-size: 15.5px;
	line-height: 1.72;
}

.detail-body p {
	margin: 0 0 1em;
}

.detail-q {
	margin: 20px 0 16px;
	padding: 14px 16px 14px 18px;
	border-left: 3px solid var(--violet);
	background: #ece7f1;
}

.detail-q__label {
	display: block;
	margin-bottom: 4px;
	color: var(--violet-deep);
	font-family: var(--px);
	font-size: 8px;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.detail-q p {
	margin: 0;
	color: #352b46;
	font-family: var(--serif);
	font-size: 18px;
	font-style: italic;
	line-height: 1.5;
}

.detail-foot {
	margin: 0;
	padding-top: 10px;
	border-top: 1px dashed var(--line);
	color: #8b8374;
	font-family: var(--serif);
	font-size: 10.5px;
	font-style: italic;
}

.promise-foot {
	margin: 15px 0 0;
	color: #8b8374;
	font-family: var(--serif);
	font-size: 11px;
	font-style: italic;
	text-align: center;
}
