:root {
    color-scheme: dark;
    --bg: #070b14;
    --sidebar: #0b1220;
    --card: #121a2b;
    --card-2: #162033;
    --text: #f4f7fb;
    --muted: #8b97ad;
    --line: rgba(148, 163, 184, 0.14);
    --teal: #2dd4bf;
    --teal-deep: #0f766e;
    --purple: #c084fc;
    --pink: #e879f9;
    --blue: #3b82f6;
    --gold: #fbbf24;
    --danger: #ef4444;
    --focus: #5eead4;
}

* { box-sizing: border-box; }

[hidden] {
    display: none !important;
}

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, textarea, select {
    font: inherit;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.mark {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    display: block;
    object-fit: cover;
    box-shadow: 0 10px 28px rgba(88, 40, 160, 0.4);
}

.mark.small {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    box-shadow: none;
}

.login-view {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(900px 420px at 12% -8%, rgba(45, 212, 191, 0.12), transparent 55%),
        radial-gradient(800px 380px at 100% 0%, rgba(192, 132, 252, 0.12), transparent 50%),
        var(--bg);
}

.login-card {
    width: min(420px, 100%);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 28px 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.login-brand .mark {
    width: 48px;
    height: 48px;
    border-radius: 14px;
}

.login-card h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
}

.lead, .empty, .muted {
    color: var(--muted);
}

.login-card form,
.login-card label {
    display: grid;
    gap: 6px;
}

.login-card form { gap: 14px; margin-top: 20px; }

label span {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--purple);
}

input, textarea, select {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(7, 11, 20, 0.72);
    color: var(--text);
    outline: none;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18);
}

.login-actions, .note-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

button {
    border: 0;
    border-radius: 12px;
    padding: 9px 14px;
    cursor: pointer;
    font-weight: 700;
}

button[type="submit"], .primary {
    background: linear-gradient(135deg, #2dd4bf, #2563eb);
    color: #06201c;
}

button[type="button"] {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

button.danger {
    background: transparent;
    color: #fca5a5;
}

button:disabled { opacity: 0.6; cursor: wait; }

.icon-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border-radius: 10px;
}

.danger-icon {
    color: #f87171;
    background: rgba(239, 68, 68, 0.12);
}

.error, .banner {
    margin: 0;
    color: #ffb4ab;
    font-weight: 600;
}

.banner {
    margin: 0 24px 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.12);
}

.app-view {
    --sidebar-width: 268px;
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-width) 8px 1fr;
}

.app-view.is-resizing {
    cursor: col-resize;
    user-select: none;
}

.app-view.is-resizing * {
    cursor: col-resize !important;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    min-width: 0;
    overflow: auto;
    background: var(--sidebar);
    padding: 18px 14px 28px;
}

.sidebar-resizer {
    position: sticky;
    top: 0;
    z-index: 3;
    height: 100vh;
    width: 8px;
    margin-left: -4px;
    cursor: col-resize;
    background: transparent;
    touch-action: none;
}

.sidebar-resizer::after {
    content: "";
    display: block;
    width: 2px;
    height: 100%;
    margin: 0 auto;
    background: var(--line);
    transition: background 0.15s ease, width 0.15s ease;
}

.sidebar-resizer:hover::after,
.sidebar-resizer:focus-visible::after,
.app-view.is-resizing .sidebar-resizer::after {
    width: 3px;
    background: var(--teal);
}

.sidebar-resizer:focus-visible {
    outline: none;
}

.app-view.is-compact .sidebar-brand > div {
    display: none;
}

.app-view.is-compact .sidebar-brand {
    justify-content: center;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 18px;
}

.sidebar-brand h1 {
    margin: 0;
    font-size: 16px;
    letter-spacing: 0.01em;
}

