.infinite-canvas-trigger {
    position: relative;
    background: linear-gradient(180deg, rgba(228, 246, 255, .18), rgba(136, 203, 255, .08));
    border-color: rgba(196, 231, 255, .24);
}

.infinite-canvas-trigger:hover {
    border-color: rgba(210, 240, 255, .42);
    background: linear-gradient(180deg, rgba(239, 250, 255, .2), rgba(141, 213, 255, .12));
}

.infinite-canvas-trigger.is-locked,
.infinite-canvas-trigger:disabled {
    border-color: rgba(148, 163, 184, .18);
    background: linear-gradient(180deg, rgba(148, 163, 184, .12), rgba(100, 116, 139, .06));
    color: rgba(255, 247, 239, .38);
    cursor: not-allowed;
    filter: grayscale(.65);
    opacity: .72;
    transform: none !important;
}

.infinite-canvas-trigger.is-locked svg,
.infinite-canvas-trigger:disabled svg {
    opacity: .52;
}

.infinite-canvas-beta-badge {
    position: absolute;
    right: -7px;
    top: -8px;
    z-index: 2;
    min-width: 34px;
    height: 17px;
    padding: 0 6px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .72);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fde68a, #f59e0b);
    color: #3a220f;
    font-size: 9px;
    line-height: 1;
    font-weight: 950;
    letter-spacing: .04em;
    box-shadow: 0 7px 16px rgba(15, 23, 42, .18);
    pointer-events: none;
}

.infinite-canvas-trigger.is-locked .infinite-canvas-beta-badge,
.infinite-canvas-trigger:disabled .infinite-canvas-beta-badge {
    background: linear-gradient(135deg, #e2e8f0, #94a3b8);
    color: #475569;
    box-shadow: none;
}

body.infinite-canvas-open .nano-contact-fab,
body.infinite-canvas-open .nano-scroll-top-btn {
    opacity: 0 !important;
    pointer-events: none !important;
}

body.infinite-canvas-open .history-modal.open,
body.infinite-canvas-open .nano-modal.open {
    z-index: 140;
}

body.infinite-canvas-open .history-modal.open {
    background: rgba(248, 250, 252, .76);
    backdrop-filter: blur(18px);
}

body.infinite-canvas-open .history-modal.open .history-dialog {
    border-color: rgba(15, 23, 42, .1);
    background: #fff;
    color: #0f172a;
    box-shadow: 0 28px 70px rgba(15, 23, 42, .18);
}

body.infinite-canvas-open .history-modal.open .history-dialog::before {
    display: none;
}

body.infinite-canvas-open .history-modal.open .history-panel {
    color: #0f172a;
    scrollbar-width: thin;
    scrollbar-color: rgba(15, 23, 42, .18) transparent;
}

body.infinite-canvas-open .history-modal.open .history-panel::-webkit-scrollbar {
    width: 8px;
}

body.infinite-canvas-open .history-modal.open .history-panel::-webkit-scrollbar-track {
    background: transparent;
}

body.infinite-canvas-open .history-modal.open .history-panel::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(15, 23, 42, .16);
    background-clip: padding-box;
}

body.infinite-canvas-open .history-modal.open .history-close,
body.infinite-canvas-open .history-modal.open .history-page-btn,
body.infinite-canvas-open .history-modal.open .history-page-jump-btn,
body.infinite-canvas-open .history-modal.open .history-download,
body.infinite-canvas-open .history-modal.open .history-set-reference,
body.infinite-canvas-open .history-modal.open .history-delete,
body.infinite-canvas-open .history-modal.open .history-beta-btn,
body.infinite-canvas-open .history-modal.open .tag {
    border-color: rgba(100, 116, 139, .16);
    background: #fff;
    color: #0f172a;
    box-shadow: none;
}

body.infinite-canvas-open .history-modal.open .history-close:hover,
body.infinite-canvas-open .history-modal.open .history-page-btn:hover:not(:disabled),
body.infinite-canvas-open .history-modal.open .history-page-jump-btn:hover:not(:disabled),
body.infinite-canvas-open .history-modal.open .history-download:hover,
body.infinite-canvas-open .history-modal.open .history-set-reference:hover:not(:disabled),
body.infinite-canvas-open .history-modal.open .history-delete:hover:not(:disabled),
body.infinite-canvas-open .history-modal.open .history-beta-btn:hover:not(:disabled) {
    border-color: rgba(15, 23, 42, .24);
    background: #f8fafc;
}

body.infinite-canvas-open .history-modal.open .history-beta-btn {
    min-width: 82px;
    background: #0f172a;
    color: #fff;
    font-weight: 850;
    opacity: 1;
}

body.infinite-canvas-open .history-modal.open .history-beta-btn:hover:not(:disabled) {
    background: #1e293b;
    color: #fff;
}

body.infinite-canvas-open .history-modal.open .history-beta-btn:disabled,
body.infinite-canvas-open .history-modal.open .history-beta-btn.is-approved,
body.infinite-canvas-open .history-modal.open .history-beta-btn.is-pending {
    border-color: rgba(100, 116, 139, .16);
    background: #eef2f7;
    color: #334155;
    opacity: 1;
}

body.infinite-canvas-open .history-modal.open .history-beta-btn.is-rejected {
    border-color: rgba(15, 23, 42, .24);
    background: #fff;
    color: #0f172a;
}

body.infinite-canvas-open .history-modal.open .history-kicker,
body.infinite-canvas-open .history-modal.open .history-sub,
body.infinite-canvas-open .history-modal.open .history-block-note,
body.infinite-canvas-open .history-modal.open .history-meta-label,
body.infinite-canvas-open .history-modal.open .history-page-indicator,
body.infinite-canvas-open .history-modal.open .history-page-jump-label {
    color: #64748b;
}

body.infinite-canvas-open .history-modal.open .history-title,
body.infinite-canvas-open .history-modal.open .history-block-title,
body.infinite-canvas-open .history-modal.open .history-prompt-copy,
body.infinite-canvas-open .history-modal.open .history-meta-value {
    color: #0f172a;
}

body.infinite-canvas-open .history-modal.open .history-block,
body.infinite-canvas-open .history-modal.open .history-meta-item,
body.infinite-canvas-open .history-modal.open .history-empty-state,
body.infinite-canvas-open .history-modal.open .history-pagination {
    border-color: rgba(100, 116, 139, .14);
    background: #f8fafc;
    color: #0f172a;
    box-shadow: none;
}

body.infinite-canvas-open .history-modal.open .history-frame {
    border-color: rgba(100, 116, 139, .16);
    background: #eef2f7;
}

body.infinite-canvas-open .history-modal.open .history-page-input {
    border-color: rgba(100, 116, 139, .16);
    background: #fff;
    color: #0f172a;
    box-shadow: none;
}

body.infinite-canvas-open .history-modal.open .history-page-input:focus {
    border-color: rgba(15, 23, 42, .28);
    box-shadow: 0 0 0 3px rgba(15, 23, 42, .06);
}

body.infinite-canvas-open .nano-modal.open {
    background: rgba(248, 250, 252, .76);
    backdrop-filter: blur(18px);
}

body.infinite-canvas-open .nano-modal.open .nano-dialog {
    border-color: rgba(15, 23, 42, .1);
    background: #fff;
    color: #0f172a;
    box-shadow: 0 28px 70px rgba(15, 23, 42, .18);
}

body.infinite-canvas-open .nano-modal.open .nano-dialog::before {
    display: none;
}

body.infinite-canvas-open .nano-modal.open .nano-panel {
    color: #0f172a;
    scrollbar-width: thin;
    scrollbar-color: rgba(15, 23, 42, .18) transparent;
}

body.infinite-canvas-open .nano-modal.open .nano-panel::-webkit-scrollbar {
    width: 8px;
}

body.infinite-canvas-open .nano-modal.open .nano-panel::-webkit-scrollbar-track {
    background: transparent;
}

body.infinite-canvas-open .nano-modal.open .nano-panel::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(15, 23, 42, .16);
    background-clip: padding-box;
}

body.infinite-canvas-open .nano-modal.open .nano-close,
body.infinite-canvas-open .nano-modal.open .nano-page-btn,
body.infinite-canvas-open .nano-modal.open .nano-page-jump-btn,
body.infinite-canvas-open .nano-modal.open .nano-copy-btn,
body.infinite-canvas-open .nano-modal.open .nano-secondary-btn,
body.infinite-canvas-open .nano-modal.open .nano-preset-link,
body.infinite-canvas-open .nano-modal.open .nano-invoice-type-btn,
body.infinite-canvas-open .nano-modal.open .nano-recharge-tool {
    border-color: rgba(100, 116, 139, .16);
    background: #fff;
    color: #0f172a;
    box-shadow: none;
}

body.infinite-canvas-open .nano-modal.open .nano-close:hover,
body.infinite-canvas-open .nano-modal.open .nano-page-btn:hover:not(:disabled),
body.infinite-canvas-open .nano-modal.open .nano-page-jump-btn:hover:not(:disabled),
body.infinite-canvas-open .nano-modal.open .nano-copy-btn:hover,
body.infinite-canvas-open .nano-modal.open .nano-secondary-btn:hover,
body.infinite-canvas-open .nano-modal.open .nano-preset-link:hover,
body.infinite-canvas-open .nano-modal.open .nano-invoice-type-btn:hover,
body.infinite-canvas-open .nano-modal.open .nano-recharge-tool:hover {
    border-color: rgba(15, 23, 42, .24);
    background: #f8fafc;
}

body.infinite-canvas-open .nano-modal.open .nano-primary-btn,
body.infinite-canvas-open .nano-modal.open .nano-order-action,
body.infinite-canvas-open .nano-modal.open .nano-invoice-type-btn.active {
    border-color: #0f172a;
    background: #0f172a;
    color: #fff;
    box-shadow: none;
}

body.infinite-canvas-open .nano-modal.open .nano-primary-btn:hover:not(:disabled),
body.infinite-canvas-open .nano-modal.open .nano-order-action:hover:not(:disabled) {
    background: #1e293b;
    box-shadow: none;
}

body.infinite-canvas-open .nano-modal.open .nano-sheet-kicker,
body.infinite-canvas-open .nano-modal.open .nano-sheet-sub,
body.infinite-canvas-open .nano-modal.open .nano-stat-label,
body.infinite-canvas-open .nano-modal.open .nano-block-note,
body.infinite-canvas-open .nano-modal.open .nano-list-sub,
body.infinite-canvas-open .nano-modal.open .nano-page-info,
body.infinite-canvas-open .nano-modal.open .nano-field-label,
body.infinite-canvas-open .nano-modal.open .nano-form-note,
body.infinite-canvas-open .nano-modal.open .nano-order-meta-label,
body.infinite-canvas-open .nano-modal.open .nano-invoice-summary-label,
body.infinite-canvas-open .nano-modal.open .nano-preset-time,
body.infinite-canvas-open .nano-modal.open .nano-invoice-order-meta,
body.infinite-canvas-open .nano-modal.open .nano-invoice-order-check,
body.infinite-canvas-open .nano-modal.open .nano-recharge-faq-answer,
body.infinite-canvas-open .nano-modal.open .nano-pricing-head,
body.infinite-canvas-open .nano-modal.open .nano-pricing-note,
body.infinite-canvas-open .nano-modal.open .nano-pricing-cost,
body.infinite-canvas-open .nano-modal.open .nano-recharge-credit-split {
    color: #64748b;
}

body.infinite-canvas-open .nano-modal.open .nano-sheet-title,
body.infinite-canvas-open .nano-modal.open .nano-stat-value,
body.infinite-canvas-open .nano-modal.open .nano-block-title,
body.infinite-canvas-open .nano-modal.open .nano-list-title,
body.infinite-canvas-open .nano-modal.open .nano-list-amount,
body.infinite-canvas-open .nano-modal.open .nano-list-amount.positive,
body.infinite-canvas-open .nano-modal.open .nano-list-amount.negative,
body.infinite-canvas-open .nano-modal.open .nano-form-label,
body.infinite-canvas-open .nano-modal.open .nano-order-meta-value,
body.infinite-canvas-open .nano-modal.open .nano-invoice-summary-value,
body.infinite-canvas-open .nano-modal.open .nano-preset-name,
body.infinite-canvas-open .nano-modal.open .nano-invoice-order-id,
body.infinite-canvas-open .nano-modal.open .nano-invoice-order-amount,
body.infinite-canvas-open .nano-modal.open .nano-recharge-faq summary,
body.infinite-canvas-open .nano-modal.open .nano-pricing-model {
    color: #0f172a;
}

body.infinite-canvas-open .nano-modal.open .nano-stat-card,
body.infinite-canvas-open .nano-modal.open .nano-block,
body.infinite-canvas-open .nano-modal.open .nano-list-item,
body.infinite-canvas-open .nano-modal.open .nano-field-card,
body.infinite-canvas-open .nano-modal.open .nano-order-card,
body.infinite-canvas-open .nano-modal.open .nano-order-meta-item,
body.infinite-canvas-open .nano-modal.open .nano-invoice-summary-cell,
body.infinite-canvas-open .nano-modal.open .nano-preset-card,
body.infinite-canvas-open .nano-modal.open .nano-invoice-order-option,
body.infinite-canvas-open .nano-modal.open .nano-form-status,
body.infinite-canvas-open .nano-modal.open .nano-invoice-threshold,
body.infinite-canvas-open .nano-modal.open .nano-invoice-order-empty,
body.infinite-canvas-open .nano-modal.open .nano-order-extra,
body.infinite-canvas-open .nano-modal.open .nano-recharge-faq details,
body.infinite-canvas-open .nano-modal.open .nano-pricing-row,
body.infinite-canvas-open .nano-modal.open .nano-pricing-cost {
    border-color: rgba(100, 116, 139, .14);
    background: #f8fafc;
    color: #0f172a;
    box-shadow: none;
}

body.infinite-canvas-open .nano-modal.open .nano-order-chip,
body.infinite-canvas-open .nano-modal.open .nano-order-chip.plan,
body.infinite-canvas-open .nano-modal.open .nano-order-chip.paid,
body.infinite-canvas-open .nano-modal.open .nano-order-chip.scope,
body.infinite-canvas-open .nano-modal.open .nano-order-chip.invoice-none,
body.infinite-canvas-open .nano-modal.open .nano-order-chip.invoice-submitted,
body.infinite-canvas-open .nano-modal.open .nano-order-chip.invoice-processing,
body.infinite-canvas-open .nano-modal.open .nano-order-chip.invoice-completed,
body.infinite-canvas-open .nano-modal.open .nano-order-chip.invoice-rejected {
    border-color: rgba(100, 116, 139, .16);
    background: #eef2f7;
    color: #334155;
}

