/****************************************************************************/
/* STILE DELLA CHAT E DEI PANNELLI */

/* HELP: Da qui è possibile modificare:
- I font ed i colori della chat
- Le dimensioni e la posizione della chat
- Lo sfondo della chat*/



iframe.iframe_chat{
   border: none;
   width: 1px;
   height: 1px;
   margin: auto;
}
div.chat_window{
  text-align: center;
}

body.chatsave_body{
  overflow: auto;
  text-align: justify;
}

/* Intestazione della giocata salvata: data, chat, partecipanti */
body.chatsave_body .chatsave_header {
    width: 100%;
    max-width: 960px;
    box-sizing: border-box;
    margin: 16px auto 0 auto;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #7c562c;
    background: rgba(124, 86, 44, 0.06);
    font-family: Georgia, serif;
    font-size: 16px;
    text-align: left;
    color: #2a1a0a;
}

body.chatsave_body .chatsave_header_row {
    margin: 2px 0;
    color: #2a1a0a;
}

body.chatsave_body .chatsave_header_label {
    font-weight: bold;
    color: #2a1a0a;
}

body.chatsave_body #pagina_chat,
body.chatsave_body div.chat_box {
    position: static;
    top: auto;
    bottom: auto;
    left: auto;
    right: auto;
    width: 100%;
    max-width: 960px;
    height: auto;
    overflow: visible;
    box-sizing: border-box;
    font-family: Georgia, serif;
    font-size: 16px;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #7c562c;
    box-shadow: inset 0 1px 4px rgba(58, 37, 16, 0.10);
    margin: 16px auto;
}

/* chat_row_A nel file salvato: float su avatar e icone così il testo
   continua a piena larghezza anche sotto di essi */
body.chatsave_body div.chat_row_A {
    display: block;
    overflow: hidden;
}

body.chatsave_body div.chat_row_A img.chat_avatar {
    display: block;
    float: left;
    width: 80px;
    height: 80px;
    min-width: 80px;
    min-height: 80px;
    max-width: 80px;
    max-height: 80px;
    margin: 0 8px 4px 0;
    box-sizing: border-box;
    object-fit: contain;
    object-position: center center;
}

body.chatsave_body div.chat_row_A span.chat_icons {
    float: left;
    display: block;
    margin: 0 4px 4px 0;
}

body.chatsave_body div.chat_row_A img.chat_avatar + span.chat_icons {
    margin-top: 8px;
}

body.chatsave_body div.chat_row_A span.chat_time,
body.chatsave_body div.chat_row_A span.chat_name,
body.chatsave_body div.chat_row_A span.chat_tag,
body.chatsave_body div.chat_row_A span.chat_msg {
    display: inline;
}

body.chatsave_body div.chat_row_A br.chat_clear {
    display: none;
}

br.chat_clear{
  clear: both;
}

/**	* Fix per layout elastico
	* @author Blancks
*/
div.chat_box{
    background:url("imgs/SFONDOCHAT.png") top left repeat;
	position:absolute;
	top:50px;
	bottom:25%;
	left:15px;
	right:15px;
	overflow-y: auto;
	overflow-x: hidden;
    
   font-family: Thaoma, SansSerif;
    font-size: 18px;
    margin:5 5 5 5px;

    font-weight: normal;
    font-style:  normal ;
    text-align:left;
   
    
}


/* ============================================================
   PANNELLO INFERIORE CHAT — Layout a tab unificato e responsivo
   ============================================================ */

/* Contenitore fisso al fondo */
div.pagina_frame_chat div.page_body div.chat_bottom_panel {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 10;
	background: linear-gradient(180deg, #f7e6c7 0%, #e3c590 100%);
	border-top: 2px solid #7c562c;
	border-left: 1px solid #7c562c;
	border-right: 1px solid #7c562c;
	border-radius: 8px 8px 0 0;
	box-shadow: 0 -3px 12px rgba(58, 37, 16, 0.30);
	box-sizing: border-box;
	overflow: hidden;
}

/* Barra dei tab */
div.pagina_frame_chat div.chat_bp_tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 2px;
	padding: 5px 8px 0 8px;
	border-bottom: 1px solid #7c562c;
}

/* Singolo tab */
div.pagina_frame_chat button.chat_bp_tab {
	padding: 5px 14px;
	border: 1px solid rgba(124, 86, 44, 0.45);
	border-bottom: none;
	border-radius: 8px 8px 0 0;
	background: rgba(255, 255, 255, 0.30);
	color: rgba(58, 37, 16, 0.70);
	font-family: Georgia, serif;
	font-size: 11px;
	font-weight: normal;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
	line-height: 1.4;
	white-space: nowrap;
	margin-bottom: -1px;
	position: relative;
	z-index: 0;
	width: auto;
	height: auto;
	margin-left: 0;
	margin-right: 0;
	margin-top: 0;
}

div.pagina_frame_chat button.chat_bp_tab.chat_bp_tab--media{
	display: inline-flex;
	align-items: center;
	column-gap: 5px;
}

div.pagina_frame_chat button.chat_bp_tab span.chat_bp_tab_indicator{
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	line-height: 1;
	color: #7c562c;
	opacity: 0.9;
	transform: translateY(-1px);
}

div.pagina_frame_chat button.chat_bp_tab:hover {
	background: rgba(255, 255, 255, 0.60);
	border-color: #7c562c;
	color: #3a2510;
}

