body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background-color: #f0f2f5;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
  box-sizing: border-box;
}
.main-layout-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
  width: 750px;
}
.app-wrapper {
  background: white;
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  display: flex;
  overflow: hidden;
}
.control-panel {
  flex: 1;
  padding: 25px;
  border-right: 1px solid #eef0f3;
}
.canvas-panel {
  flex: 1;
  background-color: #f8f9fa;
  padding: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
h2 {
  margin-top: 0;
  color: #2c3e50;
  font-size: 22px;
}
h3 {
  font-size: 15px;
  color: #64748b;
  margin-bottom: 20px;
  margin-top: 0;
}
.tabs {
  display: flex;
  gap: 5px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 6px;
  margin-bottom: 20px;
}
.tab-btn {
  flex: 1;
  padding: 8px;
  font-size: 13px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
  color: #627d98;
  font-weight: 500;
}
.tab-btn.active {
  background: white;
  color: #0f172a;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.mode-view {
  display: none;
}
.mode-view.active {
  display: block;
}
.input-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
input[type="text"] {
  padding: 12px;
  font-size: 15px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
}
.button-row {
  display: flex;
  gap: 8px;
}
button {
  flex: 1;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  background-color: #2563eb;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
button:hover {
  background-color: #1d4ed8;
}
button.btn-secondary {
  background-color: #475569;
}
button.btn-secondary:hover {
  background-color: #334155;
}
.designer-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}
.designer-controls label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
}
select {
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  font-size: 14px;
}
.color-pickers {
  display: flex;
  gap: 10px;
}
input[type="color"] {
  flex: 1;
  height: 40px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  padding: 2px;
}
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.checkbox-group label {
  text-transform: none;
  font-weight: 500;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.flag-svg {
  border: 1px solid #cbd5e1;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  background: #ffffff;
}
/* History Gallery Panel Adjustments */
.history-gallery-panel {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  text-align: left;
}
.history-gallery-panel h3 {
  color: #334155;
  font-size: 16px;
  font-weight: 600;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 10px;
  margin-bottom: 15px;
}
.history-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}
.history-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.history-thumbnail-svg {
  width: 100%;
  aspect-ratio: 3/2;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.card-caption {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: capitalize;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.history-card-form {
  margin: 0;
  padding: 0;
  display: block;
}
.history-card-btn {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100%;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.history-card-btn:hover .history-thumbnail-svg {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.12);
  border-color: #2563eb;
}
.history-thumbnail-svg {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