body.infinite-canvas-open .nano-modal.open .nano-recharge-card,
body.infinite-canvas-open .nano-modal.open .nano-recharge-card.is-featured,
body.infinite-canvas-open .nano-modal.open .nano-recharge-credit-box {
    border-color: rgba(100, 116, 139, .14);
    background: #f8fafc;
    color: #0f172a;
    box-shadow: none;
}

body.infinite-canvas-open .nano-modal.open .nano-recharge-card-title,
body.infinite-canvas-open .nano-modal.open .nano-recharge-price,
body.infinite-canvas-open .nano-modal.open .nano-recharge-credit-value {
    color: #0f172a;
}

body.infinite-canvas-open .nano-modal.open .nano-recharge-card-sub,
body.infinite-canvas-open .nano-modal.open .nano-recharge-credit-label,
body.infinite-canvas-open .nano-modal.open .nano-recharge-meta,
body.infinite-canvas-open .nano-modal.open .nano-recharge-meta li,
body.infinite-canvas-open .nano-modal.open .nano-recharge-meta span,
body.infinite-canvas-open .nano-modal.open .nano-recharge-status {
    color: #64748b;
}

body.infinite-canvas-open .nano-modal.open .nano-recharge-badge {
    border-color: rgba(100, 116, 139, .16);
    background: #eef2f7;
    color: #334155;
}

body.infinite-canvas-open .nano-modal.open .nano-recharge-badge.is-bonus,
body.infinite-canvas-open .nano-modal.open .nano-recharge-credit-chip,
body.infinite-canvas-open .nano-modal.open .nano-recharge-credit-chip.is-bonus {
    border-color: rgba(100, 116, 139, .16);
    background: #eef2f7;
    color: #0f172a;
}

body.infinite-canvas-open .nano-modal.open .nano-recharge-badge.is-bonus {
    border-color: #0f172a;
    background: #0f172a;
    color: #fff;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .16);
}

body.infinite-canvas-open .nano-modal.open .nano-recharge-badge.is-bonus-low {
    border-color: rgba(100, 116, 139, .12);
    background: #f1f5f9;
    color: #64748b;
    box-shadow: none;
}

body.infinite-canvas-open .nano-modal.open .nano-recharge-meta i {
    color: #0f172a;
}

body.infinite-canvas-open .nano-modal.open .nano-recharge-tool-icon,
body.infinite-canvas-open .nano-modal.open .nano-recharge-ticker-credit,
body.infinite-canvas-open .nano-modal.open .nano-pricing-cost strong {
    color: #0f172a;
}

body.infinite-canvas-open .nano-modal.open .nano-recharge-tool-mark,
body.infinite-canvas-open .nano-modal.open .nano-pricing-cost-icon {
    background: #0f172a;
    color: #fff;
    box-shadow: none;
}

body.infinite-canvas-open .nano-modal.open .nano-recharge-buy {
    border-color: #0f172a;
    background: #0f172a;
    color: #fff;
    box-shadow: none;
}

body.infinite-canvas-open .nano-modal.open .nano-recharge-buy:hover:not(:disabled) {
    border-color: #0f172a;
    background: #020617;
    color: #fff;
    box-shadow: 0 16px 30px rgba(15, 23, 42, .18);
}

body.infinite-canvas-open .nano-modal.open .nano-recharge-disabled-note {
    color: #64748b;
}

body.infinite-canvas-open .nano-modal.open .nano-recharge-card:hover:not(.is-disabled),
body.infinite-canvas-open .nano-modal.open .nano-recharge-card.is-featured:hover:not(.is-disabled) {
    border-color: rgba(15, 23, 42, .24);
    background: #fff;
    box-shadow: 0 28px 64px rgba(15, 23, 42, .18);
}

body.infinite-canvas-open .nano-modal.open .nano-recharge-ticker {
    background: transparent;
    box-shadow: none;
}

body.infinite-canvas-open .nano-modal.open .nano-recharge-ticker::before,
body.infinite-canvas-open .nano-modal.open .nano-recharge-ticker::after {
    display: none;
}

body.infinite-canvas-open .nano-modal.open .nano-recharge-ticker-item {
    color: #64748b;
}

body.infinite-canvas-open .nano-modal.open .nano-recharge-ticker-user,
body.infinite-canvas-open .nano-modal.open .nano-recharge-ticker-plan {
    color: #0f172a;
}

body.infinite-canvas-open .nano-modal.open .nano-copy-input,
body.infinite-canvas-open .nano-modal.open .nano-input,
body.infinite-canvas-open .nano-modal.open .nano-page-input {
    border-color: rgba(100, 116, 139, .16);
    background: #fff;
    color: #0f172a;
    box-shadow: none;
}

body.infinite-canvas-open .nano-modal.open .nano-copy-input:focus,
body.infinite-canvas-open .nano-modal.open .nano-input:focus,
body.infinite-canvas-open .nano-modal.open .nano-page-input:focus {
    border-color: rgba(15, 23, 42, .28);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, .06);
}

body.infinite-canvas-open .nano-modal.open .nano-primary-btn:disabled,
body.infinite-canvas-open .nano-modal.open .nano-order-action.is-disabled,
body.infinite-canvas-open .nano-modal.open .nano-order-action:disabled {
    border-color: rgba(100, 116, 139, .14);
    background: #e2e8f0;
    color: #64748b;
}

.nano-infinite-canvas {
    position: fixed;
    inset: 0;
    z-index: 95;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding: 10px;
    background: rgba(246, 247, 249, .94);
    color: #172033;
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, visibility .18s ease;
}

.nano-infinite-canvas.open {
    opacity: 1;
    visibility: visible;
}

.nic-corner-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 48;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #64748b;
    display: grid;
    place-items: center;
    box-shadow: none;
    cursor: pointer;
    font-size: 20px;
    font-weight: 620;
    line-height: 1;
    transition: color .16s ease, background .16s ease;
}

.nic-corner-close:hover {
    background: rgba(15, 23, 42, .06);
    color: #0f172a;
}

.nic-shell {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(460px, 34vw, 620px);
    border: 1px solid rgba(117, 130, 154, .16);
    border-radius: 28px;
    overflow: hidden;
    background: #f8f9fb;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .16);
}

.nic-main {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    border-right: 1px solid rgba(117, 130, 154, .16);
}

.nic-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(117, 130, 154, .16);
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(18px);
}

.nic-brand {
    min-width: 0;
}

.nic-title-row {
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.nic-kicker {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #64748b;
}

.nic-title {
    font-size: 18px;
    line-height: 1.2;
    font-weight: 780;
    color: #0f172a;
    white-space: nowrap;
}

.nic-search {
    width: min(260px, 28vw);
    min-width: 190px;
    height: 34px;
    border: 1px solid rgba(100, 116, 139, .14);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, .74);
    box-shadow: 0 10px 22px rgba(15, 23, 42, .04);
}

.nic-search input {
    width: 100%;
    height: 100%;
    padding: 0 13px;
    border: 0;
    background: transparent;
    color: #0f172a;
    font: inherit;
    font-size: 12px;
    font-weight: 620;
    outline: none;
}

.nic-search input::placeholder {
    color: rgba(100, 116, 139, .62);
}

.nic-actions,
.nic-zoom-actions,
.nic-panel-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nic-history-limit {
    min-height: 36px;
    padding: 4px 8px 4px 10px;
    border: 1px solid rgba(100, 116, 139, .14);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, .78);
    box-shadow: 0 10px 22px rgba(15, 23, 42, .05);
}

.nic-limit-label {
    color: #64748b;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}

.nic-limit-range {
    width: 112px;
    height: 18px;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

.nic-limit-range::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 999px;
    background: #d1d5db;
}

.nic-limit-range::-webkit-slider-thumb {
    width: 16px;
    height: 16px;
    margin-top: -6px;
    border: 3px solid #fff;
    border-radius: 999px;
    appearance: none;
    background: #64748b;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .18);
}

.nic-limit-range::-moz-range-track {
    height: 4px;
    border-radius: 999px;
    background: #d1d5db;
}

.nic-limit-range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border: 3px solid #fff;
    border-radius: 999px;
    background: #64748b;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .18);
}

.nic-limit-input {
    width: 52px;
    height: 28px;
    padding: 0 4px 0 9px;
    border: 0;
    border-radius: 999px 0 0 999px;
    background: transparent;
    color: #334155;
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    text-align: center;
    outline: none;
    appearance: textfield;
    -moz-appearance: textfield;
}

.nic-limit-input::-webkit-outer-spin-button,
.nic-limit-input::-webkit-inner-spin-button {
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
}

.nic-limit-input:focus {
    background: transparent;
}

.nic-limit-stepper {
    height: 28px;
    border: 1px solid rgba(100, 116, 139, .14);
    border-radius: 999px;
    display: inline-flex;
    align-items: stretch;
    overflow: hidden;
    background: rgba(255, 255, 255, .9);
}

.nic-limit-stepper:focus-within {
    border-color: rgba(15, 23, 42, .24);
    background: #fff;
}

.nic-limit-step-buttons {
    width: 0;
    display: grid;
    grid-template-rows: 1fr 1fr;
    border-left: 1px solid transparent;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transition: width .14s ease, opacity .14s ease, border-color .14s ease;
}

.nic-limit-stepper:hover .nic-limit-step-buttons,
.nic-limit-stepper:focus-within .nic-limit-step-buttons {
    width: 20px;
    border-left-color: rgba(100, 116, 139, .12);
    opacity: 1;
    pointer-events: auto;
}

.nic-limit-step {
    min-width: 0;
    width: 20px;
    height: 13px;
    padding: 0;
    border: 0;
    display: grid;
    place-items: center;
    background: transparent;
    color: #64748b;
    font-size: 7px;
    line-height: 1;
    cursor: pointer;
}

.nic-limit-step + .nic-limit-step {
    border-top: 1px solid rgba(100, 116, 139, .1);
}

.nic-limit-step:hover {
    background: rgba(15, 23, 42, .05);
    color: #0f172a;
}

.nic-icon-btn,
.nic-action-btn {
    height: 36px;
    border: 1px solid rgba(100, 116, 139, .18);
    background: rgba(255, 255, 255, .86);
    color: #1f2937;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
    transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.nic-icon-btn {
    width: 36px;
    padding: 0;
    border-radius: 13px;
}

.nic-action-btn {
    padding: 0 12px;
    border-radius: 14px;
}

.nic-icon-btn:hover,
.nic-action-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 23, 42, .24);
    background: #fff;
}

.nic-action-btn.primary {
    border-color: rgba(100, 116, 139, .18);
    background: rgba(248, 250, 252, .92);
    color: #334155;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .06);
}

.nic-action-btn.primary:hover {
    border-color: rgba(15, 23, 42, .2);
    background: #fff;
    color: #0f172a;
}

.nic-action-btn.danger {
    border-color: rgba(15, 23, 42, .14);
    color: #334155;
    background: rgba(255, 255, 255, .86);
}

#infinite-canvas-close {
    border-color: #0f172a;
    background: #0f172a;
    color: #fff;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .16);
}

#infinite-canvas-close:hover {
    border-color: #020617;
    background: #020617;
    color: #fff;
}

.nic-icon-btn svg,
.nic-action-btn svg {
    width: 16px;
    height: 16px;
    display: block;
}

.nic-panel-actions-icons {
    flex-wrap: nowrap;
    gap: 8px;
}

.nic-action-icon-btn {
    width: 38px;
    height: 34px;
    padding: 0;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: rgba(255, 255, 255, .9);
    color: #111827;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .05);
    transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.nic-action-icon-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 23, 42, .22);
    background: #fff;
}

.nic-action-icon-btn.danger {
    color: #111827;
}

.nic-action-icon-btn svg {
    width: 16px;
    height: 16px;
    display: block;
}

.nano-infinite-canvas [data-nic-tip] {
    position: relative;
}

.nano-infinite-canvas [data-nic-tip]::after {
    content: attr(data-nic-tip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    z-index: 60;
    max-width: 220px;
    padding: 6px 9px;
    border-radius: 9px;
    background: rgba(15, 23, 42, .94);
    color: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .18);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.25;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 4px);
    transition: opacity .04s linear, transform .04s linear, visibility 0s linear;
    transition-delay: 0s;
}

.nano-infinite-canvas [data-nic-tip]:hover::after,
.nano-infinite-canvas [data-nic-tip]:focus-visible::after {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.nic-node-toolbar [data-nic-tip]::after {
    top: calc(100% + 8px);
    bottom: auto;
    transform: translate(-50%, -4px);
}

.nic-node-toolbar [data-nic-tip]:hover::after,
.nic-node-toolbar [data-nic-tip]:focus-visible::after {
    transform: translate(-50%, 0);
}

.nic-node-toolbar [data-nic-tip]::after {
    content: none;
    display: none;
}

.nic-floating-tip {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 180;
    max-width: 220px;
    padding: 6px 9px;
    border-radius: 9px;
    background: #0f172a;
    color: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .18);
    font-size: 11px;
    font-weight: 750;
    line-height: 1.25;
    letter-spacing: 0;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    text-rendering: geometricPrecision;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: opacity .04s linear, visibility 0s linear;
}

.nic-floating-tip.is-visible {
    opacity: 1;
    visibility: visible;
}

.nic-status {
    min-width: 130px;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid rgba(100, 116, 139, .14);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .74);
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.nic-status.is-success {
    border-color: rgba(15, 23, 42, .18);
    color: #0f172a;
    background: #f8fafc;
}

.nic-status.is-error {
    border-color: rgba(15, 23, 42, .24);
    color: #0f172a;
    background: #fff;
}

.nic-viewport {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    touch-action: none;
    cursor: default;
    background-color: #f7f8fa;
    background-image:
        linear-gradient(rgba(148, 163, 184, .11) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, .11) 1px, transparent 1px);
    background-size: 40px 40px;
}

.nic-viewport.is-pan-tool {
    cursor: grab;
}

.nic-viewport.is-panning {
    cursor: grabbing;
}

.nic-viewport.is-selecting {
    cursor: crosshair;
}

.nic-context-menu {
    position: absolute;
    z-index: 30;
    min-width: 136px;
    padding: 6px;
    border: 1px solid rgba(15, 23, 42, .1);
    border-radius: 14px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 18px 40px rgba(15, 23, 42, .16);
    backdrop-filter: blur(16px);
}

.nic-context-menu button {
    width: 100%;
    height: 34px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    background: transparent;
    color: #0f172a;
    font: inherit;
    font-size: 12px;
    font-weight: 720;
    cursor: pointer;
}

.nic-context-menu button:hover {
    background: #f1f5f9;
}

.nic-context-menu.is-node-menu {
    min-width: 148px;
}

.nic-context-menu button.danger {
    color: #dc2626;
}

.nic-context-menu button.danger:hover {
    background: #fef2f2;
}

