.todo-list ul {
    width: fit-content;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    list-style: none;
    padding: 0;
}

.todo-list ul li.task .state {
    font-weight: bold;
    margin-right: 1ex;
}

.todo-list ul li.task.deadline-today {
    background-color: #fdd;
}

.todo-list ul li.task,
.todo-list ul li.mail {
    position: relative;
}

.todo-list ul li.task:hover,
.todo-list ul li.mail:hover {
    /* Invert colors */
    background-color: white;
    filter: invert() hue-rotate(180deg) brightness(200%);
}

.todo-list ul li.task > a,
.todo-list ul li.mail > a {
    display: flex;
    max-width: 100%;
    white-space: nowrap;
}
.todo-list ul li.task a,
.todo-list ul li.mail a{
    color: inherit;
    text-decoration: inherit;
}

.todo-list ul li.mail a {
    background-color: #ffd;
    padding-right: 2em;
}

.todo-list ul li.mail.mail-read a {
    background-color: #fff;
    padding-right: 0;
}

.todo-list ul li.mail a::before {
    content: '📧 ';
    text-decoration: revert;
}

.todo-list ul li.mail a .sender::before{
    content: ' from ';
}
.todo-list ul li.mail a .sender {
    flex-shrink: 1;
}

.todo-list ul li.task a .title,
.todo-list ul li.mail a .title{
    text-overflow: ellipsis;
    overflow: hidden;
    word-break: normal;
    margin-right: 1ex;

    flex-shrink: 1;
    display: inline-block;
    white-space: nowrap;
    vertical-align: bottom;
}

.todo-list ul li .application {
    padding: 0 1ex;
}

.todo-list ul li.captured {
    display: block;
    margin-left: -4ex;
}

.todo-list ul li.task .tags {
    display: inline-block;
    width: max-content;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #404;
    border-radius: 4px;

    /* position: absolute; */
    /* left: 100%; */
    /* float: right; */
    margin-left: auto;
}

.todo-list ul li.task .tags .tag {
    display: inline-block;
}

/* .todo-list ul li.task .tags .tag:nth-child(1)::before { */
/*     content: ':'; */
/* } */

.todo-list ul li.task .tags .tag::after {
    content: ':';
}
html, body {
    min-height: calc(100vh - 0.5ex);
}

body {
    margin: 0;
    padding: 0.5ex 0 0 1ex;
}

nav h1 {
    display: inline;
}
nav h1 a {
    color: inherit;
}
nav input {
}


#parent-view, #children-view  {
    display: inline;
}

#parent-view::before {
    content: 'Parent:';
    font-weight: bold;
}
#parent-view.empty {
    display: none;
}

#parent-view > a.disabled .node, #children-view > a.disabled .node {
    background-color: #ddd;
    box-shadow: none;
}

#parent-view > a:not(:first-child)::before {
    content: '>';
}

#children-view {
    list-style: none;
    padding: 0;
}

#children-view::before {
    content: 'Children:';
    font-weight: bold;
}

#children-view.empty {
    display: none;
}

#children-view > a, #parent-view > a {
    color: inherit;
    text-decoration: none;
}

#children-view .node, #parent-view .node {
    padding: 0.5ex;
    margin: 0 1ex;
    border-radius: 4px;
    display: inline-block;
    box-shadow: 0px 1px 2px 1px rgba(0, 0, 0, 0.25);
    margin-bottom: 1ex;
}


/* Extend main view all the way to the bottom of the screen */
body {
    display: flex;
    flex-direction: column;
}
#main-view {
    flex-grow: 1;
}

.org-note-view [org-class="title"] {
    margin-bottom: 2px;
}
.org-note-view.updating [org-class="title"] {
    animation-name: updating-title;
    border-bottom-width: 4px;
    animation-duration: 2s;
    margin-bottom: -2px;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
    border-bottom-style: solid;
}


@keyframes updating-title {
    from {
        border-bottom-color: hsl(0 80% 40%);
    }
    30% {
        border-bottom-color: hsl(80 80% 40%);
    }
    60% {
        border-bottom-color: hsl(180 80% 40%);
    }
    to {
        border-bottom-color: hsl(360 80% 40%);
    }
}

.org-note-view {
    outline: none;
    white-space: pre-wrap;
}

.org-note-view [org-class="title"]::before {
    content: '🔒';
}

.org-note-view[contenteditable="true"] [org-class="title"]::before {
    content: ' ';
}

.org-note-view [org-class="title"] {
    width: fit-content;
    margin-top: 0;
}

