* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #eceeef;
    color: #1d2d3a;
}

/* Header */

header {
    padding: 14px 24px;
    background: #fff;
    border-bottom: 1px solid #d2d6da;
    position: relative;
    min-height: 140px;
}

.logo {
    position: absolute;
    top: 10px;
    right: 20px;
    height: 75px;
    width: auto;
}

h1 {
    margin: 0;
    font-size: 32px;
}

.sub {
    margin-top: 4px;
    color: #5f6973;
    font-size: 17px;
}

/* Layout */

main {
    padding: 20px;
}

.screen {
    display: block;
}

.topbar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    position: sticky;
    top: 0;
    background: #eceeef;
    z-index: 10;
    padding: 8px 0;
}

.topbar h2 {
    margin: 0;
    font-size: 30px;
    flex: 1;
}

.progress {
    font-size: 18px;
    font-weight: bold;
    color: #334;
    background: white;
    border-radius: 5px;
    padding: 10px 14px;
    max-width: 46%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Buttons */

.btn {
    border: 0;
    border-radius: 5px;
    background: #2e7bbd;
    color: white;
    padding: 13px 20px;
    font-size: 18px;
    cursor: pointer;
}

.btn.secondary {
    background: #ff9400;
}

.btn.green {
    background: #6cc24a;
}

.btn.gray {
    background: #637282;
}

/* Content */

.hint {
    font-size: 17px;
    color: #5d6a76;
    margin: 0 0 14px;
}

.grid {
    display: grid;
    gap: 22px;
}

.styleGrid {
    grid-template-columns: repeat(4, minmax(220px, 1fr));
}

.styleCard {
    height: 350px;
    min-height: 350px;
    flex-direction: column;
    font-size: 46px;
    font-weight: bold;
    color: #2d7bbb;
    text-align: center;
}

.styleCard small {
    font-size: 20px;
    color: #5d6a76;
    margin-top: 14px;
}

.card {
    background: white;
    border: 5px solid transparent;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 3px #0002;
    overflow: hidden;
}

.card:hover {
    border-color: #86b7e8;
}

.card.selected {
    border-color: #000;
}

/* Parts */

.partGrid {
    grid-template-columns: repeat(3, minmax(430px, 1fr));
}

.partCard {
    height: 72vh;
    min-height: 660px;
    max-height: 850px;
}

.partCard img {
    width: 97%;
    height: 97%;
    object-fit: contain;
}

/* Notifications */

.notice {
    background: #fff5f5;
    border: 1px solid #ffa8a8;
    color: #7a0b0b;
    padding: 28px;
    border-radius: 10px;
    font-size: 18px;
}

.resultCode {
    font-size: 24px;
    font-weight: bold;
    margin: 0 0 10px;
}

/* Drawing */

.drawingWrap {
    background: #fff;
    border: 3px solid #111;
    padding: 0;
    max-width: 1420px;
    margin: 0 auto;
}

.drawing {
    width: 100%;
    height: auto;
    display: block;
}

.dimH,
.dimV {
    stroke: #0574d9;
    stroke-width: 2;
}

.dimH {
    marker-start: url(#arrowLeft);
    marker-end: url(#arrowRight);
}

.dimV {
    marker-start: url(#arrowUp);
    marker-end: url(#arrowDown);
}

.dimPlain {
    stroke: #0574d9;
    stroke-width: 2;
}

.dimGuide {
    stroke: #0574d9;
    stroke-width: 1.3;
}

.dimText {
    font-size: 34px;
    fill: #000;
    font-family: Arial;
}

.dimText.big {
    font-size: 52px;
}

.dimText.smallSpecial {
    font-size: 24px;
}

.labelText {
    font-size: 29px;
    fill: #000;
    font-family: Arial;
}

.footerText {
    font-family: Arial;
    fill: #111;
}

.hidden {
    display: none !important;
}

/* Measure Editor */

.measureEditor {
    background: #fff;
    border: 1px solid #ccd3da;
    border-radius: 8px;
    padding: 14px 16px;
    margin: 0 auto 14px;
    max-width: 1420px;
    box-shadow: 0 1px 3px #0001;
}

.measureEditor h3 {
    margin: 0 0 6px;
    font-size: 22px;
}

.measureEditor p {
    margin: 0 0 12px;
    color: #5d6a76;
}

.measureGrid {
    display: grid;
    grid-template-columns: repeat(6, minmax(110px, 1fr));
    gap: 10px;
}

.measureGrid label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    font-weight: bold;
}

.measureGrid input {
    width: 100%;
    font-size: 17px;
    padding: 8px 9px;
    border: 1px solid #b6c0ca;
    border-radius: 5px;
}

.measureGrid input:focus {
    outline: 2px solid #7db7ec;
    border-color: #2e7bbd;
}

/* Responsive */

@media (max-width: 1500px) {
    .partGrid {
        grid-template-columns: repeat(2, minmax(430px, 1fr));
    }

    .partCard {
        height: 68vh;
        min-height: 600px;
    }
}

@media (max-width: 1100px) {
    .partGrid {
        grid-template-columns: repeat(1, minmax(300px, 1fr));
    }

    .styleGrid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }

    .partCard {
        height: 52vh;
        min-height: 430px;
    }

    .measureGrid {
        grid-template-columns: repeat(3, minmax(100px, 1fr));
    }
}

/* Print */

@media print {
    @page {
        size: A4 landscape;
        margin: 6mm;
    }

    header,
    .topbar,
    .noPrint,
    .hint {
        display: none !important;
    }

    main {
        padding: 0;
    }

    .drawingWrap {
        border: 0;
        padding: 0;
        max-width: none;
        display: flex;
        justify-content: center;
        align-items: flex-start;
    }

    .drawing {
        width: auto;
        height: 185mm;
        max-width: 277mm;
    }

    body {
        background: white;
    }
}