.nic-context-menu button:disabled {
    color: #94a3b8;
    cursor: not-allowed;
    opacity: .55;
}

.nic-context-menu button:disabled:hover {
    background: transparent;
}

.nic-left-toolbar {
    position: absolute;
    left: 14px;
    top: 50%;
    z-index: 8;
    width: 44px;
    padding: 5px;
    border: 1px solid rgba(15, 23, 42, .1);
    border-radius: 14px;
    display: grid;
    gap: 4px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 16px 36px rgba(15, 23, 42, .12);
    backdrop-filter: blur(16px);
    transform: translateY(-50%);
}

.nic-left-toolbar [data-nic-tip]::after {
    left: calc(100% + 10px);
    top: 50%;
    bottom: auto;
    transform: translate(4px, -50%);
}

.nic-left-toolbar [data-nic-tip]:hover::after,
.nic-left-toolbar [data-nic-tip]:focus-visible::after {
    transform: translate(0, -50%);
}

.nic-canvas-tool {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: transparent;
    color: #475569;
    cursor: pointer;
}

.nic-canvas-tool svg {
    width: 19px;
    height: 19px;
}

.nic-canvas-tool:hover,
.nic-canvas-tool.is-active {
    border-color: rgba(15, 23, 42, .12);
    background: #f8fafc;
    color: #0f172a;
}

.nic-selection-box {
    position: absolute;
    z-index: 7;
    border: 1px solid rgba(37, 99, 235, .78);
    background: rgba(37, 99, 235, .1);
    pointer-events: none;
}

.nic-loading {
    position: absolute;
    inset: 0;
    z-index: 12;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(248, 250, 252, .58);
    backdrop-filter: blur(8px);
    pointer-events: none;
}

.nic-loading[hidden] {
    display: none;
}

.nic-loading-panel {
    min-width: min(300px, calc(100vw - 64px));
    padding: 20px 22px;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 20px;
    display: grid;
    justify-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 24px 64px rgba(15, 23, 42, .16);
    color: #0f172a;
    text-align: center;
}

.nic-loading-spinner {
    width: 28px;
    height: 28px;
    border: 2px solid rgba(15, 23, 42, .12);
    border-top-color: #111827;
    border-radius: 999px;
    animation: nic-spin .8s linear infinite;
}

.nic-loading-panel strong {
    font-size: 14px;
    line-height: 1.3;
    font-weight: 760;
}

.nic-loading-panel small {
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
    font-weight: 560;
}

.nic-limit-warning {
    position: absolute;
    inset: 0;
    z-index: 70;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(248, 250, 252, .58);
    backdrop-filter: blur(10px);
}

.nic-limit-warning[hidden] {
    display: none;
}

.nic-limit-warning-dialog {
    width: min(420px, calc(100vw - 48px));
    padding: 20px;
    border: 1px solid rgba(15, 23, 42, .1);
    border-radius: 24px;
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 14px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 26px 72px rgba(15, 23, 42, .18);
    color: #0f172a;
}

.nic-limit-warning-icon {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #111827;
    color: #fff;
    font-size: 18px;
    font-weight: 850;
}

.nic-limit-warning-copy {
    display: grid;
    gap: 7px;
}

.nic-limit-warning-copy strong {
    font-size: 15px;
    line-height: 1.35;
    font-weight: 820;
}

.nic-limit-warning-copy p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.65;
    font-weight: 560;
}

.nic-limit-warning-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.nic-limit-warning-btn {
    min-width: 82px;
    height: 38px;
    padding: 0 16px;
    border: 1px solid rgba(15, 23, 42, .1);
    border-radius: 999px;
    background: #fff;
    color: #0f172a;
    font-size: 13px;
    font-weight: 760;
    cursor: pointer;
}

.nic-limit-warning-btn:hover {
    background: #f8fafc;
}

.nic-limit-warning-btn.primary {
    border-color: #111827;
    background: #111827;
    color: #fff;
}

.nic-limit-warning-btn.primary:hover {
    background: #020617;
}

.nic-batchbar {
    position: absolute;
    left: 50%;
    top: 18px;
    z-index: 9;
    transform: translateX(-50%);
    min-height: 44px;
    padding: 6px;
    border: 1px solid rgba(15, 23, 42, .1);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 18px 44px rgba(15, 23, 42, .16);
    backdrop-filter: blur(18px);
}

.nic-batchbar[hidden] {
    display: none;
}

.nic-batch-count {
    padding: 0 10px;
    color: #334155;
    font-size: 13px;
    font-weight: 650;
    white-space: nowrap;
}

.nic-batchbar button {
    height: 32px;
    padding: 0 12px;
    border: 1px solid rgba(15, 23, 42, .1);
    border-radius: 10px;
    background: #f8fafc;
    color: #0f172a;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.nic-batchbar .nic-batch-download {
    background: #111827;
    color: #fff;
}

.nic-batchbar .nic-batch-delete {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

.nic-minimap {
    position: absolute;
    right: 18px;
    bottom: 18px;
    z-index: 10;
    width: min(236px, calc(100% - 36px));
    height: 154px;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(9, 14, 22, .94), rgba(5, 9, 15, .96));
    box-shadow: 0 22px 58px rgba(15, 23, 42, .26), inset 0 1px 0 rgba(255, 255, 255, .07);
    backdrop-filter: blur(16px);
    cursor: crosshair;
    user-select: none;
    touch-action: none;
}

.nic-minimap[hidden] {
    display: none;
}

.nic-minimap-stage {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 12px;
    background-color: #101820;
    background-image:
        linear-gradient(rgba(148, 163, 184, .075) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, .075) 1px, transparent 1px);
    background-size: 18px 18px;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .08);
}

.nic-minimap-nodes {
    position: absolute;
    inset: 0;
}

.nic-minimap-node {
    position: absolute;
    border-radius: 3px;
    background: #eab308;
    box-shadow: 0 0 0 1px rgba(234, 179, 8, .18), 0 0 12px rgba(234, 179, 8, .2);
}

.nic-minimap-node.is-selected {
    background: #facc15;
    box-shadow: 0 0 0 1px rgba(248, 250, 252, .86), 0 0 14px rgba(250, 204, 21, .38);
}

.nic-minimap-node.is-pending {
    opacity: .58;
}

.nic-minimap-viewport-box {
    position: absolute;
    border: 2px solid rgba(147, 197, 253, .96);
    border-radius: 6px;
    background: rgba(56, 189, 248, .22);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, .28), 0 0 20px rgba(96, 165, 250, .28);
    pointer-events: none;
}

.nic-minimap.is-dragging .nic-minimap-viewport-box {
    background: rgba(56, 189, 248, .32);
    border-color: #bfdbfe;
}

.nic-world {
    position: absolute;
    left: 0;
    top: 0;
    width: 1px;
    height: 1px;
    transform-origin: 0 0;
    will-change: transform;
}

.nic-node {
    --nic-node-zoom: 1;
    position: absolute;
    left: 0;
    top: 0;
    width: 206px;
    border-radius: calc(18px * var(--nic-node-zoom));
    overflow: visible;
    background: transparent;
    cursor: grab;
    user-select: none;
    transition: none;
    will-change: transform, width;
    contain: layout style;
}

.nic-node-card {
    position: relative;
    z-index: 2;
    border: 1px solid rgba(100, 116, 139, .16);
    border-radius: calc(18px * var(--nic-node-zoom));
    overflow: hidden;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 calc(16px * var(--nic-node-zoom)) calc(38px * var(--nic-node-zoom)) rgba(15, 23, 42, .13);
    transition: border-color .16s ease, box-shadow .16s ease;
}

.nic-node.is-selected .nic-node-card {
    border-color: rgba(15, 23, 42, .34);
    box-shadow: 0 18px 44px rgba(15, 23, 42, .16), 0 0 0 4px rgba(15, 23, 42, .08);
}

.nic-node.is-multi-selected .nic-node-card {
    border-color: rgba(37, 99, 235, .72);
    box-shadow: 0 18px 44px rgba(15, 23, 42, .16), 0 0 0 3px rgba(37, 99, 235, .22);
}

.nic-node.is-pending .nic-node-card {
    animation: nic-node-pending-breathe 1.9s ease-in-out infinite;
}

@keyframes nic-node-pending-breathe {
    0%, 100% {
        border-color: rgba(255, 188, 72, .62);
        box-shadow:
            0 calc(16px * var(--nic-node-zoom)) calc(38px * var(--nic-node-zoom)) rgba(15, 23, 42, .13),
            0 0 0 calc(1px * var(--nic-node-zoom)) rgba(255, 196, 92, .16),
            0 0 calc(18px * var(--nic-node-zoom)) rgba(255, 174, 52, .28);
    }
    50% {
        border-color: rgba(255, 211, 132, 1);
        box-shadow:
            0 calc(20px * var(--nic-node-zoom)) calc(48px * var(--nic-node-zoom)) rgba(15, 23, 42, .18),
            0 0 0 calc(7px * var(--nic-node-zoom)) rgba(255, 190, 72, .28),
            0 0 calc(48px * var(--nic-node-zoom)) rgba(255, 166, 39, .58);
    }
}

@media (prefers-reduced-motion: reduce) {
    .nic-node.is-pending .nic-node-card {
        animation: none;
        border-color: rgba(255, 188, 72, .72);
        box-shadow:
            0 calc(16px * var(--nic-node-zoom)) calc(38px * var(--nic-node-zoom)) rgba(15, 23, 42, .13),
            0 0 0 calc(5px * var(--nic-node-zoom)) rgba(255, 190, 72, .18),
            0 0 calc(30px * var(--nic-node-zoom)) rgba(255, 166, 39, .36);
    }
}

.nic-node.is-dragging {
    cursor: grabbing;
    transition: none;
    z-index: 10;
}

.nic-node-frame {
    position: relative;
    aspect-ratio: 3 / 4;
    background: #e2e8f0;
    overflow: hidden;
}

.nic-node-frame img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.nic-node.is-local-asset .nic-node-card {
    overflow: visible;
}

.nic-node.is-local-asset .nic-node-frame {
    aspect-ratio: var(--nic-local-aspect, 3 / 4);
    border-radius: calc(16px * var(--nic-node-zoom));
    background: #f8fafc;
}

.nic-node.is-local-asset .nic-node-frame img {
    object-fit: contain;
}

.nic-node.is-local-asset .nic-node-toolbar {
    top: calc(-42px * var(--nic-node-zoom));
}

.nic-local-asset-panel .nic-chat-result img {
    object-fit: contain;
    background: #f8fafc;
}

