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

body {
    margin: 0;
    padding: 0 2px;
    font-size: 1rem;
    font-family:
        "Noto Serif", "Noto Serif CJK JP", "Yu Mincho", "Liberation Serif", "Times New Roman", Times, Georgia, Serif;
    line-height: 1.4;
    text-align: left;
}

a {
    cursor: pointer;
}

/* Pitch accent lookup */

.ajt__pitch_lookup {
    background-color: #fffaf0;
    color: #2a1b0a;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(75px, max-content) minmax(250px, 1fr));
    row-gap: 0.2rem;
    column-gap: 0.2rem;
    font-size: 1.5rem;
}

.keyword {
    color: #582020;
    background-color: rgba(87, 43, 43, 0.1);
}

.ajt__pitch_lookup li {
    padding: 0.4rem 0.2rem;
}

.pitch_accents {
    background-color: rgba(144, 148, 113, 0.1);
}

.ajt__pitch_lookup :where(ol, ul, li) {
    list-style-type: none;
}

.pitch_accents,
.ajt__pitch_lookup li {
    display: flex;
    flex-flow: row nowrap;
    align-items: flex-start;
    column-gap: 0.4rem;
}

.ajt__pitch_lookup li:nth-of-type(2n) {
    background-color: rgba(165, 134, 126, 0.2);
}

.pitch_number {
    vertical-align: top;
    font-family:
        "Noto Sans", "Droid Sans", "DejaVu Sans", "Liberation Sans", Roboto, Cantarell, "Segoe UI", Arial, Meiryo,
        Oxygen, Ubuntu, "Helvetica Neue", Helvetica, "Noto Color Emoji", "Noto Sans CJK JP", Sans, sans-serif;
    text-align: center;
    display: inline-block;
    text-transform: lowercase;
    background-color: #333;
    color: #fffaf0;
    font-weight: bold;
    padding: 1px 3px;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 12px;
    line-height: 14px;
    user-select: none;
}

svg,
img {
    display: block;
}

.heiban :is(line, circle):not(.trail, .devoiced) {
    stroke: #3366cc;
    fill: #3366cc;
}
.atamadaka :is(line, circle):not(.trail, .devoiced) {
    stroke: red;
    fill: red;
}
.odaka :is(line, circle):not(.trail, .devoiced) {
    stroke: green;
    fill: green;
}
.nakadaka :is(line, circle):not(.trail, .devoiced) {
    stroke: #ff6207;
    fill: #ff6207;
}

/* Pitch accent lookup - dark mode */

.nightMode .ajt__pitch_lookup {
    background-color: #333;
    color: #ccc;
}
.nightMode .ajt__pitch_lookup .keyword {
    color: #ffc0cb;
}
.nightMode .ajt__pitch_lookup svg circle.devoiced {
    stroke: white;
}
.nightMode .ajt__pitch_lookup svg text {
    fill: white;
}

/* Welcome page */

.ajt__welcome h1 {
    text-align: center;
}
.ajt__welcome {
    line-height: 1.5;
}
.ajt__welcome code {
    word-break: keep-all;
    padding: 0 0.2em;
    background-color: #f3f3f3;
    border-radius: 4px;
    outline: 1px solid #ccc;
}
.ajt__welcome p + p {
    margin-top: 1rem;
}

/* Welcome page - dark mode */

.nightMode .ajt__welcome code {
    color: #ccc;
    background-color: #444;
    outline: 1px solid #4f4f4f;
}
