/* Editorial layer — shared by the home page (body.landing) and the todoos page (body.workspace),
   including the todoo view page. Loaded after marketing.css so it can restyle without touching it. */

body.landing,
body.workspace {
    --ed-serif: 'Poppins', sans-serif;
    --ed-line: color-mix(in srgb, var(--text-color) 14%, transparent);
    --ed-mute: color-mix(in srgb, var(--text-color) 58%, transparent);
    --ed-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --landing-line: var(--ed-line);
    --gx: 50vw;
    --gy: 30vh;
}

/* ---------- Atmosphere ---------- */
.ed-aurora {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.ed-blob {
    position: absolute;
    width: 52vmax;
    height: 52vmax;
    border-radius: 50%;
    background: var(--theme-color);
    filter: blur(110px);
    will-change: transform;
}

/* Two dim corner glows in the theme color only, like the settings overlay */
.ed-blob--a {
    top: -26vmax;
    left: -18vmax;
    opacity: 0.2;
    animation: ed-drift-a 30s ease-in-out infinite alternate;
}

.ed-blob--b {
    right: -22vmax;
    bottom: -26vmax;
    opacity: 0.11;
    animation: ed-drift-b 36s ease-in-out infinite alternate;
}

.ed-blob--c {
    display: none;
}

[data-theme="dark"] .ed-blob--a { opacity: 0.16; }
[data-theme="dark"] .ed-blob--b { opacity: 0.09; }

.ed-glow {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(
        420px circle at var(--gx) var(--gy),
        color-mix(in srgb, var(--theme-color) 7%, transparent),
        transparent 70%
    );
}

.ed-grain {
    position: fixed;
    inset: 0;
    z-index: 9990;
    pointer-events: none;
    opacity: 0.06;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

[data-theme="dark"] .ed-grain {
    opacity: 0.08;
    mix-blend-mode: screen;
}

@keyframes ed-drift-a { to { transform: translate3d(10vmax, 8vmax, 0) scale(1.15); } }
@keyframes ed-drift-b { to { transform: translate3d(-12vmax, -6vmax, 0) scale(0.9); } }

/* Let the atmosphere show through the page wrappers */
body.landing .page,
body.workspace .page,
body.landing #home-page,
body.workspace #home-page,
body.landing .home-content-wrapper,
body.workspace .home-content-wrapper,
body.workspace #view-note-page,
#view-note-page {
    background: transparent;
}

body.landing :focus-visible,
body.workspace :focus-visible {
    outline: 2px solid var(--theme-color);
    outline-offset: 3px;
}

/* ---------- Shared type ---------- */
body.landing .hero-eyebrow,
body.workspace .hero-eyebrow {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    font-family: var(--ed-serif);
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ed-mute);
}

body.landing .hero-eyebrow::before,
body.workspace .hero-eyebrow::before {
    content: '';
    flex-shrink: 0;
    width: 40px;
    height: 1px;
    background: currentColor;
}

body.landing .close-cta .hero-eyebrow {
    justify-content: center;
}

body.landing .hero-text h2,
body.landing .info-section h3,
body.landing .product-strip h3,
body.landing .todoos-highlight-text h3,
body.landing .close-cta h3,
body.landing .footer-brand h3,
body.workspace .notes-section-header h3 {
    font-family: var(--ed-serif);
    font-weight: 400;
    letter-spacing: -0.035em;
}

/* ---------- Header: quiet, no pill ---------- */
body.landing .app-header,
body.workspace .app-header {
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 18px var(--landing-pad, 1.5rem);
    border: 0;
    border-bottom: 1px solid transparent;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

body.landing .app-header.is-elevated,
body.landing .app-header.nav-open,
body.workspace .app-header.is-elevated {
    border-color: var(--ed-line);
    background: color-mix(in srgb, var(--bg-color) 70%, transparent);
    box-shadow: none;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

/* The settings overlay no longer pushes the page aside */
body.landing #home-page:has(.settings-panel.active) .app-header,
body.workspace #home-page:has(.settings-panel.active) .app-header {
    left: 0;
    right: 0;
    width: 100%;
}

body.landing #home-page:has(.settings-panel.active) .home-content-wrapper,
body.workspace #home-page:has(.settings-panel.active) .home-content-wrapper {
    width: 100%;
    margin-left: 0;
}

body:has(.settings-panel.active) {
    overflow: hidden;
}

body.landing .app-icon,
body.workspace .app-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
}

body.landing .nav-link {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ed-mute);
}

body.landing .nav-link:hover,
body.landing .nav-link.active {
    color: var(--text-color);
}

body.landing .nav-link::after {
    height: 1px;
}

/* Buttons: outlined pills that fill on hover */
body.landing .primary-auth-btn,
body.landing .ghost-btn,
body.landing .todoos-entry-btn {
    border: 1px solid var(--text-color);
    border-radius: 999px;
    background: transparent;
    color: var(--text-color);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: none;
}

body.landing .primary-auth-btn::before,
body.landing .ghost-btn::before,
body.landing .todoos-entry-btn::before {
    background: var(--theme-color);
    inset: 0;
    height: 100%;
    transform: translateY(101%);
    transition: transform 0.5s var(--ed-ease);
}

body.landing .primary-auth-btn:hover::before,
body.landing .ghost-btn:hover::before,
body.landing .todoos-highlight-inner:hover .todoos-entry-btn::before,
body.landing .todoos-entry-btn:hover::before {
    height: 100%;
    transform: none;
}

body.landing .primary-auth-btn:hover,
body.landing .ghost-btn:hover,
body.landing .todoos-highlight-inner:hover .todoos-entry-btn,
body.landing .todoos-entry-btn:hover {
    color: #fff;
    border-color: var(--theme-color);
}

body.landing .primary-auth-btn.large {
    padding: 15px 28px;
    font-size: 12px;
}

body.landing .nav-toggle {
    background: transparent;
}

/* ---------- Home: hero ---------- */
body.landing .hero-text h2 {
    font-size: clamp(3.6rem, 10vw, 8rem);
    line-height: 0.92;
    letter-spacing: -0.045em;
}

body.landing .hero-subtitle {
    max-width: 30ch;
    font-family: var(--ed-serif);
    font-size: clamp(1.3rem, 2.2vw, 1.75rem);
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: color-mix(in srgb, var(--text-color) 78%, transparent);
    font-weight: 400;
}

body.landing .hero-stats {
    border-top: 1px solid var(--ed-line);
    max-width: 30rem;
}

body.landing .stat-value {
    font-family: var(--ed-serif);
    font-size: 2.2rem;
    font-weight: 400;
    letter-spacing: -0.03em;
}

body.landing .stat-label {
    font-size: 11px;
    letter-spacing: 0.14em;
    color: var(--ed-mute);
}

