:root {
    font:
        16px system-ui,
        sans-serif;
    color: #252525;
    background: #faf9f6;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
}
button,
input {
    font: inherit;
}
button {
    cursor: pointer;
    padding: 0.45rem 0.7rem;
    border: 1px solid #777;
    border-radius: 4px;
    background: white;
}
.secondary {
    background: transparent;
}
.danger {
    color: #9b1c1c;
    border-color: #c99;
}
.error {
    color: #9b1c1c;
}
.login {
    display: grid;
    place-items: center;
    min-height: 100vh;
}
.login main {
    width: 22rem;
}
.login label {
    display: grid;
    gap: 0.4rem;
    margin: 1rem 0;
}
.login input {
    padding: 0.55rem;
}
.home {
    max-width: 850px;
    margin: 3rem auto;
    padding: 0 1rem;
}
.home header,
.nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.home header h1,
.nav h1 {
    margin-right: auto;
}
.home form,
.nav form {
    display: contents;
}
.stories {
    margin-top: 2rem;
}
.stories article {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 0.7rem;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #ddd;
}
.stories a {
    font-weight: 650;
    color: #234;
    text-decoration: none;
}
.stories small {
    color: #666;
}
.nav {
    height: 3.5rem;
    padding: 0 1rem;
    border-bottom: 1px solid #ddd;
}
.nav h1 {
    font-size: 1.1rem;
}
.pane-controls {
    display: flex;
    gap: 0.5rem;
}
.workspace {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr) 270px;
    height: calc(100vh - 6.5rem);
    min-height: 0;
}
.workspace.scenes-hidden {
    grid-template-columns: minmax(0, 1fr) 270px;
}
.workspace.notes-hidden {
    grid-template-columns: 230px minmax(0, 1fr);
}
.workspace.scenes-hidden.notes-hidden {
    grid-template-columns: minmax(0, 1fr);
}
.workspace.scenes-hidden #scene-pane,
.workspace.notes-hidden #notes-pane {
    display: none;
}
aside {
    padding: 1rem;
    border-right: 1px solid #ddd;
    background: #f4f2ec;
    overflow: auto;
}
aside.notes {
    border-right: 0;
    border-left: 1px solid #ddd;
    display: flex;
    flex-direction: column;
}
.editor {
    padding: 1rem;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.editor .ql-container {
    flex: 1;
    min-height: 0;
    height: auto;
    font-size: 1.05rem;
}
.notes h2 {
    font-size: 1rem;
    margin-top: 0;
}
.notes .ql-container {
    flex: 1;
    min-height: 0;
    height: auto;
    background: white;
}
.notes .ql-editor {
    white-space: pre-wrap;
}
#scene-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}
#scene-list li {
    display: flex;
    gap: 0.3rem;
    align-items: center;
    padding: 0.45rem;
    cursor: grab;
}
#scene-list li:hover {
    background: #e9e6de;
}
#scene-list a {
    flex: 1;
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
footer {
    height: 3rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 0 1rem;
    border-top: 1px solid #ddd;
    color: #666;
    font-size: 0.9rem;
}
@media (max-width: 850px) {
    .nav {
        height: auto;
        min-height: 3.5rem;
        flex-wrap: wrap;
        padding: 0.5rem 1rem;
    }
    .pane-controls {
        order: 3;
        width: 100%;
    }
    .workspace,
    .workspace.scenes-hidden,
    .workspace.notes-hidden,
    .workspace.scenes-hidden.notes-hidden {
        grid-template-columns: 1fr;
        height: auto;
    }
    .workspace aside {
        border-bottom: 1px solid #ddd;
    }
    .notes {
        border-left: 0 !important;
    }
    .editor .ql-container,
    .notes .ql-container {
        min-height: 18rem;
        height: 18rem;
        flex: none;
    }
    .stories article {
        grid-template-columns: 1fr auto auto;
    }
}
.editor .ql-editor p {
    text-indent: 2em;
}
.editor .ql-editor {
    font-family: Georgia, Cambria, "Times New Roman", serif;
    font-size: 125%;
}
