.note-transfer-actions {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    white-space: nowrap;
}
.note-import-dialog { width: min(520px, calc(100% - 32px)); overflow: auto; box-sizing: border-box; }
.note-import-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.note-import-header .btn { flex: none; width: auto; }
.note-import-dialog .summary-line { line-height: 1.65; }
.note-import-dialog summary { cursor: pointer; }
.note-import-dialog details p { margin-top: 10px !important; }
.note-import-dialog #importFile { max-width: 100%; box-sizing: border-box; }
.note-users-scroll { overflow-x: auto; scrollbar-width: auto; scrollbar-color: #7fa88c #edf4ef; padding-bottom: 8px; }
.note-users-scroll::-webkit-scrollbar { height: 12px; }
.note-users-scroll::-webkit-scrollbar-track { background: #edf4ef; border-radius: 8px; }
.note-users-scroll::-webkit-scrollbar-thumb { background: #7fa88c; border-radius: 8px; border: 2px solid #edf4ef; }
.note-users-scroll:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.note-admin-scroll-hint { margin-bottom: 10px; }
/* Keep real table rows at every viewport size; overflow stays inside the table region. */
.note-users-scroll .admin-users-table { display: table; min-width: 1900px; }
.note-users-scroll .admin-users-table thead {
    display: table-header-group;
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    white-space: nowrap;
}
.note-users-scroll .admin-users-table tbody { display: table-row-group; }
.note-users-scroll .admin-users-table tbody tr { display: table-row; padding: 0; margin: 0; border: 0; border-radius: 0; }
.note-users-scroll .admin-users-table td {
    display: table-cell;
    padding: 12px;
    border: 0;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    white-space: nowrap;
    font-size: 14px;
    overflow-wrap: normal;
}
.note-users-scroll .admin-users-table td::before { display: none; }
.note-users-scroll .admin-users-table th { white-space: nowrap; }
.note-users-scroll .admin-users-table td:last-child { min-width: 230px; border-top: 0; }
.note-users-scroll .admin-row-actions { flex-wrap: nowrap; margin: 0; }
.note-quota-row, .note-quota-editor, .note-quota-editor label { display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; white-space: nowrap; }
.note-quota-editor { margin: 0; }
.note-quota-editor label { gap: 6px; font-size: 13px; }
.note-quota-editor .field { width: 94px; min-width: 94px; height: 38px; padding: 6px 9px; margin: 0; font-size: 14px; }
.note-quota-editor .btn { width: auto; flex: none; min-height: 38px; }
.note-quota-row .note-quota-usage { display: inline; font-size: 13px; }
@media (max-width: 640px) {
    .note-import-dialog { padding: 18px; }
    .note-quota-editor .field { font-size: 16px; }
}
.note-usage { position: relative; cursor: help; }
.note-usage-tooltip { display: none; position: absolute; z-index: 10; left: 0; bottom: 100%; padding: 10px 14px; background: #182230; color: white; border-radius: 8px; white-space: nowrap; }
.note-usage:hover .note-usage-tooltip, .note-usage:focus .note-usage-tooltip { display: block; }
/* Match both sidebar actions to the same content edges. */
.note-sidebar > .clipboard { margin-left: 25px; margin-right: 25px; }
#clipboardToggle[aria-expanded="true"] { background: #b42318; border-color: #b42318; color: #fff; }
#clipboardToggle[aria-expanded="true"]:hover { background: #912018; }
@media (max-width: 640px) {
    .note-sidebar > .clipboard { margin-left: 15px; margin-right: 15px; }

}


#noteListPanel .notes-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr)); }
.note-custom-columns #noteListPanel .notes-grid { grid-template-columns: repeat(var(--note-columns), minmax(0, 1fr)); }
.note-custom-columns .note-actions { flex-wrap: wrap; }
#exportForm.bulk-bar { gap: 10px; padding: 12px; position: relative; }
#exportForm .btn, #exportForm .note-toolbar-select, #exportForm [name="export_format"] {
    box-sizing: border-box; min-height: 42px; height: 42px; border-radius: 12px;
    font-family: inherit; font-size: 14px; font-weight: 600; line-height: 20px; letter-spacing: normal;
    color: var(--text); background-color: #fff; border: 1px solid var(--border); box-shadow: none; text-align: left; justify-content: flex-start;
    margin: 0; padding: 10px 14px; flex: 0 0 auto; width: auto; min-width: 0;
}
#exportForm select.field, #exportForm .note-export-menu summary {
    appearance: none; -webkit-appearance: none; padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m2 4 4 4 4-4' fill='none' stroke='%23374151' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; cursor: pointer;
}
#exportForm .note-export-menu summary > span { display: none; }
#exportForm select option { font-family: inherit; font-size: 14px; font-weight: 600; line-height: 20px; color: var(--text); background: #fff; }
#exportForm .btn:hover, #exportForm select:hover { background-color: var(--primary-soft); transform: none; }
#exportForm .btn:focus-visible, #exportForm select:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
#exportForm .summary-line { white-space: nowrap; }
#exportForm #selectedCount { margin-left: auto; font-size: 12px; }
.note-export-menu { position: relative; flex: 0 0 auto; }
.note-export-menu summary { list-style: none; display: flex; gap: 10px; align-items: center; cursor: pointer; }
.note-export-menu summary::-webkit-details-marker { display: none; }
.note-export-options { position: absolute; left: 0; top: calc(100% + 8px); z-index: 30; width: 170px; display: grid; gap: 4px; padding: 6px; border: 1px solid var(--border); border-radius: 14px; background: #fff; box-shadow: 0 12px 32px rgba(15,23,42,.14); }
#exportForm .note-export-options .btn { width: 100%; text-align: left; justify-content: flex-start; border: 0; }
#exportForm .note-export-menu[open] summary { background-color: var(--primary-soft); }
@media (max-width: 640px) {
    #noteListPanel .notes-grid { grid-template-columns: minmax(0, 1fr); }
    .note-custom-columns #noteListPanel .notes-grid { overflow-x: auto; grid-template-columns: repeat(var(--note-columns), minmax(220px, 1fr)); }
    #exportForm.bulk-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px; }
    #exportForm .btn, #exportForm .note-toolbar-select, #exportForm [name="export_format"] { width: 100%; min-width: 0; }

    #exportForm #selectedCount { margin-left: 0; text-align: right; }
}

@media (max-width: 360px) {
    #exportForm .btn, #exportForm .note-toolbar-select, #exportForm [name="export_format"] { padding-left: 10px; padding-right: 10px; }
    #exportForm select.field, #exportForm .note-export-menu summary { padding-right: 28px; background-position: right 8px center; }
}

/* Body and read-only tags share one scroll area; tags follow the final line. */
.note-body-scroll{margin-top:14px;max-height:270px;overflow:auto;padding-right:4px}
.note-body-scroll .note-content{margin:0;max-height:none;overflow:visible;padding-right:0}
@media(max-width:720px){.note-body-scroll{max-height:44vh}}
.note-tag-row{display:flex;align-items:center;flex-wrap:wrap;gap:4px;margin:12px 0 0}
.note-tag-chip{display:inline-block;max-width:100%;overflow-wrap:anywhere;padding:1px 6px;border-radius:5px;background:#eef4ef;color:#506b56;font-size:11px;line-height:1.5}

/* Keep administrator shortcuts together on desktop; allow compact phone rows. */
@media(min-width:641px){.hero-top .account-actions{display:flex;flex-wrap:nowrap;align-items:center;gap:10px}.hero-top .account-actions>.btn,.hero-top .account-actions .btn{width:auto;white-space:nowrap}.hero-top .account-actions .logout-form{flex:0 0 auto;margin:0}.hero-top .account-actions>.btn{flex:0 0 auto}}
@media(min-width:941px){.hero-top>div:first-child{min-width:0;flex:1 1 auto}}
