* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 16px;
    color: #202124;
    font-family: Arial, sans-serif;
}

body > p {
    max-width: 100%;
    margin: 0 auto 12px;
    padding: 10px 12px;
    text-align: center;
    border-radius: 6px;
}

button,
input,
textarea {
    font: inherit;
}

button {
    min-height: 36px;
    padding: 6px 12px;
    border: 1px solid #777;
    border-radius: 6px;
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
}

#jobList {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
    gap: 10px;
    width: 100%;
    max-width: 1000px;
    margin: 14px auto;
    font-weight: bold;
}

#jobList div:not(.jobCenter):not(.jobLower):not(.jobUpper):not(.summonUpper):not(.summonCenter) {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: auto;
    min-width: 0;
    min-height: 106px;
    height: auto;
    margin: 0;
    padding: 10px;
    border: 1px solid #777;
    border-radius: 12px;
    background-color: #fff3f3;
}

.jobUpper,
.jobLower,
.jobCenter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.jobUpper {
    min-height: 34px;
    height: auto;
}

.jobCenter {
    display: none;
    min-height: 28px;
    height: auto;
}

.jobLower {
    min-height: 36px;
    height: auto;
    gap: 12px;
}

.jobLower span,
.jobCenter span {
    width: auto;
    float: none;
    text-align: center;
}

#jobList .jobLower button {
    float: none;
    width: 44px;
    min-height: 40px;
    margin: 0;
    text-align: center;
    font-size: 20px;
}

#subtract {
    margin-left: 0;
}

#jobList button,
#workerList button,
#countyList button {
    width: auto;
}

#countyList,
#event {
    display: none;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 16px auto;
}

#countyList {
    display: flex;
}

#event {
    padding: 0 0 12px;
}

#event .row {
    width: min(100%, 520px);
    padding: 16px;
    border: 1px solid #bbb;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 12px #00000018;
}

#event input,
#event textarea {
    display: block;
    width: 100%;
    min-height: 42px;
    margin: 5px 0 10px;
    padding: 8px;
    border: 1px solid #999;
    border-radius: 5px;
}

#event textarea {
    min-height: 100px;
    resize: vertical;
}

.error {
    display: none;
    color: #b00020;
}

.fc-day-today {
    background: white !important;
}

.fc-highlight {
    background-color: green !important;
}

input[type='number'] {
    width: 26%;
}

#confirmEvent {
    margin-top: 5px;
}

#calendar[hidden] {
    display: none !important;
}

#calendar {
    width: 100%;
    max-width: 1200px;
    margin: 12px auto;
}

.info {
    position: sticky;
    top: 8px;
    z-index: 2;
    width: fit-content;
    max-width: 100%;
    margin: 0 0 10px auto;
    padding: 8px 10px;
    border-radius: 6px;
    background-color: #c4f391e0;
}

.instruction {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 16px 0;
    color: #960505;
    font-weight: bold;
    text-align: center;
}

.instr {
    display: none;
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 5;
    padding: 12px 44px 12px 12px;
    border-radius: 8px;
    background-color: #b8f5baf5;
    box-shadow: 0 2px 12px #0004;
}

.instr #closeInstr {
    position: absolute;
    top: 6px;
    right: 6px;
}

#toCalendar {
    display: block;
    margin: 14px auto;
    padding: 8px 20px;
}

.confirm {
    position: fixed;
    inset: 0;
    z-index: 7;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 16px;
    background: #00000033;
}

.confirm > div {
    width: min(100%, 420px);
    padding: 18px;
    border-radius: 10px;
    background-color: white;
    box-shadow: 0 4px 24px #0005;
}

#toConfirm,
#backToCalendar,
#backToServices,
#back,
#confirmEvent {
    padding: 8px 14px;
}

#backToServices,
#back {
    display: none;
    margin: 8px auto;
}

#background {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 6;
    background-color: #0000001f;
}

#done {
    display: none;
    justify-content: center;
    align-items: center;
    margin: 60px auto;
    font-size: 20px;
    text-align: center;
}

.getInContactMsg {
    display: none;
    justify-content: center;
    align-items: center;
    margin: 12px auto;
    color: #b00020;
    text-align: center;
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .fc .fc-toolbar {
        flex-wrap: wrap;
        gap: 6px;
    }

    .fc .fc-toolbar-title {
        font-size: 1.15em;
    }

    .fc .fc-button {
        padding: 0.3em 0.45em;
    }

    #event .row {
        padding: 12px;
    }

    .info {
        position: sticky;
        top: 4px;
    }
}