body.landing .hero-glow {
    display: none;
}

/* Blend the preview into the atmosphere instead of boxing it */
body.landing .hero-shot {
    -webkit-mask-image:
        linear-gradient(90deg, transparent 0%, #000 28%),
        linear-gradient(180deg, #000 70%, transparent 100%);
    mask-image:
        linear-gradient(90deg, transparent 0%, #000 28%),
        linear-gradient(180deg, #000 70%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
}

/* ---------- Home: marquee ---------- */
body.landing .marquee {
    border-block: 1px solid var(--ed-line);
    padding: clamp(1rem, 3vw, 1.75rem) 0;
}

body.landing .marquee-track span {
    font-family: var(--ed-serif);
    font-size: clamp(2.6rem, 8vw, 6rem);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.04em;
    text-transform: none;
    padding: 0 clamp(1rem, 3vw, 2.25rem);
    color: color-mix(in srgb, var(--text-color) 16%, transparent);
}

body.landing .marquee-track span:nth-child(even) {
    color: var(--theme-color);
}

/* ---------- Home: sections ---------- */
body.landing .info-section h3,
body.landing .product-strip h3,
body.landing .todoos-highlight-text h3,
body.landing .close-cta h3 {
    font-size: clamp(2.4rem, 6vw, 4.6rem);
    line-height: 1;
}

body.landing .info-subtitle {
    font-family: var(--ed-serif);
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    line-height: 1.35;
    color: var(--ed-mute);
    font-weight: 400;
}

/* Features as editorial rows */
body.landing .feature-board {
    display: block;
    border-bottom: 1px solid var(--ed-line);
}

body.landing .feature-card {
    display: grid;
    grid-template-columns: minmax(70px, 0.18fr) minmax(0, 0.9fr) minmax(0, 1.2fr);
    gap: clamp(1rem, 3vw, 2.5rem);
    align-items: baseline;
    min-height: 0;
    padding: clamp(1.4rem, 3.5vw, 2.4rem) 0;
    border: 0;
    border-top: 1px solid var(--ed-line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

body.landing .feature-card::before {
    inset: 0 auto 0 -100vw;
    width: 300vw;
    height: auto;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--theme-color) 8%, transparent) 40%, transparent);
    opacity: 0;
    transition: opacity 0.5s ease;
}

body.landing .feature-card:hover {
    transform: none;
    border-color: var(--ed-line);
    box-shadow: none;
}

body.landing .feature-card:hover::before {
    height: auto;
    opacity: 1;
}

body.landing .feature-index {
    margin: 0;
    font-family: var(--ed-serif);
    font-size: 1.3rem;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1;
    color: var(--theme-color);
}

body.landing .feature-card:hover .feature-index {
    transform: none;
}

body.landing .feature-copy {
    display: contents;
}

body.landing .feature-copy h4 {
    margin: 0;
    font-family: var(--ed-serif);
    font-size: clamp(1.7rem, 3.4vw, 2.6rem);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.03em;
    transition: color 0.3s ease, transform 0.5s var(--ed-ease);
}

body.landing .feature-card:hover .feature-copy h4 {
    color: var(--theme-color);
    transform: translateX(8px);
}

body.landing .feature-copy p {
    font-size: 0.98rem;
    color: var(--ed-mute);
}

/* Product tiles as a ruled list */
body.landing .product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
    gap: 0 clamp(1.5rem, 5vw, 4rem);
}

body.landing .product-tile,
body.landing .product-tile-lead {
    grid-row: auto;
    min-height: 0;
    padding: clamp(1.2rem, 3vw, 2rem) 0;
    border: 0;
    border-top: 1px solid var(--ed-line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

body.landing .product-tile:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--theme-color);
}

body.landing .tile-visual {
    display: none;
}

body.landing .product-tile h4 {
    margin: 0 0 8px;
    font-family: var(--ed-serif);
    font-size: clamp(1.8rem, 3.6vw, 2.8rem);
    font-weight: 400;
    letter-spacing: -0.03em;
    transition: color 0.3s ease, transform 0.5s var(--ed-ease);
}

body.landing .product-tile:hover h4 {
    color: var(--theme-color);
    transform: translateX(6px);
}

body.landing .product-tile p {
    max-width: 34ch;
    font-size: 0.98rem;
    color: var(--ed-mute);
}

/* Logged-in highlight */
body.landing a.todoos-highlight-inner {
    border: 0;
    border-block: 1px solid var(--ed-line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: clamp(2rem, 5vw, 3.5rem) 0;
}

body.landing .todoos-highlight-inner:hover {
    transform: none;
    box-shadow: none;
}

body.landing .todoos-highlight-subtitle,
body.landing .todoos-feature-list {
    color: var(--ed-mute);
}

body.landing .todoos-pill {
    border: 1px solid var(--ed-line);
    background: transparent;
    box-shadow: none;
}

body.landing .todoos-preview-card {
    border: 1px solid var(--ed-line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

/* Close CTA */
body.landing .close-cta h3 {
    font-size: clamp(2.8rem, 8vw, 6.5rem);
}

/* Footer */
body.landing .site-footer {
    margin-top: 0;
    background: transparent;
    color: var(--text-color);
    border-top: 1px solid var(--ed-line);
}

[data-theme="dark"] body.landing .site-footer {
    background: transparent;
    border-top: 1px solid var(--ed-line);
}

body.landing .footer-mark {
    display: inline-block;
    padding: 0.05em 0.2em 0.18em 0.3em;
    margin: 0 0 20px -0.3em;
    font-size: clamp(5rem, 16vw, 11rem);
    line-height: 0.95;
    background: linear-gradient(110deg, var(--text-color) 20%, var(--theme-color) 85%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

body.landing .footer-brand h3 {
    color: var(--text-color);
    font-size: clamp(1.8rem, 3.4vw, 2.6rem);
    line-height: 1.1;
}

body.landing .footer-brand p {
    color: var(--ed-mute);
}

body.landing .site-footer .hero-eyebrow {
    color: var(--ed-mute);
}

body.landing .site-footer .ghost-btn {
    border-color: var(--text-color);
    color: var(--text-color);
}

body.landing .site-footer .ghost-btn::before {
    background: var(--theme-color);
}

body.landing .site-footer .ghost-btn:hover {
    color: #fff;
}

body.landing .footer-links span {
    color: var(--ed-mute);
}

body.landing .footer-links a {
    color: var(--text-color);
    font-family: var(--ed-serif);
    font-size: 1.35rem;
    font-weight: 400;
}

body.landing .footer-bottom {
    border-top: 1px solid var(--ed-line);
    color: var(--ed-mute);
}

/* ---------- Todoos list ---------- */
body.workspace .notes-section {
    padding-top: clamp(7rem, 16vh, 9.5rem);
}

body.workspace .notes-section-header h3 {
    font-size: clamp(3rem, 9vw, 7rem);
    line-height: 0.95;
    letter-spacing: -0.045em;
}

body.workspace .notes-section-subtitle {
    max-width: 32ch;
    margin-top: 12px;
    font-family: var(--ed-serif);
    font-size: clamp(1.3rem, 2.2vw, 1.75rem);
    line-height: 1.3;
    color: var(--ed-mute);
    font-weight: 400;
}

body.workspace .workspace-home {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ed-mute);
}

body.workspace .header-search-input {
    border: 0;
    border-bottom: 1px solid var(--ed-line);
    border-radius: 0;
    background: transparent;
    padding: 8px 2px;
    font-family: var(--ed-serif);
    font-size: 1.1rem;
    font-weight: 400;
}

body.workspace .header-search-input:hover,
body.workspace .header-search-input:focus {
    border-color: var(--theme-color);
    background: transparent;
}

body.workspace .notes-list {
    gap: 0;
    border-bottom: 1px solid var(--ed-line);
}

/* A todoo is a ruled row, not a card */
body.workspace .note-card {
    display: grid;
    grid-template-columns: clamp(2.5rem, 7vw, 4.5rem) minmax(0, 1fr) auto;
    column-gap: clamp(0.5rem, 2vw, 1.5rem);
    align-items: baseline;
    padding: clamp(1.1rem, 2.6vw, 1.7rem) 0;
    margin: 0;
    border: 0;
    border-top: 1px solid var(--ed-line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

body.workspace .note-card::before {
    display: none;
}

/* Hover wash that runs the full row */
body.workspace .note-card::after {
    inset: 0 -100vw;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--theme-color) 8%, transparent) 40%, transparent);
    opacity: 0;
    transition: opacity 0.45s ease;
}

body.workspace .note-card:hover::after {
    opacity: 1;
}

body.workspace .note-card > * {
    position: relative;
    z-index: 1;
}

body.workspace .note-header {
    display: contents;
}

body.workspace .note-avatar {
    grid-column: 1;
    grid-row: 1;
    width: auto;
    height: auto;
    border-radius: 0;
    background: none;
    box-shadow: none;
    justify-content: flex-start;
    font-family: var(--ed-serif);
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--theme-color);
}

body.workspace .note-card:hover .note-avatar {
    transform: none;
    box-shadow: none;
}

body.workspace .note-title {
    grid-column: 2;
    grid-row: 1;
    font-family: var(--ed-serif);
    font-size: clamp(1.6rem, 3.6vw, 2.6rem);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.03em;
    background: linear-gradient(var(--theme-color), var(--theme-color)) no-repeat 0 100% / 0 1px;
    transition: color 0.3s ease, transform 0.5s var(--ed-ease), background-size 0.6s var(--ed-ease);
}

body.workspace .note-card:hover .note-title {
    color: var(--theme-color);
    transform: translateX(8px);
    background-size: 100% 1px;
}

body.workspace .note-content-preview,
body.workspace .note-checklist-preview,
body.workspace .note-urls {
    grid-column: 2;
}

body.workspace .note-content-preview {
    margin: 10px 0 0;
    max-width: 62ch;
    font-size: 0.95rem;
    color: var(--ed-mute);
}

body.workspace .note-card:hover .note-content-preview {
    color: var(--text-color);
}

body.workspace .note-checklist-preview {
    margin-top: 10px;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--theme-color);
}

body.workspace .note-urls {
    margin: 10px 0 0;
}

/* Quiet icon actions, revealed on hover (a favorited heart always shows) */
body.workspace .note-actions {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    border: 0;
}

body.workspace .note-action-buttons {
    display: flex;
    align-items: center;
    gap: 2px;
}

body.workspace .note-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    color: var(--ed-mute);
    cursor: pointer;
    opacity: 0;
    transform: none;
    animation: none;
    transition: opacity 0.3s ease, color 0.2s ease, background 0.2s ease;
}

body.workspace .note-icon-btn::before {
    display: none;
}

body.workspace .note-icon-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: fill 0.2s ease, transform 0.2s ease;
}

body.workspace .note-card:hover .note-icon-btn,
body.workspace .note-card:focus-within .note-icon-btn,
body.workspace .note-icon-btn.favorited {
    opacity: 1;
}

body.workspace .note-icon-btn:hover,
body.workspace .note-icon-btn:focus-visible {
    transform: none;
    box-shadow: none;
    color: var(--text-color);
    background: color-mix(in srgb, var(--text-color) 8%, transparent);
}

body.workspace .note-favorite-btn.favorited {
    color: #e5484d;
}

body.workspace .note-favorite-btn.favorited svg {
    fill: currentColor;
}

body.workspace .note-favorite-btn:hover {
    color: #e5484d;
}

body.workspace .note-favorite-btn:active svg {
    transform: scale(0.85);
}

body.workspace .note-delete-btn:hover,
body.workspace .note-delete-btn:focus-visible {
    color: #e5484d;
    background: color-mix(in srgb, #e5484d 10%, transparent);
}

/* Reveal finished: no lift, no stagger delay on hover */
html.js body.workspace .note-card.reveal.is-visible:hover,
html.js body.workspace .note-card.reveal.is-visible.is-settled:hover,
html.js body.workspace .note-card.reveal.is-visible.is-settled:active {
    transform: none;
    box-shadow: none;
    border-color: var(--ed-line);
    background: transparent;
}

html.js body.workspace .note-card.reveal.is-visible.is-settled {
    transition: background 0.3s ease;
    transition-delay: 0ms;
}

@media (hover: none) {
    body.workspace .note-icon-btn {
        opacity: 1;
    }
}

/* Grid view: staggered, ruled columns */
body.workspace .notes-list.grid-view {
    border-bottom: 0;
    column-gap: clamp(1.5rem, 4vw, 3.5rem);
}

body.workspace .notes-list.grid-view .note-card {
    display: block;
    padding: 1.3rem 0 1.6rem;
    margin-bottom: 0;
}

body.workspace .notes-list.grid-view .note-header {
    display: flex;
    align-items: baseline;
    gap: 14px;
}

body.workspace .notes-list.grid-view .note-avatar {
    flex-shrink: 0;
}

body.workspace .notes-list.grid-view .note-title {
    min-width: 0;
    font-size: clamp(1.5rem, 2.4vw, 2rem);
}

body.workspace .notes-list.grid-view .note-actions {
    margin-top: 14px;
    justify-content: space-between;
}

body.workspace .empty-state {
    font-family: var(--ed-serif);
    color: var(--ed-mute);
    font-weight: 400;
}

body.workspace .empty-state::before {
    display: none;
}

body.workspace .empty-state h3 {
    font-family: var(--ed-serif);
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 3.4rem);
    letter-spacing: -0.03em;
    color: var(--text-color);
}

/* ---------- Todoo view ---------- */
#view-note-page {
    background: transparent;
}