.nic-node-pending {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    align-content: center;
    gap: calc(8px * var(--nic-node-zoom));
    padding: calc(18px * var(--nic-node-zoom));
    background:
        radial-gradient(circle at 50% 38%, rgba(15, 23, 42, .08), transparent 34%),
        linear-gradient(180deg, #f8fafc, #eef2f7);
    color: #0f172a;
    text-align: center;
}

.nic-node-pending .nic-chat-spinner {
    width: calc(26px * var(--nic-node-zoom));
    height: calc(26px * var(--nic-node-zoom));
}

.nic-node-pending strong {
    font-size: calc(13px * var(--nic-node-zoom));
    line-height: 1.2;
    font-weight: 800;
}

.nic-node-pending small {
    color: #64748b;
    font-size: calc(11px * var(--nic-node-zoom));
    line-height: 1.35;
    font-weight: 650;
}

.nic-node-pending.failed {
    background: linear-gradient(180deg, #fff7f7, #f8fafc);
}

.nic-node-stack-layer {
    position: absolute;
    inset: 0;
    z-index: 0;
    border: 1px solid rgba(100, 116, 139, .14);
    border-radius: calc(18px * var(--nic-node-zoom));
    background: rgba(255, 255, 255, .72);
    box-shadow: 0 calc(6px * var(--nic-node-zoom)) calc(14px * var(--nic-node-zoom)) rgba(15, 23, 42, .08);
    pointer-events: none;
    will-change: transform;
}

.nic-node-stack-layer-1 {
    opacity: .62;
    transform: translate(calc(7px * var(--nic-node-zoom)), calc(7px * var(--nic-node-zoom)));
}

.nic-node-stack-layer-2 {
    opacity: .42;
    transform: translate(calc(14px * var(--nic-node-zoom)), calc(14px * var(--nic-node-zoom)));
}

.nic-node-stack-layer-3 {
    opacity: .26;
    transform: translate(calc(21px * var(--nic-node-zoom)), calc(21px * var(--nic-node-zoom)));
}

.nic-node-result-fan {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
}

.nic-node-result-fan-item {
    --nic-fan-x: 0px;
    --nic-fan-y: 0px;
    --nic-fan-r: 0deg;
    --nic-fan-s: 1;
    position: absolute;
    left: 50%;
    top: calc(132px * var(--nic-node-zoom));
    width: calc(132px * var(--nic-node-zoom));
    aspect-ratio: 3 / 4;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: calc(18px * var(--nic-node-zoom));
    overflow: hidden;
    background: #e2e8f0;
    box-shadow: 0 calc(16px * var(--nic-node-zoom)) calc(34px * var(--nic-node-zoom)) rgba(15, 23, 42, .16);
    opacity: 0;
    transform: translate(-50%, -50%) rotate(0deg) scale(.62);
    transform-origin: center;
    transition:
        opacity .24s ease,
        transform .52s cubic-bezier(.16, 1, .3, 1),
        box-shadow .28s ease;
    will-change: opacity, transform;
}

.nic-node-result-fan-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.nic-node-result-fan.count-1 .nic-node-result-fan-item-1 {
    --nic-fan-x: calc(158px * var(--nic-node-zoom));
    --nic-fan-y: calc(-8px * var(--nic-node-zoom));
    --nic-fan-r: 8deg;
}

.nic-node-result-fan.count-2 .nic-node-result-fan-item-1 {
    --nic-fan-x: calc(-156px * var(--nic-node-zoom));
    --nic-fan-y: 0px;
    --nic-fan-r: -9deg;
}

.nic-node-result-fan.count-2 .nic-node-result-fan-item-2 {
    --nic-fan-x: calc(156px * var(--nic-node-zoom));
    --nic-fan-y: 0px;
    --nic-fan-r: 9deg;
}

.nic-node-result-fan.count-3 .nic-node-result-fan-item-1 {
    --nic-fan-x: calc(-132px * var(--nic-node-zoom));
    --nic-fan-y: calc(-122px * var(--nic-node-zoom));
    --nic-fan-r: -10deg;
}

.nic-node-result-fan.count-3 .nic-node-result-fan-item-2 {
    --nic-fan-x: calc(132px * var(--nic-node-zoom));
    --nic-fan-y: calc(-122px * var(--nic-node-zoom));
    --nic-fan-r: 10deg;
}

.nic-node-result-fan.count-3 .nic-node-result-fan-item-3 {
    --nic-fan-x: 0px;
    --nic-fan-y: calc(170px * var(--nic-node-zoom));
    --nic-fan-r: 0deg;
}

.nic-node-result-fan.count-4 .nic-node-result-fan-item-1 {
    --nic-fan-x: 0px;
    --nic-fan-y: calc(-170px * var(--nic-node-zoom));
    --nic-fan-r: -3deg;
}

.nic-node-result-fan.count-4 .nic-node-result-fan-item-2 {
    --nic-fan-x: calc(166px * var(--nic-node-zoom));
    --nic-fan-y: calc(-8px * var(--nic-node-zoom));
    --nic-fan-r: 11deg;
}

.nic-node-result-fan.count-4 .nic-node-result-fan-item-3 {
    --nic-fan-x: 0px;
    --nic-fan-y: calc(174px * var(--nic-node-zoom));
    --nic-fan-r: 3deg;
}

.nic-node-result-fan.count-4 .nic-node-result-fan-item-4 {
    --nic-fan-x: calc(-166px * var(--nic-node-zoom));
    --nic-fan-y: calc(-8px * var(--nic-node-zoom));
    --nic-fan-r: -11deg;
}

.nic-node:hover:not(.is-dragging) {
    z-index: 7;
}

.nic-node:hover:not(.is-dragging) .nic-node-result-fan-item {
    opacity: 1;
    transform: translate(calc(-50% + var(--nic-fan-x)), calc(-50% + var(--nic-fan-y))) rotate(var(--nic-fan-r)) scale(var(--nic-fan-s));
}

@media (hover: none), (pointer: coarse) {
    .nic-node-result-fan {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nic-node-result-fan-item {
        transition: none;
    }
}

.nic-node-session-badge {
    position: absolute;
    top: auto;
    right: calc(9px * var(--nic-node-zoom));
    bottom: calc(9px * var(--nic-node-zoom));
    left: auto;
    z-index: 4;
    min-width: calc(24px * var(--nic-node-zoom));
    height: calc(24px * var(--nic-node-zoom));
    padding: 0 calc(7px * var(--nic-node-zoom));
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .5);
    color: #fff;
    font-size: calc(12px * var(--nic-node-zoom));
    line-height: 1;
    font-weight: 750;
    pointer-events: none;
}

.nic-node-generation-alert {
    position: absolute;
    top: calc(10px * var(--nic-node-zoom));
    right: calc(10px * var(--nic-node-zoom));
    z-index: 5;
    width: calc(28px * var(--nic-node-zoom));
    height: calc(28px * var(--nic-node-zoom));
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .78);
    background: rgba(15, 23, 42, .78);
    color: #fff;
    box-shadow: 0 calc(10px * var(--nic-node-zoom)) calc(24px * var(--nic-node-zoom)) rgba(15, 23, 42, .2);
    backdrop-filter: blur(14px);
    pointer-events: none;
}

.nic-node-generation-alert.done {
    background: rgba(22, 163, 74, .92);
}

.nic-node-generation-alert svg {
    width: calc(17px * var(--nic-node-zoom));
    height: calc(17px * var(--nic-node-zoom));
    display: block;
}

.nic-node-generation-spinner {
    width: calc(15px * var(--nic-node-zoom));
    height: calc(15px * var(--nic-node-zoom));
    border-radius: 999px;
    border: calc(2px * var(--nic-node-zoom)) solid rgba(255, 255, 255, .34);
    border-top-color: #fff;
    animation: nic-spin .8s linear infinite;
}

.nic-node-pixel-badge {
    position: absolute;
    top: calc(-30px * var(--nic-node-zoom));
    right: 0;
    z-index: 6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: calc(22px * var(--nic-node-zoom));
    padding: 0 calc(8px * var(--nic-node-zoom));
    border-radius: calc(6px * var(--nic-node-zoom));
    background: rgba(15, 23, 42, .82);
    color: #fff;
    font-size: calc(11px * var(--nic-node-zoom));
    line-height: 1;
    font-weight: 760;
    letter-spacing: 0;
    pointer-events: none;
    box-shadow: 0 calc(8px * var(--nic-node-zoom)) calc(18px * var(--nic-node-zoom)) rgba(15, 23, 42, .18);
}

.nic-node-toolbar {
    position: absolute;
    left: calc(8px * var(--nic-node-zoom));
    right: calc(8px * var(--nic-node-zoom));
    top: calc(8px * var(--nic-node-zoom));
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: calc(5px * var(--nic-node-zoom));
    padding: calc(5px * var(--nic-node-zoom));
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .18);
    backdrop-filter: blur(16px);
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity .16s ease, transform .16s ease;
}

.nic-node:hover .nic-node-toolbar {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.nic-node-tool {
    width: calc(24px * var(--nic-node-zoom));
    height: calc(24px * var(--nic-node-zoom));
    padding: 0;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #334155;
    cursor: pointer;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}

.nic-node-tool:hover {
    transform: translateY(-1px);
    background: rgba(15, 23, 42, .08);
    color: #0f172a;
}

.nic-node-tool svg {
    width: calc(15px * var(--nic-node-zoom));
    height: calc(15px * var(--nic-node-zoom));
    display: block;
}

@keyframes nic-cost-pop {
    0% {
        transform: translateY(0) scale(1);
    }
    38% {
        transform: translateY(-4px) scale(1.08);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

#infinite-canvas-cost-label {
    display: inline-flex;
    transform-origin: center;
}

#infinite-canvas-cost-label.is-changing {
    animation: nic-cost-pop .28s ease;
}

.nic-node-body {
    padding: calc(10px * var(--nic-node-zoom));
}

.nic-node-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: calc(8px * var(--nic-node-zoom));
    color: #64748b;
    font-size: calc(10px * var(--nic-node-zoom));
    font-weight: 600;
}

.nic-node-prompt {
    margin-top: calc(6px * var(--nic-node-zoom));
    color: #172033;
    font-size: calc(12px * var(--nic-node-zoom));
    line-height: 1.45;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nic-empty {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(360px, calc(100% - 40px));
    padding: 22px;
    border: 1px dashed rgba(100, 116, 139, .24);
    border-radius: 22px;
    background: rgba(255, 255, 255, .78);
    color: #64748b;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.7;
}

.nic-panel {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    background: rgba(255, 255, 255, .9);
}

.nic-panel-head {
    padding: 16px 18px 10px;
    border-bottom: 1px solid rgba(117, 130, 154, .14);
}

.nic-panel-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.nic-panel-copy {
    min-width: 0;
}

.nic-panel-title {
    font-size: 16px;
    line-height: 1.2;
    font-weight: 750;
    color: #0f172a;
}

.nic-panel-sub {
    margin-top: 5px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
    font-weight: 500;
}

.nic-account-actions {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.nic-account-chip {
    height: 34px;
    min-width: 0;
    padding: 0 10px;
    border: 1px solid rgba(100, 116, 139, .14);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: rgba(248, 250, 252, .88);
    color: #334155;
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
    cursor: pointer;
    transition: transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
}

.nic-account-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 23, 42, .2);
    background: #fff;
    color: #0f172a;
}

.nic-account-chip-icon,
.nic-account-avatar {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #eef2f7;
    color: #334155;
}

.nic-account-chip-icon svg {
    width: 13px;
    height: 13px;
    display: block;
}

.nic-account-user-chip {
    height: 38px;
    padding-right: 12px;
}

.nic-account-user-copy {
    min-width: 0;
    display: grid;
    gap: 1px;
    text-align: left;
}

.nic-account-user-copy strong,
.nic-account-user-copy small {
    display: block;
    max-width: 112px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nic-account-user-copy strong {
    color: #0f172a;
    font-size: 12px;
    line-height: 1.1;
    font-weight: 750;
}

.nic-account-user-copy small {
    color: #94a3b8;
    font-size: 10px;
    line-height: 1.1;
    font-weight: 600;
}

.nic-account-avatar {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #f8fafc;
    color: #0f172a;
    box-shadow: inset 0 0 0 1px rgba(100, 116, 139, .14);
    font-size: 12px;
    font-weight: 750;
    line-height: 1;
    text-align: center;
}

.nic-account-avatar.large {
    width: 38px;
    height: 38px;
    font-size: 15px;
}

.nic-account-popover {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    z-index: 20;
    width: min(320px, calc(100vw - 34px));
    padding: 12px;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 18px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 22px 50px rgba(15, 23, 42, .14);
    backdrop-filter: blur(18px);
    color: #0f172a;
    max-height: min(76vh, 720px);
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(15, 23, 42, .22) transparent;
}

.nic-account-popover.wallet {
    width: min(460px, calc(100vw - 34px));
}

.nic-account-popover.account {
    width: min(360px, calc(100vw - 34px));
}

.nic-account-popover::-webkit-scrollbar {
    width: 8px;
}

.nic-account-popover::-webkit-scrollbar-track {
    background: transparent;
}

.nic-account-popover::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(15, 23, 42, .18);
    background-clip: padding-box;
}

.nic-account-popover-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.nic-account-popover-head strong {
    display: block;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 750;
}

.nic-account-popover-head small {
    display: block;
    margin-bottom: 3px;
    color: #94a3b8;
    font-size: 10px;
    line-height: 1.1;
    font-weight: 750;
    text-transform: uppercase;
}

.nic-account-popover-head span {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.35;
    font-weight: 500;
}

.nic-account-popover-close {
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid rgba(15, 23, 42, .1);
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #fff;
    color: #64748b;
    font: inherit;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
}

.nic-account-popover-total {
    margin-top: 12px;
    padding: 16px 14px;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 16px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 28px;
    line-height: 1;
    font-weight: 780;
}

.nic-account-popover-note {
    margin: 12px 0 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.65;
    font-weight: 500;
}

.nic-account-popover-button {
    width: 100%;
    height: 38px;
    margin-top: 12px;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.nic-account-popover-button:hover {
    background: #111827;
}

.nic-account-popover-grid,
.nic-account-popover-list {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}

.nic-account-popover-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.nic-account-popover-grid div,
.nic-account-popover-list div {
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 14px;
    background: #fff;
}

.nic-account-popover-grid span,
.nic-account-popover-list span {
    display: block;
    color: #64748b;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 600;
}

.nic-account-popover-grid strong,
.nic-account-popover-list strong {
    display: block;
    margin-top: 5px;
    color: #0f172a;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 750;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nic-account-profile {
    margin-top: 12px;
    padding: 10px;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
}

.nic-account-profile div {
    min-width: 0;
}

.nic-account-profile strong,
.nic-account-profile span {
    display: block;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nic-account-profile strong {
    color: #0f172a;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 750;
}

.nic-account-profile span {
    margin-top: 3px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 600;
}

.nic-wallet-stat-grid,
.nic-account-stats {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.nic-wallet-stat-grid div,
.nic-account-stats div {
    min-width: 0;
    padding: 11px;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 15px;
    background: #f8fafc;
}

.nic-wallet-stat-grid span,
.nic-account-stats span {
    display: block;
    color: #64748b;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 600;
}

.nic-wallet-stat-grid strong,
.nic-account-stats strong {
    display: block;
    margin-top: 6px;
    color: #0f172a;
    font-size: 18px;
    line-height: 1;
    font-weight: 780;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nic-wallet-block {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 16px;
    background: #fff;
}

.nic-wallet-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #0f172a;
}

.nic-wallet-block-head strong {
    font-size: 12px;
    line-height: 1.2;
    font-weight: 750;
}

.nic-wallet-block-head span {
    color: #64748b;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 600;
    white-space: nowrap;
}

.nic-wallet-cdk-row {
    margin-top: 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.nic-wallet-cdk-input {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 1px solid rgba(15, 23, 42, .1);
    border-radius: 999px;
    background: #f8fafc;
    color: #0f172a;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    outline: none;
}

.nic-wallet-cdk-input:focus {
    border-color: rgba(15, 23, 42, .24);
    background: #fff;
}

.nic-wallet-cdk-row button,
.nic-wallet-pagination button,
.nic-account-menu-list button,
.nic-account-logout {
    border: 1px solid rgba(15, 23, 42, .1);
    background: #fff;
    color: #0f172a;
    font: inherit;
    cursor: pointer;
}

.nic-wallet-cdk-row button {
    height: 38px;
    padding: 0 14px;
    border-color: #111827;
    border-radius: 999px;
    background: #111827;
    color: #fff;
    font-size: 12px;
    font-weight: 750;
}

.nic-wallet-cdk-row button:hover:not(:disabled) {
    background: #1f2937;
    color: #fff;
}

.nic-wallet-cdk-row button:disabled,
.nic-wallet-pagination button:disabled,
.nic-account-menu-list button.disabled {
    cursor: not-allowed;
    opacity: .46;
}

.nic-wallet-status {
    margin-top: 8px;
    padding: 8px 10px;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 12px;
    background: #f8fafc;
    color: #334155;
    font-size: 11px;
    line-height: 1.45;
    font-weight: 600;
}

.nic-wallet-usage {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}

.nic-wallet-usage-row {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.nic-wallet-usage-date,
.nic-wallet-usage-meta {
    color: #64748b;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 650;
    white-space: nowrap;
}

.nic-wallet-usage-track {
    height: 6px;
    border-radius: 999px;
    overflow: hidden;
    background: #e5e7eb;
}

.nic-wallet-usage-track div {
    height: 100%;
    border-radius: inherit;
    background: #64748b;
}

.nic-wallet-empty {
    padding: 12px;
    border: 1px dashed rgba(15, 23, 42, .12);
    border-radius: 14px;
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 600;
    text-align: center;
}

.nic-wallet-log-list {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}

.nic-wallet-log-item {
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #f8fafc;
}

.nic-wallet-log-item div {
    min-width: 0;
}

.nic-wallet-log-item strong,
.nic-wallet-log-item span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nic-wallet-log-item strong {
    color: #0f172a;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 700;
}

.nic-wallet-log-item span {
    margin-top: 4px;
    color: #64748b;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 600;
}

.nic-wallet-log-item b {
    flex: 0 0 auto;
    color: #0f172a;
    font-size: 13px;
    line-height: 1;
    font-weight: 780;
}

.nic-wallet-pagination {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.nic-wallet-pagination button {
    height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.nic-wallet-pagination span {
    min-width: 54px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 700;
    text-align: center;
}

.nic-account-head {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 17px;
    background: #f8fafc;
}

.nic-account-head-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nic-account-head-top div {
    min-width: 0;
}

.nic-account-head-top strong,
.nic-account-head-top span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nic-account-head-top strong {
    color: #0f172a;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 780;
}

.nic-account-head-top span {
    margin-top: 4px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 600;
}

.nic-account-head-top .nic-account-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    margin-top: 0;
    color: #0f172a;
    font-size: 15px;
    line-height: 1;
    text-overflow: clip;
    white-space: normal;
}

.nic-account-menu-list {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}

.nic-account-menu-list button {
    width: 100%;
    min-height: 54px;
    padding: 10px 12px;
    border-radius: 15px;
    text-align: left;
}

.nic-account-menu-list button:hover,
.nic-wallet-cdk-row button:hover,
.nic-wallet-pagination button:not(:disabled):hover,
.nic-account-logout:hover {
    border-color: rgba(15, 23, 42, .22);
    background: #f8fafc;
}

.nic-wallet-cdk-row button:hover:not(:disabled) {
    border-color: #111827;
    background: #1f2937;
    color: #fff;
}

.nic-account-menu-list strong,
.nic-account-menu-list span {
    display: block;
}

.nic-account-menu-list strong {
    color: #0f172a;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 760;
}

.nic-account-menu-list span {
    margin-top: 5px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.35;
    font-weight: 600;
}

.nic-account-logout {
    width: 100%;
    height: 40px;
    margin-top: 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 750;
}

.nic-panel-body {
    min-height: 0;
    overflow: auto;
    padding: 12px 18px 18px;
    scrollbar-width: thin;
    scrollbar-color: rgba(15, 23, 42, .2) transparent;
}

.nic-panel-body::-webkit-scrollbar {
    width: 8px;
}

.nic-panel-body::-webkit-scrollbar-track {
    background: transparent;
}

.nic-panel-body::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(15, 23, 42, .18);
    background-clip: padding-box;
}

.nic-panel-body::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 23, 42, .28);
    background-clip: padding-box;
}

.nic-composer {
    position: relative;
    margin: 0 12px 12px;
    padding: 12px;
    border-top: 1px solid rgba(117, 130, 154, .14);
    border: 1px solid rgba(100, 116, 139, .12);
    border-radius: 22px;
    background: rgba(255, 255, 255, .9);
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, .05),
        0 0 30px rgba(15, 23, 42, .12),
        0 18px 38px rgba(15, 23, 42, .1);
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
    backdrop-filter: blur(18px);
    overflow: visible;
}

.nic-composer.is-dragover {
    border-color: rgba(15, 23, 42, .24);
    background: #fff;
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, .08),
        0 0 34px rgba(15, 23, 42, .16),
        0 20px 46px rgba(15, 23, 42, .13);
}

.nic-composer-file {
    display: none;
}

.nic-composer-preview-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 0;
    overflow: visible;
}

