body {
    --focus-color: #c1c1c1;
    background-color: #181818;
    color: #c1c1c1;
    font-family: "Hiragino Sans", "Meiryo", sans-serif;
    margin: 0;
    padding: 24px;
    overflow-x: hidden;
    overflow-y: scroll;
}

h2 {
    margin: 0 0 4px;
    font-size: 19px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

#app {
    max-width: 860px;
    margin: 0 auto;
}

.container {
    box-sizing: border-box;
    position: relative;
    display: block;
    margin-top: 20px;
    padding: 0px 16px 24px 16px;
    background: #363636;
    border: 1px solid #333;
    border-radius: 6px;
    font-size: 30px;
    line-height: 1;
    color: #c1c1c1;
    width: 100%;
}

#jpText {
    position: relative;
    z-index: 1;
    line-height: 2.8;
    font-weight: 200;
    margin-top: 10px;
    margin-bottom: 24px;
}

#jpText:focus {
    outline: none;
}

.gloss-layer {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.gloss {
    position: absolute;
    pointer-events: auto;
    font-size: 12px;
    line-height: 13px;
    max-height: 39px;
    overflow: hidden;
    cursor: default;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    z-index: 2;
}

.gloss:hover {
    background: #363636;
    max-height: none;
    overflow: visible;
    z-index: 3;
}

body.has-jp-text-selection .gloss {
    pointer-events: none;
}

body.has-jp-text-selection .gloss:hover {
    background: transparent;
    max-height: 39px;
    overflow: hidden;
    z-index: 2;
}

.underlined {
    display: inline-block;
    position: relative;
    text-decoration: none;
}

.underlined::before,
.underlined::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    pointer-events: none;
}

.underlined::before {
    bottom: 0.81em;
    height: 1.6px;
    background: currentColor;
}

.underlined::after {
    bottom: calc(0.81em - 2.2px);
    height: 6px;
    border-radius: 999px;
    background:
        radial-gradient(
            circle 3px at left center,
            currentColor 99%,
            transparent 100%
        ),
        radial-gradient(
            circle 3px at right center,
            currentColor 99%,
            transparent 100%
        );
}

#controls {
    box-sizing: border-box;
    display: grid;
    gap: 4px;
}

input,
textarea {
    box-sizing: border-box;
    width: 100%;
    font-weight: 300 !important;
    min-width: 0;
    padding: 2px 4px;
    border: 2px solid transparent;
    border-radius: 0;
    font: inherit;
    line-height: 16px;
    background-color: #f0f0f0;
    transition:
        background-color 120ms ease,
        border-color 120ms ease,
        box-shadow 120ms ease;
}

input:not([type="checkbox"]):focus,
textarea:focus {
    outline: none;
    border-color: var(--focus-color);
    background-color: #ffffff;
    box-shadow:
        0 0 0 2px #181818,
        0 0 0 4px var(--focus-color);
    caret-color: #111;
}

input {
    height: 22px;
}

textarea {
    min-height: 52px;
    resize: vertical;
}

#textInput + #addText {
    height: 52px;
}

.checkboxContainer {
    display: flex;
    align-items: center; /* Forces all children to the exact vertical center */
    height: 24px; /* Or whatever height your div has */
    gap: 8px; /* Adds clean spacing between box and text */
}

input[type="checkbox"] {
    width: auto;
    margin: 0;
}

label {
    margin: 0;
}

button {
    box-sizing: border-box;
    width: 88px;
    height: 22px;
    padding: 2px 8px;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 0px;
    font: inherit;
    font-size: 12px;
    line-height: 16px;
    color: #111;
    background-color: #f0f0f0;
    appearance: none;
    -webkit-appearance: none;
}

button:disabled {
    color: #777;
    background-color: #bdbdbd;
    cursor: default;
}

.control-row {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 88px;
    gap: 4px;
    width: 100%;
}

rt {
    color: #878787 !important;
}

.color-picker-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.color-square {
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.red {
    color: #ff7474;
}

.orange {
    color: orange;
}

.yellow {
    color: #ffff4a;
}

.green {
    color: #64b564;
}

.blue {
    color: rgb(45, 213, 255);
}

.violet {
    color: violet;
}

.redBg {
    background-color: #ff7474;
}

.orangeBg {
    background-color: orange;
}

.yellowBg {
    background-color: #ffff4a;
}

.greenBg {
    background-color: #64b564;
}

.blueBg {
    background-color: rgb(45, 213, 255);
}

.violetBg {
    background-color: violet;
}

.selected {
    text-decoration: underline;
    text-decoration-thickness: 1.6px;
    text-underline-offset: 4px;
}

label {
    font-size: 12px;
}

table {
    width: 549px;
    border: 1px grey solid;
}

td:first-child,
.column:first-child {
    padding-right: 5px;
}

.letter {
    font-weight: bold;
}

#lastSelectionTextPreview {
    padding-left: 3px;
    font-size: 12px;
    margin-top: 3px;
}

summary {
    font-size: 12px;
}