.sidebar-brand p {
    margin: 2px 0 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.sidebar-nav {
    display: grid;
    gap: 18px;
}

.nav-section {
    display: grid;
    gap: 4px;
}

.nav-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 10px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.nav-add {
    width: 22px;
    height: 22px;
    padding: 0;
    border-radius: 7px;
    background: rgba(45, 212, 191, 0.12);
    color: var(--teal);
    font-size: 16px;
    line-height: 1;
}

.nav-item,
.nav-child {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-align: left;
    background: transparent;
    color: #d5deee;
    font-weight: 600;
    border-radius: 10px;
    padding: 8px 10px;
}

.nav-item:hover,
.nav-child:hover {
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.is-active,
.nav-child.is-active {
    background: rgba(45, 212, 191, 0.16);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.28);
}

.nav-item .count,
.nav-child .count,
.nav-site-head .count {
    margin-left: auto;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.nav-item.is-active .count,
.nav-child.is-active .count {
    color: var(--teal);
}

.nav-glyph {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    opacity: 0.85;
}

.nav-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-actions {
    display: flex;
    gap: 2px;
    margin-left: 4px;
}

.nav-actions button {
    width: 22px;
    height: 22px;
    padding: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
}

.folder-form {
    display: flex;
    gap: 6px;
    padding: 4px 6px 8px;
}

.folder-form input {
    padding: 7px 9px;
    border-radius: 9px;
}

.nav-folder {
    display: grid;
    gap: 2px;
}

.nav-folder-children {
    display: none;
    gap: 2px;
    padding: 0 0 4px 8px;
}

.nav-folder.is-open > .nav-folder-children {
    display: grid;
}

.nav-toggle {
    width: 18px;
    height: 18px;
    padding: 0;
    flex: 0 0 18px;
    display: grid;
    place-items: center;
    background: transparent;
    color: var(--muted);
    border-radius: 6px;
}

.nav-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.nav-toggle.is-empty {
    visibility: hidden;
}

.nav-folder.is-open > .nav-item .chevron {
    transform: rotate(90deg);
}

.nav-site {
    display: grid;
    gap: 2px;
}

.nav-site-head {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    background: transparent;
    color: #d5deee;
    font-weight: 600;
    border-radius: 10px;
    padding: 8px 8px;
    text-align: left;
}

.nav-site-head:hover { background: rgba(255, 255, 255, 0.05); }
.nav-site-head.is-active {
    background: rgba(45, 212, 191, 0.16);
    color: #fff;
}

.chevron {
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    opacity: 0.55;
    transition: transform 0.15s ease;
}

.nav-site.is-open .chevron {
    transform: rotate(90deg);
}

.nav-children {
    display: none;
    padding: 0 0 4px 18px;
    gap: 2px;
}

.nav-site.is-open .nav-children {
    display: grid;
}

.nav-child {
    font-size: 13px;
    font-weight: 500;
    color: #b7c3d8;
    padding: 6px 8px;
}

.workspace {
    min-width: 0;
    background:
        radial-gradient(900px 380px at 80% -10%, rgba(192, 132, 252, 0.08), transparent 50%),
        var(--bg);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 16px 24px;
    background: rgba(7, 11, 20, 0.88);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
}

.page-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.page-heading h2 {
    margin: 0;
    font-size: 18px;
}

.page-heading p {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--muted);
}

.menu-toggle { display: none; }

.search {
    max-width: 520px;
    justify-self: center;
    width: 100%;
    position: relative;
}

.tag-suggest {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 5;
    display: grid;
    gap: 2px;
    padding: 6px;
    border-radius: 12px;
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.tag-suggest button {
    width: 100%;
    text-align: left;
    background: transparent;
    color: var(--teal);
    font-weight: 700;
}

.tag-suggest button:hover {
    background: rgba(45, 212, 191, 0.12);
}

.account {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-self: end;
}

.sort-control select {
    min-width: 132px;
    padding: 6px 8px;
    font-size: 12px;
    font-weight: 650;
    border-radius: 8px;
}

button.sort-dir {
    width: 32px;
    height: 32px;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
}

button.sort-dir.is-asc svg {
    transform: rotate(180deg);
}

button.sort-dir:hover,
button.sort-dir:focus-visible {
    color: var(--text);
    background: rgba(255, 255, 255, 0.1);
}

.view-switch {
    display: flex;
    padding: 3px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line);
}

button.view-btn {
    width: 32px;
    height: 28px;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
}

button.view-btn:hover,
button.view-btn:focus-visible {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

button.view-btn.is-active {
    background: rgba(45, 212, 191, 0.16);
    color: var(--teal);
}

.account-copy {
    display: grid;
    text-align: right;
}

.account-copy strong {
    font-size: 14px;
}

#account-email {
    color: var(--muted);
    font-size: 12px;
}

.notes {
    display: grid;
    gap: 8px;
    padding: 12px 16px 32px;
}

.notes.is-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.notes.is-list {
    grid-template-columns: repeat(auto-fill, minmax(64mm, 1fr));
    gap: 4px 8px;
}

.notes.is-list .note-card {
    align-items: start;
    gap: 2px;
    padding: 8px 12px;
}

.notes.is-list .note-card .body {
    -webkit-line-clamp: 1;
    display: block;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.notes.is-list .note-card.is-editing {
    grid-template-columns: 1fr;
    align-items: stretch;
}

.note-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "quote tools"
        "body  body"
        "tags  tags";
    align-content: start;
    align-items: start;
    gap: 4px 8px;
    padding: 10px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: default;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.note-card[role="link"] {
    cursor: pointer;
}

.note-card:hover,
.note-card:focus-visible {
    border-color: rgba(45, 212, 191, 0.38);
    background: var(--card-2);
    outline: none;
}

.note-card.is-editing {
    cursor: default;
    padding: 10px;
    gap: 8px;
}

.note-card:has(.note-badge) {
    grid-template-areas:
        "badge tools"
        "quote tools"
        "body  body"
        "tags  tags";
}

.note-badge {
    grid-area: badge;
}

.note-card .quote {
    grid-area: quote;
    min-width: 0;
}

.note-card .body {
    grid-area: body;
    min-width: 0;
}

.note-card .note-tags {
    grid-area: tags;
}

.note-card-tools {
    grid-area: tools;
    position: static;
    display: flex;
    flex-shrink: 0;
    gap: 2px;
}

button.note-icon-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
}

button.note-icon-btn:hover,
button.note-icon-btn:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

button.note-icon-btn.view:hover,
button.note-icon-btn.view:focus-visible {
    background: rgba(45, 212, 191, 0.16);
    color: #99f6e4;
}

button.note-icon-btn.edit:hover,
button.note-icon-btn.edit:focus-visible {
    background: rgba(168, 85, 247, 0.16);
    color: #e9d5ff;
}

button.note-icon-btn.delete:hover,
button.note-icon-btn.delete:focus-visible {
    background: rgba(239, 68, 68, 0.16);
    color: #fca5a5;
}

.note-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 0;
}