.nic-composer-preview-row:not(:empty) {
    margin-bottom: 10px;
}

.nic-composer-preview {
    position: relative;
    width: 48px;
    height: 48px;
    overflow: visible;
    cursor: grab;
}

.nic-composer-preview:active {
    cursor: grabbing;
}

.nic-composer-preview-thumb {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(100, 116, 139, .16);
    background: #e2e8f0;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.nic-composer-preview-thumb img,
.nic-composer-preview-zoom img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.nic-composer-preview:hover,
.nic-composer-preview:focus-within {
    z-index: 14;
}

.nic-composer-preview:hover .nic-composer-preview-thumb,
.nic-composer-preview:focus-within .nic-composer-preview-thumb {
    transform: translateY(-1px);
    border-color: rgba(15, 23, 42, .24);
    box-shadow: 0 12px 24px rgba(15, 23, 42, .16);
}

.nic-composer-preview.is-dragging .nic-composer-preview-thumb {
    opacity: .45;
    transform: scale(.96);
}

.nic-composer-preview.is-drag-over .nic-composer-preview-thumb {
    border-color: rgba(15, 23, 42, .42);
    box-shadow: 0 0 0 3px rgba(15, 23, 42, .08);
}

.nic-composer-preview-order {
    position: absolute;
    left: 4px;
    bottom: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, .78);
    border: 1px solid rgba(255, 255, 255, .18);
    color: #fff;
    font-size: 10px;
    font-weight: 850;
    line-height: 1;
    backdrop-filter: blur(6px);
}

.nic-composer-preview-remove {
    position: absolute;
    right: 3px;
    top: 3px;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(15, 23, 42, .74);
    color: #fff;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: scale(.9);
    transition: opacity .14s ease, transform .14s ease, background .14s ease;
}

.nic-composer-preview:hover .nic-composer-preview-remove,
.nic-composer-preview:focus-within .nic-composer-preview-remove {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.nic-composer-preview-remove:hover {
    background: rgba(15, 23, 42, .92);
}

.nic-composer-preview-zoom {
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    width: 156px;
    height: 156px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, .12);
    background: #fff;
    box-shadow: 0 24px 54px rgba(15, 23, 42, .18);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) scale(.96);
    transform-origin: left center;
    transition: opacity .16s ease, transform .16s ease;
}

.nic-composer-preview-zoom::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5);
}

.nic-composer-preview:hover .nic-composer-preview-zoom,
.nic-composer-preview:focus-within .nic-composer-preview-zoom {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.nic-composer-input {
    width: 100%;
    min-height: 82px;
    max-height: 150px;
    padding: 4px 0 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #172033;
    font: inherit;
    font-size: 13px;
    line-height: 1.55;
    font-weight: 500;
    resize: none;
    outline: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(15, 23, 42, .2) transparent;
}

.nic-composer-input::-webkit-scrollbar {
    width: 8px;
}

.nic-composer-input::-webkit-scrollbar-track {
    background: transparent;
}

.nic-composer-input::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(15, 23, 42, .18);
    background-clip: padding-box;
}

.nic-composer-input::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 23, 42, .28);
    background-clip: padding-box;
}

.nic-composer-input:focus {
    background: transparent;
    box-shadow: none;
}

.nic-composer-input::placeholder {
    color: rgba(100, 116, 139, .52);
}

.nic-composer-input:focus::placeholder {
    color: transparent;
}

.nic-composer-footer {
    margin-top: 6px;
    padding-top: 2px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-width: 0;
    overflow: visible;
}

.nic-composer-toolrow,
.nic-composer-options {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: visible;
}

.nic-composer-options {
    flex: 1 1 auto;
    justify-content: flex-end;
}

.nic-composer-round,
.nic-composer-pill {
    height: 34px;
    border: 1px solid rgba(100, 116, 139, .13);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(248, 250, 252, .88);
    color: #334155;
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
    transition: transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
}

.nic-composer-round {
    width: 34px;
    padding: 0;
    border-radius: 999px;
    border-color: rgba(15, 23, 42, .92);
    background: #0f172a;
    color: #fff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .14);
}

.nic-composer-pill {
    max-width: 122px;
    padding: 0 10px;
    border-radius: 999px;
    gap: 6px;
    white-space: nowrap;
}

.nic-composer-pill span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nic-composer-visual-pill {
    min-width: 96px;
}

.nic-composer-pill .nic-composer-chevron {
    width: 13px;
    height: 13px;
    opacity: .72;
    transition: transform .14s ease;
}

.nic-composer-visual-pill.is-open .nic-composer-chevron {
    transform: rotate(180deg);
}

.nic-composer-round:hover,
.nic-composer-pill:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 23, 42, .2);
    background: #fff;
    color: #0f172a;
}

.nic-composer-round:hover {
    border-color: #111827;
    background: #111827;
    color: #fff;
    box-shadow: 0 12px 24px rgba(15, 23, 42, .18);
}

.nic-composer-round:disabled,
.nic-composer-pill:disabled {
    cursor: not-allowed;
    opacity: .48;
    transform: none;
}

.nic-composer-round.is-open,
.nic-composer-pill.is-open {
    border-color: rgba(15, 23, 42, .28);
    background: #fff;
    color: #0f172a;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
}

.nic-composer-round.is-loading svg {
    animation: nic-composer-spin 1s linear infinite;
}

.nic-composer-round svg,
.nic-composer-pill svg {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    display: block;
}

.nic-composer-menu {
    position: absolute;
    left: 12px;
    bottom: 64px;
    z-index: 12;
    width: min(288px, calc(100% - 24px));
    max-height: 310px;
    padding: 8px;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 18px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 22px 46px rgba(15, 23, 42, .16);
    opacity: 0;
    pointer-events: none;
    transform-origin: bottom center;
    transform: translateY(6px) scale(.98);
    transition: opacity .14s ease, transform .14s ease;
    backdrop-filter: blur(18px);
}

.nic-composer-menu.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.nic-composer-menu[data-type="visual"] {
    width: min(320px, calc(100% - 24px));
    max-height: min(520px, calc(100vh - 180px));
    padding: 14px;
}

.nic-composer-visual-section + .nic-composer-visual-section {
    margin-top: 14px;
}

.nic-composer-visual-title {
    margin-bottom: 8px;
    color: #6b7280;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.nic-composer-size-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.nic-composer-size-tab {
    height: 38px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 750;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
}

.nic-composer-size-tab:hover:not(:disabled) {
    background: #f8fafc;
    color: #111827;
}

.nic-composer-size-tab.is-active {
    border-color: rgba(15, 23, 42, .06);
    background: #f3f4f6;
    color: #111827;
}

.nic-composer-aspect-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 12px;
}

.nic-composer-aspect-tile {
    min-height: 62px;
    padding: 8px 4px;
    border: 1px solid transparent;
    border-radius: 8px;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 7px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    font: inherit;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
}

.nic-composer-aspect-tile:hover:not(:disabled) {
    background: #f8fafc;
    color: #111827;
}

.nic-composer-aspect-tile.is-active {
    border-color: rgba(15, 23, 42, .06);
    background: #f3f4f6;
    color: #111827;
}

.nic-composer-aspect-mark {
    width: 30px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nic-composer-aspect-mark .zt-ratio-frame {
    border-color: rgba(75, 85, 99, .72);
    background: rgba(255, 255, 255, .94);
}

.nic-composer-aspect-tile.is-active .zt-ratio-frame {
    border-color: rgba(17, 24, 39, .86);
    background: #fff;
    transform: scale(1.03);
}

.nic-composer-aspect-fallback {
    width: 18px;
    height: 18px;
    border: 1.5px solid rgba(75, 85, 99, .72);
    border-radius: 4px;
    display: block;
    background: #fff;
}

.nic-composer-aspect-label {
    color: inherit;
    font-size: 11px;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
}

.nic-composer-size-tab:disabled,
.nic-composer-aspect-tile:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.nic-composer-menu-head {
    padding: 6px 8px 8px;
    color: #64748b;
    font-size: 12px;
    font-weight: 750;
}

.nic-composer-menu-list {
    display: grid;
    gap: 4px;
    max-height: 248px;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(15, 23, 42, .18) transparent;
}

.nic-composer-menu-list::-webkit-scrollbar {
    width: 8px;
}

.nic-composer-menu-list::-webkit-scrollbar-track {
    background: transparent;
}

.nic-composer-menu-list::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(15, 23, 42, .16);
    background-clip: padding-box;
}

.nic-composer-menu-option {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 12px;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    background: transparent;
    color: #0f172a;
    text-align: left;
    cursor: pointer;
    font: inherit;
    transition: background .14s ease, border-color .14s ease, color .14s ease;
}

.nic-composer-menu-option:hover:not(:disabled) {
    background: rgba(15, 23, 42, .04);
}

.nic-composer-menu-option.is-active {
    border-color: rgba(15, 23, 42, .1);
    background: rgba(15, 23, 42, .06);
}

.nic-composer-menu-option:disabled {
    cursor: not-allowed;
    color: #94a3b8;
    opacity: .7;
}

.nic-composer-menu[data-type="aspect"] .nic-composer-menu-option {
    grid-template-columns: 18px 32px minmax(0, 1fr);
}

.nic-composer-menu-check {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: #0f172a;
    font-size: 12px;
    font-weight: 900;
}

.nic-composer-menu-mark {
    width: 32px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nic-composer-menu-mark .zt-ratio-frame {
    border-color: rgba(15, 23, 42, .62);
    background: rgba(248, 250, 252, .94);
}

.nic-composer-menu-option.is-active .nic-composer-menu-mark .zt-ratio-frame {
    border-color: rgba(15, 23, 42, .86);
    background: #fff;
    transform: scale(1.03);
}

.nic-composer-menu-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.nic-composer-menu-label {
    overflow: hidden;
    color: inherit;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nic-composer-menu-note {
    overflow: hidden;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nic-composer-menu-empty {
    padding: 14px 10px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
}

@keyframes nic-composer-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.nic-composer-send {
    flex: 0 0 auto;
    min-width: 112px;
    height: 42px;
    padding: 0 14px;
    border: 1px solid #0f172a;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #0f172a;
    color: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .08);
    transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease, border-color .16s ease, background .16s ease;
}

.nic-composer-send:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: #111827;
    background: #111827;
    color: #fff;
    box-shadow: 0 14px 28px rgba(15, 23, 42, .2);
}

.nic-composer-send:disabled {
    cursor: not-allowed;
    opacity: .62;
    transform: none;
}

.nic-composer-send svg {
    width: 19px;
    height: 19px;
    display: block;
}

.nic-composer-send span {
    white-space: nowrap;
}

.nic-composer-cost-bolt {
    color: #fff;
    font-size: 12px;
    line-height: 1;
}

.nic-list-card {
    border: 1px solid rgba(100, 116, 139, .16);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 14px 32px rgba(15, 23, 42, .08);
}

.nic-chat {
    display: grid;
    gap: 16px;
}

.nic-chat-row {
    display: flex;
    gap: 10px;
    align-items: start;
}

.nic-chat-row.user {
    justify-content: flex-end;
}

.nic-chat-row.ai {
    justify-content: flex-start;
}

.nic-chat-row.user .nic-chat-avatar {
    order: 2;
}

.nic-chat-row.user .nic-chat-bubble {
    order: 1;
}

.nic-chat-avatar {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #e2e8f0;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(100, 116, 139, .14);
}

.nic-chat-row.ai .nic-chat-avatar {
    background: #fff;
    color: #0f172a;
}

.nic-chat-avatar-logo {
    border-radius: 999px;
    background: #fff !important;
    overflow: hidden;
    padding: 0;
    box-shadow: inset 0 0 0 1px rgba(100, 116, 139, .16), 0 6px 16px rgba(15, 23, 42, .08);
    clip-path: circle(50% at 50% 50%);
}

.nic-chat-avatar-logo img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 999px;
    object-fit: cover;
    clip-path: circle(49% at 50% 50%);
    transform: scale(1.12);
}

.nic-chat-bubble {
    flex: 0 1 calc(100% - 44px);
    min-width: 0;
    padding: 13px;
    border: 1px solid rgba(100, 116, 139, .12);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
}

.nic-chat-row.ai .nic-chat-bubble {
    background: rgba(255, 255, 255, .92);
    border-color: rgba(100, 116, 139, .12);
}

.nic-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.3;
    font-weight: 700;
}