#view-note-page .view-note-shell {
    max-width: 1120px;
}

#view-note-page .view-note-toolbar {
    top: 0;
    padding: 14px 0;
    margin: 0 0 clamp(1rem, 3vw, 2rem);
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

#view-note-page .back-button,
#view-note-page .header-action-btn {
    border: 1px solid var(--ed-line);
}

#view-note-page .back-button:hover,
#view-note-page .header-action-btn:hover {
    border-color: var(--text-color);
    background: transparent;
}

#view-note-page .view-note-creative-btn {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ed-mute);
}

#view-note-page .view-note-creative-btn:hover {
    background: transparent;
    color: var(--theme-color);
}

#view-note-page .view-note-copy {
    max-width: 46rem;
    justify-content: flex-start;
    padding-top: clamp(1rem, 6vh, 4rem);
}

#view-note-page .view-note-copy.is-long {
    max-width: none;
}

#view-note-page .view-note-copy .hero-eyebrow {
    color: var(--ed-mute);
    letter-spacing: 0;
    text-transform: none;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    font-weight: 400;
}

#view-note-page .view-note-title {
    margin-bottom: clamp(1.5rem, 4vw, 2.75rem);
    font-family: var(--ed-serif);
    font-size: clamp(2.8rem, 8vw, 6.4rem);
    font-weight: 600;
    line-height: 0.98;
    letter-spacing: -0.04em;
    color: var(--text-color);
}

