.nb-shell {
    --nb-cell-inline-pad: 0.9rem;
    --nb-code-editor-left-padding: 46px;
    --nb-run-left: 1.14rem;
    --nb-run-top: 1.34rem;
    --nb-output-rail-width: 2.86rem;
    --nb-output-rail-left-pad: 0.46rem;
    --nb-output-trigger-size: 1.42rem;
    --nb-output-trigger-center: calc(var(--nb-output-rail-left-pad) + (var(--nb-output-trigger-size) / 2));
    --nb-markdown-left-offset: var(--nb-output-trigger-center);
    --nb-output-collapsed-max-height: 220px;
    max-width: 1100px;
    margin: 1.5rem auto 3rem auto;
}

.nb-title {
    margin-bottom: 0.25rem;
}

.nb-subtitle {
    margin-top: 0;
    color: #667;
}

.nb-header {
    display: grid;
    gap: 0.68rem;
    background: #fbfdff;
    border: 1px solid #dfe7f2;
    border-radius: 12px;
    padding: 0.9rem 1rem 0.84rem 1rem;
    box-shadow: 0 2px 8px rgba(24, 42, 66, 0.05);
}

.nb-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: stretch;
    margin-top: 0;
}

.nb-meta .nb-visibility,
.nb-meta .nb-export {
    display: flex;
    align-items: center;
    gap: 0.42rem;
    font-size: 0.82rem;
    color: #3f546f;
    border: 1px solid #e0e8f3;
    border-radius: 10px;
    background: #fff;
    padding: 0.32rem 0.42rem;
    min-height: 2.18rem;
}

.nb-loading {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: linear-gradient(90deg, #f8fafc, #eef2ff, #f8fafc);
    color: #475569;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    animation: nb-loading-pulse 1.2s ease-in-out infinite;
}

@keyframes nb-loading-pulse {
    0% { opacity: 0.65; }
    50% { opacity: 1; }
    100% { opacity: 0.65; }
}

.nb-forked {
    font-size: 0.9rem;
    color: #556;
    margin-bottom: 0.5rem;
}

.nb-forked a {
    color: #0f766e;
    text-decoration: none;
    font-weight: 600;
}

.nb-forked a:hover {
    text-decoration: underline;
}

.nb-fork-banner {
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    border: 1px solid #dbe7ff;
    background: #f5f8ff;
    color: #344;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.nb-title-input {
    width: 100%;
    font-size: 1.5rem;
    font-weight: 700;
    border: none !important;
    border-color: transparent !important;
    border-radius: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    outline: none;
    color: #223;
    box-shadow: none !important;
    transition: background-color 0.14s ease, box-shadow 0.14s ease;
}

.nb-title-input:focus {
    background: #f8fbff;
    border: none !important;
    border-color: transparent !important;
    box-shadow: inset 0 0 0 1px #cfdced !important;
    border-radius: 8px;
}

.nb-title-input:disabled {
    color: #314764;
    opacity: 0.9;
}

.nb-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin: 1rem 0 1.5rem 0;
}

.nb-toolbar-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    min-width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid #cfdaea;
    border-radius: 999px;
    background: #fff;
    color: #3b567c;
    box-shadow: 0 1px 2px rgba(18, 32, 56, 0.08);
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.nb-toolbar-icon-btn:hover,
.nb-toolbar-icon-btn:focus-visible {
    border-color: #b9cbe2;
    background: #f2f7ff;
    color: #274972;
    box-shadow: 0 2px 5px rgba(18, 32, 56, 0.12);
    outline: none;
}

.nb-toolbar-icon-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.nb-toolbar-svg {
    width: 1.06rem;
    height: 1.06rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: block;
}

.nb-toolbar-dot {
    fill: currentColor;
    stroke: none;
}

.nb-toolbar-more {
    display: none;
    position: relative;
}

.nb-toolbar-more > summary {
    list-style: none;
}

.nb-toolbar-more > summary::-webkit-details-marker {
    display: none;
}

.nb-toolbar-more[open] > .nb-toolbar-more-trigger {
    border-color: #b9cbe2;
    background: #f2f7ff;
    color: #274972;
}