button.note-tag {
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(45, 212, 191, 0.12);
    color: #99f6e4;
    font-size: 10px;
    font-weight: 700;
}

.note-tags-input {
    width: 100%;
    padding: 6px 8px;
    font-size: 12px;
}

.note-card .quote,
.note-card .body {
    margin: 0;
    overflow: hidden;
}

.note-card .quote {
    padding: 0;
    background: none;
    color: var(--text);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.3;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.note-card .body {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
}

.note-card textarea {
    min-height: 72px;
    resize: vertical;
    font-size: 13px;
}

.note-card .folder-move {
    display: grid;
    gap: 6px;
}

.note-card .folder-move span {
    color: var(--muted);
}

.category-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

button.category-tag {
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(192, 132, 252, 0.16);
    color: #e9d5ff;
    font-size: 12px;
    font-weight: 700;
}

.category-actions {
    display: flex;
    gap: 6px;
}

.category-actions button {
    padding: 6px 10px;
    font-size: 12px;
}

.note-card:not(.is-editing) .note-actions {
    display: none;
}

.note-actions {
    gap: 6px;
}

.note-actions button {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 8px;
}

.dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(4, 8, 16, 0.62);
}

.dialog {
    width: min(380px, 100%);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.dialog.note-view {
    width: min(560px, 100%);
}

.note-view-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.note-view-head h3 {
    margin: 0;
    font-size: 16px;
    line-height: 1.3;
}

.note-view-quote,
.note-view-body,
.note-view-meta {
    margin: 0 0 12px;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.note-view-quote {
    color: #99f6e4;
    font-size: 14px;
}

.note-view-body {
    font-size: 14px;
}

.note-view-meta {
    color: var(--muted);
    font-size: 12px;
    white-space: normal;
}

.note-view .note-tags {
    margin-bottom: 12px;
}

.note-tag {
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(45, 212, 191, 0.12);
    color: #99f6e4;
    font-size: 10px;
    font-weight: 700;
}

.dialog p {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 650;
    line-height: 1.4;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

button.danger-solid {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: #fff;
}

.empty {
    padding: 80px 24px;
    text-align: center;
}

.sidebar-backdrop {
    display: none;
}

button.new-note-btn {
    padding: 7px 12px;
    border-radius: 10px;
    background: linear-gradient(135deg, #2dd4bf, #2563eb);
    color: #06201c;
    font-size: 12px;
    white-space: nowrap;
}

.note-card.is-daily {
    padding-left: 10px;
}

.note-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(251, 191, 36, 0.16);
    color: #fbbf24;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.note-card.is-pinned {
    border-color: rgba(251, 191, 36, 0.35);
}

.note-card.is-dragging {
    opacity: 0.5;
}

.nav-item.is-drop {
    outline: 1px dashed var(--teal);
    background: rgba(45, 212, 191, 0.14);
}

button.note-icon-btn.pin.is-on,
button.note-icon-btn.pin:hover,
button.note-icon-btn.pin:focus-visible {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.14);
}

.daily-editor {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(4, 8, 16, 0.62);
}

.daily-editor-panel {
    width: min(840px, 100%);
    height: min(780px, calc(100vh - 48px));
    display: grid;
    grid-template-rows: auto auto auto 1fr;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.daily-editor-top {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto auto auto auto;
    gap: 8px;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
}

#daily-folder {
    max-width: 160px;
    padding: 6px 8px;
    font-size: 12px;
    font-weight: 650;
}

#daily-title {
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 6px 4px;
    font-size: 20px;
    font-weight: 700;
}

.daily-edited {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}

#daily-pin.is-on {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.14);
}