.nic-chat-prompt {
    margin: 9px 0 0;
    color: #172033;
    font-size: 13px;
    line-height: 1.62;
    font-weight: 500;
    word-break: break-word;
}

.nic-chat-cost {
    margin-top: 8px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 600;
}

.nic-chat-section-label {
    margin-top: 12px;
    color: #475569;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 700;
}

.nic-chat-ref-grid {
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}

.nic-chat-ref,
.nic-chat-result {
    position: relative;
    display: block;
    overflow: hidden;
    background: #e2e8f0;
    text-decoration: none;
}

.nic-chat-ref {
    aspect-ratio: 1 / 1;
    border-radius: 12px;
}

.nic-chat-ref-link {
    display: block;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.nic-chat-ref img,
.nic-chat-result img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.nic-chat-ref.is-mask {
    background: #fff;
}

.nic-chat-ref.is-mask img {
    object-fit: contain;
    background: #fff;
}

.nic-chat-ref span {
    position: absolute;
    left: 6px;
    top: 6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, .74);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
}

.nic-chat-ref-empty {
    margin-top: 8px;
    padding: 11px 12px;
    border: 1px dashed rgba(100, 116, 139, .22);
    border-radius: 14px;
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
    font-weight: 500;
}

.nic-chat-chips {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.nic-chat-chip {
    max-width: 100%;
    min-height: 22px;
    padding: 4px 7px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 10px;
    line-height: 1.3;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.nic-chat-meta-bottom {
    margin-top: 9px;
    color: #94a3b8;
    font-size: 10px;
    line-height: 1.3;
    font-weight: 500;
    text-align: right;
}

.nic-chat-row.ai .nic-chat-meta-bottom {
    text-align: left;
}

.nic-chat-meta-bottom span,
.nic-chat-meta-bottom em {
    display: inline-block;
    margin-right: 6px;
    font-style: normal;
    color: #64748b;
}

.nic-chat-meta-bottom em {
    margin-left: 6px;
    margin-right: 0;
    color: #94a3b8;
}

.nic-chat-meta-bottom time {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: top;
}

.nic-chat-result-wrap {
    position: relative;
    margin-top: 10px;
    border-radius: 18px;
}

.nic-chat-result {
    min-height: 280px;
    max-height: min(58vh, 620px);
    border-radius: 18px;
    border: 1px solid rgba(100, 116, 139, .14);
}

.nic-chat-result img {
    object-fit: contain;
    background: #eef3f8;
}

.nic-image-action-bar {
    position: absolute;
    left: 50%;
    bottom: 8px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 6px);
    transition: opacity .16s ease, transform .16s ease;
}

.nic-chat-ref:hover .nic-image-action-bar,
.nic-chat-ref:focus-within .nic-image-action-bar,
.nic-chat-result-wrap:hover .nic-image-action-bar,
.nic-chat-result-wrap:focus-within .nic-image-action-bar {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.nic-chat-result-wrap .nic-image-action-bar {
    gap: 10px;
}

.nic-image-action-btn {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .94);
    color: #0f172a;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .06);
    transition: transform .16s ease, background .16s ease, color .16s ease;
}

.nic-image-action-btn:hover {
    transform: translateY(-1px);
    background: #fff7ed;
    color: #9a3412;
}

.nic-image-action-btn svg {
    width: 15px;
    height: 15px;
    display: block;
}

@media (hover: none) {
    .nic-image-action-bar {
        opacity: 1;
        pointer-events: auto;
        transform: translate(-50%, 0);
    }
}

.nic-chat-result-state {
    min-height: 220px;
    padding: 22px;
    border: 1px solid rgba(100, 116, 139, .14);
    border-radius: 18px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 9px;
    background: #f8fafc;
    color: #334155;
    text-align: center;
}

.nic-chat-result-state strong {
    color: #0f172a;
    font-size: 13px;
    line-height: 1.25;
    font-weight: 750;
}

.nic-chat-result-state small {
    max-width: 260px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
    font-weight: 500;
}

.nic-chat-result-state.failed {
    background: #fff;
}

.nic-reverse-result {
    margin-top: 10px;
    padding: 14px;
    border: 1px solid rgba(100, 116, 139, .14);
    border-radius: 16px;
    background: #f8fafc;
}

.nic-reverse-label {
    color: #64748b;
    font-size: 11px;
    line-height: 1.25;
    font-weight: 750;
}

.nic-reverse-summary {
    margin-top: 6px;
    color: #475569;
    font-size: 12px;
    line-height: 1.45;
    font-weight: 650;
}

.nic-reverse-result p {
    margin: 8px 0 0;
    color: #0f172a;
    font-size: 13px;
    line-height: 1.72;
    font-weight: 550;
    white-space: pre-wrap;
    word-break: break-word;
}

.nic-reverse-actions {
    margin-top: 12px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.nic-reverse-btn {
    min-height: 34px;
    padding: 0 13px;
    border: 1px solid rgba(100, 116, 139, .16);
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font: inherit;
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
    transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}

.nic-reverse-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 23, 42, .18);
    background: #f8fafc;
    color: #0f172a;
}

.nic-reverse-btn.primary {
    border-color: #111827;
    background: #111827;
    color: #fff;
}

.nic-chat-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(15, 23, 42, .12);
    border-top-color: #111827;
    border-radius: 999px;
    animation: nic-spin .8s linear infinite;
}

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

.nic-panel-actions {
    margin-top: 13px;
}

.nic-chat-session-tools {
    display: flex;
    justify-content: flex-start;
    padding-left: 44px;
    margin-top: -8px;
}

.nic-result-toolbar {
    position: absolute;
    left: 50%;
    top: 10px;
    z-index: 3;
    width: max-content;
    max-width: calc(100% - 20px);
    margin-top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 4px;
    padding: 5px 8px;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 999px;
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 14px 32px rgba(15, 23, 42, .16);
    backdrop-filter: blur(18px);
    overflow: visible;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -6px);
    transition: opacity .16s ease, transform .16s ease;
}

.nic-chat-result-wrap:hover .nic-result-toolbar,
.nic-chat-result-wrap:focus-within .nic-result-toolbar {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.nic-tool-btn {
    flex: 0 1 auto;
    min-width: 0;
    height: 32px;
    padding: 0 9px;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: transparent;
    color: #334155;
    font: inherit;
    font-size: 12px;
    line-height: 1;
    font-weight: 650;
    cursor: pointer;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}

.nic-tool-btn:hover {
    transform: translateY(-1px);
    background: rgba(241, 245, 249, .94);
    color: #0f172a;
}

.nic-tool-btn.primary {
    background: #fff3e6;
    color: #9a3412;
}

.nic-tool-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nic-tool-icon,
.nic-tool-icon svg {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    display: block;
}

.nic-chat-row-local .nic-chat-bubble {
    border-color: rgba(15, 23, 42, .1);
    background: #fff;
}

.nic-chat-avatar-local {
    background: #111827 !important;
    color: #fff !important;
    box-shadow: none;
}

.nic-local-result {
    margin-top: 10px;
    overflow: hidden;
    border: 1px solid rgba(100, 116, 139, .14);
    border-radius: 16px;
    background: #f8fafc;
}

.nic-local-result img {
    width: 100%;
    max-height: min(48vh, 520px);
    display: block;
    object-fit: contain;
    background: #f8fafc;
}

.nic-crop-modal {
    position: fixed;
    inset: 0;
    z-index: 180;
    padding: 18px;
    display: grid;
    place-items: center;
    background: rgba(15, 23, 42, .48);
    backdrop-filter: blur(18px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .16s ease, visibility .16s ease;
}

.nic-crop-modal.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.nic-crop-dialog {
    width: min(1180px, calc(100vw - 36px));
    height: min(760px, calc(100vh - 36px));
    min-height: 520px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 34px 90px rgba(15, 23, 42, .24);
}

.nic-crop-head,
.nic-crop-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, .94);
}

.nic-crop-head {
    border-bottom: 1px solid rgba(100, 116, 139, .12);
}

.nic-crop-foot {
    border-top: 1px solid rgba(100, 116, 139, .12);
}

.nic-crop-kicker {
    color: #94a3b8;
    font-size: 10px;
    line-height: 1;
    font-weight: 800;
    text-transform: uppercase;
}

.nic-crop-title {
    margin: 4px 0 0;
    color: #0f172a;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 760;
}

.nic-crop-close,
.nic-crop-secondary,
.nic-crop-primary,
.nic-crop-ratio {
    height: 36px;
    border: 1px solid rgba(100, 116, 139, .16);
    border-radius: 999px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    font-size: 12px;
    line-height: 1;
    font-weight: 720;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.nic-crop-close {
    width: 36px;
    padding: 0;
    display: grid;
    place-items: center;
    font-size: 18px;
}

.nic-crop-secondary,
.nic-crop-primary {
    min-width: 96px;
    padding: 0 16px;
}

.nic-crop-primary {
    border-color: #111827;
    background: #111827;
    color: #fff;
}

.nic-crop-primary:disabled {
    border-color: rgba(100, 116, 139, .16);
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

.nic-crop-close:hover,
.nic-crop-secondary:hover,
.nic-crop-ratio:hover {
    border-color: rgba(15, 23, 42, .24);
    background: #f8fafc;
    transform: translateY(-1px);
}

.nic-crop-primary:hover {
    background: #1f2937;
    transform: translateY(-1px);
}

.nic-crop-body {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 16px;
    padding: 16px;
    background: #f8fafc;
}

.nic-crop-stage-shell {
    min-width: 0;
    min-height: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(100, 116, 139, .12);
    border-radius: 20px;
    background: #e5e7eb;
}

.nic-crop-stage {
    position: relative;
    width: 0;
    height: 0;
    max-width: 100%;
    max-height: 100%;
}

.nic-crop-loading {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 4;
    transform: translate(-50%, -50%);
    min-width: 220px;
    padding: 18px;
    border-radius: 18px;
    background: #fff;
    color: #475569;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 650;
    text-align: center;
    box-shadow: 0 18px 44px rgba(15, 23, 42, .12);
}

.nic-crop-error {
    width: min(360px, calc(100vw - 64px));
    padding: 18px;
    border: 1px solid rgba(100, 116, 139, .16);
    border-radius: 18px;
    background: #fff;
    color: #475569;
    box-shadow: 0 18px 44px rgba(15, 23, 42, .12);
    text-align: center;
}

.nic-crop-error strong,
.nic-crop-error span {
    display: block;
}

.nic-crop-error strong {
    color: #0f172a;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 760;
}

.nic-crop-error span {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.5;
    font-weight: 560;
}

.nic-crop-error button {
    height: 34px;
    margin-top: 14px;
    padding: 0 14px;
    border: 1px solid #111827;
    border-radius: 999px;
    background: #111827;
    color: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 720;
    cursor: pointer;
}

.nic-crop-image {
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    display: block;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.nic-crop-image[hidden] {
    display: none !important;
}

.nic-crop-box {
    position: absolute;
    touch-action: none;
    cursor: move;
    border: 2px solid #fff;
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, .52), 0 14px 34px rgba(15, 23, 42, .22);
}

.nic-crop-grid {
    position: absolute;
    pointer-events: none;
    background: rgba(255, 255, 255, .54);
}

.nic-crop-grid.is-v1,
.nic-crop-grid.is-v2 {
    top: 0;
    bottom: 0;
    width: 1px;
}

.nic-crop-grid.is-v1 {
    left: 33.333%;
}

.nic-crop-grid.is-v2 {
    left: 66.666%;
}

.nic-crop-grid.is-h1,
.nic-crop-grid.is-h2 {
    left: 0;
    right: 0;
    height: 1px;
}

.nic-crop-grid.is-h1 {
    top: 33.333%;
}

.nic-crop-grid.is-h2 {
    top: 66.666%;
}

.nic-crop-size-badge {
    position: absolute;
    left: 50%;
    top: -38px;
    transform: translateX(-50%);
    min-width: 108px;
    height: 30px;
    padding: 0 10px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, .94);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    font-weight: 780;
    white-space: nowrap;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .22);
}

.nic-crop-handle {
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #111827;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .26);
}

.nic-crop-handle.is-nw,
.nic-crop-handle.is-w,
.nic-crop-handle.is-sw {
    left: -9px;
}

.nic-crop-handle.is-ne,
.nic-crop-handle.is-e,
.nic-crop-handle.is-se {
    right: -9px;
}

.nic-crop-handle.is-nw,
.nic-crop-handle.is-n,
.nic-crop-handle.is-ne {
    top: -9px;
}

.nic-crop-handle.is-sw,
.nic-crop-handle.is-s,
.nic-crop-handle.is-se {
    bottom: -9px;
}

.nic-crop-handle.is-n,
.nic-crop-handle.is-s {
    left: 50%;
    transform: translateX(-50%);
}

.nic-crop-handle.is-w,
.nic-crop-handle.is-e {
    top: 50%;
    transform: translateY(-50%);
}

.nic-crop-handle.is-nw,
.nic-crop-handle.is-se {
    cursor: nwse-resize;
}

.nic-crop-handle.is-ne,
.nic-crop-handle.is-sw {
    cursor: nesw-resize;
}

.nic-crop-handle.is-n,
.nic-crop-handle.is-s {
    cursor: ns-resize;
}

.nic-crop-handle.is-w,
.nic-crop-handle.is-e {
    cursor: ew-resize;
}

.nic-crop-preview-panel {
    min-width: 0;
    display: grid;
    grid-template-rows: auto minmax(0, auto) auto 1fr;
    align-content: start;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(100, 116, 139, .12);
    border-radius: 20px;
    background: #fff;
}

.nic-crop-preview-title {
    color: #0f172a;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 760;
}

.nic-crop-preview {
    width: 100%;
    max-height: 280px;
    border: 1px solid rgba(100, 116, 139, .12);
    border-radius: 16px;
    background: #f8fafc;
    object-fit: contain;
}

.nic-crop-preview-meta {
    color: #64748b;
    font-size: 11px;
    line-height: 1.35;
    font-weight: 650;
}

.nic-crop-ratios,
.nic-crop-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nic-crop-ratios {
    min-width: 0;
    flex-wrap: wrap;
}

