:root {
    color-scheme: dark;
    --workspace-background: #101114;
    --card-background: #1f2126;
    --card-border: #343740;
    --text-primary: #eceef3;
    --text-muted: #a0a7b6;
    --accent: #9db7ff;
    --app-header-height: 64px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: var(--workspace-background);
    color: var(--text-primary);
}


/* Landing */
.landing {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3.5rem 1.5rem 2.5rem;
    overflow: hidden;
}

.landing::before,
.landing::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    filter: blur(0);
    opacity: 0.65;
    pointer-events: none;
}

.landing::before {
    width: 460px;
    height: 460px;
    top: -160px;
    right: -140px;
    background: radial-gradient(circle, rgba(88, 120, 210, 0.35), rgba(11, 12, 15, 0));
}

.landing::after {
    width: 520px;
    height: 520px;
    bottom: -220px;
    left: -180px;
    background: radial-gradient(circle, rgba(66, 185, 255, 0.18), rgba(11, 12, 15, 0));
}

.landing-shell {
    width: min(1100px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 3rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.landing-copy {
    max-width: 34rem;
}

.landing-kicker {
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #8ea2d8;
}

.landing-title {
    margin: 0.6rem 0 1rem;
    font-size: clamp(2.4rem, 4vw, 3.4rem);
    line-height: 1.05;
    font-weight: 650;
}

.landing-description {
    margin: 0;
    font-size: 1.05rem;
    color: #c7cbda;
}

.landing-actions {
    margin-top: 1.6rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}

.landing .landing-login {
    inline-size: 240px;
    display: inline-flex;
    min-height: 44px;
    max-width: 100%;
}

.landing-hint {
    margin: 0;
    font-size: 0.85rem;
    color: #8ea2d8;
}

.landing-status {
    margin-top: 0.6rem;
    font-size: 0.85rem;
    color: #8ea2d8;
}

.landing-status[data-status="error"] {
    color: #f2b5b5;
}

.landing-status[data-status="loading"] {
    color: #8ea2d8;
}

.landing-visual {
    position: relative;
    min-height: 320px;
    display: grid;
    align-content: center;
    gap: 1.2rem;
}

.landing-card {
    min-height: 136px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: var(--card-background);
    position: relative;
}


.landing-card > * {
    position: relative;
    z-index: 1;
}

.landing-card-eyebrow {
    margin: 0;
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
}

.landing-card-title {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.2;
    font-weight: 600;
    color: var(--text-primary);
}

.landing-card-copy {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.landing-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.landing-card-tag {
    padding: 0.28rem 0.58rem;
    border-radius: 999px;
    border: 1px solid #414653;
    background: #252b38;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    color: #c6d4f5;
}

.landing-card--primary {
    transform: translateX(10px);
}

.landing-card--secondary {
    opacity: 0.9;
    transform: translateX(-16px);
}

.landing-card--tertiary {
    opacity: 0.82;
    transform: translateX(26px);
}

.landing-footer {
    margin-top: 3rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: block;
    padding: 0;
    background: var(--workspace-background);
    border-bottom: 1px solid var(--card-border);
}
.app-branding { display: flex; flex-direction: column; }
.app-title { margin: 0; font-size: 1.05rem; font-weight: 600; }
.app-subtitle { margin-top: 0.15rem; font-size: 0.85rem; opacity: 0.7; }
.app-auth {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
    position: relative;
}
.app-auth mpr-user {
    --mpr-user-scale: 0.9;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.app-control-button {
    background: transparent;
    border: 1px solid #28314a;
    border-radius: 6px;
    color: #7aa2ff;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.3rem 0.6rem;
    transition: border-color 0.12s ease, color 0.12s ease, opacity 0.12s ease;
}

.app-hidden-button {
    display: none;
}
.app-control-button:hover {
    color: #b4c8ff;
    border-color: #3a4b71;
}

/* Containers */
.block-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Both note cards use the same grid skeleton */
.markdown-block {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 84px;
    align-items: start;
    gap: 20px;
    width: 100%;
    margin: 0;
    padding: 12px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

/* Content column */
.markdown-content,
.markdown-editor,
.note-badges { grid-column: 1; }

.card-content {
    grid-column: 1;
    min-width: 0;
    overflow-wrap: anywhere;
    display: flex;
    flex-direction: column;
    gap: 0;
    align-self: stretch;
}

.card-content .note-html-view,
.card-content .markdown-editor {
    grid-column: auto;
}

.note-badges:not(:empty) {
    margin-bottom: 0.35rem;
}

.card--has-badges .card-controls {
    margin-top: 0;
}

.meta-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    text-align: right;
    gap: 0.35rem;
    margin: 0;
    align-self: stretch;
}
.meta-chip {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: 0.72rem; padding: 0.18rem 0.4rem; border-radius: 0.35rem;
    background: #16181c; border: 1px solid #343740; color: #cfd7ff;
}
.meta-chip--privacy { border-color: #3a2d3f; color: #f2c8ff; }
.meta-chip--status  { border-color: #234630; color: #c7ffd9; }
.meta-chip--cat     { border-color: #293a63; color: #c9dbff; }

.note-badges {
    grid-column: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.72rem;
    color: #aebcf3;
}

.note-badge {
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(48, 58, 92, 0.35);
    border: 1px solid rgba(65, 80, 120, 0.65);
    line-height: 1.25;
    letter-spacing: 0.01em;
}

.note-badge--code {
    background: rgba(42, 67, 58, 0.45);
    border-color: rgba(86, 123, 104, 0.65);
    color: #a9f3c6;
}

.note-html-view {
    position: relative;
    grid-column: 1;
    max-height: 18vh;
    overflow: hidden;
    border-radius: 0;
}

.note-html-view.note-html-view--toggle-hover {
    cursor: pointer;
}

.note-html-view::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3.5rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.16s ease;
    background: linear-gradient(180deg, transparent 0%, var(--workspace-background) 100%);
}

.note-html-view.note-html-view--overflow::after {
    opacity: 1;
}

.note-html-view.note-html-view--expanded {
    max-height: none;
    overflow: visible;
}

.note-html-view--expanded .markdown-content {
    padding-bottom: 2.75rem;
}

.note-html-view.note-html-view--expanded::after {
    opacity: 0;
}

.note-expand-toggle {
    position: absolute;
    left: 50%;
    bottom: 0.35rem;
    transform: translateX(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    width: 2.1rem;
    height: 2.1rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.note-expand-toggle__icon {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background-color: rgba(14, 18, 30, 0.9);
    box-shadow: 0 0 6px rgba(10, 12, 18, 0.85);
    transition: background-color 0.18s ease;
    display: block;
}

.note-expand-toggle__ring {
    fill: none;
    stroke: #d8e4ff;
    stroke-width: 1.4;
    opacity: 0.88;
    transition: stroke 0.12s ease, opacity 0.12s ease;
}

.note-expand-toggle__arrow {
    fill: none;
    stroke: #d8e4ff;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    transform-origin: 12px 12px;
    transition: transform 0.18s ease, stroke 0.12s ease;
}

.note-expand-toggle:hover .note-expand-toggle__icon {
    background-color: rgba(21, 27, 43, 0.95);
}

.note-expand-toggle:hover .note-expand-toggle__ring,
.note-expand-toggle:hover .note-expand-toggle__arrow {
    stroke: #ffffff;
    opacity: 1;
}

.note-expand-toggle[aria-expanded="true"] .note-expand-toggle__arrow {
    transform: rotate(180deg);
}

.note-task-checkbox {
    margin-right: 0.4rem;
    cursor: pointer;
}

/* HTML VIEW (rendered markdown) */
.markdown-content {
    white-space: normal;                /* let HTML decide layout */
    line-height: 1.5;
    font-size: 1rem;
    padding: 0.25rem 0;
    margin: 0;
    min-height: 2.2rem;                 /* matches editor baseline so no jump */
}
.markdown-content p { margin: 0; }    /* kill default p margins to stabilize height */
.markdown-content p + p {
    margin-top: 0.6rem;
}
.markdown-content ul,
.markdown-content ol { margin: 0.25rem 0 0.25rem 1.2rem; }

.markdown-content img {
    display: block;
    max-width: min(100%, 70vw);
    max-height: 60vh;
    width: auto;
    height: auto;
    margin: 0.35rem 0;
    object-fit: contain;
    object-position: top left;
}

.note-html-view .markdown-content {
    padding-right: 0.25rem;
}



.note-html-view--placeholder {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: rgba(191, 202, 245, 0.8);
    font-size: 0.95rem;
}
.note-html-view--placeholder .note-html-view__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: rgba(96, 122, 194, 0.35);
    color: #d5deff;
    font-size: 1.1rem;
}

/* Tables */
.markdown-content table {
    display: block;
    overflow-x: auto;
    width: fit-content;
    max-width: 100%;
    border-collapse: collapse;
    margin: 0.25rem 0;
}
.markdown-content th, .markdown-content td {
    border: 1px solid #2a2f3a;
    padding: 0.4rem 0.6rem;
}
.markdown-content th {
    background: #141820;
    font-weight: 600;
}

/* EDITOR */
.markdown-editor {
    display: none;
    width: 100%;
    border: none;
    outline: none;
    font: inherit;
    background: transparent;
    color: #e7e9ee;
    caret-color: #e7e9ee;
    resize: none;
    overflow: hidden;
    white-space: pre-wrap;

    /* baseline so the caret shows up before first input */
    min-height: 2.2rem;
    line-height: 1.5;
    padding: 0.25rem 0; /* match html view padding */
}

.markdown-editor--enhanced {
    opacity: 0;
    color: transparent;
    caret-color: transparent;
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(100%);
}

/* Mode toggles */
.edit-mode .markdown-content,
.editing-in-place .markdown-content,
.markdown-editor-host--edit .markdown-content { display: none; }
.edit-mode .markdown-editor,
.editing-in-place .markdown-editor,
.markdown-editor-host--edit .markdown-editor { display: block; }

.markdown-editor-host--view .markdown-editor,
.markdown-editor-host--view .CodeMirror { display: none; }
.markdown-editor-host--view .markdown-content { display: block; }
.markdown-editor-host--view.editing-in-place .markdown-content { display: none; }
.markdown-editor-host--edit .CodeMirror { display: block; }

/* Actions column (cards only) */
.card-controls {
    grid-column: 2;
    grid-row: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    justify-self: stretch;
    align-self: start;
    text-align: right;
}
.actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    min-width: 0;
}
.action-group { display: flex; flex-direction: column; gap: 0.35rem; }
.action-group--row { flex-direction: row; gap: 0.25rem; }
.action-button {
    background: #22252d;
    border: 1px solid #414653;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    font-size: 0.8rem;
    color: #c6d4f5;
    padding: 4px;
    min-width: 32px;
    min-height: 32px;
    line-height: 1.2;
    text-align: center;
    opacity: 1;
    transition: border-color 0.12s ease, color 0.12s ease;
}
.action-group--row .action-button { flex: 1; }

.markdown-block--pinned {
    position: sticky;
    top: var(--pinned-top-offset, calc(var(--app-header-height) + 12px));
    z-index: 4;
    background: var(--workspace-background);
}

.markdown-block.top-editor .markdown-content,
.markdown-block.top-editor .markdown-editor {
    font-size: 1rem;
    line-height: 1.5;
    min-height: 2.2rem;
    padding: 0.25rem 0;
}

.markdown-block.top-editor .EasyMDEContainer .editor-preview,
.markdown-block.top-editor .EasyMDEContainer .editor-preview-side {
    display: none !important;
    width: 0 !important;
    max-width: 0 !important;
    min-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
}

.action-button--compact { font-size: 0.72rem; padding: 0.16rem 0.3rem; }
.action-button--icon {
    font-size: 0.7rem;
    padding: 0.16rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.action-button--pin {
    width: 1.6rem;
    height: 1.6rem;
    padding: 0;
    border-radius: 999px;
    position: relative;
}
.action-button--pin::before {
    content: "";
    display: block;
    width: 0.9rem;
    height: 0.9rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237aa2ff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h12a1 1 0 0 1 1 1v16.5l-7-3.5-7 3.5V4a1 1 0 0 1 1-1z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    margin: 0 auto;
    transition: filter 0.2s ease, opacity 0.2s ease;
    opacity: 0.7;
}
.action-button--pressed.action-button--pin::before,
.action-button--pin[aria-pressed="true"]::before {
    filter: drop-shadow(0 0 3px rgba(122, 162, 255, 0.75));
    opacity: 1;
}
.action-button--toggle {
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 9999px;
    align-self: flex-end;
}
.action-button--pressed,
.action-button--toggle[aria-pressed="true"] {
    background: rgba(122, 162, 255, 0.12);
    border-color: #7aa2ff;
    color: #c6d7ff;
    opacity: 1;
}
.action-group--row .action-button--icon {
    flex: 0 0 auto;
}
.markdown-block:hover .action-button,
.markdown-block.edit-mode .action-button,
.markdown-block.editing-in-place .action-button { opacity: 1; }
.action-button:hover { color: #b4c8ff; border-color: #3a4b71; }

.clipboard-feedback {
    align-self: flex-start;
    background: rgba(30, 81, 50, 0.9);
    border: 1px solid #3b9a5f;
    border-radius: 4px;
    color: #9df6b9;
    font-size: 0.72rem;
    padding: 0.18rem 0.4rem;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateY(-4px);
    margin-top: -0.1rem;
}

.clipboard-feedback--visible {
    opacity: 1;
    transform: translateY(0);
}

/* Editor toolbar */
.editor-mode-toolbar {
    grid-column: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.editor-mode-toggle-group,
.editor-mode-utility-group {
    display: inline-flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.editor-mode-utility-group { margin-left: auto; }

.editor-button {
    background: transparent;
    border: 1px solid #28314a;
    border-radius: 6px;
    color: #9db7ff;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    line-height: 1.2;
    transition: border-color 0.12s ease, color 0.12s ease, background-color 0.12s ease;
}

.editor-button:hover {
    border-color: #3a4b71;
    color: #c4d4ff;
}

.editor-mode-toggle.is-active {
    background: #1a2237;
    border-color: #3a4b71;
    color: #d6e2ff;
}

.markdown-editor-host--view .editor-mode-toggle[aria-pressed="true"] {
    background: #121420;
}

.markdown-editor-host--edit .editor-mode-toggle[aria-pressed="true"] {
    background: #1f2840;
}

/* EasyMDE skin tweaks */
.EasyMDEContainer {
    grid-column: 1;
    width: 100%;
    background: transparent !important;
}

.CodeMirror {
    grid-column: 1;
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: auto !important;
    background: transparent !important;
    color: #e7e9ee;
    font-family: inherit;
    border: none !important;
    border-radius: 0;
    box-shadow: none;
    padding: 0 !important;
    line-height: 1.5;
    min-height: 2.2rem;
}

.CodeMirror-cursor {
    border-left: 1px solid #e7e9ee;
}

.EasyMDEContainer .CodeMirror {
    font-family: inherit;
    line-height: 1.3;
}

.CodeMirror-lines {
    padding: 0.25rem 0.25rem 0.25rem 0;
}

.CodeMirror pre {
    padding: 0;
    color: inherit;
    background: transparent;
}

.CodeMirror-scroll {
    width: 100%;
    height: auto !important;
    min-height: 2.2rem !important;
    box-sizing: border-box;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
}

.CodeMirror-hscrollbar,
.CodeMirror-scrollbar-filler,
.CodeMirror-gutter-filler {
    display: none !important;
}

.markdown-block.top-editor .CodeMirror {
    height: auto !important;
}

.cm-header { color: #9db7ff; }
.cm-strong { color: #f9d67a; }
.cm-em { color: #f5a7ff; }
.cm-link { color: #7ad4ff; }
.cm-quote { color: #8adca1; }

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

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translate(-50%, 0.75rem);
    background: rgba(36, 62, 48, 0.92);
    border: 1px solid rgba(63, 124, 82, 0.9);
    border-radius: 999px;
    padding: 0.45rem 1.1rem;
    color: #c8fad9;
    font-size: 0.85rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 120;
}

.toast--visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.toast[hidden] {
    display: none;
}

/* Keyboard shortcuts modal */
.keyboard-shortcuts-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(8, 12, 22, 0.78);
    z-index: 1200;
}

.keyboard-shortcuts-overlay[hidden] { display: none; }

.keyboard-shortcuts-modal {
    position: relative;
    width: min(520px, 100%);
    background: #111723;
    border: 1px solid #27324a;
    border-radius: 14px;
    padding: 1.75rem 1.6rem;
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.45);
    color: #e7e9ee;
}

.keyboard-shortcuts-title {
    margin: 0 0 1.2rem;
    font-size: 1.4rem;
    font-weight: 600;
    color: #dbe3ff;
}

.keyboard-shortcuts-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: #98a6cd;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
}

.keyboard-shortcuts-close:hover,
.keyboard-shortcuts-close:focus {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    outline: none;
}

.keyboard-shortcuts-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.keyboard-shortcut {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.keyboard-shortcut-description {
    margin: 0;
    font-size: 0.95rem;
    color: #c7d2f2;
    flex: 1;
}

.keyboard-shortcut-keys {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.35rem;
}

.keyboard-shortcut-keys-group {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.keyboard-shortcut-keys kbd {
    background: #1c2333;
    border: 1px solid #36405a;
    border-radius: 6px;
    padding: 0.28rem 0.6rem;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.85rem;
    color: #f4f6ff;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.28);
    min-width: 2.1rem;
    text-align: center;
}

.keyboard-shortcut-keys-plus {
    color: #6e7793;
    font-size: 0.85rem;
}

body.keyboard-shortcuts-open {
    overflow: hidden;
}

.app-footer {
    margin-top: auto;
}

/* One shared surface for capture and persisted cards. */
.card-stream {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 12px 0 48px;
    flex: 1;
}

#top-editor { margin-bottom: 12px; }
.markdown-content { cursor: text; }
.markdown-content > :first-child { margin-top: 0; }
.markdown-content > :last-child { margin-bottom: 0; }
.markdown-content h1, .cm-s-easymde .cm-header-1 { font-size: 1.4rem; }
.markdown-content h2, .cm-s-easymde .cm-header-2 { font-size: 1.2rem; }
.markdown-content h3, .cm-s-easymde .cm-header-3 { font-size: 1.05rem; }
.markdown-content :is(h4, h5, h6), .cm-s-easymde :is(.cm-header-4, .cm-header-5, .cm-header-6) { font-size: 1rem; }
.markdown-content :is(h1, h2, h3, h4, h5, h6) { line-height: 1.4; margin: 0.7em 0 0.4em; }
.markdown-content a { color: var(--accent); }
.markdown-content blockquote { margin: 0.75rem 0; padding-left: 1rem; border-left: 3px solid #6478a0; color: #b8c1d4; }
.markdown-content pre { max-width: 100%; overflow-x: auto; padding: 12px; border-radius: 6px; background: #11141b; }
.markdown-content code { font-family: ui-monospace, monospace; font-size: 0.88em; color: #d6e1ff; }
.markdown-content :not(pre) > code { background: #282e3d; padding: 0.1em 0.3em; border-radius: 4px; }
.card-controls .action-group { grid-column: 1 / -1; }
.actions [data-action="copy-note"] { grid-column: 1; grid-row: 2; }
.actions [data-action="delete"] { grid-column: 2; grid-row: 2; }
.actions [data-action^="merge-"] { grid-column: 1 / -1; }
.actions [data-action="delete"]:hover { color: #ffb6b1; border-color: #b36969; }
.actions :is(.action-button, .notebook-dictate-button) { width: 100%; height: 32px; min-height: 32px; border-radius: 6px; }
.actions .action-group--row .action-button { flex: 1; }
.actions .notebook-dictate-button { width: 100%; }
.top-editor .actions { display: flex; align-items: flex-end; }
.top-editor .notebook-dictate-button { width: 32px; }
:is(button, a, input):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.notebook-dictate-button {
    width: 1.6rem;
    height: 1.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid #414653;
    background: #22252d;
    color: #c6d4f5;
    cursor: pointer;
    box-shadow: none;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.notebook-dictate-button__mic {
    width: 1rem;
    height: 1rem;
    display: block;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M12 15c1.9 0 3.2-1.35 3.2-3.35V6.15C15.2 4.2 13.9 3 12 3S8.8 4.2 8.8 6.15v5.5C8.8 13.65 10.1 15 12 15ZM6.5 10.8c0 3.1 2.15 5.4 5.5 5.4s5.5-2.3 5.5-5.4M12 16.2V21M8.7 21h6.6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M12 15c1.9 0 3.2-1.35 3.2-3.35V6.15C15.2 4.2 13.9 3 12 3S8.8 4.2 8.8 6.15v5.5C8.8 13.65 10.1 15 12 15ZM6.5 10.8c0 3.1 2.15 5.4 5.5 5.4s5.5-2.3 5.5-5.4M12 16.2V21M8.7 21h6.6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.notebook-dictate-button__stop {
    display: none;
    width: 0.62rem;
    height: 0.62rem;
    border-radius: 2px;
    background: currentColor;
}

.notebook-dictate-button:hover,
.notebook-dictate-button:focus {
    background: #30394d;
    color: #fff;
    outline: none;
    box-shadow: none;
}

.notebook-dictate-button.is-recording {
    color: #b92621;
    background: #382124;
    box-shadow: 0 0 0 3px rgba(185, 38, 33, 0.12);
}

.notebook-dictate-button.is-recording .notebook-dictate-button__mic {
    display: none;
}

.notebook-dictate-button.is-recording .notebook-dictate-button__stop {
    display: block;
}

.notebook-dictation-status {
    position: fixed;
    left: 50%;
    bottom: 1.35rem;
    z-index: 20;
    transform: translateX(-50%);
    padding: 0.48rem 0.85rem;
    border-radius: 999px;
    border: 1px solid #414653;
    background: #22252d;
    color: #eceef3;
    box-shadow: 0 12px 28px rgba(72, 52, 20, 0.18);
    font-size: 0.86rem;
}

.notebook-dictation-status[data-state="error"] {
    color: #ffb6b1;
    border-color: rgba(142, 34, 30, 0.22);
}

.notebook-dictation-status[data-state="success"] {
    color: #a3e4b0;
    border-color: rgba(40, 97, 52, 0.22);
}


@media (max-width: 760px) {
    .card-stream { width: calc(100% - 24px); }
    .markdown-block { grid-template-columns: minmax(0, 1fr) 70px; gap: 12px; }
    .landing-shell { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
    .landing-visual { min-height: 0; }
    .landing-card { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
