/* notes-widget.css — Notion-uslubidagi eslatmalar (qayta ishlatiladigan widget).
   Ishlatiladi: public/note/not.html (mustaqil, to'liq sahifa) VA
   public/main.html ichidagi "Eslatmalar" tabida (embedded, .nw-embedded). */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --nw-primary: #00f2ff;
    --nw-secondary: #6366f1;
    --nw-accent: #f59e0b;
    --nw-danger: #ef4444;

    --nw-bg-primary: #0a0b0f;
    --nw-bg-secondary: #131419;
    --nw-bg-tertiary: #1a1c23;
    --nw-bg-card: #1e2028;
    --nw-bg-hover: rgba(255, 255, 255, 0.06);

    --nw-text-primary: #ffffff;
    --nw-text-secondary: #a0a3b1;
    --nw-text-muted: #6b7280;

    --nw-border: rgba(255, 255, 255, 0.1);
    --nw-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --nw-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);

    --nw-sidebar-width: 280px;
    --nw-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* `hidden` atributi bilan almashtiriladigan har bir ko'rinish o'zining
   display qoidasiga ega — CSS kaskadida shu qoidalar `[hidden]`ning
   standart display:none'idan ustun chiqmasligi uchun bu yerda majburiy
   ustuvorlik beriladi. Faqat widget ichidagi elementlarga tegishli
   bo'lishi uchun `.app`/popover'lar doirasida saqlanadi. */
.app [hidden], .popover[hidden] { display: none !important; }

.app, .app * , .popover, .popover * { box-sizing: border-box; }

/* Mustaqil sahifa (/note/not) uchun — butun brauzer oynasini to'ldiradi,
   sahifa darajasidagi skroll bo'lmaydi (`.app` o'zi ichki skroll qiladi).
   Embedded (dashboard ichidagi) holatda body'ga tegilmaydi — main.html'ning
   o'z body uslubi buzilmasligi kerak. */
body.nw-standalone-body { margin: 0; height: 100%; overflow: hidden; background: var(--nw-bg-primary); }
html:has(body.nw-standalone-body) { height: 100%; }

.app {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--nw-bg-primary) 0%, var(--nw-bg-secondary) 100%);
    color: var(--nw-text-primary);
    display: flex;
    height: 100vh;
    position: relative;
}
.app button { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }
.app textarea, .app input { font-family: inherit; }

.mobile-topbar { display: none; }
.backdrop { display: none; }

/* ═══════════════════════════ SIDEBAR ═══════════════════════════ */

.nw-sidebar {
    width: var(--nw-sidebar-width);
    min-width: var(--nw-sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--nw-bg-secondary) 0%, var(--nw-bg-tertiary) 100%);
    border-right: 1px solid var(--nw-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-top { padding: 18px 16px 8px; border-bottom: 1px solid var(--nw-border); }

.back-link {
    display: inline-block;
    font-size: 12.5px;
    color: var(--nw-text-muted);
    text-decoration: none;
    margin-bottom: 10px;
    transition: var(--nw-transition);
}
.back-link:hover { color: var(--nw-primary); }

.brand { font-size: 17px; font-weight: 700; margin-bottom: 14px; letter-spacing: -0.2px; }

/* ── Mehmon (login qilmagan) banner ── */
.guest-banner {
    margin: 10px 16px 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(0, 242, 255, 0.08), rgba(99, 102, 241, 0.08));
    border: 1px solid rgba(0, 242, 255, 0.25);
}
.guest-banner p { font-size: 11.5px; line-height: 1.5; color: var(--nw-text-secondary); margin-bottom: 8px; }
.link-account-btn {
    width: 100%;
    padding: 8px 10px;
    border-radius: 7px;
    background: linear-gradient(135deg, var(--nw-primary), var(--nw-secondary));
    color: #06131a;
    font-size: 12.5px;
    font-weight: 700;
    transition: var(--nw-transition);
}
.link-account-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }

.search-wrap { padding: 10px 16px 0; }

.search-input {
    width: 100%;
    background: var(--nw-bg-primary);
    border: 1px solid var(--nw-border);
    border-radius: 8px;
    color: var(--nw-text-primary);
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
    transition: var(--nw-transition);
}
.search-input:focus { border-color: var(--nw-primary); box-shadow: 0 0 0 3px rgba(0, 242, 255, 0.12); }
.search-input::placeholder { color: var(--nw-text-muted); }

