body {
    -webkit-tap-highlight-color: transparent;
    overflow: scroll;
    line-height: normal;
    user-select: none;
    background: var(--navy);
}

#app {
    position: absolute;
    display: flex;
    flex-direction: column;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
}

:root {
    --navy: #0b1f4d;
    --ink: #0b1b3f;
    --muted: #4a5878;
    --ink-soft: #33456e;
    --divider: #e8edf7;
    --link: #1d4ed8;
    --link-hover: #1e3a8a;
    --accent: #2563eb;
    --line: #c9d3e6;
    --line-soft: #d3dffc;
    --line-faint: #e3e9f5;
    --surface: #f3f6fc;
    --field: #f7f9fe;
    --tint: #e3ebff;
    --danger: #b42318;
    --danger-bg: #fef0ee;
    --single: #0ea5e9;
    --single-bg: #e2f4fc;
    --recurring: #4f46e5;
    --recurring-text: #3b35ac;
    --recurring-bg: #ededfc;
    --safe-bottom: 0px;
    /* floating tab bar: clears the home indicator, the rest of the UI rises with it */
    --tab-bottom: max(14px, calc(var(--safe-bottom) - 12px));
    --tab-lift: calc(var(--tab-bottom) - 14px);
}

* {
    font-family: "Plus Jakarta Sans", sans-serif;
}

html,
body {
    color: var(--ink);
}

h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 18px;
    font-weight: 800;
    padding: 4px 0 8px;
}

.sheet {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    box-sizing: border-box;
    background-color: white;
    color: var(--ink);
    border-radius: 28px 28px 0 0;
    padding-bottom: calc(96px + var(--tab-lift));
}

.sheet.tinted {
    background-color: var(--surface);
}

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    color: var(--link-hover);
}

/* a card of label rows; the divider between the rows is inset like in the design */
.group {
    background-color: white;
    border: 1px solid var(--line-faint);
    border-radius: 16px;
}

/* footer buttons of a sheet: the first one is a third, the second one two thirds */
.sheet-buttons {
    display: flex;
    gap: 10px;
    padding-top: 4px;
}

.sheet-buttons {
    --button-padding: 6px;
}

.sheet-buttons > .button {
    box-sizing: border-box;
    height: 50px;
    flex: 1 1 14px;
}

.sheet-buttons > .button.primary,
.sheet-buttons > .button.danger {
    flex: 2 1 12px;
}

.tiny {
    font-size: 12px;
    color: var(--muted);
}

select,
textarea,
input:not([type="checkbox"]) {
    color: var(--ink);
    font-weight: 600;
    font-size: 16px;
}

select {
    appearance: none;
    -webkit-appearance: none;
    height: var(--select-height, 44px);
    border-radius: var(--select-radius, 12px);
    border: 1px solid var(--line-soft);
    background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a5878' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right var(--select-chevron-x, 10px) center;
    background-size: var(--select-chevron, 14px);
    padding: 0 var(--select-padding-right, 28px) 0 var(--select-padding-left, 12px);
    font-size: var(--select-font-size, 16px);
    font-weight: var(--select-font-weight, 700);
    min-width: 0;
}

textarea {
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: var(--field);
    padding: 10px 12px;
    outline: none;
}

input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    margin: 0;
    border-radius: 7px;
    border: 2px solid #9aa6bf;
    background: #fff;
    background-position: center;
    background-repeat: no-repeat;
}

input[type="checkbox"]:checked {
    border-color: var(--accent);
    background-color: var(--accent);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E");
}

input[type="radio"] {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--accent);
}

input[type="checkbox"]:disabled,
input[type="radio"]:disabled {
    opacity: 0.5;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* narrow pickers sharing a row (hour : minute, duration with units) */
.label-row > .items:has(> .compact) {
    flex: none;
    margin-left: auto;
    gap: 6px;
}

.label-row > .items > .unit {
    flex: none;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
}

.label-row > .items > .unit + .compact {
    margin-left: 6px;
}