#view-note-page .view-note-title em {
    color: var(--theme-color);
}

#view-note-page .view-note-body {
    font-family: var(--ed-serif);
    font-size: clamp(1.4rem, 2.6vw, 1.95rem);
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: -0.012em;
    color: color-mix(in srgb, var(--text-color) 88%, transparent);
}

#view-note-page .view-note-copy.is-long .view-note-body {
    font-size: clamp(1.2rem, 1.8vw, 1.4rem);
    font-weight: 400;
    line-height: 1.55;
    column-rule: 1px solid var(--ed-line);
}

#view-note-page .markdown-body h1,
#view-note-page .markdown-body h2,
#view-note-page .markdown-body h3,
#view-note-page .markdown-body h4,
#view-note-page .markdown-body h5,
#view-note-page .markdown-body h6 {
    font-family: var(--ed-serif);
    font-weight: 400;
    letter-spacing: -0.02em;
}

#view-note-page .markdown-body h1 { font-size: 1.7em; }
#view-note-page .markdown-body h2 { font-size: 1.45em; }
#view-note-page .markdown-body h3 { font-size: 1.25em; }

#view-note-page .markdown-body blockquote {
    border-left-width: 1px;
}

#view-note-page .view-note-checklist,
#view-note-page .view-note-timestamps {
    border-top: 1px solid var(--ed-line);
}

#view-note-page .view-checklist-heading {
    color: var(--ed-mute);
}

#view-note-page .view-checklist-item {
    padding: 10px 0;
    margin: 0;
    border-bottom: 1px solid var(--ed-line);
}

#view-note-page .view-checklist-item-text {
    font-family: var(--ed-serif);
    font-size: 1.4rem;
    line-height: 1.25;
    font-weight: 400;
}

#view-note-page .view-note-timestamps {
    color: var(--ed-mute);
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
    .ed-blob {
        animation: none;
    }
}

/* The closed settings drawer shouldn't bleed a shadow onto the page edge */
body.landing .settings-panel:not(.active),
body.workspace .settings-panel:not(.active) {
    box-shadow: none;
}

body.workspace .note-checklist-preview {
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
}

body.workspace .notes-list.grid-view .note-card::after {
    inset: 0 -12px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--theme-color) 9%, transparent), transparent 80%);
}

/* Headings are already semibold: keep **bold** readable as an accent */
body.workspace .note-title strong,
#view-note-page .view-note-title strong,
#view-note-page .view-note-body strong {
    font-weight: 400;
    font-synthesis: none;
    color: var(--theme-color);
}

/* Phones: actions drop under the content so titles keep the full row */
@media (max-width: 640px) {
    body.workspace .note-card {
        grid-template-columns: 1.75rem minmax(0, 1fr);
    }

    body.workspace .note-actions {
        grid-column: 2;
        grid-row: auto;
        margin-top: 12px;
        justify-content: space-between;
    }
}

@media (max-width: 720px) {
    body.landing .feature-card {
        grid-template-columns: 2.2rem minmax(0, 1fr);
        row-gap: 10px;
    }

    body.landing .feature-copy p {
        grid-column: 2;
    }

    body.landing .product-grid {
        grid-template-columns: 1fr;
    }
}

/* Display headings: bold, matching the developer page name */
body.landing .hero-text h2,
body.landing .info-section h3,
body.landing .product-strip h3,
body.landing .todoos-highlight-text h3,
body.landing .close-cta h3,
body.workspace .notes-section-header h3 {
    font-weight: 700;
    letter-spacing: -0.055em;
}

/* ---------- Settings overlay ---------- */
body.landing .settings-panel,
body.workspace .settings-panel {
    --ox: 40px;
    --oy: 40px;
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    z-index: 1500;
    transform: none;
    overflow: hidden;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    visibility: hidden;
    clip-path: circle(0px at var(--ox) var(--oy));
    transition:
        clip-path 0.85s cubic-bezier(0.76, 0, 0.24, 1),
        visibility 0s linear 0.85s;
}

body.landing .settings-panel.active,
body.workspace .settings-panel.active {
    transform: none;
    box-shadow: none;
    visibility: visible;
    clip-path: circle(160vmax at var(--ox) var(--oy));
    transition:
        clip-path 1.05s cubic-bezier(0.76, 0, 0.24, 1),
        visibility 0s;
}

/* Two-tone wipe: an accent disc leads, the page-colored surface follows */
.settings-panel::before,
.settings-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.settings-panel::before {
    background: var(--theme-color);
}

.settings-panel::after {
    background:
        radial-gradient(60vmax 50vmax at 8% -10%, color-mix(in srgb, var(--theme-color) 22%, transparent), transparent 70%),
        radial-gradient(50vmax 45vmax at 100% 100%, color-mix(in srgb, var(--theme-color) 12%, transparent), transparent 70%),
        var(--bg-color);
    clip-path: circle(0px at var(--ox) var(--oy));
    transition: clip-path 0.7s cubic-bezier(0.76, 0, 0.24, 1);
}