.nic-crop-ratio {
    min-width: 54px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.nic-crop-ratio.is-active {
    border-color: #111827;
    background: #111827;
    color: #fff;
}

.nic-crop-ratio-mark {
    width: 14px;
    height: 14px;
    border: 1.6px solid currentColor;
    border-radius: 4px;
    display: inline-block;
    opacity: .76;
}

.nic-crop-ratio[data-nic-crop-ratio="free"] .nic-crop-ratio-mark {
    border-radius: 999px;
}

.nic-crop-ratio[data-nic-crop-ratio="1:2"] .nic-crop-ratio-mark {
    width: 9px;
    height: 16px;
}

.nic-crop-ratio[data-nic-crop-ratio="3:2"] .nic-crop-ratio-mark,
.nic-crop-ratio[data-nic-crop-ratio="16:9"] .nic-crop-ratio-mark {
    width: 18px;
    height: 11px;
}

.nic-crop-ratio[data-nic-crop-ratio="3:4"] .nic-crop-ratio-mark,
.nic-crop-ratio[data-nic-crop-ratio="9:16"] .nic-crop-ratio-mark {
    width: 10px;
    height: 16px;
}

.nic-repaint-modal {
    position: fixed;
    inset: 0;
    z-index: 182;
    padding: 18px;
    display: grid;
    place-items: center;
    background: rgba(15, 23, 42, .48);
    backdrop-filter: blur(18px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .16s ease, visibility .16s ease;
}

.nic-repaint-modal.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.nic-repaint-dialog {
    width: min(1180px, calc(100vw - 36px));
    height: min(760px, calc(100vh - 36px));
    min-height: 520px;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 34px 90px rgba(15, 23, 42, .24);
}

.nic-repaint-head,
.nic-repaint-foot,
.nic-repaint-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, .95);
}

.nic-repaint-head,
.nic-repaint-toolbar {
    border-bottom: 1px solid rgba(100, 116, 139, .12);
}

.nic-repaint-foot {
    border-top: 1px solid rgba(100, 116, 139, .12);
}

