.ns-page .lb-page {
    padding-top: var(--studio-generator-padding-top);
}

.ns-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(290px, 34%);
    gap: clamp(12px, 1.8vw, 24px);
}
.ns-preview { display: flex; flex-direction: column; }
#ns-view { position: relative; flex: 1; min-height: clamp(400px, 39vw, 570px); background: #202b38; }
#ns-view :is(canvas, svg) { position: absolute; inset: 0; width: 100%; height: 100%; }
#ns-view svg { padding: 6%; }
#ns-dimensions { padding: 8px 16px; min-height: 2.5em; font-size: .9rem; color: #c3ced9; background: #0d131e; }

.ns-controls { display: flex; flex-direction: column; justify-content: center; }
.ns-controls h2 { margin: 0 0 16px; }
.ns-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ns-page .ns-tile {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 5px; width: 100%; min-width: 0; aspect-ratio: 1; padding: 8px;
    background: #0b1722; color: #edf7fa; border: 1px solid #38535f;
    border-radius: 10px; text-align: center; cursor: pointer; font-family: inherit;
}
.ns-page .ns-tile:hover { border-color: #7cebd8; background: #12222e; }
.ns-page :focus-visible { outline: 2px solid #7cebd8; outline-offset: 2px; }
.ns-tile strong { font-size: .98rem; line-height: 1.2; }
.ns-tile small { max-width: 100%; color: #c1ced5; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .8rem; }
.ns-tile > span { display: inline-flex; height: 32px; align-items: center; margin-bottom: 4px; color: #7cebd8; }
.ns-initial { font: bold 32px/1 Georgia, serif; }
.ns-ruler::before {
    content: ''; width: 34px; height: 13px; border: 2px solid; border-radius: 2px; transform: rotate(-24deg);
    background: repeating-linear-gradient(90deg, transparent 0 4px, currentColor 4px 6px) left top / 100% 5px no-repeat;
}
.ns-swatches i { width: 24px; height: 24px; border: 1px solid #aeb9c4; border-radius: 50%; }
.ns-swatches i + i { margin-left: -6px; }
.ns-page .ns-dialog {
    position: fixed; inset: 0; margin: auto; width: min(440px, calc(100% - 24px)); height: fit-content;
    max-height: calc(100dvh - 32px); padding: 0; color: #edf7fa; box-shadow: 0 16px 48px #0009;
}
.ns-dialog[open] { display: flex; flex-direction: column; }
.ns-dialog::backdrop { background: rgb(3 9 14 / .62); }
.ns-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid #334150; }
.ns-dialog h2, .ns-dialog form { margin: 0; }
.ns-page .ns-close { width: 36px; height: 36px; padding: 0; color: white; border: 1px solid #476579; border-radius: 8px; background: #101f2c; font: 24px/1 sans-serif; cursor: pointer; }
.ns-dialog-body { padding: 18px; overflow-y: auto; overscroll-behavior: contain; }
.ns-dialog #ns-name { display: block; width: 100%; margin-top: 5px; padding: 10px; border-radius: 8px; background: #101a26; border: 1px solid #506172; color: white; font: inherit; }
.ns-format-options { margin: 0; padding: 0; border: 0; min-width: 0; }
.ns-format-options legend { margin-bottom: 8px; padding: 0; color: #c1ced5; font-size: .85rem; }
.ns-format-row, .ns-format-result dl { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.ns-format-row label { display: block; position: relative; margin: 0; cursor: pointer; }
.ns-format-row input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ns-format-row label > span {
    display: grid; gap: 3px; align-content: center; padding: 12px 8px; min-height: 82px;
    color: #eef5f8; background: #0b1722; border: 1px solid #45606d; border-radius: 9px;
}
.ns-format-row strong, .ns-format-row b { font-size: 1rem; line-height: 1.15; }
.ns-format-row small { font-size: .75rem; color: #b7c8d2; font-weight: 400; }
.ns-format-row b { margin-top: 6px; font-variant-numeric: tabular-nums; }
.ns-format-row input:checked + span { background: #19333b; border-color: #7cebd8; box-shadow: inset 0 0 0 1px #7cebd8; }
.ns-format-row input:checked + span b { color: #7cebd8; }
.ns-format-row input:focus-visible + span { outline: 2px solid #ffe100; outline-offset: 2px; }
.ns-format-row input:disabled + span { opacity: .6; cursor: default; }
.ns-format-row input:disabled + span b { font-size: .75rem; }
.ns-format-result { margin-top: 16px; padding-top: 12px; border-top: 1px solid #334150; }
.ns-dialog .ns-format-result h3 { margin: 0 0 8px; font-size: .95rem; overflow-wrap: anywhere; }
.ns-format-result dl, .ns-format-result dd { margin: 0; }
.ns-format-result dt { color: #b7c8d2; font-size: .75rem; }
.ns-format-result dd { font-weight: 600; font-variant-numeric: tabular-nums; }
.ns-format-result p { margin: 8px 0 0; font-size: .8rem; color: #c1ced5; }
.ns-outline-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 100px)); gap: 8px; margin-bottom: 12px; }
.ns-outline-cards .ns-tile[aria-pressed=true] { border-color: #7cebd8; background: #19333b; }
.ns-outline-cards .ns-tile[aria-pressed=true] small { color: #7cebd8; font-weight: 700; }
.ns-contour-sample { font: bold 28px/1 Georgia, serif; paint-order: stroke fill; -webkit-text-stroke: 3px var(--ns-contour-color, transparent); }
.ns-contour-script { font-style: italic; }
.ns-dialog h3 { margin: 18px 0 8px; color: white; font-size: 1rem; }
#ns-panel-surface > h3:first-child { margin-top: 0; }
.ns-surface-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.ns-surface-options button {
    min-height: 44px; padding: 8px; border: 1px solid #526975; border-radius: 8px;
    background: #101f2c; color: #eef5f8; font: inherit; cursor: pointer;
}
.ns-surface-options button[aria-pressed=true] { border-color: #7cebd8; background: #19333b; }
.ns-dialog .ns-font-picker { margin-top: 10px; padding: 0; border: 1px solid #526975; border-radius: 8px; }
.ns-font-picker summary { padding: 10px; cursor: pointer; }
.ns-font-picker summary strong { margin-inline-start: 8px; font-size: 1.15rem; font-weight: 400; }
.ns-font-picker > div { padding: 0 10px 10px; }
.ns-font-picker h3 { margin: 10px 0 5px; font-size: .9rem; }
.ns-font-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.ns-font-options button {
    display: grid; gap: 4px; min-width: 0; padding: 8px 4px; border: 1px solid #526975;
    border-radius: 8px; background: #101f2c; color: #eef5f8; cursor: pointer;
}
.ns-font-options button[aria-pressed=true] { border-color: #7cebd8; background: #19333b; }
.ns-font-options button span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 1.5rem; font-weight: 400; }
.ns-font-options small { font: 500 .78rem/1.2 Rubik, sans-serif; }
.ns-colors { display: flex; flex-wrap: wrap; gap: 6px; }
.ns-colors button {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    width: auto; min-width: 36px; min-height: 36px; padding: 4px 10px;
    border: 1px solid #526975; border-radius: 8px; background: #101f2c;
    color: #eef5f8; font: inherit; font-size: .95rem; font-weight: 600; line-height: 1.1; cursor: pointer;
}
.ns-colors button::before {
    content: ''; width: 12px; height: 12px; border-radius: 50%;
    background: var(--ns-color); border: 1px solid #98a9b7;
}
#ns-letters { gap: 4px; }
#ns-letters button {
    flex-direction: column-reverse; gap: 4px; width: clamp(40px, 10vw, 50px);
    min-height: 52px; padding: 5px 3px; font-size: 1.5rem; font-weight: 700;
}
#ns-letters button::before { width: 65%; height: 5px; border-radius: 3px; }
#ns-letters button[aria-pressed=true] {
    color: #0a0b0e; background: #7cebd8; border-color: #7cebd8;
}
.ns-colors button[aria-pressed=true] { border-color: #7cebd8; background: #19333b; }
.ns-picker-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
#ns-color-count { color: #b7c8d2; font-size: .85rem; }
.ns-palette { display: grid; grid-template-columns: repeat(auto-fill,minmax(32px,1fr)); gap: 6px; }
.ns-palette button {
    position: relative; width: 100%; aspect-ratio: 1; padding: 0;
    border: 1px solid #526975; border-radius: 8px; cursor: pointer;
}
.ns-palette button[aria-pressed=true]::after {
    content: ''; position: absolute; inset: 0; margin: auto; width: 8px; height: 14px;
    border: solid white; border-width: 0 3px 3px 0; transform: translateY(-2px) rotate(45deg);
    filter: drop-shadow(0 1px 1px #000) drop-shadow(0 0 1px #000);
}
.ns-palette button:disabled { opacity: .25; }
.ns-page :is(#ns-dialog-status, #ns-status, #ns-cart-status) { color: #ffdaa6; margin: 12px 0 0; }
.ns-page :is(#ns-dialog-status, #ns-status, #ns-cart-status):empty { display: none; }
.ns-page #ns-price { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; line-height: 1.2; }
.ns-page #ns-current { font-size: 1.9rem; font-weight: 750; letter-spacing: -.04em; color: #f1faf7; }
.ns-page #ns-regular { font-size: .95rem; font-weight: 400; color: #a5b4bd; white-space: nowrap; }
.ns-page #ns-saving { padding: 5px 8px; border-radius: 6px; background: #fde100; color: #172029; font-size: .75rem; font-weight: 600; white-space: nowrap; }
@media (max-width: 480px) {
    .ns-page #ns-price { column-gap: 9px; }
    .ns-page #ns-current { font-size: 1.65rem; }
}
.ns-page #ns-price.is-unavailable #ns-current { font-size: 1.1rem; color: #d4dfe5; }
.ns-product-guide {
    display: grid;
    gap: clamp(32px, 5vw, 64px);
    margin-top: clamp(32px, 5vw, 64px);
}
.ns-product-guide h2 { font-size: clamp(1.45rem, 2.4vw, 2rem); line-height: 1.2; }
.ns-examples, .ns-advice {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(16px, 2.5vw, 32px);
}
.ns-examples { margin-top: 20px; }
.ns-examples figure {
    margin: 0;
    overflow: hidden;
    background: var(--studio-surface);
    border: 1px solid var(--studio-line);
    border-radius: 14px;
}
.ns-examples img { display: block; width: 100%; height: auto; }
.ns-examples figcaption { display: grid; gap: 4px; padding: 14px 18px; }
.ns-examples strong { color: #fff; font-size: 1.1rem; }
.ns-examples small { color: #b7c8d2; font-variant-numeric: tabular-nums; }
.ns-advice p { max-width: 62ch; line-height: 1.65; }
.ns-advice p:last-child { margin-bottom: 0; }
@media (max-width: 760px) {
    .ns-examples, .ns-advice { grid-template-columns: minmax(0, 1fr); }
    .ns-layout { grid-template-columns: minmax(0, 1fr); }
    #ns-view { min-height: clamp(270px, 39svh, 380px); }
    .ns-controls { padding: 14px; }
    .ns-controls h2 { margin-bottom: 10px; font-size: 1.1rem; }
    .ns-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
    .ns-page .ns-tile { padding: 4px; gap: 2px; }
    .ns-tile > span { height: 24px; margin-bottom: 2px; }
    .ns-tile strong { font-size: .8rem; }
    .ns-tile small { font-size: .7rem; }
}
