*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

::selection {
    background: var(--theme-selection-1-bg);
    color: var(--theme-selection-2-text);
}

#application-titlebar {
    -webkit-app-region: drag;
    height: 38px;
    width: 100%;

    left: 0;
    top: 0;
    position: fixed;

    display: flex;
    align-items: center;
    justify-content: center;
}

.app-title {
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 1.8rem;
    letter-spacing: -0.8px;
    line-height: 0;
    color: var(--theme-text-1-default);

    font-family: 'system-ui', sans-serif;
    z-index: 3;
    position: relative;
}

body {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Consolas', 'Leelawadee', monospace;

    background-color: var(--theme-bg-1-default);
    background-image: 
        linear-gradient(0deg, transparent 24%, var(--theme-grid-1-overlay) 25%, var(--theme-grid-1-overlay) 26%, transparent 27%, transparent 74%, var(--theme-grid-1-overlay) 75%, var(--theme-grid-1-overlay) 76%, transparent 77%, transparent),
        linear-gradient(90deg, transparent 24%, var(--theme-grid-1-overlay) 25%, var(--theme-grid-1-overlay) 26%, transparent 27%, transparent 74%, var(--theme-grid-1-overlay) 75%, var(--theme-grid-1-overlay) 76%, transparent 77%, transparent);
    background-size: 50px 50px;
    
    color: var(--theme-text-1-default);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 4rem 1.2rem;
}

.today-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.date-label {
    font-size: 12px;
    color: var(--theme-text-2-default);
    letter-spacing: 0.3px;
}

/* Editor mask - subtle gradient placed behind the editor to darken background */
.editor-mask {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: linear-gradient(to bottom, var(--theme-mask-1-start) 0%, var(--theme-mask-2-mid) 40%, var(--theme-mask-3-end) 100%);
    z-index: 2;
    height: 150px;
}

.editor-mask-top {
    position: fixed;
    left: 0;
    right: 0;
    top: 0px;
    pointer-events: none;
    background: linear-gradient(to top, var(--theme-mask-1-start) 0%, var(--theme-mask-2-mid) 40%, var(--theme-mask-3-end) 100%);
    z-index: 2;
    height: 150px;
}

.input-message {
    display: flex;

    position: fixed;
    z-index: 3;
    left: 50%;
    transform: translateX(-50%);
    bottom: 14px;

    width: 90%;
    max-width: 450px;
}

.writing-surface {
    background: var(--theme-bg-2-default);
    border: 1.5px solid var(--theme-border-1-default);
    color: var(--theme-text-1-default);
    box-shadow: var(--shadow);
    border-radius: 0px;

    font-family: inherit;
    letter-spacing: 0px;
    font-size: 12.5px;
    padding: 1.15rem;

    min-height: 48px;
    width: 100%;

    resize: none;
    outline: none;
    transition: 200ms all ease;

    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.writing-surface::placeholder {
    color: var(--theme-text-3-default);
}

.writing-surface:focus {
    border-color: var(--theme-border-3-default);
    background-color: var(--theme-bg-3-default);
}

.writing-surface:disabled {
    cursor: not-allowed;
    background: var(--theme-bg-1-default);
    color: var(--theme-text-4-disabled);
    font-style: italic;

    &::placeholder {
        color: var(--theme-text-4-disabled);
        font-style: italic;
    }
}

.commit-button {
    background-color: transparent;
    border: none;
    outline: none;

    padding: 0.5rem 0.5rem;
    border-radius: 100vmax;

    line-height: 0;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.3px;

    position: fixed;
    right: 0.8rem;
    top: 0.6rem;

    & svg {
        fill: var(--theme-text-3-default);
    }
}

.commit-button:hover:not(:disabled) {
    background: var(--theme-bg-4-hover);
    border-color: var(--theme-border-2-default);
}

.commit-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.committed-notice {
    color: var(--theme-text-2-default);
    font-size: 12px;
    letter-spacing: 0.3px;
}

.history-section {
    margin-top: 2rem;
}

.history-title {
    font-size: 12.5px;
    color: var(--theme-text-2-default);
    letter-spacing: 0.3px;
}

.history-entry {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--theme-border-4-subtle);
}

.history-entry:last-child {
    border-bottom: none;
}

.history-date {
    font-size: 12px;
    color: var(--theme-text-2-default);
    margin-bottom: 1rem;
    letter-spacing: 0.3px;
}

.history-text {
    font-size: 14px;
    line-height: 1.4;
    box-shadow: var(--shadow);
    user-select: text;
    -webkit-user-select: text;

    color: var(--theme-text-3-default);
    background-color: var(--theme-bg-2-default);
    border: solid 1px var(--theme-border-1-default);
    border-radius: 0px;
    
    padding: 1.15rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.history-empty {
    font-size: 14px;
    font-style: italic;
    display: none;
}

.history-timestamp {
    font-size: 12px;
    margin-top: 1rem;
    letter-spacing: 0.2px;
}