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

:root {
    --stone-bg: #D6CCBC;
    --stone-border: #B0A494;
    --stone-dark: #C8BEAE;
    --accent: #7C6A52;
    --text: #2C2420;
    --text-light: #8A7A6A;
    --bg: #F5F1EB;
    --panel-bg: #FDFAF6;
    --btn-add-bg: #2C2420;
    --btn-add-text: #F5F1EB;
    --tag-bg: #EDE8DF;
    --tag-on: #7C6A52;
    --notif-bg: #2C2420;
    --radius: 10px;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.page {
    max-width: 860px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}

/* Header */
.header {
    margin-bottom: 40px;
}
.eyebrow {
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 8px;
}
h1 {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(32px, 5vw, 48px);
    line-height: 1.1;
    color: var(--text);
}
h1 em { font-style: italic; color: var(--accent); }

/* Add button */
.add-btn-container {
    margin-bottom: 28px;
}
.add-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    background: var(--btn-add-bg);
    color: var(--btn-add-text);
    border: none;
    border-radius: 100px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity .15s, transform .15s;
}
.add-btn:hover { opacity: .85; transform: translateY(-1px); }
.add-btn:active { transform: translateY(0); }
.add-btn .plus-icon {
    width: 18px; height: 18px;
    background: rgba(255,255,255,.18);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; line-height: 1;
}

/* Stone counter */
.stone-count {
    display: inline-block;
    font-size: 12px;
    color: var(--text-light);
    margin-left: 14px;
    transition: opacity .3s;
}

/* Liste */
#liste-pierres {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Stone instance */
.stone-instance {
    background: var(--panel-bg);
    border: 1px solid #E8E0D4;
    border-radius: var(--radius);
    overflow: hidden;
    animation: slideIn .28s cubic-bezier(.22,.8,.36,1) both;
}
.stone-instance.removing {
    animation: slideOut .22s ease forwards;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
    to   { opacity: 1; transform: none; }
}
@keyframes slideOut {
    to { opacity: 0; transform: translateY(-8px) scale(.97); max-height: 0; padding: 0; margin: 0; }
}

/* Layout intérieur */
.layout {
    display: grid;
    grid-template-columns: 1fr 260px;
}
@media (max-width: 620px) {
    .layout { grid-template-columns: 1fr; }
}

/* Canvas */
.canvas-wrap {
    padding: 20px;
    border-right: 1px solid #EDE8DF;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.canvas-stage svg {
    width: 100%;
    height: auto;
    display: block;
}
.dim-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 8px;
    fill: #A09880;
}

/* Tags */
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tag {
    padding: 3px 10px;
    background: var(--tag-bg);
    border-radius: 100px;
    font-size: 11px;
    color: var(--text-light);
    font-weight: 500;
}
.tag.on {
    background: var(--tag-on);
    color: #fff;
}

/* Panel */
.panel {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.panel-section { display: flex; flex-direction: column; gap: 10px; }
.sec-label {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-light);
}

/* Dimensions */
.dim-inputs { display: flex; gap: 10px; }
.input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.input-group label {
    font-size: 11px;
    color: var(--text-light);
}
.input-group input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #DDD6CA;
    border-radius: 6px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    background: #fff;
    color: var(--text);
    outline: none;
    transition: border-color .15s;
}
.input-group input:focus { border-color: var(--accent); }

/* Finitions */
.fin-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.fin-btn {
    display: grid;
    grid-template-columns: 20px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid #E0D9CF;
    border-radius: 7px;
    background: transparent;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: background .13s, border-color .13s;
    text-align: left;
}
.fin-btn:hover { background: #F0EBE3; }
.fin-btn.on {
    background: #EDE4D8;
    border-color: var(--accent);
}
.fin-indicator {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #CCC4B8;
    transition: background .15s;
}
.fin-btn.on .fin-indicator { background: var(--accent); }
.fin-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}
.fin-desc {
    font-size: 11px;
    color: var(--text-light);
}

/* Description dynamique */
.desc-text {
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.5;
    min-height: 36px;
}

/* Delete */
.delete-btn {
    width: 100%;
    padding: 8px;
    border: 1px solid #E8DDD3;
    border-radius: 6px;
    background: transparent;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    color: #A09080;
    cursor: pointer;
    transition: background .13s, color .13s, border-color .13s;
}
.delete-btn:hover {
    background: #FBF0EC;
    border-color: #E0A898;
    color: #C05A40;
}

/* Notifications */
#notif-container {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    z-index: 100;
}
.notif {
    padding: 9px 20px;
    background: var(--notif-bg);
    color: #F5F1EB;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    animation: notifIn .2s ease both, notifOut .3s ease 2.6s both;
}

/* Formulaire client */
.client-form {
    margin-top: 40px;
    padding: 28px;
    background: var(--panel-bg);
    border: 1px solid #E8E0D4;
    border-radius: var(--radius);
}

.client-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 520px) {
    .client-form-grid { grid-template-columns: 1fr; }
}

.client-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.client-field label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-light);
}

.client-field input,
.client-field textarea {
    padding: 9px 12px;
    border: 1px solid #DDD6CA;
    border-radius: 6px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    background: #fff;
    color: var(--text);
    outline: none;
    transition: border-color .15s;
}

.client-field input:focus,
.client-field textarea:focus { border-color: var(--accent); }

.client-field textarea {
    min-height: 100px;
    resize: vertical;
}

@keyframes notifIn  { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform:none; } }
@keyframes notifOut { to   { opacity:0; transform: translateY(4px); } }