.settings-panel.active::after {
    clip-path: circle(160vmax at var(--ox) var(--oy));
    transition: clip-path 1s cubic-bezier(0.76, 0, 0.24, 1) 0.14s;
}

.sp-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    max-width: 1180px;
    height: 100%;
    margin: 0 auto;
    padding: 0 var(--landing-pad, 1.5rem);
    overflow-y: auto;
}

/* Rise-in: staggered once the surface has opened, instant on close */
.settings-panel .sp-rise {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.settings-panel.active .sp-rise {
    opacity: 1;
    transform: none;
    transition:
        opacity 0.8s var(--ed-ease),
        transform 0.9s var(--ed-ease);
    transition-delay: calc(0.55s + var(--i, 0) * 70ms);
}

body.landing .drawer-header.sp-top,
body.workspace .drawer-header.sp-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    padding: 24px 0;
    border: 0;
}

.drawer-eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ed-mute);
}

body.landing .close-drawer,
body.workspace .close-drawer {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px 10px 20px;
    border: 1px solid var(--ed-line);
    border-radius: 999px;
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-color);
    cursor: pointer;
}

body.landing .close-drawer svg,
body.workspace .close-drawer svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    transition: transform 0.6s var(--ed-ease);
}

body.landing .close-drawer:hover,
body.workspace .close-drawer:hover {
    border-color: var(--text-color);
}

body.landing .close-drawer:hover svg,
body.workspace .close-drawer:hover svg {
    transform: rotate(90deg);
}

body.landing .settings-content.sp-body,
body.workspace .settings-content.sp-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 0 clamp(1.5rem, 5vh, 3rem);
}

/* Title: each letter-block rises out of a mask */
.sp-title {
    overflow: hidden;
    padding: 0 0.1em 0.12em 0;
    margin-bottom: clamp(1.25rem, 4vh, 2.75rem);
    font-size: clamp(3.4rem, min(13vw, 19vh), 9rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.06em;
}

.sp-title span {
    display: inline-block;
    transform: translateY(110%);
    transition: transform 0.3s ease;
}

.settings-panel.active .sp-title span {
    transform: none;
    transition: transform 1s var(--ed-ease) 0.5s;
}

.sp-title b {
    color: var(--theme-color);
}

.sp-sections {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 clamp(2rem, 7vw, 6rem);
    align-items: start;
}

body.landing .settings-section,
body.workspace .settings-section {
    margin: 0;
    padding: 0;
}

.settings-section .sp-label {
    display: flex;
    gap: 12px;
    align-items: baseline;
    margin: 0 0 4px;
    padding-top: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ed-mute);
}

.settings-section .sp-label span {
    color: var(--theme-color);
    font-variant-numeric: tabular-nums;
}

.settings-section .sp-label ~ .sp-label,
.settings-section .color-options ~ .sp-label {
    margin-top: clamp(1rem, 3vh, 2rem);
}

/* A setting is one large line */
.sp-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: clamp(0.7rem, 1.8vh, 1.1rem) 0;
    border: 0;
    border-top: 1px solid var(--ed-line);
    border-radius: 0;
    background: none;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.sp-name {
    flex: 1;
    font-size: clamp(1.7rem, min(3.6vw, 5.2vh), 2.8rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.05em;
    transition: color 0.3s ease, transform 0.6s var(--ed-ease);
}

.sp-row:hover .sp-name {
    color: var(--theme-color);
    transform: translateX(8px);
}

.sp-check {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.sp-state {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ed-mute);
}

.sp-state i {
    font-style: normal;
}

.sp-state i:last-child,
.sp-check:checked ~ .sp-state i:first-child {
    display: none;
}

.sp-check:checked ~ .sp-state i:last-child {
    display: inline;
    color: var(--theme-color);
}

.sp-knob {
    position: relative;
    flex-shrink: 0;
    width: 46px;
    height: 26px;
    border: 1px solid color-mix(in srgb, var(--text-color) 30%, transparent);
    border-radius: 999px;
    transition: background 0.4s ease, border-color 0.4s ease;
}

.sp-knob::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-color);
    transition: transform 0.5s var(--ed-ease), background 0.3s ease;
}

.sp-check:checked ~ .sp-knob {
    background: var(--theme-color);
    border-color: var(--theme-color);
}

.sp-check:checked ~ .sp-knob::before {
    background: #fff;
    transform: translateX(20px);
}

.sp-check:focus-visible ~ .sp-knob,
.sp-row:focus-visible,
body.landing .close-drawer:focus-visible,
body.workspace .close-drawer:focus-visible {
    outline: 2px solid var(--theme-color);
    outline-offset: 4px;
}

.sp-arrow {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    fill: none;
    stroke: var(--ed-mute);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.5s var(--ed-ease), stroke 0.3s ease;
}

.sp-row:hover .sp-arrow {
    stroke: var(--theme-color);
    transform: translateX(5px);
}

/* Colors */
body.landing .color-options,
body.workspace .color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    padding: clamp(0.8rem, 2vh, 1.2rem) 0 clamp(0.4rem, 1vh, 0.8rem);
    border-top: 1px solid var(--ed-line);
}

body.landing .color-option,
body.workspace .color-option {
    width: clamp(40px, 6.5vh, 54px);
    height: clamp(40px, 6.5vh, 54px);
    border: 0;
    transition: transform 0.5s var(--ed-ease), box-shadow 0.3s ease;
}

body.landing .color-option:hover,
body.workspace .color-option:hover {
    transform: scale(1.1) rotate(-6deg);
}

body.landing .color-option.active,
body.workspace .color-option.active {
    box-shadow: 0 0 0 4px var(--bg-color), 0 0 0 5.5px var(--text-color);
}

body.landing .custom-color,
body.workspace .custom-color {
    background: transparent;
    border: 1px dashed color-mix(in srgb, var(--text-color) 45%, transparent);
    color: var(--text-color);
}

body.landing .custom-color svg,
body.workspace .custom-color svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    pointer-events: none;
}

/* Logout: a quiet row, accent on hover */
body.landing .logout-btn.sp-row,
body.workspace .logout-btn.sp-row {
    margin: 0;
    width: 100%;
    padding: clamp(0.7rem, 1.8vh, 1.1rem) 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: var(--text-color);
    font-size: inherit;
    letter-spacing: normal;
    text-transform: none;
    border: 0;
    border-top: 1px solid var(--ed-line);
    border-bottom: 1px solid var(--ed-line);
}

