/* Remote Manager - Styles */

/* Base */
body { 
    font-family: 'Fira Sans', system-ui, sans-serif; 
}

/* Status indicators */
.status-online { color: #22c55e; }
.status-offline { color: #ef4444; }

/* Tabs */
.tab-active { 
    border-bottom: 2px solid #3b82f6; 
    color: #3b82f6; 
}

/* Terminal */
.terminal { 
    font-family: 'Fira Code', 'Consolas', monospace; 
}

/* Animations */
.fade-in { 
    animation: fadeIn 0.3s ease-out; 
}

@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(-4px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* Effects */
.glow-text { 
    text-shadow: 0 0 10px currentColor; 
}

.stat-value { 
    font-variant-numeric: tabular-nums; 
}

/* Copy button */
.copy-btn {
    opacity: 0;
    transition: opacity 0.15s ease;
}

tr:hover .copy-btn,
.copy-btn:focus {
    opacity: 1;
}

.copy-btn:active {
    transform: scale(0.95);
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(34, 197, 94, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 1.7s forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Team notes */
.notes-shell {
    --notes-bg: #0f172a;
    --notes-panel: #172033;
    --notes-panel-strong: #111827;
    --notes-panel-soft: #1d293d;
    --notes-border: rgba(148, 163, 184, 0.18);
    --notes-border-strong: rgba(148, 163, 184, 0.32);
    --notes-text: #f1f5f9;
    --notes-muted: #a8b3c7;
    --notes-dim: #8391a7;
    --notes-accent: #60a5fa;
    --notes-accent-strong: #3b82f6;
    --notes-danger: #fda4af;
    color: var(--notes-text);
    max-width: 1280px;
    margin: 0 auto;
    padding-bottom: 3rem;
}

.notes-shell ::selection,
.notes-drawer ::selection {
    color: #eff6ff;
    background: rgba(59, 130, 246, 0.55);
}

.notes-shell button,
.notes-shell input,
.notes-shell textarea,
.notes-drawer button,
.notes-drawer input,
.notes-drawer textarea {
    font: inherit;
}

.notes-shell button:focus-visible,
.notes-shell input:focus-visible,
.notes-shell textarea:focus-visible,
.notes-drawer button:focus-visible,
.notes-drawer input:focus-visible,
.notes-drawer textarea:focus-visible {
    outline: 2px solid var(--notes-accent, #60a5fa);
    outline-offset: 2px;
}

.notes-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin: 0.25rem 0 1.6rem;
}

.notes-page-header h2 {
    color: var(--notes-text);
    font-size: clamp(1.55rem, 2.4vw, 2rem);
    font-weight: 650;
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.notes-page-header p {
    max-width: 68ch;
    margin-top: 0.55rem;
    color: var(--notes-muted);
    font-size: 0.93rem;
    line-height: 1.55;
}

.notes-sync-state {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: max-content;
    color: var(--notes-muted);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
}

.notes-sync-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: #4ade80;
}

.notes-sync-state[data-state="working"] .notes-sync-dot {
    background: #fbbf24;
    animation: notesPulse 1.2s ease-in-out infinite;
}

.notes-sync-state[data-state="error"] .notes-sync-dot {
    background: #fb7185;
}

.notes-mode-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    color: #fde68a;
    background: rgba(120, 53, 15, 0.22);
    border: 1px solid rgba(251, 191, 36, 0.28);
    border-radius: 0.75rem;
}

.notes-mode-notice.hidden {
    display: none;
}

.notes-mode-notice svg {
    flex: 0 0 auto;
    width: 1.15rem;
    height: 1.15rem;
    margin-top: 0.1rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.notes-mode-notice div {
    display: grid;
    gap: 0.15rem;
}

.notes-mode-notice strong {
    font-size: 0.82rem;
    font-weight: 600;
}

.notes-mode-notice span {
    color: #fcd995;
    font-size: 0.78rem;
    line-height: 1.45;
}

.notes-composer {
    overflow: hidden;
    margin-bottom: 1.2rem;
    background: var(--notes-panel);
    border: 1px solid var(--notes-border);
    border-radius: 0.9rem;
    transition: border-color 180ms ease-out, background-color 180ms ease-out;
}

.notes-composer:focus-within,
.notes-composer.is-expanded {
    background: #19243a;
    border-color: rgba(96, 165, 250, 0.52);
}

.notes-composer-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    min-height: 3.6rem;
    padding: 0.55rem 0.65rem 0.55rem 1rem;
}

.notes-composer-icon {
    width: 1.2rem;
    height: 1.2rem;
    fill: none;
    stroke: var(--notes-dim);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.notes-composer-main textarea {
    width: 100%;
    max-height: 8rem;
    padding: 0.55rem 0;
    overflow-y: auto;
    color: var(--notes-text);
    background: transparent;
    border: 0;
    outline: 0;
    resize: none;
    line-height: 1.5;
    caret-color: var(--notes-accent);
}

.notes-composer-main textarea::placeholder,
.notes-composer input::placeholder,
.notes-search input::placeholder,
.notes-drawer input::placeholder,
.notes-drawer textarea::placeholder {
    color: #7f8da3;
    opacity: 1;
}

.notes-save-compact {
    padding: 0.55rem 0.9rem;
    color: #dbeafe;
    background: rgba(59, 130, 246, 0.13);
    border: 1px solid rgba(96, 165, 250, 0.28);
    border-radius: 0.62rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.notes-composer.is-expanded .notes-save-compact {
    visibility: hidden;
}

.notes-composer-expanded {
    display: grid;
    grid-template-rows: 0fr;
    padding: 0 1rem;
    opacity: 0;
    visibility: hidden;
    border-top: 1px solid transparent;
    transition: grid-template-rows 200ms cubic-bezier(0.16, 1, 0.3, 1), opacity 160ms ease-out,
        padding 200ms cubic-bezier(0.16, 1, 0.3, 1), border-color 160ms ease-out;
}

.notes-composer.is-expanded .notes-composer-expanded {
    grid-template-rows: auto;
    padding-top: 0.95rem;
    padding-bottom: 0.9rem;
    opacity: 1;
    visibility: visible;
    border-top-color: var(--notes-border);
}

.notes-composer-expanded > input {
    width: 100%;
    padding: 0.72rem 0.8rem;
    color: var(--notes-text);
    background: var(--notes-panel-strong);
    border: 1px solid var(--notes-border);
    border-radius: 0.68rem;
    caret-color: var(--notes-accent);
}

.notes-composer-hint,
.notes-composer-footer,
.notes-composer-tools,
.notes-composer-actions {
    display: flex;
    align-items: center;
}

.notes-composer-hint {
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.55rem;
    color: var(--notes-dim);
    font-size: 0.73rem;
}

.notes-composer-hint > span:last-child {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.notes-composer-hint kbd,
.notes-search kbd {
    padding: 0.08rem 0.32rem;
    color: #cbd5e1;
    background: #0b1220;
    border: 1px solid var(--notes-border-strong);
    border-radius: 0.3rem;
    font-family: inherit;
    font-size: 0.68rem;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.notes-composer-footer {
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.8rem;
}

.notes-composer-tools {
    gap: 0.8rem;
    color: var(--notes-dim);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.notes-composer-actions {
    gap: 0.55rem;
}

.notes-text-button,
.notes-secondary-button,
.notes-primary-button {
    border: 0;
    cursor: pointer;
}

.notes-text-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.1rem;
    color: var(--notes-muted);
    background: transparent;
    font-size: 0.78rem;
}

.notes-text-button:hover {
    color: var(--notes-text);
}

.notes-text-button svg {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.notes-secondary-button,
.notes-primary-button {
    padding: 0.58rem 0.9rem;
    border-radius: 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.notes-secondary-button {
    color: var(--notes-muted);
    background: transparent;
}

.notes-secondary-button:hover {
    color: var(--notes-text);
    background: rgba(148, 163, 184, 0.09);
}

.notes-primary-button {
    color: white;
    background: var(--notes-accent-strong);
}

.notes-primary-button:hover {
    background: #2563eb;
}

.notes-primary-button:disabled,
.notes-save-compact:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.notes-image-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    min-height: 0;
    margin-top: 0.65rem;
}

.notes-image-strip:empty {
    display: none;
}

.notes-image-thumb {
    position: relative;
    width: 4.5rem;
    height: 4.5rem;
}

.notes-image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.62rem;
}

.notes-image-thumb button {
    position: absolute;
    top: 0.28rem;
    right: 0.28rem;
    display: grid;
    width: 1.45rem;
    height: 1.45rem;
    place-items: center;
    color: white;
    background: rgba(15, 23, 42, 0.88);
    border: 0;
    border-radius: 999px;
    cursor: pointer;
}

.notes-image-thumb svg {
    width: 0.78rem;
    height: 0.78rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 2;
}

.notes-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.7rem;
}

.notes-view-switcher {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem;
    overflow-x: auto;
    background: rgba(15, 23, 42, 0.58);
    border-radius: 0.7rem;
}

.notes-view-switcher button {
    min-width: max-content;
    padding: 0.48rem 0.68rem;
    color: var(--notes-muted);
    background: transparent;
    border: 0;
    border-radius: 0.5rem;
    font-size: 0.78rem;
    cursor: pointer;
}

.notes-view-switcher button:hover {
    color: var(--notes-text);
}

.notes-view-switcher button[aria-selected="true"] {
    color: #eff6ff;
    background: #27344a;
}

.notes-view-switcher span {
    margin-left: 0.25rem;
    color: var(--notes-dim);
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
}

.notes-view-switcher button[aria-selected="true"] span {
    color: #bfdbfe;
}

.notes-search {
    position: relative;
    display: flex;
    align-items: center;
    width: min(22rem, 100%);
}

.notes-search svg {
    position: absolute;
    left: 0.78rem;
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: var(--notes-dim);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    pointer-events: none;
}

.notes-search input {
    width: 100%;
    padding: 0.65rem 2.4rem 0.65rem 2.35rem;
    color: var(--notes-text);
    background: var(--notes-panel-strong);
    border: 1px solid var(--notes-border);
    border-radius: 0.68rem;
    caret-color: var(--notes-accent);
}

.notes-search kbd {
    position: absolute;
    right: 0.7rem;
}

.notes-list-meta {
    min-height: 1.15rem;
    margin: 0.85rem 0;
    color: var(--notes-dim);
    font-size: 0.75rem;
}

.notes-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.notes-card {
    position: relative;
    display: flex;
    min-height: 12.5rem;
    flex-direction: column;
    overflow: visible;
    background: var(--notes-panel);
    border: 1px solid var(--notes-border);
    border-radius: 0.82rem;
    transition: border-color 160ms ease-out, background-color 160ms ease-out, transform 160ms ease-out;
}

.notes-card:hover,
.notes-card:focus-within {
    background: #1a263b;
    border-color: var(--notes-border-strong);
    transform: translateY(-1px);
}

.notes-card.is-pinned {
    background: #18243a;
    border-color: rgba(96, 165, 250, 0.3);
}

.notes-card-open {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    flex: 1;
    width: 100%;
    padding: 1rem 1rem 0.7rem;
}

.notes-card-content {
    min-width: 0;
    padding: 0;
    color: inherit;
    text-align: left;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.notes-card-copy {
    position: relative;
    align-self: start;
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.22);
    border-radius: 0.55rem;
    cursor: pointer;
}

.notes-card-copy:hover {
    color: white;
    background: rgba(59, 130, 246, 0.24);
}

.notes-card-copy svg,
.notes-card-menu summary svg,
.notes-card-menu button svg,
.notes-icon-button svg {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.notes-card-title-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.notes-pin-mark {
    flex: 0 0 auto;
    width: 0.9rem;
    height: 0.9rem;
    margin-top: 0.22rem;
    fill: none;
    stroke: var(--notes-accent);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.notes-card h3 {
    display: -webkit-box;
    overflow: hidden;
    color: var(--notes-text);
    font-size: 0.96rem;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.012em;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.notes-card-excerpt {
    display: -webkit-box;
    min-height: 3.9rem;
    margin-top: 0.72rem;
    overflow: hidden;
    color: var(--notes-muted);
    font-size: 0.81rem;
    line-height: 1.6;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.notes-card-excerpt mark {
    padding: 0 0.12rem;
    color: #fef3c7;
    background: rgba(245, 158, 11, 0.24);
    border-radius: 0.2rem;
}

.notes-card-cover {
    width: 100%;
    height: 5.5rem;
    margin-top: 0.75rem;
    object-fit: cover;
    border-radius: 0.62rem;
}

.notes-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.65rem 0.8rem 0.75rem 1rem;
    border-top: 1px solid var(--notes-border);
}

.notes-card-meta {
    min-width: 0;
    overflow: hidden;
    color: var(--notes-dim);
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notes-card-menu {
    position: relative;
}

.notes-card-menu summary {
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    color: var(--notes-muted);
    border-radius: 0.5rem;
    cursor: pointer;
    list-style: none;
}

.notes-card-menu summary::-webkit-details-marker {
    display: none;
}

.notes-card-menu summary:hover {
    color: var(--notes-text);
    background: rgba(148, 163, 184, 0.09);
}

.notes-card-menu > div {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.4rem);
    z-index: 8;
    display: grid;
    min-width: 10.5rem;
    padding: 0.35rem;
    background: #0f1829;
    border: 1px solid var(--notes-border-strong);
    border-radius: 0.68rem;
    box-shadow: 0 14px 36px rgba(2, 6, 23, 0.42);
}

.notes-card-menu button {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.62rem;
    color: var(--notes-muted);
    text-align: left;
    background: transparent;
    border: 0;
    border-radius: 0.45rem;
    font-size: 0.76rem;
    cursor: pointer;
}

.notes-card-menu button:hover {
    color: var(--notes-text);
    background: rgba(148, 163, 184, 0.1);
}

.notes-card-menu button.is-danger {
    color: var(--notes-danger);
}

.notes-empty,
.notes-error {
    grid-column: 1 / -1;
    display: grid;
    min-height: 15rem;
    place-items: center;
    padding: 2rem;
    color: var(--notes-muted);
    text-align: center;
    background: rgba(15, 23, 42, 0.35);
    border: 1px dashed var(--notes-border-strong);
    border-radius: 0.85rem;
}

.notes-empty div,
.notes-error div {
    max-width: 28rem;
}

.notes-empty svg,
.notes-error svg {
    width: 2.2rem;
    height: 2.2rem;
    margin: 0 auto 0.9rem;
    fill: none;
    stroke: var(--notes-dim);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.5;
}

.notes-empty h3,
.notes-error h3 {
    color: var(--notes-text);
    font-size: 0.95rem;
    font-weight: 600;
}

.notes-empty p,
.notes-error p {
    margin-top: 0.45rem;
    font-size: 0.8rem;
    line-height: 1.55;
}

.notes-loading {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.notes-loading span {
    min-height: 12.5rem;
    background: linear-gradient(105deg, #172033 25%, #202d43 42%, #172033 60%);
    background-size: 240% 100%;
    border-radius: 0.82rem;
    animation: notesShimmer 1.5s ease-in-out infinite;
}

.notes-drawer-layer {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    justify-content: flex-end;
}

.notes-drawer-layer.hidden {
    display: none;
}

.notes-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.64);
    border: 0;
    cursor: default;
    backdrop-filter: blur(2px);
}

.notes-drawer {
    position: relative;
    display: flex;
    width: min(48rem, 92vw);
    height: 100%;
    flex-direction: column;
    color: var(--notes-text, #f1f5f9);
    background: #111a2a;
    box-shadow: -24px 0 64px rgba(2, 6, 23, 0.48);
    animation: notesDrawerIn 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

.notes-drawer-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.35rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.notes-drawer-heading {
    min-width: 0;
}

.notes-drawer-heading > span {
    display: inline-flex;
    margin-bottom: 0.4rem;
    color: #93c5fd;
    font-size: 0.72rem;
}

.notes-drawer-heading h3 {
    overflow: hidden;
    color: #f8fafc;
    font-size: 1.18rem;
    font-weight: 650;
    line-height: 1.35;
    letter-spacing: -0.018em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notes-drawer-heading p {
    margin-top: 0.38rem;
    color: #91a0b6;
    font-size: 0.75rem;
    line-height: 1.45;
}

.notes-icon-button {
    display: grid;
    flex: 0 0 auto;
    width: 2.15rem;
    height: 2.15rem;
    place-items: center;
    color: #a8b3c7;
    background: transparent;
    border: 0;
    border-radius: 0.55rem;
    cursor: pointer;
}

.notes-icon-button:hover {
    color: white;
    background: rgba(148, 163, 184, 0.1);
}

.notes-conflict {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.9rem 1.2rem 0;
    padding: 0.85rem 0.95rem;
    color: #fde68a;
    background: rgba(120, 53, 15, 0.24);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 0.68rem;
}

.notes-conflict.hidden {
    display: none;
}

.notes-conflict > div:first-child {
    display: grid;
    gap: 0.15rem;
}

.notes-conflict strong {
    font-size: 0.8rem;
}

.notes-conflict span {
    color: #fcd995;
    font-size: 0.73rem;
}

.notes-conflict > div:last-child {
    display: flex;
    gap: 0.4rem;
}

.notes-conflict button {
    min-width: max-content;
    padding: 0.42rem 0.58rem;
    color: #fef3c7;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.22);
    border-radius: 0.45rem;
    font-size: 0.72rem;
    cursor: pointer;
}

.notes-drawer-body,
.notes-drawer-editor {
    flex: 1;
    min-height: 0;
    padding: 1.5rem 1.4rem 2rem;
    overflow-y: auto;
}

.notes-drawer-body.hidden,
.notes-drawer-editor.hidden {
    display: none;
}

.notes-editor-tabs {
    display: inline-flex;
    gap: 0.2rem;
    margin-bottom: 1rem;
    padding: 0.2rem;
    background: #0b1322;
    border-radius: 0.58rem;
}

.notes-editor-tabs button {
    padding: 0.45rem 0.75rem;
    color: #9caac0;
    background: transparent;
    border: 0;
    border-radius: 0.42rem;
    font-size: 0.76rem;
    cursor: pointer;
}

.notes-editor-tabs button[aria-selected="true"] {
    color: #eff6ff;
    background: #26344b;
}

.notes-edit-pane {
    display: grid;
    gap: 0.95rem;
}

.notes-edit-pane.hidden,
.notes-markdown.hidden {
    display: none;
}

.notes-edit-pane label {
    display: grid;
    gap: 0.42rem;
    color: #a8b3c7;
    font-size: 0.75rem;
}

.notes-edit-pane input,
.notes-edit-pane textarea {
    width: 100%;
    padding: 0.75rem 0.85rem;
    color: #f1f5f9;
    background: #0b1322;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.65rem;
    caret-color: #60a5fa;
}

.notes-edit-pane textarea {
    min-height: 22rem;
    font-family: 'Fira Code', Consolas, monospace;
    font-size: 0.82rem;
    line-height: 1.65;
    resize: vertical;
    tab-size: 4;
}

.notes-editor-utility {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: #8391a7;
    font-size: 0.73rem;
    font-variant-numeric: tabular-nums;
}

.notes-markdown {
    max-width: 72ch;
    color: #dbe4f0;
    font-size: 0.91rem;
    line-height: 1.72;
    overflow-wrap: anywhere;
}

.notes-markdown > :first-child {
    margin-top: 0;
}

.notes-markdown > :last-child {
    margin-bottom: 0;
}

.notes-markdown h1,
.notes-markdown h2,
.notes-markdown h3,
.notes-markdown h4 {
    margin: 1.75em 0 0.55em;
    color: #f8fafc;
    font-weight: 650;
    line-height: 1.3;
    letter-spacing: -0.018em;
}

.notes-markdown h1 { font-size: 1.45rem; }
.notes-markdown h2 { font-size: 1.24rem; }
.notes-markdown h3 { font-size: 1.08rem; }
.notes-markdown h4 { font-size: 0.98rem; }

.notes-markdown p,
.notes-markdown ul,
.notes-markdown ol,
.notes-markdown blockquote,
.notes-markdown pre,
.notes-markdown table {
    margin: 0.8em 0;
}

.notes-markdown ul,
.notes-markdown ol {
    padding-left: 1.4rem;
}

.notes-markdown ul { list-style: disc; }
.notes-markdown ol { list-style: decimal; }

.notes-markdown li + li {
    margin-top: 0.32rem;
}

.notes-markdown a {
    color: #93c5fd;
    text-decoration: underline;
    text-decoration-color: rgba(147, 197, 253, 0.5);
    text-underline-offset: 0.18em;
}

.notes-markdown a:hover {
    color: #dbeafe;
    text-decoration-color: currentColor;
}

.notes-markdown code {
    padding: 0.14em 0.36em;
    color: #dbeafe;
    background: #0b1322;
    border-radius: 0.3rem;
    font-family: 'Fira Code', Consolas, monospace;
    font-size: 0.86em;
}

.notes-markdown pre {
    overflow-x: auto;
    padding: 0.9rem 1rem;
    color: #d8e2ef;
    background: #0a1220;
    border-radius: 0.65rem;
}

.notes-markdown pre code {
    padding: 0;
    color: inherit;
    background: transparent;
    border-radius: 0;
    font-size: 0.8rem;
}

.notes-markdown blockquote {
    padding: 0.25rem 0 0.25rem 0.9rem;
    color: #b4c0d2;
    border-left: 1px solid #64748b;
}

.notes-markdown img {
    display: block;
    max-width: 100%;
    max-height: 32rem;
    margin: 1rem 0;
    object-fit: contain;
    border-radius: 0.7rem;
}

.notes-markdown table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}

.notes-markdown th,
.notes-markdown td {
    padding: 0.55rem 0.68rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    text-align: left;
}

.notes-markdown th {
    color: #f1f5f9;
    font-weight: 600;
}

.notes-markdown input[type="checkbox"] {
    margin-right: 0.42rem;
    accent-color: #3b82f6;
}

.notes-markdown-fallback {
    margin: 0;
    color: #dbe4f0;
    font-family: 'Fira Sans', system-ui, sans-serif;
    white-space: pre-wrap;
}

.notes-legacy-images {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    max-width: 44rem;
    margin-top: 1.25rem;
}

.notes-legacy-images:empty {
    display: none;
}

.notes-legacy-images img {
    width: 100%;
    height: 11rem;
    object-fit: cover;
    border-radius: 0.7rem;
}

.notes-history {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    background: #111a2a;
}

.notes-history.hidden {
    display: none;
}

.notes-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.35rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.notes-history-header h4 {
    color: #f8fafc;
    font-size: 1rem;
    font-weight: 650;
}

#notesHistoryList {
    display: grid;
    gap: 0.7rem;
    padding: 1rem 1.25rem 2rem;
    overflow-y: auto;
}

.notes-history-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    padding: 0.9rem;
    background: #172033;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 0.7rem;
}

.notes-history-item h5 {
    overflow: hidden;
    color: #f1f5f9;
    font-size: 0.84rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notes-history-item p {
    display: -webkit-box;
    margin-top: 0.35rem;
    overflow: hidden;
    color: #9caac0;
    font-size: 0.75rem;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.notes-history-item small {
    display: block;
    margin-top: 0.45rem;
    color: #7f8da3;
    font-size: 0.68rem;
    font-variant-numeric: tabular-nums;
}

.notes-history-item button {
    align-self: center;
    padding: 0.48rem 0.62rem;
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.22);
    border-radius: 0.5rem;
    font-size: 0.73rem;
    cursor: pointer;
}

.notes-drawer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    min-height: 4.3rem;
    padding: 0.75rem 1.25rem;
    background: #0e1726;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.notes-drawer-footer > div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notes-footer-button {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    min-width: max-content;
    padding: 0.55rem 0.7rem;
    color: #a8b3c7;
    background: transparent;
    border: 0;
    border-radius: 0.52rem;
    font-size: 0.76rem;
    cursor: pointer;
}

.notes-footer-button:hover {
    color: white;
    background: rgba(148, 163, 184, 0.1);
}

.notes-footer-button.is-danger {
    color: #fda4af;
}

.notes-footer-button svg {
    width: 0.95rem;
    height: 0.95rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

@keyframes notesDrawerIn {
    from {
        transform: translateX(1.75rem);
        clip-path: inset(0 0 0 10%);
        filter: blur(2px);
    }
    to {
        transform: translateX(0);
        clip-path: inset(0 0 0 0);
        filter: blur(0);
    }
}

@keyframes notesPulse {
    50% { opacity: 0.4; }
}

@keyframes notesShimmer {
    0% { background-position: 120% 0; }
    100% { background-position: -120% 0; }
}

@media (max-width: 860px) {
    .notes-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .notes-search {
        width: 100%;
    }

    .notes-grid,
    .notes-loading {
        grid-template-columns: 1fr;
    }

    .notes-drawer {
        width: min(42rem, 96vw);
    }
}

@media (max-width: 560px) {
    .notes-page-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.65rem;
    }

    .notes-composer-main {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .notes-save-compact {
        display: none;
    }

    .notes-composer-footer,
    .notes-editor-utility,
    .notes-conflict {
        align-items: stretch;
        flex-direction: column;
    }

    .notes-composer-actions,
    .notes-conflict > div:last-child {
        justify-content: flex-end;
    }

    .notes-view-switcher {
        margin-inline: -0.2rem;
    }

    .notes-card {
        min-height: 11rem;
    }

    .notes-drawer {
        width: 100vw;
    }

    .notes-drawer-header,
    .notes-drawer-body,
    .notes-drawer-editor {
        padding-inline: 1rem;
    }

    .notes-drawer-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .notes-drawer-footer > div {
        justify-content: flex-end;
        overflow-x: auto;
    }

    .notes-legacy-images {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .notes-composer-expanded,
    .notes-card,
    .notes-drawer,
    .notes-loading span,
    .notes-sync-state[data-state="working"] .notes-sync-dot {
        animation: none;
        transition: none;
    }
}