#daily-save:hover,
#daily-save:focus-visible {
    background: rgba(45, 212, 191, 0.16);
    color: #99f6e4;
}

#daily-save.is-saved {
    color: #5eead4;
    background: rgba(45, 212, 191, 0.14);
}

.daily-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px;
    padding: 7px 12px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
}

.daily-toolbar button,
.daily-toolbar select,
.daily-color {
    border: 0;
    border-radius: 8px;
    min-width: 28px;
    height: 28px;
    padding: 0 7px;
    display: inline-grid;
    place-items: center;
    background: transparent;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.daily-toolbar button:hover,
.daily-toolbar select:hover,
.daily-color:hover,
.daily-toolbar button.is-active {
    background: rgba(45, 212, 191, 0.16);
    color: var(--teal);
}

.tb-sep {
    width: 1px;
    height: 18px;
    margin: 0 4px;
    background: var(--line);
}

.tb-more-wrap {
    position: relative;
}

.tb-more-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 6;
    display: grid;
    gap: 4px;
    min-width: 160px;
    padding: 8px;
    border-radius: 12px;
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.tb-more-menu button {
    justify-content: start;
    height: auto;
    padding: 6px 8px;
}

#daily-format-toggle.is-collapsed svg {
    transform: rotate(-90deg);
}

.daily-toolbar select {
    padding: 5px 6px;
}

.daily-color {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.daily-color input {
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    background: transparent;
}

.daily-source {
    display: grid;
    gap: 6px;
    padding: 10px 16px 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(56, 189, 248, 0.06);
}

.daily-source-quote {
    margin: 0;
    color: #99f6e4;
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.daily-source-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: baseline;
    color: var(--muted);
    font-size: 12px;
}

#daily-source-link {
    color: #7dd3fc;
    font-weight: 650;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

#daily-source-link:hover {
    text-decoration: underline;
}

.daily-source-tags {
    width: min(360px, 100%);
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 12px;
}

.daily-body {
    min-height: 0;
    overflow: auto;
    padding: 20px 24px 32px;
    outline: none;
    font-size: 16px;
    line-height: 1.6;
}

.daily-body:empty::before {
    content: attr(data-placeholder);
    color: var(--muted);
}