@media (max-width: 820px) {
    .sp-sections {
        grid-template-columns: 1fr;
    }

    .sp-title {
        font-size: clamp(3.2rem, 17vw, 5.5rem);
    }

    .sp-name {
        font-size: clamp(1.5rem, 7vw, 2.2rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    .settings-panel,
    .settings-panel::after,
    .settings-panel .sp-rise,
    .sp-title span {
        transition-duration: 0.01s !important;
        transition-delay: 0s !important;
    }
}

/* ---------- Home: Android download ---------- */
body.landing .app-download-section {
    padding: clamp(4.5rem, 10vh, 7.5rem) var(--landing-pad);
    scroll-margin-top: 100px;
}

body.landing .app-download-section h3 {
    font-size: clamp(2.4rem, 6vw, 4.6rem);
    line-height: 1;
}

body.landing .app-download-section .info-subtitle strong {
    color: var(--text-color);
    font-weight: 600;
}

body.landing .download-box {
    max-width: 500px;
}

/* Main: arm64, a compact highlighted banner */
body.landing .download-main {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 22px;
    padding: 22px 26px;
    border-radius: 22px;
    background: var(--theme-color);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 24px 60px -26px color-mix(in srgb, var(--theme-color) 75%, transparent);
    transition: transform 0.5s var(--ed-ease), box-shadow 0.5s ease;
}

body.landing .download-main:hover {
    transform: translateY(-3px);
    box-shadow: 0 30px 70px -24px color-mix(in srgb, var(--theme-color) 85%, transparent);
}

body.landing .download-android {
    width: 40px;
    height: 40px;
    fill: currentColor;
    stroke: none;
}

body.landing .download-copy h4 {
    margin: 0 0 4px;
    font-family: var(--ed-serif);
    font-size: clamp(1.35rem, 2.2vw, 1.8rem);
    font-weight: 500;
    letter-spacing: -0.03em;
}

body.landing .download-copy p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.85);
}

body.landing .download-badge {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body.landing .download-foot {
    display: flex;
    align-items: center;
    gap: 18px;
}

body.landing .download-size {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
}

body.landing .download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 22px;
    border-radius: 999px;
    background: #fff;
    color: #000;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background 0.4s var(--ed-ease), color 0.4s var(--ed-ease);
}

body.landing .download-btn svg,
body.landing .download-row-btn svg,
body.landing .download-toggle svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.landing .download-main:hover .download-btn {
    background: #000;
    color: #fff;
}

/* Toggle: minimize / expand the other variants */
body.landing .download-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 9px 14px 9px 16px;
    border: 1px dashed var(--ed-line);
    border-radius: 999px;
    background: transparent;
    color: var(--ed-mute);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.3s ease, border-color 0.3s ease;
}

body.landing .download-toggle:hover {
    color: var(--text-color);
    border-color: var(--text-color);
}

body.landing .download-toggle-count {
    display: grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-color) 10%, transparent);
    font-size: 11px;
    letter-spacing: 0;
}

body.landing .download-toggle svg {
    transition: transform 0.4s var(--ed-ease);
}

body.landing .download-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

/* Collapsible list (animates height 0 -> auto) */
body.landing .download-more {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.5s var(--ed-ease);
}

body.landing .download-more.is-open {
    grid-template-rows: 1fr;
}

body.landing .download-more-inner {
    min-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.35s ease;
}

body.landing .download-more.is-open .download-more-inner {
    opacity: 1;
    transition-delay: 0.1s;
}

/* Other variants: slim list rows, not cards */
body.landing .download-row {
    display: grid;
    grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 18px;
    padding: 16px 4px;
    border-bottom: 1px solid var(--ed-line);
    color: var(--text-color);
    text-decoration: none;
}

body.landing .download-more-inner .download-row:first-child {
    margin-top: 6px;
    border-top: 1px solid var(--ed-line);
}

body.landing .download-row-name {
    font-family: var(--ed-serif);
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: -0.02em;
}

body.landing .download-row-desc {
    font-size: 0.9rem;
    color: var(--ed-mute);
}

body.landing .download-row-size {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ed-mute);
}

body.landing .download-row-btn {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--ed-line);
    border-radius: 50%;
    transition: background 0.4s var(--ed-ease), color 0.4s var(--ed-ease), border-color 0.4s var(--ed-ease), transform 0.4s var(--ed-ease);
}

body.landing .download-row:hover .download-row-btn {
    background: var(--theme-color);
    border-color: var(--theme-color);
    color: #fff;
    transform: translateY(2px);
}

body.landing .download-note {
    margin: 22px 0 0;
    font-size: 0.9rem;
    color: var(--ed-mute);
}

body.landing .download-main {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 20px;
    gap: 16px 16px;
}

body.landing .download-foot {
    grid-column: 1 / -1;
    justify-content: space-between;
}

body.landing .download-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    row-gap: 2px;
}

body.landing .download-row-desc {
    grid-column: 1;
    grid-row: 2;
}

body.landing .download-row-size {
    grid-column: 2;
    grid-row: 1 / span 2;
}

body.landing .download-row-btn {
    grid-column: 3;
    grid-row: 1 / span 2;
}

@media (prefers-reduced-motion: reduce) {
    body.landing .download-more,
    body.landing .download-more-inner,
    body.landing .download-toggle svg {
        transition-duration: 0.01s;
    }
}

/* Download: left column (copy + buttons), right column (phone, full height) */
body.landing .download-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: clamp(1.5rem, 5vw, 5rem);
    align-items: center;
}

body.landing .download-left {
    min-width: 0;
}

body.landing .download-phone {
    position: relative;
    margin: 0;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, #000 40%, rgba(0, 0, 0, 0.55) 70%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 40%, rgba(0, 0, 0, 0.55) 70%, transparent 100%);
}

body.landing .download-phone img {
    display: block;
    width: 100%;
    height: auto;
    margin-top: -14%;
    user-select: none;
    pointer-events: none;
}

@media (max-width: 900px) {
    body.landing .download-layout {
        grid-template-columns: 1fr;
    }

    body.landing .download-box {
        max-width: none;
    }

    body.landing .download-phone {
        max-width: 420px;
        width: 100%;
        margin: 0 auto;
    }
}

/* ===== Note editor dialog =====
   Fixed header + scrolling body + pinned footer so Save never falls off-screen. */
body.modal-open {
    overflow: hidden;
}

#note-modal {
    padding: 24px;
    background: color-mix(in srgb, #0b1220 38%, transparent);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    overscroll-behavior: contain;
}

#note-modal .note-modal-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 720px;
    height: min(760px, calc(100dvh - 48px));
    max-height: none;
    padding: 0;
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid var(--ed-line);
    background: var(--surface-color);
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
    animation: noteModalIn 0.28s var(--ed-ease);
}

@keyframes noteModalIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

#note-modal .modal-header {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding: 18px 20px 14px 28px;
    border-bottom: 1px solid var(--ed-line);
}

#note-modal .modal-header h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ed-mute);
}

#note-modal .note-modal-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

#note-modal .note-modal-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ed-mute);
    font-size: 0;
    cursor: pointer;
    transform: none;
    transition: color 0.2s ease, background 0.2s ease;
}