.nic-repaint-toolbar-left,
.nic-repaint-toolbar-right,
.nic-repaint-tool-group {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.nic-repaint-toolbar-left {
    min-width: 0;
}

.nic-repaint-toolbar-right {
    margin-left: auto;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nic-repaint-tool-group {
    gap: 6px;
    padding: 4px;
    border: 1px solid rgba(100, 116, 139, .16);
    border-radius: 999px;
    background: #f8fafc;
}

.nic-repaint-kicker {
    color: #94a3b8;
    font-size: 10px;
    line-height: 1;
    font-weight: 800;
    text-transform: uppercase;
}

.nic-repaint-title {
    margin: 4px 0 0;
    color: #0f172a;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 760;
}

.nic-repaint-close,
.nic-repaint-secondary,
.nic-repaint-primary,
.nic-repaint-tool,
.nic-repaint-clear {
    height: 36px;
    border: 1px solid rgba(100, 116, 139, .16);
    border-radius: 999px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    font-size: 12px;
    line-height: 1;
    font-weight: 720;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.nic-repaint-close,
.nic-repaint-tool {
    width: 36px;
    padding: 0;
    display: grid;
    place-items: center;
}

.nic-repaint-close {
    font-size: 18px;
}

.nic-repaint-tool {
    font-size: 18px;
}

.nic-repaint-clear,
.nic-repaint-secondary,
.nic-repaint-primary {
    min-width: 82px;
    padding: 0 14px;
}

.nic-repaint-primary {
    min-width: 104px;
    border-color: #111827;
    background: #111827;
    color: #fff;
}

.nic-repaint-primary:disabled,
.nic-repaint-tool:disabled {
    border-color: rgba(100, 116, 139, .16);
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

.nic-repaint-primary:disabled {
    border-color: #111827;
    background: #111827;
    color: #fff;
    opacity: .48;
}

.nic-repaint-close:hover,
.nic-repaint-secondary:hover,
.nic-repaint-tool:hover,
.nic-repaint-clear:hover {
    border-color: rgba(15, 23, 42, .24);
    background: #f8fafc;
    transform: translateY(-1px);
}

.nic-repaint-primary:not(:disabled):hover {
    background: #1f2937;
    transform: translateY(-1px);
}

.nic-repaint-brush {
    min-width: min(360px, 100%);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #0f172a;
    font-size: 12px;
    font-weight: 720;
}

.nic-repaint-brush-dot {
    width: 18px;
    height: 18px;
    border: 2px solid #111827;
    border-radius: 999px;
    background: #fff;
    flex: 0 0 auto;
}

.nic-repaint-brush input {
    width: min(220px, 42vw);
    accent-color: #111827;
}

.nic-repaint-model {
    position: relative;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #0f172a;
}

.nic-repaint-model-label {
    color: #64748b;
    font-size: 11px;
    font-weight: 720;
    white-space: nowrap;
}

.nic-repaint-model-current {
    height: 36px;
    padding: 0 12px;
    border: 1px solid rgba(100, 116, 139, .16);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    color: #0f172a;
    font-size: 12px;
    font-weight: 760;
    white-space: nowrap;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.nic-repaint-model-current:hover,
.nic-repaint-model-current.is-open {
    border-color: rgba(15, 23, 42, .24);
    background: #f8fafc;
}

.nic-repaint-model-chevron {
    color: #64748b;
    font-size: 14px;
    line-height: 1;
    transition: transform .16s ease;
}

.nic-repaint-model-current.is-open .nic-repaint-model-chevron {
    transform: rotate(180deg);
}

.nic-repaint-model-popover {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    z-index: 6;
    width: min(280px, calc(100vw - 48px));
    max-height: min(420px, calc(100vh - 160px));
    overflow: auto;
    padding: 8px;
    border: 1px solid rgba(100, 116, 139, .16);
    border-radius: 18px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 20px 52px rgba(15, 23, 42, .18);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
}

.nic-repaint-model-popover.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.nic-repaint-model-popover::-webkit-scrollbar {
    width: 8px;
}

.nic-repaint-model-popover::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(15, 23, 42, .22);
    background-clip: padding-box;
}

.nic-repaint-model-popover-head {
    padding: 8px 10px 10px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 760;
}

.nic-repaint-mode {
    width: 100%;
    min-height: 42px;
    padding: 8px 10px;
    border: 0;
    border-radius: 12px;
    background: #fff;
    color: #334155;
    font: inherit;
    font-size: 12px;
    font-weight: 720;
    text-align: left;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.nic-repaint-mode:hover {
    background: #f8fafc;
}

.nic-repaint-mode.is-active {
    background: #111827;
    color: #fff;
}

.nic-repaint-mode-check {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    font-size: 12px;
    line-height: 1;
    font-weight: 800;
}

.nic-repaint-mode-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.nic-repaint-mode-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nic-repaint-mode-note {
    color: #64748b;
    font-size: 10px;
    line-height: 1.25;
    font-weight: 650;
}

.nic-repaint-mode.is-active .nic-repaint-mode-note {
    color: rgba(255, 255, 255, .74);
}

.nic-highres-modal {
    position: fixed;
    inset: 0;
    z-index: 183;
    padding: 18px;
    display: grid;
    place-items: center;
    background: rgba(15, 23, 42, .46);
    backdrop-filter: blur(18px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .16s ease, visibility .16s ease;
}

.nic-highres-modal.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.nic-highres-dialog {
    width: min(820px, calc(100vw - 36px));
    max-height: min(720px, calc(100vh - 36px));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 34px 90px rgba(15, 23, 42, .24);
}

.nic-highres-head,
.nic-highres-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, .95);
}

.nic-highres-head {
    border-bottom: 1px solid rgba(100, 116, 139, .12);
}

.nic-highres-foot {
    border-top: 1px solid rgba(100, 116, 139, .12);
}

.nic-highres-kicker {
    color: #94a3b8;
    font-size: 10px;
    line-height: 1;
    font-weight: 800;
    text-transform: uppercase;
}

.nic-highres-title {
    margin: 4px 0 0;
    color: #0f172a;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 760;
}

.nic-highres-close,
.nic-highres-secondary,
.nic-highres-primary {
    height: 36px;
    border: 1px solid rgba(100, 116, 139, .16);
    border-radius: 999px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    font-size: 12px;
    line-height: 1;
    font-weight: 720;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.nic-highres-close {
    width: 36px;
    padding: 0;
    display: grid;
    place-items: center;
    font-size: 18px;
}

.nic-highres-secondary,
.nic-highres-primary {
    min-width: 92px;
    padding: 0 14px;
}

.nic-highres-primary {
    min-width: 136px;
    border-color: #111827;
    background: #111827;
    color: #fff;
}

.nic-highres-primary:disabled {
    border-color: rgba(100, 116, 139, .16);
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

.nic-highres-close:hover,
.nic-highres-secondary:hover {
    border-color: rgba(15, 23, 42, .24);
    background: #f8fafc;
    transform: translateY(-1px);
}

.nic-highres-primary:hover:not(:disabled) {
    background: #1f2937;
    transform: translateY(-1px);
}

.nic-highres-body {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(280px, 1fr);
    gap: 16px;
    padding: 16px;
    background: #f8fafc;
}

.nic-highres-preview {
    min-width: 0;
    min-height: 280px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(100, 116, 139, .14);
    border-radius: 20px;
    background: #fff;
}

.nic-highres-preview img {
    max-width: 100%;
    max-height: 420px;
    display: block;
    object-fit: contain;
}

.nic-highres-config {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 14px;
}

.nic-highres-source {
    padding: 10px 12px;
    border: 1px solid rgba(100, 116, 139, .14);
    border-radius: 14px;
    background: #fff;
    color: #334155;
    font-size: 12px;
    font-weight: 720;
}

.nic-highres-source.is-error {
    color: #dc2626;
}

.nic-highres-model {
    position: relative;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #0f172a;
}

.nic-highres-model-label,
.nic-highres-section-title {
    color: #64748b;
    font-size: 11px;
    font-weight: 720;
    white-space: nowrap;
}

.nic-highres-options {
    display: grid;
    gap: 8px;
    margin-top: 8px;
    max-height: 300px;
    overflow: auto;
    padding-right: 2px;
}

.nic-highres-options::-webkit-scrollbar {
    width: 8px;
}

.nic-highres-options::-webkit-scrollbar-track {
    background: transparent;
}

.nic-highres-options::-webkit-scrollbar-thumb {
    border: 2px solid #f8fafc;
    border-radius: 999px;
    background: rgba(100, 116, 139, .28);
}

.nic-highres-option {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid rgba(100, 116, 139, .14);
    border-radius: 14px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    text-align: left;
    display: grid;
    gap: 4px;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.nic-highres-option strong {
    font-size: 13px;
    line-height: 1.2;
    font-weight: 760;
}

.nic-highres-option span {
    color: #64748b;
    font-size: 11px;
    line-height: 1.25;
    font-weight: 650;
}

.nic-highres-option:hover {
    border-color: rgba(15, 23, 42, .22);
    background: #fff;
    transform: translateY(-1px);
}

.nic-highres-option.is-active {
    border-color: #111827;
    background: #111827;
    color: #fff;
}

.nic-highres-option.is-active span {
    color: rgba(255, 255, 255, .72);
}

.nic-highres-empty,
.nic-highres-meta {
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
    font-weight: 650;
}

.nic-highres-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nic-reverse-dialog {
    width: min(900px, calc(100vw - 36px));
}

.nic-reverse-tool-body {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(320px, 1fr);
    gap: 16px;
    padding: 16px;
    background: #f8fafc;
}

.nic-reverse-tool-preview {
    min-width: 0;
    min-height: 340px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(100, 116, 139, .12);
    border-radius: 20px;
    background: #fff;
}

.nic-reverse-tool-preview img {
    max-width: 100%;
    max-height: 520px;
    display: block;
    border-radius: 14px;
    object-fit: contain;
}

.nic-reverse-tool-side {
    min-width: 0;
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    gap: 10px;
}

.nic-reverse-tool-title {
    color: #0f172a;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 760;
}

.nic-reverse-tool-state,
.nic-reverse-tool-summary {
    padding: 14px;
    border: 1px solid rgba(100, 116, 139, .14);
    border-radius: 16px;
    background: #fff;
    color: #475569;
}

.nic-reverse-tool-state {
    min-height: 98px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    text-align: center;
}

.nic-reverse-tool-state strong,
.nic-reverse-tool-state small {
    display: block;
}

.nic-reverse-tool-state strong {
    color: #0f172a;
    font-size: 13px;
    line-height: 1.25;
    font-weight: 760;
}

.nic-reverse-tool-state small,
.nic-reverse-tool-summary {
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
    font-weight: 600;
}

.nic-reverse-tool-state.is-error {
    border-color: rgba(239, 68, 68, .2);
    background: #fff;
}

.nic-reverse-tool-output {
    width: 100%;
    min-height: 240px;
    resize: none;
    border: 1px solid rgba(100, 116, 139, .16);
    border-radius: 18px;
    background: #fff;
    color: #0f172a;
    padding: 14px;
    font: inherit;
    font-size: 13px;
    line-height: 1.72;
    font-weight: 560;
    outline: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(15, 23, 42, .18) transparent;
}

.nic-reverse-tool-output::-webkit-scrollbar {
    width: 8px;
}

.nic-reverse-tool-output::-webkit-scrollbar-track {
    background: transparent;
}

.nic-reverse-tool-output::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(15, 23, 42, .2);
    background-clip: padding-box;
}

.nic-expand-modal {
    position: fixed;
    inset: 0;
    z-index: 184;
    padding: 18px;
    display: grid;
    place-items: center;
    background: rgba(15, 23, 42, .46);
    backdrop-filter: blur(18px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .16s ease, visibility .16s ease;
}

.nic-expand-modal.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.nic-expand-dialog {
    width: min(1120px, calc(100vw - 36px));
    height: min(780px, calc(100vh - 36px));
    max-height: calc(100vh - 36px);
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 34px 90px rgba(15, 23, 42, .24);
}

.nic-expand-head,
.nic-expand-toolbar,
.nic-expand-foot {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, .95);
}

.nic-expand-head,
.nic-expand-toolbar {
    z-index: 24;
    overflow: visible;
    border-bottom: 1px solid rgba(100, 116, 139, .12);
}

.nic-expand-toolbar .nic-repaint-model {
    z-index: 25;
}

.nic-expand-toolbar .nic-repaint-model-popover {
    left: 0;
    right: auto;
    top: calc(100% + 8px);
    z-index: 40;
    width: min(260px, calc(100vw - 56px));
}

.nic-expand-foot {
    border-top: 1px solid rgba(100, 116, 139, .12);
    background: #fff;
}

.nic-expand-kicker {
    color: #94a3b8;
    font-size: 10px;
    line-height: 1;
    font-weight: 800;
    text-transform: uppercase;
}

.nic-expand-title {
    margin: 4px 0 0;
    color: #0f172a;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 760;
}

.nic-expand-close {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(100, 116, 139, .16);
    border-radius: 999px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    font-size: 18px;
    line-height: 1;
    font-weight: 720;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.nic-expand-close:hover {
    border-color: rgba(15, 23, 42, .24);
    background: #f8fafc;
    transform: translateY(-1px);
}

.nic-expand-target {
    padding: 8px 12px;
    border: 1px solid rgba(100, 116, 139, .14);
    border-radius: 999px;
    background: #f8fafc;
    color: #334155;
    font-size: 12px;
    line-height: 1;
    font-weight: 720;
}

.nic-expand-body {
    position: relative;
    z-index: 1;
    min-height: 0;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 16px;
    padding: 16px;
    background: #f8fafc;
}

.nic-expand-stage-shell {
    min-width: 0;
    min-height: 0;
    align-self: stretch;
    justify-self: stretch;
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(100, 116, 139, .14);
    border-radius: 20px;
    background:
        linear-gradient(45deg, rgba(148, 163, 184, .16) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(148, 163, 184, .16) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(148, 163, 184, .16) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(148, 163, 184, .16) 75%),
        #fff;
    background-size: 24px 24px;
    background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}

.nic-expand-frame {
    position: relative;
    border-radius: 8px;
    background: rgba(255, 255, 255, .28);
    overflow: visible;
    box-shadow: 0 20px 60px rgba(15, 23, 42, .18);
}

.nic-expand-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    box-sizing: border-box;
    border: 2px solid #2563eb;
    border-radius: 8px;
    pointer-events: none;
}

.nic-expand-image {
    position: absolute;
    z-index: 1;
    display: block;
    user-select: none;
    pointer-events: none;
    border-radius: 4px;
    box-shadow: 0 8px 26px rgba(15, 23, 42, .18);
}

.nic-expand-handle {
    position: absolute;
    z-index: 4;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, .32);
}

.nic-expand-handle.n,
.nic-expand-handle.s {
    left: 50%;
    transform: translateX(-50%);
    cursor: ns-resize;
}

.nic-expand-handle.e,
.nic-expand-handle.w {
    top: 50%;
    transform: translateY(-50%);
    cursor: ew-resize;
}

.nic-expand-handle.n { top: -9px; }
.nic-expand-handle.s { bottom: -9px; }
.nic-expand-handle.e { right: -9px; }
.nic-expand-handle.w { left: -9px; }
.nic-expand-handle.ne { top: -9px; right: -9px; cursor: nesw-resize; }
.nic-expand-handle.nw { top: -9px; left: -9px; cursor: nwse-resize; }
.nic-expand-handle.se { right: -9px; bottom: -9px; cursor: nwse-resize; }
.nic-expand-handle.sw { left: -9px; bottom: -9px; cursor: nesw-resize; }

.nic-expand-loading {
    padding: 16px 22px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .92);
    color: #334155;
    font-size: 13px;
    font-weight: 760;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .14);
}

.nic-expand-error {
    display: grid;
    gap: 8px;
    justify-items: center;
    max-width: 360px;
    padding: 18px;
    border: 1px solid rgba(239, 68, 68, .16);
    border-radius: 18px;
    background: #fff;
    color: #991b1b;
    text-align: center;
}

.nic-expand-error[hidden],
.nic-expand-loading[hidden],
.nic-expand-frame[hidden] {
    display: none;
}

.nic-expand-error button {
    height: 34px;
    padding: 0 14px;
    border: 1px solid rgba(239, 68, 68, .18);
    border-radius: 999px;
    background: #fff;
    color: #991b1b;
    font: inherit;
    font-size: 12px;
    font-weight: 760;
    cursor: pointer;
}

.nic-expand-side {
    min-width: 0;
    min-height: 0;
    max-height: 100%;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(15, 23, 42, .18) transparent;
    position: relative;
    display: grid;
    align-content: start;
    gap: 12px;
}

.nic-expand-side::-webkit-scrollbar {
    width: 6px;
}

.nic-expand-side::-webkit-scrollbar-track {
    background: transparent;
}

.nic-expand-side::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(15, 23, 42, .16);
}

.nic-expand-model {
    width: 100%;
    justify-content: space-between;
}

.nic-expand-model .nic-repaint-model-current {
    min-width: 136px;
    justify-content: space-between;
}

.nic-expand-model .nic-repaint-model-popover {
    left: auto;
    right: 0;
    z-index: 45;
}

.nic-expand-ratios {
    display: grid;
    gap: 8px;
}

.nic-expand-ratio-title {
    color: #64748b;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 760;
}

.nic-expand-ratio-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.nic-expand-ratio {
    min-width: 0;
    min-height: 48px;
    padding: 8px 10px;
    border: 1px solid rgba(100, 116, 139, .14);
    border-radius: 14px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.nic-expand-ratio > span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nic-expand-ratio > span:first-child {
    font-size: 12px;
    line-height: 1.2;
    font-weight: 780;
}

.nic-expand-ratio > span:last-child {
    margin-top: 4px;
    color: #64748b;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 650;
}

.nic-expand-ratio:hover {
    border-color: rgba(15, 23, 42, .22);
    background: #f8fafc;
    transform: translateY(-1px);
}

.nic-expand-ratio.is-active {
    border-color: #111827;
    background: #111827;
    color: #fff;
}

.nic-expand-ratio.is-active > span:last-child {
    color: rgba(255, 255, 255, .72);
}

.nic-expand-side-title {
    color: #0f172a;
    font-size: 13px;
    font-weight: 760;
}

.nic-repaint-model-empty {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 650;
}

.nic-repaint-body {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 16px;
    padding: 16px;
    background: #f8fafc;
}

.nic-repaint-stage-shell {
    min-width: 0;
    min-height: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(100, 116, 139, .12);
    border-radius: 20px;
    background:
        linear-gradient(45deg, rgba(148, 163, 184, .2) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(148, 163, 184, .2) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(148, 163, 184, .2) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(148, 163, 184, .2) 75%);
    background-size: 22px 22px;
    background-position: 0 0, 0 11px, 11px -11px, -11px 0;
}

.nic-repaint-stage {
    position: relative;
    width: 0;
    height: 0;
    max-width: 100%;
    max-height: 100%;
}

.nic-repaint-loading {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 4;
    transform: translate(-50%, -50%);
    min-width: 220px;
    padding: 18px;
    border-radius: 18px;
    background: #fff;
    color: #475569;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 650;
    text-align: center;
    box-shadow: 0 18px 44px rgba(15, 23, 42, .12);
}

.nic-repaint-error {
    width: min(360px, calc(100vw - 64px));
    padding: 18px;
    border: 1px solid rgba(100, 116, 139, .16);
    border-radius: 18px;
    background: #fff;
    color: #475569;
    box-shadow: 0 18px 44px rgba(15, 23, 42, .12);
    text-align: center;
}

.nic-repaint-error strong,
.nic-repaint-error span {
    display: block;
}

.nic-repaint-error strong {
    color: #0f172a;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 760;
}

.nic-repaint-error span {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.5;
    font-weight: 560;
}

.nic-repaint-error button {
    height: 34px;
    margin-top: 14px;
    padding: 0 14px;
    border: 1px solid #111827;
    border-radius: 999px;
    background: #111827;
    color: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 720;
    cursor: pointer;
}

.nic-repaint-image {
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    display: block;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.nic-repaint-image[hidden],
.nic-repaint-mask[hidden],
.nic-repaint-cursor[hidden] {
    display: none !important;
}

.nic-repaint-mask {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: none;
    touch-action: none;
    opacity: .72;
    filter: drop-shadow(0 0 1px rgba(15, 23, 42, .86)) drop-shadow(0 6px 18px rgba(15, 23, 42, .22));
}

.nic-repaint-cursor {
    position: absolute;
    z-index: 2;
    left: 0;
    top: 0;
    border: 2px solid #fff;
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, .72), 0 8px 22px rgba(15, 23, 42, .18);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.nic-repaint-side {
    min-width: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    align-content: start;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(100, 116, 139, .12);
    border-radius: 20px;
    background: #fff;
}

.nic-repaint-side-title {
    color: #0f172a;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 760;
}

.nic-repaint-prompt {
    width: 100%;
    min-height: 180px;
    resize: none;
    border: 1px solid rgba(100, 116, 139, .18);
    border-radius: 16px;
    background: #f8fafc;
    color: #0f172a;
    padding: 12px;
    font: inherit;
    font-size: 13px;
    line-height: 1.65;
    font-weight: 560;
    outline: none;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.nic-repaint-prompt:focus {
    border-color: rgba(15, 23, 42, .36);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(15, 23, 42, .06);
}

.nic-repaint-prompt::-webkit-scrollbar {
    width: 8px;
}

.nic-repaint-prompt::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(15, 23, 42, .22);
    background-clip: padding-box;
}

.nic-repaint-prompt::-webkit-scrollbar-track {
    background: transparent;
}

.nic-repaint-hint,
.nic-repaint-meta {
    color: #64748b;
    font-size: 11px;
    line-height: 1.45;
    font-weight: 650;
}

.nic-repaint-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nic-recent-title {
    margin: 18px 0 10px;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.nic-list {
    display: grid;
    gap: 10px;
}

.nic-list-card {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 10px;
    padding: 8px;
    color: inherit;
    text-align: left;
    font: inherit;
    cursor: pointer;
    transition: transform .16s ease, border-color .16s ease;
}

.nic-list-card:hover,
.nic-list-card.is-selected {
    transform: translateY(-1px);
    border-color: rgba(15, 23, 42, .24);
}

.nic-list-thumb {
    width: 54px;
    aspect-ratio: 3 / 4;
    border-radius: 12px;
    overflow: hidden;
    background: #e2e8f0;
}

.nic-list-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nic-list-name {
    color: #172033;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nic-list-meta {
    margin-top: 5px;
    color: #64748b;
    font-size: 10px;
    font-weight: 500;
}

@media (max-width: 980px) {
    .nano-infinite-canvas {
        padding: 8px;
    }

    .nic-shell {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) minmax(220px, 36vh);
        border-radius: 24px;
    }

    .nic-main {
        border-right: 0;
        border-bottom: 1px solid rgba(117, 130, 154, .16);
    }

    .nic-panel {
        min-height: 0;
    }

    .nic-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .nic-title-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .nic-search {
        width: min(100%, 320px);
        min-width: 0;
    }

    .nic-actions {
        width: 100%;
    }

    .nic-history-limit {
        flex: 1 1 260px;
    }

    .nic-status {
        flex: 1 1 auto;
    }

    .nic-composer-options {
        justify-content: flex-start;
    }

    .nic-crop-dialog {
        height: min(860px, calc(100vh - 24px));
    }

    .nic-repaint-dialog {
        height: min(860px, calc(100vh - 24px));
    }

    .nic-crop-body,
    .nic-repaint-body {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) auto;
    }

    .nic-crop-preview-panel {
        grid-template-columns: 120px minmax(0, 1fr);
        grid-template-rows: auto auto;
        align-items: center;
    }

    .nic-crop-preview-title {
        grid-column: 2;
    }

    .nic-crop-preview {
        grid-row: 1 / span 2;
        max-height: 120px;
    }

    .nic-crop-preview-meta {
        grid-column: 2;
    }

    .nic-repaint-side {
        grid-template-columns: 160px minmax(0, 1fr);
        grid-template-rows: auto auto;
        align-items: start;
    }

    .nic-repaint-toolbar {
        flex-wrap: wrap;
    }

    .nic-repaint-toolbar-right {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
    }

    .nic-repaint-side-title {
        grid-column: 1;
    }

    .nic-repaint-prompt {
        grid-column: 2;
        grid-row: 1 / span 2;
        min-height: 118px;
    }

    .nic-repaint-hint {
        grid-column: 1;
    }
}

@media (max-width: 560px) {
    .nano-infinite-canvas {
        padding: 6px;
    }

    .nic-shell {
        border-radius: 20px;
    }

    .nic-title {
        font-size: 16px;
    }

    .nic-panel-head {
        padding: 14px 14px 10px;
    }

    .nic-panel-head-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .nic-account-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .nic-account-chip {
        flex: 1 1 auto;
    }

    .nic-panel-body {
        padding: 12px 14px 14px;
    }

    .nic-composer {
        margin: 0 10px 10px;
        padding: 10px;
    }

    .nic-composer-footer {
        align-items: center;
        flex-wrap: wrap;
    }

    .nic-composer-send {
        margin-left: auto;
    }

    .nic-history-limit {
        width: 100%;
        flex-basis: 100%;
    }

    .nic-limit-range {
        flex: 1 1 auto;
        width: auto;
    }

    .nic-composer-options {
        order: 3;
        flex-basis: 100%;
        justify-content: flex-start;
    }

    .nic-result-toolbar {
        left: 8px;
        right: 8px;
        top: 8px;
        width: auto;
        border-radius: 999px;
        flex-wrap: nowrap;
        overflow: visible;
        opacity: 1;
        pointer-events: auto;
        transform: none;
    }

    .nic-chat-result-wrap:hover .nic-result-toolbar,
    .nic-chat-result-wrap:focus-within .nic-result-toolbar {
        transform: none;
    }

    .nic-tool-btn {
        flex: 1 1 0;
        padding: 0 6px;
    }

    .nic-action-btn {
        flex: 1 1 auto;
    }

    .nic-crop-modal,
    .nic-repaint-modal {
        padding: 8px;
    }

    .nic-crop-dialog,
    .nic-repaint-dialog {
        width: calc(100vw - 16px);
        height: calc(100vh - 16px);
        min-height: 0;
        border-radius: 20px;
    }

    .nic-crop-head,
    .nic-crop-foot,
    .nic-repaint-head,
    .nic-repaint-foot,
    .nic-repaint-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .nic-crop-close,
    .nic-repaint-close {
        position: absolute;
        right: 14px;
        top: 14px;
    }

    .nic-crop-body,
    .nic-repaint-body {
        padding: 10px;
        gap: 10px;
    }

    .nic-crop-preview-panel {
        display: none;
    }

    .nic-crop-ratios,
    .nic-crop-actions,
    .nic-repaint-actions {
        width: 100%;
    }

    .nic-crop-actions button,
    .nic-repaint-actions button {
        flex: 1 1 0;
    }

    .nic-repaint-side {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    .nic-repaint-prompt,
    .nic-repaint-side-title,
    .nic-repaint-hint {
        grid-column: 1;
        grid-row: auto;
    }

    .nic-repaint-prompt {
        min-height: 116px;
    }

    .nic-repaint-model {
        width: 100%;
        align-items: flex-start;
        flex-direction: column;
    }

    .nic-repaint-model-popover {
        left: 0;
        right: auto;
    }

    .nic-reverse-dialog,
    .nic-highres-dialog {
        width: min(100vw - 20px, 820px);
        max-height: min(92vh, 720px);
    }

    .nic-reverse-tool-body,
    .nic-highres-body {
        grid-template-columns: 1fr;
        overflow: auto;
    }

    .nic-reverse-tool-preview,
    .nic-highres-preview {
        min-height: 220px;
    }

    .nic-highres-foot {
        align-items: stretch;
        flex-direction: column;
    }

    .nic-highres-actions {
        justify-content: flex-end;
    }

    .nic-node {
        width: 176px;
    }
}