.daily-body h1 { font-size: 28px; margin: 0 0 12px; }
.daily-body h2 { font-size: 22px; margin: 0 0 10px; }
.daily-body h3 { font-size: 18px; margin: 0 0 8px; }
.daily-body ul,
.daily-body ol { margin: 0 0 12px; padding-left: 22px; }
.daily-body a { color: var(--teal); }
.daily-body .daily-check {
    list-style: none;
    padding-left: 4px;
}
.daily-body .daily-check li {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.note-preview {
    max-height: 2.7em;
    overflow: hidden;
    pointer-events: none;
    font-size: 12px;
    line-height: 1.35;
    color: var(--muted);
}

.note-preview * {
    display: inline;
    margin: 0;
    padding: 0;
    font-size: inherit;
    font-weight: inherit;
}

.pin-mark {
    font-size: 11px;
}

.note-view-html {
    margin: 0 0 12px;
    overflow-wrap: anywhere;
    font-size: 14px;
    line-height: 1.55;
}

.note-menu {
    position: fixed;
    z-index: 60;
    min-width: 220px;
    padding: 6px;
    border-radius: 12px;
    background: #121a2b;
    border: 1px solid var(--line);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.note-menu button {
    width: 100%;
    display: block;
    text-align: left;
    background: transparent;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 13px;
    font-weight: 600;
}

.note-menu button:hover,
.note-menu button:focus-visible {
    background: rgba(45, 212, 191, 0.12);
    color: var(--text);
    outline: none;
}

.note-menu button.is-danger {
    color: #fca5a5;
}

.note-menu button.is-danger:hover,
.note-menu button.is-danger:focus-visible {
    background: rgba(239, 68, 68, 0.14);
}

.note-menu-sep {
    height: 1px;
    margin: 5px 6px;
    background: var(--line);
}

.note-menu-sub {
    position: relative;
}

.note-menu-flyout {
    display: none;
    position: absolute;
    left: calc(100% + 4px);
    top: 0;
    min-width: 180px;
    max-height: 240px;
    overflow: auto;
    padding: 6px;
    border-radius: 12px;
    background: #121a2b;
    border: 1px solid var(--line);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.note-menu-sub:hover .note-menu-flyout,
.note-menu-sub:focus-within .note-menu-flyout {
    display: grid;
}

button.note-icon-btn.share:hover,
button.note-icon-btn.share:focus-visible,
button.note-icon-btn.share.is-on {
    background: rgba(56, 189, 248, 0.16);
    color: #7dd3fc;
}

.note-card.is-shared,
.nav-item.is-shared {
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.22);
}

.share-mark {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    color: #7dd3fc;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    vertical-align: middle;
}

.note-card .share-mark {
    font-size: 0;
    margin-left: 4px;
}

.share-mark svg {
    width: 11px;
    height: 11px;
}

.nav-item .share-mark {
    margin-left: 0;
    flex: 0 0 auto;
    font-size: 0;
}

.share-popover {
    position: fixed;
    z-index: 70;
    width: min(280px, calc(100vw - 16px));
    padding: 12px;
    border-radius: 12px;
    background: #121a2b;
    border: 1px solid var(--line);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    display: grid;
    gap: 8px;
}

.share-popover-title {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
}

.share-popover input,
.share-popover select {
    width: 100%;
    padding: 7px 9px;
    border-radius: 9px;
    font-size: 13px;
}

.share-popover-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.share-popover-actions button {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 8px;
}

.share-error {
    margin: 0;
    color: #fca5a5;
    font-size: 12px;
}

.access-list {
    display: grid;
    gap: 6px;
    max-height: 240px;
    overflow: auto;
}

.access-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 4px;
    align-items: center;
}

.access-row span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
}

.access-row select {
    width: auto;
    max-width: 108px;
    padding: 4px 6px;
    font-size: 11px;
}

.access-row button {
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
}

.access-owner {
    color: var(--muted);
    font-size: 12px;
}

.view-share {
    display: grid;
    gap: 4px;
    margin: 0 0 12px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(56, 189, 248, 0.08);
    font-size: 12px;
    color: var(--muted);
}

.view-share strong {
    color: var(--text);
    font-weight: 700;
}

.daily-editor.is-readonly .daily-toolbar,
.daily-editor.is-readonly #daily-folder,
.daily-editor.is-readonly #daily-save,
.daily-editor.is-readonly #daily-pin,
.daily-editor.is-readonly #daily-delete {
    display: none;
}

.daily-editor.is-readonly #daily-title,
.daily-editor.is-readonly #daily-body {
    pointer-events: none;
}

@media (max-width: 980px) {
    .app-view {
        grid-template-columns: 1fr;
    }
    .sidebar-resizer {
        display: none;
    }
    .menu-toggle { display: grid; }
    .topbar {
        grid-template-columns: auto 1fr auto;
    }
    .search {
        grid-column: 1 / -1;
        max-width: none;
        justify-self: stretch;
    }
    .sidebar {
        position: fixed;
        z-index: 20;
        left: 0;
        top: 0;
        width: min(300px, 88vw);
        transform: translateX(-105%);
        transition: transform 0.2s ease;
    }
    .sidebar.is-open {
        transform: none;
    }
    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 15;
        background: rgba(0, 0, 0, 0.45);
    }
}

@media (max-width: 640px) {
    .topbar {
        grid-template-columns: auto 1fr auto;
        padding: 12px;
    }
    .account-copy { display: none; }
    .notes { padding: 10px 10px 28px; gap: 6px; }
    .notes.is-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
    .notes.is-list { grid-template-columns: repeat(auto-fill, minmax(64mm, 1fr)); }
}