.new-page-btn {
    margin: 10px 16px 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 8px;
    background: var(--nw-bg-card);
    border: 1px solid var(--nw-border);
    color: var(--nw-text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: var(--nw-transition);
}
.new-page-btn span { font-size: 15px; color: var(--nw-primary); }
.new-page-btn:hover { background: var(--nw-bg-hover); color: var(--nw-text-primary); border-color: rgba(0, 242, 255, 0.3); }
.new-page-btn.primary {
    margin: 20px auto 0;
    background: linear-gradient(135deg, var(--nw-primary), var(--nw-secondary));
    color: #06131a;
    border: none;
    font-weight: 700;
    padding: 11px 20px;
}
.new-page-btn.primary span { color: #06131a; }
.new-page-btn.primary:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* ── Sevimlilar ── */
.pinned-wrap { padding: 10px 8px 0; border-bottom: 1px solid var(--nw-border); }
.tree-section-label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--nw-text-muted);
    padding: 4px 8px 6px;
}
.pinned-list { padding-bottom: 6px; }
.pinned-row { display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--nw-text-secondary); }
.pinned-row:hover { background: var(--nw-bg-hover); color: var(--nw-text-primary); }
.pinned-row.active { background: rgba(0, 242, 255, 0.12); color: var(--nw-text-primary); }

.tree {
    flex: 1;
    overflow-y: auto;
    padding: 8px 8px 8px;
}
.tree::-webkit-scrollbar { width: 6px; }
.tree::-webkit-scrollbar-thumb { background: var(--nw-border); border-radius: 3px; }

.tree-empty { padding: 20px 16px; text-align: center; color: var(--nw-text-muted); font-size: 12.5px; }

.tree-row-wrap { position: relative; }

.tree-row {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 6px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--nw-text-secondary);
    font-size: 13.5px;
    user-select: none;
    transition: background 0.12s ease;
    position: relative;
}
.tree-row:hover { background: var(--nw-bg-hover); color: var(--nw-text-primary); }
.tree-row.active { background: rgba(0, 242, 255, 0.12); color: var(--nw-text-primary); }
.tree-row.drag-over-mid { outline: 2px solid var(--nw-accent); outline-offset: -2px; border-radius: 6px; }
.tree-row.drag-over-top::before,
.tree-row.drag-over-bottom::after {
    content: '';
    position: absolute;
    left: 6px; right: 6px;
    height: 2px;
    background: var(--nw-primary);
    border-radius: 1px;
}
.tree-row.drag-over-top::before { top: -1px; }
.tree-row.drag-over-bottom::after { bottom: -1px; }
.tree-row.dragging { opacity: 0.4; }

.tree-caret {
    width: 16px; height: 16px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 10px;
    color: var(--nw-text-muted);
    transition: transform 0.15s ease;
    border-radius: 4px;
}
.tree-caret:hover { background: rgba(255,255,255,0.1); }
.tree-caret.open { transform: rotate(90deg); }
.tree-caret.hidden-caret { visibility: hidden; }

.tree-icon { flex-shrink: 0; font-size: 14px; width: 18px; text-align: center; }

.tree-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-title.untitled { color: var(--nw-text-muted); font-style: italic; }

.tree-actions { display: none; align-items: center; gap: 2px; flex-shrink: 0; }
.tree-row:hover .tree-actions { display: flex; }
.tree-action-btn {
    width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 4px;
    font-size: 12px;
    color: var(--nw-text-muted);
}
.tree-action-btn:hover { background: rgba(255,255,255,0.12); color: var(--nw-text-primary); }

.tree-children { margin-left: 14px; border-left: 1px solid var(--nw-border); padding-left: 4px; }
.tree-children.collapsed { display: none; }

.sidebar-bottom { border-top: 1px solid var(--nw-border); padding: 8px; }
.trash-link {
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 12.5px;
    color: var(--nw-text-muted);
    transition: var(--nw-transition);
}
.trash-link:hover { background: var(--nw-bg-hover); color: var(--nw-text-secondary); }

/* ═══════════════════════════ MAIN ═══════════════════════════ */

.nw-main { flex: 1; height: 100vh; display: flex; flex-direction: column; overflow: hidden; position: relative; }

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}
.empty-emoji { font-size: 52px; margin-bottom: 14px; opacity: 0.85; }
.empty-state h2 { font-size: 19px; margin-bottom: 6px; }
.empty-state p { color: var(--nw-text-muted); font-size: 13.5px; margin-bottom: 18px; }

