:root {
    color-scheme: light;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #232135;
    background: #f6f5f9;
    --accent: #6346bd;
    --ink: #232135;
    --muted: #656177;
    --line: #e9e5ef;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.lockscreen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: radial-gradient(ellipse at 50% 28%, #eee6ff, #f6f5f9 65%);
}
.login-card {
    width: min(100%, 410px);
    padding: 36px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 20px 60px #36266313;
}
.brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 10px;
    background: var(--accent);
}
.brand-mark span {
    display: block;
    width: 13px;
    height: 16px;
    border: 1.5px solid #fff;
    border-radius: 3px;
    background: linear-gradient(#fff, #fff) center 4px / 5px 1px no-repeat,
        linear-gradient(#fff, #fff) center 8px / 5px 1px no-repeat;
}
.login-card .brand-mark { width: 48px; height: 48px; border-radius: 14px; }
.login-card .brand-mark span { transform: scale(1.25); }
.login-card h1 { margin: 20px 0 6px; font-size: 30px; letter-spacing: -.045em; }
.login-card p { margin: 0 0 25px; color: var(--muted); line-height: 1.5; }
.login-card .login-error { color: #922a47; margin: -10px 0 16px; }
.login-card label { display: block; margin-bottom: 8px; font-weight: 650; font-size: .88rem; }
.login-card input {
    width: 100%;
    min-height: 47px;
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid #dcd6e9;
    border-radius: 9px;
}
.primary {
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 13px;
    border: 0;
    border-radius: 9px;
    background: var(--accent);
    color: #fff;
    font-weight: 650;
}
.primary:hover { background: #51359c; }

.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.topbar-inner {
    width: min(1120px, 100% - 46px);
    min-height: 66px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 720; letter-spacing: -.02em; }
.quiet {
    min-height: 34px;
    padding: 4px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-weight: 600;
    font-size: .83rem;
}
.quiet:hover, .toolbar button:hover { background: #f2edf9; }
.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 285px;
    align-items: start;
    gap: 20px;
    width: min(1120px, 100% - 46px);
    margin: 32px auto;
}
.notebook, .task-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 7px 24px #30224c08;
}
.notebook-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 22px 24px 16px;
}
.notebook-heading h1 { margin: 0; font-size: 30px; letter-spacing: -.045em; }
.save-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
#status { color: var(--muted); font-size: .8rem; }
#status.problem { color: #922a47; }
.toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 15px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #faf9fc;
}
.toolbar button {
    min-width: 34px;
    min-height: 35px;
    padding: 0 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ink);
    font-size: .86rem;
}
.toolbar .task-tool { margin-left: auto; background: #eee7ff; color: #4f32a0; font-weight: 680; }
.sub { font-size: .73em; }
.divider { height: 20px; width: 1px; margin: 0 3px; background: var(--line); }
#editor {
    min-height: 52vh;
    padding: 21px 24px 34px;
    line-height: 1.72;
    caret-color: var(--accent);
    overflow-wrap: anywhere;
}
#editor:focus { outline: none; }
#editor:focus-visible { box-shadow: inset 3px 0 #eee7ff; }
#editor h2 { margin: .65em 0 .3em; font-size: 1.5rem; line-height: 1.3; }
#editor a { color: #52329d; text-decoration: underline; }
#editor [data-task] {
    display: block;
    position: relative;
    min-height: 31px;
    padding-left: 42px;
    margin-block: 3px;
}
#editor [data-task="done"] .task-text { color: var(--muted); text-decoration: line-through; }
#editor .dragging { opacity: .45; }
.task-handle, .task-toggle { position: absolute; top: .25em; user-select: none; }
.task-handle { left: 0; color: var(--muted); cursor: grab; }
.task-toggle {
    left: 17px;
    width: 19px;
    height: 19px;
    padding: 0;
    border: 1px solid #8274a1;
    border-radius: 5px;
    background: #fff;
    color: #fff;
    line-height: 1;
    font-size: .82rem;
}
.task-toggle[aria-checked="true"] { border-color: var(--accent); background: var(--accent); }
.editor-footer {
    padding: 11px 24px 14px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .8rem;
}
kbd {
    padding: 2px 4px;
    border-radius: 4px;
    background: #f2eff7;
    color: var(--ink);
}
.task-panel { padding: 18px; }
.task-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.task-heading h2 { margin: 0; font-size: 1rem; letter-spacing: -.02em; }
#task-count { padding: 3px 8px; border-radius: 6px; background: #eee7ff; color: #4f32a0; font-size: .8rem; font-weight: 680; }
#open-tasks { margin: 12px 0; padding: 0; list-style: none; }
#open-tasks:empty { margin: 0; }
.side-task {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    padding: 8px 3px;
    background: transparent;
    color: var(--ink);
    border: 0;
    text-align: left;
    line-height: 1.4;
    font-size: .88rem;
    overflow-wrap: anywhere;
}
.side-task::before { content: ''; flex: 0 0 13px; height: 13px; margin-top: 3px; border: 1px solid #8274a1; border-radius: 4px; }
.side-task:hover::before { background: #eee7ff; border-color: var(--accent); }
#empty-tasks { color: var(--muted); font-size: .86rem; line-height: 1.45; }
.add-task { color: #4f32a0; }

@media (max-width: 760px) {
    .layout { grid-template-columns: minmax(0, 1fr); margin-block: 16px; width: calc(100% - 28px); gap: 14px; }
    .topbar-inner { width: calc(100% - 28px); min-height: 58px; }
    .notebook-heading { padding: 16px; }
    .toolbar { margin-inline: 10px; }
    #editor { min-height: 42vh; padding-inline: 16px; }
    .editor-footer { padding-inline: 16px; }
}
