/* Editing your profile right on it (js/ktc/ktc_profile_edit.js, system/ktc/profile_edit.php). In edit
   mode the Bio tab's details are buttons, each Info row others can be shown or not has an eye, and a
   hidden one is dimmed; the header's name and mood are buttons, and the avatar and cover have their
   tools. Nothing edit mode adds takes room, so the profile is as tall as it is to everyone else.
   Colours are the KTC tokens (css/ktc/ktc-base.css), each with its value for themes that don't load them */
.ktc_pe { position: relative; }
.ktc_pe.is_editing > .ktc_pe_view { display: none; }

.ktc_pe_field { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; margin: -6px -8px; padding: 6px 8px; border: 0; border-radius: var(--radius-sm, 8px);
	background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; transition: background-color .15s; }
.ktc_pe_field:focus-visible, .ktc_pe_field[aria-expanded="true"] { background: var(--bubble, rgba(255, 255, 255, 0.04)); }
.ktc_pe_field.is_saving { opacity: .6; cursor: progress; }
.ktc_pe_field .fa-pen { flex: none; font-size: 11px; color: var(--ink-dim, #666666); transition: color .15s; }
.ktc_pe_value { min-width: 0; }
.ktc_pe_unset { color: var(--ink-dim, #666666); font-style: italic; }
.ktc_pe_about { display: flex; width: calc(100% + 16px); align-items: flex-start; }
.ktc_pe_about .ktc_pe_value { flex: 1; }
.ktc_pe_about .fa-pen { margin-top: 3px; }
.ktc_pe_eye { width: 32px; text-align: right; }
.ktc_pe_share { width: 28px; height: 24px; margin: -4px 0; border: 0; border-radius: var(--radius-sm, 8px); background: none; color: var(--cyan-bright, #12c2e9); cursor: pointer; transition: background-color .15s; }
.ktc_pe_share .fa-eye-slash, .ktc_pe_share.is_hidden .fa-eye { display: none; }
.ktc_pe_share.is_hidden .fa-eye-slash { display: inline; color: var(--ink-dim, #666666); }
/* a row others don't see, and one that can't be changed: quieter in colour (opacity took them under 4.5:1) */
/* #probio: a phone's own rule (ktc-mobile.css #probio .proitem .prodata) would otherwise make them white */
#probio .ktc_pe_row.is_hidden .prodata { color: var(--ink-muted, #888888); font-style: italic; }
#probio .ktc_pe_row.is_fixed .prodata { color: var(--ink-muted, #888888); }
/* the profile's own Edit profile, in edit mode */
.modal_top_item.ktc_pe_hide { display: none; }

/* Done: a pill held over the bottom of the profile while it scrolls, resting at the end in room kept
   for it below the Bio tab (the bar itself is 0 tall). It steps aside while a detail is being edited
   (.is_focused, calm) */
.ktc_pe_bar { position: sticky; bottom: 32px; z-index: 7; height: 0; margin-top: 24px; }
.ktc_pe_bar_in { position: absolute; right: 0; bottom: -22px; display: flex; padding: 4px; border: 1px solid var(--edge, #333333); border-radius: 999px;
	background: var(--menu, #242424); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); transition: opacity .15s ease-out, transform .15s ease-out; }
.is_focused .ktc_pe_bar_in { opacity: 0; transform: translateY(8px); pointer-events: none; visibility: hidden; transition: opacity .15s ease-out, transform .15s ease-out, visibility 0s .15s; }
/* dark ink on the gradient: white was 2.1 to 3.0:1 across it */
.ktc_pe_done { height: 30px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--skin-gradient, linear-gradient(135deg, #c471ed, #6b9aeb, #12c2e9));
	color: var(--kt-edge, #14061f); font-size: 13px; font-weight: 800; cursor: pointer; transition: filter .15s, transform .08s; }
.ktc_pe_done:active { transform: translateY(1px); }

/* the Undo toast (undoToast): what just changed and Undo, from the top like the chat's own toasts
   (css/ktc/ktc-toast.css), above the profile; a note has no Undo */
.ktc_pe_undo { position: fixed; z-index: 10001; left: 50%; top: calc(12px + var(--safe-top, 0px)); display: flex; align-items: center; gap: 14px; overflow: hidden;
	max-width: calc(100vw - 32px); padding: 8px 8px 8px 16px; border: 2px solid var(--kt-edge, #14061f); border-radius: 16px;
	background: var(--kt-deep, #1c1430); box-shadow: 0 3px 0 var(--kt-edge, #14061f), 0 10px 28px rgba(0, 0, 0, 0.55); color: var(--kt-ink, #ffffff);
	font-size: 14px; font-weight: 600; opacity: 0; transform: translate(-50%, -16px); transition: opacity .2s ease-out, transform .26s cubic-bezier(.16, 1, .3, 1); }
.ktc_pe_undo.is_in { opacity: 1; transform: translate(-50%, 0); }
/* on a touch screen: just above Done, where the thumb already is */
.ktc_pe_undo.is_low { top: auto; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 16px); }
.ktc_pe_undo.is_low.is_in { transform: translate(-50%, 0); }
.ktc_pe_undo.is_note { padding: 12px 16px; }
.ktc_pe_undo_text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* the time left, running out along the bottom edge; it stops while the toast is hovered or focused */
.ktc_pe_undo_bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--cyan-bright, #12c2e9); transform-origin: left; animation: ktc_pe_undo_time linear forwards; }
.ktc_pe_undo.is_paused .ktc_pe_undo_bar { animation-play-state: paused; }
@keyframes ktc_pe_undo_time { from { transform: scaleX(1); } to { transform: scaleX(0); } }
/* KTC's chunky white button */
.ktc_pe_undo_btn { flex: none; height: 34px; padding: 0 16px; border: 2px solid var(--kt-edge, #14061f); border-radius: 999px; background: #ffffff; color: var(--kt-edge, #14061f);
	box-shadow: 0 2px 0 var(--kt-edge, #14061f); font-size: 13px; font-weight: 800; cursor: pointer; transition: transform .08s, box-shadow .08s; }
.ktc_pe_undo_btn:active { transform: translateY(2px); box-shadow: none; }
/* told to screen readers, not shown */
.ktc_pe_live { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* a cover waiting for its Undo toast to go before it's removed */
.pro_top.ktc_pe_removing_cover { background-image: none !important; }

/* a detail being edited: a text box with Save and Cancel (lists are the popover, below) */
.ktc_pe_inline { display: flex; flex-direction: column; gap: 8px; width: 100%; text-align: left; }
.ktc_pe_input { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 2px solid var(--cyan-bright, #12c2e9) !important; border-radius: var(--radius-sm, 8px);
	background: var(--surface, #151515); color: var(--ink, #ffffff); font: inherit; font-size: 14px; }
.ktc_pe_textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.ktc_pe_inline_actions { display: flex; justify-content: flex-end; gap: 6px; }
.ktc_pe_inline_btn { min-height: 32px; padding: 0 12px; border: 0; border-radius: 999px; font-size: 12px; font-weight: 800; cursor: pointer; background: var(--edge, #333333); color: var(--ink, #ffffff); }
.ktc_pe_inline_ok { background: var(--skin-gradient, linear-gradient(135deg, #c471ed, #6b9aeb, #12c2e9)); color: var(--kt-edge, #14061f); }
.ktc_pe_inline_btn[disabled] { opacity: .6; cursor: default; }

/* the profile's header in edit mode: name and mood are buttons, avatar and cover have their tools */
.ktc_pe_head_field { display: inline-block; position: relative; padding: 2px 8px; border-radius: var(--radius-sm, 8px); cursor: pointer; outline-offset: 2px; transition: background-color .15s; }
.ktc_pe_head_field:focus-visible { background: rgba(0, 0, 0, 0.25); }
.ktc_pe_head_field.is_open { display: block; padding: 0; background: none; cursor: default; }
.ktc_pe_pen { margin-left: 6px; font-size: 11px; opacity: .75; }
.ktc_pe_mood_new { font-style: italic; opacity: .8; }
.ktc_pe_head_field .ktc_pe_inline { max-width: 320px; margin: 4px auto 0; }
.ktc_pe_head_field .ktc_pe_input { font-weight: 600; text-align: center; }
.ktc_pe_head_field .ktc_pe_inline_actions { justify-content: center; }
/* the name is as wide as the row (main.css .pro_name): its highlight only as wide as the name, as the mood's */
.pro_name.ktc_pe_head_field { width: auto; max-width: 100%; box-sizing: border-box; }
/* the cover's change and remove, among the profile's own icons top right (.modal_top_item); the
   change is a label around the file input */
.ktc_pe_top_btn { position: relative; color: inherit; }
.ktc_pe_top_btn:focus-within { outline: 3px solid #ffffff; outline-offset: 2px; border-radius: 8px; }
.ktc_pe_cover_file { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

/* a detail's choices: a few rows tall, scrolling, with a search box when it's long */
.ktc_pe_pop { position: absolute; z-index: 8; display: flex; flex-direction: column; padding: 6px; border: 2px solid var(--edge, #333333); border-radius: var(--radius-md, 12px);
	background: var(--menu, #242424); box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5); }
.ktc_pe_search { margin: 0 0 6px; padding: 8px 10px; border-radius: var(--radius-sm, 8px); font-size: 13px; }
.ktc_pe_list { max-height: 240px; overflow-y: auto; overscroll-behavior: contain; outline: none; }
.ktc_pe_item { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border-radius: var(--radius-sm, 8px); font-size: 14px; cursor: pointer; }
.ktc_pe_item span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* the row the keys are on: its background, and a cyan edge that doesn't rely on it */
.ktc_pe_item.is_active { background: var(--edge, #333333); box-shadow: inset 3px 0 0 var(--cyan-bright, #12c2e9); }
.ktc_pe_item.is_current { font-weight: 700; }
.ktc_pe_check { margin-left: auto; color: var(--cyan-bright, #12c2e9); }
.ktc_pe_item.is_disabled { opacity: .5; cursor: default; }
/* a long list on a touch screen: a sheet from the bottom over a veil, rows a thumb's height */
.ktc_pe_veil { position: fixed; inset: 0; z-index: 10002; background: var(--scrim, rgba(0, 0, 0, 0.6)); }
.ktc_pe_pop.is_sheet { position: fixed; z-index: 10003; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 75vh; padding: 8px 12px calc(12px + env(safe-area-inset-bottom, 0px));
	border: 2px solid var(--edge, #333333); border-bottom: 0; border-radius: var(--radius-xl, 16px) var(--radius-xl, 16px) 0 0; box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.5); }
.ktc_pe_pop.is_sheet::before { content: ''; align-self: center; width: 40px; height: 4px; margin: 2px 0 8px; border-radius: 999px; background: var(--edge-strong, #444444); }
.ktc_pe_sheet_title { margin: 0 4px 8px; font-size: 15px; font-weight: 700; }
.ktc_pe_pop.is_sheet .ktc_pe_list { max-height: none; flex: 1; min-height: 0; }
.ktc_pe_pop.is_sheet .ktc_pe_item { min-height: 48px; font-size: 15px; }
.ktc_pe_pop.is_sheet .ktc_pe_search { font-size: 16px; padding: 10px 12px; }

@media (pointer: coarse) {
	/* bigger targets on a touch screen, still inside the room a row already has */
	.ktc_pe_share { width: 40px; height: 40px; margin: -12px 0; }
	.ktc_pe_done { height: 38px; }
	.ktc_pe_undo_btn { height: 44px; }
	.ktc_pe_inline_btn, .ktc_pe_item { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
	.ktc_pe_undo { transition: opacity .2s; transform: translate(-50%, 0); }
	.ktc_pe_undo.is_low { transform: translate(-50%, 0); }
	.ktc_pe_bar_in, .is_focused .ktc_pe_bar_in { transform: none; }
}
/* hover only where there is hover: on a touch screen a tap would leave it stuck */
@media (hover: hover) {
	.ktc_pe_done:hover { filter: brightness(1.08); }
	.ktc_pe_field:hover { background: var(--bubble, rgba(255, 255, 255, 0.04)); }
	.ktc_pe_field:hover .fa-pen { color: var(--cyan-bright, #12c2e9); }
	.ktc_pe_share:hover { background: var(--bubble, rgba(255, 255, 255, 0.04)); }
	.ktc_pe_head_field:hover { background: rgba(0, 0, 0, 0.25); }
}
