/* Tool-specific styles only - base styles are in tool-layout.css */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #0a0a0a;
    color: #e5e7eb;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #141414;
    border-bottom: 1px solid #374151;
    z-index: 100;
}

    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

    margin-top: 60px;
    padding: 48px 24px;
    text-align: center;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    max-width: 720px;
    margin: 0 auto;
}

.tool-main {
    flex: 1;
    padding: 32px 24px 120px;
}

.tool-container {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group > label {
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
}

.file-upload-zone {
    background-color: #0a0a0a;
    border: 2px dashed #374151;
    border-radius: 12px;
    padding: 48px 32px;
    text-align: center;
    cursor: pointer;
    transition: all 150ms ease;
    position: relative;
    outline: none;
}

.file-upload-zone.has-error {
    border-color: #dc2626;
    background-color: #7f1d1d;
}

.upload-icon {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    opacity: 0.7;
    color: #6b7280;
    letter-spacing: 2px;
}

.upload-primary {
    font-size: 16px;
    font-weight: 400;
    color: #e5e7eb;
    margin-bottom: 4px;
}

.upload-secondary {
    font-size: 14px;
    font-weight: 400;
    color: #9ca3af;
}

.thumbnails-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.thumbnails-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.image-counter {
    font-size: 14px;
    font-weight: 500;
    color: #9ca3af;
    flex: 1;
}

.button-small {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 6px;
}

.thumbnails-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.thumbnail-item {
    position: relative;
    width: 80px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: grab;
}

.thumbnail-item.dragging {
    opacity: 0.4;
}

.thumbnail-item.drag-over {
    border-left: 2px solid #3b82f6;
}

.thumbnail-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #374151;
    background-color: #141414;
}

.thumbnail-name {
    font-size: 11px;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thumbnail-remove {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 50%;
    color: #9ca3af;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 150ms ease;
}

.thumbnail-remove:hover {
    background-color: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
}

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 24px;
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 8px;
}

