:root {
    --bg: #0f172a;
    --surface: #111827;
    --surface-strong: #1f2937;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --accent: #38bdf8;
    --accent-strong: #0ea5e9;
    --success: #22c55e;
    --border: rgba(148, 163, 184, 0.18);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top, rgba(56, 189, 248, 0.12), transparent 30%),
      linear-gradient(180deg, #020617 0%, #0b1222 100%);
    color: var(--text);
    font-family: "Segoe UI", Arial, sans-serif;
}

button, input, select, textarea {
    font: inherit;
}

.app-shell {
    padding-bottom: 2rem;
}

.app-header {
    padding-top: 2.5rem;
    padding-bottom: 1.5rem;
    color: var(--text);
}

h1 {
    font-size: clamp(2rem, 2.6vw, 3rem);
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

.lead {
    color: white;
}

.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 0.85rem;
    background: rgba(56, 189, 248, 0.16);
    color: var(--accent);
    border-radius: 999px;
    font-size: 0.82rem;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.control-panel, .canvas-panel, .summary-panel {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.86));
    border: 1px solid var(--border);
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    overflow: hidden;
}

.card {
    background: transparent;
    border: none;
}

.canvas-panel .card-body {
    overflow: hidden;
    border-radius: 12px;
}

.canvas-toolbar {
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.canvas-holder {
    width: 100%;
}

#slabCanvas {
    display: block;
    width: 100%;
    height: 680px;
    border-radius: inherit;
    overflow: hidden;
    background: rgba(8, 8, 8, 0.9);
    border: 1px solid white;
}

.canvas-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin: 1rem 1.5rem 1.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    font-size: 0.95rem;
}

.legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    display: inline-block;
}

.legend-swatch.top {
    background: #f59e0b;
}

.legend-swatch.bottom {
    background: #ef4444;
}

.card-body {
    padding: 1.6rem;
}

.section-title {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: white;
}

.form-label {
    color: white;
}

.form-control, .form-select, textarea {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.12);
    color: var(--text);
}

.form-control:focus, .form-select:focus, textarea:focus {
    border-color: rgba(56, 189, 248, 0.6);
    box-shadow: 0 0 0 0.15rem rgba(56, 189, 248, 0.12);
}

.summary-output {
    display: grid;
    gap: 0.9rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.6);
    padding: 0.9rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.08);
    color:white;
}

.summary-row span {
    color: var(--muted);
    font-size: 0.95rem;
    color:white;
}

.summary-row strong {
    color: var(--text);
    font-weight: 700;
}

.canvas-toolbar {
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}



#slabCanvas {
    max-width: 100%;
    width: 100%;
    height: 680px; /* base height for desktop/tablet */
    border-radius: 24px;
    background: rgba(8, 8, 8, 0.9);
    border: 1px solid white;
    padding-right: 5px;    
}

@media (max-width: 1199px) {
    .app-header, .card-body {
        padding-left: 1.1rem;
        padding-right: 1.1rem;
        
    }
}

@media (max-width: 767px) {
    .canvas-holder {
        padding: 5px;
    }
    .section-title {
        font-size: 1rem;
    }
    #slabCanvas {
        height: 320px; /* smaller height on mobile to avoid overflow */
    }
}

.btn-outline-secondary {
    color: var(--text);
    border-color: rgba(148, 163, 184, 0.18);
}

.btn-outline-secondary:hover {
    color: #fff;
    background: rgba(56, 189, 248, 0.14);
    border-color: rgba(56, 189, 248, 0.3);
}

