*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 240%;
}

body {
    margin: 0;
    font-family: system-ui, sans-serif;
    background-color: #f9fafb;
    color: #111827;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0.25rem 0;
}

h1 {
    margin-top: 0;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.25rem 0.5rem;
    min-height: 2.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.navbar .nav-item {
    display: flex;
    align-items: center;
}


.icon {
    width: 1em;
    height: 1em;
    vertical-align: middle;
}

.historical-icon {
    margin-right: 0.25rem;
}

/* Larger icons for headings */
h1 .icon {
    width: 1.5rem;
    height: 1.5rem;
}

.navbar .icon {
    width: 2rem;
    height: 2rem;
}

.content {
    padding: 0.25rem;
    margin-top: 2.5rem; /* prevent content from hiding under navbar */
}

.user-menu {
    position: relative;
}

.user-button {
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
}

.dropdown {
    display: none;
    position: absolute;
    right: 0;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.dropdown.show,
.user-menu:hover .dropdown {
    display: block;
}

.dropdown a {
    display: block;
    padding: 0.25rem 0.5rem;
    color: #111827;
    text-decoration: none;
}

.dropdown a:hover {
    background-color: #f3f4f6;
}

.icon-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: inherit;
}

/* Ensure inline editors match surrounding text */
.inline-input {
    font-size: inherit;
}

/* Match textarea text size to surrounding content */
textarea {
    font-size: 1rem;
    font-family: inherit;
}

.time-range {
    margin: 0;
}

#title-type {
    margin-bottom: 0;
}

.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0.25rem;
}

/* Form field layout */
.field {
    margin-bottom: 0.5rem;
}

.label-row {
    display: flex;
    align-items: center;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.label-row label {
    font-weight: inherit;
}

.label-row .icon-button {
    margin-left: 0.25rem;
}

.required {
    color: red;
    margin-left: 0.25rem;
}

.help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.25rem;
    color: #2563eb;
    cursor: pointer;
    width: 1rem;
    height: 1rem;
    border: 1px solid #2563eb;
    border-radius: 50%;
    font-size: 0.75rem;
}

.form input,
.form textarea,
.form select {
    font-size: 1rem;
    padding: 0.5rem;
}

.form textarea {
    resize: vertical;
}

.form input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
}

.form label.checkbox {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.form label.checkbox span {
    margin-left: 0.5rem;
}

.form button {
    font-size: 1rem;
    padding: 0.5rem 1rem;
}

.nav-left {
    display: flex;
    align-items: center;
}

.nav-left .nav-item {
    margin-right: 0.5rem;
}

.nav-left .nav-item:last-child {
    margin-right: 0;
}

.nav-actions {
    display: flex;
    align-items: center;
}

.create-menu {
    position: relative;
    margin-right: 0.5rem;
}

.list-menu {
    position: relative;
    margin-right: 0.5rem;
}

.settings-menu {
    position: relative;
    margin-right: 0.5rem;
}

/* Group styling */
.group {
    border: 1px solid #d1d5db;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.profile-picture {
    cursor: pointer;
    display: inline-block;
}

.profile-picture img {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
}

.profile-picture .pending {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background-color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.75rem;
    color: #555;
}

.group .group {
    margin-left: 1rem;
}

.group > h3 {
    margin-top: 0;
}

.recurrence-item {
    position: relative;
}

.recurrence-item .remove-recurrence {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: none;
    border: none;
    cursor: pointer;
}

.duration-inputs {
    display: inline-flex;
    align-items: center;
}

.duration-inputs input {
    margin-right: 0.25rem;
}

.duration-inputs label {
    display: inline-flex;
    align-items: center;
    margin-right: 0.25rem;
}

.duration-inputs label input {
    margin-right: 0.1rem;
}

.duration-inputs input[type="number"] {
    width: 4rem;
}

.duration-inputs input[type="datetime-local"] {
    width: 16rem;
}

.responsible-line {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.25rem;
}

.responsible-selector {
    position: relative;
    display: inline-block;
}

#responsible-list {
    list-style: none;
    padding-left: 0;
    margin-top: 0;
    margin-left: 1rem;
}

#responsible-list li {
    display: flex;
    align-items: center;
    margin-bottom: 0.125rem;
}

#responsible-list li button {
    background: none;
    border: none;
    cursor: pointer;
    margin-left: 0.25rem;
}

.flash {
    padding: 0.5rem;
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
    margin-bottom: 0.5rem;
}

.time-list {
    list-style: none;
    padding-left: 0;
}

.time-list li {
    margin-bottom: 0.25rem;
}

.profile-icon {
    height: 1em;
    width: 1em;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 0.25rem;
}

.time-list .profile-icon + .profile-icon {
    margin-left: -0.25rem;
}

.checkbox-icon {
    height: 1em;
    width: 1em;
    vertical-align: middle;
    margin-left: 0.25rem;
}

.entry-icon {
    height: 1em;
    width: 1em;
    vertical-align: middle;
    margin: 0 0.25rem;
}

/* Make skip/unskip buttons match surrounding text size */
.skip-button {
    font-size: 1rem;
    padding: 0.25rem 0.5rem;
}

.note-marker {
    color: #b91c1c;
    margin-left: 0.2rem;
}

.time-suffix {
    padding: 0 0.25rem;
    border-radius: 0.25rem;
}

.due-soon {
    background-color: #fee2e2; /* light red */
}

.due-today {
    background-color: #fef9c3; /* light yellow */
}

.due-week {
    background-color: #dcfce7; /* light green */
}

.due-later {
    background-color: #dbeafe; /* light blue */
}

.pin-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.pin-modal-content {
    background: #ffffff;
    padding: 1rem;
    border-radius: 0.25rem;
    text-align: center;
}

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
}

.keypad .key {
    padding: 0.5rem;
    font-size: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.keypad .letters {
    font-size: 0.5rem;
}

.keypad .enter {
    grid-column: 3;
}

.keypad .clear {
    grid-column: 1;
}

#pin-display {
    min-height: 1.5rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.25rem;
}

.pin-error {
    color: #b91c1c;
    margin-top: 0.5rem;
}

h1 .icon-button {
    margin-left: 0.25rem;
}
h2 .icon-button {
    margin-left: 0.25rem;
}