.settings-title {
    font-size: 18px;
    font-weight: 500;
    color: #d1d5db;
    margin-bottom: 4px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.setting-item > label {
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
}

.segmented-control {
    display: flex;
    background-color: #1a1a1a;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.segment {
    flex: 1;
    padding: 8px 16px;
    background: none;
    border: none;
    border-radius: 6px;
    color: #9ca3af;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 150ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.segment:hover {
    color: #e5e7eb;
}

.segment.active {
    background-color: #3b82f6;
    color: #ffffff;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.template-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 6px 8px;
    background-color: #1a1a1a;
    border: 2px solid #374151;
    border-radius: 8px;
    cursor: pointer;
    transition: all 150ms ease;
}

.template-btn:hover {
    border-color: #4b5563;
    background-color: #1f1f1f;
}

.template-btn.active {
    border-color: #3b82f6;
    background-color: #172554;
}

.template-btn.template-pro {
    opacity: 0.6;
}

.template-btn.template-pro.active {
    opacity: 1;
}

.template-label {
    font-size: 11px;
    font-weight: 500;
    color: #9ca3af;
}

.template-btn.active .template-label {
    color: #e5e7eb;
}

.pro-badge-overlay {
    position: absolute;
    top: 4px;
    right: 4px;
    color: #0a0a0a;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 1px 4px;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

.template-preview {
    width: 56px;
    height: 56px;
    display: grid;
    gap: 2px;
    border-radius: 4px;
    overflow: hidden;
}

.template-preview > span,
.template-preview .cell-row > span,
.template-preview .col > span {
    background-color: #374151;
    border-radius: 2px;
}

.template-2x2 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.template-3x3 {
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
}

.template-2x3 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
}

.template-1plus2 {
    display: flex;
    gap: 2px;
}

.template-1plus2 .cell-large {
    flex: 2;
    background-color: #374151;
    border-radius: 2px;
}

.template-1plus2 .cell-stack {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.template-1plus2 .cell-stack > span {
    flex: 1;
    background-color: #374151;
    border-radius: 2px;
}

.template-1plus3 {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.template-1plus3 .cell-wide {
    flex: 1;
    background-color: #374151;
    border-radius: 2px;
}

.template-1plus3 .cell-row {
    flex: 1;
    display: flex;
    gap: 2px;
}

.template-1plus3 .cell-row > span {
    flex: 1;
    background-color: #374151;
    border-radius: 2px;
}

.template-2plus1 {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.template-2plus1 .cell-row {
    flex: 1;
    display: flex;
    gap: 2px;
}

.template-2plus1 .cell-row > span {
    flex: 1;
    background-color: #374151;
    border-radius: 2px;
}

.template-2plus1 .cell-wide {
    flex: 1;
    background-color: #374151;
    border-radius: 2px;
}

.template-3plus1 {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.template-3plus1 .cell-row {
    flex: 1;
    display: flex;
    gap: 2px;
}

.template-3plus1 .cell-row > span {
    flex: 1;
    background-color: #374151;
    border-radius: 2px;
}

.template-3plus1 .cell-wide {
    flex: 1;
    background-color: #374151;
    border-radius: 2px;
}

.template-4x4 {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
}

.template-5x5 {
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
}

.template-masonry2 {
    display: flex;
    gap: 2px;
}

.template-masonry2 .col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.template-masonry2 .h-tall {
    flex: 2;
    background-color: #374151;
    border-radius: 2px;
}

.template-masonry2 .h-short {
    flex: 1;
    background-color: #374151;
    border-radius: 2px;
}

.template-masonry3 {
    display: flex;
    gap: 2px;
}

.template-masonry3 .col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.template-masonry3 .h-tall {
    flex: 2;
    background-color: #374151;
    border-radius: 2px;
}

.template-masonry3 .h-mid {
    flex: 1.5;
    background-color: #374151;
    border-radius: 2px;
}

.template-masonry3 .h-short {
    flex: 1;
    background-color: #374151;
    border-radius: 2px;
}

.template-lshape {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 2fr 1fr;
    gap: 2px;
}

.template-lshape .cell-big {
    background-color: #374151;
    border-radius: 2px;
}

.template-lshape .cell-side {
    background-color: #374151;
    border-radius: 2px;
}

.template-lshape .cell-bottom {
    background-color: #374151;
    border-radius: 2px;
}

.template-tshape {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.template-tshape .cell-wide {
    flex: 1;
    background-color: #374151;
    border-radius: 2px;
}

.template-tshape .cell-row {
    flex: 1;
    display: flex;
    gap: 2px;
}

.template-tshape .cell-row > span {
    flex: 1;
    background-color: #374151;
    border-radius: 2px;
}

.template-cross {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    gap: 2px;
}

.template-cross .cell-center {
    grid-column: 2;
    grid-row: 2;
    background-color: #374151;
    border-radius: 2px;
}

.template-cross .cell-arm {
    background-color: #374151;
    border-radius: 2px;
}

.template-cross .cell-arm:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
}

.template-cross .cell-arm:nth-child(3) {
    grid-column: 1;
    grid-row: 2;
}

.template-cross .cell-arm:nth-child(4) {
    grid-column: 3;
    grid-row: 2;
}

.template-cross .cell-arm:nth-child(5) {
    grid-column: 2;
    grid-row: 3;
}

.template-diagonal2 {
    position: relative;
}

.template-diagonal2 .cell-diag {
    position: absolute;
    width: 60%;
    height: 60%;
    background-color: #374151;
    border-radius: 2px;
}

.template-diagonal2 .cell-diag-tl {
    top: 0;
    left: 0;
}

.template-diagonal2 .cell-diag-br {
    bottom: 0;
    right: 0;
}

.template-diagonal3 {
    position: relative;
}

.template-diagonal3 .cell-diag {
    position: absolute;
    width: 45%;
    height: 45%;
    background-color: #374151;
    border-radius: 2px;
}

.template-diagonal3 .cell-diag:nth-child(1) {
    top: 0;
    left: 0;
}

.template-diagonal3 .cell-diag:nth-child(2) {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.template-diagonal3 .cell-diag:nth-child(3) {
    bottom: 0;
    right: 0;
}

.template-circlepack {
    position: relative;
}

.template-circlepack .circle {
    position: absolute;
    border-radius: 50%;
    background-color: #374151;
}

.template-circlepack .circle-lg {
    width: 36px;
    height: 36px;
    top: 2px;
    left: 2px;
}

.template-circlepack .circle-md {
    width: 24px;
    height: 24px;
    top: 4px;
    right: 2px;
}

.template-circlepack .circle-sm {
    width: 20px;
    height: 20px;
    bottom: 2px;
    right: 12px;
}

.template-hex {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    justify-content: center;
    align-items: center;
    align-content: center;
}

.template-hex .hex {
    width: 18px;
    height: 16px;
    background-color: #374151;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}

.template-mosaic {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    gap: 2px;
}

.template-mosaic .m-a {
    grid-row: 1 / 3;
    background-color: #374151;
    border-radius: 2px;
}

.template-mosaic .m-b {
    background-color: #374151;
    border-radius: 2px;
}

.template-mosaic .m-c {
    background-color: #374151;
    border-radius: 2px;
}

.template-mosaic .m-d {
    background-color: #374151;
    border-radius: 2px;
}

.template-mosaic .m-e {
    display: none;
}

.template-panoramic {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: 1fr;
    height: 100%;
}

.template-vstrip {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 1fr);
    height: 100%;
}

.template-asym1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    gap: 2px;
}

    grid-row: 1 / 4;
    background-color: #374151;
    border-radius: 2px;
}

.template-asym1 .cell-sm {
    background-color: #374151;
    border-radius: 2px;
}

.template-asym2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 2fr 1fr;
    gap: 2px;
}

.template-asym2 .cell-med {
    background-color: #374151;
    border-radius: 2px;
}

.template-asym2 .cell-sm {
    background-color: #374151;
    border-radius: 2px;
}

.template-pinterest {
    display: flex;
    gap: 2px;
}

.template-pinterest .col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.template-pinterest .h-tall {
    flex: 2;
    background-color: #374151;
    border-radius: 2px;
}

.template-pinterest .h-mid {
    flex: 1.5;
    background-color: #374151;
    border-radius: 2px;
}

.template-pinterest .h-short {
    flex: 1;
    background-color: #374151;
    border-radius: 2px;
}

.pro-badge-inline {
    color: #0a0a0a;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 1px 5px;
    border-radius: 3px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.pro-badge {
    color: #0a0a0a;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.freeform-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.freeform-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
}

.freeform-instructions {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

.freeform-canvas-wrap {
    position: relative;
    width: 100%;
    background-color: #0a0a0a;
    border: 1px solid #374151;
    border-radius: 8px;
    overflow: hidden;
}

.freeform-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: auto;
}

.preset-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.preset-btn {
    background-color: #1a1a1a;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 150ms ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.preset-btn:hover:not(:disabled) {
    background-color: #374151;
}

.preset-btn.active {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

.preset-btn.active .pro-badge-inline {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.preset-btn.preset-pro {
    opacity: 0.6;
}

.preset-btn.preset-pro.active {
    opacity: 1;
}

.preset-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.custom-size-inputs {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.size-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.size-input-group label {
    font-size: 12px;
    font-weight: 500;
    color: #9ca3af;
}

.size-separator {
    font-size: 16px;
    color: #6b7280;
    padding-bottom: 10px;
}

.slider-with-input {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider-with-input .slider {
    flex: 1;
}

.slider-with-input .text-input-sm {
    width: 64px;
    flex-shrink: 0;
}

input[type="range"].slider {
    width: 100%;
    height: 4px;
    background-color: #374151;
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
    display: block;
}

input[type="range"].slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background-color: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
}

input[type="range"].slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background-color: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

input[type="range"].slider:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.color-picker-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-input {
    width: 40px;
    height: 40px;
    border: 1px solid #374151;
    border-radius: 6px;
    background: none;
    cursor: pointer;
    padding: 2px;
}

.color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-input::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.color-input::-moz-color-swatch {
    border: none;
    border-radius: 4px;
}

.color-swatches {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.swatch {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid #374151;
    cursor: pointer;
    transition: all 150ms ease;
    position: relative;
    overflow: hidden;
}

.swatch:hover {
    border-color: #6b7280;
    transform: scale(1.1);
}

.swatch.active {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.swatch-transparent {
    background-color: transparent;
}

.checkerboard-icon {
    display: block;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(45deg, #666 25%, transparent 25%),
        linear-gradient(-45deg, #666 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #666 75%),
        linear-gradient(-45deg, transparent 75%, #666 75%);
    background-size: 8px 8px;
    background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
}

.text-input {
    background-color: #141414;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
}

.text-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.text-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.text-input::placeholder {
    color: #6b7280;
}

.text-input-sm {
    padding: 8px 12px;
    font-size: 14px;
}

label.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #e5e7eb;
}

label.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 4px;
    position: relative;
    transition: all 150ms ease;
    flex-shrink: 0;
}

label.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

label.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 6px;
    width: 4px;
    height: 8px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.preview-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preview-canvas-wrap {
    position: relative;
    width: 100%;
    background-color: #0a0a0a;
    border: 1px solid #374151;
    border-radius: 8px;
    overflow: hidden;
    background-image:
        linear-gradient(45deg, #1a1a1a 25%, transparent 25%),
        linear-gradient(-45deg, #1a1a1a 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #1a1a1a 75%),
        linear-gradient(-45deg, transparent 75%, #1a1a1a 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

.preview-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: auto;
}

.action-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-hint {
    font-size: 13px;
    color: #f59e0b;
    text-align: center;
}

.button-primary {
    background-color: #3b82f6;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: background-color 150ms ease;
    text-align: center;
}

.button-large {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
}

.button-secondary {
    background-color: #1a1a1a;
    color: #e5e7eb;
    border: 1px solid #374151;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 150ms ease;
    text-align: center;
}

.button-download {
    background-color: #059669;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: background-color 150ms ease;
    text-align: center;
    width: 100%;
}

.output-section {
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.output-header h3 {
    font-size: 22px;
    font-weight: 600;
    line-height: 28px;
    color: #d1d5db;
}

.result-preview {
    background-color: #0a0a0a;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.result-preview img {
    max-width: 100%;
    max-height: 480px;
    object-fit: contain;
    border-radius: 4px;
}

.result-info {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
    padding: 12px;
    background-color: #1a1a1a;
    border-radius: 6px;
    flex: 1;
    min-width: 100px;
}

.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
    color: #e5e7eb;
}

.download-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.create-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 32px;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #374151;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    font-size: 14px;
    color: #9ca3af;
}

.progress-bar {
    width: 100%;
    max-width: 300px;
    height: 4px;
    background-color: #374151;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #3b82f6;
    border-radius: 2px;
    width: 0%;
    transition: width 200ms ease;
}

.pro-cta-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.pro-cta-text {
    font-size: 14px;
    color: #d1d5db;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 24px;
}

.modal-overlay.modal-hidden {
    display: none;
}

.modal-overlay.modal-visible {
    display: flex;
}

.modal {
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 0;
    max-width: 480px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 24px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 22px;
    font-weight: 600;
    color: #ffffff;
}

.modal-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #e5e7eb;
}

.modal-content {
    padding: 24px;
}

.modal-feature-label {
    font-size: 15px;
    color: #f59e0b;
    font-weight: 500;
    margin-bottom: 20px;
}

.pro-features-list {
    margin-bottom: 24px;
}

.pro-feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}

.feature-check {
    width: 20px;
    height: 20px;
    background-color: #059669;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.feature-text {
    font-size: 15px;
    color: #e5e7eb;
}

.modal-cta {
    width: 100%;
    display: block;
}

.error-message {
    background-color: #7f1d1d;
    border: 1px solid #dc2626;
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
}

.success-message {
    background-color: #064e3b;
    border: 1px solid #059669;
    color: #6ee7b7;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
}

.footer {
    background-color: #0a0a0a;
    border-top: 1px solid #374151;
    padding: 32px 24px;
    text-align: center;
    margin-top: auto;
}

.footer p {
    font-size: 14px;
    color: #6b7280;
}

.modal-hidden {
    display: none;
}

@media (max-width: 768px) {
        padding: 32px 16px;
    }

        font-size: 28px;
        line-height: 36px;
    }

        font-size: 14px;
    }

    .tool-main {
        padding: 24px 16px 100px;
    }

    .tool-container {
        gap: 32px;
    }

    .settings-group {
        padding: 16px;
    }

    .output-section {
        padding: 16px;
    }

    .template-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .template-preview {
        width: 48px;
        height: 48px;
    }

    .preset-buttons {
        gap: 6px;
    }

    .preset-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .file-upload-zone {
        padding: 32px 16px;
    }

    .thumbnail-item {
        width: 64px;
    }

    .thumbnail-img {
        width: 64px;
        height: 64px;
    }

    .pro-cta-content {
        flex-direction: column;
        gap: 10px;
    }

        padding: 0 16px;
    }

    .button-primary,
    .button-secondary {
        width: 100%;
    }

    .stat-item {
        min-width: 80px;
    }

    .stat-value {
        font-size: 14px;
    }

    .segmented-control {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .template-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .result-info {
        flex-direction: column;
    }

    .custom-size-inputs {
        flex-direction: column;
        align-items: stretch;
    }

    .size-separator {
        text-align: center;
        padding-bottom: 0;
    }

    .color-swatches {
        gap: 6px;
    }

    .swatch {
        width: 28px;
        height: 28px;
    }
}