.nb-toolbar-more-trigger .nb-toolbar-svg circle {
    fill: currentColor;
    stroke: none;
}

.nb-toolbar-more-panel {
    position: absolute;
    top: calc(100% + 0.28rem);
    right: 0;
    min-width: 190px;
    padding: 0.32rem;
    border: 1px solid #d7e0ed;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(12, 22, 40, 0.14);
    z-index: 35;
}

.nb-toolbar-icon-btn.is-success {
    border-color: #b7debf;
    background: #edf9f0;
    color: #1f6a3e;
}

.nb-toolbar-icon-btn.is-error {
    border-color: #e7c2c2;
    background: #fff2f2;
    color: #9a2d2d;
}

.nb-toolbar-icon-btn.is-active {
    border-color: #9fbbe0;
    background: #edf3fd;
    color: #18437c;
}

.nb-save-btn::after {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 999px;
    border: 2px solid transparent;
    opacity: 0;
    pointer-events: none;
}

.nb-save-btn.is-saving::after {
    opacity: 1;
    border-top-color: #24a148;
    border-right-color: #24a148;
    animation: nb-spin 0.9s linear infinite;
}

.nb-save-btn.is-dirty {
    border-color: #b9cde7;
    background: #f3f8ff;
    color: #2a578f;
}

.nb-save-btn.is-saved {
    border-color: #b7debf;
    background: #edf9f0;
    color: #1f6a3e;
}

.nb-save-btn.is-error {
    border-color: #e7c2c2;
    background: #fff2f2;
    color: #9a2d2d;
}

.nb-save-btn.is-fork {
    border-color: #d9c9e7;
    background: #f8f2fd;
    color: #5d3f7f;
}

.nb-save-btn.is-login {
    border-color: #c4d9e8;
    background: #f0f7fb;
    color: #2d5674;
}

.nb-reader-toggle.is-active {
    color: #18437c;
    border-color: #9fbbe0;
    background: #edf3fd;
}

.nb-reader-mode .nb-header {
    display: none;
}

.nb-reader-mode .nb-toolbar {
    margin: 0.5rem 0 1rem 0;
}

.nb-reader-mode .nb-toolbar > *:not(.nb-reader-toggle):not(.nb-toolbar-more):not(.nb-status) {
    display: none !important;
}

.nb-reader-mode .nb-status {
    margin-left: 0.5rem;
}

.nb-export label {
    margin: 0;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    color: #5f7088;
    font-weight: 600;
}

.nb-export select {
    min-width: 120px;
}

.nb-visibility label {
    margin: 0;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    color: #5f7088;
    font-weight: 600;
}

.nb-visibility select {
    min-width: 120px;
}

.nb-header .form-control.form-control-sm {
    height: 1.84rem;
    border-radius: 8px;
    border: 1px solid #d8e2ef;
    background: #fbfdff;
    color: #2a405e;
    font-size: 0.8rem;
    line-height: 1.1;
    padding: 0.18rem 0.42rem;
    box-shadow: none;
    transition: border-color 0.14s ease, background-color 0.14s ease;
}

.nb-header .form-control.form-control-sm:focus {
    border-color: #bfd0e7;
    background: #fff;
    box-shadow: none;
}

.nb-header .form-control.form-control-sm:disabled {
    background: #f7f9fc;
    color: #667c98;
}

#nb-export-btn.btn {
    height: 1.84rem;
    border-radius: 8px;
    border-color: #d6e1ef;
    color: #365275;
    background: #f7faff;
    font-size: 0.78rem;
    padding: 0.18rem 0.58rem;
    line-height: 1.05;
    box-shadow: none;
}

#nb-export-btn.btn:hover,
#nb-export-btn.btn:focus-visible {
    border-color: #bfd0e7;
    background: #edf4ff;
    color: #234a77;
    box-shadow: none;
}

#nb-export-btn.btn:disabled {
    opacity: 0.62;
}

.nb-status {
    margin-left: auto;
    font-size: 0.9rem;
    color: #667;
}

.nb-usage-meter {
    font-size: 0.78rem;
    color: #4f6988;
    border: 1px solid #d9e2ef;
    border-radius: 999px;
    padding: 0.22rem 0.62rem;
    background: #f8fbff;
}

