  /* ==================== (A) Fonts ==================== */
  /* ==================== (A) Fonts ==================== */
  @font-face {
    font-family: Charlemagne;
    src: url('../assets/fonts/CharlemagneStd-Bold.otf') format("otf");
  }

  @font-face {
    font-family: GismondaFG;
    src: url('../assets/fonts/GismondaFG.woff') format("woff");
  }

  @font-face {
    font-family: Garamond;
    src: url('../assets/fonts/Garamond.woff') format("woff");
  }

  :root {
    /* =================== 1. ACTOR SHEET FONT STYLES =========== */
    --window-header-font-family: GismondaFG;
    --window-header-title-font-size: 1.1rem;
    --window-header-title-font-weight: normal;
    --window-header-title-color: #f5f5f5;

    --major-button-font-family: GismondaFG;
    --major-button-font-size: 1.05rem;
    --major-button-font-weight: normal;
    --major-button-color: #dadada;

    --tab-header-font-family: GismondaFG;
    --tab-header-font-size: 1.0rem;
    --tab-header-font-weight: 700;
    --tab-header-color: #403f3e;
    --tab-header-color-active: #4a0404;

    --actor-input-font-size: 0.8rem;
    --actor-input-font-weight: 500;
    --actor-input-color: black;

    --actor-label-font-size: 0.8rem;
    --actor-label-font-weight: 700;
    --actor-label-color: #464331c4;

    /* =================== 2. DEBUGGING HIGHLIGHTERS ============ */
    --debug-background-color-red: #ff000054;
    --debug-background-color-blue: #1d00ff54;
    --debug-background-color-green: #54ff0054;

    --debug-box-shadow-red: inset 0 0 2px red;
    --debug-box-shadow-blue: inset 0 0 2px blue;
    --debug-box-shadow-green: inset 0 0 2px green;

    /* =================== 3. OVERRIDE FOUNDRY BACKGROUND ======= */
    --background: #e8e4d8;
  }

  .application.sheet.item,
  .application.sheet.actor,
  .window-app.sheet.item,
  .window-app.sheet.actor {
    --input-height: 1.8rem;
  }

  /*@import url("https://fonts.googleapis.com/css2?family=Martel:wght@400;800&family=Roboto:wght@300;400;500&display=swap");*/

  /* Override Foundry's .application background and remove all padding */
  .application.sheet.item,
  .application.sheet.actor {
    background: #e8e4d8 url("../assets/ui/fiche_background_simple_01.webp") repeat !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Remove ALL margins from forms, sections, headers in sheets */
  .application.sheet.item form,
  .application.sheet.actor form,
  .window-app.sheet.item form,
  .window-app.sheet.actor form,
  .application.sheet.item > section,
  .application.sheet.actor > section,
  .window-app.sheet.item > section,
  .window-app.sheet.actor > section {
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Remove all margins and padding from item sheet headers */
  .application.sheet.item .sheet-header,
  .application.sheet.actor .sheet-header,
  .window-app.sheet.item .sheet-header,
  .window-app.sheet.actor .sheet-header {
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Fix item sheet image size */
  .application.sheet.item header.sheet-header img.item-sheet-img,
  .window-app.sheet.item header.sheet-header img.item-sheet-img {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    max-width: 64px;
    max-height: 64px;
    margin: 4px;
    object-fit: cover;
  }

  /* Adjust header fields width */
  .application.sheet.item .header-fields,
  .window-app.sheet.item .header-fields {
    flex: 0 0 30rem;
    width: 30rem;
    margin-right: 10px;
  }

  /* Style chat button in item header */
  .application.sheet.item .header-actions,
  .window-app.sheet.item .header-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
  }

  .application.sheet.item .header-actions button,
  .window-app.sheet.item .header-actions button {
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid #999;
    border-radius: 3px;
    padding: 5px 10px;
    cursor: pointer;
  }

  .application.sheet.item .header-actions button:hover,
  .window-app.sheet.item .header-actions button:hover {
    background: rgba(0, 0, 0, 0.2);
  }

  /* Global styles & Font */
  .window-app {
    font-family: GismondaFG;
    text-align: justify;
    font-size: 12px;
    letter-spacing: 1px;
    background: #e8e4d8 url("../assets/ui/fiche_background_simple_01.webp") repeat !important;
  }

  /* Ensure item sheets also have the background */
  .window-app.sheet.item {
    background: #e8e4d8 url("../assets/ui/fiche_background_simple_01.webp") repeat !important;
  }

  /* Ensure actor sheets also have the background */
  .window-app.sheet.actor {
    background: #e8e4d8 url("../assets/ui/fiche_background_simple_01.webp") repeat !important;
  }

  /* Fonts */
  .window-app .window-header,
  #actors .directory-list,
  #navigation #scene-list .scene.nav-item {
    font-family: GismondaFG;
    font-size: 0.8rem;
  }

  /* For title, sidebar character and scene */
  .sheet header.sheet-header h1 input {
    font-family: GismondaFG;
    font-size: 0.8rem;
    color: rgb(41, 38, 38);
  }

  .sheet nav.sheet-tabs {
    font-family: "GismondaFG";
    font-size: 0.8rem;
    color: #151c1f;
  }

  /* For nav and title */

  .window-app input,
  .fvtt-les-heritiers .item-form,
  .sheet header.sheet-header .flex-group-center.flex-compteurs,
  .sheet header.sheet-header .flex-group-center.flex-fatigue,
  select,
  button,
  .item-checkbox,
  #sidebar,
  #players,
  #navigation #nav-toggle {
    font-size: 0.8rem;
  }

  .fvtt-les-heritiers .sheet-header input,
  .fvtt-les-heritiers .sheet-header select {
    color: rgb(41, 38, 38);
  }

  .window-header {
    background: rgba(0, 0, 0, 0.75);
  }

  /* Better backgrounds for sheet windows */
  .window-app.sheet.item .window-header,
  .window-app.sheet.actor .window-header {
    background-image: url("../assets/ui/fiche_background_simple_01.webp") !important;
    background-repeat: repeat !important;
    background-color: rgba(0, 0, 0, 0.3) !important;
    background-blend-mode: multiply;
  }

  .page-heading {
    color: #151c1f;
  }

  .window-app.sheet .window-content {
    margin: 0;
    padding: 0;
    background-image: url("../assets/ui/fiche_background_simple_01.webp") !important;
    background-repeat: repeat !important;
  }

  /* Ensure item sheets window-content also has the background */
  .window-app.sheet.item .window-content,
  .window-app.sheet.item form {
    background-image: url("../assets/ui/fiche_background_simple_01.webp") !important;
    background-repeat: repeat !important;
  }

  /* Ensure actor sheets window-content and form also have the background */
  .window-app.sheet.actor .window-content,
  .window-app.sheet.actor form {
    background-image: url("../assets/ui/fiche_background_simple_01.webp") !important;
    background-repeat: repeat !important;
  }

  .strong-text {
    font-weight: bold;
  }

  .tabs .item.active,
  .blessures-list li ul li:first-child:hover,
  a:hover {
    text-shadow: 1px 0px 0px #ff6600;
  }

  .rollable:hover,
  .rollable:focus {
    color: #000;
    text-shadow: 0 0 10px red;
    cursor: pointer;
  }

  input:disabled {
    color: #1c2058;
  }

  select:disabled {
    color: #1c2058;
  }

  table {
    border: 1px solid #7a7971;
  }

  .grid,
  .grid-2col {
    display: grid;
    grid-column: span 2 / span 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 10px 0;
    padding: 0;
  }

  .grid-3col {
    grid-column: span 3 / span 3;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid-4col {
    grid-column: span 4 / span 4;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .grid-5col {
    grid-column: span 5 / span 5;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .grid-6col {
    grid-column: span 5 / span 5;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .grid-7col {
    grid-column: span 7 / span 7;
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .grid-8col {
    grid-column: span 8 / span 8;
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .grid-9col {
    grid-column: span 9 / span 9;
    grid-template-columns: repeat(9, minmax(0, 1fr));
  }

  .grid-10col {
    grid-column: span 10 / span 10;
    grid-template-columns: repeat(10, minmax(0, 1fr));
  }

  .grid-11col {
    grid-column: span 11 / span 11;
    grid-template-columns: repeat(11, minmax(0, 1fr));
  }

  .grid-12col {
    grid-column: span 12 / span 12;
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .flex-group-center,
  .flex-group-left,
  .flex-group-right {
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    text-align: center;
    padding: 5px;
  }

  .flex-group-left {
    -webkit-box-pack: start;
    -ms-flex-pack: start;
    justify-content: flex-start;
    text-align: left;
  }

  .flex-group-right {
    -webkit-box-pack: end;
    -ms-flex-pack: end;
    justify-content: flex-end;
    text-align: right;
  }

  .flex-center {
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    text-align: center;
  }

  .table-create-actor {
    font-size: 0.8rem;
  }

  .flex-between {
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
  }

  .flex-shrink {
    flex: 'flex-shrink';
  }

  /* Styles limited to foundryvtt-vadentis sheets */

  .fvtt-les-heritiers .sheet-header {
    -webkit-box-flex: 0;
    -ms-flex: 0 0 210px;
    flex: 0 0 210px;
    overflow: hidden;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -ms-flex-direction: row;
    flex-direction: row;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-pack: start;
    -ms-flex-pack: start;
    justify-content: flex-start;
    margin: 0;
    padding: 0;
    background-image: url("../assets/ui/fiche_background_simple_01.webp");
  }

  .background-sheet-header {
    background-image: url("../assets/ui/fiche_background_simple_01.webp");
    background-blend-mode: soft-light;
    color: rgb(41, 38, 38);
  }

  .fvtt-les-heritiers .sheet-header .profile-img {
    -webkit-box-flex: 0;
    -ms-flex: 0 0 128px;
    flex: 0 0 128px;
    height: 128px;
    width: 128px;
    margin-right: 10px;
    object-fit: cover;
    object-position: 50% 0;
  }

  .button-img {
    vertical-align: baseline;
    width: 8%;
    height: 8%;
    max-height: 48px;
    border-width: 0;
    border: 1px solid rgba(0, 0, 0, 0);
  }

  .button-img:hover {
    color: rgba(255, 255, 128, 0.7);
    border: 1px solid rgba(255, 128, 0, 0.8);
    cursor: pointer;
  }

  .button-effect-img {
    vertical-align: baseline;
    width: 16px;
    max-height: 16px;
    height: 16;
    border-width: 0;
  }

  .small-button-container {
    height: 16px;
    width: 16px;
    border: 0;
    vertical-align: bottom;
  }

  .fvtt-les-heritiers .sheet-header .header-fields {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
  }

  .fvtt-les-heritiers .sheet-header h1.charname {
    height: 50px;
    padding: 0px;
    margin: 5px 0;
    border-bottom: 0;
    font-weight: bold;
    font-size: 2rem;
    font-family: GismondaFG;
    color: rgb(41, 38, 38);
  }

  .fvtt-les-heritiers .sheet-header h1.charname input {
    width: 100%;
    height: 100%;
    margin: 0;
    font-weight: bold;
    font-family: GismondaFG;
    font-size: 2rem;
    color: rgb(41, 38, 38);
  }

  .fvtt-les-heritiers .sheet-tabs {
    -webkit-box-flex: 0;
    -ms-flex: 0;
    flex: 0;
  }

  .fvtt-les-heritiers .sheet-body,
  .fvtt-les-heritiers .sheet-body .tab .editor {
    height: 100%;
    font-size: 0.9rem;
    font-family: Garamond;
    color: rgba(0, 0, 0, 0.98)
  }

  .fvtt-les-heritiers .sheet-body input,
  .fvtt-les-heritiers .sheet-body select {
    color: rgba(0, 0, 0, 0.9)
  }

  .application.sheet .editor,
  .window-app.sheet .editor {
    border: 2;
    height: 300px;
    margin-top: 8px;
    padding: 0 3px;
  }

  .application.sheet .medium-editor,
  .window-app.sheet .medium-editor {
    border: 2;
    height: 240px;
    padding: 0 3px;
  }

  .application.sheet .small-editor,
  .window-app.sheet .small-editor {
    border: 2;
    height: 120px;
    padding: 0 3px;
  }

  .fvtt-les-heritiers .tox .tox-editor-container {
    background: #fff;
  }

  .fvtt-les-heritiers .tox .tox-edit-area {
    padding: 0 8px;
  }

  .fvtt-les-heritiers .resource-label {
    font-weight: bold;
    text-transform: uppercase;
  }

  .fvtt-les-heritiers .tabs {
    height: 40px;
    border-top: 1px solid #AAA;
    border-bottom: 1px solid #AAA;
    color: #000000;
  }

  .fvtt-les-heritiers .tabs .item {
    /*line-height: 40px;*/
    font-weight: bold;
    font-family: GismondaFG;
  }

  .fvtt-les-heritiers .tabs .item.active {
    text-decoration: underline;
    text-shadow: none;
  }

  .fvtt-les-heritiers .items-list {
    list-style: none;
    margin: 1px 0;
    padding: 0;
    overflow-y: auto;
  }

  .fvtt-les-heritiers .items-list .item-header {
    font-weight: bold;
  }

  .fvtt-les-heritiers .items-list .item {
    height: 24px;
    line-height: 20px;
    padding: 0;
    border-bottom: 1px solid #BBB;
  }

  .fvtt-les-heritiers .items-list .item .item-image {
    -webkit-box-flex: 0;
    -ms-flex: 0 0 24px;
    flex: 0 0 24px;
    margin-right: 5px;
  }

  .fvtt-les-heritiers .items-list .item img {
    display: block;
  }

  .fvtt-les-heritiers .items-list .item-name {
    margin: 0;
  }

  .fvtt-les-heritiers .items-list .item-controls {
    -webkit-box-flex: 0;
    -ms-flex: 0 0 86px;
    flex: 0 0 86px;
    text-align: right;
  }


  /* ======================================== */
  /* Sheet  */
  .window-app.sheet .window-content .sheet-header {
    /*background: #011d33 url("../images/ui/fond1.webp") repeat left top;*/
    background: url("../assets/ui/fiche_background_simple_01.webp");
    background-repeat: repeat;
  }

  .window-app.sheet .window-content .sheet-header input[type="text"],
  .window-app.sheet .window-content .sheet-header select,
  .window-app.sheet .window-content .sheet-header input[type="number"],
  .window-app.sheet .window-content .sheet-header input[type="password"],
  .window-app.sheet .window-content .sheet-header input[type="date"],
  .window-app.sheet .window-content .sheet-header input[type="time"] {
    /*color: rgba(36, 37, 37, 0.75);*/
    /*background: rgba(255, 255, 255, 0.05);*/
    /*border: 2px saddlebrown;*/
    /*color: lightgray;*/
    border-width: 1px;
    margin-bottom: 0.25rem;
  }

  .window-app .window-content,
  .window-app.sheet .window-content .sheet-body {
    font-size: 0.8rem;
    background: url("../assets/ui/fiche_background_simple_01.webp");
    background-repeat: repeat-y;
    color: black;
  }

  /*section.sheet-body{
  padding: 0.25rem   0.5rem;}*/

  .sheet header.sheet-header .profile-img {
    object-fit: cover;
    object-position: 50% 0;
    margin: 0.5rem 0 0.5rem 0.5rem;
    padding: 0;
    border: 0px;
  }

  .sheet nav.sheet-tabs {
    font-size: 0.70rem;
    font-weight: bold;
    height: 2.5rem;
    flex: 0 0 3rem;
    margin: 0;
    padding: 0 0 0 0.25rem;
    text-align: center;
    text-transform: uppercase;
    line-height: 1.5rem;
    border-top: 0 none;
    border-bottom: 0 none;
    color: #cbdaa3;
    background-image: url("../assets/ui/bandeau_01.webp");
  }

  nav.sheet-tabs a,
  nav.sheet-tabs .item {
    position: relative;
    padding: 0 0.25rem;
    color: beige;
  }

  nav.sheet-tabs .item:after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    height: 2rem;
    width: 1px;
  }

  .fvtt-les-heritiers.sheet .tab[data-tab] {
    padding: 0;
    background-image: url("../assets/ui/fiche_background_simple_01.webp");
    background-repeat: repeat;
    color: #000;
  }

  /* Spécialités title should be black */
  .fvtt-les-heritiers.sheet h3.specialites-title {
    color: #000;
  }

  /* Add padding to description tab */
  .fvtt-les-heritiers.sheet .tab[data-tab="description"] {
    padding: 0.5rem;
  }

  /* AppV2 Item Sheets - Flex Container Setup */
  .fvtt-les-heritiers.item section {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    padding: 0;
    margin: 0;
  }

  /* AppV2 Item Sheets - Header and Nav */
  .fvtt-les-heritiers.item header.sheet-header {
    flex: 0 0 auto;
  }

  .fvtt-les-heritiers.item nav.sheet-tabs,
  .fvtt-les-heritiers.item nav.tabs {
    flex: 0 0 auto;
  }

  /* AppV2 Item Sheets - Tabs with scrolling */
  .fvtt-les-heritiers.item .tab[data-tab] {
    display: none;
    padding: 0.5rem;
    overflow-y: auto;
    flex: 1 1 auto;
  }

  .fvtt-les-heritiers.item .tab[data-tab].active {
    display: block;
  }

  /* AppV2 Actor Sheets - Flex Container Setup */
  .fvtt-les-heritiers.actor section {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    padding: 0;
    margin: 0;
  }

  /* AppV2 Actor Sheets - Header and Nav */
  .fvtt-les-heritiers.actor header.sheet-header {
    flex: 0 0 auto;
  }

  .fvtt-les-heritiers.actor nav.sheet-tabs,
  .fvtt-les-heritiers.actor nav.tabs {
    flex: 0 0 auto;
  }

  /* AppV2 Actor Sheets - Tabs with scrolling */
  .fvtt-les-heritiers.actor .tab[data-tab] {
    display: none;
    padding: 0.25rem 0.5rem;
    overflow-y: auto;
    flex: 1 1 auto;
  }

  .fvtt-les-heritiers.actor .tab[data-tab].active {
    display: block;
  }

  /* Redesigned skill category headers */
  .fvtt-les-heritiers.actor .sheet-box {
    margin-bottom: 0.25rem;
  }

  .fvtt-les-heritiers.actor .items-title-text {
    font-size: 0.95rem;
    font-weight: bold;
    font-family: GismondaFG;
    color: #2c1810;
    padding: 1px 4px;
    background: linear-gradient(to right, rgba(139, 90, 43, 0.3), transparent);
    border-left: 3px solid #8b5a2b;
    display: inline-block;
    margin: 0;
    line-height: 1.1;
  }

  .fvtt-les-heritiers.actor .items-title-text:parent(h3) {
    margin: 0;
    line-height: 1.2;
  }

  .fvtt-les-heritiers.actor .sheet-box h3 {
    margin: 0;
    padding: 0;
    line-height: 1.2;
  }

  /* Compact the category header row */
  .fvtt-les-heritiers.actor .sheet-box .item-list > li:first-child {
    padding: 0;
    margin-bottom: 2px;
    border-bottom: 1px solid rgba(139, 90, 43, 0.3);
    min-height: auto;
  }

  /* Style "Niveau" label in category headers */
  .fvtt-les-heritiers.actor .sheet-box .short-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #2c1810;
    text-transform: uppercase;
    line-height: 1.2;
    margin-left: 0.5rem;
  }

  /* Magie section headers - make them prominent */
  .fvtt-les-heritiers.actor .magie-section-header {
    background: linear-gradient(to right, rgba(139, 105, 20, 0.15), rgba(139, 105, 20, 0.05));
    border-left: 4px solid #8b6914;
    padding: 0.4rem 0.5rem;
    margin-bottom: 0.3rem;
    margin-top: 0.5rem;
    border-radius: 3px;
  }

  .fvtt-les-heritiers.actor .magie-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    margin: 0;
    padding: 0;
    white-space: nowrap;
    overflow: visible;
    
    .items-title-text {
      font-size: 1.2rem;
      padding: 3px 8px;
      background: none;
      border-left: none;
      white-space: nowrap;
      
      a {
        color: #8b6914;
        font-weight: bold;
        white-space: nowrap;
      }
    }
  }

  .fvtt-les-heritiers.actor .magie-rang-name {
    font-size: 0.85rem;
    color: #6d5410;
    font-style: italic;
    margin-left: 0.3rem;
    white-space: nowrap;
  }


  /* Force dark text color for labels and inputs in item sheets */
  .application.sheet.item .tab label,
  .application.sheet.item .tab input,
  .application.sheet.item .tab select,
  .application.sheet.item .tab textarea,
  .window-app.sheet.item .tab label,
  .window-app.sheet.item .tab input,
  .window-app.sheet.item .tab select,
  .window-app.sheet.item .tab textarea {
    color: #000 !important;
  }

  /* Force dark text color for labels and inputs in actor sheets */
  .application.sheet.actor label,
  .application.sheet.actor input,
  .application.sheet.actor select,
  .application.sheet.actor textarea,
  .window-app.sheet.actor label,
  .window-app.sheet.actor input,
  .window-app.sheet.actor select,
  .window-app.sheet.actor textarea {
    color: #000 !important;
  }

  /* Add light background to inputs and selects in item sheets */
  .application.sheet.item .tab input:not([type="checkbox"]):not([type="radio"]),
  .application.sheet.item .tab select,
  .application.sheet.item .tab textarea,
  .window-app.sheet.item .tab input:not([type="checkbox"]):not([type="radio"]),
  .window-app.sheet.item .tab select,
  .window-app.sheet.item .tab textarea,
  .application.sheet.item .sheet-header input:not([type="checkbox"]):not([type="radio"]),
  .application.sheet.item .sheet-header select,
  .window-app.sheet.item .sheet-header input:not([type="checkbox"]):not([type="radio"]),
  .window-app.sheet.item .sheet-header select {
    background: rgba(252, 248, 240, 0.95) !important;
    border: 1px solid #999 !important;
    color: #000 !important;
  }

  /* Add light background to inputs and selects in actor sheets */
  .application.sheet.actor input:not([type="checkbox"]):not([type="radio"]),
  .application.sheet.actor select,
  .application.sheet.actor textarea,
  .window-app.sheet.actor input:not([type="checkbox"]):not([type="radio"]),
  .window-app.sheet.actor select,
  .window-app.sheet.actor textarea {
    background: rgba(252, 248, 240, 0.95) !important;
    border: 1px solid #999 !important;
    color: #000 !important;
  }

  /* Center number inputs in all sheets */
  .application.sheet input[type="number"],
  .application.sheet input[data-dtype="Number"],
  .window-app.sheet input[type="number"],
  .window-app.sheet input[data-dtype="Number"] {
    text-align: center;
  }

  /* Ensure checkboxes don't get background */
  .application.sheet.item input[type="checkbox"],
  .application.sheet.item input[type="radio"],
  .window-app.sheet.item input[type="checkbox"],
  .window-app.sheet.item input[type="radio"],
  .application.sheet.actor input[type="checkbox"],
  .application.sheet.actor input[type="radio"],
  .window-app.sheet.actor input[type="checkbox"],
  .window-app.sheet.actor input[type="radio"] {
    background: transparent !important;
    width: auto !important;
  }

  /* Ensure all tabs in item and actor sheets have backgrounds */
  .fvtt-les-heritiers .sheet-body .tab {
    background-image: url("../assets/ui/fiche_background_simple_01.webp") !important;
    background-repeat: repeat !important;
    color: #000 !important;
  }

  section.sheet-body:after {
    content: "";
    display: block;
    clear: both;
  }

  .sheet header.sheet-header .flex-compteurs {
    text-align: right;
  }

  .sheet header.sheet-header .resource-content {
    width: 2rem;
  }

  .select-diff {
    display: inline-block;
    text-align: left;
    width: 50px;
  }

  .window-app.sheet .window-content .tooltip:hover .tooltiptext {
    top: 2rem;
    left: 2rem;
    margin: 0;
    padding: 0.25rem;
  }

  .window-app.sheet .window-content .carac-value,
  .window-app.sheet .window-content .competence-xp {
    margin: 0.05rem;
    flex-basis: 3rem;
    text-align: center;
  }

  /* ======================================== */
  /* Global UI elements  */

  /* ======================================== */

  h1,
  h2,
  h3,
  h4 {
    font-weight: bold;
  }

  ul,
  ol {
    margin: 0;
    padding: 0;
  }

  ul,
  li {
    list-style-type: none;
  }

  .sheet li {
    margin: 0.010rem;
    padding: 0.25rem;
  }

  .header-fields li {
    margin: 0;
    padding: 0;
  }

  .alterne-list>.list-item:hover {
    background: rgba(100, 100, 50, 0.25);
  }

  .alterne-list>.list-item:nth-child(even) {
    background: rgba(80, 60, 0, 0.10);
  }

  .alterne-list>.list-item:nth-child(odd) {
    background: rgb(160, 130, 100, 0.05);
  }

  .specialisation-label {
    font-size: 0.8rem;
    font-style: italic;
  }

  .carac-label,
  .attr-label {
    font-weight: bold;
  }

  .list-item {
    margin: 0.125rem;
    box-shadow: inset 0px 0px 1px #00000096;
    border-radius: 0.25rem;
    padding: 0.125rem;
    flex: 1 1 5rem;
  }

  .item-display-show {
    display: block;
  }

  .item-display-hide {
    display: none;
  }

  .conteneur-type {
    background: rgb(200, 10, 100, 0.25);
  }

  .item-quantite {
    margin-left: 0.5rem;
  }

  .list-item-margin1 {
    margin-left: 1rem;
  }

  .list-item-margin2 {
    margin-left: 2rem;
  }

  .list-item-margin3 {
    margin-left: 3rem;
  }

  .list-item-margin4 {
    margin-left: 4rem;
  }

  .sheet-competence-img {
    width: 24px;
    height: 24px;
    flex-grow: 0;
    margin-right: 0.25rem;
  }

  .competence-column {
    flex-direction: column;
    align-content: flex-start;
    justify-content: flex-start;
    flex-grow: 0;
    flex-basis: 1;
  }

  .competence-header {
    align-content: flex-start;
    justify-content: flex-start;
    font-weight: bold;
    flex-grow: 0;
  }

  .secondaire-label,
  .arme-label,
  .generic-label,
  .competence-label,
  .devotion-label,
  .sort-label,
  .technique-label,
  .stat-label,
  .arme-label,
  .armure-label,
  .equipement-label,
  .description-label {
    flex-grow: 2;
    margin-left: 4px;
  }

  .roll-dialog-label {
    margin: 4px 0;
    padding-top: 7px;
  }

  /* Roll Dialog Window Styling */
  .application.heritiers-roll-dialog .window-content {
    padding: 0;
  }
  
  .window-app.heritiers-roll-dialog .window-content {
    margin: 0;
    padding: 0;
  }

  /* Roll Dialog Main Styling */
  .heritiers-roll-dialog {
    background: #e8e4d8 url("../assets/ui/fiche_background_simple_01.webp") repeat !important;
    font-family: GismondaFG;
    
    * {
      color: #2a2a2a;
    }

    /* Header */
    .dialog-header {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 6px;
      background: rgba(139, 105, 20, 0.15);
      border-bottom: 2px solid #8b6914;
      margin-bottom: 0;

      .actor-icon {
        width: 40px;
        height: 40px;
        border-radius: 4px;
        border: 2px solid #8b6914;
        object-fit: cover;
      }

      .dialog-title {
        flex: 1;

        h3 {
          margin: 0;
          font-size: 1rem;
          color: #8b6914;
          text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
        }

        .competence-name {
          font-size: 0.8rem;
          color: #6d5410;
          margin-top: 2px;
          font-style: italic;
        }
      }
    }

    /* Content */
    .dialog-content {
      padding: 6px;
      max-height: 650px;
      overflow-y: auto;
    }

    /* Form Groups */
    .form-group {
      margin-bottom: 6px;

      label {
        display: block;
        font-weight: bold;
        color: #8b6914;
        text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.5);
        margin-bottom: 2px;
        font-size: 0.85rem;
      }

      input:not([type="checkbox"]),
      select {
        width: 100%;
        padding: 4px 6px;
        background: rgba(255, 255, 255, 0.8);
        border: 1px solid rgba(100, 100, 100, 0.5);
        border-radius: 3px;
        color: #2a2a2a;
        font-size: 0.9rem;
        font-family: GismondaFG;
      }

      input:not([type="checkbox"]):focus,
      select:focus {
        outline: none;
        border-color: #8b6914;
        box-shadow: 0 0 5px rgba(139, 105, 20, 0.6);
        background: #ffffff;
      }

      input:not([type="checkbox"]):disabled {
        opacity: 0.7;
        cursor: not-allowed;
        background: rgba(200, 200, 200, 0.8);
        color: #555;
      }

      input[type="checkbox"] {
        width: auto;
        height: auto;
        cursor: pointer;
        accent-color: #8b6914;
        margin: 0;
        padding: 0;
      }
    }

    /* Info messages */
    .info-message {
      padding: 5px 8px;
      background: rgba(139, 105, 20, 0.1);
      border-left: 3px solid #8b6914;
      border-radius: 3px;
      font-size: 0.8rem;
      color: #2a2a2a;
      margin-bottom: 6px;
      font-style: italic;
    }

    /* Special sections */
    .weapon-section,
    .combat-modifiers {
      background: rgba(139, 105, 20, 0.1);
      padding: 6px;
      border-radius: 4px;
      border: 1px solid #8b6914;
      margin-bottom: 8px;
    }

    /* Dialog buttons */
    .dialog-buttons {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      padding: 8px;
      border-top: 2px solid #8b6914;
      background: rgba(139, 105, 20, 0.1);

      button {
        flex: 1 1 auto;
        min-width: 100px;
        padding: 6px 10px;
        border: none;
        border-radius: 4px;
        font-weight: bold;
        cursor: pointer;
        transition: all 0.2s ease;
        font-size: 0.8rem;
        font-family: GismondaFG;
        background: linear-gradient(135deg, #8b6914 0%, #6d5410 100%);
        color: #f5f5f5;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
        white-space: normal;
        line-height: 1.2;

        &:hover {
          background: linear-gradient(135deg, #a07a18 0%, #8b6914 100%);
          transform: translateY(-2px);
          box-shadow: 0 4px 8px rgba(139, 105, 20, 0.5);
        }

        &.full-width-button,
        &[data-action="rollTricherie"],
        &[data-action="rollHeritage"] {
          flex: 1 1 100%;
          width: 100%;
        }

        &[data-action="cancel"] {
          background: rgba(100, 100, 100, 0.3);
          color: #f5f5f5;

          &:hover {
            background: rgba(100, 100, 100, 0.5);
          }
        }

        i {
          margin-right: 4px;
        }
      }
    }
  }

  .skill-roll-dialog,
  form.skill-roll-dialog {
    background: transparent;
    
    .roll-dialog-header {
      display: flex;
      align-items: center;
      gap: 1rem;
      padding: 0.75rem;
      background: rgba(56, 32, 32, 0.4);
      border-bottom: 2px solid #8b6914;
      margin-bottom: 0.5rem;

      .actor-icon {
        width: 48px;
        height: 48px;
        border-radius: 4px;
        border: 2px solid #8b6914;
      }

      .dialog-roll-title {
        margin: 0;
        color: #d4a574;
        font-size: 1.3rem;
        flex: 1;
      }
    }

    .roll-dialog-content {
      padding: 0.5rem;
      display: flex;
      flex-direction: column;
      gap: 0.4rem;
    }

    .roll-dialog-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0.3rem 0.5rem;
      background: rgba(56, 32, 32, 0.2);
      border-radius: 4px;
      gap: 1rem;
      min-height: 2rem;
    }

    .roll-dialog-section {
      background: rgba(56, 32, 32, 0.3);
      border-radius: 4px;
      padding: 0.5rem;
      margin: 0.2rem 0;
      display: flex;
      flex-direction: column;
      gap: 0.3rem;
      border-left: 3px solid #8b6914;
    }

    .roll-dialog-label-left {
      color: #d4a574;
      font-weight: bold;
      flex: 1;
      min-width: 120px;
    }

    .roll-dialog-value {
      color: #fff;
      text-align: right;
      font-weight: normal;
    }

    .roll-dialog-info {
      color: #bbb;
      font-style: italic;
      font-size: 0.9rem;
    }

    .roll-dialog-select {
      background: rgba(0, 0, 0, 0.3);
      border: 1px solid #666;
      border-radius: 3px;
      color: #fff;
      padding: 0.2rem 0.4rem;
      min-width: 150px;
    }

    input[type="checkbox"] {
      width: 1.2rem;
      height: 1.2rem;
      cursor: pointer;
    }
  }

  .roll-style {
    background-color: rgba(56, 32, 32, 0.4);
    border-radius: 0.25rem;
    padding: 0.25rem 0.25rem 0.25rem 0.5rem;
    margin-right: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
  }

  .roll-style a {
    line-height: 1;
    display: flex;
    align-items: center;
  }

  /* Enhanced button styling for clickable elements */
  .fvtt-les-heritiers.actor .roll-style a,
  .fvtt-les-heritiers.actor .roll-competence,
  .fvtt-les-heritiers.actor .roll-carac,
  .fvtt-les-heritiers.actor .roll-root-competence,
  .fvtt-les-heritiers.actor .roll-pouvoir,
  .fvtt-les-heritiers.actor .roll-sort,
  .fvtt-les-heritiers.actor a[data-action^="roll"],
  .fvtt-les-heritiers.actor .chat-card-button {
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
  }

  /* Hover effects for clickable buttons */
  .fvtt-les-heritiers.actor .roll-style:hover {
    background-color: rgba(139, 90, 43, 0.5);
    box-shadow: 0 0 5px rgba(139, 90, 43, 0.4);
    transform: translateY(-1px);
  }

  .fvtt-les-heritiers.actor .roll-style:hover a {
    color: #fff;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
  }

  .fvtt-les-heritiers.actor .roll-style:active {
    transform: translateY(0);
    box-shadow: 0 0 2px rgba(139, 90, 43, 0.3);
  }

  /* Style for chat-card-button */
  .fvtt-les-heritiers.actor .chat-card-button {
    background: linear-gradient(to bottom, rgba(139, 90, 43, 0.6), rgba(139, 90, 43, 0.4));
    border: 1px solid rgba(139, 90, 43, 0.8);
    border-radius: 4px;
    padding: 4px 12px;
    color: #2c1810;
    font-weight: 600;
    text-align: center;
    display: inline-block;
  }

  .fvtt-les-heritiers.actor .chat-card-button:hover {
    background: linear-gradient(to bottom, rgba(139, 90, 43, 0.8), rgba(139, 90, 43, 0.6));
    border-color: rgba(139, 90, 43, 1);
    color: #000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
  }

  .fvtt-les-heritiers.actor .chat-card-button:active {
    transform: translateY(0);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
  }

  .specialisarion-margin {
    margin-left: 1.5rem;
  }

  .short-label {
    flex-grow: 1;
  }

  .keyword-label {
    font-size: 0.85rem;
  }

  .item-sheet-label {
    flex-grow: 1;
  }

  .item-text-long-line {
    flex-grow: 3;
  }

  .score-label {
    flex-grow: 2;
    align-content: center;
  }

  .attribut-value,
  .carac-value {
    flex-grow: 0;
    flex-basis: 64px;
    margin-right: 4px;
    margin-left: 4px;
  }

  .sante-value,
  .competence-value {
    flex-grow: 0;
    flex-basis: 2rem;
    margin-right: 0.25rem;
    margin-left: 0.25rem;
  }

  .description-value {
    flex-grow: 0;
    flex-basis: 4rem;
    margin-right: 0.25rem;
    margin-left: 0.25rem;
  }

  .competence-xp {
    flex-grow: 0;
    flex-basis: 2rem;
    margin-right: 0.25rem;
    margin-left: 0.25rem;
  }

  .blessures-title {
    font-weight: bold;
  }

  .alchimie-title {
    font-weight: bold;
  }

  .blessure-data {
    flex-direction: row;
    align-content: flex-start;
    justify-content: flex-start;
  }

  .blessures-soins {
    flex-grow: 0;
    flex-basis: 32px;
    margin-right: 4px;
    margin-left: 4px;
  }

  .blessures-loc {
    flex-grow: 0;
    flex-basis: 96px;
    margin-right: 4px;
    margin-left: 4px;
  }

  .pointsreve-value {
    flex-grow: 0;
    flex-basis: 64px;
    margin-right: 4px;
    margin-left: 4px;
  }

  .input-sante-header,
  .stress-style {
    flex-grow: 0;
    flex-basis: 64px;
    margin-right: 4px;
    margin-left: 4px;
  }

  .small-label {
    margin-top: 5px;
  }

  .padd-right {
    margin-right: 8px;
  }

  .padd-left {
    margin-left: 8px;
  }

  .stack-left {
    align-items: center;
    flex-shrink: 1;
    flex-grow: 0;
  }

  .npc-stat-label {
    flex-grow: 2;
  }

  .packed-left {
    white-space: nowrap;
    flex-grow: 0;
  }

  .numeric-input {
    text-align: right;
    direction: rtl;
    padding: 5px;
  }

  .input-numeric-short {
    width: 40px;
    max-width: 40px;
    flex-grow: 0;
    flex-shrink: 0;
    flex-basis: 40px;
    margin-right: 0.25rem;
    margin-left: 0.25rem;
  }

  .stats-table {
    align-content: flex-start;
  }

  /* ======================================== */
  .tokenhudext {
    display: flex;
    flex: 0 !important;
    font-weight: 600;
  }

  .tokenhudext.left {
    justify-content: flex-start;
    flex-direction: column;
    position: absolute;
    top: 2.75rem;
    right: 4rem;
  }

  .tokenhudext.right {
    justify-content: flex-start;
    flex-direction: column;
    position: absolute;
    top: 2.75rem;
    left: 4rem;
  }

  .control-icon.tokenhudicon {
    width: fit-content;
    height: fit-content;
    min-width: 6rem;
    min-height: 1.2rem;
    flex-basis: auto;
    padding: 0;
    line-height: 1rem;
    margin: 0.25rem;
  }

  .control-icon.tokenhudicon.right {
    margin-left: 8px;
  }

  #token-hud .status-effects.active {
    z-index: 2;
  }

  /* ======================================== */
  .item-checkbox {
    height: 25px;
    border: 1px solid #736953a6;
    border-left: none;
    font-weight: 500;
    font-size: 1rem;
    color: black;
    padding-top: 5px;
    margin-right: 0px;
    width: 45px;
    position: relative;
    left: 0px;
    text-align: center;
  }


  .flex-actions-bar {
    flex-grow: 2;
  }

  /* ======================================== */
  /* Sidebar CSS */
  #sidebar {
    background-position: 100%;
    color: rgba(220, 220, 220, 0.75);
  }

  /*  background: rgb(105,85,65) url("../images/ui/texture_feuille_perso_onglets.webp") no-repeat right bottom;*/

  #sidebar.collapsed {
    height: 470px !important;
  }

  #sidebar-tabs>.collapsed,
  #chat-controls .chat-control-icon {
    color: rgba(220, 220, 220, 0.75);
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.75);
  }

  .sidebar-tab .directory-list .entity {
    border-top: 1px dashed rgba(0, 0, 0, 0.25);
    border-bottom: 0 none;
    padding: 0.25rem 0;
  }

  .sidebar-tab .directory-list .entity:hover {
    background: rgba(0, 0, 0, 0.05);
    cursor: pointer;
  }

  .chat-message-header {
    background: linear-gradient(135deg, rgba(139, 105, 20, 0.3) 0%, rgba(139, 105, 20, 0.15) 100%);
    border-bottom: 2px solid #8b6914;
    font-size: 1.1rem;
    height: 48px;
    text-align: center;
    vertical-align: middle;
    display: flex;
    align-items: center;
  }

  .chat-message .message-header .flavor-text,
  .chat-message .message-header .whisper-to {
    font-size: 0.9rem;
    color: #6d5410;
    font-style: italic;
  }

  .chat-actor-name {
    padding: 4px;
    color: #8b6914;
    font-weight: bold;
  }

  .chat-img {
    width: 64px;
    height: 64px;
  }

  .roll-dialog-header {
    height: 52px;
  }

  .adversite-text {
    font-weight: bold;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  .icon-adversite-container {
    position: relative;
    text-align: center;
    color: white;
    width: 64px;
    min-height: 48px;
  }

  .icon-adversite {
    width: 48px;
    border: 0px;
  }

  .hud-adversite-container {
    position: relative;
    text-align: center;
    color: white;
    width: 64px;
    min-height: 64px;
  }

  .hud-adversite-text {
    font-weight: bold;
    font-size: 0.9rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -85%);
  }

  .actor-icon {
    float: left;
    width: 48px;
    height: 48px;
    padding: 2px 6px 2px 2px;
  }

  .padding-dice {
    padding-top: .2rem;
    padding-bottom: .2rem;
  }

  .dice-image {
    box-sizing: border-box;
    border: none;
    border-radius: 0;
    max-width: 100%;
  }

  .dice-image-reroll {
    background-color: rgba(115, 224, 115, 0.25);
    border-color: #011d33;
    box-sizing: border-box;
    border: 1px;
    border-radius: 0%;
    max-width: 100%;
  }

  .chat-dice {
    width: 15%;
    height: 15%;
    font-size: 15px;
    padding: 10px;
    padding-bottom: 20px;
    padding-top: .2rem;
    padding-bottom: .2rem;
  }

  .div-river-full {
    height: 5rem;
    align-items: flex-start;
  }

  .div-river {
    align-content: center;
    margin-left: 8px;
    align-content: space-around;
    justify-content: space-around;
  }

  .div-center {
    align-self: center;
  }

  .chat-message {
    font-family: GismondaFG;
    background: #e8e4d8 url("../assets/ui/fiche_background_simple_01.webp") repeat;
    border: 2px solid #8b6914;
    border-radius: 6px;
    font-size: 0.9rem;
  }

  .chat-message.whisper {
    background: #e8e4d8 url("../assets/ui/fiche_background_simple_01.webp") repeat;
    border: 2px solid #545469;
    box-shadow: 0 0 8px rgba(84, 84, 105, 0.5);
  }

  .chat-message .chat-icon {
    border: 2px solid #8b6914;
    border-radius: 4px;
    padding: 2px;
    float: left;
    width: 40px;
    height: 40px;
    object-fit: cover;
  }

  #sidebar-tabs {
    flex: 0 0 32px;
    box-sizing: border-box;
    margin: 0 0 5px;
    border-bottom: 1px solid rgba(0, 0, 0, 0);
    box-shadow: inset 0 0 2rem rgba(0, 0, 0, 0.5);
  }

  #sidebar-tabs>.item.active {
    border: 1px solid rgba(114, 98, 72, 1);
    background: rgba(30, 25, 20, 0.75);
    box-shadow: 0 0 6px inset rgba(114, 98, 72, 1);
  }

  #sidebar #sidebar-tabs i {
    display: inline-block;
    background-position: center;
    background-size: cover;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.75);

  }

  /*--------------------------------------------------------------------------*/
  /* Control, Tool, hotbar & navigation */

  #controls .scene-control,
  #controls .control-tool {
    box-shadow: 0 0 3px #000;
    margin: 0 0 8px;
    border-radius: 0;
    background: rgba(30, 25, 20, 1);
    background-origin: padding-box;
    border: 4px solid rgba(72, 46, 28, 0.5);
  }

  #hotbar #action-bar #macro-list {
    border: 1px solid rgba(72, 46, 28, 1);
    box-shadow: 2px 2px 5px #000000;
  }

  #hotbar #action-bar .macro {
    border-image: url(img/ui/bg_control.jpg) 21 repeat;
    border-image-slice: 6 6 6 6 fill;
    border-image-width: 6px 6px 6px 6px;
    border-image-outset: 0px 0px 0px 0px;
    border-radius: 0px;
  }

  #hotbar .bar-controls {
    background: rgba(30, 25, 20, 1);
    border: 1px solid rgba(72, 46, 28, 1);
  }

  #players {
    border: 4px solid rgba(72, 46, 28, 0.5);
    background: rgba(30, 25, 20, 1);
  }

  #navigation #scene-list .scene.nav-item.active {
    background: rgba(72, 46, 28, 1);
  }

  #navigation #scene-list .scene.nav-item {
    background: rgba(30, 25, 20, 1);
    background-origin: padding-box;
    border: 4px solid rgba(72, 46, 28, 0.5);
  }

  #navigation #scene-list .scene.view,
  #navigation #scene-list .scene.context {
    background: rgba(72, 46, 28, 1);
    background-origin: padding-box;
    border: 4px solid rgba(72, 46, 28, 1);
    box-shadow: 0 0 3px #ff6400;
  }

  #navigation #nav-toggle {
    background: rgba(30, 25, 20, 1);
    background-origin: padding-box;
    border: 4px solid rgba(72, 46, 28, 0.5);
  }

  /* Tooltip container */
  .tooltip {
    position: relative;
    display: inline-block;
    /*border-bottom: 1px dotted black; /* If you want dots under the hoverable text */
  }

  /* Tooltip text */
  .tooltip .tooltiptext {
    text-align: left;
    background: rgba(231, 229, 226, 0.9);
    width: 150px;
    padding: 3px 0;
    font-size: 0.9rem;

    /* Position the tooltip text */
    top: 1px;
    position: absolute;
    z-index: 1;

    /* Fade in tooltip */
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s;
  }

  .tooltip .ttt-fatigue {
    width: 360px;

    background: rgba(30, 25, 20, 0.9);
    border-image: url(img/ui/bg_control.jpg) 21 repeat;
    border-image-slice: 6 6 6 6 fill;
    border-image-width: 6px 6px 6px 6px;
    border-image-outset: 0px 0px 0px 0px;
    border-radius: 0px;

    font-size: 0.8rem;
    padding: 3px 0;
  }

  .tooltip .ttt-ajustements {
    width: 150px;
    background: rgba(220, 220, 210, 0.95);
    border-radius: 6px;
    font-size: 0.9rem;
    padding: 3px 0;
  }

  .tooltip-nobottom {
    border-bottom: unset;
    /* If you want dots under the hoverable text */
  }

  .tooltip .ttt-xp {
    width: 250px;
    background: rgba(220, 220, 210, 0.95);
    border-radius: 6px;
    font-size: 0.9rem;
    padding: 3px 0;
  }

  /* Show the tooltip text when you mouse over the tooltip container */
  .tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
  }

  .chat-card-button {
    box-shadow: inset 0px 1px 0px 0px #a6827e;
    background-image: url("../assets/ui/bandeau_01.webp");
    /*background-color: #7d5d3b00;*/
    border-radius: 3px;
    border: 2px ridge #846109;
    display: inline-block;
    cursor: pointer;
    color: #ffffff;
    font-size: 0.8rem;
    padding: 4px 4px 0px 4px;
    text-decoration: none;
    text-shadow: 0px 1px 0px #4d3534;
    position: relative;
    /*margin:2px;*/
  }

  .chat-card-button:hover {
    background: linear-gradient(to bottom, #800000 5%, #3e0101 60%);
    /*background-color: rgba(56, 33, 33, 60);*/
  }

  .chat-card-button:active {
    position: relative;
    top: 1px;
  }

  h4.entry-name.document-name {
    color: #f3eeee;
  }

  .compendium h4.entry-name.document-name {
    color: black;
  }

  .fxmaster {
    background: #443e37E0;
    background-color: #443e37E0;
  }

  .button-sheet-roll {
    box-shadow: inset 0px 1px 0px 0px #a6827e;
    background: linear-gradient(to bottom, #41545a 5%, #2e5561 100%);
    background-color: #7d5d3b00;
    border-radius: 4px;
    border: 1px ridge #846109;
    display: inline-block;
    cursor: pointer;
    color: #ffffff;
    font-size: 0.8rem;
    padding: 1px 1px 0px 1px;
    text-decoration: none;
    text-shadow: 0px 1px 0px #4d3534;
    position: relative;
    max-height: 1.7rem;
    flex-grow: 1;
    max-width: 4.5rem;
    min-width: 4.5rem;
  }

  .sheet.journal-entry.application .journal-sidebar .toc .page-heading .page-title {
    color: beige;
  }

  .button-sheet-roll:hover {
    background: linear-gradient(to bottom, #800000 5%, #3e0101 100%);
    background-color: rgb(56, 33, 33);
  }

  .roll-tricherie-2 {
    margin: 2px 2px 2px 2px;
    box-shadow: inset 0px 1px 0px 0px #a6827e;
    background: linear-gradient(to bottom, #41545a 5%, #2e5561 100%);
    background-color: #7d5d3b00;
    border-radius: 4px;
    border: 1px ridge #846109;
    padding: 1px 1px 0px 1px;
    text-decoration: none;
    text-shadow: 0px 1px 0px #4d3534;
    color: beige;
  }

  .button-sheet-roll:active {
    position: relative;
    top: 1px;
  }

  .button-sheet-roll-long1 {
    max-width: 6.1rem;
    min-width: 6.1rem;
  }

  .defense-sheet {
    border-radius: 4px;
    text-align: center;
    display: inline-block;
    font-size: 0.8rem;
    padding: 1px 1px 0px 1px;
    text-decoration: none;
    position: relative;
    max-height: 1.7rem;
    margin-left: 4px;
    flex-grow: 1;
    max-width: 3.5rem;
    min-width: 3.5rem;
  }

  .plus-minus-button {
    box-shadow: inset 0px 1px 0px 0px #a6827e;
    background: linear-gradient(to bottom, #21374afc 5%, #152833ab 100%);
    background-color: #7d5d3b00;
    border-radius: 4px;
    border: 2px ridge #846109;
    display: inline-block;
    cursor: pointer;
    color: #ffffff;
    padding: 3px 6px 2px 6px;
    text-decoration: none;
    text-shadow: 0px 1px 0px #4d3534;
    position: relative;
    margin: 3px;
    max-width: 24px;
    max-height: 24px;
  }

  .river-button:hover,
  .plus-minus-button:hover,
  .chat-card-button:hover {
    background: linear-gradient(to bottom, #800000 5%, #3e0101 100%);
    background-color: red;
  }

  .plus-minus-button:active,
  .chat-card-button:active {
    position: relative;
    top: 1px;
  }

  .plus-minus {
    font-size: 0.9rem;
    font-weight: bold;
  }

  .ul-level1 {
    padding-left: 2rem;
  }

  .drop-equipment-effect,
  .drop-power-effect,
  .drop-perk-effect,
  .drop-ability-effect,
  .drop-effect-specaffected,
  .drop-effect-spec,
  .drop-ability-weapon,
  .drop-ability-armor,
  .drop-race-perk,
  .drop-spec-perk,
  .drop-ability-power,
  .drop-ability-spec,
  .drop-spec-power,
  .drop-abilities,
  .drop-optionnal-abilities,
  .drop-specialperk1,
  .drop-perk2,
  .drop-spec1,
  .drop-spec2 {
    background: linear-gradient(to bottom, #6c95b9fc 5%, #105177ab 100%);
    background-color: #7d5d3b00;
    border-radius: 3px;
    border: 2px ridge #846109;
  }

  .label-name {
    padding-top: 7px;
    padding-left: 4px;
    margin-left: 4px;
    min-width: 5rem;
    max-width: 5rem;
  }

  /*************************************************************/
  .competence-name {
    padding-top: 7px;
    padding-left: 4px;
    margin-left: 4px;
    flex-grow: 2;
  }

  /* Adjust characteristics in actor sheet header */
  .application.sheet.actor .sheet-header .competence-name,
  .window-app.sheet.actor .sheet-header .competence-name,
  .application.sheet.actor .sheet-header .item-name-label,
  .window-app.sheet.actor .sheet-header .item-name-label {
    font-size: 1rem;
    padding-top: 6px;
    margin-top: 0;
    margin-bottom: 0;
    line-height: 1.2;
    display: flex;
    align-items: center;
  }

  /* Center the link/text inside the characteristic label */
  .application.sheet.actor .sheet-header .competence-name a,
  .window-app.sheet.actor .sheet-header .competence-name a,
  .application.sheet.actor .sheet-header .item-name-label a,
  .window-app.sheet.actor .sheet-header .item-name-label a {
    display: block;
    width: 100%;
  }

  /* Reduce padding/margin for inputs in actor sheet header */
  .application.sheet.actor .sheet-header input,
  .application.sheet.actor .sheet-header select,
  .window-app.sheet.actor .sheet-header input,
  .window-app.sheet.actor .sheet-header select {
    padding: 1px 4px;
    margin: 1px 2px;
    line-height: 1.2;
  }

  .application.sheet.actor .sheet-header .padd-right,
  .window-app.sheet.actor .sheet-header .padd-right {
    margin-right: 4px;
  }

  /* Compact PV line in actor header - redesigned */
  .application.sheet.actor .sheet-header .item-field-label-short,
  .window-app.sheet.actor .sheet-header .item-field-label-short {
    max-width: 2.8rem;
    min-width: 2.8rem;
    padding: 2px 3px;
    margin: 0 1px;
  }

  /* Wider width for Tricherie label specifically */
  .application.sheet.actor .sheet-header label.item-field-label-short:has(+ input[name="system.rang.tricherie.value"]),
  .window-app.sheet.actor .sheet-header label.item-field-label-short:has(+ input[name="system.rang.tricherie.value"]) {
    max-width: 4.8rem;
    min-width: 4.8rem;
  }

  .application.sheet.actor .sheet-header .item-field-label-short-num,
  .window-app.sheet.actor .sheet-header .item-field-label-short-num {
    max-width: 2rem;
    min-width: 2rem;
    padding: 2px 3px;
    margin: 0 1px;
  }

  .application.sheet.actor .sheet-header .item-field-label-medium,
  .window-app.sheet.actor .sheet-header .item-field-label-medium {
    max-width: 6rem;
    min-width: 6rem;
    padding: 2px 3px;
    margin: 0 4px;
  }

  /* Remove spacing spans and use gap instead */
  .application.sheet.actor .sheet-header .flexrow > span,
  .window-app.sheet.actor .sheet-header .flexrow > span {
    display: none;
  }

  .application.sheet.actor .sheet-header .flexrow,
  .window-app.sheet.actor .sheet-header .flexrow {
    gap: 2px;
  }

  /* Add spacing between characteristics and PV line */
  .application.sheet.actor .sheet-header .flexrow:has(> label:first-child:contains("PV")),
  .window-app.sheet.actor .sheet-header .flexrow:has(> label:first-child) {
    margin-top: 6px;
  }

  /* More specific: target the PV line directly */
  .application.sheet.actor .sheet-header .flexcol > .flexrow:last-child,
  .window-app.sheet.actor .sheet-header .flexcol > .flexrow:last-child {
    margin-top: 6px;
  }

  /*************************************************************/
  .competence-niveau {
    flex-grow: 1;
    min-width: 64px;
    max-width: 64px;
  }

  /*************************************************************/
  .arme-defensif {
    padding-top: 7px;
    text-align: center;
    flex-grow: 2;
  }

  /*************************************************************/
  .magie-text-helper {
    font-size: 0.8rem;
    font-style: italic;
    margin-left: 12px;
    max-width: 95%;
    text-align: justify;
  }

  /*************************************************************/
  .item-name-img {
    flex-grow: 1;
    max-width: 2rem;
    min-width: 2rem;
    max-height: 2rem;
    margin-right: 4px;
  }

  /*************************************************************/
  #pause {
    font-size: 2rem;
  }

  #pause>h3 {
    color: #CCC
  }

  #pause>img {
    content: url(../assets/ui/pause_heritier.webp);
    height: 256px;
    width: 256px;
    top: -80px;
    left: calc(50% - 132px);
  }

  #logo {
    content: url(../assets/ui/logo_main_01.webp);
    width: 120px;
    height: 40px;
  }

  .dice-cell {
    padding-left: 12px;
    padding-right: 12px;
    width: 60px;
    text-align: center;
  }

  .dice-formula,
  .dice-total {
    height: 54px;
    position: relative;
  }

  .item-name-label-header {
    flex-grow: 2;
    max-width: 12rem;
    min-width: 12rem;
  }

  .item-name-label {
    flex-grow: 2;
    max-width: 10rem;
    min-width: 10rem;
  }

  .item-name-label-level2 {
    flex-grow: 2;
    max-width: 9rem;
    min-width: 9rem;
  }

  .item-field-label-short {
    padding-top: 2px;
    flex-grow: 1;
    max-width: 4rem;
    min-width: 4rem;
  }

  .item-field-label-short-num {
    padding-top: 2px;
    flex-grow: 1;
    max-width: 2rem;
    min-width: 2rem;
  }

  .item-field-label-medium {
    padding-top: 2px;
    flex-grow: 1;
    max-width: 6rem;
    min-width: 6rem;
  }

  .item-field-label-long {
    padding-top: 2px;
    flex-grow: 1;
    max-width: 8rem;
    min-width: 8rem;
  }

  .item-field-label-long2 {
    padding-top: 2px;
    flex-grow: 1;
    max-width: 14rem;
    min-width: 14rem;
  }

  .item-field-label-long2-img {
    max-width: 16rem;
    min-width: 16rem;
  }

  .item-field-label-long3 {
    padding-top: 2px;
    flex-grow: 1;
    max-width: 20rem;
    min-width: 20rem;
  }

  .item-control-end {
    align-self: flex-end;
  }

  .alternate-list {
    margin-top: 2px;
    flex-wrap: nowrap;
  }

  .item-filler {
    flex-grow: 6;
    flex-shrink: 7;
  }

  .item-controls-fixed {
    margin-left: 0.5rem;
    min-width: 3.2rem;
    max-width: 3.2rem;
  }

  .item-field {
    justify-content: flex-start;
    flex-grow: 1;
  }

  .chat-success {
    font-size: 1.2rem;
    font-weight: bold;
    color: darkgreen;
  }

  .chat-failure {
    font-size: 1.2rem;
    font-weight: bold;
    color: darkred;
  }

  /* ==================== New Chat Card Styling ==================== */
  .heritiers-chat-card {
    font-family: GismondaFG;
    background: #e8e4d8 url("../assets/ui/fiche_background_simple_01.webp") repeat;
    border: 2px solid #8b6914;
    border-radius: 6px;
    overflow: hidden;
    margin: 0;

    /* Header */
    .chat-card-header {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px;
      background: linear-gradient(135deg, rgba(139, 105, 20, 0.3) 0%, rgba(139, 105, 20, 0.15) 100%);
      border-bottom: 2px solid #8b6914;
    }

    .chat-actor-avatar {
      width: 40px;
      height: 40px;
      border-radius: 4px;
      border: 2px solid #8b6914;
      object-fit: cover;
    }

    .chat-actor-info {
      flex: 1;
    }

    .chat-actor-name {
      margin: 0;
      font-size: 0.9rem;
      color: #8b6914;
      font-weight: bold;
    }

    .chat-action-name {
      font-size: 0.75rem;
      color: #6d5410;
      font-style: italic;
    }

    .chat-action-icon {
      width: 36px;
      height: 36px;
      border-radius: 4px;
      border: 1px solid #8b6914;
      object-fit: cover;
    }

    /* Attack Type Badge */
    .chat-attack-badge {
      background: #8b6914;
      color: #fff;
      padding: 4px 12px;
      text-align: center;
      font-weight: bold;
      font-size: 0.75rem;
      text-transform: uppercase;
    }

    /* Roll Calculation Grid */
    .chat-roll-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
      gap: 6px;
      padding: 8px;
      background: rgba(255, 255, 255, 0.3);
    }

    .chat-roll-item {
      display: flex;
      flex-direction: column;
      gap: 2px;
      padding: 4px 6px;
      background: rgba(255, 255, 255, 0.6);
      border-left: 3px solid #8b6914;
      border-radius: 3px;
    }

    .chat-roll-label {
      font-size: 0.65rem;
      color: #6d5410;
      font-weight: bold;
      text-transform: uppercase;
    }

    .chat-roll-value {
      font-size: 0.85rem;
      color: #2a2a2a;
      font-weight: bold;
    }

    .chat-dice-result {
      color: #8b6914;
      font-size: 1rem;
    }

    .chat-tricherie-used {
      background: rgba(139, 105, 20, 0.2);
      border-left-color: #d4a574;
      border-left-width: 4px;
      
      .chat-roll-value {
        color: #8b6914;
        font-weight: bold;
        font-style: italic;
      }
    }

    /* Result Box */
    .chat-result-box {
      padding: 6px;
      margin: 4px;
      border-radius: 6px;
      text-align: center;
      
      &.success {
        background: linear-gradient(135deg, rgba(51, 170, 51, 0.2) 0%, rgba(51, 170, 51, 0.1) 100%);
        border: 2px solid #33aa33;
      }
      
      &.failure {
        background: linear-gradient(135deg, rgba(170, 51, 51, 0.2) 0%, rgba(170, 51, 51, 0.1) 100%);
        border: 2px solid #aa3333;
      }
      
      &.critical-failure {
        background: linear-gradient(135deg, rgba(139, 0, 0, 0.3) 0%, rgba(139, 0, 0, 0.15) 100%);
        border: 2px solid #8b0000;
      }
    }

    .chat-result-total {
      display: flex;
      justify-content: center;
      align-items: baseline;
      gap: 4px;
      margin-bottom: 3px;
    }

    .chat-result-label {
      font-size: 0.9rem;
      color: #6d5410;
      font-weight: bold;
      text-transform: uppercase;
    }

    .chat-result-number {
      font-size: 1.35rem;
      font-weight: bold;
      color: #8b6914;
    }

    .chat-result-details {
      display: flex;
      justify-content: center;
      gap: 16px;
      margin-bottom: 6px;
      font-size: 0.85rem;
      color: #6d5410;
    }

    .chat-result-status {
      font-size: 1.2rem;
      font-weight: bold;
      padding: 4px;
      
      i {
        margin-right: 4px;
      }
      
      .success & {
        color: #33aa33;
      }
      
      .failure & {
        color: #aa3333;
      }
      
      .critical-failure & {
        color: #8b0000;
      }
    }

    .chat-special-result {
      margin-top: 6px;
      font-size: 0.9rem;
      color: #d4a574;
      font-weight: bold;
      
      i {
        margin-right: 4px;
      }
    }

    .chat-damage-display {
      margin-top: 6px;
      padding: 4px 8px;
      background: rgba(139, 105, 20, 0.15);
      border-radius: 3px;
      font-size: 0.85rem;
      color: #8b6914;
      
      i {
        margin-right: 4px;
      }
      
      strong {
        font-size: 0.95rem;
      }
    }

    /* Tricherie Box */
    .chat-tricherie-box {
      background: rgba(139, 105, 20, 0.15);
      padding: 8px;
      border-top: 1px solid #8b6914;
    }

    .chat-tricherie-label {
      display: block;
      font-size: 0.75rem;
      color: #6d5410;
      font-weight: bold;
      margin-bottom: 6px;
    }

    .chat-tricherie-faces {
      display: flex;
      gap: 6px;
      justify-content: center;
    }

    .chat-tricherie-face {
      background: #8b6914;
      color: #fff;
      padding: 8px 12px;
      border-radius: 4px;
      font-weight: bold;
      font-size: 1.1rem;
      cursor: pointer;
      transition: all 0.2s ease;
      text-decoration: none;
      
      &:hover {
        background: #a07a18;
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
      }
    }

    /* Details Section (Collapsible) */
    .chat-details-section {
      border-top: 1px solid #8b6914;
    }

    .chat-details-summary {
      padding: 8px;
      background: rgba(139, 105, 20, 0.1);
      cursor: pointer;
      font-weight: bold;
      color: #8b6914;
      font-size: 0.9rem;
      user-select: none;
      
      &:hover {
        background: rgba(139, 105, 20, 0.2);
      }
      
      i {
        margin-right: 6px;
      }
    }

    .chat-details-content {
      padding: 8px;
      background: rgba(255, 255, 255, 0.3);
      font-size: 0.85rem;
      
      div {
        margin-bottom: 4px;
        
        &:last-child {
          margin-bottom: 0;
        }
      }
      
      strong {
        color: #8b6914;
      }
    }
  }

  /* Welcome Message Styling */
  .heritiers-welcome-card {
    .welcome-header {
      padding: 12px;
      background: linear-gradient(135deg, rgba(139, 105, 20, 0.4) 0%, rgba(139, 105, 20, 0.2) 100%);
      border-bottom: 3px solid #8b6914;
    }

    .welcome-icon-wrapper {
      width: 48px;
      height: 48px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: rgba(139, 105, 20, 0.2);
      border-radius: 50%;
      border: 2px solid #8b6914;
    }

    .welcome-icon {
      font-size: 1.5rem;
      color: #8b6914;
    }

    .welcome-content {
      padding: 12px;
    }

    .welcome-section {
      margin-bottom: 12px;
      padding: 10px;
      background: rgba(139, 105, 20, 0.08);
      border-left: 3px solid #8b6914;
      border-radius: 3px;

      &:last-child {
        margin-bottom: 0;
      }

      > i {
        font-size: 1rem;
        color: #8b6914;
        margin-right: 8px;
        float: left;
        margin-top: 2px;
      }

      p {
        margin: 4px 0;
        font-size: 0.9rem;
        line-height: 1.4;

        &:last-child {
          margin-bottom: 0;
        }
      }

      a {
        color: #8b6914;
        font-weight: bold;
        text-decoration: none;
        border-bottom: 1px solid transparent;
        transition: border-bottom 0.2s;

        &:hover {
          border-bottom-color: #8b6914;
        }

        i {
          font-size: 0.85rem;
          margin-right: 4px;
        }
      }

      strong {
        color: #8b6914;
        font-weight: bold;
      }

      em {
        font-style: italic;
      }
    }
  }

  .adversite-modify {
    margin-top: 12px;
  }

  .argent-total-text {
    margin-left: 4px;
  }