.org-note-view [org-class="title"] .stars {
    color: #888;
}

.org-note-view  [org-class="title"] .stars::after {
    content: '';
}

.org-note-view [org-class="title"] .tags {
    list-style: none;
    display: inline-block;
    padding: 0 0 0 1em;
}

.org-note-view [org-class="title"] .tags li {
    border-radius: 4px;
    background-color: #ddd;
    padding: 0 0.5ex;
    display: inline-block;
    margin-left: 0.25ex;
}

.org-note-view [org-class="title"] .tags li.empty {
    display: none;
}

.org-note-view a.explicit::before {
    content: '[[';
    color: #888;
}
.org-note-view a.explicit::after {
    content: ']]';
    color: #888;
}

.org-note-view a.explicit.internal::before {
    content: '[[📓 ';
    color: #888;
}.org-note-view a.explicit.external::before {
    content: '[[🌐 ';
    color: #888;
}


.org-note-view a.internal::before {
    content: '📓 ';
    color: #888;
}.org-note-view a.external::before {
    content: '🌐 ';
    color: #888;
}

.results-box-container {
    z-index: 5;
    position: fixed;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.3);
    top: 0;
    left: 0;
}
.results-box-container.hidden {
    display: none;
}
.results-box {
    min-width: 50vw;
    max-width: 90vw;
    min-height: 20ex;
    max-height: 90vh;
    overflow: auto;
    border-radius: 4px;
    margin: 2rem auto;
    box-shadow: 0px 1px 2px 1px rgba(0, 0, 0, 0.25);
    background-color: #fff;
}

.results-box-container .results-box input {
    width: 90%;
    margin: 0 auto;
    padding-top: 2ex;
    display: block;
    background-color: transparent;
    color: #000;
    border: none;
    border-bottom: 1px solid #888;
    outline: none;
    font-size: 100%;
}

.results-box-container .results-box input:focus {
    border-bottom: 1px solid #000;
}

@keyframes loading-query {
    from {
        border-bottom-color: hsl(0 80% 40%);
    }
    30% {
        border-bottom-color: hsl(80 80% 40%);
    }
    60% {
        border-bottom-color: hsl(180 80% 40%);
    }
    to {
        border-bottom-color: hsl(360 80% 40%);
    }
}
.results-box-container .results-box.loading input {
    animation-name: loading-query;
    border-bottom-width: 2px;
    animation-duration: 2s;
    margin-bottom: -1px;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
}

/* Search box results */
.results-box ul {
    list-style: none;
    padding: 0;
}
.results-box ul li {
    padding: 0.25ex;
    margin: 1ex;
    border-radius: 4px;
    box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.25);
}

.results-box ul li h2 {
    font-size: 110%;
    padding: 1.25ex;
    display: block;
    margin: 0;
}

.results-box li h2.is-todo::before {
  content: 'TODO';
  display: inline-block;
  background-color: #D00;
  padding: 0.25ex;
  border-radius: 4px;
  font-size: 90%;
  margin-right: 0.5ex;
}

.no-results-box {
    padding: 1rem;
}

.no-results-box.hidden {
    display: none;
}
.org-spreadsheet-view table thead tr th {
    background-color: #fdd;
}

.org-spreadsheet-view table tbody tr:nth-child(2n) td {
    background-color: #eef;
}
#weekplan, #dayplan {
  --weekplan-row-height: 2em;
}

#weekplan .day,
#dayplan .day {
    display: block;
    margin: 0.5ex;
    line-height: var(--weekplan-row-height);
    position: relative;
    height: var(--weekplan-row-height);
    color: #888;
}

#weekplan .day .hour,
#dayplan .day .hour {
    display: block;
    position: absolute;
    top: 0;
    box-sizing: border-box;
    border-left: 1px solid #ccf;
    height: var(--weekplan-row-height);
}

#weekplan .day .hour-0, #weekplan .day .hour-1,
#dayplan .day .hour-0, #dayplan .day .hour-1 {
    color: transparent;
}

#weekplan .day.past,
#dayplan .day.past {
    border: 1px solid #000;
}

#weekplan .day.today,
#dayplan .day.today {
    border: 1px solid #045;
}

#weekplan .day.today {
    box-shadow: 0 0 3px 2px #089;
}

#weekplan .day.future,
#dayplan .day.future {
    border: 1px dotted #000;
}


#weekplan .day .conflict,
#dayplan .day .conflict,
#weekplan .day .task,
#dayplan .day .task,
#weekplan .day .rest,
#dayplan .day .rest {
    display: inline-block;
    position: absolute;
    text-align: center;
    height: var(--weekplan-row-height);
    box-sizing: border-box;
    border: 1px solid black;
}