div.pagina_frame_chat button.chat_bp_tab.is-active {
	background: linear-gradient(180deg, #fdf6e8 0%, #ecdcb8 100%);
	border-color: #7c562c;
	color: #2b1d0d;
	font-weight: bold;
	z-index: 1;
}

div.pagina_frame_chat button.chat_bp_tab.is-active span.chat_bp_tab_indicator{
	color: #5a3a18;
}

/* L'indicatore della griglia tattica si accende solo quando la stanza ha una
   griglia attiva: serve una regola esplicita perche' display:inline-flex qui
   sopra vincerebbe sull'attributo hidden. */
div.pagina_frame_chat button.chat_bp_tab span.chat_bp_tab_indicator[hidden]{
	display: none;
}

/* Pannello di contenuto (nascosto di default) */
div.pagina_frame_chat div.chat_bp_panel {
	display: none;
	padding: 8px 10px 0px 10px;
	box-sizing: border-box;
}

div.pagina_frame_chat div.chat_bp_panel.is-active {
	display: block;
}

div.pagina_frame_chat .chat-media-card,
div.pagina_frame_chat .chat-media-admin,
div.pagina_frame_chat .chat-media-empty{
	border: 1px solid rgba(124, 86, 44, 0.35);
	border-radius: 10px;
	background: rgba(255, 248, 236, 0.82);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
	padding: 8px 10px;
}

div.pagina_frame_chat .chat-media-card + .chat-media-admin,
div.pagina_frame_chat .chat-media-empty + .chat-media-admin{
	margin-top: 8px;
}

div.pagina_frame_chat .chat-media-admin__title{
	font-size: 11px;
	font-family: Georgia, serif;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #6a4825;
}

div.pagina_frame_chat .chat-media-pill{
	display: inline-flex;
	align-items: center;
	padding: 2px 7px;
	border-radius: 999px;
	border: 1px solid rgba(124, 86, 44, 0.25);
	background: rgba(255, 255, 255, 0.65);
	color: #5a3a18;
	font-size: 10px;
	line-height: 1.2;
}

div.pagina_frame_chat .chat-media-pill--timer{
	background: rgba(240, 225, 198, 0.85);
}

div.pagina_frame_chat .chat-media-card__note{
	color: #4a3320;
	line-height: 1.35;
	font-size: 12px;
	margin-top: 6px;
}

div.pagina_frame_chat .chat-media-card__player{
	margin-top: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

div.pagina_frame_chat .chat-media-audio-player{
	flex: 1 1 420px;
	width: 100%;
	min-width: 220px;
}

div.pagina_frame_chat .chat-media-player-tools{
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	gap: 5px;
	margin-left: auto;
}

div.pagina_frame_chat .chat-media-player-actions{
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

div.pagina_frame_chat .chat-media-nav,
div.pagina_frame_chat .chat-media-track{
	border: 1px solid rgba(124, 86, 44, 0.35);
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.7);
	color: #3f2b17;
}

div.pagina_frame_chat .chat-media-nav{
	min-width: 26px;
	height: 26px;
	padding: 0 6px;
	font-size: 11px;
	cursor: pointer;
	line-height: 1;
}

div.pagina_frame_chat .chat-media-repeat-button{
	display: inline-flex;
	align-items: center;
	justify-content: center;
	position: relative;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 1px solid rgba(124, 86, 44, 0.35);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.78);
	color: #6a4825;
	cursor: pointer;
}

div.pagina_frame_chat .chat-media-repeat-button__icon{
	font-size: 15px;
	line-height: 1;
}

div.pagina_frame_chat .chat-media-repeat-button__badge{
	position: absolute;
	right: -2px;
	bottom: -2px;
	min-width: 12px;
	height: 12px;
	padding: 0 2px;
	border-radius: 999px;
	background: #7c562c;
	color: #fff8ec;
	font-size: 8px;
	line-height: 12px;
	text-align: center;
	box-sizing: border-box;
}

div.pagina_frame_chat .chat-media-repeat-button.is-mode-none{
	opacity: 0.68;
}

div.pagina_frame_chat .chat-media-repeat-button.is-mode-playlist,
div.pagina_frame_chat .chat-media-repeat-button.is-mode-track{
	background: linear-gradient(180deg, #fdf6e8 0%, #ecdcb8 100%);
	border-color: #7c562c;
	opacity: 1;
}

div.pagina_frame_chat .chat-media-playlist-wrap{
	margin-top: 6px;
	padding-top: 6px;
	border-top: 1px dashed rgba(124, 86, 44, 0.25);
}

div.pagina_frame_chat .chat-media-playlist{
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	max-height: 74px;
	overflow-y: auto;
}

div.pagina_frame_chat .chat-media-playlist__item{
	margin: 0;
	flex: 0 1 220px;
	max-width: 100%;
}

div.pagina_frame_chat .chat-media-track{
	width: 100%;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 4px 7px;
	text-align: left;
	cursor: pointer;
}

div.pagina_frame_chat .chat-media-track__index{
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 18px;
	height: 18px;
	border-radius: 50%;
	background: rgba(124, 86, 44, 0.12);
	font-size: 10px;
	font-weight: bold;
}

div.pagina_frame_chat .chat-media-track__title{
	min-width: 0;
	flex: 1 1 auto;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-size: 12px;
	line-height: 1.2;
}

div.pagina_frame_chat .chat-media-track.is-active{
	background: linear-gradient(180deg, #fdf6e8 0%, #ecdcb8 100%);
	border-color: #7c562c;
}

div.pagina_frame_chat .chat-media-empty{
	color: #5a3a18;
}

div.pagina_frame_chat .chat-media-admin__title{
	margin-bottom: 8px;
}

div.pagina_frame_chat details.chat-media-admin{
	padding: 0;
	overflow: hidden;
}

div.pagina_frame_chat details.chat-media-admin[open]{
	padding: 0;
}

div.pagina_frame_chat .chat-media-admin__summary{
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 7px 10px;
	cursor: pointer;
	font-size: 11px;
	font-family: Georgia, serif;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #6a4825;
	list-style: none;
}

div.pagina_frame_chat .chat-media-admin__summary::-webkit-details-marker{
	display: none;
}

div.pagina_frame_chat .chat-media-admin__summary::after{
	content: '+';
	font-size: 16px;
	line-height: 1;
	color: #7c562c;
}

div.pagina_frame_chat details.chat-media-admin[open] .chat-media-admin__summary::after{
	content: '−';
}

div.pagina_frame_chat .chat-media-admin__body{
	padding: 0 10px 8px 10px;
}

div.pagina_frame_chat .chat-media-help{
	margin-top: 4px;
	font-size: 11px;
	line-height: 1.3;
	color: #6a4825;
}

div.pagina_frame_chat .cp_row--media-admin{
	display: grid;
	grid-template-columns: minmax(0, 1.7fr) minmax(240px, 0.95fr);
	align-items: start;
	gap: 8px;
}

div.pagina_frame_chat .cp_field--media-playlist{
	min-width: 0;
}

div.pagina_frame_chat .cp_field--media-playlist textarea{
	width: 100%;
	min-height: 46px;
	resize: vertical;
	box-sizing: border-box;
}

div.pagina_frame_chat .chat-media-admin__side{
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	align-content: start;
	gap: 6px;
	min-width: 0;
}

div.pagina_frame_chat .chat-media-admin__side .cp_field--grow{
	flex: 0 0 auto;
	min-width: 0;
}

div.pagina_frame_chat .chat-media-admin__actions{
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 5px;
}

div.pagina_frame_chat .cp_field--media-timer{
	flex: 0 0 74px;
}

div.pagina_frame_chat .cp_field--media-timer input{
	text-align: center;
}

div.pagina_frame_chat form.chat-media-form + form.chat-media-form{
	margin-top: 0;
}

@media (max-width: 760px) {
	div.pagina_frame_chat .cp_row--media-admin{
		display: flex;
		grid-template-columns: none;
	}
}

div.pagina_frame_chat div.chat_bp_panel--lazy div.chat_lazy_panel_state {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
}

div.pagina_frame_chat span.chat_lazy_panel_loader {
	display: inline-block;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 3px solid rgba(124, 86, 44, 0.22);
	border-top-color: #7c562c;
	animation: chat_lazy_panel_spin 0.75s linear infinite;
}

@keyframes chat_lazy_panel_spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

/* Riga campi — flexbox */
div.pagina_frame_chat div.cp_row {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 6px;
}

/* Campo base */
div.pagina_frame_chat div.cp_field {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	min-width: 70px;
	flex: 0 0 auto;
	margin: 0;
}

/* Campo largo */
div.pagina_frame_chat div.cp_field--grow {
	flex: 1 1 150px;
	min-width: 120px;
}

/* Campo medio */
div.pagina_frame_chat div.cp_field--mid {
	flex: 1 1 130px;
	min-width: 100px;
}

/* Campo stretto */
div.pagina_frame_chat div.cp_field--s {
	flex: 0 0 80px;
	max-width: 100px;
}

/* Campo ricerca */
div.pagina_frame_chat div.cp_field--search {
	flex: 0 0 110px;
}

/* Campo spell (dropdown incantesimi) */
div.pagina_frame_chat div.cp_field--spell {
	flex: 1 1 90px;
	min-width: 70px;
}

/* Adv-toggle compatto nel pannello spell */
div.pagina_frame_chat div.cp_field--spell-adv {
	flex: 0 0 auto;
}

/* Campo specializzazione */
div.pagina_frame_chat div.cp_field--spec {
	flex: 0 0 auto;
}

/* Campo lingua base dei discorsi diretti: largo quanto basta, non allarga la riga */
div.pagina_frame_chat div.cp_field--lang,
div.pagina_frame_chat div.cp_field--forma {
	flex: 0 0 auto;
	min-width: 70px;
	max-width: 132px;
}

div.pagina_frame_chat div.cp_field--lang select,
div.pagina_frame_chat div.cp_field--forma select {
	max-width: 132px;
	text-overflow: ellipsis;
}

/* Lingua imposta dalla forma assunta: il selettore resta visibile ma bloccato */
div.pagina_frame_chat div.cp_field--lang select[disabled] {
	opacity: 0.75;
	cursor: not-allowed;
}

/* Campo bottone — display:block per evitare interferenze del flex colonna ereditato */
div.pagina_frame_chat div.cp_field--btn {
	flex: 0 0 auto;
	align-self: flex-start;
	display: block;
	margin: 0;
}

/* Riga tab oggetti: toggle modalita + form inline */
div.pagina_frame_chat div.cp_row--items {
	align-items: flex-start;
}

div.pagina_frame_chat div.cp_field--mode-toggle {
	flex: 0 0 auto;
	min-width: 170px;
}

div.pagina_frame_chat form.chat-item-inline-form {
	display: flex;
	flex: 1 1 320px;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 6px;
	margin: 0;
}

div.pagina_frame_chat div.cp_row--items.item-mode-standard form.item-mode-form-magic {
	display: none;
}

div.pagina_frame_chat div.cp_row--items.item-mode-magic form.item-mode-form-standard {
	display: none;
}

/* Etichetta sotto il campo */
div.pagina_frame_chat span.cp_label {
	display: block;
	font-size: 10px;
	font-family: Georgia, serif;
	letter-spacing: 0.06em;
	line-height: 1.3;
	color: #5a3a18;
	text-align: center;
	margin-top: 3px;
	padding-top: 1px;
	white-space: nowrap;
	overflow: visible;
	text-overflow: clip;
}

/* Select e input nel pannello */
div.pagina_frame_chat div.chat_bottom_panel select,
div.pagina_frame_chat div.chat_bottom_panel input[name=tag],
div.pagina_frame_chat div.chat_bottom_panel input[type=text],
div.pagina_frame_chat div.chat_bottom_panel input[type=number],
div.pagina_frame_chat div.chat_bottom_panel textarea[name=message] {
	width: 100%;
	min-height: 34px;
	height: 34px;
	margin: 0;
	padding: 4px 10px;
	box-sizing: border-box;
	background: rgba(255, 255, 255, 0.82);
	border: 1px solid rgba(124, 86, 44, 0.55);
	border-radius: 10px;
	color: #1e1206;
	font-size: 12px;
	font-family: Georgia, serif;
	transition: border-color 0.15s ease;
}

/* Textarea messaggio: auto-espandibile fino a 2 righe */
div.pagina_frame_chat div.chat_bottom_panel textarea[name=message] {
	max-height: 52px;
	overflow-y: auto;
	overflow-x: hidden;
	resize: none;
	line-height: 1.55;
	vertical-align: top;
	word-wrap: break-word;
	padding: 7px 10px 5px;
}

div.pagina_frame_chat div.chat_bottom_panel select {
	cursor: pointer;
}

/* Select abilità: larghezza automatica basata sul contenuto */
div.pagina_frame_chat div.chat_bottom_panel select[name=id_ab] {
	width: auto;
}

div.pagina_frame_chat div.chat_bottom_panel select:focus,
div.pagina_frame_chat div.chat_bottom_panel input[name=tag]:focus,
div.pagina_frame_chat div.chat_bottom_panel input[type=text]:focus,
div.pagina_frame_chat div.chat_bottom_panel input[type=number]:focus,
div.pagina_frame_chat div.chat_bottom_panel textarea[name=message]:focus {
	border-color: #7c562c;
	outline: none;
}

/* Pulsante invia */
div.pagina_frame_chat div.chat_bottom_panel button[type=submit],
div.pagina_frame_chat div.chat_bottom_panel input[type=submit] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 34px;
	height: 34px;
	padding: 0 16px;
	margin: 0;
	width: auto;
	background: linear-gradient(180deg, #f0dca8 0%, #c8a060 100%);
	border: 1px solid #7c562c;
	border-radius: 10px;
	color: #2b1d0d;
	font-size: 12px;
	font-family: Georgia, serif;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
	white-space: nowrap;
	box-sizing: border-box;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.50);
}

div.pagina_frame_chat div.chat_bottom_panel button[type=submit]:hover,
div.pagina_frame_chat div.chat_bottom_panel input[type=submit]:hover {
	background: linear-gradient(180deg, #fcefd7 0%, #d4a865 100%);
	border-color: #5a3a18;
	transform: translateY(-1px);
}

/* Adv-toggle (Vantaggio/Svantaggio) */
div.pagina_frame_chat div.chat_bottom_panel div.adv-toggle {
	display: flex;
	flex-direction: column;
	border: 1px solid rgba(124, 86, 44, 0.55);
	border-radius: 10px;
	overflow: hidden;
	margin: 0;
	flex: 0 0 auto;
	height: 34px;
	box-sizing: border-box;
}

div.pagina_frame_chat div.chat_bottom_panel div.adv-btn-row {
	display: flex;
}

div.pagina_frame_chat div.chat_bottom_panel button.adv-btn {
	flex: 1;
	height: auto;
	min-height: 32px;
	padding: 6px 12px;
	border: none;
	border-right: 1px solid rgba(124, 86, 44, 0.45);
	border-radius: 0;
	background: rgba(255, 255, 255, 0.45);
	color: #3f2b17;
	font-size: 11px;
	font-family: Georgia, serif;
	cursor: pointer;
	transition: background 0.12s ease;
	width: auto;
	margin: 0;
	white-space: nowrap;
	box-shadow: none;
}

div.pagina_frame_chat div.chat_bottom_panel button.adv-btn:last-of-type {
	border-right: none;
}

div.pagina_frame_chat div.chat_bottom_panel button.adv-btn:hover {
	background: rgba(255, 255, 255, 0.70);
}

div.pagina_frame_chat div.chat_bottom_panel button.adv-btn.active {
	background: linear-gradient(180deg, #f0dca8 0%, #c8a060 100%);
	color: #2b1d0d;
	font-weight: bold;
}


/* Toggle modalità azione (Abilità / Dado puro) */
div.pagina_frame_chat div.chat_bottom_panel div.act-mode-toggle {
	display: flex;
	flex-direction: column;
	border: 1px solid rgba(124, 86, 44, 0.55);
	border-radius: 10px;
	overflow: hidden;
	margin: 0;
	flex: 0 0 auto;
	height: 34px;
	box-sizing: border-box;
}

div.pagina_frame_chat div.chat_bottom_panel div.act-mode-btn-row {
	display: flex;
}

div.pagina_frame_chat div.chat_bottom_panel button.act-mode-btn {
	flex: 1;
	height: auto;
	min-height: 32px;
	padding: 6px 12px;
	border: none;
	border-right: 1px solid rgba(124, 86, 44, 0.45);
	border-radius: 0;
	background: rgba(255, 255, 255, 0.45);
	color: rgba(58, 37, 16, 0.70);
	font-size: 11px;
	font-family: Georgia, serif;
	cursor: pointer;
	transition: background 0.12s ease;
	width: auto;
	margin: 0;
	white-space: nowrap;
	box-shadow: none;
}

div.pagina_frame_chat div.chat_bottom_panel button.act-mode-btn:last-of-type {
	border-right: none;
}

div.pagina_frame_chat div.chat_bottom_panel button.act-mode-btn:hover {
	background: rgba(255, 255, 255, 0.70);
}

div.pagina_frame_chat div.chat_bottom_panel button.act-mode-btn.is-active {
	background: linear-gradient(180deg, #f0dca8 0%, #c8a060 100%);
	color: #2b1d0d;
	font-weight: bold;
}

/* Visibilità campi per modalità: default = skill, dice = dado puro */
div.pagina_frame_chat form.act-mode-skill div.act-dice-field {
	display: none;
}

div.pagina_frame_chat form.act-mode-dice div.act-skill-field {
	display: none;
}

/* Mobile responsive */
@media (max-width: 600px) {
	div.pagina_frame_chat div.page_body div.chat_bottom_panel {
		max-height: 58vh;
		overflow-x: hidden;
		overflow-y: auto;
	}
	div.pagina_frame_chat div.chat_bp_tabs {
		flex-wrap: nowrap;
		overflow-x: auto;
		padding: 4px 6px 0 6px;
	}
	div.pagina_frame_chat button.chat_bp_tab {
		padding: 4px 8px;
		font-size: 10px;
		flex: 0 0 auto;
	}
	div.pagina_frame_chat div.chat_bp_panel {
		padding: 6px 7px 0px 7px;
	}
	div.pagina_frame_chat div.cp_row {
		gap: 5px;
	}
	div.pagina_frame_chat div.cp_field {
		min-width: 0;
	}
	div.pagina_frame_chat div.cp_field--s {
		flex: 0 0 60px;
		max-width: 80px;
	}
	div.pagina_frame_chat div.cp_field--mid {
		min-width: 80px;
	}
	div.pagina_frame_chat div.cp_field--grow {
		min-width: 90px;
	}
	div.pagina_frame_chat div.cp_field--mode-toggle {
		min-width: 100%;
	}
	div.pagina_frame_chat div.cp_field--search {
		flex: 0 0 80px;
	}
	div.pagina_frame_chat div.cp_field--lang,
	div.pagina_frame_chat div.cp_field--lang select,
	div.pagina_frame_chat div.cp_field--forma,
	div.pagina_frame_chat div.cp_field--forma select {
		max-width: 92px;
	}
	div.pagina_frame_chat div.cp_field--spell {
		flex: 1 1 70px;
		min-width: 50px;
	}
	div.pagina_frame_chat form.chat-item-inline-form {
		flex: 1 1 100%;
	}
	div.pagina_frame_chat span.cp_label {
		font-size: 9px;
		white-space: normal;
	}
	div.pagina_frame_chat div.chat_box {
		left: 8px;
		right: 8px;
		padding: 7px 8px;
	}
}

@media (max-width: 520px) {
	div.pagina_frame_chat div.cp_field--grow,
	div.pagina_frame_chat div.cp_field--mid {
		flex: 1 1 100%;
		min-width: 0;
	}
	div.pagina_frame_chat div.cp_field--s,
	div.pagina_frame_chat div.cp_field--search,
	div.pagina_frame_chat div.cp_field--spell,
	div.pagina_frame_chat div.cp_field--lang,
	div.pagina_frame_chat div.cp_field--forma,
	div.pagina_frame_chat div.cp_field--filter,
	div.pagina_frame_chat div.cp_field--nocomp {
		flex: 1 1 46%;
		min-width: 0;
		max-width: none;
	}
	div.pagina_frame_chat div.cp_field--lang select,
	div.pagina_frame_chat div.cp_field--forma select {
		max-width: none;
	}
	div.pagina_frame_chat div.cp_field--btn {
		align-self: stretch;
		width: 100%;
	}
	div.pagina_frame_chat div.chat_bottom_panel button[type=submit],
	div.pagina_frame_chat div.chat_bottom_panel input[type=submit] {
		width: 100%;
	}
	div.pagina_frame_chat div.chat_bottom_panel select,
	div.pagina_frame_chat div.chat_bottom_panel input[name=tag],
	div.pagina_frame_chat div.chat_bottom_panel input[type=text],
	div.pagina_frame_chat div.chat_bottom_panel input[type=number],
	div.pagina_frame_chat div.chat_bottom_panel textarea[name=message] {
		min-height: 32px;
		height: 32px;
		padding-left: 8px;
		padding-right: 8px;
	}
	div.pagina_frame_chat div.chat_bottom_panel textarea[name=message] {
		max-height: 72px;
	}
}

@media (max-width: 380px) {
	div.pagina_frame_chat div.page_body div.chat_bottom_panel {
		max-height: 62vh;
	}
	div.pagina_frame_chat button.chat_bp_tab {
		padding: 4px 7px;
	}
	div.pagina_frame_chat div.cp_field--s,
	div.pagina_frame_chat div.cp_field--search,
	div.pagina_frame_chat div.cp_field--spell,
	div.pagina_frame_chat div.cp_field--lang,
	div.pagina_frame_chat div.cp_field--forma,
	div.pagina_frame_chat div.cp_field--filter,
	div.pagina_frame_chat div.cp_field--nocomp {
		flex-basis: 100%;
	}
}

/* La pagina chat occupa tutta l'area del contenitore output senza padding */
div.output:has(div.pagina_frame_chat) {
	padding: 0;
	margin: 0;
	overflow: hidden;
}

#maincontent.maincontent--topbar div.output:has(div.pagina_frame_chat) {
	position: absolute;
	top: var(--topbar-offset);
	right: 0;
	bottom: 0;
	left: 0;
	min-height: 0;
	margin-top: 0;
	padding-top: 0;
}

/* pagina_frame_chat riempie l'intera area output */
div.pagina_frame_chat {
	position: absolute;
	top: 0px;
	bottom: 0;
	left: 0;
	right: 0;
}

/* page_body diventa il containing block esplicito per chat_box e chat_bottom_panel */
div.pagina_frame_chat div.page_body {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
	overflow: hidden;
}

div.pagina_frame_chat div.page_body.page_body--blocked {
	overflow-y: auto;
	padding: 72px 12px 12px 12px;
	box-sizing: border-box;
}

div.pagina_frame_chat div.page_body.page_body--blocked div.chat-access-warning {
	max-width: 760px;
	margin: 0 auto;
	position: relative;
	z-index: 1;
}

/* Spazio extra per il titolo chat (nome + meteo + lune) per evitare sovrapposizioni */
div.pagina_frame_chat div.chat_box {
	top: 70px;
	bottom: var(--cbp-h, 110px);
	left: 12px;
	right: 12px;
	z-index: 1;
	border-radius: 10px;
	border: 1px solid #7c562c;
	box-shadow: inset 0 1px 4px rgba(58, 37, 16, 0.10);
	font-family: Georgia, serif;
	padding: 8px 10px;
	box-sizing: border-box;
}

div.pagina_frame_chat div.chat_loading_placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 180px;
}

div.pagina_frame_chat div.page_title {
	position: relative;
	z-index: 2;
}

div.pagina_frame_chat div.page_title h2{
	position: relative;
	display:flex;
	align-items:center;
	align-content:center;
	justify-content:center;
	flex-wrap:nowrap;
	column-gap: 6px;
	row-gap: 4px;
	min-height: 30px;
	margin-bottom: 8px;
	border-bottom: none;
	padding-bottom: 0;
}

div.pagina_frame_chat div.page_title h2 span.chat-title-switcher{
	display:flex;
	align-items:center;
	justify-content:center;
	gap: 0;
	min-width: 0;
	max-width: calc(100% - 190px);
	align-self:center;
	padding: 5px 10px 5px 12px;
	border: 1px solid #c5ac84;
	border-radius: 16px;
	background: linear-gradient(180deg, rgba(251, 246, 236, 0.98) 0%, rgba(236, 224, 201, 0.96) 100%);
	box-shadow: 0 2px 6px rgba(58, 37, 16, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

div.pagina_frame_chat div.page_title h2 span.chat-title-slider-view{
	display:grid;
	align-items:center;
	overflow:hidden;
	min-width: 0;
	max-width: 100%;
	min-height: 24px;
	padding: 0 2px 0 0;
	box-sizing:border-box;
	text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
}

div.pagina_frame_chat div.page_title h2 span.chat-title-slider-track{
	display:grid;
	align-items:center;
	width:100%;
}

div.pagina_frame_chat div.page_title h2 span.chat-title-slide{
	display:flex;
	align-items:center;
	justify-content:center;
	grid-area: 1 / 1;
	min-width:100%;
	width:100%;
	box-sizing:border-box;
	opacity:0;
	visibility:hidden;
	transform: translateY(4px);
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

div.pagina_frame_chat div.page_title h2 span.chat-title-mainline,
div.pagina_frame_chat div.page_title h2 span.chat-title-dayline{
	display:flex;
	align-items:center;
	justify-content:center;
	flex-wrap:nowrap;
	white-space:nowrap;
	min-width:0;
	max-width:100%;
	overflow:hidden;
	margin:0;
	padding:0;
	box-sizing:border-box;
	line-height:1.1;
}

div.pagina_frame_chat div.page_title h2 span.chat-title-slide.chat-title-slide-main{
	opacity:1;
	visibility:visible;
	transform: translateY(0);
}

div.pagina_frame_chat div.page_title h2 span.chat-title-switcher.is-day-visible span.chat-title-slide.chat-title-slide-main{
	opacity:0;
	visibility:hidden;
	transform: translateY(-4px);
}

div.pagina_frame_chat div.page_title h2 span.chat-title-switcher.is-day-visible span.chat-title-slide.chat-title-slide-day{
	opacity:1;
	visibility:visible;
	transform: translateY(0);
}

div.pagina_frame_chat div.page_title h2 span.chat-title-mainline{
	column-gap: 6px;
}

div.pagina_frame_chat div.page_title h2 span.chat-title-dayline{
	font-size:14px;
	font-weight:bolder;
	color:#000000;
	line-height:1.1;
	text-overflow:ellipsis;
}

/* Titolo chat: solo il nome in nero, meteo in corpo ridotto */
div.pagina_frame_chat div.page_title h2 span.chat-title-name{
	color:#000000;
	display:inline-flex;
	align-items:center;
	column-gap: 6px;
	line-height:1.1;
	white-space:nowrap;
}

div.pagina_frame_chat div.page_title h2 span.chat-title-media-indicator{
	display:inline-flex;
	align-items:center;
	justify-content:center;
	font-size: 14px;
	line-height: 1;
	color: #7c562c;
	opacity: 0.85;
	cursor: help;
	transform: translateY(-1px);
}

div.pagina_frame_chat div.page_title h2 span.chat-linked-wrap{
	position: absolute;
	left: 17px;
	top: 65%;
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	margin-right: 0;
}

div.pagina_frame_chat div.page_title h2 button.chat-linked-toggle{
	border: 1px solid #7c562c;
	border-radius: 14px;
	padding: 2px 10px;
	background: linear-gradient(180deg, #f7e6c7 0%, #d7b078 100%);
	color: #3f2b17;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	cursor: pointer;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 1px 2px rgba(30, 18, 8, 0.22);
}

div.pagina_frame_chat div.page_title h2 button.chat-linked-toggle:hover,
div.pagina_frame_chat div.page_title h2 button.chat-linked-toggle:focus{
	background: linear-gradient(180deg, #fcefd7 0%, #e0bb86 100%);
	outline: none;
}

div.pagina_frame_chat div.page_title h2 span.chat-linked-menu{
	display: none;
	position: absolute;
	top: calc(100% + 18px);
	left: 0;
	min-width: 220px;
	max-width: 320px;
	padding: 6px;
	border: 1px solid #7c562c;
	border-radius: 10px;
	background: linear-gradient(180deg, #f7e6c7 0%, #e3c590 100%);
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
	z-index: 30;
}

div.pagina_frame_chat div.page_title h2 span.chat-linked-menu.is-open,
div.pagina_frame_chat div.page_title h2 span.chat-linked-wrap:hover span.chat-linked-menu{
	display: block;
}

div.pagina_frame_chat div.page_title h2 span.chat-linked-menu a{
	display: block;
	padding: 4px 6px;
	color: #2b1d0d;
	text-decoration: none;
	font-size: 12px;
	line-height: 1.25;
	border-radius: 6px;
}

div.pagina_frame_chat div.page_title h2 span.chat-linked-menu a:hover{
	background: rgba(255, 255, 255, 0.45);
}

div.pagina_frame_chat div.page_title h2 span.chat-gather-wrap{
	position: absolute;
	right: 17px;
	top: 48%;
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
}

div.pagina_frame_chat div.page_title h2 button.chat-gather-toggle{
	border: none;
	background: transparent;
	padding: 0;
	margin: 0;
	cursor: pointer;
	line-height: 1;
}

div.pagina_frame_chat div.page_title h2 button.chat-gather-toggle img{
	display: block;
	height: 80px;
	width: 80px;
}

div.pagina_frame_chat div.page_title h2 span.chat-gather-menu{
	display: none;
	position: absolute;
	top: 100%;
	right: 0px;
	min-width: 280px;
	max-width: 380px;
	padding: 8px;
	border: 1px solid #7c562c;
	border-radius: 10px;
	background: linear-gradient(180deg, #f7e6c7 0%, #e3c590 100%);
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
	z-index: 35;
}

div.pagina_frame_chat div.page_title h2 span.chat-gather-menu.is-open{
	display: block;
}

/* I menu a tendina dell'intestazione (sottostanze e raccolta) sono racchiusi nel
   contesto di impilamento di .page_title (z-index: 2), quindi finirebbero sotto il
   riquadro delle note master (z-index: 6) e non riceverebbero i clic: mentre un menu
   è aperto si alza l'intero titolo sopra il riquadro. */
div.pagina_frame_chat div.page_title:has(span.chat-gather-menu.is-open),
div.pagina_frame_chat div.page_title:has(span.chat-linked-menu.is-open),
div.pagina_frame_chat div.page_title:has(span.chat-linked-wrap:hover) {
	z-index: 8;
}

div.pagina_frame_chat div.page_title h2 div.chat-gather-item{
	padding: 4px 0;
	border-bottom: 1px solid rgba(76, 50, 24, 0.25);
}

div.pagina_frame_chat div.page_title h2 div.chat-gather-item:last-child{
	border-bottom: none;
}

div.pagina_frame_chat div.page_title h2 button.chat-gather-start{
	width: 100%;
	text-align: left;
	border: 1px solid #7c562c;
	border-radius: 6px;
	padding: 4px 6px;
	background: rgba(255, 255, 255, 0.55);
	color: #2b1d0d;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
}

div.pagina_frame_chat div.page_title h2 button.chat-gather-start:hover{
	background: rgba(255, 255, 255, 0.78);
}

div.pagina_frame_chat div.page_title h2 div.chat-gather-objects{
	margin-top: 3px;
	padding: 0 2px;
	font-size: 10px;
	line-height: 1.25;
	color: #4b3216;
}

div.pagina_frame_chat div.page_title h2 span.chat-gather-busy{
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 8px;
	border: 1px solid #7c562c;
	border-radius: 14px;
	background: linear-gradient(180deg, #f7e6c7 0%, #d7b078 100%);
	color: #3f2b17;
}

div.pagina_frame_chat div.page_title h2 span.chat-gather-busy img{
	display: block;
	height: 22px;
	width: auto;
}

div.pagina_frame_chat div.page_title h2 span.chat-gather-busy-text{
	display: inline-flex;
	flex-direction: column;
	align-items: flex-end;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.15;
	white-space: nowrap;
}

div.pagina_frame_chat div.page_title h2 span.chat-gather-busy-text span#chat_gather_countdown{
	font-size: 12px;
	letter-spacing: 0.03em;
}

div.pagina_frame_chat div.page_title h2 span.chat-gather-busy-text small{
	font-size: 9px;
	font-weight: normal;
	line-height: 1.1;
	max-width: 180px;
	overflow: hidden;
	text-overflow: ellipsis;
}


div.pagina_frame_chat div.page_title h2 span.chat-title-meteo{
	font-size:11px;
	font-weight:normal;
	color:#000000;
	display:inline-flex;
	align-items:center;
	gap: 4px;
	line-height:1;
	white-space: nowrap;
}

div.pagina_frame_chat div.page_title h2 span.chat-title-meteo img{
	display:block;
	flex: 0 0 auto;
}

div.pagina_frame_chat div.page_title h2 span.chat-title-moons{
	display:inline-flex;
	align-items:center;
	column-gap: 4px;
	line-height: 1;
	white-space: nowrap;
}

div.pagina_frame_chat div.page_title h2 span.chat-title-moons img{
	height:20px;
	width:auto;
	vertical-align:middle;
}

div.pagina_frame_chat div.page_title h2 span.chat-title-info{
	display:inline-flex;
	align-items:center;
	line-height:1;
	white-space:nowrap;
}

div.pagina_frame_chat div.page_title h2 span.chat-title-info a{
	display:inline-flex;
	align-items:center;
}

div.pagina_frame_chat div.page_title h2 span.chat-title-info img.title-info-icon{
	display:block;
	width:auto;
	height:auto;
	max-width:none;
	flex: 0 0 auto;
	vertical-align:middle;
}

div.pagina_frame_chat div.page_title h2 button.chat-title-toggle{
	flex: 0 0 auto;
}

/**	* Fine fix */



/***** testo della chat *****/


/* Tipi messaggio: (A azione, N PNG, M Master,
I Immagine, S sussurro, D dado, C skill check, O uso oggetto) */

div.chat_row_A{
  margin-top:5px;
  color:#000000;
  display:block;
  overflow:visible;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

div.chat_row_A	span.color2{margin-top:5px;color:#002472; }

div.chat_row_A img.chat_avatar{
  display:block;
  float:left;
  width: 80px;
  height: 80px;
  min-width: 80px;
  min-height: 80px;
  max-width: 80px;
  max-height: 80px;
  margin:0 3px 0 0;
  box-sizing: border-box;
  object-fit: contain;
  object-position: center center;
  vertical-align:top;
}

div.chat_row_A span.chat_icons{
  float:left;
  margin: 0 4px 4px 1px;
}

div.chat_row_A img.chat_avatar + span.chat_icons{
  margin-top: 8px;
}

div.chat_row_A span.chat_icons,
div.chat_row_A span.chat_time,
div.chat_row_A span.chat_name,
div.chat_row_A span.chat_tag,
div.chat_row_A span.chat_msg{
  align-self: auto;
}

div.chat_row_A span.chat_msg{
  display: inline;
  flex: none;
  min-width: 0;
  max-width: none;
  overflow-wrap: anywhere;
  word-break: normal;
}

div.chat_row_A br.chat_clear{
  display:block;
  clear:both;
  height:0;
  overflow:hidden;
  font-size:0;
  line-height:0;
}

div.chat_row_M{
  margin: 10px 4px 8px;
  padding: 10px 14px 12px;
  border: 1px solid #b24a4a;
  border-left: 4px solid #8c1f1f;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 248, 248, 0.96) 0%, rgba(247, 232, 232, 0.94) 100%);
  box-shadow: 0 2px 8px rgba(99, 10, 10, 0.08);
  color: #631717;
  font-family: "Trebuchet MS", Verdana, Arial, sans-serif;
  font-size: 18px;
  font-weight: normal;
  font-style: normal;
  line-height: 1.55;
  text-align: left;
}

div.chat_row_M span.chat_time{
  margin: 0 6px 0 0;
  color: #8a3030;
  font-size: 0.72em;
  font-weight: 600;
  letter-spacing: 0.04em;
}

div.chat_row_M span.chat_master{
  display: inline;
  color: inherit;
  font-weight: normal;
  white-space: pre-line;
}

div.chat_row_M span.chat_master span.color2{
  color: #621372;
}

div.chat_row_T{
  margin-top:5px;
  padding:6px 8px;
  border: 2px solid #00004d;
  border-radius: 4px;
  background: #f2f2f2;
  color: #000000;
}

div.chat_row_T span.chat_name{
  color: #00004d;
}

div.chat_row_T span.chat_time{
  color: #00004d;
}

div.chat_row_T span.chat_msg{
  color: #000000;
}

div.chat_row_N{margin-top:5px; color: #300000}

div.chat_row_N	span.color2{margin-top:5px; color:#840000;}

div.chat_row_R{ 
   margin-top:5px;
   font-size:20px;
   font-weight: bold;
       font-style:  normal ;
       color: #310047;
      
      border-width: 2px;
      border-color:red;
      border-style: solid; 
   }

div.chat_row_I{
	margin-top: 5px;
   text-align: center;
}

div.chat_row_S{margin: 5 5 5 5px; color:#06003a;
font-style: italic}

div.chat_row_D10, div.chat_row_D100{
margin-top:5px;
 border-width: 2px;
   border-color: blue;
   border-style: solid;
   color: #310047;
}

.dice_red { color: rgb(99, 10, 10); font-weight: bold; }
.dice_green { color: rgb(7, 99, 7); font-weight: bold; }
.dice_blue  { color: rgb(7, 88, 180); font-weight: bold; }

div.chat_row_O{
margin-top:5px;
 border-width: 2px;
   border-color: blue;
   border-style: solid;
      color: #310047;
}

/* Spell Cast automatizzato */
div.chat_row_SC {
    margin-top: 5px;
    border-width: 2px;
    border-color: #8a4dff;
    border-style: solid;
    color: #310047;
    background: rgba(138, 77, 255, 0.04);
    padding: 4px 8px;
}

/* Combattimento automatizzato: tiri di attacco, difesa e risoluzione danni */
div.chat_row_CB {
    margin-top: 5px;
    border-width: 2px;
    border-color: #b3402a;
    border-style: solid;
    color: #4a1004;
    background: rgba(179, 64, 42, 0.05);
    padding: 4px 8px;
}

div.chat_row_response_collapsible {
    cursor: pointer;
}

div.chat_row_C span.chat_msg .chat_response_compact,
div.chat_row_D10 span.chat_msg .chat_response_compact,
div.chat_row_D100 span.chat_msg .chat_response_compact,
div.chat_row_O span.chat_msg .chat_response_compact,
div.chat_row_SC span.chat_msg .chat_response_compact,
div.chat_row_CB span.chat_msg .chat_response_compact {
    display: inline;
    box-sizing: border-box;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    border-width: 0;
    border-style: none;
    overflow-wrap: anywhere;
    word-break: normal;
    color: inherit;
    font-weight: inherit;
    line-height: inherit;
    cursor: pointer;
    outline: none;
    transform: none;
}

div.chat_row_C span.chat_msg .chat_response_compact:hover,
div.chat_row_C span.chat_msg .chat_response_compact:focus,
div.chat_row_D10 span.chat_msg .chat_response_compact:hover,
div.chat_row_D10 span.chat_msg .chat_response_compact:focus,
div.chat_row_D100 span.chat_msg .chat_response_compact:hover,
div.chat_row_D100 span.chat_msg .chat_response_compact:focus,
div.chat_row_O span.chat_msg .chat_response_compact:hover,
div.chat_row_O span.chat_msg .chat_response_compact:focus,
div.chat_row_SC span.chat_msg .chat_response_compact:hover,
div.chat_row_SC span.chat_msg .chat_response_compact:focus,
div.chat_row_CB span.chat_msg .chat_response_compact:hover,
div.chat_row_CB span.chat_msg .chat_response_compact:focus {
    display: inline;
    box-sizing: border-box;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    border-width: 0;
    border-style: none;
    color: inherit;
    font-weight: inherit;
    line-height: inherit;
    transform: none;
    outline: none;
}

.chat_response_summary {
    display: inline;
    cursor: pointer;
}

.chat_response_summary_line {
    display: block;
    margin: 0;
    padding: 0;
    line-height: 1.25;
}

.chat_response_summary_line:first-child {
    display: inline;
}

.chat_response_detail {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid rgba(84, 49, 24, 0.24);
    overflow-wrap: anywhere;
    word-break: normal;
}

.chat_response_detail[hidden] {
    display: none !important;
}

.chat_response_compact.is-expanded .chat_response_summary {
    display: none;
}

.chat_response_compact.is-expanded .chat_response_detail {
    display: inline;
    width: auto;
    max-width: none;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

/* Registro di servizio dell'arbitraggio: riga visibile solo dai Master in su */
div.chat_row_SM {
    margin-top: 5px;
    border: 1px dashed #6b6f7a;
    color: #3a3f4a;
    background: rgba(107, 111, 122, 0.06);
    padding: 3px 8px;
    font-size: 0.92em;
    font-style: italic;
}

div.chat_row_SM span.chat_tag {
    color: #5a5f6b;
    font-style: normal;
}

/* Richiesta di difesa: visibile solo al bersaglio (bottoni) e all'attaccante (attesa) */
div.chat_row_DF {
    margin-top: 5px;
    border: 2px dashed #b3402a;
    color: #4a1004;
    background: rgba(179, 64, 42, 0.08);
    padding: 4px 8px;
}

div.chat_row_DF--waiting {
    border-style: dotted;
    opacity: 0.75;
    font-style: italic;
}

div.chat_row_DF button.cb_defend_btn,
div.chat_row_DF button.cb_nodef_btn,
div.chat_row_DF button.cb_accept_btn,
div.chat_row_DF button.pe_choose_btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    height: 24px;
    padding: 0 12px;
    margin: 2px 4px 2px 0;
    background: linear-gradient(180deg, #f0dca8 0%, #c8a060 100%);
    border: 1px solid #7c562c;
    border-radius: 6px;
    color: #2b1d0d;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    box-sizing: border-box;
    transform: none;
}

/* Bottone del rituale Permanenza: tinta violacea dedicata */
div.chat_row_DF button.pe_choose_btn {
    background: linear-gradient(180deg, #e4d6f2 0%, #ab8cc9 100%);
    border-color: #5c3c7c;
}

div.chat_row_DF button.cb_nodef_btn {
    background: linear-gradient(180deg, #e8d8c0 0%, #b8a488 100%);
}

div.chat_row_DF button.cb_accept_btn {
    background: linear-gradient(180deg, #d8ecc8 0%, #9cc47c 100%);
    border-color: #4a7c2c;
}

div.chat_row_DF button.cb_defend_btn:hover,
div.chat_row_DF button.cb_defend_btn:focus,
div.chat_row_DF button.cb_nodef_btn:hover,
div.chat_row_DF button.cb_nodef_btn:focus,
div.chat_row_DF button.cb_accept_btn:hover,
div.chat_row_DF button.cb_accept_btn:focus,
div.chat_row_DF button.pe_choose_btn:hover,
div.chat_row_DF button.pe_choose_btn:focus {
    display: inline-flex;
    box-sizing: border-box;
    min-height: 24px;
    height: 24px;
    padding: 0 12px;
    margin: 2px 4px 2px 0;
    border-width: 1px;
    border-style: solid;
    border-color: #b3402a;
    font-weight: 600;
    line-height: 1;
    transform: none;
    background: linear-gradient(180deg, #f6e6ba 0%, #d4ac6c 100%);
    color: #2b1d0d;
}

/* Hover del bottone "Accetta la cura": mantiene la tinta verde */
div.chat_row_DF button.cb_accept_btn:hover,
div.chat_row_DF button.cb_accept_btn:focus {
    background: linear-gradient(180deg, #e2f2d4 0%, #aacf8c 100%);
    border-color: #4a7c2c;
}

/* Hover del bottone Permanenza: mantiene la tinta violacea */
div.chat_row_DF button.pe_choose_btn:hover,
div.chat_row_DF button.pe_choose_btn:focus {
    background: linear-gradient(180deg, #ece0f8 0%, #ba9cd6 100%);
    border-color: #5c3c7c;
}

/* Select compatta dei bersagli (tab Attacchi, pannello spell, effetti magici).
   Selezione multipla: Ctrl/Cmd+click per aggiungere bersagli. */
div.pagina_frame_chat select.ap_targets_select {
    min-width: 130px;
    max-width: 200px;
    max-height: 58px;
    overflow-y: auto;
    padding: 2px 4px;
    font-size: 11px;
    line-height: 1.4;
    box-sizing: border-box;
}

div.pagina_frame_chat select.ap_targets_select option {
    padding: 1px 4px;
}

div.pagina_frame_chat .ap_targets_refresh {
    display: inline-block;
    box-sizing: border-box;
    background: none;
    border-width: 0;
    border-style: none;
    cursor: pointer;
    color: #7c562c;
    font-size: 12px;
    font-weight: normal;
    line-height: 1;
    padding: 0 2px;
    margin: 0;
    min-height: auto;
    height: auto;
    width: auto;
    box-shadow: none;
    transform: none;
}

div.pagina_frame_chat .ap_targets_refresh:hover,
div.pagina_frame_chat .ap_targets_refresh:focus {
    display: inline-block;
    box-sizing: border-box;
    background: none;
    border-width: 0;
    border-style: none;
    padding: 0 2px;
    margin: 0;
    min-height: auto;
    height: auto;
    width: auto;
    font-size: 12px;
    font-weight: normal;
    line-height: 1;
    transform: none;
    color: #2b1d0d;
}

/* Pulsante bersagli con popup condiviso per attacchi, spell ed effetti magici */
div.pagina_frame_chat div.cp_field--targets {
	flex: 0 0 auto;
	min-width: 120px;
}

div.pagina_frame_chat .chat-target-picker {
	width: 100%;
	min-width: 120px;
	max-width: 190px;
	box-sizing: border-box;
}

div.pagina_frame_chat .chat-target-picker--hidden {
	display: none;
}

div.pagina_frame_chat .chat-target-picker__inputs {
	display: none;
}

div.pagina_frame_chat .chat-target-picker__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 30px;
	height: 30px;
	margin: 0;
	padding: 0 10px;
	border-width: 1px;
	border-style: solid;
	border-color: rgba(124, 86, 44, 0.55);
	border-radius: 8px;
	box-sizing: border-box;
	background: rgba(255, 255, 255, 0.84);
	color: #4f351b;
	font-family: Georgia, serif;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.25;
	text-align: center;
	cursor: pointer;
	box-shadow: inset 0 1px 1px rgba(30, 18, 6, 0.06);
	transform: none;
	white-space: nowrap;
	overflow: hidden;
}

div.pagina_frame_chat .chat-target-picker__button:hover,
div.pagina_frame_chat .chat-target-picker__button:focus {
	display: inline-flex;
	box-sizing: border-box;
	width: 100%;
	min-height: 30px;
	height: 30px;
	margin: 0;
	padding: 0 10px;
	border-width: 1px;
	border-style: solid;
	border-color: #7c562c;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.96);
	color: #4f351b;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.25;
	box-shadow: 0 0 0 2px rgba(200, 160, 96, 0.22), inset 0 1px 1px rgba(30, 18, 6, 0.06);
	transform: none;
	outline: none;
}

div.pagina_frame_chat .chat-target-picker__button.is-selected,
div.pagina_frame_chat .chat-target-picker__button.is-selected:hover,
div.pagina_frame_chat .chat-target-picker__button.is-selected:focus {
	border-color: #7a2d17;
	background: linear-gradient(180deg, #f0dca8 0%, #c8a060 100%);
	color: #4f351b;
}

div.pagina_frame_chat .chat-target-picker__summary {
	display: block;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Popup bersagli: stile coordinato al popup difesa */
div.pagina_frame_chat .chat_note_overlay.cb_targets_overlay {
	background: rgba(30, 18, 6, 0.14);
	z-index: 4820;
}

div.pagina_frame_chat .chat_note_popup.cb_targets_popup {
	left: 50%;
	top: 8%;
	transform: translateX(-50%);
	width: min(760px, calc(100% - 28px));
	min-width: 420px;
	min-height: 140px;
	max-width: calc(100% - 28px);
	max-height: calc(100vh - 16px);
	background: linear-gradient(180deg, #fff8eb 0%, #f6ead2 100%);
	border-color: #8a6234;
	box-shadow: 0 14px 42px rgba(20, 10, 2, 0.34), 0 0 0 1px rgba(255, 255, 255, 0.45) inset;
	resize: none;
	user-select: text;
}

div.pagina_frame_chat .cb_targets_resize_handle,
div.pagina_frame_chat .cb_defense_resize_handle {
	position: absolute;
	right: 5px;
	bottom: 5px;
	z-index: 2;
	width: 16px;
	height: 16px;
	box-sizing: border-box;
	cursor: nwse-resize;
	touch-action: none;
	background:
		linear-gradient(135deg, transparent 0 52%, rgba(124, 86, 44, 0.58) 52% 60%, transparent 60%),
		linear-gradient(135deg, transparent 0 70%, rgba(124, 86, 44, 0.42) 70% 78%, transparent 78%);
}

div.pagina_frame_chat .cb_targets_popup .chat_note_header {
	background: linear-gradient(180deg, #ead7ad 0%, #d4b77c 100%);
	border-bottom-color: rgba(124, 86, 44, 0.42);
}

div.pagina_frame_chat .chat_note_body.cb_targets_body {
	flex: 1 1 auto;
	min-height: 0;
	max-height: none;
	overflow-y: auto;
	padding: 14px 16px 12px;
	gap: 10px;
	color: #2b1d0d;
}

div.pagina_frame_chat .cb_targets_panel {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	min-height: 0;
	width: 100%;
	box-sizing: border-box;
	color: #2b1d0d;
	font-family: Georgia, serif;
}

div.pagina_frame_chat .cb_targets_toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin: 0 0 10px;
}

div.pagina_frame_chat .cb_targets_modes {
	display: inline-flex;
	min-height: 34px;
	height: 34px;
	border: 1px solid rgba(124, 86, 44, 0.55);
	border-radius: 8px;
	overflow: hidden;
	box-sizing: border-box;
	background: rgba(255, 255, 255, 0.58);
}

div.pagina_frame_chat .cb_targets_mode_button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 32px;
	height: 32px;
	width: auto;
	margin: 0;
	padding: 0 14px;
	border-width: 0 1px 0 0;
	border-style: solid;
	border-color: rgba(124, 86, 44, 0.42);
	border-radius: 0;
	box-sizing: border-box;
	background: rgba(255, 255, 255, 0.52);
	color: #3f2b17;
	font-family: Georgia, serif;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	box-shadow: none;
	transform: none;
}

div.pagina_frame_chat .cb_targets_mode_button:last-child {
	border-right-width: 0;
}

div.pagina_frame_chat .cb_targets_mode_button:hover,
div.pagina_frame_chat .cb_targets_mode_button:focus {
	display: inline-flex;
	box-sizing: border-box;
	min-height: 32px;
	height: 32px;
	width: auto;
	margin: 0;
	padding: 0 14px;
	border-width: 0 1px 0 0;
	border-style: solid;
	border-color: rgba(124, 86, 44, 0.42);
	border-radius: 0;
	background: rgba(255, 255, 255, 0.76);
	color: #2b1d0d;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	box-shadow: none;
	transform: none;
	outline: none;
}

div.pagina_frame_chat .cb_targets_mode_button:last-child:hover,
div.pagina_frame_chat .cb_targets_mode_button:last-child:focus {
	border-right-width: 0;
}

div.pagina_frame_chat .cb_targets_mode_button.is-active,
div.pagina_frame_chat .cb_targets_mode_button.is-active:hover,
div.pagina_frame_chat .cb_targets_mode_button.is-active:focus {
	background: linear-gradient(180deg, #f0dca8 0%, #c8a060 100%);
	color: #2b1d0d;
	font-weight: 700;
}

div.pagina_frame_chat .cb_targets_refresh {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	width: 34px;
	min-height: 34px;
	height: 34px;
	margin: 0;
	padding: 0;
	border-width: 1px;
	border-style: solid;
	border-color: rgba(124, 86, 44, 0.55);
	border-radius: 8px;
	box-sizing: border-box;
	background: rgba(255, 255, 255, 0.72);
	color: #5a3a18;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	box-shadow: none;
	transform: none;
}

div.pagina_frame_chat .cb_targets_refresh:hover,
div.pagina_frame_chat .cb_targets_refresh:focus {
	display: inline-flex;
	box-sizing: border-box;
	min-width: 34px;
	width: 34px;
	min-height: 34px;
	height: 34px;
	margin: 0;
	padding: 0;
	border-width: 1px;
	border-style: solid;
	border-color: #7c562c;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.92);
	color: #2b1d0d;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	box-shadow: 0 0 0 2px rgba(200, 160, 96, 0.22);
	transform: none;
	outline: none;
}

div.pagina_frame_chat .cb_targets_sections {
	flex: 0 0 auto;
	min-height: 0;
	width: 100%;
	min-width: 0;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	overflow: visible;
}

div.pagina_frame_chat .cb_targets_section {
	display: none;
	margin: 0;
	padding: 0;
}

div.pagina_frame_chat .cb_targets_section.is-active {
	display: block;
	width: 100%;
	min-width: 0;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	overflow: visible;
}

div.pagina_frame_chat .cb_targets_list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	margin: 0;
	padding: 0;
}

div.pagina_frame_chat .cb_targets_list--players {
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

div.pagina_frame_chat .cb_targets_object_columns {
	display: block;
	width: 100%;
	min-width: 0;
	margin: 0;
	box-sizing: border-box;
}

div.pagina_frame_chat .cb_targets_object_groups {
	display: flex;
	flex-flow: row nowrap;
	gap: 8px;
	align-items: stretch;
	width: 100%;
	min-width: 0;
	margin: 0;
	overflow-x: auto;
	overflow-y: hidden;
	padding-bottom: 4px;
}

div.pagina_frame_chat .cb_targets_object_group {
	display: flex;
	flex-direction: column;
	flex: 0 1 236px;
	min-width: 220px;
	max-width: 252px;
	min-height: 0;
	max-height: 382px;
	margin: 0;
	padding: 5px;
	border: 1px solid rgba(124, 86, 44, 0.22);
	border-radius: 6px;
	box-sizing: border-box;
	background: rgba(255, 255, 255, 0.34);
	overflow: hidden;
}

div.pagina_frame_chat .cb_targets_object_group--self {
	flex-basis: 244px;
}

div.pagina_frame_chat .cb_targets_object_group--other {
	flex-basis: 236px;
}

div.pagina_frame_chat .cb_targets_object_group_title {
	flex: 0 0 auto;
	margin: 0 0 6px;
	color: #3f2b17;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.2;
}

div.pagina_frame_chat .cb_targets_object_group .cb_targets_list--items {
	flex: 1 1 auto;
	min-height: 0;
	max-height: 332px;
	grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
	gap: 5px;
	align-content: start;
	overflow-y: auto;
	padding-right: 2px;
	scrollbar-gutter: stable;
}

div.pagina_frame_chat .cb_targets_object_group--self .cb_targets_list--items {
	max-height: none;
	grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
	overflow-y: visible;
	padding-right: 0;
	scrollbar-gutter: auto;
}

div.pagina_frame_chat .cb_targets_object_self_sections {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 8px;
	min-height: 0;
	max-height: 332px;
	margin: 0;
	overflow-y: auto;
	padding-right: 2px;
	scrollbar-gutter: stable;
}

div.pagina_frame_chat .cb_targets_object_subsection {
	min-width: 0;
	margin: 0;
}

div.pagina_frame_chat .cb_targets_object_subtitle {
	margin: 0 0 5px;
	color: #5a3a18;
	font-size: 10px;
	font-weight: 700;
	line-height: 1.2;
	text-align: left;
}

div.pagina_frame_chat .cb_targets_choice {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	min-height: 38px;
	margin: 0;
	padding: 8px 9px;
	border: 1px solid rgba(124, 86, 44, 0.28);
	border-radius: 8px;
	box-sizing: border-box;
	background: rgba(255, 255, 255, 0.58);
	color: #2b1d0d;
	font-weight: normal;
	line-height: normal;
	cursor: pointer;
	transform: none;
}

div.pagina_frame_chat .cb_targets_choice:hover,
div.pagina_frame_chat .cb_targets_choice:focus-within {
	display: flex;
	box-sizing: border-box;
	min-height: 38px;
	margin: 0;
	padding: 8px 9px;
	border-width: 1px;
	border-style: solid;
	border-color: rgba(124, 86, 44, 0.54);
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.78);
	color: #2b1d0d;
	font-weight: normal;
	line-height: normal;
	transform: none;
}

div.pagina_frame_chat .cb_targets_choice--object {
	min-height: 46px;
	padding: 6px 7px;
	gap: 6px;
}

div.pagina_frame_chat .cb_targets_choice--object:hover,
div.pagina_frame_chat .cb_targets_choice--object:focus-within {
	display: flex;
	box-sizing: border-box;
	min-height: 46px;
	margin: 0;
	padding: 6px 7px;
	border-width: 1px;
	border-style: solid;
	border-color: rgba(124, 86, 44, 0.54);
	border-radius: 8px;
	font-weight: normal;
	line-height: normal;
	transform: none;
}

div.pagina_frame_chat .cb_targets_choice input[type="checkbox"] {
	flex: 0 0 auto;
	width: 15px;
	height: 15px;
	margin: 1px 0 0;
}

div.pagina_frame_chat .cb_targets_choice__text {
	display: flex;
	flex-direction: column;
	min-width: 0;
	gap: 2px;
}

div.pagina_frame_chat .cb_targets_choice--object .cb_targets_choice__text {
	gap: 1px;
	width: 100%;
}

div.pagina_frame_chat .cb_targets_choice__label {
	color: #2b1d0d;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
}

div.pagina_frame_chat .cb_targets_choice--object .cb_targets_choice__label {
	display: block;
	max-width: 100%;
	overflow: visible;
	overflow-wrap: anywhere;
	text-overflow: clip;
	white-space: normal;
	font-size: 11px;
	line-height: 1.2;
}

div.pagina_frame_chat .cb_targets_choice__detail {
	color: #6c4a22;
	font-size: 11px;
	font-weight: normal;
	line-height: 1.25;
}

div.pagina_frame_chat .cb_targets_choice--object .cb_targets_choice__detail {
	display: block;
	max-width: 100%;
	overflow: visible;
	overflow-wrap: anywhere;
	text-overflow: clip;
	white-space: normal;
	font-size: 10px;
	line-height: 1.2;
}

div.pagina_frame_chat .cb_targets_empty {
	margin: 0;
	padding: 16px 12px;
	border: 1px solid rgba(124, 86, 44, 0.24);
	border-radius: 8px;
	box-sizing: border-box;
	background: rgba(255, 255, 255, 0.48);
	color: #5a3a18;
	font-size: 12px;
	font-style: italic;
	line-height: 1.35;
	text-align: center;
}

div.pagina_frame_chat .cb_targets_object_group .cb_targets_empty {
	padding: 10px 8px;
	font-size: 11px;
	line-height: 1.25;
}

div.pagina_frame_chat .cb_targets_aim {
	display: flex;
	flex: 0 0 auto;
	flex-direction: column;
	gap: 10px;
	width: 100%;
	margin: 12px 0 0;
	padding: 12px 0 0;
	border-top: 1px solid rgba(124, 86, 44, 0.20);
	box-sizing: border-box;
	clear: both;
}

div.pagina_frame_chat .cb_targets_aim_area {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-weight: bold;
	cursor: pointer;
}

div.pagina_frame_chat .cb_targets_aim_area input {
	margin: 0;
}

div.pagina_frame_chat .cb_targets_aim_hint {
	margin: 0;
	font-size: 0.8em;
	opacity: 0.75;
	line-height: 1.3;
}

div.pagina_frame_chat .cb_targets_aim_list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
}

div.pagina_frame_chat .cb_targets_aim_row {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
	padding: 8px;
	border: 1px solid rgba(124, 86, 44, 0.20);
	border-radius: 6px;
}

div.pagina_frame_chat .cb_targets_aim_name {
	font-weight: bold;
	font-size: 0.9em;
}

div.pagina_frame_chat .cb_targets_aim_row_controls {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
}

div.pagina_frame_chat .cb_targets_aim_field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1 1 150px;
	min-width: 130px;
	margin: 0;
}

div.pagina_frame_chat .cb_targets_aim_label {
	font-size: 0.78em;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	opacity: 0.8;
}

div.pagina_frame_chat .cb_targets_aim_select {
	width: 100%;
	margin: 0;
}

div.pagina_frame_chat .cb_targets_empty_confirm {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin: 12px 0 0;
	padding: 10px 12px;
	border: 1px solid rgba(179, 64, 42, 0.45);
	border-radius: 8px;
	box-sizing: border-box;
	background: rgba(255, 242, 220, 0.92);
	color: #4f2418;
	font-family: Georgia, serif;
	font-size: 12px;
	line-height: 1.3;
}

div.pagina_frame_chat .cb_targets_empty_confirm__text {
	flex: 1 1 auto;
	min-width: 0;
	font-weight: 600;
}

div.pagina_frame_chat .cb_targets_empty_confirm__actions {
	display: inline-flex;
	flex: 0 0 auto;
	gap: 6px;
}

div.pagina_frame_chat .cb_targets_empty_confirm__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 46px;
	min-height: 28px;
	height: 28px;
	margin: 0;
	padding: 0 11px;
	border-width: 1px;
	border-style: solid;
	border-color: rgba(124, 86, 44, 0.62);
	border-radius: 7px;
	box-sizing: border-box;
	background: rgba(255, 255, 255, 0.72);
	color: #3f2b17;
	font-family: Georgia, serif;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	box-shadow: none;
	transform: none;
}

div.pagina_frame_chat .cb_targets_empty_confirm__button:hover,
div.pagina_frame_chat .cb_targets_empty_confirm__button:focus {
	display: inline-flex;
	box-sizing: border-box;
	min-width: 46px;
	min-height: 28px;
	height: 28px;
	margin: 0;
	padding: 0 11px;
	border-width: 1px;
	border-style: solid;
	border-color: #7c562c;
	border-radius: 7px;
	background: rgba(255, 255, 255, 0.92);
	color: #2b1d0d;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	box-shadow: none;
	transform: none;
	outline: none;
}

div.pagina_frame_chat .cb_targets_empty_confirm__button--yes {
	background: linear-gradient(180deg, #f0dca8 0%, #c8a060 100%);
	border-color: #7c562c;
}

div.pagina_frame_chat .cb_targets_actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	padding: 10px 0 0;
	margin-top: 10px;
	border-top: 1px solid rgba(124, 86, 44, 0.20);
}

div.pagina_frame_chat .cb_targets_action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 34px;
	height: 34px;
	width: auto;
	margin: 0;
	padding: 0 18px;
	border-width: 1px;
	border-style: solid;
	border-color: #7c562c;
	border-radius: 8px;
	box-sizing: border-box;
	background: linear-gradient(180deg, #f0dca8 0%, #c8a060 100%);
	color: #2b1d0d;
	font-family: Georgia, serif;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	box-shadow: none;
	transform: none;
}

div.pagina_frame_chat .cb_targets_action--secondary {
	background: rgba(255, 255, 255, 0.66);
	color: #5a3a18;
}

div.pagina_frame_chat .cb_targets_action:hover,
div.pagina_frame_chat .cb_targets_action:focus {
	display: inline-flex;
	box-sizing: border-box;
	min-height: 34px;
	height: 34px;
	width: auto;
	margin: 0;
	padding: 0 18px;
	border-width: 1px;
	border-style: solid;
	border-color: #b3402a;
	border-radius: 8px;
	background: linear-gradient(180deg, #f6e6ba 0%, #d4ac6c 100%);
	color: #2b1d0d;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	box-shadow: none;
	transform: none;
	outline: none;
}

@media (max-width: 760px) {
	div.pagina_frame_chat .chat_note_popup.cb_targets_popup {
		top: 5%;
		width: auto;
		min-width: 0;
		min-height: 140px;
		max-width: none;
		left: 10px;
		right: 10px;
		transform: none;
	}
	div.pagina_frame_chat .cb_targets_resize_handle,
	div.pagina_frame_chat .cb_defense_resize_handle {
		display: none;
	}
	div.pagina_frame_chat .cb_targets_list {
		grid-template-columns: 1fr;
	}
	div.pagina_frame_chat .cb_targets_object_groups {
		flex-flow: row nowrap;
	}
	div.pagina_frame_chat .cb_targets_object_group,
	div.pagina_frame_chat .cb_targets_object_group--self {
		flex: 0 1 230px;
		min-width: 214px;
	}
}

@media (max-width: 480px) {
	div.pagina_frame_chat .chat_note_body.cb_targets_body {
		padding: 12px 10px 10px;
	}
	div.pagina_frame_chat .cb_targets_toolbar,
	div.pagina_frame_chat .cb_targets_actions {
		align-items: stretch;
	}
	div.pagina_frame_chat .cb_targets_actions {
		flex-direction: column;
	}
	div.pagina_frame_chat .cb_targets_action,
	div.pagina_frame_chat .cb_targets_action:hover,
	div.pagina_frame_chat .cb_targets_action:focus {
		width: 100%;
	}
	div.pagina_frame_chat .cb_targets_empty_confirm {
		align-items: stretch;
		flex-direction: column;
	}
	div.pagina_frame_chat .cb_targets_empty_confirm__actions {
		justify-content: flex-end;
	}
}

/* Popup difesa: finestra centrata dentro l'overlay fixed */
div.pagina_frame_chat .cb_defense_overlay {
	background: rgba(30, 18, 6, 0.14);
}

div.pagina_frame_chat .cb_defense_popup {
	left: 50%;
	top: 8%;
	transform: translateX(-50%);
	width: 760px;
	min-width: 420px;
	min-height: 140px;
	max-width: calc(100% - 28px);
	max-height: calc(100vh - 16px);
	background: linear-gradient(180deg, #fff8eb 0%, #f6ead2 100%);
	border-color: #8a6234;
	box-shadow: 0 14px 42px rgba(20, 10, 2, 0.34), 0 0 0 1px rgba(255, 255, 255, 0.45) inset;
	resize: none;
	user-select: text;
}

div.pagina_frame_chat .cb_defense_popup .chat_note_header {
	background: linear-gradient(180deg, #ead7ad 0%, #d4b77c 100%);
	border-bottom-color: rgba(124, 86, 44, 0.42);
}

div.pagina_frame_chat .cb_defense_body {
	flex: 1 1 auto;
	min-height: 0;
	max-height: none;
	overflow-y: auto;
	padding: 14px 16px 12px;
	gap: 10px;
	color: #2b1d0d;
}

div.pagina_frame_chat .cb_defense_panel {
	min-height: 0;
	width: 100%;
	box-sizing: border-box;
	color: #2b1d0d;
	font-family: Georgia, serif;
}

div.pagina_frame_chat .cb_defense_info {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 3px 6px;
    font-size: 13px;
	line-height: 1.45;
	text-align: center;
    padding: 10px 12px;
    border: 1px solid rgba(124, 86, 44, 0.30);
	border-radius: 10px;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.76) 0%, rgba(236, 214, 174, 0.42) 100%);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
	color: #2b1d0d;
}

div.pagina_frame_chat .cb_defense_info .cb_defense_attacker {
    font-weight: 600;
	color: #7a2d17;
}

div.pagina_frame_chat .cb_defense_info strong {
	color: #3f220e;
}

div.pagina_frame_chat .cb_defense_body div.warning,
div.pagina_frame_chat .cb_defense_body div.error {
	margin: 0;
	padding: 9px 12px;
	border-width: 1px;
	border-style: solid;
	border-radius: 9px;
	background-image: none;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.35;
	text-align: center;
	box-sizing: border-box;
	text-shadow: none;
}

div.pagina_frame_chat .cb_defense_body div.warning {
	border-color: rgba(157, 104, 38, 0.52);
	background: #f4e5c4;
	color: #3a2411;
}

div.pagina_frame_chat .cb_defense_body div.error {
	border-color: rgba(128, 0, 0, 0.46);
	background: #f2d2c8;
	color: #5a170e;
}

div.pagina_frame_chat .cb_defense_resolved_note {
    font-size: 12px;
}

div.pagina_frame_chat .cb_defense_row {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	align-items: start;
	gap: 10px 8px;
    padding: 2px 0 4px;
	margin: 0;
}

div.pagina_frame_chat .cb_defense_row > div.cp_field {
	grid-column: span 3;
	min-width: 0;
	width: auto;
	margin: 0;
}

div.pagina_frame_chat .cb_defense_row > div.cp_field:first-child {
	grid-column: span 3;
}

div.pagina_frame_chat .cb_defense_row > div#dp_stat_field {
	grid-column: span 2;
}

div.pagina_frame_chat .cb_defense_row > div#dp_spec_field {
	grid-column: span 3;
}

div.pagina_frame_chat .cb_defense_row > div#dp_reaction_field,
div.pagina_frame_chat .cb_defense_row > div#dp_item_field {
	grid-column: span 6;
}

div.pagina_frame_chat .cb_defense_row > div#dp_nocomp_field {
	grid-column: span 3;
}

div.pagina_frame_chat .cb_defense_row > div.cp_field--spell-adv {
	grid-column: span 4;
}

div.pagina_frame_chat .cb_defense_row > div.cp_field--s {
	grid-column: span 2;
	max-width: none;
}

div.pagina_frame_chat .cb_defense_panel select {
	width: 100%;
	min-height: 34px;
	height: 34px;
	margin: 0;
	padding: 4px 9px;
	box-sizing: border-box;
	background: rgba(255, 255, 255, 0.86);
	border: 1px solid rgba(124, 86, 44, 0.55);
	border-radius: 8px;
	color: #1e1206;
	font-size: 12px;
	font-family: Georgia, serif;
	line-height: 1.2;
	outline: none;
	box-shadow: inset 0 1px 1px rgba(30, 18, 6, 0.07);
}

div.pagina_frame_chat .cb_defense_panel select:focus {
	border-color: #7c562c;
	box-shadow: 0 0 0 2px rgba(200, 160, 96, 0.22), inset 0 1px 1px rgba(30, 18, 6, 0.07);
}

div.pagina_frame_chat .cb_defense_panel .sc_checkbox_label {
	height: 34px;
	margin: 0;
	background: rgba(255, 255, 255, 0.58);
	border: 1px solid rgba(124, 86, 44, 0.55);
	border-radius: 8px;
	box-sizing: border-box;
}

div.pagina_frame_chat .cb_defense_panel .sc_checkbox_label input[type="checkbox"] {
	width: 16px;
	height: 16px;
	margin: 0;
}

div.pagina_frame_chat .cb_defense_panel span.cp_label {
	margin-top: 4px;
	padding-top: 0;
	color: #5a3a18;
	font-size: 10px;
	line-height: 1.25;
	letter-spacing: 0.04em;
	white-space: normal;
}

div.pagina_frame_chat .cb_defense_panel div.adv-toggle {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 34px;
	margin: 0;
	border: 1px solid rgba(124, 86, 44, 0.55);
	border-radius: 8px;
	overflow: hidden;
	box-sizing: border-box;
	background: rgba(255, 255, 255, 0.58);
}

div.pagina_frame_chat .cb_defense_panel div.adv-btn-row {
	display: flex;
	width: 100%;
	height: 100%;
}

div.pagina_frame_chat .cb_defense_panel button.adv-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 1 1 0;
	min-width: 0;
	min-height: 32px;
	height: 32px;
	width: auto;
	margin: 0;
	padding: 0 8px;
	border-width: 0 1px 0 0;
	border-style: solid;
	border-color: rgba(124, 86, 44, 0.42);
	border-radius: 0;
	background: rgba(255, 255, 255, 0.52);
	color: #3f2b17;
	font-size: 11px;
	font-family: Georgia, serif;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	box-sizing: border-box;
	box-shadow: none;
	transform: none;
	white-space: nowrap;
}

div.pagina_frame_chat .cb_defense_panel button.adv-btn:last-of-type {
	border-right-width: 0;
}

div.pagina_frame_chat .cb_defense_panel button.adv-btn:hover,
div.pagina_frame_chat .cb_defense_panel button.adv-btn:focus {
	display: inline-flex;
	box-sizing: border-box;
	min-height: 32px;
	height: 32px;
	width: auto;
	margin: 0;
	padding: 0 8px;
	border-width: 0 1px 0 0;
	border-style: solid;
	border-color: rgba(124, 86, 44, 0.42);
	border-radius: 0;
	background: rgba(255, 255, 255, 0.76);
	color: #2b1d0d;
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
	box-shadow: none;
	transform: none;
	outline: none;
}

div.pagina_frame_chat .cb_defense_panel button.adv-btn:last-of-type:hover,
div.pagina_frame_chat .cb_defense_panel button.adv-btn:last-of-type:focus {
	border-right-width: 0;
}

div.pagina_frame_chat .cb_defense_panel button.adv-btn.active,
div.pagina_frame_chat .cb_defense_panel button.adv-btn.active:hover,
div.pagina_frame_chat .cb_defense_panel button.adv-btn.active:focus {
	background: linear-gradient(180deg, #f0dca8 0%, #c8a060 100%);
	color: #2b1d0d;
	font-weight: 700;
}

div.pagina_frame_chat .cb_defense_hint {
    font-size: 11px;
    font-style: italic;
	line-height: 1.35;
    opacity: 1;
    padding: 8px 10px;
	border-left: 3px solid rgba(124, 86, 44, 0.42);
	border-radius: 7px;
	background: rgba(255, 255, 255, 0.45);
	color: #5a3a18;
}

div.pagina_frame_chat .cb_defense_actions {
    display: flex;
    justify-content: flex-end;
    padding: 10px 0 0;
	margin-top: 2px;
	border-top: 1px solid rgba(124, 86, 44, 0.20);
}

/* Popup del rituale Permanenza: elenco degli effetti stabilizzabili */
div.pagina_frame_chat .pe_permanence_list {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 10px 0;
}

div.pagina_frame_chat .pe_permanence_option {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	padding: 8px 10px;
	border: 1px solid rgba(124, 86, 44, 0.35);
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.45);
	cursor: pointer;
}

div.pagina_frame_chat .pe_permanence_option--fail {
	border-style: dashed;
	opacity: 0.8;
}

div.pagina_frame_chat .pe_permanence_option input[type="radio"] {
	margin-top: 3px;
	flex: 0 0 auto;
}

div.pagina_frame_chat .pe_permanence_option_body {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

div.pagina_frame_chat .pe_permanence_option_title {
	font-weight: 600;
	color: #2b1d0d;
	font-size: 12px;
}

div.pagina_frame_chat .pe_permanence_option_meta {
	font-size: 11px;
	color: #5a3a18;
}

div.pagina_frame_chat .cb_defense_submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    height: 34px;
	width: auto;
    padding: 0 20px;
    margin: 0;
    background: linear-gradient(180deg, #f0dca8 0%, #c8a060 100%);
    border: 1px solid #7c562c;
    border-radius: 9px;
    color: #2b1d0d;
    font-size: 12px;
	font-family: Georgia, serif;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    box-sizing: border-box;
    transform: none;
}

div.pagina_frame_chat .cb_defense_submit:hover,
div.pagina_frame_chat .cb_defense_submit:focus {
    display: inline-flex;
    box-sizing: border-box;
    min-height: 34px;
    height: 34px;
	width: auto;
    padding: 0 20px;
    margin: 0;
    border-width: 1px;
    border-style: solid;
    border-color: #b3402a;
	border-radius: 9px;
	font-size: 12px;
    font-weight: 600;
    line-height: 1;
    transform: none;
    background: linear-gradient(180deg, #f6e6ba 0%, #d4ac6c 100%);
    color: #2b1d0d;
}

@media (max-width: 760px) {
	div.pagina_frame_chat .cb_defense_popup {
		top: 5%;
		width: auto;
		min-width: 0;
		min-height: 140px;
		max-width: none;
		left: 10px;
		right: 10px;
		transform: none;
	}
	div.pagina_frame_chat .cb_defense_row > div.cp_field,
	div.pagina_frame_chat .cb_defense_row > div.cp_field:first-child,
	div.pagina_frame_chat .cb_defense_row > div#dp_stat_field,
	div.pagina_frame_chat .cb_defense_row > div#dp_spec_field,
	div.pagina_frame_chat .cb_defense_row > div#dp_reaction_field,
	div.pagina_frame_chat .cb_defense_row > div#dp_item_field,
	div.pagina_frame_chat .cb_defense_row > div#dp_nocomp_field,
	div.pagina_frame_chat .cb_defense_row > div.cp_field--spell-adv,
	div.pagina_frame_chat .cb_defense_row > div.cp_field--s {
		grid-column: span 6;
	}
}

@media (max-width: 480px) {
	div.pagina_frame_chat .cb_defense_body {
		padding: 12px 10px 10px;
	}
	div.pagina_frame_chat .cb_defense_row {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}
	div.pagina_frame_chat .cb_defense_row > div.cp_field,
	div.pagina_frame_chat .cb_defense_row > div.cp_field:first-child,
	div.pagina_frame_chat .cb_defense_row > div#dp_stat_field,
	div.pagina_frame_chat .cb_defense_row > div#dp_spec_field,
	div.pagina_frame_chat .cb_defense_row > div#dp_reaction_field,
	div.pagina_frame_chat .cb_defense_row > div#dp_item_field,
	div.pagina_frame_chat .cb_defense_row > div#dp_nocomp_field,
	div.pagina_frame_chat .cb_defense_row > div.cp_field--spell-adv,
	div.pagina_frame_chat .cb_defense_row > div.cp_field--s {
		grid-column: 1 / -1;
	}
	div.pagina_frame_chat .cb_defense_actions {
		justify-content: stretch;
	}
	div.pagina_frame_chat .cb_defense_submit,
	div.pagina_frame_chat .cb_defense_submit:hover,
	div.pagina_frame_chat .cb_defense_submit:focus {
		width: 100%;
	}
}

/* Campo filtro (tipo/sfera) nel pannello spell */
div.pagina_frame_chat div.cp_field--filter {
	flex: 0 0 auto;
	min-width: 70px;
}

/* Campo checkbox "senza componenti" nel pannello spell */
div.pagina_frame_chat div.cp_field--nocomp {
	flex: 0 0 auto;
	min-width: 70px;
	align-items: center;
}

@media (max-width: 520px) {
	div.pagina_frame_chat div.cp_field--filter,
	div.pagina_frame_chat div.cp_field--nocomp {
		flex: 1 1 46%;
		min-width: 0;
		max-width: none;
	}
	div.pagina_frame_chat div.chat_bottom_panel select[name=id_ab] {
		width: 100%;
	}
}

@media (max-width: 380px) {
	div.pagina_frame_chat div.cp_field--filter,
	div.pagina_frame_chat div.cp_field--nocomp {
		flex-basis: 100%;
	}
}

.sc_checkbox_label {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    cursor: pointer;
}

.sc_checkbox_label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
}

div.chat_row_C{
margin-top:5px;

 border-width: 2px;
   border-color: blue;
   border-style: solid;
      color: #310047;
}

div.chat_row_F{
   margin-top:5px;
   
    border-width: 2px;
      border-color: rgb(225, 0, 255);
      border-style: solid;
         color: #350072;
}

span.chat_time{
   font-size: 0.8em;
   font-weight: bolder;
   margin: 0 3px 0 1px;
}

span.chat_name{
   font-weight: bolder;   
   /*font-size: 14px;*/
   color: #7a0000;
}

span.chat_tag{
  display: inline-block;
  margin: 0 3px 0 0;
  color: #002472;
  font-weight: 600;
  white-space: nowrap;
}

span.chat_name a{
   display: inline-flex;
   align-items: center;
   font-weight: bolder;   
   font-size: 14px;
   color: #5a1f16;
   margin-top: 0;
   text-decoration: none;
}

span.chat_icons{
  display: inline-flex;
  align-items: flex-end;
  gap: 4px;
  vertical-align: text-bottom;
  line-height: 1;
  margin: 0 3px 0 1px;
}

span.chat_icons img.presenti_ico{
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  vertical-align: bottom;
  margin: 0;
}

span.race_gender_tooltip{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

span.race_gender_tooltip.race_gender_cycle{
  display: inline-grid;
  place-items: center;
}

span.race_gender_tooltip.race_gender_cycle img.race_icon_main,
span.race_gender_tooltip.race_gender_cycle img.race_icon_origin{
  grid-area: 1 / 1;
  transition: opacity 1s ease;
  pointer-events: none;
}

span.race_gender_tooltip.race_gender_cycle img.race_icon_origin{
  opacity: 0;
}

span.race_gender_tooltip.race_gender_cycle.is-origin img.race_icon_main{
  opacity: 0;
}

span.race_gender_tooltip.race_gender_cycle.is-origin img.race_icon_origin{
  opacity: 1;
}

span.race_gender_tooltip::after{
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 8px 10px;
  border: 1px solid #8f939f;
  border-radius: 8px;
  background: rgba(20, 22, 28, 0.95);
  color: #f3f5f9;
  font-weight: normal;
  white-space: pre-line;
  text-align: center;
  line-height: 1.25;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

span.race_gender_tooltip::before{
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid rgba(20, 22, 28, 0.95);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

span.race_gender_tooltip:hover::after,
span.race_gender_tooltip:hover::before{
  opacity: 1;
  visibility: visible;
}

span.race_gender_tooltip[data-tooltip=""]::after,
span.race_gender_tooltip[data-tooltip=""]::before{
  display: none !important;
}

/* Chat live: tooltip in overlay fisso (evita clipping sui bordi del box chat) */
div.chat_live_tooltips span.race_gender_tooltip::after,
div.chat_live_tooltips span.race_gender_tooltip::before{
  display: none !important;
}

#chat_tooltip_overlay,
#chat_party_tooltip_overlay{
  position: fixed;
  z-index: 2147483647;
  pointer-events: none;
  display: none;
  white-space: pre-line;
  text-align: center;
  line-height: 1.25;
  padding: 8px 10px;
  border: 1px solid #8f939f;
  border-radius: 8px;
  background: rgba(20, 22, 28, 0.95);
  color: #f3f5f9;
  width: max-content;
  max-width: calc(100vw - 24px);
}

#chat_tooltip_overlay.is_visible,
#chat_party_tooltip_overlay.is_visible{
  display: block;
}

#chat_tooltip_overlay::before,
#chat_party_tooltip_overlay::before{
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  pointer-events: none;
}

#chat_tooltip_overlay:not(.is_below)::before,
#chat_party_tooltip_overlay:not(.is_below)::before{
  top: 100%;
  border-top: 6px solid rgba(20, 22, 28, 0.95);
}

#chat_tooltip_overlay.is_below::before,
#chat_party_tooltip_overlay.is_below::before{
  bottom: 100%;
  border-bottom: 6px solid rgba(20, 22, 28, 0.95);
}

.chat_spell_tooltip{
  display: inline-flex;
  align-items: baseline;
}

.chat_spell_tooltip_trigger{
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  font: inherit;
  font-weight: 700;
  line-height: inherit;
  color: #7a2a1c;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
  cursor: pointer;
}

.chat_spell_tooltip_trigger:hover,
.chat_spell_tooltip_trigger:focus{
  color: #5f1f15;
  outline: none;
}

.chat_spell_tooltip_payload{
  display: none;
}

#chat_spell_tooltip_overlay{
  position: fixed;
  z-index: 2147483647;
  display: none;
  pointer-events: auto;
  width: min(var(--chat-spell-overlay-max-width, 960px), calc(100vw - 20px));
  max-width: calc(100vw - 20px);
}

#chat_spell_tooltip_overlay.is_visible{
  display: block;
}

#chat_spell_tooltip_overlay::before{
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  pointer-events: none;
}

#chat_spell_tooltip_overlay:not(.is_below)::before{
  top: 100%;
  border-top: 8px solid #f3e2bd;
}

#chat_spell_tooltip_overlay.is_below::before{
  bottom: 100%;
  border-bottom: 8px solid #f3e2bd;
}

.chat_spell_tooltip_card{
  display: flex;
  box-sizing: border-box;
  width: 100%;
  gap: 14px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid #b48a54;
  border-radius: 10px;
  background: linear-gradient(180deg, #fcf4df 0%, #f3e2bd 100%);
  box-shadow: 0 12px 26px rgba(54, 28, 14, 0.22);
  color: #3b2413;
  max-height: none;
  overflow: visible;
}

.chat_spell_tooltip_media{
  flex: 0 0 78px;
  width: 78px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(117, 73, 31, 0.28);
  background: rgba(255, 255, 255, 0.55);
}

.chat_spell_tooltip_media img{
  display: block;
  width: 100%;
  height: auto;
}

.chat_spell_tooltip_body{
  min-width: 0;
  flex: 1 1 auto;
  width: 100%;
}

.chat_spell_tooltip_title{
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.2;
  font-weight: 700;
  color: #5d2d14;
}

.chat_spell_tooltip_section + .chat_spell_tooltip_section{
  margin-top: 10px;
}

.chat_spell_tooltip_section{
  width: 100%;
}

.chat_spell_tooltip_section_title{
  margin-bottom: 3px;
  font-size: 0.72rem;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8b5f2f;
}

.chat_spell_tooltip_section_text{
  width: 100%;
  font-size: 0.91rem;
  line-height: 1.38;
  color: #3b2413;
}

.chat_spell_tooltip_meta{
  display: grid;
  width: 100%;
  gap: 7px;
}

.chat_spell_tooltip_meta_row{
  display: grid;
  grid-template-columns: minmax(86px, 110px) minmax(0, 1fr);
  width: 100%;
  gap: 8px;
  align-items: start;
}

.chat_spell_tooltip_meta_label{
  display: block;
  justify-self: start;
  text-align: left;
  font-size: 0.78rem;
  line-height: 1.25;
  font-weight: 700;
  color: #7a552b;
}

.chat_spell_tooltip_meta_value{
  display: block;
  justify-self: start;
  text-align: left;
  font-size: 0.88rem;
  line-height: 1.35;
  color: #3b2413;
}

@media (max-width: 640px) {
  .chat_spell_tooltip_card{
    gap: 10px;
    padding: 10px;
  }

  .chat_spell_tooltip_media{
    flex-basis: 64px;
    width: 64px;
  }

  .chat_spell_tooltip_meta_row{
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

div.chat_row_A span.chat_name,
div.chat_row_A span.chat_name a{
  font-size: 1.05em;
  line-height: 1.2;
  font-weight: 600;
}

div.chat_row_A span.chat_name{
  display: inline-flex;
  align-items: center;
  align-self: baseline;
  position: relative;
  z-index: 2;
  margin: 0 3px 0 1px;
}

/* Allarga l'area cliccabile del nome per il sussurro rapido. */
div.chat_row_A span.chat_name a{
  display: inline-block;
  min-height: 0;
  padding: 0 5px 2px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

div.chat_row_A span.chat_name a:hover,
div.chat_row_A span.chat_name a:focus{
  color: #7a2a1c;
  background-color: rgba(90, 31, 22, 0.08);
}

/* Chat live: il testo fluisce intorno ad avatar e icone senza uscire dal box. */
div.chat_live_tooltips div.chat_row_A span.chat_msg{
  display: inline;
  box-sizing: border-box;
  flex: none;
  min-width: 0;
  position: static;
  z-index: 1;
  width: auto;
  max-width: none;
  left: auto;
  text-indent: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}

span.chat_msg{
   /*font-size: 14px;*/
   font-weight: normal;
}

span.chat-bold{
  font-weight: bold;
}

/* Nomi di personaggi e PNG nei report (prove, oggetti, spell, attacchi, difese) */
span.chat-report-name{
  font-weight: bold;
}

span.chat_master{ }



/* BBCode underline (usato da functions.inc.php) */
.adv-underline{
  text-decoration: underline;
}

.container,
.container-fluid,
.container-xxl,
.container-xl,
.container-lg,
.container-md,
.container-sm {
  width: 100%;
  padding-right: var(--bs-gutter-x, 0.75rem);
  padding-left: var(--bs-gutter-x, 0.75rem);
  margin-right: auto;
  margin-left: auto;
}

@media (min-width: 576px) {
  .container-sm, .container {
    max-width: 540px;
  }
}
@media (min-width: 768px) {
  .container-md, .container-sm, .container {
    max-width: 720px;
  }
}
@media (min-width: 992px) {
  .container-lg, .container-md, .container-sm, .container {
    max-width: 960px;
  }
}
@media (min-width: 1200px) {
  .container-xl, .container-lg, .container-md, .container-sm, .container {
    max-width: 1140px;
  }
}
@media (min-width: 1400px) {
  .container-xxl, .container-xl, .container-lg, .container-md, .container-sm, .container {
    max-width: 1320px;
  }
}
.row {
   --bs-gutter-x: 1.5rem;
   --bs-gutter-y: 0;
   display: flex;
   flex-wrap: wrap;
   margin-top: calc(var(--bs-gutter-y) * -1);
   margin-right: calc(var(--bs-gutter-x) / -2);
   margin-left: calc(var(--bs-gutter-x) / -2);
 }
 .row > * {
   box-sizing: border-box;
   flex-shrink: 0;
   width: 100%;
   max-width: 100%;
   padding-right: calc(var(--bs-gutter-x) / 2);
   padding-left: calc(var(--bs-gutter-x) / 2);
   margin-top: var(--bs-gutter-y);
 }
 
 .col {
   flex: 1 0 0%;
 }

div.output:has(div.pagina_frame_chat){
  overflow: hidden !important;
  /* display: table; */
}

/****************************************************************************/

/* Autocomplete nomi PG per il sussurro */
.chat_tag_ac {
	position: fixed;
	background: #fff8f0;
	border: 1px solid rgba(124, 86, 44, 0.55);
	border-radius: 8px;
	box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.15);
	z-index: 1000;
	max-height: 140px;
	overflow-y: auto;
	list-style: none;
	padding: 3px 0;
	margin: 0;
	display: none;
}

.chat_tag_ac.is-open {
	display: block;
}

.chat_tag_ac li {
	padding: 5px 10px;
	font-size: 12px;
	font-family: Georgia, serif;
	color: #1e1206;
	cursor: pointer;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.chat_tag_ac li:hover,
.chat_tag_ac li.is-active {
	background: rgba(124, 86, 44, 0.12);
}

.chat_tag_ac li.chat_tag_ac_sep {
	padding: 4px 8px 2px;
	font-size: 10px;
	font-family: Georgia, serif;
	color: rgba(30, 18, 6, 0.5);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	border-top: 1px solid rgba(124, 86, 44, 0.2);
	cursor: default;
	pointer-events: none;
	user-select: none;
}

.chat_tag_ac li.chat_tag_ac_sep:first-child {
	border-top: none;
}

/* Pulsante Salva nella barra chat */
div.pagina_frame_chat div.chat_bottom_panel button#chat_save_btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 34px;
	height: 34px;
	padding: 0 12px;
	margin: 0;
	width: auto;
	background: rgba(200, 160, 80, 0.22);
	border: 1px solid rgba(124, 86, 44, 0.70);
	border-radius: 10px;
	color: #4a2e0e;
	font-size: 12px;
	font-family: Georgia, serif;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
	white-space: nowrap;
	box-sizing: border-box;
}

div.pagina_frame_chat div.chat_bottom_panel button#chat_save_btn:hover {
	background: rgba(200, 160, 80, 0.42);
	border-color: #7c562c;
}

/* Pulsante Note nella barra chat */
div.pagina_frame_chat div.chat_bottom_panel button.chat_note_btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 34px;
	height: 34px;
	padding: 0 12px;
	margin: 0;
	width: auto;
	background: rgba(255, 255, 255, 0.55);
	border: 1px solid rgba(124, 86, 44, 0.55);
	border-radius: 10px;
	color: #4a2e0e;
	font-size: 12px;
	font-family: Georgia, serif;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
	white-space: nowrap;
	box-sizing: border-box;
}

div.pagina_frame_chat div.chat_bottom_panel button.chat_note_btn:hover {
	background: rgba(240, 220, 168, 0.65);
	border-color: #7c562c;
}

/* Overlay popup Note — schermo trasparente, pass-through dei clic */
div.pagina_frame_chat .chat_note_overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: none;
	z-index: 900;
	pointer-events: none;
}

div.pagina_frame_chat .chat_note_overlay.is-open {
	display: block;
}

/* Finestra popup Note — assoluta dentro overlay fixed, draggabile */
div.pagina_frame_chat .chat_note_popup {
	position: absolute;
	background: #fdf5e6;
	border: 1px solid #7c562c;
	border-radius: 12px;
	box-shadow: 0 6px 28px rgba(0, 0, 0, 0.30), 0 0 0 1px rgba(124, 86, 44, 0.18);
	width: 78%;
	max-width: 1020px;
	min-width: 340px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	pointer-events: all;
	user-select: none;
	box-sizing: border-box;
}

div.pagina_frame_chat .chat_note_header {
	width: 100%;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px 8px;
	border-bottom: 1px solid rgba(124, 86, 44, 0.30);
	background: rgba(240, 220, 168, 0.35);
	cursor: move;
}

div.pagina_frame_chat .chat_note_header span {
	font-family: Georgia, serif;
	font-size: 13px;
	font-weight: 600;
	color: #2b1d0d;
	letter-spacing: 0.02em;
}

div.pagina_frame_chat .chat_note_close {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
	color: #7c562c;
	padding: 0 2px;
	margin: 0;
	transition: color 0.12s ease;
	min-height: auto;
	height: auto;
	width: auto;
	box-shadow: none;
}

div.pagina_frame_chat .chat_note_close:hover {
	color: #2b1d0d;
}

div.pagina_frame_chat .chat_note_body {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 14px 6px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

div.pagina_frame_chat .chat_note_body textarea {
	width: 100%;
	min-height: 320px;
	max-height: 60vh;
	resize: vertical;
	padding: 10px 12px;
	box-sizing: border-box;
	background: rgba(255, 255, 255, 0.88);
	border: 1px solid rgba(124, 86, 44, 0.55);
	border-radius: 8px;
	color: #1e1206;
	font-size: 13px;
	font-family: Georgia, serif;
	line-height: 1.6;
	transition: border-color 0.15s ease;
	outline: none;
	user-select: text;
}

div.pagina_frame_chat .chat_note_body textarea:focus {
	border-color: #7c562c;
}

div.pagina_frame_chat .chat_note_counter {
	text-align: right;
	font-size: 11px;
	font-family: Georgia, serif;
	color: rgba(30, 18, 6, 0.5);
}

div.pagina_frame_chat .chat_note_footer {
	width: 100%;
	box-sizing: border-box;
	padding: 8px 14px 12px;
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	border-top: 1px solid rgba(124, 86, 44, 0.20);
}

div.pagina_frame_chat .chat_note_submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 32px;
	height: 32px;
	padding: 0 18px;
	margin: 0;
	background: linear-gradient(180deg, #f0dca8 0%, #c8a060 100%);
	border: 1px solid #7c562c;
	border-radius: 8px;
	color: #2b1d0d;
	font-size: 12px;
	font-family: Georgia, serif;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
	white-space: nowrap;
	box-sizing: border-box;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.50);
	transform: none;
}

div.pagina_frame_chat .chat_note_submit:hover,
div.pagina_frame_chat .chat_note_submit:focus {
	display: inline-flex;
	box-sizing: border-box;
	min-height: 32px;
	height: 32px;
	width: auto;
	margin: 0;
	padding: 0 18px;
	border-width: 1px;
	border-style: solid;
	border-radius: 8px;
	background: linear-gradient(180deg, #fcefd7 0%, #d4a865 100%);
	border-color: #5a3a18;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	transform: none;
	outline: none;
}

div.pagina_frame_chat .chat_note_submit--master {
	background: linear-gradient(180deg, #d4bff0 0%, #8a60c8 100%);
	border-color: #5c2c8a;
	color: #1a0d2b;
}

div.pagina_frame_chat .chat_note_submit--master:hover {
	background: linear-gradient(180deg, #e2d4f8 0%, #9a70d4 100%);
	border-color: #3e1a6a;
}

/* Note master del luogo: riquadro fisso sopra il log chat */
div.pagina_frame_chat .chat_master_notes_box {
	position: absolute;
	top: 78px;
	left: 28px;
	right: 28px;
	z-index: 6;
	box-sizing: border-box;
	font-family: Georgia, serif;
	color: #6d1208;
	pointer-events: auto;
}

div.pagina_frame_chat .chat_master_notes_toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	min-height: 34px;
	height: auto;
	margin: 0;
	padding: 7px 13px;
	border-width: 1px;
	border-style: solid;
	border-color: #9b2c22;
	border-radius: 8px 8px 0 0;
	box-sizing: border-box;
	background: linear-gradient(180deg, rgba(255, 248, 244, 0.98) 0%, rgba(244, 221, 213, 0.96) 100%);
	box-shadow: 0 2px 8px rgba(86, 24, 16, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.75);
	color: #6d1208;
	font-family: Georgia, serif;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	text-align: left;
	text-transform: none;
	cursor: pointer;
	transform: none;
}

div.pagina_frame_chat .chat_master_notes_box.is-collapsed .chat_master_notes_toggle {
	border-radius: 8px;
}

div.pagina_frame_chat .chat_master_notes_toggle:hover,
div.pagina_frame_chat .chat_master_notes_toggle:focus {
	display: flex;
	box-sizing: border-box;
	width: 100%;
	min-height: 34px;
	height: auto;
	margin: 0;
	padding: 7px 13px;
	border-width: 1px;
	border-style: solid;
	border-color: #7b1f18;
	background: linear-gradient(180deg, rgba(255, 252, 248, 0.99) 0%, rgba(247, 226, 219, 0.98) 100%);
	color: #5c0f06;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	transform: none;
	outline: none;
}

div.pagina_frame_chat .chat_master_notes_label {
	display: block;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

div.pagina_frame_chat .chat_master_notes_chevron {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	min-width: 18px;
	height: 18px;
	margin-left: 10px;
	box-sizing: border-box;
	border: 1px solid rgba(109, 18, 8, 0.38);
	border-radius: 50%;
	font-size: 13px;
	line-height: 1;
	color: #6d1208;
	background: rgba(255, 255, 255, 0.46);
}

div.pagina_frame_chat .chat_master_notes_chevron::before {
	content: "+";
}

div.pagina_frame_chat .chat_master_notes_box:not(.is-collapsed) .chat_master_notes_chevron::before {
	content: "-";
}

div.pagina_frame_chat .chat_master_notes_panel {
	max-height: 34vh;
	overflow-y: auto;
	box-sizing: border-box;
	padding: 10px 14px 12px;
	border-width: 0 1px 1px;
	border-style: solid;
	border-color: #9b2c22;
	border-radius: 0 0 8px 8px;
	background: rgba(255, 248, 244, 0.96);
	box-shadow: 0 6px 16px rgba(86, 24, 16, 0.20);
	color: #5d1007;
	font-size: 15px;
	line-height: 1.5;
}

div.pagina_frame_chat .chat_master_notes_panel[hidden] {
	display: none;
}

div.pagina_frame_chat .chat_master_notes_content {
	width: 100%;
	box-sizing: border-box;
	color: #5d1007;
	text-align: left;
}

div.pagina_frame_chat .chat_master_notes_content .gdrcd-user-content {
	margin: 0;
	color: #5d1007;
}

div.pagina_frame_chat .chat_master_notes_actions {
	display: flex;
	justify-content: flex-end;
	width: 100%;
	box-sizing: border-box;
	margin-top: 10px;
	padding-top: 8px;
	border-top: 1px solid rgba(155, 44, 34, 0.22);
}

div.pagina_frame_chat .chat_master_notes_edit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: auto;
	min-height: 34px;
	height: 34px;
	margin: 0;
	padding: 0 12px;
	border-width: 1px;
	border-style: solid;
	border-color: rgba(123, 31, 24, 0.66);
	border-radius: 8px;
	box-sizing: border-box;
	background: rgba(255, 246, 242, 0.82);
	box-shadow: none;
	color: #6d1208;
	font-family: Georgia, serif;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	cursor: pointer;
	transform: none;
}

div.pagina_frame_chat .chat_master_notes_edit:hover,
div.pagina_frame_chat .chat_master_notes_edit:focus {
	display: inline-flex;
	box-sizing: border-box;
	width: auto;
	min-height: 34px;
	height: 34px;
	margin: 0;
	padding: 0 12px;
	border-width: 1px;
	border-style: solid;
	border-color: #7b1f18;
	border-radius: 8px;
	background: rgba(244, 221, 213, 0.92);
	box-shadow: none;
	color: #5c0f06;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	transform: none;
	outline: none;
}

div.pagina_frame_chat .chat_master_notes_popup {
	width: 72%;
	max-width: 920px;
	min-width: 360px;
}

div.pagina_frame_chat .chat_master_notes_body textarea {
	min-height: 260px;
	max-height: 55vh;
}

div.pagina_frame_chat .chat_master_notes_meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	box-sizing: border-box;
	gap: 12px;
}

div.pagina_frame_chat .chat_master_notes_feedback {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 11px;
	font-family: Georgia, serif;
	line-height: 1.3;
	text-align: left;
	color: rgba(30, 18, 6, 0.62);
}

div.pagina_frame_chat .chat_master_notes_feedback.is-error {
	color: #8a1f12;
	font-weight: 600;
}

div.pagina_frame_chat .chat_master_notes_feedback.is-warning {
	color: #5a3a18;
	font-weight: 600;
}

div.pagina_frame_chat .chat_note_submit.chat_master_notes_cancel,
div.pagina_frame_chat .chat_note_submit.chat_master_notes_save {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 32px;
	height: 32px;
	width: 120px;
	min-width: 120px;
	flex: 0 0 120px;
	margin: 0;
	padding: 0 18px;
	border-width: 1px;
	border-style: solid;
	border-radius: 8px;
	box-sizing: border-box;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	position: static;
	top: auto;
	right: auto;
	bottom: auto;
	left: auto;
	transform: none !important;
}

div.pagina_frame_chat div.chat_bottom_panel .chat_master_notes_overlay .chat_note_footer {
	align-items: center;
	min-height: 56px;
	height: 56px;
	overflow: hidden;
}

div.pagina_frame_chat div.chat_bottom_panel .chat_master_notes_overlay button.chat_note_submit.chat_master_notes_cancel,
div.pagina_frame_chat div.chat_bottom_panel .chat_master_notes_overlay button.chat_note_submit.chat_master_notes_save {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	box-sizing: border-box !important;
	min-height: 32px !important;
	height: 32px !important;
	width: 120px !important;
	min-width: 120px !important;
	max-width: 120px !important;
	flex: 0 0 120px !important;
	margin: 0 !important;
	padding: 0 18px !important;
	border-width: 1px !important;
	border-style: solid !important;
	border-radius: 8px !important;
	font-family: Georgia, serif !important;
	font-size: 12px !important;
	font-weight: 600 !important;
	line-height: 1 !important;
	position: static !important;
	top: auto !important;
	right: auto !important;
	bottom: auto !important;
	left: auto !important;
	vertical-align: top;
	transform: none !important;
	transition: background 0.15s ease, border-color 0.15s ease !important;
}

div.pagina_frame_chat div.chat_bottom_panel .chat_master_notes_overlay button.chat_note_submit.chat_master_notes_cancel:hover,
div.pagina_frame_chat div.chat_bottom_panel .chat_master_notes_overlay button.chat_note_submit.chat_master_notes_cancel:focus,
div.pagina_frame_chat div.chat_bottom_panel .chat_master_notes_overlay button.chat_note_submit.chat_master_notes_cancel:active,
div.pagina_frame_chat div.chat_bottom_panel .chat_master_notes_overlay button.chat_note_submit.chat_master_notes_save:hover,
div.pagina_frame_chat div.chat_bottom_panel .chat_master_notes_overlay button.chat_note_submit.chat_master_notes_save:focus,
div.pagina_frame_chat div.chat_bottom_panel .chat_master_notes_overlay button.chat_note_submit.chat_master_notes_save:active {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	display: inline-flex !important;
	box-sizing: border-box !important;
	min-height: 32px !important;
	height: 32px !important;
	width: 120px !important;
	min-width: 120px !important;
	max-width: 120px !important;
	flex: 0 0 120px !important;
	margin: 0 !important;
	padding: 0 18px !important;
	border-width: 1px !important;
	border-style: solid !important;
	border-radius: 8px !important;
	font-size: 12px !important;
	font-weight: 600 !important;
	line-height: 1 !important;
	position: static !important;
	top: auto !important;
	right: auto !important;
	bottom: auto !important;
	left: auto !important;
	vertical-align: top;
	transform: none !important;
	outline: none;
}

div.pagina_frame_chat div.chat_bottom_panel .chat_master_notes_overlay button.chat_note_submit.chat_master_notes_cancel::-moz-focus-inner,
div.pagina_frame_chat div.chat_bottom_panel .chat_master_notes_overlay button.chat_note_submit.chat_master_notes_save::-moz-focus-inner {
	padding: 0;
	border: 0;
}

div.pagina_frame_chat .chat_note_submit.chat_master_notes_cancel {
	border-color: rgba(124, 86, 44, 0.55);
	background: rgba(255, 255, 255, 0.70);
	color: #4a2e0e;
}

div.pagina_frame_chat .chat_note_submit.chat_master_notes_save {
	border-color: #7b1f18;
	background: linear-gradient(180deg, #f4ddd5 0%, #c88475 100%);
	color: #4f0d05;
}

div.pagina_frame_chat .chat_note_submit.chat_master_notes_cancel:hover,
div.pagina_frame_chat .chat_note_submit.chat_master_notes_cancel:focus,
div.pagina_frame_chat .chat_note_submit.chat_master_notes_save:hover,
div.pagina_frame_chat .chat_note_submit.chat_master_notes_save:focus {
	display: inline-flex;
	box-sizing: border-box;
	min-height: 32px;
	height: 32px;
	width: 120px;
	min-width: 120px;
	flex: 0 0 120px;
	margin: 0;
	padding: 0 18px;
	border-width: 1px;
	border-style: solid;
	border-radius: 8px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	position: static;
	top: auto;
	right: auto;
	bottom: auto;
	left: auto;
	transform: none !important;
	outline: none;
}

div.pagina_frame_chat .chat_note_submit.chat_master_notes_cancel:hover,
div.pagina_frame_chat .chat_note_submit.chat_master_notes_cancel:focus {
	border-color: #7c562c;
	background: rgba(255, 255, 255, 0.88);
	color: #2b1d0d;
}

div.pagina_frame_chat .chat_note_submit.chat_master_notes_save:hover,
div.pagina_frame_chat .chat_note_submit.chat_master_notes_save:focus {
	border-color: #5c170f;
	background: linear-gradient(180deg, #f8e8e2 0%, #cf927f 100%);
	color: #3d0a04;
}

@media (max-width: 760px) {
	div.pagina_frame_chat .chat_master_notes_box {
		top: 72px;
		left: 10px;
		right: 10px;
	}
	div.pagina_frame_chat .chat_master_notes_panel {
		max-height: 42vh;
		padding: 9px 10px 10px;
	}
	div.pagina_frame_chat .chat_master_notes_popup {
		width: calc(100vw - 20px);
		max-width: none;
		min-width: 0;
	}
	div.pagina_frame_chat .chat_master_notes_body textarea {
		min-height: 220px;
	}
	div.pagina_frame_chat .chat_master_notes_meta {
		align-items: flex-start;
		flex-direction: column;
		gap: 4px;
	}
}

/* ─── Popup Salva giocata ─── */
div.pagina_frame_chat .chat_save_overlay {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 200;
	background: rgba(0, 0, 0, 0.18);
}

div.pagina_frame_chat .chat_save_overlay.is-open {
	display: block;
}

div.pagina_frame_chat .chat_save_popup {
	position: absolute;
	bottom: 72px;
	right: 16px;
	background: #fdf5e6;
	border: 1px solid #7c562c;
	border-radius: 6px;
	min-width: 280px;
	max-width: 340px;
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
	box-sizing: border-box;
	overflow: hidden;
}

div.pagina_frame_chat .chat_save_header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 12px;
	background: linear-gradient(180deg, #e8c97a 0%, #b8882a 100%);
	border-bottom: 1px solid #7c562c;
}

div.pagina_frame_chat .chat_save_header span {
	font-family: Georgia, serif;
	font-size: 13px;
	font-weight: 600;
	color: #2b1d0d;
}

div.pagina_frame_chat .chat_save_close {
	background: none;
	border: none;
	color: #2b1d0d;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	padding: 0 2px;
	opacity: 0.7;
}

div.pagina_frame_chat .chat_save_close:hover {
	opacity: 1;
}

div.pagina_frame_chat .chat_save_body {
	padding: 12px;
}

div.pagina_frame_chat .chat_save_step {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

div.pagina_frame_chat .chat_save_mode_btn {
	display: block;
	width: 100%;
	padding: 9px 14px;
	background: linear-gradient(180deg, #f0dca8 0%, #c8a060 100%);
	border: 1px solid #7c562c;
	border-radius: 6px;
	color: #2b1d0d;
	font-family: Georgia, serif;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	text-align: left;
	transition: background 0.15s ease;
}

div.pagina_frame_chat .chat_save_mode_btn:hover {
	background: linear-gradient(180deg, #fcefd7 0%, #d4a865 100%);
	border-color: #5a3a18;
}

div.pagina_frame_chat .chat_save_field {
	margin-bottom: 8px;
}

div.pagina_frame_chat .chat_save_field label {
	display: block;
	font-family: Georgia, serif;
	font-size: 11px;
	color: #5a3a18;
	margin-bottom: 3px;
	font-weight: 600;
}

div.pagina_frame_chat .chat_save_field input[type="datetime-local"] {
	width: 100%;
	padding: 5px 8px;
	border: 1px solid #b08050;
	border-radius: 4px;
	background: #fff9ee;
	color: #2b1d0d;
	font-size: 12px;
	box-sizing: border-box;
}

div.pagina_frame_chat .chat_save_radio_group {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

div.pagina_frame_chat .chat_save_radio_group label {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	font-family: Georgia, serif;
	font-size: 11px;
	color: #2b1d0d;
	font-weight: normal;
	cursor: pointer;
	margin-bottom: 0;
}

div.pagina_frame_chat .chat_save_radio_group input[type="radio"] {
	margin-top: 2px;
	flex-shrink: 0;
}

div.pagina_frame_chat .chat_save_actions {
	display: flex;
	gap: 6px;
	margin-top: 10px;
}

div.pagina_frame_chat .chat_save_confirm_btn {
	flex: 1;
	min-height: 30px;
	padding: 0 12px;
	background: linear-gradient(180deg, #f0dca8 0%, #c8a060 100%);
	border: 1px solid #7c562c;
	border-radius: 6px;
	color: #2b1d0d;
	font-family: Georgia, serif;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
}

div.pagina_frame_chat .chat_save_confirm_btn:hover {
	background: linear-gradient(180deg, #fcefd7 0%, #d4a865 100%);
}

div.pagina_frame_chat .chat_save_back_btn {
	min-height: 30px;
	padding: 0 10px;
	background: none;
	border: 1px solid #b08050;
	border-radius: 6px;
	color: #5a3a18;
	font-family: Georgia, serif;
	font-size: 11px;
	cursor: pointer;
}

div.pagina_frame_chat .chat_save_back_btn:hover {
	background: rgba(176, 128, 80, 0.1);
}

div.pagina_frame_chat .chat_save_working {
	font-family: Georgia, serif;
	font-size: 11px;
	color: #7c562c;
	text-align: center;
	padding: 6px 0;
	display: none;
}

@media (max-width: 480px) {
	div.pagina_frame_chat .chat_save_popup {
		right: 8px;
		left: 8px;
		min-width: 0;
		max-width: none;
	}
}

/* ============================================================
   DRAWER LATERALE DEI PRESENTI — targhe con parametri e aure
   ============================================================ */

/* Contenitore: ancorato al bordo destro dell'area chat, stessa fascia
   verticale del box messaggi. La linguetta resta visibile anche da chiuso. */
div.pagina_frame_chat div.chat_party_drawer{
  position: absolute;
  top: 70px;
  bottom: calc(25% + 12px);
  right: 0;
  z-index: 12;
  display: flex;
  align-items: flex-start;
  pointer-events: none;
}

div.pagina_frame_chat button.chat_party_toggle{
  pointer-events: auto;
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  flex: 0 0 auto;
  width: 26px;
  min-height: 0;
  height: auto;
  margin: 0;
  padding: 8px 4px;
  border-width: 1px;
  border-style: solid;
  border-color: #7c562c;
  border-right-width: 0;
  border-radius: 10px 0 0 10px;
  background: linear-gradient(180deg, #f8e8c8 0%, #dfbf82 100%);
  color: #3a2510;
  box-shadow: -3px 4px 14px rgba(0, 0, 0, 0.32), inset 1px 0 0 rgba(255, 255, 255, 0.55);
  cursor: pointer;
  line-height: 1;
  transform: none;
}

div.pagina_frame_chat button.chat_party_toggle:hover,
div.pagina_frame_chat button.chat_party_toggle:focus{
  display: inline-flex;
  box-sizing: border-box;
  flex: 0 0 auto;
  width: 26px;
  min-height: 0;
  height: auto;
  margin: 0;
  padding: 8px 4px;
  border-width: 1px;
  border-style: solid;
  border-color: #5a3a18;
  border-right-width: 0;
  border-radius: 10px 0 0 10px;
  background: linear-gradient(180deg, #fdf6e8 0%, #ecdcb8 100%);
  color: #2b1d0d;
  line-height: 1;
  transform: none;
  outline: none;
}

div.pagina_frame_chat span.chat_party_toggle__label{
  display: block;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Pannello: chiuso occupa larghezza zero, aperto scorre da destra. */
div.pagina_frame_chat div.chat_party_panel{
  pointer-events: auto;
  box-sizing: border-box;
  position: relative;
  width: 0;
  max-width: calc(100vw - 60px);
  height: 100%;
  overflow: hidden;
  border-width: 1px;
  border-style: solid;
  border-color: #7c562c;
  border-right-width: 0;
  border-radius: 0 0 0 10px;
  background: linear-gradient(180deg, rgba(30, 31, 36, 0.97) 0%, rgba(18, 20, 26, 0.95) 68px, rgba(17, 19, 24, 0.94) 100%);
  box-shadow: -6px 8px 22px rgba(0, 0, 0, 0.42), inset 1px 0 0 rgba(255, 248, 236, 0.06);
  opacity: 0;
  transition: width 0.22s ease, opacity 0.18s ease;
  display: flex;
  flex-direction: column;
}

div.pagina_frame_chat div.chat_party_drawer.is-open div.chat_party_panel{
  width: 288px;
  opacity: 1;
}

div.pagina_frame_chat div.chat_party_head{
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(124, 86, 44, 0.78);
  background: linear-gradient(180deg, rgba(64, 45, 25, 0.78) 0%, rgba(32, 29, 28, 0.72) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 246, 226, 0.13), 0 1px 0 rgba(0, 0, 0, 0.42);
}

div.pagina_frame_chat span.chat_party_head__title{
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #f7e8c4;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.70);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

div.pagina_frame_chat button.chat_party_refresh{
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  margin: 0;
  padding: 0;
  border-width: 1px;
  border-style: solid;
  border-color: rgba(243, 226, 189, 0.45);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  color: #f3e2bd;
  font-size: 13px;
  font-weight: normal;
  line-height: 1;
  cursor: pointer;
  transform: none;
}

div.pagina_frame_chat button.chat_party_refresh:hover,
div.pagina_frame_chat button.chat_party_refresh:focus{
  display: inline-flex;
  box-sizing: border-box;
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  margin: 0;
  padding: 0;
  border-width: 1px;
  border-style: solid;
  border-color: rgba(243, 226, 189, 0.85);
  border-radius: 7px;
  background: rgba(243, 226, 189, 0.12);
  color: #fdf6e8;
  font-size: 13px;
  font-weight: normal;
  line-height: 1;
  transform: none;
  outline: none;
}

div.pagina_frame_chat div.chat_party_body{
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(180deg, rgba(255, 248, 236, 0.035) 0%, rgba(255, 248, 236, 0) 34px);
}

div.pagina_frame_chat div.chat_party_empty{
  padding: 12px 8px;
  text-align: center;
  font-size: 12px;
  color: rgba(243, 245, 249, 0.75);
}

/* Targa del singolo personaggio */
div.pagina_frame_chat article.chat_party_card{
  box-sizing: border-box;
  padding: 8px 9px 9px;
  border: 1px solid rgba(227, 197, 144, 0.24);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 248, 236, 0.075) 0%, rgba(255, 255, 255, 0.025) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

div.pagina_frame_chat article.chat_party_card--self{
  border-color: rgba(227, 197, 144, 0.62);
  background: linear-gradient(180deg, rgba(227, 197, 144, 0.17) 0%, rgba(227, 197, 144, 0.07) 100%);
}

div.pagina_frame_chat div.chat_party_card__name{
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 5px;
}

div.pagina_frame_chat span.chat_party_card__nome{
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: bold;
  color: #f3e2bd;
}

div.pagina_frame_chat span.chat_party_card__cognome{
  font-size: 11px;
  color: rgba(243, 245, 249, 0.70);
}

div.pagina_frame_chat span.chat_party_card__nickname{
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: bold;
  font-style: italic;
  color: #f3e2bd;
}

div.pagina_frame_chat span.chat_party_card__realname{
  font-size: 11px;
  font-weight: normal;
  color: rgba(243, 245, 249, 0.70);
}

div.pagina_frame_chat span.chat_party_card__invisible{
  margin-left: auto;
  padding: 1px 6px;
  border: 1px solid rgba(160, 175, 220, 0.55);
  border-radius: 999px;
  font-size: 9px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: rgba(188, 202, 240, 0.90);
}

/* Tag di percezione (P8): badge accanto al nome nel pannello presenti,
   filtrati per osservatore lato server */
div.pagina_frame_chat span.chat_party_tag{
  padding: 1px 6px;
  border: 1px solid rgba(190, 190, 190, 0.55);
  border-radius: 999px;
  font-size: 9px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: rgba(220, 220, 220, 0.90);
}

div.pagina_frame_chat span.chat_party_tag--invisibile,
div.pagina_frame_chat span.chat_party_tag--occultato{
  border-color: rgba(140, 200, 230, 0.55);
  color: rgba(170, 215, 240, 0.92);
}

div.pagina_frame_chat span.chat_party_tag--camuffato{
  border-color: rgba(200, 170, 230, 0.55);
  color: rgba(215, 190, 240, 0.92);
}

div.pagina_frame_chat span.chat_party_tag--marchiato{
  border-color: rgba(230, 170, 150, 0.55);
  color: rgba(240, 195, 175, 0.92);
}

div.pagina_frame_chat span.chat_party_tag--individuato{
  border-color: rgba(240, 210, 130, 0.65);
  color: rgba(245, 225, 165, 0.95);
}

div.pagina_frame_chat span.chat_party_tag--anti_individuazione{
  border-color: rgba(150, 220, 180, 0.55);
  color: rgba(185, 235, 205, 0.92);
}

/* Elenco compatto degli occultati in stanza (vista Master) */
div.pagina_frame_chat div.chat_party_hidden_list{
  margin: 0 0 8px;
  padding: 5px 8px;
  border: 1px dashed rgba(140, 200, 230, 0.45);
  border-radius: 6px;
  font-size: 11px;
  color: rgba(200, 220, 240, 0.92);
}

div.pagina_frame_chat span.chat_party_hidden_list__label{
  font-weight: bold;
  letter-spacing: 0;
  text-transform: uppercase;
  font-size: 9px;
  color: rgba(170, 215, 240, 0.92);
}

/* Caselline dei punti salute: stesso markup della scheda in versione compatta */
div.pagina_frame_chat div.chat_party_card__health{
  margin-bottom: 5px;
}

div.pagina_frame_chat .chat_party_card .health-levels{
  --health-level-columns: 10;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  width: auto;
  max-width: 100%;
  position: relative;
}

div.pagina_frame_chat .chat_party_card .health-levels--cols-1{ --health-level-columns: 1; }
div.pagina_frame_chat .chat_party_card .health-levels--cols-2{ --health-level-columns: 2; }
div.pagina_frame_chat .chat_party_card .health-levels--cols-3{ --health-level-columns: 3; }
div.pagina_frame_chat .chat_party_card .health-levels--cols-4{ --health-level-columns: 4; }
div.pagina_frame_chat .chat_party_card .health-levels--cols-5{ --health-level-columns: 5; }
div.pagina_frame_chat .chat_party_card .health-levels--cols-6{ --health-level-columns: 6; }
div.pagina_frame_chat .chat_party_card .health-levels--cols-7{ --health-level-columns: 7; }
div.pagina_frame_chat .chat_party_card .health-levels--cols-8{ --health-level-columns: 8; }
div.pagina_frame_chat .chat_party_card .health-levels--cols-9{ --health-level-columns: 9; }
div.pagina_frame_chat .chat_party_card .health-levels--cols-10{ --health-level-columns: 10; }

div.pagina_frame_chat .chat_party_card .health-levels__grid{
  display: grid;
  grid-template-columns: repeat(var(--health-level-columns), 10px);
  gap: 2px;
  width: max-content;
  max-width: 100%;
}

div.pagina_frame_chat .chat_party_card .health-levels__box{
  width: 10px;
  height: 10px;
  display: block;
  position: relative;
  box-sizing: border-box;
  border: 1px solid rgba(229, 218, 193, 0.92);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.04);
}

div.pagina_frame_chat .chat_party_card .health-levels__box.is-damaged{
  background: rgba(91, 17, 17, 0.58);
  border-color: rgba(226, 174, 174, 0.96);
}

div.pagina_frame_chat .chat_party_card .health-levels__box.is-damaged::before,
div.pagina_frame_chat .chat_party_card .health-levels__box.is-damaged::after{
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1px;
  height: 6px;
  background: rgba(255, 255, 255, 0.95);
  transform-origin: center;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.45);
}

div.pagina_frame_chat .chat_party_card .health-levels__box.is-damaged::before{
  transform: translate(-50%, -50%) rotate(45deg);
}

div.pagina_frame_chat .chat_party_card .health-levels__box.is-damaged::after{
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* Etichetta x/y al passaggio del mouse sulle caselline (come in scheda) */
div.pagina_frame_chat .chat_party_card .health-levels::after{
  content: attr(data-health-count);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translate(-50%, 4px);
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(10, 12, 18, 0.96);
  color: rgba(188, 219, 234, 0.96);
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 4;
}

div.pagina_frame_chat .chat_party_card .health-levels:hover::after,
div.pagina_frame_chat .chat_party_card .health-levels:focus-within::after{
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Barre di mente e stamina */
div.pagina_frame_chat div.chat_party_bar{
  position: relative;
  box-sizing: border-box;
  height: 14px;
  margin-top: 4px;
  border: 1px solid rgba(143, 147, 159, 0.55);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

div.pagina_frame_chat span.chat_party_bar__fill{
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  transition: width 0.25s ease;
}

div.pagina_frame_chat div.chat_party_bar--mente span.chat_party_bar__fill{
  background: linear-gradient(180deg, #7aa8e0 0%, #43699e 100%);
}

div.pagina_frame_chat div.chat_party_bar--stamina span.chat_party_bar__fill{
  background: linear-gradient(180deg, #86c17e 0%, #47774a 100%);
}

div.pagina_frame_chat span.chat_party_bar__text{
  position: relative;
  z-index: 1;
  display: block;
  text-align: center;
  font-size: 9px;
  font-weight: bold;
  line-height: 12px;
  letter-spacing: 0;
  color: #f3f5f9;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
}

/* Fila delle icone aure */
div.pagina_frame_chat div.chat_party_card__aure{
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

div.pagina_frame_chat span.chat_party_aura_wrap{
  display: inline-flex;
}

div.pagina_frame_chat button.chat_party_aura{
  box-sizing: border-box;
  flex: 0 0 auto;
  min-width: 24px;
  min-height: 24px;
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 0;
  border-width: 1px;
  border-style: solid;
  border-color: rgba(227, 197, 144, 0.65);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transform: none;
}

div.pagina_frame_chat button.chat_party_aura:hover,
div.pagina_frame_chat button.chat_party_aura:focus{
  display: inline-flex;
  box-sizing: border-box;
  flex: 0 0 auto;
  min-width: 24px;
  min-height: 24px;
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 0;
  border-width: 1px;
  border-style: solid;
  border-color: rgba(253, 246, 232, 0.95);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.12);
  line-height: 1;
  transform: none;
  outline: none;
}

div.pagina_frame_chat button.chat_party_aura img{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

div.pagina_frame_chat span.chat_party_aura__letter{
  font-family: Georgia, serif;
  font-size: 12px;
  font-weight: bold;
  color: #f3e2bd;
  text-transform: uppercase;
}

/* Aure con interruttore su "inattiva": icona spenta */
div.pagina_frame_chat button.chat_party_aura.is-inactive{
  border-color: rgba(143, 147, 159, 0.45);
  opacity: 0.45;
  filter: grayscale(1);
}

/* Overlay della card aura aperta al click (contenuto con le classi
   dei tooltip incantesimi, già stilate sopra) */
#chat_party_aura_overlay{
  position: fixed;
  z-index: 2147483647;
  display: none;
  pointer-events: auto;
  width: min(680px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow-y: auto;
}

#chat_party_aura_overlay.is_visible{
  display: block;
}

/* Card aura: le due colonne contengono flussi verticali indipendenti.
   Una descrizione estesa non spinge quindi il riepilogo o il livello
   oltre il proprio contenuto. */
#chat_party_aura_overlay .chat_spell_tooltip_body{
  display: block;
}

#chat_party_aura_overlay .chat_party_aura_card__columns{
  display: grid;
  grid-template-columns: minmax(210px, 0.85fr) minmax(0, 1.15fr);
  align-items: start;
  column-gap: 18px;
}

#chat_party_aura_overlay .chat_party_aura_card__columns--single{
  grid-template-columns: minmax(0, 1fr);
}

#chat_party_aura_overlay .chat_party_aura_card__column{
  min-width: 0;
}

#chat_party_aura_overlay .chat_party_aura_card__column .chat_spell_tooltip_section{
  min-width: 0;
  margin-bottom: 10px;
}

#chat_party_aura_overlay .chat_party_aura_card__column .chat_spell_tooltip_section + .chat_spell_tooltip_section{
  margin-top: 0;
}

@media (max-width: 640px) {
  #chat_party_aura_overlay .chat_party_aura_card__columns{
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0;
  }

  div.pagina_frame_chat div.chat_party_drawer.is-open div.chat_party_panel{
    width: min(288px, calc(100vw - 46px));
  }
}

/* Arbitraggio dal drawer: blocco parametri in coda alla targa (solo Master) */
div.pagina_frame_chat details.chat_party_master{
  margin-top: 8px;
  border-top: 1px solid rgba(227, 197, 144, 0.16);
  padding-top: 7px;
}

div.pagina_frame_chat summary.chat_party_master__summary{
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  margin: 0;
  padding: 4px 8px;
  border-width: 1px;
  border-style: solid;
  border-color: rgba(227, 197, 144, 0.42);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(227, 197, 144, 0.14) 0%, rgba(227, 197, 144, 0.07) 100%);
  color: #f3e2bd;
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: normal;
  line-height: 1.2;
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
  transform: none;
}

div.pagina_frame_chat summary.chat_party_master__summary::-webkit-details-marker{
  display: none;
}

div.pagina_frame_chat summary.chat_party_master__summary:hover,
div.pagina_frame_chat summary.chat_party_master__summary:focus{
  display: flex;
  box-sizing: border-box;
  min-height: 26px;
  margin: 0;
  padding: 4px 8px;
  border-width: 1px;
  border-style: solid;
  border-color: rgba(253, 246, 232, 0.85);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(227, 197, 144, 0.21) 0%, rgba(227, 197, 144, 0.11) 100%);
  color: #fdf6e8;
  font-size: 11px;
  font-weight: normal;
  line-height: 1.2;
  transform: none;
  outline: none;
}

div.pagina_frame_chat details.chat_party_master form.chat_party_form{
  margin-top: 7px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

div.pagina_frame_chat label.chat_party_res{
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: rgba(243, 245, 249, 0.85);
}

div.pagina_frame_chat span.chat_party_res__label{
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

div.pagina_frame_chat span.chat_party_res__max{
  flex: 0 0 auto;
  color: rgba(243, 245, 249, 0.55);
}

div.pagina_frame_chat div.chat_party_delta_row{
  display: flex;
  align-items: center;
  gap: 4px;
}

div.pagina_frame_chat form.chat_party_form--delta{
  margin-top: 8px;
}

div.pagina_frame_chat form.chat_party_form--delta span.chat_party_field__label{
  font-size: 11px;
  letter-spacing: 0;
  color: rgba(243, 245, 249, 0.70);
}

div.pagina_frame_chat details.chat_party_master input[type="number"],
div.pagina_frame_chat details.chat_party_master select{
  box-sizing: border-box;
  flex: 0 0 auto;
  width: 58px;
  min-height: 24px;
  height: 24px;
  margin: 0;
  padding: 2px 5px;
  border-width: 1px;
  border-style: solid;
  border-color: rgba(227, 197, 144, 0.45);
  border-radius: 4px;
  background: rgba(8, 10, 14, 0.34);
  color: #f3e2bd;
  font-size: 11px;
  font-weight: normal;
  line-height: 1.2;
  transform: none;
}

div.pagina_frame_chat details.chat_party_master select{
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

div.pagina_frame_chat details.chat_party_master div.chat_party_actions{
  display: flex;
  gap: 4px;
}

div.pagina_frame_chat details.chat_party_master button.chat_party_btn{
  box-sizing: border-box;
  flex: 1 1 auto;
  min-height: 25px;
  height: 25px;
  margin: 0;
  padding: 0 7px;
  border-width: 1px;
  border-style: solid;
  border-color: rgba(227, 197, 144, 0.55);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(227, 197, 144, 0.14) 0%, rgba(227, 197, 144, 0.08) 100%);
  color: #f3e2bd;
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: normal;
  line-height: 1;
  cursor: pointer;
  transform: none;
}

div.pagina_frame_chat details.chat_party_master button.chat_party_btn:hover,
div.pagina_frame_chat details.chat_party_master button.chat_party_btn:focus{
  box-sizing: border-box;
  flex: 1 1 auto;
  min-height: 25px;
  height: 25px;
  margin: 0;
  padding: 0 7px;
  border-width: 1px;
  border-style: solid;
  border-color: rgba(253, 246, 232, 0.95);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(227, 197, 144, 0.23) 0%, rgba(227, 197, 144, 0.13) 100%);
  color: #fdf6e8;
  font-size: 11px;
  font-weight: normal;
  line-height: 1;
  transform: none;
  outline: none;
}

div.pagina_frame_chat details.chat_party_master button.chat_party_btn--icon{
  flex: 0 0 auto;
  width: 28px;
  min-width: 28px;
  text-align: center;
}

div.pagina_frame_chat details.chat_party_master button.chat_party_btn--icon:hover,
div.pagina_frame_chat details.chat_party_master button.chat_party_btn--icon:focus{
  flex: 0 0 auto;
  width: 28px;
  min-width: 28px;
}

/* Strumenti in calce alla card aura (pergamena): modifica staff e congedo */
.chat_party_aura_tools{
  flex: 1 1 100%;
  border-top: 1px solid rgba(117, 73, 31, 0.28);
  padding-top: 8px;
}

.chat_party_aura_tools form.chat_party_form{
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.chat_party_aura_tools div.chat_party_field_row{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chat_party_aura_tools label.chat_party_field{
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 120px;
  min-width: 0;
}

.chat_party_aura_tools span.chat_party_field__label{
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: rgba(59, 36, 19, 0.70);
}

.chat_party_aura_tools label.chat_party_check{
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #3b2413;
}

.chat_party_aura_tools input[type="text"],
.chat_party_aura_tools input[type="number"],
.chat_party_aura_tools textarea{
  box-sizing: border-box;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 3px 5px;
  border: 1px solid rgba(117, 73, 31, 0.45);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.60);
  color: #3b2413;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.4;
}

.chat_party_aura_tools textarea{
  min-height: 62px;
  resize: vertical;
}

.chat_party_aura_tools label.chat_party_check input[type="checkbox"]{
  width: auto;
  margin: 0;
}

.chat_party_aura_tools div.chat_party_actions{
  display: flex;
  gap: 6px;
}

.chat_party_aura_tools button.chat_party_btn{
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  height: auto;
  margin: 0;
  padding: 4px 10px;
  border-width: 1px;
  border-style: solid;
  border-color: #b48a54;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.55);
  color: #3b2413;
  font-family: Georgia, serif;
  font-size: 12px;
  font-weight: normal;
  line-height: 1.4;
  cursor: pointer;
  transform: none;
}

.chat_party_aura_tools button.chat_party_btn:hover,
.chat_party_aura_tools button.chat_party_btn:focus{
  display: inline-flex;
  box-sizing: border-box;
  min-height: 28px;
  height: auto;
  margin: 0;
  padding: 4px 10px;
  border-width: 1px;
  border-style: solid;
  border-color: #75491f;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.80);
  color: #2b1a0d;
  font-size: 12px;
  font-weight: normal;
  line-height: 1.4;
  transform: none;
  outline: none;
}

.chat_party_aura_tools button.chat_party_btn--danger{
  border-color: rgba(140, 44, 38, 0.60);
  color: #5d1512;
}

.chat_party_aura_tools button.chat_party_btn--danger:hover,
.chat_party_aura_tools button.chat_party_btn--danger:focus{
  border-color: rgba(140, 44, 38, 0.95);
  background: rgba(140, 44, 38, 0.12);
  color: #5d1512;
}

/* =========================
   PANNELLO PNG — tab di gestione dei Personaggi Non Giocanti (solo Master)
   ========================= */
div.pagina_frame_chat div.chat_png_panel{
  box-sizing: border-box;
  width: 100%;
  /* Riserva sotto la barra l'equivalente della striscia cp_label delle
     altre tab (margine 3px + padding 1px + riga 13px = 17px, meno i 2px
     di padding verticale della barra): l'altezza del pannello PNG resta
     così uniforme a quella degli altri pannelli anche senza etichette */
  padding-bottom: 15px;
}

/* Barra unica orizzontale: controlli, etichette di sezione e chip dei PNG
   fluiscono sulla stessa riga e vanno a capo solo quando serve; oltre le
   ~3 righe la barra scorre al suo interno, così il pannello resta basso */
div.pagina_frame_chat div.chat_png_bar{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 5px 7px;
  box-sizing: border-box;
  width: 100%;
  max-height: 106px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1px;
}

/* Campo di ricerca: filtra le chip PNG per nome senza ricaricare;
   stesse metriche degli altri input del pannello inferiore (34px) */
div.pagina_frame_chat input.chat_png_filter{
  flex: 0 1 auto;
  box-sizing: border-box;
  width: min(240px, 32vw);
  min-width: 110px;
  height: 34px;
  min-height: 34px;
  margin: 0;
  padding: 4px 10px;
  border: 1px solid rgba(124, 86, 44, 0.55);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  color: #1e1206;
  font-size: 12px;
  font-family: Georgia, serif;
  line-height: 1.4;
}

div.pagina_frame_chat input.chat_png_filter:focus{
  border-color: #7c562c;
  outline: none;
}

div.pagina_frame_chat .chat_png_btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: auto;
  height: 34px;
  min-height: 34px;
  padding: 0 14px;
  margin: 0;
  border: 1px solid rgba(124, 86, 44, 0.55);
  border-radius: 10px;
  background: rgba(255, 248, 236, 0.82);
  color: #4a3318;
  font-size: 12px;
  font-family: Georgia, serif;
  line-height: 1.2;
  font-weight: normal;
  text-decoration: none;
  cursor: pointer;
  transform: none;
}

div.pagina_frame_chat .chat_png_btn:hover,
div.pagina_frame_chat .chat_png_btn:focus{
  display: inline-flex;
  box-sizing: border-box;
  width: auto;
  height: 34px;
  min-height: 34px;
  padding: 0 14px;
  margin: 0;
  border-width: 1px;
  border-style: solid;
  border-color: #7c562c;
  background: rgba(124, 86, 44, 0.18);
  color: #2f1f0e;
  font-weight: normal;
  line-height: 1.2;
  text-decoration: none;
  outline: none;
  transform: none;
}

div.pagina_frame_chat .chat_png_btn--create{
  border-color: #7c562c;
  background: rgba(124, 86, 44, 0.25);
  font-weight: bold;
}

div.pagina_frame_chat .chat_png_btn--create:hover,
div.pagina_frame_chat .chat_png_btn--create:focus{
  border-color: #5f3f1c;
  background: rgba(124, 86, 44, 0.34);
  color: #2f1f0e;
  font-weight: bold;
  box-shadow: 0 0 0 2px rgba(124, 86, 44, 0.10);
}

/* Gruppo di sezione (etichetta + chip): con display:contents i figli
   fluiscono direttamente nella barra come elementi propri */
div.pagina_frame_chat span.chat_png_group{
  display: contents;
}

div.pagina_frame_chat span.chat_png_bar__label{
  flex: 0 0 auto;
  margin: 0 0 0 4px;
  padding: 0 0 0 10px;
  border-left: 1px solid rgba(124, 86, 44, 0.35);
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7c562c;
  line-height: 1.4;
  white-space: nowrap;
}

/* Toggle "Altri PNG": stessa veste dell'etichetta ma cliccabile;
   hover/focus cambiano solo il colore */
div.pagina_frame_chat button.chat_png_bar__toggle{
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-sizing: border-box;
  height: auto;
  min-height: 0;
  margin: 0 0 0 4px;
  padding: 0 0 0 10px;
  border: none;
  border-left: 1px solid rgba(124, 86, 44, 0.35);
  border-radius: 0;
  background: none;
  cursor: pointer;
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: left;
  line-height: 1.4;
  color: #7c562c;
  white-space: nowrap;
  transform: none;
}

div.pagina_frame_chat button.chat_png_bar__toggle:hover,
div.pagina_frame_chat button.chat_png_bar__toggle:focus{
  display: inline-flex;
  box-sizing: border-box;
  height: auto;
  min-height: 0;
  margin: 0 0 0 4px;
  padding: 0 0 0 10px;
  border: none;
  border-left: 1px solid rgba(124, 86, 44, 0.35);
  background: none;
  font-weight: bold;
  line-height: 1.4;
  color: #4a3318;
  outline: none;
  transform: none;
}

div.pagina_frame_chat span.chat_png_bar__chevron{
  display: inline-block;
  flex: 0 0 auto;
  font-size: 10px;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform 0.15s ease;
}

div.pagina_frame_chat span.chat_png_group.is-collapsed span.chat_png_bar__chevron{
  transform: rotate(0deg);
}

/* Gruppo compresso: restano visibili solo etichetta/toggle */
div.pagina_frame_chat span.chat_png_group.is-collapsed button.chat_png_chip,
div.pagina_frame_chat span.chat_png_group.is-collapsed span.chat_png_empty{
  display: none;
}

div.pagina_frame_chat span.chat_png_empty{
  flex: 0 0 auto;
  font-size: 11px;
  font-style: italic;
  color: rgba(74, 51, 24, 0.75);
  line-height: 1.4;
}

/* Messaggio "nessuna corrispondenza": mostrato dal JS quando il filtro
   nasconde tutte le chip della sezione */
div.pagina_frame_chat span.chat_png_empty--nomatch{
  display: none;
}

div.pagina_frame_chat span.chat_png_empty--nomatch.is-visible{
  display: inline;
}

/* Chip PNG: avatar + nome; l'intera chip apre il menù azioni */
div.pagina_frame_chat button.chat_png_chip{
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-sizing: border-box;
  max-width: 220px;
  height: 30px;
  min-height: 30px;
  margin: 0;
  padding: 2px 11px 2px 4px;
  border: 1px solid rgba(124, 86, 44, 0.45);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.55);
  color: #3a2812;
  font-size: 12px;
  font-family: Georgia, serif;
  line-height: 1.2;
  font-weight: normal;
  cursor: pointer;
  transform: none;
}

/* Variante per i PNG non in scena in questa stanza: più sbiadita */
div.pagina_frame_chat button.chat_png_chip--off{
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(124, 86, 44, 0.30);
  color: rgba(58, 40, 18, 0.85);
}

div.pagina_frame_chat button.chat_png_chip:hover,
div.pagina_frame_chat button.chat_png_chip:focus{
  display: inline-flex;
  box-sizing: border-box;
  height: 30px;
  min-height: 30px;
  margin: 0;
  padding: 2px 11px 2px 4px;
  border-width: 1px;
  border-style: solid;
  border-color: #7c562c;
  background: rgba(124, 86, 44, 0.18);
  color: #2f1f0e;
  font-weight: normal;
  line-height: 1.2;
  outline: none;
  transform: none;
}

/* Chip nascosta dal filtro per nome */
div.pagina_frame_chat button.chat_png_chip.is-filtered{
  display: none;
}

div.pagina_frame_chat span.chat_png_chip__avatar{
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(124, 86, 44, 0.15);
}

div.pagina_frame_chat span.chat_png_chip__avatar img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

div.pagina_frame_chat span.chat_png_chip__nome{
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: bold;
}

div.pagina_frame_chat span.chat_png_chip__cognome{
  font-weight: normal;
  color: rgba(58, 40, 18, 0.8);
}

div.pagina_frame_chat span.chat_png_chip__nickname{
  font-weight: bold;
  font-style: italic;
  color: #2b1a09;
}

div.pagina_frame_chat span.chat_png_chip__realname{
  font-weight: normal;
  color: rgba(58, 40, 18, 0.8);
}

/* Menù azioni flottante: elemento unico riposizionato dal JS accanto al
   pulsante ⋮ premuto; position:fixed per non essere tagliato dagli
   overflow del pannello inferiore e delle sezioni scrollabili */
div.pagina_frame_chat div.chat_png_action_menu{
  position: fixed;
  z-index: 60;
  display: none;
  min-width: 150px;
  padding: 5px;
  border: 1px solid #7c562c;
  border-radius: 8px;
  background: #fdf3e0;
  box-shadow: 0 4px 14px rgba(58, 37, 16, 0.35);
}

div.pagina_frame_chat div.chat_png_action_menu.is-open{
  display: block;
}

div.pagina_frame_chat .chat_png_action_menu .chat_png_menu_item{
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 5px 10px;
  border: none;
  border-radius: 6px;
  background: none;
  color: #4a3318;
  font-size: 12px;
  font-family: Georgia, serif;
  line-height: 1.4;
  font-weight: normal;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transform: none;
}

div.pagina_frame_chat .chat_png_action_menu .chat_png_menu_item:hover,
div.pagina_frame_chat .chat_png_action_menu .chat_png_menu_item:focus{
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 5px 10px;
  border: none;
  background: rgba(124, 86, 44, 0.16);
  color: #2f1f0e;
  font-weight: normal;
  line-height: 1.4;
  text-decoration: none;
  outline: none;
  transform: none;
}

div.pagina_frame_chat .chat_png_action_menu .chat_png_menu_item--danger{
  color: #7a1f1a;
}

div.pagina_frame_chat .chat_png_action_menu .chat_png_menu_item--danger:hover,
div.pagina_frame_chat .chat_png_action_menu .chat_png_menu_item--danger:focus{
  background: rgba(140, 44, 38, 0.14);
  color: #5d1512;
}

/* ===== Tab "Julie" (Karma Control Panel ridotto in chat) ===================
   Barra compatta a riga singola: i controlli restano stabili e le regole
   attive si aprono a richiesta come la sezione "Altri PNG". */
div.pagina_frame_chat div.chat_julie_panel{
  box-sizing: border-box;
  width: 100%;
  height: 51px;
  padding: 0;
  overflow: hidden;
}

/* I 51px equivalgono a un controllo standard con la relativa cp_label e
   includono lo spazio dell'eventuale scrollbar orizzontale. */
div.pagina_frame_chat div.chat_julie_bar{
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 7px;
  box-sizing: border-box;
  width: 100%;
  height: 51px;
  max-height: 51px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 1px;
  scrollbar-color: rgba(124, 86, 44, 0.48) rgba(255, 255, 255, 0.22);
  scrollbar-width: thin;
}

div.pagina_frame_chat div.chat_julie_bar::-webkit-scrollbar{
  height: 8px;
}

div.pagina_frame_chat div.chat_julie_bar::-webkit-scrollbar-track{
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.22);
}

div.pagina_frame_chat div.chat_julie_bar::-webkit-scrollbar-thumb{
  border-radius: 4px;
  background: rgba(124, 86, 44, 0.48);
}

div.pagina_frame_chat form.chat_julie_form{
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  min-width: max-content;
  margin: 0;
  padding: 0;
}

/* Gruppo etichetta + select accoppiate (min/max) */
div.pagina_frame_chat span.chat_julie_field{
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 3px;
  box-sizing: border-box;
  height: 28px;
  min-height: 28px;
  margin: 0;
  padding: 0 6px 0 0;
  border-right: 1px solid rgba(124, 86, 44, 0.24);
}

div.pagina_frame_chat span.chat_julie_field--who{
  padding-right: 8px;
}

div.pagina_frame_chat span.chat_julie_flabel{
  flex: 0 0 auto;
  color: rgba(58, 37, 16, 0.72);
  font-size: 10px;
  font-family: Georgia, serif;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* La specificità include chat_bottom_panel per prevalere sulla regola
   generale che assegna width:100% a tutte le select del pannello. */
div.pagina_frame_chat div.chat_bottom_panel select.chat_julie_sel{
  flex: 0 0 auto;
  box-sizing: border-box;
  height: 28px;
  min-height: 28px;
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  margin: 0;
  padding: 2px 4px;
  border: 1px solid rgba(124, 86, 44, 0.55);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: #1e1206;
  font-size: 11px;
  font-family: Georgia, serif;
  font-weight: normal;
  line-height: 1.2;
}

div.pagina_frame_chat div.chat_bottom_panel select.chat_julie_sel:focus{
  box-sizing: border-box;
  height: 28px;
  min-height: 28px;
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  margin: 0;
  padding: 2px 4px;
  border-width: 1px;
  border-style: solid;
  border-color: #7c562c;
  font-weight: normal;
  line-height: 1.2;
  outline: none;
  transform: none;
}

div.pagina_frame_chat div.chat_bottom_panel select.chat_julie_sel--who{
  width: clamp(120px, 13vw, 188px);
  min-width: 120px;
  max-width: 188px;
  font-weight: bold;
}

div.pagina_frame_chat div.chat_bottom_panel select.chat_julie_sel--who:focus{
  width: clamp(120px, 13vw, 188px);
  min-width: 120px;
  max-width: 188px;
  font-weight: bold;
}

/* Pulsante "Fa quella cosa!" e pulsanti di servizio: 28px come le select */
div.pagina_frame_chat button.chat_julie_apply,
div.pagina_frame_chat button.chat_julie_apply:hover,
div.pagina_frame_chat button.chat_julie_apply:focus,
div.pagina_frame_chat .chat_julie_btn,
div.pagina_frame_chat .chat_julie_btn:hover,
div.pagina_frame_chat .chat_julie_btn:focus{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 28px;
  min-height: 28px;
  width: auto;
  margin: 0;
  border-width: 1px;
  border-style: solid;
  border-radius: 8px;
  font-size: 11px;
  font-family: Georgia, serif;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transform: none;
}

div.pagina_frame_chat button.chat_julie_apply{
  padding: 0 12px;
  border-color: #7c562c;
  background: linear-gradient(180deg, #f3d79a 0%, #e0b56a 100%);
  color: #3a2510;
  font-weight: bold;
}

div.pagina_frame_chat button.chat_julie_apply:hover,
div.pagina_frame_chat button.chat_julie_apply:focus{
  border-color: #5a3d1e;
  background: linear-gradient(180deg, #f7e0ac 0%, #e6bf78 100%);
  color: #2b1d0d;
  font-weight: bold;
  outline: none;
}

div.pagina_frame_chat .chat_julie_btn{
  padding: 0 9px;
  border-color: rgba(124, 86, 44, 0.45);
  background: rgba(255, 255, 255, 0.55);
  color: #3a2812;
  font-weight: normal;
}

div.pagina_frame_chat .chat_julie_btn:hover,
div.pagina_frame_chat .chat_julie_btn:focus{
  border-color: #7c562c;
  background: rgba(124, 86, 44, 0.18);
  color: #2f1f0e;
  font-weight: normal;
  outline: none;
}

div.pagina_frame_chat .chat_julie_btn--full,
div.pagina_frame_chat .chat_julie_btn--full:hover,
div.pagina_frame_chat .chat_julie_btn--full:focus{
  font-size: 10px;
}

/* Sezione regole attive: etichetta + chip, sulla stessa barra */
div.pagina_frame_chat span.chat_julie_rules{
  display: inline-flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  min-width: max-content;
  height: 28px;
  min-height: 28px;
}

div.pagina_frame_chat button.chat_julie_rules__toggle{
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-sizing: border-box;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0 0 0 10px;
  border: none;
  border-left: 1px solid rgba(124, 86, 44, 0.3);
  border-radius: 0;
  background: none;
  color: rgba(58, 37, 16, 0.72);
  font-size: 10px;
  font-family: Georgia, serif;
  font-weight: bold;
  line-height: 1.4;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: pointer;
  transform: none;
}

div.pagina_frame_chat button.chat_julie_rules__toggle:hover,
div.pagina_frame_chat button.chat_julie_rules__toggle:focus{
  display: inline-flex;
  box-sizing: border-box;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0 0 0 10px;
  border: none;
  border-left: 1px solid rgba(124, 86, 44, 0.3);
  background: none;
  color: #4a3318;
  font-weight: bold;
  line-height: 1.4;
  outline: none;
  transform: none;
}

div.pagina_frame_chat span.chat_julie_rules__chevron{
  display: inline-block;
  flex: 0 0 auto;
  font-size: 10px;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform 0.15s ease;
}

div.pagina_frame_chat span.chat_julie_rules.is-collapsed span.chat_julie_rules__chevron{
  transform: rotate(0deg);
}

div.pagina_frame_chat span.chat_julie_rules.is-collapsed span.chat_julie_chip,
div.pagina_frame_chat span.chat_julie_rules.is-collapsed span.chat_julie_empty{
  display: none;
}

div.pagina_frame_chat span.chat_julie_empty{
  color: rgba(58, 40, 18, 0.7);
  font-size: 11px;
  font-family: Georgia, serif;
  font-style: italic;
}

/* Chip di una regola: pallino stato + testo + durata + elimina */
div.pagina_frame_chat span.chat_julie_chip{
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-sizing: border-box;
  max-width: 250px;
  height: 28px;
  min-height: 28px;
  padding: 2px 4px 2px 6px;
  border: 1px solid rgba(124, 86, 44, 0.45);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  color: #3a2812;
  font-size: 11px;
  font-family: Georgia, serif;
  line-height: 1.15;
}

/* Regola disattivata: più sbiadita, come le chip PNG fuori scena */
div.pagina_frame_chat span.chat_julie_chip--off{
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(124, 86, 44, 0.28);
  color: rgba(58, 40, 18, 0.7);
}

/* Pallino di stato: verde acceso se attiva, spento se no; è anche il toggle */
div.pagina_frame_chat button.chat_julie_chip__dot,
div.pagina_frame_chat button.chat_julie_chip__dot:hover,
div.pagina_frame_chat button.chat_julie_chip__dot:focus{
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 11px;
  height: 11px;
  margin: 0;
  padding: 0;
  border: 1px solid #4f7a3a;
  border-radius: 50%;
  background: #7bb45a;
  cursor: pointer;
  transform: none;
}

div.pagina_frame_chat button.chat_julie_chip__dot:hover,
div.pagina_frame_chat button.chat_julie_chip__dot:focus{
  box-shadow: 0 0 4px rgba(123, 180, 90, 0.9);
  outline: none;
}

div.pagina_frame_chat span.chat_julie_chip--off button.chat_julie_chip__dot{
  border-color: rgba(90, 61, 30, 0.5);
  background: rgba(124, 86, 44, 0.25);
}

div.pagina_frame_chat span.chat_julie_chip__body{
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
}

div.pagina_frame_chat span.chat_julie_chip__name{
  min-width: 0;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: bold;
}

div.pagina_frame_chat span.chat_julie_chip__rule{
  min-width: 0;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(58, 40, 18, 0.85);
  font-size: 10px;
}

div.pagina_frame_chat span.chat_julie_chip__dur{
  flex: 0 0 auto;
  padding: 1px 5px;
  border-radius: 8px;
  background: rgba(124, 86, 44, 0.14);
  color: rgba(58, 40, 18, 0.85);
  font-size: 9px;
  white-space: nowrap;
}

div.pagina_frame_chat button.chat_julie_chip__x,
div.pagina_frame_chat button.chat_julie_chip__x:hover,
div.pagina_frame_chat button.chat_julie_chip__x:focus{
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: rgba(140, 44, 38, 0.85);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transform: none;
}

div.pagina_frame_chat button.chat_julie_chip__x:hover,
div.pagina_frame_chat button.chat_julie_chip__x:focus{
  border-color: rgba(140, 44, 38, 0.5);
  background: rgba(140, 44, 38, 0.14);
  color: #5d1512;
  outline: none;
}

/* ==========================================================================
   Modalità "Modifica Post" della chat (solo Gestori)
   Il pannello della tab è la modalità: finché è aperto, le righe della chat
   mostrano i comandi. Lo spazio del pannello è poco e condiviso con gli altri,
   quindi qui si sta su una riga di comandi e due righe di testo al massimo.
   ========================================================================== */

div.pagina_frame_chat div.chat_modifica_post_panel {
	padding-bottom: 8px;
}

div.pagina_frame_chat div.chat_modifica_post_panel__riga {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

div.pagina_frame_chat span.chat_modifica_post_conteggio {
	margin: 0 2px;
	font-family: Georgia, serif;
	font-size: 11px;
	font-style: italic;
	color: rgba(58, 37, 16, 0.75);
	white-space: nowrap;
}

div.pagina_frame_chat p.chat_modifica_post_panel__intro {
	margin: 6px 0 0 0;
	font-family: Georgia, serif;
	font-size: 11px;
	line-height: 1.35;
	color: rgba(58, 37, 16, 0.72);
}

div.pagina_frame_chat p.chat_modifica_post_panel__esito {
	margin: 4px 0 0 0;
	font-family: Georgia, serif;
	font-size: 11px;
	font-style: italic;
	color: rgba(58, 37, 16, 0.9);
}

div.pagina_frame_chat p.chat_modifica_post_panel__esito.is-errore {
	color: #7a1c17;
	font-style: normal;
}

/* Pulsanti del pannello e delle righe: stato normale e hover hanno lo stesso
   box model, cambiano solo i colori (niente spostamenti del testo). */
div.pagina_frame_chat button.chat_modifica_post_azione,
div.pagina_frame_chat button.chat_mp_btn {
	display: inline-block;
	box-sizing: border-box;
	width: auto;
	height: auto;
	min-height: 0;
	margin: 0;
	padding: 3px 8px;
	border: 1px solid rgba(124, 86, 44, 0.5);
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.55);
	color: rgba(58, 37, 16, 0.85);
	font-family: Georgia, serif;
	font-size: 11px;
	font-weight: normal;
	line-height: 1.4;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transform: none;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

div.pagina_frame_chat button.chat_modifica_post_azione:hover,
div.pagina_frame_chat button.chat_modifica_post_azione:focus,
div.pagina_frame_chat button.chat_mp_btn:hover,
div.pagina_frame_chat button.chat_mp_btn:focus {
	display: inline-block;
	box-sizing: border-box;
	height: auto;
	min-height: 0;
	margin: 0;
	padding: 3px 8px;
	border-width: 1px;
	border-style: solid;
	border-color: rgba(124, 86, 44, 0.85);
	background: rgba(255, 255, 255, 0.85);
	color: rgba(58, 37, 16, 1);
	font-size: 11px;
	font-weight: normal;
	line-height: 1.4;
	transform: none;
	outline: none;
}

div.pagina_frame_chat button.chat_modifica_post_azione--elimina,
div.pagina_frame_chat button.chat_mp_btn--elimina {
	border-color: rgba(140, 44, 38, 0.55);
	color: #7a1c17;
}

div.pagina_frame_chat button.chat_modifica_post_azione--elimina:hover,
div.pagina_frame_chat button.chat_modifica_post_azione--elimina:focus,
div.pagina_frame_chat button.chat_mp_btn--elimina:hover,
div.pagina_frame_chat button.chat_mp_btn--elimina:focus {
	border-color: rgba(140, 44, 38, 0.9);
	background: rgba(140, 44, 38, 0.14);
	color: #5d1512;
}

div.pagina_frame_chat button.chat_modifica_post_azione[disabled],
div.pagina_frame_chat button.chat_modifica_post_azione[disabled]:hover {
	opacity: 0.45;
	cursor: default;
	background: rgba(255, 255, 255, 0.55);
	border-color: rgba(124, 86, 44, 0.5);
}

/* Comandi in testa a ogni riga: compaiono solo con la modalità accesa, e sono
   volutamente minuti per non allontanare il testo del post. */
div.pagina_frame_chat span.chat_mp_comandi {
	display: none;
}

div.pagina_frame_chat div.chat_box.is-modifica-post span.chat_mp_comandi {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	margin-right: 5px;
	vertical-align: middle;
}

div.pagina_frame_chat div.chat_box.is-modifica-post span.chat_mp_comandi button.chat_mp_btn {
	padding: 1px 6px;
	font-size: 10px;
	line-height: 1.3;
}

div.pagina_frame_chat div.chat_box.is-modifica-post span.chat_mp_comandi button.chat_mp_btn:hover,
div.pagina_frame_chat div.chat_box.is-modifica-post span.chat_mp_comandi button.chat_mp_btn:focus {
	padding: 1px 6px;
	font-size: 10px;
	line-height: 1.3;
}

div.pagina_frame_chat div.chat_box.is-modifica-post input.chat_mp_check {
	width: auto;
	height: auto;
	margin: 0 1px 0 0;
	vertical-align: middle;
	cursor: pointer;
}

/* Riga in corso di modifica: evidenziata senza spostare nulla. */
div.pagina_frame_chat div.chat_box.is-modifica-post [data-mid].is-mp-in-modifica {
	background: rgba(140, 44, 38, 0.07);
	border-radius: 6px;
}

div.pagina_frame_chat div.chat_mp_editor {
	margin: 4px 0 4px 0;
	padding: 6px;
	border: 1px solid rgba(124, 86, 44, 0.5);
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.78);
	font-family: Georgia, serif;
	font-size: 11px;
}

div.pagina_frame_chat p.chat_mp_editor__avviso {
	margin: 0 0 5px 0;
	color: #7a1c17;
	line-height: 1.35;
}

div.pagina_frame_chat textarea.chat_mp_editor__testo {
	box-sizing: border-box;
	width: 100%;
	margin: 0 0 5px 0;
	padding: 5px;
	border: 1px solid rgba(124, 86, 44, 0.5);
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.92);
	color: rgba(58, 37, 16, 0.95);
	font-family: Georgia, serif;
	font-size: 12px;
	line-height: 1.45;
	resize: vertical;
}

div.pagina_frame_chat div.chat_mp_editor__azioni {
	display: flex;
	gap: 5px;
}
