/* Notepad page spacing: tool ko heading ke paas rakhta hai. */
.qtd-notepad-page { padding: 38px 0 72px; }
.qtd-notepad-intro { margin-bottom: 24px; }
.qtd-notepad-intro h1 { font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1.2; }
.qtd-notepad-intro p:last-child { max-width: 780px; color: var(--text-light); margin-top: 8px; }

/* Editor shell: notes list aur writing area ko alag, readable columns deta hai. */
.qtd-notepad-app {
    display: grid;
    grid-template-columns: minmax(220px, 275px) minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
    min-height: 620px;
}
.qtd-notepad-sidebar,
.qtd-notepad-workspace {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow);
    padding: 20px;
    min-width: 0;
}

/* Sidebar controls: search aur notes list keyboard se aasani se milte hain. */
.qtd-notepad-sidebar { display: flex; flex-direction: column; gap: 12px; }
.qtd-notepad-sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.qtd-notepad-sidebar h2 { font-size: 1.2rem; }
.qtd-notepad-list { display: flex; flex-direction: column; gap: 6px; max-height: 480px; overflow-y: auto; }
.qtd-notepad-list-item { text-align: left; overflow-wrap: anywhere; }
.qtd-notepad-list-item[aria-current="true"] { background: #dbeafe; border-color: #93c5fd; }
.qtd-notepad-empty { color: var(--text-light); font-size: .9rem; }

/* Buttons ka shared shape; existing tool buttons ki styling ko nahi chhedta. */
.qtd-notepad-app button {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    color: #0f172a;
    padding: 9px 12px;
    font: inherit;
    font-size: .875rem;
    cursor: pointer;
}
.qtd-notepad-app button:hover { background: #eaf2ff; }
.qtd-notepad-app button:focus-visible,
.qtd-notepad-app input:focus-visible,
.qtd-notepad-app textarea:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
.qtd-notepad-app button:disabled { opacity: .5; cursor: not-allowed; }
.qtd-notepad-app .qtd-note-primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.qtd-notepad-app .qtd-note-primary:hover { background: #1d4ed8; }
.qtd-notepad-app .qtd-note-danger { color: #991b1b; border-color: #fecaca; }
.qtd-note-quiet { margin-top: auto; text-align: left; }

/* Editor inputs: title aur note ko alag hierarchy deta hai. */
.qtd-note-label { display: block; font-size: .8rem; font-weight: 600; color: #475569; }
.qtd-notepad-app input[type="text"],
.qtd-notepad-app input[type="search"],
.qtd-notepad-app textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #0f172a;
    background: #fff;
    font: inherit;
    padding: 10px 12px;
}
.qtd-notepad-topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 12px; align-items: center; }
.qtd-notepad-topbar .qtd-note-label { grid-column: 1 / -1; }
.qtd-notepad-topbar input { font-size: 1.25rem; font-weight: 600; }
#noteSaveStatus { color: #166534; white-space: nowrap; font-size: .8rem; }
.qtd-notepad-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.qtd-notepad-workspace textarea { min-height: 390px; resize: vertical; line-height: 1.7; margin-top: 6px; }
.qtd-notepad-status { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; color: #64748b; font-size: .8rem; }
.qtd-note-message { color: #1d4ed8; min-height: 1.6em; margin-top: 8px; }
.qtd-notepad-help { margin-top: 38px; max-width: 1200px; }
.qtd-notepad-help h2 { font-size: 1.4rem; margin-bottom: 8px; }
.qtd-notepad-help p { max-width: 830px; color: var(--text-light); }

/* Dark editor sirf app ke andar lagta hai; site ka logo aur shared theme same rehte hain. */
.qtd-notepad-dark .qtd-notepad-sidebar,
.qtd-notepad-dark .qtd-notepad-workspace { background: #111827; border-color: #334155; color: #f8fafc; }
.qtd-notepad-dark .qtd-note-label,
.qtd-notepad-dark .qtd-notepad-status { color: #cbd5e1; }
.qtd-notepad-dark input[type="text"],
.qtd-notepad-dark input[type="search"],
.qtd-notepad-dark textarea { background: #1e293b; color: #f8fafc; border-color: #475569; }
.qtd-notepad-dark button:not(.qtd-note-primary) { background: #1e293b; color: #f8fafc; border-color: #475569; }
.qtd-notepad-dark .qtd-notepad-list-item[aria-current="true"] { background: #1e3a5f; }
.qtd-notepad-dark #noteSaveStatus { color: #86efac; }

/* Tablet aur phone par sidebar editor ke upar aati hai; horizontal scroll nahi hota. */
@media (max-width: 800px) {
    .qtd-notepad-page { padding-top: 26px; }
    .qtd-notepad-app { grid-template-columns: 1fr; }
    .qtd-notepad-list { max-height: 190px; }
}
@media (max-width: 480px) {
    .qtd-notepad-sidebar,
    .qtd-notepad-workspace { padding: 15px; }
    .qtd-notepad-actions button { flex: 1 1 auto; text-align: center; }
    .qtd-notepad-workspace textarea { min-height: 340px; }
}

/* Formatting toolbar: editor ke controls ko wrap karta hai aur keyboard focus clear rakhta hai. */
.qtd-note-toolbar { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border: 1px solid #cbd5e1; border-radius: 8px; background: #f8fafc; margin-bottom: 10px; }
.qtd-note-toolbar button { min-width: 38px; }
.qtd-note-editor { width: 100%; min-height: 390px; padding: 12px; margin-top: 6px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #0f172a; line-height: 1.7; overflow-wrap: anywhere; }
.qtd-note-editor:empty::before { content: attr(data-placeholder); color: #64748b; pointer-events: none; }
.qtd-note-editor:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
.qtd-note-editor h2 { font-size: 1.4rem; margin: .5em 0; }
.qtd-note-editor ul, .qtd-note-editor ol { padding-left: 1.7rem; }
.qtd-note-editor a { color: #1d4ed8; text-decoration: underline; }
/* Dark mode mein toolbar aur editable sheet dono readable rehte hain. */
.qtd-notepad-dark .qtd-note-toolbar, .qtd-notepad-dark .qtd-note-editor { background: #1e293b; color: #f8fafc; border-color: #475569; }
.qtd-notepad-dark .qtd-note-editor a { color: #93c5fd; }
@media (max-width: 480px) { .qtd-note-editor { min-height: 340px; } }

/* Compact intro: header ke baad heading aur editor ko paas laata hai. */
.qtd-notepad-page { padding-top: 18px; }
.qtd-notepad-intro { margin-bottom: 14px; }
.qtd-notepad-intro .home-eyebrow { margin-bottom: 3px; }
.qtd-notepad-intro h1 { font-size: clamp(1.7rem, 3vw, 2.2rem); }
.qtd-notepad-intro p:last-child { margin-top: 3px; line-height: 1.4; }
/* Global ul reset ke baad editor ke list markers dobara dikhata hai. */
.qtd-note-editor ul { list-style: disc outside; }
.qtd-note-editor ol { list-style: decimal outside; }
.qtd-note-editor li { display: list-item; margin: .15em 0; }
/* Custom confirmation/link dialog: browser alert ke badle theme-jaisa surface. */
.qtd-note-dialog { border: 1px solid #cbd5e1; border-radius: 14px; padding: 22px; width: min(90vw, 430px); max-width: none; margin: auto; background: #fff; color: #0f172a; box-shadow: 0 20px 70px #0f172a55; }
.qtd-note-dialog::backdrop { background: #0f172a99; }
.qtd-note-dialog h2 { font-size: 1.25rem; margin-bottom: 8px; }
.qtd-note-dialog p { margin-bottom: 14px; }
.qtd-note-dialog input { display: block; width: 100%; border: 1px solid #94a3b8; border-radius: 8px; padding: 9px; margin: 8px 0 16px; }
.qtd-note-dialog input[hidden], .qtd-note-dialog label[hidden] { display: none; }
.qtd-note-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.qtd-note-dialog button { border: 1px solid #cbd5e1; border-radius: 8px; padding: 9px 14px; background: #f8fafc; cursor: pointer; font: inherit; }
.qtd-note-dialog .qtd-note-primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.qtd-note-dialog button:focus-visible, .qtd-note-dialog input:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
/* Success/error message editor ke paas aur page par unobtrusive toast mein aata hai. */
.qtd-note-toast { position: fixed; top: 90px; right: 20px; z-index: 999999; max-width: min(90vw, 380px); border-radius: 9px; background: #1e293b; color: #fff; padding: 10px 15px; box-shadow: 0 8px 24px #0f172a55; opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .18s, transform .18s, visibility .18s; pointer-events: none; }
.qtd-note-toast.show { opacity: 1; visibility: visible; transform: translateY(0); }
@media (max-width: 800px) { .qtd-notepad-page { padding-top: 16px; } }

/* Compact editor layout: title ke baad primary actions ek row mein; baaki More actions mein. */
.qtd-notepad-page { padding-top: 10px; }
.qtd-notepad-intro { margin-bottom: 9px; }
.qtd-notepad-intro .home-eyebrow { display: none; }
.qtd-notepad-intro h1 { font-size: clamp(1.55rem, 2.7vw, 2rem); line-height: 1.15; }
.qtd-notepad-intro p:last-child { font-size: .86rem; margin: 2px 0 0; max-width: none; }
.qtd-notepad-workspace { padding-top: 14px; }
.qtd-notepad-actions { align-items: center; gap: 6px; margin: 8px 0; }
.qtd-notepad-actions button, .qtd-note-more summary, .qtd-note-toolbar button, .qtd-note-toolbar select { padding: 6px 9px; font-size: .82rem; }
.qtd-note-more { position: relative; }
.qtd-note-more summary { list-style: none; border: 1px solid #cbd5e1; border-radius: 8px; background: #f8fafc; cursor: pointer; }
.qtd-note-more summary::-webkit-details-marker { display: none; }
.qtd-note-more summary::after { content: ' ▾'; }
.qtd-note-more-items { position: absolute; top: calc(100% + 5px); left: 0; z-index: 30; width: 210px; max-height: 65vh; overflow-y: auto; padding: 8px; display: grid; gap: 5px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; box-shadow: 0 12px 30px #0f172a33; }
.qtd-note-more-items button { text-align: left; }
.qtd-note-more:not([open]) .qtd-note-more-items { display: none; }
.qtd-note-toolbar { gap: 5px; padding: 5px; margin-bottom: 4px; align-items: center; }
.qtd-note-control-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.qtd-note-toolbar select { border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #0f172a; max-width: 132px; cursor: pointer; }
.qtd-note-editor { margin-top: 3px; }
/* Saved formatting: headings, quotes, code, alignment aur indent note ke andar hi rehte hain. */
.qtd-note-editor h1 { font-size: 1.65rem; }
.qtd-note-editor h3 { font-size: 1.15rem; }
.qtd-note-editor blockquote { border-left: 3px solid #93c5fd; padding-left: 12px; color: #475569; }
.qtd-note-editor pre { white-space: pre-wrap; font-family: ui-monospace, monospace; background: #f1f5f9; padding: 10px; border-radius: 7px; }
.qtd-note-editor [data-align="center"] { text-align: center; }
.qtd-note-editor [data-align="right"] { text-align: right; }
.qtd-note-editor [data-align="justify"] { text-align: justify; }
.qtd-note-editor [data-indent="1"] { margin-left: 2rem; }
/* Notepad feedback ko existing Word Counter/Text Case toast aur modal ke rang se match karta hai. */
.qtd-note-toast { background: #2563eb; max-width: 320px; padding: 14px 20px; font-size: 15px; font-weight: 600; border-radius: 10px; box-shadow: 0 10px 25px #0003; }
.qtd-note-dialog { border: 1px solid #e5e7eb; border-radius: 16px; padding: 30px; box-shadow: 0 20px 50px #0f172a2e; text-align: center; }
.qtd-note-dialog::backdrop { background: #0f172a73; }
.qtd-note-dialog h2 { font-size: 22px; color: #111827; }
.qtd-note-dialog p { font-size: 15px; color: #6b7280; margin-bottom: 25px; }
.qtd-note-dialog-actions { justify-content: center; gap: 12px; }
.qtd-note-dialog button { padding: 11px 22px; border: 0; font-size: 14px; font-weight: 600; }
.qtd-notepad-dark .qtd-note-more summary, .qtd-notepad-dark .qtd-note-more-items, .qtd-notepad-dark .qtd-note-toolbar select { background: #1e293b; color: #fff; border-color: #475569; }
.qtd-notepad-dark .qtd-note-editor blockquote { color: #cbd5e1; }
.qtd-notepad-dark .qtd-note-editor pre { background: #0f172a; }
@media (max-width: 480px) { .qtd-notepad-actions button { flex: 0 0 auto; } .qtd-note-more-items { left: auto; right: 0; } }

/* Checklist: native list text editable rakhta hai, aur checkbox ki state note ke HTML mein save hoti hai. */
.qtd-note-editor ul[data-checklist="1"] { list-style: none; padding-left: .25rem; }
.qtd-note-editor ul[data-checklist="1"] > li { display: list-item; position: relative; padding-left: 1.8rem; min-height: 1.7em; }
.qtd-note-editor .qtd-check-toggle { position: absolute; left: 0; top: .35em; width: 1.15rem; height: 1.15rem; padding: 0; border: 1px solid #64748b; border-radius: 4px; background: #fff; cursor: pointer; }
.qtd-note-editor li[data-checked="1"] > .qtd-check-toggle { background: #2563eb; border-color: #2563eb; color: #fff; }
.qtd-note-editor li[data-checked="1"] > .qtd-check-toggle::after { content: "✓"; display: block; line-height: 1; }
.qtd-note-editor li[data-checked="1"] { color: #64748b; text-decoration: line-through; }
.qtd-notepad-dark .qtd-note-editor .qtd-check-toggle { background: #1e293b; border-color: #94a3b8; }
.qtd-notepad-dark .qtd-note-editor li[data-checked="1"] > .qtd-check-toggle { background: #2563eb; }

/* Editor header: title aur ek continuous formatting strip ko writing sheet ke saath jodta hai. */
.qtd-notepad-intro { margin-bottom: 8px; }
.qtd-notepad-intro h1 { font-size: 1.45rem; }
.qtd-notepad-intro p:last-child { display: none; }
.qtd-notepad-workspace { padding: 12px 16px 86px; }
.qtd-notepad-topbar { padding: 0 4px 10px; }
.qtd-notepad-topbar .qtd-note-label,
.qtd-notepad-workspace > .qtd-note-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.qtd-notepad-app .qtd-notepad-topbar input[type="text"] { border: 0; box-shadow: none; background: transparent; color: inherit; padding: 8px 4px; font-size: 1.15rem; }
.qtd-notepad-topbar input:focus-visible { outline-offset: 0; }
.qtd-note-toolbar { background: #fff; border-radius: 0; border-width: 1px 0; padding: 8px 4px; margin: 0 -16px 12px; gap: 7px; }
.qtd-note-toolbar .qtd-note-more { margin-left: auto; }
.qtd-note-toolbar .qtd-note-more summary { padding: 6px 9px; font-size: .82rem; white-space: nowrap; }
.qtd-note-toolbar .qtd-note-more-items { right: 0; left: auto; }
.qtd-note-editor { border: 0; border-radius: 0; margin: 0; padding: 10px 5px; min-height: max(450px, calc(100vh - 320px)); }

/* Bottom actions: upload left aur current-note actions right, viewport par readable floating controls. */
.qtd-note-bottom-bar { pointer-events: none; }
.qtd-note-bottom-bar > * { pointer-events: auto; }
.qtd-notepad-app .qtd-note-upload,
.qtd-note-floating-actions { position: fixed; bottom: 18px; z-index: 40; background: #fff; border: 1px solid #dbe3ee; box-shadow: 0 10px 30px #0f172a24; }
.qtd-notepad-app .qtd-note-upload { left: 18px; border-radius: 12px; padding: 10px 15px; color: #1d4ed8; font-weight: 600; }
.qtd-note-floating-actions { right: 18px; display: flex; gap: 5px; padding: 6px; border-radius: 14px; }
.qtd-note-floating-actions button { border: 0; background: transparent; white-space: nowrap; }
.qtd-note-floating-actions .qtd-note-danger { color: #991b1b; }
/* Icon buttons reference-jaisi compact tray mein hain; title aur aria-label naam batate hain. */
.qtd-note-floating-actions button { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; padding: 8px; border-radius: 10px; }
.qtd-note-floating-actions svg, .qtd-note-upload svg { width: 22px; height: 22px; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.qtd-note-floating-actions button:hover { background: #eaf2ff; }
.qtd-notepad-app .qtd-note-upload { display: inline-flex; align-items: center; gap: 8px; }
.qtd-notepad-dark .qtd-note-toolbar,
.qtd-notepad-dark .qtd-note-floating-actions,
.qtd-notepad-dark .qtd-note-upload { background: #1e293b; border-color: #475569; color: #f8fafc; }

/* Phone par fixed actions ko safe width mein rakhta hai aur editor ke neeche breathing room deta hai. */
@media (max-width: 700px) {
    .qtd-notepad-workspace { padding-bottom: 105px; }
    .qtd-note-toolbar { overflow: visible; }
    .qtd-notepad-app .qtd-note-upload { left: 8px; bottom: 8px; padding: 8px; }
    .qtd-note-floating-actions { right: 8px; bottom: 8px; gap: 0; padding: 4px; }
    .qtd-note-floating-actions button { width: 38px; height: 38px; padding: 7px; }
}

/* Reference toolbar: icon controls, slim dividers aur labelled dropdowns ek hi row mein rehte hain. */
.qtd-note-toolbar { flex-wrap: wrap; overflow: visible; background: var(--surface); color: var(--text); border-color: var(--border); gap: 3px; }
/* More aur Page Settings ek hi flex item hain; wrap par icon akela next row mein nahi girta. */
.qtd-note-toolbar-end { display: inline-flex; align-items: center; flex: 0 0 auto; margin-left: auto; }
.qtd-notepad-app .qtd-note-toolbar > button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 36px; width: 36px; height: 38px; min-width: 36px; padding: 6px; border: 0; border-radius: 6px; background: transparent; color: inherit; font-size: 1.15rem; }
.qtd-notepad-app .qtd-note-toolbar > button:hover { background: #dbeafe; color: var(--primary-dark); }
.qtd-note-toolbar > button svg,
.qtd-note-select-wrap svg,
.qtd-note-toolbar .qtd-note-more summary svg { width: 21px; height: 21px; flex: none; stroke-linecap: round; stroke-linejoin: round; }
.qtd-note-select-wrap { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; padding: 0 10px; border-right: 1px solid var(--border); }
.qtd-note-select-wrap select { border: 0; background: transparent; color: inherit; height: 38px; padding: 5px; cursor: pointer; }
.qtd-note-toolbar .qtd-note-style-select select { max-width: 150px; min-width: 125px; }
.qtd-note-toolbar .qtd-note-align-select select { max-width: 145px; min-width: 115px; }
.qtd-note-toolbar .qtd-note-more { margin-left: auto; flex: 0 0 auto; padding-left: 8px; border-left: 1px solid var(--border); }
.qtd-note-toolbar-end .qtd-note-more { margin-left: 0; }
/* Desktop editor mein controls compact rakhte hain, taaki More aur Page Settings bhi usi row mein fit hon. */
@media (min-width: 701px) {
    .qtd-note-toolbar { flex-wrap: nowrap; gap: 1px; }
    .qtd-note-toolbar .qtd-note-select-wrap { padding-inline: 4px; min-width: 0; }
    .qtd-note-toolbar .qtd-note-style-select select { min-width: 90px; width: 96px; }
    .qtd-note-toolbar .qtd-note-align-select select { min-width: 88px; width: 104px; }
    .qtd-notepad-app .qtd-note-toolbar > button { flex-basis: 32px; width: 32px; min-width: 32px; padding: 4px; }
    .qtd-note-toolbar .qtd-note-menu summary, .qtd-note-toolbar .qtd-note-more summary { padding-inline: 4px; white-space: nowrap; }
    .qtd-note-toolbar-end { margin-left: auto; }
    .qtd-note-toolbar-end .qtd-note-more { padding-left: 4px; }
    .qtd-note-toolbar-end .qtd-note-page { padding-left: 4px; }
}
.qtd-note-toolbar .qtd-note-more summary { display: inline-flex; align-items: center; gap: 5px; height: 38px; border: 0; background: transparent; color: inherit; }
.qtd-note-toolbar .qtd-note-more summary:hover { background: #dbeafe; color: var(--primary-dark); }
.qtd-note-toolbar .qtd-note-more summary::after { content: " ▾"; }
.qtd-note-more-items { color: #0f172a; }
/* Dark editor mein toolbar readable dark surface par rehta hai. */
.qtd-notepad-dark .qtd-note-toolbar { background: #1e293b; color: #f8fafc; border-color: #475569; }
.qtd-notepad-dark .qtd-note-select-wrap,
.qtd-notepad-dark .qtd-note-toolbar .qtd-note-more { border-color: #475569; }
.qtd-notepad-dark .qtd-note-toolbar .qtd-note-more summary { background: transparent; color: #f8fafc; }
@media (max-width: 700px) { .qtd-note-toolbar .qtd-note-more { margin-left: 0; } }
@media (max-width: 700px) { .qtd-note-toolbar-end { margin-left: 0; } }

/* Aa aur page settings menus site ke blue/white palette mein keyboard-friendly popovers hain. */
.qtd-note-menu { position: relative; flex: 0 0 auto; }
.qtd-note-menu summary { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 6px; list-style: none; border-radius: 6px; cursor: pointer; font-weight: 600; }
.qtd-note-menu summary::-webkit-details-marker { display: none; }
.qtd-note-menu summary::after { content: "⌄"; margin-left: 5px; font-size: .95rem; }
.qtd-note-menu summary:hover, .qtd-note-menu[open] summary { background: #dbeafe; color: var(--primary-dark); }
.qtd-note-menu summary svg { width: 21px; height: 21px; stroke-linecap: round; stroke-linejoin: round; }
.qtd-note-menu-items { position: absolute; top: calc(100% + 8px); right: 0; z-index: 50; display: grid; gap: 2px; width: 220px; max-height: min(70vh, 580px); overflow-y: auto; padding: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 15px 35px #0f172a26; }
.qtd-note-menu-items button { text-align: left; border: 0; background: transparent; padding: 9px 12px; border-radius: 6px; }
.qtd-note-menu-items button:hover, .qtd-note-menu-items button[aria-pressed="true"] { background: #dbeafe; color: var(--primary-dark); }
.qtd-note-menu-items strong { padding: 10px 12px 4px; color: #475569; font-size: .8rem; }
.qtd-note-page { padding-left: 8px; border-left: 1px solid var(--border); }
.qtd-note-page-items { width: 225px; }
.qtd-notepad-dark .qtd-note-menu-items { background: #1e293b; border-color: #475569; color: #f8fafc; }
.qtd-notepad-dark .qtd-note-menu-items strong { color: #cbd5e1; }
.qtd-notepad-dark .qtd-note-page { border-color: #475569; }

/* Page settings note ke canvas ka visual size aur padding badalte hain; pageless full-width rehta hai. */
.qtd-note-editor[data-page-size="a4"] { --qtd-page-width: 794px; }
.qtd-note-editor[data-page-size="letter"], .qtd-note-editor[data-page-size="legal"], .qtd-note-editor[data-page-size="folio"] { --qtd-page-width: 816px; }
.qtd-note-editor[data-page-size="tabloid"] { --qtd-page-width: 1056px; }
.qtd-note-editor[data-page-size="a3"] { --qtd-page-width: 1123px; }
.qtd-note-editor[data-page-size="a5"] { --qtd-page-width: 559px; }
.qtd-note-editor[data-page-size="b4"] { --qtd-page-width: 945px; }
.qtd-note-editor[data-page-size="b5"] { --qtd-page-width: 665px; }
.qtd-note-editor[data-page-size="statement"] { --qtd-page-width: 528px; }
.qtd-note-editor[data-page-size="executive"] { --qtd-page-width: 696px; }
.qtd-note-editor[data-page-orientation="landscape"][data-page-size="a4"] { --qtd-page-width: 1123px; }
.qtd-note-editor[data-page-orientation="landscape"][data-page-size="letter"], .qtd-note-editor[data-page-orientation="landscape"][data-page-size="statement"] { --qtd-page-width: 1056px; }
.qtd-note-editor[data-page-orientation="landscape"][data-page-size="legal"] { --qtd-page-width: 1344px; }
.qtd-note-editor[data-page-orientation="landscape"][data-page-size="tabloid"] { --qtd-page-width: 1632px; }
.qtd-note-editor[data-page-orientation="landscape"][data-page-size="a3"] { --qtd-page-width: 1587px; }
.qtd-note-editor[data-page-orientation="landscape"][data-page-size="a5"] { --qtd-page-width: 794px; }
.qtd-note-editor[data-page-orientation="landscape"][data-page-size="b4"] { --qtd-page-width: 1334px; }
.qtd-note-editor[data-page-orientation="landscape"][data-page-size="b5"] { --qtd-page-width: 945px; }
.qtd-note-editor[data-page-orientation="landscape"][data-page-size="executive"] { --qtd-page-width: 1008px; }
.qtd-note-editor[data-page-orientation="landscape"][data-page-size="folio"] { --qtd-page-width: 1248px; }
.qtd-note-editor:not([data-page-size="pageless"]) { width: min(100%, var(--qtd-page-width)); margin-inline: auto; border: 1px solid #cbd5e1; border-radius: 3px; box-shadow: 0 7px 22px #0f172a16; min-height: 650px; }
.qtd-note-editor[data-page-margin="normal"]:not([data-page-size="pageless"]) { padding: 48px; }
.qtd-note-editor[data-page-margin="narrow"]:not([data-page-size="pageless"]) { padding: 24px; }
.qtd-note-editor[data-page-margin="wide"]:not([data-page-size="pageless"]) { padding: 72px; }
@media (max-width: 700px) { .qtd-note-editor:not([data-page-size="pageless"]) { padding: 18px; } .qtd-note-menu-items { right: auto; left: 0; } .qtd-note-page .qtd-note-menu-items { right: 0; left: auto; } }

/* Tool ke neeche crawlable guide aur FAQ: editor ki compact first-screen layout ko nahi chhedte. */
.qtd-notepad-help { max-width: 1200px; padding-top: 8px; line-height: 1.65; }
.qtd-notepad-help h2 { margin: 30px 0 10px; font-size: 1.45rem; }
.qtd-notepad-help h3 { font-size: 1.08rem; margin-bottom: 8px; }
.qtd-notepad-help p { max-width: none; margin-bottom: 14px; }
/* Guide Text Case page jaise alag stacked cards mein features samjhata hai. */
.qtd-notepad-guide { display: grid; gap: 12px; margin: 18px 0 54px; }
.qtd-notepad-guide > section { padding: 17px 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 6px 20px #0f172a0a; }
.qtd-notepad-guide h3 { margin-top: 0; }
.qtd-notepad-guide p { margin-bottom: 0; }
/* Feature list aur steps ko skim karna aasaan rahe; real list semantics bhi preserve hain. */
.qtd-notepad-features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 0; margin: 16px 0 54px; list-style: none; }
.qtd-notepad-features li { padding: 14px 16px; margin: 0; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
.qtd-notepad-steps { display: grid; gap: 12px; padding-left: 1.5rem; margin: 16px 0 54px; }
.qtd-notepad-steps li { padding: 14px 16px; margin: 0; border-left: 3px solid var(--primary); border-radius: 8px; background: var(--surface); }
/* Native details/summary FAQ ko click aur keyboard dono se kholta hai; questions ek saaf column mein rehte hain. */
.qtd-notepad-faq { display: grid; gap: 10px; }
.qtd-notepad-faq details { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.qtd-notepad-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; list-style: none; cursor: pointer; color: var(--text); font-weight: 700; }
.qtd-notepad-faq summary::-webkit-details-marker { display: none; }
.qtd-notepad-faq summary::after { content: "+"; color: var(--primary-dark); font-size: 1.35rem; line-height: 1; }
.qtd-notepad-faq details[open] summary::after { content: "−"; }
.qtd-notepad-faq summary:focus-visible { outline: 2px solid var(--primary-dark); outline-offset: 2px; border-radius: 12px; }
.qtd-notepad-faq details > p { padding: 0 18px 16px; margin: 0; }
.qtd-notepad-faq { margin: 16px 0 54px; }
/* Related tools ko alag clickable cards banate hain, links ka purpose bhi visible hai. */
.qtd-notepad-related { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0 50px; }
.qtd-notepad-related a { display: block; padding: 16px 18px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-weight: 700; text-decoration: none; }
.qtd-notepad-related a:hover, .qtd-notepad-related a:focus-visible { border-color: var(--primary); text-decoration: underline; }
.qtd-notepad-related span { display: block; margin-top: 3px; color: var(--text); font-size: .88rem; font-weight: 400; }
.qtd-notepad-help ol { padding-left: 1.35rem; list-style: decimal outside; }
.qtd-notepad-help li { margin-bottom: 8px; }
.qtd-notepad-help a { color: var(--primary-dark); text-decoration: underline; }
@media (max-width: 900px) { .qtd-notepad-features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .qtd-notepad-related { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .qtd-notepad-features { grid-template-columns: 1fr; } }

/* Linked text underlined rehta hai; click par URL preview se destination clearly dikhta hai. */
.qtd-note-editor a[href] { color: var(--primary-dark); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.qtd-note-link-preview { position: fixed; z-index: 80; display: flex; align-items: center; gap: 12px; width: min(320px, calc(100vw - 24px)); padding: 10px 12px; border: 1px solid #bfdbfe; border-radius: 10px; background: var(--surface); box-shadow: 0 12px 30px #0f172a2b; font-size: .8rem; }
.qtd-note-link-preview[hidden] { display: none; }
.qtd-note-link-preview span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.qtd-note-link-preview a { flex: none; color: var(--primary-dark); font-weight: 600; }
.qtd-notepad-dark .qtd-note-link-preview { background: #1e293b; border-color: #475569; }

/* Phone par formatting ek hi swipeable row hai; page ki width nahi badhti.
   Dropdowns fixed position mein khulte hain, taaki scroll strip unhe clip na kare. */
@media (max-width: 700px) {
    .qtd-note-toolbar {
        display: flex; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden;
        width: calc(100% + 32px); max-width: none; gap: 4px;
        overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
    }
    .qtd-note-toolbar > *, .qtd-note-toolbar-end { flex: 0 0 auto; }
    .qtd-note-toolbar-end { margin-left: 0; }
    .qtd-note-toolbar .qtd-note-menu-items, .qtd-note-toolbar .qtd-note-more-items { position: fixed; z-index: 1100; right: auto; left: auto; top: auto; max-width: calc(100vw - 16px); }

    /* Chhoti screen par canvas ki initial blank height kam; content badhne par phailta hai. */
    .qtd-note-editor, .qtd-note-editor:not([data-page-size="pageless"]) { min-height: min(380px, 55dvh); }
    /* App ke neeche guide par floating actions nahi aate. */
    .qtd-notepad-app.qtd-note-actions-outside .qtd-note-bottom-bar { visibility: hidden; pointer-events: none; }
}

/* Desktop sidebar jaisa hai; drawer ke buttons sirf chhoti screens par dikhte hain. */
.qtd-notes-toggle, .qtd-notes-close, .qtd-notes-backdrop { display: none; }

/* Mobile par notes list canvas ko neeche nahi dhakelti: title ke paas toggle,
   list overlay drawer mein, aur backdrop editor par accidental taps rokta hai. */
@media (max-width: 800px) {
    .qtd-notepad-app { display: block; }
    .qtd-notes-toggle { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
    .qtd-notepad-topbar { grid-template-columns: auto minmax(0, 1fr); }
    .qtd-notepad-topbar .qtd-notes-toggle { grid-column: 1; grid-row: 1; align-self: center; }
    .qtd-notepad-topbar input#noteTitle { grid-column: 2; grid-row: 1; min-width: 0; }
    .qtd-notepad-topbar #noteSaveStatus { grid-column: 2; grid-row: 2; justify-self: end; }
    .qtd-notepad-sidebar {
        position: fixed; z-index: 1202; inset: 0 auto 0 0;
        width: min(340px, 88vw); height: 100dvh; overflow-y: auto;
        border-radius: 0; transform: translateX(-105%); transition: transform .22s ease;
        box-shadow: 12px 0 30px #0f172a26;
    }
    .qtd-notepad-app.qtd-notes-open .qtd-notepad-sidebar { transform: translateX(0); }
    .qtd-notes-close { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; font-size: 1.5rem!important; margin-left: auto; }
    .qtd-notepad-sidebar-head #noteNew { width: 100%; }
    .qtd-notes-backdrop:not([hidden]) { display: block; position: fixed; z-index: 1201; inset: 0; width: 100%; border: 0; border-radius: 0; background: #0f172a80; }
    body.qtd-notes-drawer-open { overflow: hidden; }
}
@media (max-width: 800px) and (prefers-reduced-motion: reduce) {
    .qtd-notepad-sidebar { transition: none; }
}
.qtd-notepad-dark .qtd-note-link-preview span { color: #f8fafc; }

/* Insert menu ke horizontal rule aur page break ko blue theme mein clearly alag dikhata hai. */
.qtd-note-editor hr { border: 0; border-top: 2px solid #cbd5e1; margin: 22px 0; }
.qtd-note-editor [data-page-break="1"] { position: relative; height: 24px; margin: 28px 0; border-top: 2px dashed #93c5fd; user-select: none; }
.qtd-note-editor [data-page-break="1"]::after { content: "Page break"; position: absolute; top: -12px; right: 0; padding: 0 8px; background: #fff; color: #475569; font-size: .75rem; }
.qtd-notepad-dark .qtd-note-editor [data-page-break="1"]::after { background: #1e293b; color: #cbd5e1; }

/* Mobile title row ki extra Saved locally line hatata hai; live save status
   assistive technology ke liye DOM mein available rehta hai. */
@media (max-width: 800px) {
    .qtd-notepad-topbar #noteSaveStatus {
        position: absolute; width: 1px; height: 1px; padding: 0;
        overflow: hidden; clip-path: inset(50%); white-space: nowrap;
    }
}

/* Mobile par blank note ka writing area saaf dikhata hai; border aur hint se
   toolbar ke neeche editor ki shuruaat samajh aati hai. */
@media (max-width: 700px) {
    .qtd-notepad-workspace .qtd-note-editor {
        border: 1px solid #cbd5e1;
        border-radius: 10px;
        padding: 14px;
        min-height: min(380px, 55dvh);
    }
    .qtd-notepad-workspace .qtd-note-editor:empty::before {
        display: block;
        color: #64748b;
    }
    .qtd-notepad-dark .qtd-notepad-workspace .qtd-note-editor {
        border-color: #475569;
    }
}
