:root {
    --line: #4a4a4a;
    --accent: #2c7be5;
    --grid: #e9e9e9;
    --muted: #9aa0a6;
    --ink: #333;
    --bg-light: #f7f9fc;
    --border-color: #e1e4e8;
}

body {
   
    font-weight: 700;
    font-size: 11.6px;
    color: var(--ink);
    margin: 0;
    background: var(--bg-light);
}

.wrap {
    max-width: 1400px;
    margin: 20px auto;
    padding: 20px;
}

.toolbar {
    display: flex;
    gap: 24px;
    align-items: center;
    margin-bottom: 24px;
    background: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.main-container {
    display: flex;
    gap: 24px;
    align-items: stretch;
}

@media (max-width: 900px) {
    .main-container {
        flex-direction: column;
    }
}

.main-view {
    flex: 1 1 65%;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.side-views {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 24px;
    flex: 1 1 35%;
}

@media (max-width: 900px) {
    .side-views {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        width: 100%;
    }
}

.card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.card > .hd {
    padding: 4px 6px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 11.6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card > .bd {
    padding: 4px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.photo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
}

.photo-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

svg {
    width: 100%;
    height: 100%;
    display: block;
}

.dim-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.dim-input {
    border: 1px solid var(--accent);
    border-radius: 6px;
    padding: 2px;
    width: 52px;
    height: 18px;
    text-align: center;
    font-size: 6.8px;
    font-weight: 700;
    color: var(--ink);
    background: white;
    transition: all 0.2s ease;
}

.dim-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(44, 123, 229, 0.2);
}

.calc-result {
    font-size: 0.6em;
    font-weight: 600;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 2px 4px;
    border-radius: 5px;
    z-index: 10;
}

.quantity-container {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.card.main-view .bd svg {
    height: 500px;
}

.card.side-card .bd svg {
    height: 220px;
}

.card.side-card .bd {
    padding: 0;
}

.card.side-card .dim-input {
    font-size: 6.4px;
	font-weight: 700;
}

.shape-hidden {
    display: none;
}

.dimension-line {
    stroke: #2c7be5;
    stroke-width: 1.5;
    stroke-dasharray: 5, 3;
}

.red-dimension {
    stroke: #e74c3c;
    stroke-width: 1;
    stroke-dasharray: 6, 2;
}

.dimension-text {
    font-family: Arial, sans-serif;
    font-size: 12px;
    fill: #333;
    font-weight: 500;
}

.red-text {
    fill: #e74c3c;
    font-weight: bold;
}

.shape {
    fill: none;
    stroke: #333;
    stroke-width: 3;
    stroke-linejoin: round;
}

.shape-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.shape-button {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 5px;
    transition: all 0.3s ease;
}

.shape-button:hover {
    background-color: #f0f0f0;
}

.shape-button.active {
    border-color: var(--accent);
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

.shape-button img {
    width: 100px;
    height: auto;
    display: block;
}