.cb-card { padding: 28px; }
.cb-title-bar { background: linear-gradient(135deg, var(--site-dark) 0%, var(--site-dark-2) 100%); border-radius: 10px 10px 0 0; padding: 18px 24px; margin: -28px -28px 24px; }
.cb-title-bar h1 { color: #fff; margin: 0; font-size: 1.4em; text-align: center; }

/* ===== Tabs ===== */
.cb-tabs { display: flex; gap: 4px; border-bottom: 1px solid #eee; margin-bottom: 22px; flex-wrap: wrap; }
.cb-tab-btn { background: none; border: none; border-bottom: 2px solid transparent; padding: 10px 18px; font-weight: 600; font-size: .9em; color: #6b7280; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.cb-tab-btn:hover { color: var(--site-dark); }
.cb-tab-btn.active { color: var(--site-dark); border-bottom-color: var(--site-dark); }
.cb-panel.hide { display: none; }

/* ===== Layout grid: controls + preview ===== */
.cb-builder-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-bottom: 20px; align-items: start; }
.cb-controls { display: flex; flex-direction: column; gap: 16px; }
.cb-control-row { display: flex; flex-direction: column; gap: 6px; }
.cb-control-row label { font-weight: 600; font-size: .88em; display: flex; align-items: center; justify-content: space-between; }
.cb-control-row select, .cb-control-row input[type="text"] { border: 1px solid #ddd; border-radius: 8px; padding: 8px 12px; font-size: .9em; }
.cb-control-row input[type="range"] { width: 100%; accent-color: var(--site-light); }
.cb-value { font-family: "Courier New", monospace; font-weight: 700; color: var(--site-dark); background: #fdf4ff; border-radius: 20px; padding: 2px 10px; font-size: .82em; }

.cb-control-row-inline { flex-direction: row; align-items: center; gap: 16px; flex-wrap: wrap; }
.cb-control-row-inline label { font-weight: 600; font-size: .88em; }
.cb-checkbox-label, .cb-radio-label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 600; font-size: .88em; }
.cb-checkbox-label input, .cb-radio-label input { accent-color: var(--site-light); width: 16px; height: 16px; }
.cb-unit-label { font-weight: 600; font-size: .88em; margin-left: auto; }

input[type="color"] { width: 44px; height: 34px; border: 1px solid #ddd; border-radius: 8px; padding: 2px; cursor: pointer; background: #fff; }

/* ===== Preview boxes ===== */
.cb-preview-wrap { display: flex; align-items: center; justify-content: center; min-height: 200px; background: repeating-conic-gradient(#f3f4f6 0% 25%, #fff 0% 50%) 50% / 20px 20px; border-radius: 10px; border: 1px solid #eee; padding: 24px; }
.cb-preview-box { width: 140px; height: 140px; background: #fff; border-radius: 10px; }
.cb-shadow-preview-box { background: #fff; }
.cb-gradient-preview-box { width: 220px; height: 140px; }
.cb-radius-preview-box { background: linear-gradient(135deg, var(--site-light), #f0abfc); }

/* ===== Gradient stops ===== */
.cb-stops { display: flex; flex-direction: column; gap: 10px; }
.cb-stop-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: center; }
.cb-stop-row input[type="number"] { width: 64px; border: 1px solid #ddd; border-radius: 8px; padding: 7px 8px; font-size: .88em; }
.cb-stop-remove-btn { background: none; border: 1px solid #eee; border-radius: 8px; padding: 7px 10px; color: var(--site-danger); cursor: pointer; }
.cb-stop-remove-btn:hover { background: var(--site-danger-bg); border-color: var(--site-danger-border); }
.cb-add-btn { align-self: flex-start; background: none; border: 1px dashed #ccc; border-radius: 20px; padding: 7px 16px; font-size: .85em; font-weight: 600; color: var(--site-dark); cursor: pointer; }
.cb-add-btn:hover { background: #f0fdfa; border-color: var(--site-light); }

/* ===== Flexbox playground ===== */
.cb-flex-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 18px; }
.cb-flex-preview-box { display: flex; gap: 10px; min-height: 200px; background: repeating-conic-gradient(#f3f4f6 0% 25%, #fff 0% 50%) 50% / 20px 20px; border-radius: 10px; border: 1px solid #eee; padding: 16px; box-sizing: border-box; }
.cb-flex-item { background: linear-gradient(135deg, var(--site-light), #86198f); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; border-radius: 8px; min-width: 46px; min-height: 46px; padding: 14px; box-sizing: border-box; }

.cb-flex-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 18px 0; }
.cb-flex-item-controls { border: 1px solid #eee; border-radius: 10px; padding: 12px 14px; background: #fafbfc; }
.cb-flex-item-controls h4 { margin: 0 0 8px; font-size: .85em; color: var(--site-dark); }
.cb-flex-item-field { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.cb-flex-item-field label { font-size: .8em; color: #6b7280; font-weight: 600; }
.cb-flex-item-field input { width: 70px; border: 1px solid #ddd; border-radius: 6px; padding: 5px 7px; font-size: .85em; }

/* ===== Border radius grid ===== */
.cb-radius-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ===== Output row ===== */
.cb-output-row { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.cb-output { flex: 1 1 300px; margin: 0; background: #1e1e2e; color: #f5f5f7; border-radius: 10px; padding: 14px 16px; font-family: "Courier New", monospace; font-size: .87em; line-height: 1.6; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
.cb-copy-btn { display: inline-flex; align-items: center; gap: 8px; border: none; border-radius: 20px; padding: 9px 20px; font-weight: 700; font-size: .88em; cursor: pointer; background: var(--site-light); color: #fff; transition: background .2s ease; flex: 0 0 auto; }
.cb-copy-btn:hover { background: var(--site-dark); }
.cb-copy-btn.cb-copied { background: var(--site-success); }

@media (max-width: 760px) {
    .cb-builder-grid { grid-template-columns: 1fr; }
    .cb-radius-grid { grid-template-columns: 1fr; }
    .cb-preview-wrap { min-height: 160px; }
    .cb-stop-row { grid-template-columns: auto 1fr auto; }
    .cb-stop-row input[type="number"] { grid-column: 1 / -1; width: 100%; }
}