/* ── Trash view ── */
.trash-view { flex: 1; min-height: 0; overflow-y: auto; padding: 40px clamp(16px, 6vw, 100px); }
.trash-header h2 { font-size: 20px; margin-bottom: 6px; }
.trash-header p { color: var(--nw-text-muted); font-size: 13px; margin-bottom: 22px; }
.trash-list { display: flex; flex-direction: column; gap: 8px; max-width: 640px; }
.trash-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    background: var(--nw-bg-card);
    border: 1px solid var(--nw-border);
    border-radius: 8px;
}
.trash-item .t-icon { font-size: 16px; }
.trash-item .t-title { flex: 1; font-size: 13.5px; color: var(--nw-text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-item .t-date { font-size: 11.5px; color: var(--nw-text-muted); }
.trash-item .t-btn {
    font-size: 12px; padding: 5px 10px; border-radius: 6px;
    background: var(--nw-bg-tertiary); color: var(--nw-text-secondary); border: 1px solid var(--nw-border);
    transition: var(--nw-transition);
}
.trash-item .t-btn:hover { background: var(--nw-bg-hover); color: var(--nw-text-primary); }
.trash-item .t-btn.danger:hover { color: var(--nw-danger); border-color: rgba(239,68,68,0.4); }
.trash-empty { color: var(--nw-text-muted); font-size: 13px; padding: 20px 0; }

/* ── Page view ── */
.page-view { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

.page-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px clamp(16px, 6vw, 100px);
    border-bottom: 1px solid var(--nw-border);
    background: rgba(19, 20, 25, 0.6);
    backdrop-filter: blur(6px);
    overflow-x: auto;
    flex-shrink: 0;
}
.toolbar-group { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.toolbar-sep { width: 1px; height: 18px; background: var(--nw-border); margin: 0 6px; flex-shrink: 0; }
.tb-btn {
    min-width: 28px; height: 28px;
    padding: 0 7px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px;
    font-size: 12px;
    color: var(--nw-text-secondary);
    white-space: nowrap;
    transition: var(--nw-transition);
}
.tb-btn:hover { background: var(--nw-bg-hover); color: var(--nw-text-primary); }
.tb-btn.active { background: rgba(0, 242, 255, 0.15); color: var(--nw-primary); }
.save-status { margin-left: auto; font-size: 11.5px; color: var(--nw-text-muted); flex-shrink: 0; padding-left: 10px; }
.save-status.saving { color: var(--nw-accent); }
.save-status.error { color: var(--nw-danger); }

.page-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.page-scroll::-webkit-scrollbar { width: 8px; }
.page-scroll::-webkit-scrollbar-thumb { background: var(--nw-border); border-radius: 4px; }

.page-inner { max-width: 760px; margin: 0 auto; padding: 36px clamp(16px, 6vw, 40px) 120px; }

.page-icon-row { margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.page-icon-btn { font-size: 44px; line-height: 1; border-radius: 10px; padding: 4px; transition: var(--nw-transition); }
.page-icon-btn:hover { background: var(--nw-bg-hover); }
.pin-btn {
    font-size: 20px;
    line-height: 1;
    color: var(--nw-text-muted);
    padding: 6px 8px;
    border-radius: 8px;
    transition: var(--nw-transition);
    align-self: flex-start;
    margin-top: 8px;
}
.pin-btn:hover { background: var(--nw-bg-hover); color: var(--nw-accent); }
.pin-btn.active { color: var(--nw-accent); }

.page-title-wrap { margin-bottom: 4px; }
.nw-page-title {
    width: 100%;
    resize: none;
    overflow: hidden;
    background: transparent;
    border: none;
    outline: none;
    color: var(--nw-text-primary);
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.25;
}
.nw-page-title::placeholder { color: var(--nw-text-muted); }

.page-meta { font-size: 12px; color: var(--nw-text-muted); margin-bottom: 24px; }

.page-body { outline: none; font-size: 15.5px; line-height: 1.7; color: var(--nw-text-primary); min-height: 200px; }

.page-footer-actions { border-top: 1px solid var(--nw-border); padding: 10px clamp(16px, 6vw, 100px); flex-shrink: 0; }
.danger-link { font-size: 12.5px; color: var(--nw-text-muted); padding: 6px 10px; border-radius: 6px; transition: var(--nw-transition); }
.danger-link:hover { background: rgba(239, 68, 68, 0.12); color: var(--nw-danger); }

/* ═══════════════════════════ BLOCKS ═══════════════════════════ */

.n-block { outline: none; padding: 3px 4px 3px 2px; border-radius: 4px; position: relative; min-height: 1.7em; }
.n-block:hover { background: rgba(255,255,255,0.025); }
.n-block.nw-empty::before { content: attr(data-placeholder); color: var(--nw-text-muted); pointer-events: none; position: absolute; }

.n-block[data-type="h1"] { font-size: 26px; font-weight: 800; margin-top: 18px; letter-spacing: -0.3px; }
.n-block[data-type="h2"] { font-size: 21px; font-weight: 700; margin-top: 14px; letter-spacing: -0.2px; }
.n-block[data-type="h3"] { font-size: 17.5px; font-weight: 700; margin-top: 10px; }

.n-block[data-type="quote"] { border-left: 3px solid var(--nw-accent); padding-left: 14px; color: var(--nw-text-secondary); font-style: italic; }

.n-block[data-type="bulleted"], .n-block[data-type="numbered"] { padding-left: 26px; }
.n-block[data-type="bulleted"]::before { content: '•'; position: absolute; left: 8px; color: var(--nw-text-secondary); }
.n-block[data-type="numbered"]::before { content: attr(data-num) '.'; position: absolute; left: 4px; color: var(--nw-text-secondary); font-variant-numeric: tabular-nums; }

.n-block[data-indent="1"] { margin-left: 24px; }
.n-block[data-indent="2"] { margin-left: 48px; }
.n-block[data-indent="3"] { margin-left: 72px; }
.n-block[data-indent="4"] { margin-left: 96px; }
.n-block[data-indent="5"] { margin-left: 120px; }
.n-block[data-indent="6"] { margin-left: 144px; }

.n-block[data-type="divider"] { height: 20px; cursor: default; }
.n-block[data-type="divider"] hr { border: none; border-top: 1px solid var(--nw-border); margin-top: 10px; }
.n-block[data-type="divider"] .block-del {
    display: none; position: absolute; right: 4px; top: 0;
    font-size: 11px; color: var(--nw-text-muted); padding: 2px 6px; border-radius: 4px;
}
.n-block[data-type="divider"]:hover .block-del { display: block; }
.n-block[data-type="divider"]:hover .block-del:hover { background: rgba(239,68,68,0.15); color: var(--nw-danger); }

.n-block.todo-block { display: flex; align-items: flex-start; gap: 8px; padding-left: 4px; }
.n-block.todo-block .n-check { margin-top: 4px; width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--nw-primary); cursor: pointer; }
.n-block.todo-block .n-text { flex: 1; outline: none; }
.n-block.todo-block[data-checked="true"] .n-text { color: var(--nw-text-muted); text-decoration: line-through; }

.n-block b, .n-block strong { font-weight: 700; }

/* ═══════════════════════════ POPOVERS ═══════════════════════════ */

.popover {
    position: fixed;
    z-index: 500;
    background: var(--nw-bg-card);
    border: 1px solid var(--nw-border);
    border-radius: 10px;
    box-shadow: var(--nw-shadow-lg);
    font-family: 'Inter', sans-serif;
    color: var(--nw-text-primary);
}

.emoji-popover { padding: 10px; width: 260px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 220px; overflow-y: auto; }
.emoji-cell { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; font-size: 16px; border-radius: 6px; transition: background 0.1s ease; }
.emoji-cell:hover { background: var(--nw-bg-hover); }

.highlight-popover { padding: 8px; display: flex; gap: 6px; }
.hl-swatch {
    width: 26px; height: 26px;
    border-radius: 6px;
    border: 1px solid var(--nw-border);
    cursor: pointer;
    transition: var(--nw-transition);
}
.hl-swatch:hover { transform: scale(1.12); }
.hl-swatch.none { background-image: linear-gradient(45deg, transparent 45%, var(--nw-danger) 45%, var(--nw-danger) 55%, transparent 55%); }

.slash-menu { width: 250px; padding: 6px; max-height: 300px; overflow-y: auto; }
.slash-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border-radius: 6px; font-size: 13px; color: var(--nw-text-secondary); text-align: left; }
.slash-item .si-icon { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; background: var(--nw-bg-tertiary); border-radius: 5px; font-size: 12px; flex-shrink: 0; }
.slash-item:hover, .slash-item.selected { background: var(--nw-bg-hover); color: var(--nw-text-primary); }

.ctx-menu { width: 210px; padding: 6px; }
.ctx-item { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; font-size: 13px; color: var(--nw-text-secondary); }
.ctx-item:hover { background: var(--nw-bg-hover); color: var(--nw-text-primary); }
.ctx-item.danger:hover { color: var(--nw-danger); background: rgba(239,68,68,0.12); }

.nw-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--nw-bg-card);
    border: 1px solid var(--nw-border);
    color: var(--nw-text-primary);
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    box-shadow: var(--nw-shadow-lg);
    z-index: 900;
    font-family: 'Inter', sans-serif;
}

