/* Panels */
.panel {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.panel h2 {
    font-size: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border-light);
}

/* Form fields */
.field { margin-bottom: 1rem; }

.field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.field input[type="text"],
.field input[type="number"],
.field select {
    width: 100%;
    padding: 0.5rem 0.7rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.field input:focus, .field select:focus {
    outline: none;
    border-color: var(--color-accent);
}

.field input[type="range"] { width: 100%; cursor: pointer; }

.field input[type="color"] {
    width: 100%;
    height: 36px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
    padding: 2px;
}

.field textarea {
    width: 100%;
    padding: 0.5rem 0.7rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}

.field textarea:focus {
    outline: none;
    border-color: var(--color-accent);
}

.field-hint {
    display: block;
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.25rem;
}

/* Range row */
.range-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.range-row input[type="range"] { flex: 1; }

.range-value {
    min-width: 3ch;
    text-align: right;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-accent);
}

/* Upload zone */
.upload-zone {
    border: 2.5px dashed #ccc;
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    position: relative;
}

.upload-zone:hover, .upload-zone.drag-over {
    border-color: var(--color-accent);
    background: #f0f0ff;
}

.upload-zone input[type="file"] { display: none; }
.upload-zone .icon { font-size: 2.5rem; margin-bottom: 0.5rem; display: block; }
.upload-zone .text { font-size: 0.9rem; color: var(--color-text-dim); }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--color-accent);
    color: white;
    width: 100%;
    margin-top: 0.5rem;
}

.btn-primary:hover { background: var(--color-accent-hover); }
.btn-primary:disabled { background: #bbb; cursor: not-allowed; }

.btn-secondary {
    background: var(--color-accent);
    color: white;
    width: 100%;
}

.btn-secondary:hover { background: var(--color-accent-hover); }
.btn-secondary:disabled { background: #bbb; cursor: not-allowed; }

.btn-download {
    background: var(--color-success);
    color: white;
    margin-top: 1rem;
}

.btn-download:hover { background: var(--color-success-hover); }

.btn-danger {
    background: var(--color-danger);
    color: white;
}

.btn-danger:hover { background: #b71c1c; }

.btn-outline {
    background: transparent;
    color: var(--color-accent);
    border: 1.5px solid var(--color-accent);
}

.btn-outline:hover { background: #f0f0ff; }

/* Preview area */
.preview-area {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.canvas-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
    background: repeating-conic-gradient(#e0e0e0 0% 25%, white 0% 50%) 50% / 16px 16px;
    border-radius: 8px;
    overflow: hidden;
}

.preview-area img {
    display: block;
    max-width: 100%;
    max-height: 70vh;
}

.placeholder-msg {
    padding: 4rem 2rem;
    text-align: center;
    color: #aaa;
    font-size: 0.95rem;
}

/* Panel description */
.panel-desc {
    font-size: 0.82rem;
    color: #777;
    margin: -0.5rem 0 1rem;
    line-height: 1.4;
}

/* Capacity info */
.capacity-info {
    font-size: 0.8rem;
    color: var(--color-text-dim);
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: #f8f8f8;
    border-radius: var(--radius);
}

/* Pros / Cons */
.pros-cons {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.78rem;
    line-height: 1.5;
    border: 1px solid var(--color-border-light);
}

.pros-cons summary {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    cursor: pointer;
    user-select: none;
}

.pros-cons ul { list-style: none; margin: 0.4rem 0 0; padding: 0; }

.pros-cons li {
    padding: 0.15rem 0;
    padding-left: 1.2em;
    text-indent: -1.2em;
}

.pros-cons li::before {
    display: inline-block;
    width: 1.2em;
    text-indent: 0;
}

.pros-cons .pro::before { content: "+"; color: var(--color-success); font-weight: 700; }
.pros-cons .con::before { content: "\2013"; color: var(--color-danger); font-weight: 700; }

/* Decode result */
.decode-result {
    margin-top: 1rem;
    padding: 1rem;
    background: #f0f4f0;
    border-radius: 8px;
    border: 1.5px solid #c8e6c9;
}

.decode-result h3 {
    font-size: 0.85rem;
    color: var(--color-success);
    margin-bottom: 0.5rem;
}

.decode-result pre {
    font-size: 0.82rem;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--color-text);
    margin: 0;
}