.nb-toc {
    margin: -0.45rem 0 1rem 0;
    border: 1px solid #e0e8f2;
    border-radius: 10px;
    background: #fdfefe;
    padding: 0.15rem 0.3rem;
}

#notebook-pybot-bridge {
    position: relative;
    z-index: 4;
}

.nb-toc[hidden] {
    display: none !important;
}

.nb-toc > summary {
    cursor: pointer;
    list-style: none;
    user-select: none;
    font-size: 0.84rem;
    color: #415674;
    padding: 0.28rem 0.4rem;
    border-radius: 8px;
}

.nb-toc > summary::-webkit-details-marker {
    display: none;
}

.nb-toc > summary:hover,
.nb-toc > summary:focus-visible {
    background: #f2f7ff;
    outline: none;
}

.nb-toc-list {
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
    padding: 0.1rem 0.2rem 0.35rem 0.2rem;
}

.nb-toc-link {
    border: none;
    background: transparent;
    color: #2e4869;
    font-size: 0.82rem;
    line-height: 1.3;
    text-align: left;
    padding: 0.18rem 0.34rem;
    border-radius: 6px;
    cursor: pointer;
}

.nb-toc-link:hover,
.nb-toc-link:focus-visible {
    background: #edf4ff;
    outline: none;
}

.nb-toc-level-2 { padding-left: 1rem; }
.nb-toc-level-3 { padding-left: 1.45rem; }
.nb-toc-level-4 { padding-left: 1.8rem; }
.nb-toc-level-5 { padding-left: 2.1rem; }
.nb-toc-level-6 { padding-left: 2.35rem; }

.nb-md-heading {
    scroll-margin-top: 5.2rem;
}

.nb-undo-toast {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.44rem 0.54rem 0.44rem 0.68rem;
    border: 1px solid #ccd8e8;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 10px 20px rgba(20, 34, 55, 0.14);
    color: #304864;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.16s ease, transform 0.16s ease;
    z-index: 2200;
}

.nb-undo-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.nb-undo-text {
    font-size: 0.82rem;
    line-height: 1.2;
}

.nb-undo-btn {
    border: 1px solid #c5d6ec;
    border-radius: 999px;
    background: #f4f8ff;
    color: #244a7a;
    font-size: 0.76rem;
    line-height: 1;
    padding: 0.26rem 0.62rem;
    cursor: pointer;
}

.nb-undo-btn:hover,
.nb-undo-btn:focus-visible {
    background: #eaf2ff;
    border-color: #b5cae4;
    outline: none;
}

