:root{
    --monokai-bg: #272822;
    --monokai-fg: #f8f8f2;
    --preview-radius: 6px;

    --dark0_x:  46,52,64; /* #2e3440 */
    --dark0:    rgb(var(--dark0_x));
    --dark1_x:  59,66,82; /* #3b4252 */
    --dark1:    rgb(var(--dark1_x));
    --dark2_x:  67,76,94; /* #434c5e */
    --dark2:    rgb(var(--dark2_x));
    --dark3_x:  76,86,106; /* #4c566a */
    --dark3:    rgb(var(--dark3_x));

    --light0_x: 216,222,233; /* #d8dee9 */
    --light0:   rgb(var(--light0_x));
    --light1_x: 229,233,240; /* #e5e9f0 */
    --light1:   rgb(var(--light1_x));
    --light2_x: 236,239,244; /* #eceff4 */
    --light2:   rgb(var(--light2_x));
    --light3_x: 255,255,255; /* #ffffff */
    --light3:   rgb(var(--light3_x));

    --frost0_x: 143,188,187; /* #8fbcbb */
    --frost0:   rgb(var(--frost0_x));
    --frost1_x: 136,192,208; /* #88c0d0 */
    --frost1:   rgb(var(--frost1_x));
    --frost2_x: 129,161,193; /* #81a1c1 */
    --frost2:   rgb(var(--frost2_x));
    --frost3_x: 94,129,172; /* #5e81ac */
    --frost3:   rgb(var(--frost3_x));

    --red_x:    191,97,106; /* #bf616a */
    --red:      rgb(var(--red_x));
    --orange_x: 208,135,112; /* #d08770 */
    --orange:   rgb(var(--orange_x));
    --yellow_x: 235,203,139; /* #ebcb8b */
    --yellow:   rgb(var(--yellow_x));
    --green_x:  163,190,140; /* #a3be8c */
    --green:    rgb(var(--green_x));
    --purple_x: 180,142,173; /* #b48ead */
    --purple:   rgb(var(--purple_x));

    --font-semibold: 600;

    --bold-weight: var(--font-semibold);
    --bold-color: var(--yellow);
    --italic-color: var(--yellow);

    --codeblock-border: rgba(255, 255, 255, 0.05);

    --line-height-tight: 1.3;

    --text-normal: var(--light2);

    --font-text-sizes: 16px;

    --size-2-2: 4px;
    --size-4-2: 8px;
    --background-modifier-border: var(--dark2);

    --table-white-space: normal;
    --table-background: transparent;
    --table-border-width: 1px;
    --table-header-size: var(--font-text-sizes);
    --table-header-weight: var(--bold-weight);
    --table-header-color: var(--text-normal);
    --table-row-background-hover: var(--dark3);
    --table-header-background-hover: var(--dark3);
    --table-border-color: var(--background-modifier-border);
    --table-row-alt-background: var(--table-background);
    --table-column-alt-background: var(--table-background);
    --table-row-last-border-width: var(--table-border-width);
    --table-column-first-border-width: var(--table-border-width);
    --table-column-last-border-width: var(--table-border-width);
    --table-header-background: var(--table-background);
    --table-header-border-width: var(--table-border-width);
    --table-header-border-color: var(--table-border-color);
    --table-column-max-width: none;

    --table-row-even-background:     hsl(220, 16%, 20%);
    --table-row-odd-background:      hsl(220, 16%, 24%);
    --table-row-background-hover:    var(--dark3);
}

  .chronos-blank {
      height: 1em;          /* hauteur de la ligne vide */
      margin: 0.5em 0;      /* espace vertical */
    }

  .editor-wrapper {
    max-width: 900px;
    margin: auto;
    position: relative;
  }
  .CodeMirror {
    /* font-size: 15px; */
    line-height: 1.6;
    /* height: 500px; */
    border-radius: var(--preview-radius);
    border: 1px solid rgba(0,0,0,0.12);
    box-sizing: border-box;
    /* background: var(--monokai-bg) !important; */
    color: var(--monokai-fg);
    overflow-x: hidden;
  }
  .CodeMirror-scroll {
    padding: 5px;
    /* max-height: 500px; */
    overflow-y: auto;
    box-sizing: border-box;
    overflow-x: hidden !important;
  }
  .preview-overlay {
      position: absolute;
      top: 0; left: 0; right: 0; bottom: 0;
      padding: 18px;
      box-sizing: border-box;
      /* height: 500px; */
      border-radius: var(--preview-radius);
      z-index: 2;
      display: none;
      overflow-y: auto;
      overflow-x: hidden;
      background: var(--monokai-bg);
      color: var(--monokai-fg);
      border: 1px solid rgba(0,0,0,0.12);
      -webkit-font-smoothing: antialiased;
  }
  .preview-overlay::-webkit-scrollbar { width: 8px; }
  .preview-overlay::-webkit-scrollbar-thumb { background-color: rgba(255,255,255,0.08); border-radius: 6px; }
  .preview-overlay::-webkit-scrollbar-track { background: transparent; }
  .preview-overlay { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.08) transparent; }

  .preview-line { margin: 6px 0; }
  .preview-line .todo { display: flex; align-items: center; gap: 10px; color: var(--monokai-fg); }
  .preview-line .todo input[type="checkbox"]{ width:16px;height:16px; accent-color:#007d32; pointer-events:auto; transform:translateY(-1px); }
  .preview-line pre { margin: 8px 0; border-radius: 6px; overflow: auto; }
  .preview-line pre code.hljs { display:block; padding:12px; border-radius:6px; background:rgba(255,255,255,0.05); }
  .preview-line p { margin: 6px 0; color: var(--monokai-fg); }


  .collapsible-handle { color: rgba(249, 38, 114, 0.1); }
  .collapsible-handle:hover { color: rgba(249, 38, 114, 0.5); }

  /* Base blockquote avec rail gauche + icône */
  .chronos_blockquote {
    position: relative;
    padding: 1rem 1rem 1rem 4.5rem; /* espace rail + icône */
    margin: 1rem 0;
    border-radius: 8px;
    background: var(--bq-bg, #f9f9f9);
    color: var(--bq-text, #333);
    border-bottom-left-radius: 10px;
    border-top-left-radius: 10px;
    border-left: 0px;
  }

  /* rail vertical */
  .chronos_blockquote::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3.2rem;
    background: var(--bq-rail, #ccc);
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
  }

  /* icône centrée dans le rail */
  .chronos_blockquote::after {
    font-family: "remixicon"; /* police Remixicon */
    content: var(--bq-emoji, "💬");
    position: absolute;
    left: 0; top: 50%;
    width: 3.2rem;
    transform: translateY(-50%);
    text-align: center;
    font-size: 1.4rem;
    line-height: 1;
  }

  /* préserver les retours à la ligne */
  .chronos_blockquote p { 
    white-space: pre-line; 
    margin: 0; 
  }

  /* Variantes */
  .chronos_blockquote.is-info {
    --bq-rail: #147fc5;
    --bq-bg: #d7e0e525;
    --bq-text: #fbfbfb;
    --bq-emoji: "\ee59";
  }

  .chronos_blockquote.is-success {
    --bq-rail: #066f2b;
    --bq-bg: #e6f7ec25;
    --bq-text: #fbfbfb;
    --bq-emoji: "\eb7b";
  }

  .chronos_blockquote.is-warning {
    --bq-rail: #d1911b;
    --bq-bg: #fff5d725;
    --bq-text: #fbfbfb;
    --bq-emoji: "\ea21";
  }

  .chronos_blockquote.is-error {
    --bq-rail: #cf3a58fa;
    --bq-bg: #fde8eb25;
    --bq-text: #fbfbfb;
    --bq-emoji: "\f4c7";
  }

  /* Container */
  .chronos_progress {
    margin: 1rem 0;
    padding: 0.5rem 0;
    width: 60%;
  }

  /* Label */
  .chronos_progress_label {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    opacity: 0.8;
  }

  /* Bar */
  .chronos_progress_bar {
    background: #1c1c1c;
    border-radius: 6px;
    height: 10px;
    overflow: hidden;
    position: relative;
  }

  /* Fill */
  .chronos_progress_fill {
    background: linear-gradient(90deg, #246ea9, #13b781);
    height: 100%;
    border-radius: 6px;
    transition: width 0.35s ease;
    box-shadow: 0 0 6px #2ca1ff80;
  }

.preview-overlay hr {
border: none;          /* supprime la bordure par défaut */
border-top: 1px solid rgba(255, 255, 255, 0.1);
color: rgba(255, 255, 255, 0.1);
}

/* Default styling for markdown elements in preview */
.preview-overlay h1 {
    font-size: 1.875rem; /* 3xl */
    font-weight: 700; /* bold */
    /*border-bottom: 1px solid rgba(255, 255, 255, 0.1);*/
    padding-bottom: 0.2rem;
    margin-bottom: 0.25rem;
    color: rgb(189, 89, 97);
    /*margin-bottom: 1rem;*/
}

.preview-overlay h2 {
    font-size: 1.5rem; /* 2xl */
    font-weight: 600; /* semibold */
    /*border-bottom: 1px solid rgba(255, 255, 255, 0.1);*/
    padding-bottom: 0.2rem;
    margin-bottom: 0.25rem;
    color: rgb(227, 208, 150);
    /*margin-bottom: 0.75rem;*/
}

.preview-overlay h3 {
    font-size: 1.25rem; /* xl */
    font-weight: 600; /* semibold */
    margin-bottom: 0.25rem;
    color: rgb(163, 179, 133);
    /*margin-bottom: 0.5rem;*/
}

.preview-overlay h4 {
    font-size: 1.125rem; /* lg */
    font-weight: 600; /* semibold */
    margin-bottom: 0.25rem;
    color: rgb(151, 132, 162)
    /*margin-bottom: 0.5rem;*/
}

.preview-overlay h5 {
    font-size: 1rem; /* base */
    font-weight: 600; /* semibold */
    margin-bottom: 0.25rem;
    color: rgb(146, 175, 191);
    /*margin-bottom: 0.25rem;*/
}

.preview-overlay h6 {
    font-size: 0.875rem; /* sm */
    font-weight: 600; /* semibold */
    margin-bottom: 0.25rem;
    color: rgb(131, 160, 183);
}

.preview-overlay ul {
    list-style-type: disc;
    list-style-position: inside;
    padding-left: 1.25rem; /* pl-5 */
    margin-bottom: 0.5rem;
}

.preview-overlay ol {
    list-style-type: decimal;
    list-style-position: inside;
    padding-left: 1.25rem; /* pl-5 */
    margin-bottom: 0.5rem;
}

.preview-overlay li {
    margin-bottom: 0.25rem;
}

.preview-overlay blockquote {
}

.preview-overlay code {
}

.preview-overlay pre {
    border-radius: 0.25rem;
}

/* Tables */
.preview-overlay table {
  border-collapse: collapse;
  margin-block-start: 1em;
  margin-block-end: 1em;
  border: var(--table-border-width) solid var(--table-border-color);
}
.preview-overlay td,
.preview-overlay th {
  padding: var(--size-2-2) var(--size-4-2);
  border: var(--table-border-width) solid var(--table-border-color);
  max-width: var(--table-column-max-width);
}

.preview-overlay th {
  font-size: var(--table-header-size);
  font-weight: var(--table-header-weight);
  color: var(--table-header-color);
  text-align: left;
  line-height: var(--line-height-tight);
}
.preview-overlay th[align="center"] {
  text-align: center;
}
.preview-overlay th[align="right"] {
  text-align: right;
}
.preview-overlay thead > tr > th,
.preview-overlay tbody > tr > td {
  white-space: var(--table-white-space);
  text-overflow: ellipsis;
  overflow: hidden;
}
.preview-overlay tbody tr {
  background-color: var(--table-background);
}
@media (hover: hover) {
  .preview-overlay tbody tr:hover {
    background-color: var(--table-row-background-hover);
  }
}

.preview-overlay tbody tr:nth-child(even)
{
    background-color: var(--table-row-even-background) !important;
}

.preview-overlay tbody tr:nth-child(odd)
{
    background-color: var(--table-row-odd-background) !important;
}

.preview-overlay tbody tr:nth-child(even):hover,
.preview-overlay tbody tr:nth-child(odd):hover
{
    background-color: var(--table-row-background-hover) !important;
}
@media (hover: hover) {
  .preview-overlay tbody tr:nth-child(odd):hover {
    background-color: var(--table-row-background-hover);
  }
}
.preview-overlay tbody tr > td:nth-child(2n+2) {
  background-color: var(--table-column-alt-background);
}
.preview-overlay tbody tr:last-child > td {
  border-bottom-width: var(--table-row-last-border-width);
}
.preview-overlay tbody tr > td:first-child {
  border-left-width: var(--table-column-first-border-width);
}
.preview-overlay tbody tr > td:last-child {
  border-right-width: var(--table-column-last-border-width);
}
.preview-overlay thead tr {
  background-color: var(--table-header-background);
}
@media (hover: hover) {
  .preview-overlay thead tr:hover {
    background-color: var(--table-header-background-hover);
  }
}
.preview-overlay thead tr > th {
  border-top-width: var(--table-header-border-width);
  border-color: var(--table-header-border-color);
}
.preview-overlay thead tr > th:nth-child(2n+2) {
  background-color: var(--table-column-alt-background);
}
.preview-overlay thead tr > th:first-child {
  border-left-width: var(--table-column-first-border-width);
}
.preview-overlay thead tr > th:last-child {
  border-right-width: var(--table-column-last-border-width);
}


.preview-overlay a {
    color: #93a178; 
    text-decoration: none;
}

.preview-overlay b,
.preview-overlay strong {
  font-weight: var(--bold-weight);
  color: var(--bold-color);
}

.preview-overlay i,
.preview-overlay em {
  font-style: italic;
  color: var(--italic-color);
}

.preview-overlay .hljs {
    border-radius: 10px;
    border: 1px solid var(--codeblock-border);
}

.preview-overlay .chip-entity-link {
    border-radius: 5px;
    padding: 1px 5px 1px 5px;
    position: relative;          /* pour que ::before soit positionné par rapport au chip */
    display: inline-flex;
    align-items: center; 
}

/* Icône pour task */
.preview-overlay .task-entity-link::before {
    content: "📝";               /* emoji task */
    margin-right: 5px;
}

/* Icône pour project */
.preview-overlay .project-entity-link::before {
    content: "📁";               /* emoji project */
    margin-right: 5px;
}

/* Icône pour meeting */
.preview-overlay .meeting-entity-link::before {
    content: "🗓️";               /* emoji meeting */
    margin-right: 5px;
}

.preview-overlay .task-entity-link {
    background-color: rgba(255, 255, 255, 0.08);
}


.preview-overlay .project-entity-link {
    background-color: rgba(255, 255, 255, 0.08);
}

.preview-overlay .meeting-entity-link {
    background-color: rgba(255, 255, 255, 0.08);
}


/* Fullscreen Modal Styles */
#modal-scroll-container.is-fullscreen {
    width: 75vw;
    height: 95vh;
    max-width: 100vw;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
}

#task-modal.is-fullscreen {
    padding: 0;
}

/*#modal-scroll-container.is-fullscreen .codemirror-editor {
    width: 95% !important;
} */

#modal-scroll-container.is-fullscreen .codemirror-editor .CodeMirror,
#modal-scroll-container.is-fullscreen .codemirror-editor .preview-overlay {
    height: 60vh !important;
}

#modal-scroll-container.is-fullscreen .codemirror-script-editor .CodeMirror {
    height: 40vh !important;
}

#modal-scroll-container.is-fullscreen .metadata-element {
    max-width: 50vw !important;
    margin: 0 auto;
}

#modal-scroll-container::-webkit-scrollbar { width: 8px; }
#modal-scroll-container::-webkit-scrollbar-thumb { background-color: rgba(255,255,255,0.08); border-radius: 6px; }
#modal-scroll-container::-webkit-scrollbar-track { background: transparent; }
#modal-scroll-container { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.08) transparent; }



/* Modal daily */
#daily-editor-container .CodeMirror {
    height: 100% !important;
}

/* Tab specific styles */
.tab-link.active {
    border-color: #4A90E2; /* Or your theme's primary color */
    color: #FFFFFF;
}

.tab-content.hidden {
    display: none;
}

/* Discreet scrollbar for recently updated tasks table */
#recently-updated-tasks-scroll-container::-webkit-scrollbar { width: 8px; }
#recently-updated-tasks-scroll-container::-webkit-scrollbar-thumb { background-color: rgba(255,255,255,0.08); border-radius: 6px; }
#recently-updated-tasks-scroll-container::-webkit-scrollbar-track { background: transparent; }
#recently-updated-tasks-scroll-container { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.08) transparent; }