#note-modal .note-modal-icon-btn svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: fill 0.2s ease, transform 0.15s ease;
}

#note-modal .note-modal-icon-btn:hover,
#note-modal .note-modal-icon-btn:focus-visible {
    color: var(--text-color);
    background: color-mix(in srgb, var(--text-color) 8%, transparent);
    transform: none;
}

#note-modal .note-modal-icon-btn:active svg {
    transform: scale(0.88);
}

#note-modal .favorite-btn:hover,
#note-modal .favorite-btn.favorited {
    color: #e5484d;
}

#note-modal .favorite-btn.favorited svg {
    fill: currentColor;
}

#note-modal .note-form {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 22px 28px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

#note-modal .note-title-field {
    flex: none;
    width: 100%;
    padding: 4px 0 10px;
    border: 0;
    border-bottom: 1px solid var(--ed-line);
    border-radius: 0;
    background: transparent;
    color: var(--text-color);
    font-family: var(--ed-serif);
    font-size: clamp(1.4rem, 3vw, 1.85rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    transition: border-color 0.2s ease;
}

#note-modal .note-title-field:focus {
    outline: none;
    background: transparent;
    border-bottom-color: var(--theme-color);
}

#note-modal .note-title-field::placeholder,
#note-modal .form-textarea::placeholder,
#note-modal .checklist-input::placeholder {
    color: color-mix(in srgb, var(--text-color) 38%, transparent);
}

#note-modal .checklist-section {
    flex: none;
    padding: 14px 16px;
    border: 1px solid var(--ed-line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--text-color) 2.5%, transparent);
}

#note-modal .checklist-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ed-mute);
}

#note-modal .checklist-icon {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#note-modal .checklist-items {
    gap: 2px;
}

#note-modal .checklist-items:not(:empty) {
    margin-bottom: 6px;
}

#note-modal .checklist-item {
    gap: 10px;
    padding: 2px 0 2px 2px;
    border-radius: 8px;
}

#note-modal .checklist-item input[type="checkbox"] {
    width: 17px;
    height: 17px;
    flex: none;
    margin: 0;
}

#note-modal .checklist-item-text {
    font-size: 15px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

#note-modal .checklist-item-remove {
    width: 30px;
    height: 30px;
    opacity: 0;
}

#note-modal .checklist-item-remove svg {
    width: 15px;
    height: 15px;
}

#note-modal .checklist-item:hover .checklist-item-remove,
#note-modal .checklist-item-remove:focus-visible {
    opacity: 1;
}

#note-modal .checklist-item-remove:hover {
    color: #e5484d;
}

#note-modal .checklist-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

#note-modal .checklist-input {
    flex: 1;
    min-width: 0;
    padding: 8px 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text-color);
    font-size: 15px;
}

#note-modal .add-checklist-btn {
    color: var(--theme-color);
}

#note-modal .form-textarea {
    flex: 1 0 220px;
    width: 100%;
    min-height: 220px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text-color);
    font-size: 16px;
    line-height: 1.7;
    resize: none;
}

#note-modal .form-textarea:focus {
    outline: none;
    background: transparent;
}

#note-modal .note-modal-footer {
    flex: none;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--ed-line);
    background: var(--surface-color);
}

#note-modal .note-modal-cancel,
#note-modal .save-note-btn {
    width: auto;
    min-width: 96px;
    height: 40px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    font-family: var(--ed-serif);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: none;
    transform: none;
    transition: background 0.2s ease, color 0.2s ease, filter 0.2s ease;
}

#note-modal .note-modal-cancel {
    background: transparent;
    color: var(--ed-mute);
}

#note-modal .note-modal-cancel:hover {
    color: var(--text-color);
    background: color-mix(in srgb, var(--text-color) 7%, transparent);
}

#note-modal .save-note-btn {
    background: var(--theme-color);
    color: #fff;
}

#note-modal .save-note-btn::before {
    display: none;
}

#note-modal .save-note-btn:hover {
    filter: brightness(1.06);
    transform: none;
    box-shadow: none;
}

@media (max-width: 640px) {
    #note-modal {
        padding: 0;
        align-items: flex-end;
    }

    #note-modal .note-modal-content {
        max-width: none;
        height: 100dvh;
        border-radius: 0;
        border: 0;
    }

    #note-modal .modal-header {
        padding: 12px 12px 10px 20px;
    }

    #note-modal .note-form {
        padding: 18px 20px;
    }

    #note-modal .checklist-item-remove {
        opacity: 1;
    }

    #note-modal .save-note-btn {
        flex: 1;
    }
}

/* ===== Notes loading skeleton ===== */
body.workspace .notes-skeleton {
    margin: 0;
    text-align: left;
    border-bottom: 1px solid var(--ed-line);
}

body.workspace .notes-skeleton.hidden {
    display: none;
}

.notes-skeleton .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.notes-skeleton .skeleton-row {
    display: grid;
    grid-template-columns: clamp(2.5rem, 7vw, 4.5rem) minmax(0, 1fr);
    column-gap: clamp(0.5rem, 2vw, 1.5rem);
    align-items: start;
    padding: clamp(1.1rem, 2.6vw, 1.7rem) 0;
    border-top: 1px solid var(--ed-line);
    animation: skFade 0.5s var(--ed-ease) both;
}

.notes-skeleton .skeleton-row:nth-of-type(2) { animation-delay: 0.06s; opacity: 0.85; }
.notes-skeleton .skeleton-row:nth-of-type(3) { animation-delay: 0.12s; opacity: 0.65; }
.notes-skeleton .skeleton-row:nth-of-type(4) { animation-delay: 0.18s; opacity: 0.45; }

.notes-skeleton .sk-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notes-skeleton .sk {
    display: block;
    border-radius: 999px;
    background:
        linear-gradient(100deg,
            transparent 30%,
            color-mix(in srgb, var(--theme-color) 14%, transparent) 50%,
            transparent 70%)
        0 0 / 250% 100% no-repeat,
        color-mix(in srgb, var(--text-color) 7%, transparent);
    animation: skShimmer 1.4s ease-in-out infinite;
}

.notes-skeleton .sk-num {
    width: 18px;
    height: 18px;
    margin-top: 10px;
    background-color: color-mix(in srgb, var(--theme-color) 22%, transparent);
}

.notes-skeleton .sk-title {
    height: clamp(1.6rem, 3vw, 2.2rem);
    max-width: 420px;
    border-radius: 10px;
    margin-bottom: 4px;
}

.notes-skeleton .sk-line {
    height: 12px;
    max-width: 620px;
}

.notes-skeleton .sk-line[style*="width:0"] {
    display: none;
}

