@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Space+Grotesk:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background: #e9e5dd;
    color: #202629;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #162f32;
    color: #f7f3ea;
    padding: 1.2rem 1.7rem;
}

header h1 {
    font-size: 1.45rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.eyebrow { font: 500 0.66rem 'DM Mono', monospace; letter-spacing: 0.12em; color: #c6c1b6; margin-bottom: 0.35rem; }
.header-actions { display: flex; gap: 0.55rem; }
.file-button { position: relative; overflow: hidden; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.toolbar {
    align-items: center;
    background: #f7f3ea;
    padding: 0.7rem 1.7rem;
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid #d5d0c5;
}

.btn {
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: transform 0.18s ease, background 0.18s ease;
    font-weight: 500;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.btn-primary {
    background-color: #ef6a4f;
    color: #fffaf1;
}

.btn-primary:hover { background-color: #d95840; }

.btn-secondary {
    background-color: transparent;
    border-color: #c9c3b7;
    color: #263c3e;
}

.btn-secondary:hover { background-color: #e8e1d6; }

.btn-danger {
    background-color: #bd4b3e;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-success {
    background-color: #2f7770;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 315px;
    background-color: #f7f3ea;
    padding: 1.5rem;
    border-right: 1px solid #d5d0c5;
    overflow-y: auto;
}

.sidebar h3 {
    margin-bottom: 1rem;
    color: #162f32;
    font-size: 1.1rem;
}

#properties {
    color: #657174;
}
.panel-heading { border-bottom: 1px solid #d5d0c5; padding-bottom: 1rem; margin-bottom: 1rem; }
.panel-heading .eyebrow { color: #9a958c; }

.property-group {
    margin-bottom: 1.5rem;
}

.property-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #34494a;
}

.property-group input[type="text"],
.property-group input[type="number"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #c9c3b7;
    border-radius: 3px;
    background: #fffdf8;
    font-size: 0.9rem;
}

.property-group input[type="checkbox"] {
    margin-right: 0.5rem;
}

.property-group button {
    margin-top: 0.5rem;
}

.attribute-list {
    list-style: none;
    margin-top: 0.5rem;
}

.attribute-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background-color: #eae5da;
    margin-bottom: 0.5rem;
    border-radius: 3px;
    gap: 0.4rem;
}

.attribute-item button {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}
.attribute-name {
    min-width: 0;
    flex: 1;
    padding: 0.35rem;
    border: 1px solid #c9c3b7;
    border-radius: 3px;
    background: #fffdf8;
    font: 0.82rem 'Space Grotesk', sans-serif;
}

.canvas-container {
    flex: 1;
    background-color: #dcd8cf;
    position: relative;
    overflow: auto;
}

#erCanvas {
    display: block;
    cursor: default;
    background-color: #fffdf8;
    background-image: radial-gradient(#c8c2b7 0.8px, transparent 0.8px);
    background-size: 20px 20px;
    margin: 1.2rem;
    box-shadow: 0 5px 18px rgba(31, 38, 39, 0.08);
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}
.btn-quiet { background: transparent; border-color: rgba(247,243,234,0.35); color: inherit; }
.toolbar-divider { width: 1px; height: 26px; background: #d5d0c5; margin: 0 0.2rem; }
.mode-hint { margin-left: auto; color: #78807d; font: 0.72rem 'DM Mono', monospace; }
.canvas-size-label { display: inline-flex; align-items: center; gap: 0.35rem; color: #526160; font: 0.72rem 'DM Mono', monospace; }
.canvas-size-label input, .canvas-size-input { width: 72px; padding: 0.4rem; border: 1px solid #c9c3b7; border-radius: 3px; background: #fffdf8; font: 0.78rem 'DM Mono', monospace; color: #263c3e; }
.canvas-size-input { width: 68px; }
.property-note { font-size: 0.78rem; line-height: 1.45; color: #78807d; }
.inline-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
select { width: 100%; padding: 0.5rem; border: 1px solid #c9c3b7; border-radius: 3px; background: #fffdf8; font: inherit; }
@media (max-width: 760px) {
    header { align-items: flex-start; gap: 1rem; flex-direction: column; }
    .header-actions { width: 100%; }
    .toolbar { flex-wrap: wrap; padding: 0.7rem 1rem; }
    .mode-hint { width: 100%; margin-left: 0; }
    .main-content { flex-direction: column-reverse; overflow: auto; }
    .sidebar { width: 100%; max-height: 42vh; border-right: 0; border-top: 1px solid #d5d0c5; }
    .canvas-container { min-height: 58vh; }
}
