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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #fafafa;
    min-height: 100vh;
    color: #1a1a1a;
    line-height: 1.5;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 16px;
}

header {
    text-align: center;
    margin-bottom: 16px;
}

header h1 {
    color: #1a1a1a;
    font-size: 1.5em;
    font-weight: 400;
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}

header p {
    color: #666;
    font-size: 0.85em;
    font-weight: 300;
}

.drop-zone {
    border: 1px dashed #d0d0d0;
    border-radius: 4px;
    padding: 32px 16px;
    text-align: center;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 16px;
}

.drop-zone:hover {
    background: #f5f5f5;
    border-color: #999;
}

.drop-zone.dragover {
    background: #f0f0f0;
    border-color: #666;
}

.drop-zone-content {
    pointer-events: none;
}

.upload-icon {
    width: 36px;
    height: 36px;
    margin: 0 auto 8px;
    color: #666;
    opacity: 0.6;
}

.drop-zone p {
    font-size: 0.9em;
    color: #666;
    margin: 4px 0;
    font-weight: 400;
}

.subtext {
    font-size: 0.8em;
    color: #999;
}

.main-content {
    display: grid;
    grid-template-columns: 320px 1fr 1fr;
    gap: 16px;
    align-items: start;
}

@media (max-width: 1400px) {
    .main-content {
        grid-template-columns: 280px 1fr 1fr;
    }
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.controls-panel {
    position: sticky;
    top: 12px;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    padding: 16px;
    background: #fafafa;
    border-radius: 4px;
    border: 1px solid #e1e8ed;
}

.controls-panel h2 {
    color: #1a1a1a;
    margin-bottom: 12px;
    font-size: 1.1em;
    font-weight: 400;
    letter-spacing: -0.2px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e8e8e8;
}

.control-group {
    margin-bottom: 16px;
    padding-bottom: 12px;
}

.control-group:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.control-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 400;
    color: #333;
    font-size: 0.85em;
}

.control-group select,
.control-group input[type="number"] {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #d0d0d0;
    border-radius: 3px;
    font-size: 0.9em;
    transition: border-color 0.2s;
    background: #ffffff;
    color: #1a1a1a;
    font-family: inherit;
}

.control-group select:focus,
.control-group input[type="number"]:focus {
    outline: none;
    border-color: #666;
}

.size-inputs-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.size-input-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.size-input-row .size-input {
    flex: 1;
}

.btn-remove-size {
    width: 28px;
    height: 28px;
    border: 1px solid #d0d0d0;
    background: #ffffff;
    color: #666;
    border-radius: 3px;
    font-size: 1.1em;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    line-height: 1;
}

.btn-remove-size:hover {
    background: #f5f5f5;
    border-color: #999;
    color: #333;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.8em;
}

.mapping-container {
    padding: 0;
}

.mapping-instructions {
    font-size: 0.8em;
    color: #666;
    margin-bottom: 12px;
    font-weight: 300;
}

.mapping-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    margin: 8px 0;
    border-bottom: 1px solid #e8e8e8;
}

.mapping-row:last-child {
    border-bottom: none;
}

.mapping-left {
    flex: 1;
    min-width: 0;
}

.mapping-right {
    flex-shrink: 0;
    width: 130px;
}

.mapping-size-label {
    font-weight: 500;
    color: #1a1a1a;
    font-size: 0.9em;
    margin-bottom: 6px;
    letter-spacing: -0.1px;
}

.mapping-text-details {
    margin-top: 4px;
}

.text-details-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.text-detail-item {
    font-size: 0.8em;
    color: #666;
    padding: 6px 8px;
    background: #fafafa;
    border-radius: 3px;
    border-left: 2px solid #d0d0d0;
}

.text-preview {
    font-weight: 400;
    color: #1a1a1a;
    display: block;
    margin-bottom: 2px;
}

.text-props {
    font-size: 0.85em;
    color: #999;
    display: block;
}

.mapping-select-container {
    margin-top: 4px;
}

.size-mapping-select {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #d0d0d0;
    border-radius: 3px;
    font-size: 0.85em;
    background: #ffffff;
    cursor: pointer;
    transition: border-color 0.2s;
    color: #1a1a1a;
    font-family: inherit;
    width: 100%;
}

.size-mapping-select:focus {
    outline: none;
    border-color: #666;
}

.mapping-info {
    padding: 12px;
    border-radius: 3px;
    border: 1px solid #e8e8e8;
    font-size: 0.8em;
    color: #666;
}

.button-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e8e8e8;
}

.btn {
    padding: 8px 16px;
    border: 1px solid #d0d0d0;
    border-radius: 3px;
    font-size: 0.9em;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: #1a1a1a;
    color: #ffffff;
    border-color: #1a1a1a;
}

.btn-primary:hover {
    background: #333;
    border-color: #333;
}

.btn-secondary {
    background: #ffffff;
    color: #1a1a1a;
    border-color: #d0d0d0;
}

.btn-secondary:hover {
    background: #fafafa;
    border-color: #999;
}

.btn-outline {
    background: #ffffff;
    color: #666;
    border-color: #d0d0d0;
}

.btn-outline:hover {
    background: #fafafa;
    border-color: #999;
    color: #333;
}

.preview-section {
    position: sticky;
    top: 12px;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
}

.preview-section h2 {
    color: #1a1a1a;
    font-size: 1.1em;
    font-weight: 400;
    letter-spacing: -0.2px;
    padding-bottom: 8px;
}

.preview-box {
    padding: 0;
}

.preview-box {
    width: 100%;
    margin-bottom: 12px;
}

.preview-actions {
    margin-top: 12px;
}

.preview-actions .btn-full-width {
    width: 100%;
}

.preview-box > div {
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 3px;
    padding: 12px;
    min-height: 200px;
    max-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    isolation: isolate;
}

#originalPreview {
    isolation: isolate;
}

#originalPreview svg {
    isolation: isolate;
}

.preview-box svg {
    max-width: 100%;
    height: auto;
}

.info-panel {
    padding: 16px;
    border: 1px solid #e8e8e8;
}

.info-panel h2 {
    color: #1a1a1a;
    margin-bottom: 12px;
    font-size: 1.1em;
    font-weight: 400;
    letter-spacing: -0.2px;
}

#textInfo {
    padding: 12px;
    border-radius: 3px;
    border: 1px solid #e8e8e8;
    max-height: 300px;
    overflow-y: auto;
}

.text-item {
    padding: 8px;
    margin: 4px 0;
    border-left: 2px solid #d0d0d0;
    background: #fafafa;
    font-size: 0.8em;
}

.text-item strong {
    color: #1a1a1a;
    font-weight: 500;
}