@keyframes skShimmer {
    from { background-position: 150% 0, 0 0; }
    to { background-position: -150% 0, 0 0; }
}

@keyframes skFade {
    from { transform: translateY(6px); }
    to { transform: none; }
}

@media (max-width: 640px) {
    .notes-skeleton .skeleton-row {
        grid-template-columns: 1.75rem minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .notes-skeleton .sk,
    .notes-skeleton .skeleton-row {
        animation: none;
    }
}

/* ===== All / Favorites switch ===== */
body.workspace .notes-filter {
    position: relative;
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    margin: clamp(1.6rem, 4vw, 2.4rem) 0 clamp(1rem, 2.5vw, 1.5rem);
    padding: 4px;
    border: 1px solid var(--ed-line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-color) 3%, transparent);
    isolation: isolate;
}

body.workspace .notes-filter-pill {
    position: absolute;
    z-index: -1;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc(50% - 4px);
    border-radius: 999px;
    background: var(--surface-color);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.08),
        0 4px 14px color-mix(in srgb, var(--theme-color) 16%, transparent);
    transition: transform 0.45s var(--ed-ease), box-shadow 0.3s ease;
}

body.workspace .notes-filter.is-fav .notes-filter-pill {
    transform: translateX(100%);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.08),
        0 4px 14px rgba(229, 72, 77, 0.2);
}

body.workspace .notes-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 128px;
    height: 40px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ed-mute);
    font-family: var(--ed-serif);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.25s ease;
}

body.workspace .notes-filter-btn:hover,
body.workspace .notes-filter-btn.is-active {
    color: var(--text-color);
}

body.workspace .notes-filter-btn:focus-visible {
    outline: 2px solid var(--theme-color);
    outline-offset: 2px;
}

body.workspace .notes-filter-btn svg {
    width: 17px;
    height: 17px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: fill 0.25s ease, color 0.25s ease, transform 0.35s var(--ed-ease);
}

body.workspace .notes-filter-btn[data-filter="fav"]:hover svg,
body.workspace .notes-filter-btn[data-filter="fav"].is-active svg {
    color: #e5484d;
}

body.workspace .notes-filter-btn[data-filter="fav"].is-active svg {
    fill: currentColor;
    animation: favPop 0.45s var(--ed-ease);
}

@keyframes favPop {
    0% { transform: scale(0.7); }
    55% { transform: scale(1.18); }
    100% { transform: scale(1); }
}

body.workspace .notes-filter-count {
    min-width: 22px;
    height: 20px;
    padding: 0 7px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-color) 7%, transparent);
    color: var(--ed-mute);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 20px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    transition: background 0.25s ease, color 0.25s ease;
}

body.workspace .notes-filter-btn[data-filter="all"].is-active .notes-filter-count {
    background: color-mix(in srgb, var(--theme-color) 14%, transparent);
    color: var(--theme-color);
}

body.workspace .notes-filter-btn[data-filter="fav"].is-active .notes-filter-count {
    background: rgba(229, 72, 77, 0.12);
    color: #e5484d;
}

@media (max-width: 640px) {
    body.workspace .notes-filter {
        display: grid;
        width: 100%;
    }

    body.workspace .notes-filter-btn {
        min-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.workspace .notes-filter-pill,
    body.workspace .notes-filter-btn svg {
        transition: none;
        animation: none;
    }
}

/* ---------- Home: share / scan ---------- */
body.landing .share-section {
    padding: clamp(4.5rem, 10vh, 7.5rem) var(--landing-pad);
    border-top: 1px solid var(--ed-line);
    scroll-margin-top: 100px;
}

body.landing .share-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: clamp(2rem, 5vw, 5rem);
    align-items: center;
}

body.landing .share-copy {
    margin-bottom: 0;
}

body.landing .share-section h3 {
    font-size: clamp(2.4rem, 6vw, 4.6rem);
    line-height: 1;
}

body.landing .share-link {
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 460px;
    margin-top: clamp(1.6rem, 4vh, 2.2rem);
    padding: 14px 18px 14px 14px;
    border: 1px solid var(--ed-line);
    border-radius: 18px;
    color: var(--text-color);
    text-decoration: none;
    background: color-mix(in srgb, var(--surface-color) 70%, transparent);
    transition: border-color 0.3s ease, transform 0.4s var(--ed-ease);
}

body.landing .share-link:hover {
    border-color: var(--theme-color);
    transform: translateY(-2px);
}

body.landing .share-link-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--theme-color) 12%, transparent);
    color: var(--theme-color);
}

body.landing .share-link svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.landing .share-link-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(1rem, 1.6vw, 1.15rem);
    font-weight: 500;
}

body.landing .share-link-text b {
    color: var(--theme-color);
    font-weight: 600;
}

body.landing .share-link-arrow {
    flex: none;
    color: var(--ed-mute);
    transition: transform 0.4s var(--ed-ease), color 0.3s ease;
}

body.landing .share-link:hover .share-link-arrow {
    color: var(--theme-color);
    transform: translate(2px, -2px);
}

body.landing .share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

body.landing .share-actions .primary-auth-btn,
body.landing .share-actions .ghost-btn {
    padding: 13px 24px;
}

body.landing .share-copy-btn.is-copied {
    border-color: var(--theme-color);
    background: var(--theme-color);
    color: #fff;
}

body.landing .share-steps {
    display: grid;
    gap: 10px;
    margin: clamp(1.8rem, 4vh, 2.4rem) 0 0;
    padding: 0;
    list-style: none;
    color: var(--ed-mute);
    font-size: 15px;
}

body.landing .share-steps li {
    display: flex;
    align-items: baseline;
    gap: 14px;
}

body.landing .share-steps span {
    color: var(--theme-color);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    font-variant-numeric: tabular-nums;
}

body.landing .share-visual {
    position: relative;
    justify-self: center;
    width: 100%;
    max-width: 600px;
    margin: 0;
}

body.landing .share-glow {
    position: absolute;
    inset: 18% 8% 6%;
    z-index: -1;
    border-radius: 40%;
    background: var(--theme-color);
    opacity: 0.18;
    filter: blur(60px);
}

body.landing .share-visual img {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
}

@media (max-width: 900px) {
    body.landing .share-layout {
        grid-template-columns: 1fr;
    }

    body.landing .share-visual {
        max-width: 520px;
    }
}

@media (max-width: 640px) {
    body.landing .share-actions .primary-auth-btn,
    body.landing .share-actions .ghost-btn {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
        margin: 0;
    }
}

/* Scanner image swaps with the theme */
body.landing .share-visual .share-img-dark,
[data-theme="dark"] body.landing .share-visual .share-img-light {
    display: none;
}

[data-theme="dark"] body.landing .share-visual .share-img-dark {
    display: block;
}