/* ═══════════════════════════ RESPONSIVE (mustaqil sahifa: /note/not) ═══════════════════════════ */

@media (max-width: 860px) {
    .app:not(.nw-embedded) { display: block; height: 100vh; flex-direction: column; }

    .app:not(.nw-embedded) .mobile-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 52px;
        padding: 0 8px;
        border-bottom: 1px solid var(--nw-border);
        background: var(--nw-bg-secondary);
        position: relative;
        z-index: 50;
    }
    .icon-btn {
        width: 36px; height: 36px;
        display: flex; align-items: center; justify-content: center;
        font-size: 18px;
        border-radius: 8px;
        color: var(--nw-text-secondary);
    }
    .icon-btn:hover { background: var(--nw-bg-hover); }
    .mobile-title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }

    .app:not(.nw-embedded) .nw-main { height: calc(100vh - 52px); }

    .app:not(.nw-embedded) .nw-sidebar {
        position: fixed;
        top: 52px; left: 0; bottom: 0;
        height: auto;
        width: min(var(--nw-sidebar-width), 85vw);
        min-width: 0;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        box-shadow: var(--nw-shadow-lg);
    }
    .app:not(.nw-embedded) .nw-sidebar.open { transform: translateX(0); }

    .app:not(.nw-embedded) .backdrop {
        display: none;
        position: fixed;
        top: 52px; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 150;
    }
    .app:not(.nw-embedded) .backdrop.show { display: block; }

    .page-inner { padding: 24px 16px 100px; }
    .nw-page-title { font-size: 26px; }
    .page-toolbar { padding: 8px 10px; }

    /* Tor ekranda icon+title+date+2 tugma bitta qatorga sig'maydi — `.t-title`
       (flex:1, flex-basis:0%) qolgan (kontent-o'lchamli) birodarlar tomonidan
       0px'gacha siqilib, sarlavha butunlay ko'rinmay qolar edi. Shu sabab
       sana+tugmalar ikkinchi qatorga tushiriladi, sarlavha esa birinchi
       qatorda belgi bilan birga, kerak bo'lsa "..." bilan qisqartiriladi. */
    .trash-item { flex-wrap: wrap; row-gap: 8px; }
    .trash-item .t-title { min-width: 0; order: 1; }
    .trash-item .t-icon { order: 0; }
    .trash-item .t-date { order: 2; flex: 1 1 100%; }
    .trash-item .t-btn { order: 3; }
}

