.sgtb-wrap {
    --sgtb-accent: #9b2c2c;
    --sgtb-accent-dark: #742020;
    --sgtb-border: #ded7ce;
    --sgtb-surface: #fffdf9;
    max-width: 760px;
    margin: 30px auto;
    padding: clamp(22px, 5vw, 42px);
    border: 1px solid var(--sgtb-border);
    border-radius: 18px;
    background: var(--sgtb-surface);
    box-shadow: 0 14px 38px rgba(48, 36, 24, .09);
    color: #2e2924;
}

.sgtb-heading h2 { margin: 0 0 8px; font-size: clamp(28px, 4vw, 38px); }
.sgtb-heading p { margin: 0 0 28px; color: #625b53; line-height: 1.6; }
.sgtb-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.sgtb-form label > span { display: block; margin-bottom: 7px; font-weight: 650; }
.sgtb-form input:not([type="checkbox"]),
.sgtb-form select,
.sgtb-form textarea {
    width: 100%;
    min-height: 48px;
    box-sizing: border-box;
    border: 1px solid var(--sgtb-border);
    border-radius: 9px;
    background: #fff;
    padding: 10px 12px;
    color: #2e2924;
    font: inherit;
}
.sgtb-form textarea { min-height: 110px; resize: vertical; }
.sgtb-form input:focus, .sgtb-form select:focus, .sgtb-form textarea:focus {
    outline: 3px solid rgba(155, 44, 44, .14);
    border-color: var(--sgtb-accent);
}
.sgtb-full-width { display: block; margin-top: 18px; }
.sgtb-consent { display: flex; align-items: flex-start; gap: 10px; margin: 20px 0; line-height: 1.45; }
.sgtb-consent input { margin-top: 4px; flex: 0 0 auto; }
.sgtb-consent span { font-weight: 400 !important; }
.sgtb-submit {
    appearance: none;
    border: 0;
    border-radius: 999px;
    background: var(--sgtb-accent);
    color: #fff;
    padding: 13px 24px;
    min-height: 48px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}
.sgtb-submit:hover { background: var(--sgtb-accent-dark); transform: translateY(-1px); }
.sgtb-submit:disabled { opacity: .65; cursor: wait; transform: none; }
.sgtb-submit.is-loading::after { content: ' …'; }
.sgtb-message { display: none; margin-top: 18px; padding: 13px 15px; border-radius: 9px; }
.sgtb-message.is-success { display: block; background: #ecf8ee; color: #176129; border: 1px solid #b7dfbe; }
.sgtb-message.is-error { display: block; background: #fff0f0; color: #8b1a1a; border: 1px solid #efb9b9; }
.sgtb-hp { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

.sgtb-table-picker { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--sgtb-border); }
.sgtb-table-picker[hidden] { display: none !important; }
.sgtb-table-picker-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.sgtb-table-picker h3 { margin: 0 0 5px; font-size: 21px; }
.sgtb-table-picker p { margin: 0; color: #625b53; }
.sgtb-legend { display: flex; flex-wrap: wrap; gap: 7px 12px; font-size: 12px; color: #625b53; }
.sgtb-legend span { display: inline-flex; align-items: center; gap: 5px; }
.sgtb-legend i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.sgtb-legend .is-available { background: #55a96a; }
.sgtb-legend .is-unavailable { background: #cc6868; }
.sgtb-legend .is-too-small { background: #a9a9a9; }
.sgtb-legend .is-selected { background: #d49a2c; }
.sgtb-floorplan {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border: 2px solid #cfc5b9;
    border-radius: 14px;
    background-color: #f8f5ef;
    background-image: linear-gradient(rgba(108, 91, 70, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(108, 91, 70, .07) 1px, transparent 1px);
    background-size: 28px 28px;
}
.sgtb-visual-table {
    position: absolute !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 4px !important;
    border: 3px solid rgba(0,0,0,.13) !important;
    box-shadow: 0 4px 9px rgba(34, 27, 20, .14) !important;
    color: #fff !important;
    font: inherit !important;
    line-height: 1.05 !important;
    text-align: center;
    transform: none !important;
    transition: box-shadow .15s ease, border-color .15s ease, filter .15s ease !important;
}
.sgtb-visual-table.shape-round { border-radius: 50% !important; }
.sgtb-visual-table.shape-square { border-radius: 8px !important; }
.sgtb-visual-table.shape-rectangle { border-radius: 10px !important; }
.sgtb-visual-table.status-available { background: #55a96a !important; cursor: pointer !important; }
.sgtb-visual-table.status-unavailable { background: #cc6868 !important; opacity: .78; cursor: not-allowed !important; }
.sgtb-visual-table.status-too-small { background: #9d9d9d !important; opacity: .62; cursor: not-allowed !important; }
.sgtb-visual-table.status-available:hover { filter: brightness(.94); box-shadow: 0 6px 15px rgba(34,27,20,.23) !important; }
.sgtb-visual-table.is-selected { background: #d49a2c !important; border-color: #6d4700 !important; box-shadow: 0 0 0 4px rgba(212,154,44,.23) !important; }
.sgtb-visual-table strong { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(10px, 1.8vw, 14px); }
.sgtb-visual-table small { display: block; margin-top: 3px; font-size: clamp(8px, 1.4vw, 11px); opacity: .94; }
.sgtb-table-help { min-height: 22px; margin-top: 10px !important; font-weight: 650; color: var(--sgtb-accent) !important; }

@media (max-width: 640px) {
    .sgtb-wrap { margin: 16px 0; border-radius: 12px; }
    .sgtb-grid { grid-template-columns: 1fr; gap: 14px; }
    .sgtb-submit { width: 100%; }
    .sgtb-table-picker-heading { display: block; }
    .sgtb-legend { margin-top: 10px; }
}