.nb-cells {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nb-cell {
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    position: relative;
}

.nb-cell.is-active {
    border-color: #d8e2f0;
    background: #fcfdff;
    box-shadow: 0 6px 18px rgba(86, 111, 162, 0.08);
}

.nb-cell[data-cell-type="code"] {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

.nb-cell[data-cell-type="code"].is-active,
.nb-cell[data-cell-type="code"]:focus-within {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

.nb-cell[data-cell-type="markdown"] {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    border-radius: 10px;
    margin: 0;
    transition: margin 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.nb-cell[data-cell-type="markdown"].is-active,
.nb-cell[data-cell-type="markdown"]:focus-within {
    border-color: #e2e9f5;
    background: #fbfdff;
    box-shadow: none;
    margin: 0.65rem 0;
}

.nb-cell-insert {
    display: none;
    align-items: center;
    gap: 0.35rem;
    min-height: 0.8rem;
    padding: 0.1rem 0.8rem;
    background: transparent;
    border: none;
    transition: background-color 0.14s ease, border-color 0.14s ease;
}

.nb-cell.is-active .nb-cell-insert,
.nb-cell:focus-within .nb-cell-insert {
    display: flex;
}

.nb-insert-above {
    border-bottom: 1px dashed transparent;
}

.nb-insert-below {
    border-top: 1px dashed transparent;
    border-bottom: none;
}

.nb-cell-insert .nb-icon-btn {
    min-width: 2.1rem;
    height: 1.8rem;
    font-size: 0.75rem;
    opacity: 0;
    transform: translateY(-2px);
    pointer-events: none;
    transition: opacity 0.14s ease, transform 0.14s ease;
}

.nb-cell-insert:hover,
.nb-cell-insert:focus-within {
    background: #f8fafe;
}

.nb-insert-above:hover,
.nb-insert-above:focus-within {
    border-bottom-color: #e1e8f2;
}

.nb-insert-below:hover,
.nb-insert-below:focus-within {
    border-top-color: #e1e8f2;
}

.nb-cell-insert:hover .nb-icon-btn,
.nb-cell-insert:focus-within .nb-icon-btn {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.nb-cell-insert .nb-icon-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.nb-cell[data-cell-type="code"] .nb-cell-insert {
    display: flex;
    position: absolute;
    left: 0.7rem;
    right: 0.7rem;
    min-height: 0;
    padding: 0;
    background: transparent;
    border: none;
    opacity: 0;
    pointer-events: none;
    z-index: 16;
}

.nb-cell[data-cell-type="code"] .nb-insert-above {
    top: -0.65rem;
}

.nb-cell[data-cell-type="code"] .nb-insert-below {
    bottom: -0.65rem;
}

.nb-cell[data-cell-type="code"]:hover .nb-cell-insert,
.nb-cell[data-cell-type="code"].is-active .nb-cell-insert,
.nb-cell[data-cell-type="code"]:focus-within .nb-cell-insert {
    opacity: 1;
    pointer-events: auto;
}

.nb-cell[data-cell-type="code"] .nb-cell-insert .nb-icon-btn {
    opacity: 0;
    pointer-events: none;
    transform: translateY(0);
}

.nb-cell[data-cell-type="code"] .nb-cell-insert:hover .nb-icon-btn,
.nb-cell[data-cell-type="code"] .nb-cell-insert:focus-within .nb-icon-btn {
    opacity: 1;
    pointer-events: auto;
}

.nb-cell-header {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.52rem 0.8rem;
    border-bottom: 1px solid #edf0f5;
    background: #fafbfd;
    font-size: 0.84rem;
    color: #566179;
}

.nb-cell.is-active .nb-cell-header,
.nb-cell:focus-within .nb-cell-header {
    display: flex;
}

.nb-cell[data-cell-type="markdown"] .nb-cell-header {
    display: none;
    padding: 0.18rem 0.55rem 0.1rem 0.55rem;
    border-bottom: none;
    background: transparent;
}

.nb-cell[data-cell-type="code"] .nb-cell-header {
    display: none;
    position: absolute;
    top: 0;
    right: 0.72rem;
    transform: translateY(-50%);
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    gap: 0.32rem;
    padding: 0;
    border: none;
    background: transparent;
    z-index: 24;
    pointer-events: none;
}

.nb-cell[data-cell-type="code"].is-active .nb-cell-header,
.nb-cell[data-cell-type="code"]:focus-within .nb-cell-header {
    display: flex;
}

.nb-cell[data-cell-type="markdown"].is-active .nb-cell-header,
.nb-cell[data-cell-type="markdown"]:focus-within .nb-cell-header {
    display: flex;
}

.nb-reader-mode .nb-cell[data-cell-type="code"]:hover .nb-cell-header,
.nb-reader-mode .nb-cell[data-cell-type="markdown"]:hover .nb-cell-header {
    display: flex;
}

.nb-cell-kind {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #7a8498;
}

.nb-icon-btn.nb-cell-run-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #c9d8eb;
    background: #ffffff;
    color: #3a5f92;
    box-shadow: none;
    width: 1.56rem;
    min-width: 1.56rem;
    height: 1.56rem;
    padding: 0;
    border-radius: 50%;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.14s ease, background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.nb-cell[data-cell-type="code"]:hover .nb-icon-btn.nb-cell-run-trigger,
.nb-cell[data-cell-type="code"].is-active .nb-icon-btn.nb-cell-run-trigger {
    opacity: 0.84;
    visibility: visible;
    pointer-events: auto;
}

.nb-cell[data-cell-type="code"] .nb-icon-btn.nb-cell-run-trigger {
    position: absolute;
    top: var(--nb-run-top);
    left: var(--nb-run-left);
    z-index: 18;
}

.nb-icon-btn.nb-cell-run-trigger:hover,
.nb-icon-btn.nb-cell-run-trigger:focus-visible {
    border-color: #b6cbe5;
    background: rgba(47, 125, 240, 0.12);
    color: #2d5e9d;
    opacity: 1;
}

.nb-cell-actions {
    margin-left: auto;
    display: none;
    gap: 0.35rem;
    position: relative;
}

.nb-cell.is-active .nb-cell-actions,
.nb-cell:focus-within .nb-cell-actions {
    display: flex;
}

.nb-cell-actions .nb-icon-btn {
    font-weight: 700;
}

.nb-cell-actions .nb-icon-btn[data-action="up"],
.nb-cell-actions .nb-icon-btn[data-action="down"] {
    font-weight: 700;
    color: #274368;
    line-height: 0;
}

.nb-cell[data-cell-type="code"] .nb-cell-actions .nb-icon-btn[data-action="up"],
.nb-cell[data-cell-type="code"] .nb-cell-actions .nb-icon-btn[data-action="down"] {
    min-width: 1.72rem;
    height: 1.72rem;
}

.nb-arrow-icon {
    width: 1.04rem;
    height: 1.04rem;
    display: block;
}

.nb-cell[data-cell-type="code"] .nb-cell-actions {
    margin-left: 0;
    display: flex;
    flex-direction: row;
    gap: 0.14rem;
    pointer-events: auto;
    border: 1px solid #c6d5ea;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(18, 33, 58, 0.12);
    padding: 0.14rem;
}

.nb-cell[data-cell-type="code"] .nb-cell-actions .nb-icon-btn {
    min-width: 1.58rem;
    height: 1.58rem;
    border: none;
    box-shadow: none;
    background: transparent;
    border-radius: 999px;
    padding: 0;
}

.nb-cell[data-cell-type="code"] .nb-cell-actions .nb-icon-btn:hover,
.nb-cell[data-cell-type="code"] .nb-cell-actions .nb-icon-btn:focus-visible {
    border: none;
    background: #eef4fc;
    box-shadow: none;
}

.nb-cell[data-cell-type="code"] .nb-cell-actions .nb-icon-btn.is-running {
    background: #e8eff9;
    border: none;
}

.nb-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.85rem;
    height: 1.85rem;
    border: 1px solid #d5deea;
    background: #fff;
    border-radius: 7px;
    padding: 0 0.42rem;
    font-size: 0.82rem;
    line-height: 1;
    cursor: pointer;
    color: #3a4d6a;
    box-shadow: 0 1px 2px rgba(12, 22, 40, 0.08);
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.nb-icon-btn:hover,
.nb-icon-btn:focus-visible {
    border-color: #c3d1e6;
    background: #f5f8fe;
    color: #263d5e;
    outline: none;
}

.nb-icon-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.nb-icon-btn.is-running {
    color: #223652;
    border-color: #b7c7df;
}

.nb-icon-btn.nb-cell-run-trigger.is-running {
    background: rgba(47, 125, 240, 0.16);
    border-color: #afc4df;
    opacity: 1;
}

.nb-more-menu {
    position: relative;
}

.nb-more-menu > summary {
    list-style: none;
}

.nb-more-menu > summary::-webkit-details-marker {
    display: none;
}

.nb-more-menu[open] > .nb-more-trigger {
    border-color: #c5d3e8;
    background: #eef3fb;
}

.nb-more-panel {
    position: absolute;
    top: calc(100% + 0.28rem);
    right: 0;
    min-width: 170px;
    padding: 0.32rem;
    border: 1px solid #d7e0ed;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(12, 22, 40, 0.14);
    z-index: 25;
}

.nb-output-menu {
    position: relative;
}

.nb-output-menu > summary {
    list-style: none;
}

.nb-output-menu > summary::-webkit-details-marker {
    display: none;
}

.nb-icon-btn.nb-output-trigger {
    min-width: var(--nb-output-trigger-size);
    height: var(--nb-output-trigger-size);
    border: none;
    background: transparent;
    color: #5f6f89;
    box-shadow: none;
    border-radius: 999px;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.nb-cell[data-cell-type="code"].has-output:hover .nb-icon-btn.nb-output-trigger,
.nb-cell[data-cell-type="code"].has-output.is-active .nb-icon-btn.nb-output-trigger {
    opacity: 0.9;
    visibility: visible;
    pointer-events: auto;
}

.nb-icon-btn.nb-output-trigger:hover,
.nb-icon-btn.nb-output-trigger:focus-visible {
    border: none;
    background: #eef4fc;
    color: #355982;
}

.nb-output-panel {
    position: absolute;
    top: calc(100% + 0.24rem);
    left: 0;
    min-width: 146px;
    padding: 0.28rem;
    border: 1px solid #d7e0ed;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(12, 22, 40, 0.14);
    z-index: 25;
}

.nb-menu-action {
    display: block;
    width: 100%;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #2e425f;
    text-align: left;
    font-size: 0.82rem;
    line-height: 1.25;
    padding: 0.36rem 0.48rem;
    cursor: pointer;
}

.nb-menu-action:hover,
.nb-menu-action:focus-visible {
    background: #f0f5fd;
    outline: none;
}

.nb-menu-action:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.nb-run-spinner {
    display: inline-block;
    width: 0.78rem;
    height: 0.78rem;
    border: 2px solid #a0aec0;
    border-top-color: #334;
    border-radius: 50%;
    margin: 0;
    vertical-align: middle;
    animation: nb-spin 0.8s linear infinite;
}

@keyframes nb-spin {
    to {
        transform: rotate(360deg);
    }
}

.nb-cell-body {
    padding: 0.7rem var(--nb-cell-inline-pad) 0.85rem var(--nb-cell-inline-pad);
    overflow-x: visible;
}

.nb-cell[data-cell-type="code"] .nb-cell-body {
    position: relative;
    padding-top: 1.05rem;
    padding-bottom: 1.275rem;
}

.nb-cell[data-cell-type="code"].has-output .nb-cell-body {
    padding-bottom: 0;
}

.nb-cell[data-cell-type="markdown"] .nb-cell-body {
    padding: 0 var(--nb-cell-inline-pad) 0.3rem calc(var(--nb-cell-inline-pad) + var(--nb-markdown-left-offset));
}

.nb-cell[data-cell-type="markdown"].is-active .nb-cell-body,
.nb-cell[data-cell-type="markdown"]:focus-within .nb-cell-body {
    padding: 0 var(--nb-cell-inline-pad) 0.45rem calc(var(--nb-cell-inline-pad) + var(--nb-markdown-left-offset));
}

.nb-ace {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    border: 1px solid #e3e9f1;
    border-radius: 8px;
    background: #fbfcfe;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.nb-ace .ace_text-layer {
    font-weight: 500;
}

.nb-cell.is-active .nb-ace,
.nb-cell:focus-within .nb-ace {
    border-color: #c2d3ea;
    box-shadow: 0 0 0 2px rgba(148, 177, 218, 0.2);
}

.nb-cell[data-cell-type="code"].is-active .nb-ace,
.nb-cell[data-cell-type="code"]:focus-within .nb-ace {
    border-color: #2f7df0;
    box-shadow: none;
}

.nb-md-input {
    width: 100%;
    min-height: 80px;
    border: 1px solid #e3e9f1;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-family: inherit;
    resize: vertical;
    display: none;
}

.nb-cell[data-cell-type="markdown"] .nb-md-input {
    border: none;
    border-radius: 0;
    padding: 0;
    background: transparent;
    min-height: 1.8rem;
}

.nb-cell[data-cell-type="markdown"] .nb-md-input,
.nb-cell[data-cell-type="markdown"] .nb-md-preview {
    font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
    font-size: 1.04rem;
    line-height: 1.62;
    color: #25324a;
}

.nb-cell[data-cell-type="markdown"] .nb-md-input:focus {
    outline: none;
}

.nb-md-preview {
    margin-top: 0;
    padding: 0.75rem;
    border: 1px dashed #d5dce9;
    border-radius: 8px;
    background: #fcfdff;
    display: none;
    cursor: text;
}

.nb-cell[data-cell-type="markdown"] .nb-md-preview {
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
}

.nb-cell[data-cell-type="markdown"] .nb-md-preview code,
.nb-cell[data-cell-type="markdown"] .nb-md-preview pre {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.nb-cell[data-cell-type="markdown"] .nb-md-preview > :first-child {
    margin-top: 0;
}

.nb-cell[data-cell-type="markdown"] .nb-md-preview > :last-child {
    margin-bottom: 0;
}

.nb-md-input.is-active {
    display: block;
}

.nb-md-preview.is-active {
    display: block;
}

.nb-md-preview.is-empty {
    color: #889;
    font-style: italic;
    border-style: solid;
    background: #fff;
}

.nb-cell[data-cell-type="markdown"] .nb-md-preview.is-empty {
    font-style: normal;
    border-style: none;
    background: transparent;
    color: #8c95a8;
}

.nb-md-empty {
    color: #889;
}

.nb-output {
    padding: 0.75rem var(--nb-cell-inline-pad) 1rem var(--nb-cell-inline-pad);
    background: #fdfdfd;
}

.nb-output:empty {
    display: none;
}

.nb-cell[data-cell-type="code"].has-output .nb-ace {
    border-bottom: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.nb-cell[data-cell-type="code"] .nb-output {
    margin: 0 var(--nb-cell-inline-pad) 0.85rem var(--nb-cell-inline-pad);
    border: 1px solid #e3e9f1;
    border-top: 1px solid #dbe3ef;
    border-radius: 0 0 8px 8px;
    padding: 0;
    display: none;
    align-items: flex-start;
}

.nb-cell[data-cell-type="code"].has-output .nb-output {
    display: flex;
}

.nb-cell[data-cell-type="code"] .nb-output-controls {
    flex: 0 0 var(--nb-output-rail-width);
    padding: 0.58rem 0 0.76rem var(--nb-output-rail-left-pad);
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.nb-cell[data-cell-type="code"] .nb-output-main {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.72rem var(--nb-cell-inline-pad) 0.96rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.nb-cell[data-cell-type="code"] .nb-output-content {
    min-width: 0;
    position: relative;
}

.nb-cell[data-cell-type="code"] .nb-output.is-output-collapsible:not(.is-output-expanded) .nb-output-content {
    max-height: var(--nb-output-collapsed-max-height);
    overflow: hidden;
}

.nb-cell[data-cell-type="code"] .nb-output.is-output-collapsible:not(.is-output-expanded) .nb-output-content::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3.2rem;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(253, 253, 253, 0), rgba(253, 253, 253, 0.98));
}

.nb-cell[data-cell-type="code"] .nb-output-toggle {
    align-self: flex-start;
    border: 1px solid #d4ddea;
    background: #f8fbff;
    color: #2d4d74;
    border-radius: 999px;
    padding: 0.14rem 0.62rem;
    font-size: 0.74rem;
    line-height: 1.1;
    cursor: pointer;
}

.nb-cell[data-cell-type="code"] .nb-output-toggle:hover,
.nb-cell[data-cell-type="code"] .nb-output-toggle:focus-visible {
    border-color: #bfd0e7;
    background: #edf4fe;
    outline: none;
}

.nb-cell[data-cell-type="code"] .nb-output-toggle[hidden] {
    display: none;
}

.nb-cell[data-cell-type="code"].has-output.is-active .nb-output,
.nb-cell[data-cell-type="code"].has-output:focus-within .nb-output {
    border-color: #2f7df0;
    border-top-color: #c8daf7;
}

.nb-output .nb-stdout {
    white-space: pre-wrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.nb-output pre,
.nb-stdout-text {
    margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

.nb-stdout-html {
    white-space: normal;
}

.nb-output .nb-stderr {
    color: #b3261e;
}

.nb-output img {
    max-width: 100%;
    margin-top: 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.nb-cell[data-cell-type="code"].is-collapsed .nb-output {
    display: none;
}

.nb-cell[data-cell-type="markdown"].is-collapsed .nb-cell-body {
    display: none;
}

.nb-cell[data-cell-type="markdown"].is-collapsed .nb-cell-header {
    display: flex;
}

.nb-cell[data-cell-type="markdown"].is-collapsed .nb-cell-actions {
    display: flex;
}

.nb-list-shell {
    max-width: 1000px;
    margin: 2rem auto 3rem auto;
}

.nb-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.nb-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.nb-card {
    display: block;
    padding: 1rem;
    border: 1px solid #e4e6eb;
    border-radius: 10px;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.nb-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(25, 35, 55, 0.1);
}

.nb-card-title {
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.nb-card-desc {
    font-size: 0.9rem;
    color: #556;
}

.nb-card-meta {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #889;
}

.nb-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    box-shadow: 0 10px 18px rgba(0, 190, 98, 0.25);
    border-radius: 999px;
    background: linear-gradient(135deg, #00be62, #10b981);
    border: none;
}

.nb-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(0, 190, 98, 0.3);
}

.nb-empty {
    padding: 2rem;
    border: 1px dashed #ccd2df;
    border-radius: 10px;
    background: #fafbff;
    text-align: center;
}

.nb-tour {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.nb-tour-card {
    background: #fff;
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    width: min(520px, 92vw);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
}

.nb-tour-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.nb-tour-list {
    margin: 0;
    padding-left: 1.1rem;
}

@media (max-width: 720px) {
    .nb-shell {
        padding-bottom: 3.7rem;
    }

    .nb-header {
        padding: 0.72rem 0.74rem;
        gap: 0.58rem;
    }

    .nb-title-input {
        font-size: 1.2rem;
    }

    .nb-meta {
        gap: 0.44rem;
    }

    .nb-meta .nb-visibility,
    .nb-meta .nb-export {
        flex: 1 1 100%;
        min-height: 0;
        padding: 0.28rem 0.34rem;
    }

    .nb-header .form-control.form-control-sm {
        flex: 1 1 auto;
        min-width: 0;
    }

    #nb-export-btn.btn {
        flex: 0 0 auto;
    }

    .nb-toolbar {
        position: sticky;
        top: 0.35rem;
        z-index: 120;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.35rem;
        align-items: center;
        padding: 0.38rem;
        border: 1px solid #dbe4f0;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 8px 18px rgba(31, 45, 69, 0.11);
        backdrop-filter: blur(6px);
    }

    .nb-toolbar .btn.btn-sm {
        font-size: 0.78rem;
        line-height: 1.2;
        padding: 0.26rem 0.52rem;
    }

    .nb-toolbar > button,
    .nb-toolbar > details {
        flex: 0 0 auto;
    }

    .nb-toolbar .nb-toolbar-icon-btn {
        width: 1.86rem;
        min-width: 1.86rem;
        height: 1.86rem;
    }

    .nb-toolbar-secondary {
        display: none !important;
    }

    .nb-toolbar-more {
        display: inline-flex;
        flex: 0 0 auto;
    }

    .nb-toolbar-more-panel {
        position: fixed;
        top: auto;
        right: 0.75rem;
        bottom: 0.8rem;
        left: 0.75rem;
        min-width: 0;
        max-width: 340px;
        margin-left: auto;
        z-index: 2105;
    }

    .nb-toolbar-more-panel .nb-menu-action {
        font-size: 0.88rem;
        padding: 0.5rem 0.58rem;
    }

    .nb-toc {
        margin: -0.15rem 0 0.85rem 0;
    }

    .nb-toc > summary {
        font-size: 0.8rem;
    }

    .nb-toc-link {
        font-size: 0.8rem;
    }

    .nb-md-heading {
        scroll-margin-top: 6.6rem;
    }

    .nb-usage-meter {
        order: 20;
        margin-left: 0;
        font-size: 0.74rem;
    }

    .nb-status {
        order: 21;
        margin-left: 0;
        flex: 1 0 100%;
        font-size: 0.82rem;
        line-height: 1.3;
    }

    .nb-reader-mode .nb-toolbar .nb-toolbar-more {
        display: inline-flex !important;
    }

    .nb-undo-toast {
        left: 0.65rem;
        right: 0.65rem;
        bottom: 0.65rem;
        justify-content: space-between;
        border-radius: 12px;
    }

    .nb-list-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}