#weekplan .day .rest,
#dayplan .day .rest {
    background-color: rgba(0,0,0,0.3);
    text-align: right;
}

#weekplan .day .task,
#dayplan .day .task {
    background-color: #fa0;
    border: 1px solid #b60;
    color: #fff;
    cursor: pointer;
}

#weekplan .day .task.tag-entretenimiento,
#dayplan .day .task.tag-entretenimiento {
    background-color: #4e4;
    border: 1px solid #0a0;
    color: black;
}

#weekplan .day .task.tag-wrk,
#dayplan .day .task.tag-wrk {
    background-color: #f44;
    border: 1px solid #b00;
}


#weekplan .day .task.tag-master,
#dayplan .day .task.tag-master {
    background-color: #08f;
    border: 1px solid #04b;
}

#weekplan .day .task.state-MEETIN,
#dayplan .day .task.state-MEETING,
#weekplan .day .task.tag-meeting,
#dayplan .day .task.tag-meeting {
    background-color: #808;
    border: 1px solid #404;
}


#weekplan .day .task.tag-meeting.tag-task,
#dayplan .day .task.tag-meeting.tag-task {
    background-color: #f44;
    border: 1px solid #b00;
}

#weekplan .day .task.ongoing,
#dayplan .day .task.ongoing {
    background: repeating-linear-gradient(
        45deg,
        rgba(100, 120, 200, 1),
        rgba(100, 120, 200, 1) 1ex,
        rgba(160, 80, 60, 1) 1ex,
        rgba(160, 80, 60, 1) 2ex
    );
    border: none;
}


#weekplan .day .conflict,
#dayplan .day .conflict {
    background: repeating-linear-gradient(
        45deg,
        rgba(255, 200, 200, 1),
        rgba(255, 200, 200, 1) 1ex,
        rgba(255, 0, 0, 1) 1ex,
        rgba(255, 0, 0, 1) 2ex
    );
    border: none;
}

#weekplan .day .marker,
#dayplan .day .marker {
    width: 3px;
    position: absolute;
    height: calc(100% + 10px);
    top: -5px;
    background-color: #006;
    pointer-events: none;
}

#weekplan .day.today .marker,
#dayplan .day.today .marker {
    width: 3px;
    position: absolute;
    height: calc(100% + 25px);
    top: -15px;
    background-color: #006;
}

#weekplan .task label,
#dayplan .task label {
    font-size: 66%;
    overflow: hidden;
    width: 100%;
    height: 100%;
    display: inline-block;
    line-height: 1em;
    vertical-align: middle;
    font-weight: bold;
    pointer-events: none;
}

#weekplan .day .marker label,
#dayplan .day .marker label {
    left: 3px;
    position: absolute;
    top: -1ex;
    color: #006;
    font-style: italic;
    text-wrap: nowrap;
}

#weekplan .day .marker.daily,
#dayplan .day .marker.daily {
    border-left: 4px dashed rgba(250,0,96, 1);
    background: none;
    margin-left: -2px;
}
#weekplan .day .marker.daily label,
#dayplan .day .marker.daily label {
    display: none;
}

#weekplan .day  .hour:nth-child(2n),
#dayplan .day  .hour:nth-child(2n) {
    color: transparent;  /* Don't show hour contents */
    border-color: transparent;
}

@media screen and (max-width: 600px) {
    #weekplan .day .hour-2, #dayplan .day .hour-2,
    #weekplan .day .hour-3, #dayplan .day .hour-3,
    #weekplan .day .hour-4, #dayplan .day .hour-4,
    #weekplan .day .hour-5, #dayplan .day .hour-5,
    #weekplan .day .hour-6, #dayplan .day .hour-6,
    #weekplan .day .hour-7, #dayplan .day .hour-7 {
        color: transparent;
    }

    #weekplan .day .hour,
    #dayplan .day .hour {
        border-color: transparent;
    }
    #weekplan .day  .hour:nth-child(4n + 1),
    #dayplan .day  .hour:nth-child(4n + 1) {
        border-left-color: #ccf;
    }
}

@media screen and (max-width: 400px) {
    #weekplan .day .hour,
    #dayplan .day .hour {
        border-color: transparent;
    }
    #weekplan .day  .hour:nth-child(4n + 1),
    #dayplan .day  .hour:nth-child(4n + 1) {
        color: transparent;
        border-left-color: transparent
    }
}