/* ═══════════════════════════ EMBEDDED (main.html "Eslatmalar" tabi) ═══════════════════════════
   Bu holatda tashqi dashboard o'zining sarlavha/navigatsiyasini beradi —
   widget'ning o'z mobil-topbar'i va "orqaga"/"Eslatmalar" sarlavhasi
   ikki karra chiqmasligi uchun doim yashiriladi. Balandlik butun
   viewport (100vh) emas, ota konteyner beradigan joyni to'ldiradi. */

.nw-embedded { height: 100%; }
.nw-embedded .mobile-topbar { display: none !important; }
.nw-embedded .sidebar-top .back-link, .nw-embedded .sidebar-top .brand { display: none; }
.nw-embedded .nw-sidebar, .nw-embedded .nw-main { height: 100%; }

/* Konteyner (dashboard panelining o'zi), tashqi brauzer oynasi emas —
   shu sabab @media emas, @container ishlatiladi: panel tor bo'lsa
   (masalan mobil qurilmada dashboard sidebar yopilgach ham content
   maydoni tor qolsa), sidebar daraxt ustida, tahrirlovchi pastda
   joylashadi, xuddi mustaqil sahifadagi drawer o'rniga oddiy stack. */
.nw-embedded-container { container-type: inline-size; }

@container (max-width: 720px) {
    .nw-embedded { display: flex; flex-direction: column; }
    .nw-embedded .nw-sidebar {
        width: 100%;
        min-width: 0;
        max-height: 240px;
        border-right: none;
        border-bottom: 1px solid var(--nw-border);
    }
    .nw-embedded .nw-main { flex: 1; min-height: 420px; }
}
