body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f4f7fc;
    margin: 0;
    padding: 20px;
}
.container {
    max-width: 1000px;
    margin: auto;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
h1 {
    text-align: center;
    color: #2c3e50;
}
h5 {
    text-align: center;
    color: #2c3e50;
}
.section {
    margin: 25px 0;
    padding: 15px;
    background: #f8faff;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}
.section h2 {
    margin-top: 0;
    font-size: 1.2rem;
    color: #2c3e50;
}
.row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin: 8px 0;
    padding: 8px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.row label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
}
.row input[type="number"] {
    width: 80px;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.row input[type="checkbox"] {
    margin-left: 5px;
}
.remove-btn {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    font-weight: bold;
}
.remove-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}
button[type="button"] {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}
button[type="button"]:hover {
    background: #2980b9;
}
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}
.toolbar button {
    background: #6c757d;
}
.toolbar button:hover {
    background: #5a6268;
}
#calculateBtn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 1.1rem;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
}
#calculateBtn:hover {
    background: #1e8449;
}
#resultArea {
    margin-top: 30px;
}
.summary {
    background: #eaf7f0;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}
.summary p {
    margin: 5px 0;
}
.pattern-card {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}
.pattern-card h3 {
    margin-top: 0;
    color: #2c3e50;
}
.pattern-details {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.9rem;
    margin-bottom: 10px;
}
.pattern-visual {
    display: flex;
    height: 40px;
    border: 1px solid #aaa;
    border-radius: 4px;
    overflow: hidden;
    background: #eee;
    position: relative;
}
.piece {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    white-space: nowrap;
    box-sizing: border-box;
    border-right: 2px solid #333;
}
.waste {
    height: 100%;
    background: #d0d0d0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #555;
    box-sizing: border-box;
}
.scale-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #555;
    margin-top: 4px;
}
.error {
    background: #fde0e0;
    color: #c0392b;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #c0392b;
}
.print-labels-btn {
    background: #9b59b6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 15px;
    transition: background 0.2s;
}
.print-labels-btn:hover {
    background: #8e44ad;
}
@media (max-width: 500px) {
    body {
        padding: 8px;
    }
    h1 {
        font-size: 1.4em;
    }
    .seo-content, .subtitle{
        font-size: 0.8em;
    }
}
@media (max-width: 600px) {
    .row {
        flex-direction: column;
        align-items: stretch;
    }
    .row label {
        flex-wrap: wrap;
    }
    .row input[type="number"] {
        width: 100%;
    }
    .pattern-visual {
        height: 30px;
    }
    .piece {
        font-size: 0.5rem;
    }
}
@media print {
    body { background: white; padding: 10px; }
    .container { box-shadow: none; padding: 10px; }
    .toolbar, #calculateBtn, .remove-btn, button[type="button"], .print-labels-btn { display: none !important; }
    .section { border-left-color: #ccc; }
    .pattern-card { break-inside: avoid; page-break-inside: avoid; }
    .row { box-shadow: none; border: 1px solid #eee; }
    #resultArea { display: block !important; }
    .pattern-visual { height: 30px; }
    .piece { font-size: 0.6rem; text-shadow: none; color: black;}
}